This library provides functions drawing diagrams of trees.
A tree data structure
node : a -> List (Tree a) -> Tree a
Constructs a tree out of a root value and a list of subtrees
( Basics.Float, Basics.Float )
2D coordinate
{ position : Coord -> fmt -> fmt
, compose : Basics.Int -> Basics.Int -> List fmt -> out
, transform : Basics.Int -> Basics.Int -> Coord -> Coord
}
Functions for moving around and composing drawings
a -> fmt
Alias for functions that draw nodes
Coord -> fmt
Alias for functions that draw edges between nodes
draw_ : Drawable fmt out -> TreeLayout -> NodeDrawer a fmt -> EdgeDrawer fmt -> Tree a -> out
Draws the tree using the provided functions for drawings nodes and edges. TreeLayout contains some more options for positioning the tree.
{ orientation : TreeOrientation
, levelHeight : Basics.Int
, siblingDistance : Basics.Int
, subtreeDistance : Basics.Int
, padding : Basics.Int
}
Options to be passed to draw_
for laying out the tree:
subtreeDistance
to produce a clearer distinction between sibling
nodes and non-siblings on the same level of the tree.defaultTreeLayout : TreeLayout
A set of default values that should be modified to create your TreeLayout
Direction of the tree from root to leaves
leftToRight : TreeOrientation
Left-to-right tree orientation
rightToLeft : TreeOrientation
Right-to-left tree orientation
bottomToTop : TreeOrientation
Bottom-to-top tree orientation
topToBottom : TreeOrientation
Top-to-bottom tree orientation