Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / dot.sig
1 (* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9 signature DOT =
10 sig
11 datatype color = datatype DotColor.t
12 datatype direction =
13 Backward
14 | Both
15 | Forward
16 | None
17 datatype fontFamily =
18 Courier
19 | Helvetica
20 | Symbol
21 | Times
22 datatype fontWeight =
23 Bold
24 | Italic
25 | Roman
26 type fontName = fontFamily * fontWeight
27 datatype justify =
28 Center
29 | Left
30 | Right
31 datatype orientation =
32 Landscape
33 | Portrait
34 datatype polygonOption =
35 Distortion of real (* -1.0 <= r <= 1.0 *)
36 | Orientation of int (* 0 <= i <= 360. Clockwise rotation from
37 * X axis in degrees.
38 *)
39 | Peripheries of int
40 | Skew of real (* -1.0 <= r <= 1.0 *)
41 datatype rank = Max | Min | Same
42 datatype rankDir =
43 LeftToRight
44 | TopToBottom
45 datatype ratio =
46 Auto
47 | Compress
48 | Fill
49 | WidthOverHeight of real
50 datatype shape =
51 Box
52 | Circle
53 | Diamond
54 | Ellipse
55 | Plaintext
56 | Polygon of {sides: int,
57 options: polygonOption list}
58 datatype style =
59 BoldStyle
60 | Dashed
61 | Dotted
62 | Filled
63 | Invisible
64 | Solid
65 structure EdgeOption:
66 sig
67 datatype t =
68 Color of color
69 | Decorate of bool (* connect edge label to edge *)
70 | Dir of direction
71 | FontColor of color
72 | FontName of fontName
73 | FontSize of int (* points *)
74 | Label of (string * justify) list
75 | Minlen of int
76 | Style of style
77 | Weight of int
78
79 val label: string -> t (* label s = Label (s, Center) *)
80 end
81 structure NodeOption:
82 sig
83 datatype t =
84 Color of color
85 | FontColor of color
86 | FontName of fontName
87 | FontSize of int (* points *)
88 | Height of real (* inches *)
89 | Label of (string * justify) list
90 | Shape of shape
91 | Width of real (* inches *)
92
93 val label: string -> t (* label s = Label (s, Center) *)
94 end
95 structure GraphOption:
96 sig
97 datatype t =
98 Center of bool
99 | Color of color (* *)
100 | Concentrate of bool
101 | FontColor of color
102 | FontName of fontName
103 | FontSize of int (* points *)
104 | Label of string
105 | Margin of real * real (* inches *)
106 | Mclimit of real (* mincross iterations multiplier *)
107 | NodeSep of real (* inches *)
108 | Nslimit of int (* network simplex limit *)
109 | Orientation of orientation
110 | Page of {height: real, width: real} (* inches *)
111 | Rank of rank * {nodeName: string} list
112 | RankDir of rankDir
113 | RankSep of real (* inches *)
114 | Ratio of ratio
115 | Size of {height: real, width: real} (* inches *)
116 end
117
118 val layout: {nodes: {name: string,
119 options: NodeOption.t list,
120 successors: {name: string,
121 options: EdgeOption.t list} list
122 } list,
123 options: GraphOption.t list,
124 title: string} -> Layout.t
125 end