Graph.XDotDrawParses xdot drawing operations
See dot documentation to understand the drawing operations
type style_attr = | Filled |
| Invisible |
| Diagonals |
| Rounded |
| Dashed |
| Dotted |
| Solid |
| Bold |
| StyleString of string |
Style attributes
type operation = | Filled_ellipse of pos * width * height |
| Unfilled_ellipse of pos * width * height |
| Filled_polygon of pos array |
| Unfilled_polygon of pos array |
| Polyline of pos array |
| Bspline of pos array |
| Filled_bspline of pos array |
| Text of pos * align * width * string |
| Fill_color of string |
| Pen_color of string |
| Font of float * string |
| Style of style_attr list |
Drawing operations
val string_scale_size : fontMeasure:(fontName:string -> fontSize:int ->
string -> int * int) -> string -> float -> string -> width * heightstring_scale_size ~fontMeasure font font_size text. Interpolates the font metrics we have to use to draw the given text with the given font but preserving the bounding box of the text even with a proportional font. For a fixed width font the result is font_size*font_size.
Parses an xdot drawing attribute
val parse : string -> operation listSome drawing operations modify the following drawing state (pen_color, font and style).
type draw_state = private {mutable fill_color : string; |
mutable pen_color : string; |
mutable font : float * string; |
mutable style : style_attr list; |
}val draw_with : (draw_state -> operation -> unit) -> operation list -> unitIterates on the drawing operations and updates the implicit drawing state