module Make(G:TREE):Swith type t := G.t and type vertex := G.V.t
If the operations in Tree_layout.TREE are O(1), the layout functions are O(n).
| Parameters: |
|
type t
type vertex
module H:Hashtbl.Swith type key = vertex
val layered : distance:(vertex -> vertex -> float) ->
t -> vertex -> Tree_layout.pos H.ttree_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.posboundaries ~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.