package tree_layout

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Define layout engines.

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

Parameters

module G : TREE

Signature

module H : Hashtbl.S with type key = G.V.t
val layered : distance:(G.V.t -> G.V.t -> float) -> G.t -> G.V.t -> 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.

val boundaries : ?margins:pos -> pos H.t -> pos * 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.

OCaml

Innovation. Community. Security.