Module Mlpost.Tree
Create and draw trees
type arrow_style
=
|
Directed
edges are directed and an arrow is drawn at the end of an edge
|
Undirected
edges are undirected and no arrow is drawn
The style of arrows between nodes
type edge_style
=
There are several styles available for edges
val node : ?ls:Num.t -> ?cs:Num.t -> ?arrow_style:arrow_style -> ?edge_style:edge_style -> ?stroke:Color.t -> ?brush:Brush.t -> ?pen:Pen.t -> ?sep:Num.t -> Box.t -> t list -> t
node label children
creates a node with labellabel
and a list of childrenchildren
. Default arrow_style isDirected
. Default edge_style isStraight
.ls
(level sep): vertical distance between levels. The default value is 1.0. A negative value draws the tree upward.cs
(children sep): horizontal distance between siblings. The default value is 0.2. Optional arguments are the same as inleaf
.
val nodel : ?ls:Num.t -> ?cs:Num.t -> ?arrow_style:arrow_style -> ?edge_style:edge_style -> ?stroke:Color.t -> ?brush:Brush.t -> ?pen:Pen.t -> ?sep:Num.t -> Box.t -> (t * (Command.position * Picture.t)) list -> t
Similar to
node
but with labels on edges. Labels are taken into account only whenedge_style
isStraight
.
val bin : ?ls:Num.t -> ?cs:Num.t -> ?arrow_style:arrow_style -> ?edge_style:edge_style -> ?stroke:Color.t -> ?brush:Brush.t -> ?pen:Pen.t -> ?sep:Num.t -> Box.t -> t -> t -> t
bin label l r
creates a binary node with labellabel
and childrenl
andr
. Optional arguments are the same as inleaf
.
module Simple : sig ... end