aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-09-04 13:33:30 +0100
committerYann Herklotz <git@yannherklotz.com>2020-09-04 13:33:30 +0100
commitf7f35d58933bd0968aa7934b5553f40ef7ebc671 (patch)
tree3a9a774127c037f2a92df8f9707afc3594ca960d
parent765bd4b9f8dcee6b8f6cc70a3b1b23617fdee807 (diff)
downloadalluvial-hs-f7f35d58933bd0968aa7934b5553f40ef7ebc671.tar.gz
alluvial-hs-f7f35d58933bd0968aa7934b5553f40ef7ebc671.zip
Add code for straight line
-rw-r--r--README.md1
-rw-r--r--src/Main.hs14
2 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index 39aed42..5dada4f 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
# Alluvial
A library for generating alluvial diagrams, currently using a latex and tikz backend.
+
diff --git a/src/Main.hs b/src/Main.hs
index 65ae4a0..505d3f4 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -1,4 +1,18 @@
module Main where
+newtype Ribbon = Ribbon [Bool] Int
+
+newtype RawData = RawData [Ribbon]
+
+newtype Limits = Limits { limitsLow :: Int, limitsHigh :: Int }
+
+drawSegment :: Limits -> Bool -> Bool -> Int -> String
+drawSegment (Limits _ h) True True i =
+ show (i,h) <> " -- " <> show ((fromInteger i + 1.0) / 2.0, h) <> " -- " show (i+1,h)
+
+drawRibbon :: Ribbon -> String
+drawRibbon (Ribbon b i) =
+
+
main :: IO ()
main = putStrLn "Hello, Haskell!"