-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6886389
commit c12c5ff
Showing
4 changed files
with
44 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{-# LANGUAGE NoMonomorphismRestriction #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
|
||
import Diagrams.Prelude | ||
import Diagrams.Backend.SVG.CmdLine | ||
|
||
data Step = Step { | ||
originCoordinates :: Point V2 Double, | ||
name :: Double } | ||
|
||
stepName :: Step -> Double | ||
stepName Step { originCoordinates = x, name = y } = y | ||
|
||
stepShape :: Double -> Diagram B | ||
stepShape x = fromOffsets | ||
[V2 0 0, | ||
V2 0 0.5, | ||
V2 0.75 0, | ||
V2 0 (-0.5), | ||
V2 (-0.75) 0] | ||
# showOrigin | ||
# named x | ||
|
||
steps :: [Step] | ||
steps = [ | ||
Step { | ||
originCoordinates = p2 (x, y), | ||
name = x * 10 + y } | ||
| x <- [0 .. 1], | ||
y <- [0 .. 2]] | ||
|
||
connections :: [Step] -> [QDiagram B V2 Double Any -> QDiagram B V2 Double Any] | ||
connections (x1: x2: xn) = | ||
connectOutside (stepName x1) (stepName x2): connections (x2: xn) | ||
connections (x1: []) = [] | ||
connections [] = [] | ||
|
||
main = mainWith $ | ||
position [(x, (stepShape y)) | Step { originCoordinates = x, name = y } <- steps] | ||
# applyAll (connections steps) | ||
# lw veryThin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.