Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
- type ScaleFactors u = ScalingContext u Int u
- uniformSF :: Num u => u -> ScaleFactors u
- scaleFactors :: Num u => u -> u -> ScaleFactors u
- drawScaledTree :: (Real u, Floating u, InterpretUnit u, InnerSpace (Vec2 u)) => ScaleFactors u -> Point2 u -> TreeBuildAns u -> TreeDrawing u
- data TreeDirection
- = TREE_UP
- | TREE_DOWN
- | TREE_LEFT
- | TREE_RIGHT
- drawScaledTreeD :: (Real u, Floating u, InterpretUnit u, InnerSpace (Vec2 u)) => ScaleFactors u -> Point2 u -> TreeDirection -> TreeBuildAns u -> TreeDrawing u
- drawScaledFamilyTree :: (Real u, Floating u, InterpretUnit u, InnerSpace (Vec2 u)) => ScaleFactors u -> Point2 u -> TreeBuildAns u -> TreeDrawing u
- charNode :: (Real u, Floating u, InterpretUnit u) => Char -> TreeNode u
- textNode :: (Real u, Floating u, InterpretUnit u) => String -> TreeNode u
- circleNode :: (Floating u, InterpretUnit u) => RGBi -> a -> TreeNode u
- diskNode :: (Floating u, InterpretUnit u) => RGBi -> a -> TreeNode u
The type of rendered trees
type ScaleFactors u = ScalingContext u Int uSource
Customize the size of the printed tree.
A tree is designed with a height of 1 unit between parent and child nodes.
The y-scaling factor multiplies the unit height, a scaling factor of 30 represents 30 points.
In the horizontal, 1 unit is the smallest possible distance between child nodes.
uniformSF :: Num u => u -> ScaleFactors uSource
Build uniform x- and y-scaling factors, i.e. x == y
.
scaleFactors :: Num u => u -> u -> ScaleFactors uSource
drawScaledTree :: (Real u, Floating u, InterpretUnit u, InnerSpace (Vec2 u)) => ScaleFactors u -> Point2 u -> TreeBuildAns u -> TreeDrawing uSource
data TreeDirection Source
drawScaledTreeD :: (Real u, Floating u, InterpretUnit u, InnerSpace (Vec2 u)) => ScaleFactors u -> Point2 u -> TreeDirection -> TreeBuildAns u -> TreeDrawing uSource
drawScaledFamilyTree :: (Real u, Floating u, InterpretUnit u, InnerSpace (Vec2 u)) => ScaleFactors u -> Point2 u -> TreeBuildAns u -> TreeDrawing uSource
Drawing nodes
charNode :: (Real u, Floating u, InterpretUnit u) => Char -> TreeNode uSource
Render tree nodes with a single character.
Useful for rendering Data.Tree Char
.
textNode :: (Real u, Floating u, InterpretUnit u) => String -> TreeNode uSource
Tree nodes with a text label.
Useful for rendering Data.Tree String
.
Note the width of the label is not accounted for in the design of the tree. Labels with long texts may overlap. Also, only a single line of text is printed - any text after the first newline character will be dropped.
circleNode :: (Floating u, InterpretUnit u) => RGBi -> a -> TreeNode uSource
Tree nodes with a stroked circle.
Suitable for printing the shape of a tree, ignoring the data.