package mlpost

  1. Overview
  2. Docs

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 =
  1. | Up
  2. | Down
  3. | Left
  4. | Right
  5. | 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.

  • parameter lab

    The label of the arrow, in Latex format

  • parameter pos

    The position of the label, relative to the arrow

  • parameter line_width

    Draws a thick arrow of that width, if present (experimental)

  • parameter head

    If true, the arrow has a head. Otherwise, it's just a line.

  • parameter outd

    The outgoing direction of the arrow

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

  • parameter scale

    The distance between nodes; default is 40 bp

  • parameter style

    The style of nodes: circular or rectangular (default is circular)

  • parameter boxed

    The border is drawn if set (default is true)

  • parameter fill

    The color to fill nodes

  • parameter stroke

    The color to draw arrows

  • parameter pen

    The pen used for arrows

OCaml

Innovation. Community. Security.