Module Mlpost.Diag

module Diag: sig .. end

Create simple diagrams by placing objects in a table. Deprecated.


Diagrams.

This module permits to create diagrams in a very simple and yet quite flexible fashion. It permits to specify content, form and color of nodes as well as color, form and labels of arrows between nodes. Nodes have to be placed by hand, though

Creation

type node 

The abstract type of nodes

type node_style = Box.t -> Box.t 

The type for node styles; It corresponds to the type of the box creation functions in the Box module

val node : ?style:node_style ->
?fill:Color.t ->
?boxed:bool -> float -> float -> Box.t -> node

Construct a node at a given position with a given content in Latex format and a box style

type t 

The abstract type of diagrams

val create : node list -> t

Create a diagram that consists of the given nodes

type dir = 
| Up
| Down
| Left
| Right
| Angle of float
val arrow : t ->
?lab:string ->
?line_width:Num.t ->
?boxed:bool ->
?line_color:Color.t ->
?fill_color:Color.t ->
?pos:Command.position ->
?head:bool ->
?dashed:Dash.t ->
?outd:dir ->
?ind:dir -> node -> node -> unit

arrow d n1 n2 adds an arrow between n1 and n2 in the diagram d, by side effect.

lab : The label of the arrow, in Latex format
line_width : Draws a thick arrow of that width, if present (experimental)
pos : The position of the label, relative to the arrow
head : If true, the arrow has a head. Otherwise, it's just a line.
outd : The outgoing direction of the arrow
ind : The ingoing direction of the arrow

Drawing

val draw : ?scale:(float -> Num.t) ->
?style:node_style ->
?boxed:bool ->
?fill:Color.t ->
?stroke:Color.t ->
?pen:Pen.t -> t -> Command.t

Draws the diagram.

scale : The distance between nodes; default is 40 bp
style : The style of nodes: circular or rectangular (default is circular)
boxed : The border is drawn if set (default is true)
fill : The color to fill nodes
stroke : The color to draw arrows
pen : The pen used for arrows