Functor Tree_layout.Make

module Make (G : TREE) : S  with type t := G.t
     and type vertex := G.V.t
Define layout engines.

If the operations in Tree_layout.TREE are O(1), the layout functions are O(n).

Parameters:
G : TREE

type t 
A tree
type vertex 
A vertex of the tree.
module H: Hashtbl.S  with type key = vertex
val layered : distance:(vertex -> vertex -> float) ->
t -> vertex -> Tree_layout.pos H.t
tree_layout ~distance g v returns the layered layout for the tree g rooted in v. Layered layout are such that vertices with the same depth have the same vertical coordinate.

distance v1 v2 should return the horizontal distance between v1 and v2 placed at the same depth.

The returned hash table contains one binding per accessible vertex in g.
See also Improving Walker's Algorithm to Run in Linear Time

val boundaries : ?margins:Tree_layout.pos ->
Tree_layout.pos H.t -> Tree_layout.pos * Tree_layout.pos
boundaries ~margins positions returns a pair (pos, size) defining a rectangle containing the positions in positions.

The option argument margins add a margin around the rectangle.