-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathWestGermanicLanguages.elm
99 lines (88 loc) · 2.23 KB
/
WestGermanicLanguages.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
module WestGermanicLanguages exposing (..)
import Color exposing (..)
import Collage exposing (..)
import Element exposing (..)
import String
import Text
import TreeDiagram exposing (node, Tree, defaultTreeLayout)
import TreeDiagram.Canvas exposing (draw)
-- Tree to draw
westGermanicLanguages =
node
"West Germanic"
[ node
"Ingvaeonic"
[ node
"Old Saxon"
[ node
"Middle Low German"
[ node "Low German" []
]
]
, node
"Anglo-Frisian"
[ node
"Old English"
[ node
"Middle English"
[ node "English" []
]
]
, node
"Old Frisian"
[ node "Frisian" []
]
]
]
, node
"Istvaeonic"
[ node
"Old Dutch"
[ node
"Middle Dutch"
[ node "Dutch" []
, node "Afrikaans" []
]
]
]
, node
"Irminonic"
[ node
"Old High German"
[ node
"Middle High German"
[ node "German" []
]
, node
"Old Yiddish"
[ node "Yiddish" []
]
]
]
]
{-| Represent edges as straight lines
-}
drawEdge : ( Float, Float ) -> Form
drawEdge to =
segment ( 0, 0 ) to |> traced (solid black)
{-| Represent nodes as white textboxes
-}
drawNode : String -> Form
drawNode n =
Text.fromString n
|> centered
|> width 100
|> container 100 50 middle
|> color white
|> toForm
main =
Element.toHtml <|
draw
{ defaultTreeLayout
| siblingDistance = 110
, subtreeDistance = 150
, padding = 80
}
drawNode
drawEdge
westGermanicLanguages