From f7f35d58933bd0968aa7934b5553f40ef7ebc671 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 4 Sep 2020 13:33:30 +0100 Subject: Add code for straight line --- README.md | 1 + src/Main.hs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) 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!" -- cgit