File: gv.3ocaml

package info (click to toggle)
graphviz 2.26.3-5%2Bsqueeze3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 63,044 kB
  • ctags: 25,930
  • sloc: ansic: 212,134; sh: 20,316; cpp: 7,239; makefile: 4,211; yacc: 3,335; xml: 2,450; tcl: 1,900; cs: 1,890; objc: 1,149; perl: 829; lex: 364; awk: 171; python: 41; ruby: 35; php: 26
file content (363 lines) | stat: -rw-r--r-- 8,902 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
.TH gv 3ocaml "26 January 2010"

.SH NAME

gv_ocaml - graph manipulation in ocaml

.SH SYNOPSIS



.SH USAGE



.SH INTRODUCTION

.B gv_ocaml
is a dynamically loaded extension for
.B ocaml
that provides access to the graph facilities of
.B graphviz.

.SH COMMANDS

.TP
\fBNew graphs\fR
.br
.TP
New empty graph
.br
\fIgraph_handle\fR \fBgv.graph\fR \fI(name);\fR
.br
\fIgraph_handle\fR \fBgv.digraph\fR \fI(name);\fR
.br
\fIgraph_handle\fR \fBgv.strictgraph\fR \fI(name);\fR
.br
\fIgraph_handle\fR \fBgv.strictdigraph\fR \fI(name);\fR
.br
.TP
New graph from a dot-syntax string or file
.br
\fIgraph_handle\fR \fBgv.readstring\fR \fI(string);\fR
.br
\fIgraph_handle\fR \fBgv.read\fR \fI(string filename);\fR
.br
\fIgraph_handle\fR \fBgv.read\fR \fI(channel);\fR
.br
.TP
Add new subgraph to existing graph
.br
\fIgraph_handle\fR \fBgv.graph\fR \fI(graph_handle, name);\fR
.br
.TP
\fBNew nodes\fR
.br
.TP
Add new node to existing graph
.br
\fInode_handle\fR \fBgv.node\fR \fI(graph_handle, name);\fR
.br
.TP
\fBNew edges\fR
.br
.TP
Add new edge between existing nodes
.br
\fIedge_handle\fR \fBgv.edge\fR \fI(tail_node_handle, head_node_handle);\fR
.br
.TP
Add a new edge between an existing tail node, and a named head node which will be induced in the graph if it doesn't already exist
.br
\fIedge_handle\fR \fBgv.edge\fR \fI(tail_node_handle, head_name);\fR
.br
.TP
Add a new edge between an existing head node, and a named tail node which will be induced in the graph if it doesn't already exist
.br
\fIedge_handle\fR \fBgv.edge\fR \fI(tail_name, head_node_handle);\fR
.br
.TP
Add a new edge between named tail  and head nodes which will be induced in the graph if they don't already exist
.br
\fIedge_handle\fR \fBgv.edge\fR \fI(graph_handle, tail_name, head_name);\fR
.br
.TP
\fBSetting attribute values\fR
.br
.TP
Set value of named attribute of graph/node/edge - creating attribute if necessary
.br
\fIstring\fR \fBgv.setv\fR \fI(graph_handle, attr_name, attr_value);\fR
.br
\fIstring\fR \fBgv.setv\fR \fI(node_handle, attr_name, attr_value);\fR
.br
\fIstring\fR \fBgv.setv\fR \fI(edge_handle, attr_name, attr_value);\fR
.br
.TP
Set value of existing attribute of graph/node/edge (using attribute handle)
.br
\fIstring\fR \fBgv.setv\fR \fI(graph_handle, attr_handle, attr_value);\fR
.br
\fIstring\fR \fBgv.setv\fR \fI(node_handle, attr_handle, attr_value);\fR
.br
\fIstring\fR \fBgv.setv\fR \fI(edge_handle, attr_handle, attr_value);\fR
.br
.TP
\fBGetting attribute values\fR
.br
.TP
Get value of named attribute of graph/node/edge
.br
\fIstring\fR \fBgv.getv\fR \fI(graph_handle, attr_name);\fR
.br
\fIstring\fR \fBgv.getv\fR \fI(node_handle, attr_name);\fR
.br
\fIstring\fR \fBgv.getv\fR \fI(edge_handle, attr_name);\fR
.br
.TP
Get value of attribute of graph/node/edge (using attribute handle)
.br
\fIstring\fR \fBgv.getv\fR \fI(graph_handle, attr_handle);\fR
.br
\fIstring\fR \fBgv.getv\fR \fI(node_handle, attr_handle);\fR
.br
\fIstring\fR \fBgv.getv\fR \fI(edge_handle, attr_handle);\fR
.br
.TP
\fBObtain names from handles\fR
.br
\fIstring\fR \fBgv.nameof\fR \fI(graph_handle);\fR
.br
\fIstring\fR \fBgv.nameof\fR \fI(node_handle);\fR
.br
\fIstring\fR \fBgv.nameof\fR \fI(attr_handle);\fR
.br
.TP
\fBFind handles from names\fR
.br
\fIgraph_handle\fR \fBgv.findsubg\fR \fI(graph_handle, name);\fR
.br
\fInode_handle\fR \fBgv.findnode\fR \fI(graph_handle, name);\fR
.br
\fIedge_handle\fR \fBgv.findedge\fR \fI(tail_node_handle, head_node_handle);\fR
.br
\fIattribute_handle\fR \fBgv.findattr\fR \fI(graph_handle, name);\fR
.br
\fIattribute_handle\fR \fBgv.findattr\fR \fI(node_handle, name);\fR
.br
\fIattribute_handle\fR \fBgv.findattr\fR \fI(edge_handle, name);\fR
.br
.TP
\fBMisc graph navigators returning handles\fR
.br
\fInode_handle\fR \fBgv.headof\fR \fI(edge_handle);\fR
.br
\fInode_handle\fR \fBgv.tailof\fR \fI(edge_handle);\fR
.br
\fIgraph_handle\fR \fBgv.graphof\fR \fI(graph_handle);\fR
.br
\fIgraph_handle\fR \fBgv.graphof\fR \fI(edge_handle);\fR
.br
\fIgraph_handle\fR \fBgv.graphof\fR \fI(node_handle);\fR
.br
\fIgraph_handle\fR \fBgv.rootof\fR \fI(graph_handle);\fR
.br
.TP
\fBObtain handles of proto node/edge for setting default attribute values\fR
.br
\fInode_handle\fR \fBgv.protonode\fR \fI(graph_handle);\fR
.br
\fIedge_handle\fR \fBgv.protoedge\fR \fI(graph_handle);\fR
.br
.TP
\fBIterators\fR
.br
.TP
Iteration termination tests
.br
\fIbool\fR \fBgv.ok\fR \fI(graph_handle);\fR
.br
\fIbool\fR \fBgv.ok\fR \fI(node_handle);\fR
.br
\fIbool\fR \fBgv.ok\fR \fI(edge_handle);\fR
.br
\fIbool\fR \fBgv.ok\fR \fI(attr_handle);\fR
.br
.TP
Iterate over subgraphs of a graph
.br
\fIgraph_handle\fR \fBgv.firstsubg\fR \fI(graph_handle);\fR
.br
\fIgraph_handle\fR \fBgv.nextsubg\fR \fI(graph_handle, subgraph_handle);\fR
.br
.TP
Iterate over supergraphs of a graph (obscure and rarely useful)
.br
\fIgraph_handle\fR \fBgv.firstsupg\fR \fI(graph_handle);\fR
.br
\fIgraph_handle\fR \fBgv.nextsupg\fR \fI(graph_handle, subgraph_handle);\fR
.br
.TP
Iterate over edges of a graph
.br
\fIedge_handle\fR \fBgv.firstedge\fR \fI(graph_handle);\fR
.br
\fIedge_handle\fR \fBgv.nextedge\fR \fI(graph_handle, edge_handle);\fR
.br
.TP
Iterate over outedges of a graph
.br
\fIedge_handle\fR \fBgv.firstout\fR \fI(graph_handle);\fR
.br
\fIedge_handle\fR \fBgv.nextout\fR \fI(graph_handle, edge_handle);\fR
.br
.TP
Iterate over edges of a node
.br
\fIedge_handle\fR \fBgv.firstedge\fR \fI(node_handle);\fR
.br
\fIedge_handle\fR \fBgv.nextedge\fR \fI(node_handle, edge_handle);\fR
.br
.TP
Iterate over out-edges of a node
.br
\fIedge_handle\fR \fBgv.firstout\fR \fI(node_handle);\fR
.br
\fIedge_handle\fR \fBgv.nextout\fR \fI(node_handle, edge_handle);\fR
.br
.TP
Iterate over head nodes reachable from out-edges of a node
.br
\fInode_handle\fR \fBgv.firsthead\fR \fI(node_handle);\fR
.br
\fInode_handle\fR \fBgv.nexthead\fR \fI(node_handle, head_node_handle);\fR
.br
.TP
Iterate over in-edges of a graph
.br
\fIedge_handle\fR \fBgv.firstin\fR \fI(graph_handle);\fR
.br
\fIedge_handle\fR \fBgv.nextin\fR \fI(node_handle, edge_handle);\fR
.br
.TP
Iterate over in-edges of a node
.br
\fIedge_handle\fR \fBgv.firstin\fR \fI(node_handle);\fR
.br
\fIedge_handle\fR \fBgv.nextin\fR \fI(graph_handle, edge_handle);\fR
.br
.TP
Iterate over tail nodes reachable from in-edges of a node
.br
\fInode_handle\fR \fBgv.firsttail\fR \fI(node_handle);\fR
.br
\fInode_handle\fR \fBgv.nexttail\fR \fI(node_handle, tail_node_handle);\fR
.br
.TP
Iterate over nodes of a graph
.br
\fInode_handle\fR \fBgv.firstnode\fR \fI(graph_handle);\fR
.br
\fInode_handle\fR \fBgv.nextnode\fR \fI(graph_handle, node_handle);\fR
.br
.TP
Iterate over nodes of an edge
.br
\fInode_handle\fR \fBgv.firstnode\fR \fI(edge_handle);\fR
.br
\fInode_handle\fR \fBgv.nextnode\fR \fI(edge_handle, node_handle);\fR
.br
.TP
Iterate over attributes of a graph
.br
\fIattribute_handle\fR \fBgv.firstattr\fR \fI(graph_handle);\fR
.br
\fIattribute_handle\fR \fBgv.nextattr\fR \fI(graph_handle, attr_handle);\fR
.br
.TP
Iterate over attributes of an edge
.br
\fIattribute_handle\fR \fBgv.firstattr\fR \fI(edge_handle);\fR
.br
\fIattribute_handle\fR \fBgv.nextattr\fR \fI(edge_handle, attr_handle);\fR
.br
.TP
Iterate over attributes of a node
.br
\fIattribute_handle\fR \fBgv.firstattr\fR \fI(node_handle);\fR
.br
\fIattribute_handle\fR \fBgv.nextattr\fR \fI(node_handle, attr_handle);\fR
.br
.TP
\fBRemove graph objects\fR
.br
\fIbool\fR \fBgv.rm\fR \fI(graph_handle);\fR
.br
\fIbool\fR \fBgv.rm\fR \fI(node_handle);\fR
.br
\fIbool\fR \fBgv.rm\fR \fI(edge_handle);\fR
.br
.TP
\fBLayout\fR
.br
.TP
Annotate a graph with layout attributes and values using a specific layout engine
.br
\fIbool\fR \fBgv.layout\fR \fI(graph_handle, string engine);\fR
.br
.TP
\fBRender\fR
.br
.TP
Render a layout into attributes of the graph
.br
\fIbool\fR \fBgv.render\fR \fI(graph_handle);\fR
.br
.TP
Render a layout to stdout
.br
\fIbool\fR \fBgv.render\fR \fI(graph_handle, string format);\fR
.br
.TP
Render to an open file
.br
\fIbool\fR \fBgv.render\fR \fI(graph_handle, string format, channel fout);\fR
.br
.TP
Render a layout to an unopened file by name
.br
\fIbool\fR \fBgv.render\fR \fI(graph_handle, string format, string filename);\fR
.br
.TP
Render to an open channel
.br
\fIbool\fR \fBgv.renderchannel\fR \fI(graph_handle, string format, string channelname);\fR
.br
.TP
Render to a string result
.br
\fBgv.renderresult\fR \fI(graph_handle, string format, string outdata);\fR
.br
.TP
Render a layout to a malloc'ed string, to be free'd by the caller
.br
.TP
(deprecated - too easy to leak memory)
.br
.TP
(still needed for "eval [gv::renderdata $G tk]" )
.br
\fIstring\fR \fBgv.renderdata\fR \fI(graph_handle, string format);\fR
.br
.TP
Writing graph back to file
.br
\fIbool\fR \fBgv.write\fR \fI(graph_handle, string filename);\fR
.br
\fIbool\fR \fBgv.write\fR \fI(graph_handle, channel);\fR
.br

.SH KEYWORDS

graph, dot, neato, fdp, circo, twopi, ocaml.