Module Graph__.XDot
type node_layout
=
{
n_name : string;
Dot label
n_pos : pos;
Center position
n_bbox : bounding_box;
Bounding box
n_draw : Graph.XDotDraw.operation list;
Shape drawing
n_ldraw : Graph.XDotDraw.operation list;
Label drawing
}
Each node has at least a position and a bounding box.
type cluster_layout
=
{
c_pos : pos;
c_bbox : bounding_box;
c_draw : Graph.XDotDraw.operation list;
c_ldraw : Graph.XDotDraw.operation list;
}
type edge_layout
=
{
e_draw : Graph.XDotDraw.operation list;
Shapes and curves
e_ldraw : Graph.XDotDraw.operation list;
Label drawing
e_hdraw : Graph.XDotDraw.operation list;
Head arrowhead drawing
e_tdraw : Graph.XDotDraw.operation list;
Tail arrowhead drawing
e_hldraw : Graph.XDotDraw.operation list;
Head label drawing
e_tldraw : Graph.XDotDraw.operation list;
Tail label drawing
}
val mk_node_layout : name:string -> pos:pos -> bbox:bounding_box -> draw:Graph.XDotDraw.operation list -> ldraw:Graph.XDotDraw.operation list -> node_layout
Creates a node layout
val mk_cluster_layout : pos:pos -> bbox:bounding_box -> draw:Graph.XDotDraw.operation list -> ldraw:Graph.XDotDraw.operation list -> cluster_layout
Creates a cluster layout
val mk_edge_layout : draw:Graph.XDotDraw.operation list -> ldraw:Graph.XDotDraw.operation list -> hdraw:Graph.XDotDraw.operation list -> tdraw:Graph.XDotDraw.operation list -> hldraw:Graph.XDotDraw.operation list -> tldraw:Graph.XDotDraw.operation list -> edge_layout
Creates an edge layout
module Make : functor (G : Graph.Graphviz.GraphWithDotAttrs) -> sig ... end
Instantiates a module which creates graph layouts from xdot files
val bounding_box : (float * float) -> float -> float -> bounding_box
bounding_box pos w h
converts a bounding box of centerpos
, widthw
and heighth
from a Dot file to a pair of corners (lower left and upper right) in the world coordinate system.- parameter pos
position of the center of the node
- parameter w
width of the node
- parameter h
height of the node
val read_bounding_box : string -> bounding_box
val read_node_layout : Graph.Dot_ast.node_id -> Graph.Dot_ast.attr list -> node_layout
Reads xdot layouts from the dot ast
val read_edge_layout : Graph.Dot_ast.attr list -> edge_layout
val read_cluster_layout : Graph.Dot_ast.attr list -> cluster_layout