wumpus-tree-0.14.0: Drawing trees




Build a tree within a monad - the monad allows anchor references.



data NodeId a Source

Nodes can be bound with (>>=) or in the do-notation before they are drawn. This is similar to the concept of embedded nodes in TikZ. Bound nodes can be referenced by their anchors e.g. to give them an extra annotation.

This opaque type represents bound nodes and regular nodes that are just drawn and cannot be annotated.


Eq a => Eq (NodeId a) 

runTreeBuild :: (Real u, Floating u, FromPtSize u) => (a -> TreeNode u) -> TreeBuild u (TreeSpec a) -> TreeBuildAns uSource

This is the run function for the TreeBuild monad.

Note the monadic command is type specialized to (TreeSpec a), this is because evaluation in the TreeBuild monad is only significant for producing a Tree (TreeNode u).

regularBuild :: Tree a -> TreeBuild u (TreeSpec a)Source

Turn an ordinary Data.Tree into a regular TreeSpec.

All nodes become regular nodes, no nodes are bound. Thus nodes cannot be annotated etc.

label :: a -> NodeId aSource

Note - this is not in the TreeBuild monad.

annotate :: u ~ DUnit a => NodeId a -> NodeAnno u -> TreeBuild u ()Source

Annotate a node with a NodeAnno.

Note - regular nodes cannot be annotated, a node must be bound to a variable first with nodeId.

Also this function is not so useful now Wumpus-Basic has the decorate, sdecorate, and adecorate functions.

zbranch :: [ZTreeSpec u] -> ZTreeSpec uSource

Default branch - has children.

zleaf :: ZTreeSpec uSource

Default leaf - tree node with no children.