package tree_layout

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

The output signature for a certain layout engine.

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 -> 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.