diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-09-04 13:33:30 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2020-09-04 13:33:30 +0100 |
commit | f7f35d58933bd0968aa7934b5553f40ef7ebc671 (patch) | |
tree | 3a9a774127c037f2a92df8f9707afc3594ca960d | |
parent | 765bd4b9f8dcee6b8f6cc70a3b1b23617fdee807 (diff) | |
download | alluvial-hs-f7f35d58933bd0968aa7934b5553f40ef7ebc671.tar.gz alluvial-hs-f7f35d58933bd0968aa7934b5553f40ef7ebc671.zip |
Add code for straight line
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | src/Main.hs | 14 |
2 files changed, 15 insertions, 0 deletions
@@ -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!" |