Module Mlpost.Triangle
Tree-like, triangular shapes, with a root on top and an horizontal bottom line.
type t
= Box.t
A triangular shape is a box. In the following, we simply call it a "triangle".
val create : ?brush:Brush.t -> ?stroke:Color.t option -> ?pen:Pen.t -> ?dash:Dash.t -> ?fill:Color.t -> ?left:float -> ?right:float -> ?width:Num.t -> depth:Num.t -> unit -> Box.t
create depth
creates a triangular shape of depthdepth
. The width is equal todepth
, unless specified usingwidth
.left
andright
control the horizontal position of the root; they default to0.5
i.e. the root is centered. Negative values forleft
andright
are allowed.
val pic : ?brush:Brush.t -> ?stroke:Color.t option -> ?pen:Pen.t -> ?dash:Dash.t -> ?fill:Color.t -> ?dx:float -> ?dy:float -> Picture.t -> t
builds a triangle surrounding a picture
val tex : ?brush:Brush.t -> ?stroke:Color.t option -> ?pen:Pen.t -> ?dash:Dash.t -> ?fill:Color.t -> ?dx:float -> ?dy:float -> string -> t
builds a triangle surrounding a picture
builds a triangle surrounding a LaTeX label
val root : t -> Point.t
val bottom_left : t -> Point.t
val bottom_right : t -> Point.t
Special points in a triangle.
val draw : ?debug:bool -> t -> Command.t
val root_label : ?pos:Command.position -> Picture.t -> t -> t
val tex_root_label : ?pos:Command.position -> string -> t -> t
Attach a label to the root.
val x_depth : ?x:float -> ?depth:float -> t -> Point.t
a point inside a triangle is denoted using two coordinates
x
anddepth
. Coordinatex
controls horizontal placement, with 0.0 for left and 1.0 for right (negative values are allowed). Coordinatedepth
controls vertical placement, with 0.0 for root and 1.0 for bottom line (negative values are allowed).x
defaults to0.5
(centered) anddepth
defaults to1.0
(bottom).
val label : ?x:float -> ?depth:float -> ?pos:Command.position -> Picture.t -> t -> t
val tex_label : ?x:float -> ?depth:float -> ?pos:Command.position -> string -> t -> t
Attach a label to the point (x, depth). Coordinate
depth
defaults to 0.7, so that label is likely to fit nicely in the triangle (otherwise, you may consider using functionspic
andtex
above).
val anchor : ?x:float -> ?depth:float -> t -> t -> t
anchor t2 t1
moves trianglet1
at position (x, depth) in trianglet2
val pose : ?x:float -> ?depth:float -> t -> t -> t
pose t2 t1
moves trianglet1
so that its south point is at position (x, depth) in trianglet2