~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

« back to all changes in this revision

Viewing changes to tcldgl/tcldgl.n

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.lf 1 tcldgl.n
 
2
'\"
 
3
'\" Copyright (c) 1997 Lucent Technologies, Inc.
 
4
'\"
 
5
.lf 1 man.macros
 
6
'\" The definitions below are for supplemental macros used in Tcl/Tk
 
7
'\" manual entries.
 
8
'\"
 
9
'\" .AP type name in/out ?indent?
 
10
'\"     Start paragraph describing an argument to a library procedure.
 
11
'\"     type is type of argument (int, etc.), in/out is either "in", "out",
 
12
'\"     or "in/out" to describe whether procedure reads or modifies arg,
 
13
'\"     and indent is equivalent to second arg of .IP (shouldn't ever be
 
14
'\"     needed;  use .AS below instead)
 
15
'\"
 
16
'\" .AS ?type? ?name?
 
17
'\"     Give maximum sizes of arguments for setting tab stops.  Type and
 
18
'\"     name are examples of largest possible arguments that will be passed
 
19
'\"     to .AP later.  If args are omitted, default tab stops are used.
 
20
'\"
 
21
'\" .BS
 
22
'\"     Start box enclosure.  From here until next .BE, everything will be
 
23
'\"     enclosed in one large box.
 
24
'\"
 
25
'\" .BE
 
26
'\"     End of box enclosure.
 
27
'\"
 
28
'\" .CS
 
29
'\"     Begin code excerpt.
 
30
'\"
 
31
'\" .CE
 
32
'\"     End code excerpt.
 
33
'\"
 
34
'\" .VS ?br?
 
35
'\"     Begin vertical sidebar, for use in marking newly-changed parts
 
36
'\"     of man pages.  If an argument is present, then a line break is
 
37
'\"     forced before starting the sidebar.
 
38
'\"
 
39
'\" .VE
 
40
'\"     End of vertical sidebar.
 
41
'\"
 
42
'\" .DS
 
43
'\"     Begin an indented unfilled display.
 
44
'\"
 
45
'\" .DE
 
46
'\"     End of indented unfilled display.
 
47
'\"
 
48
'\" .SO
 
49
'\"     Start of list of standard options for a Tk widget.  The
 
50
'\"     options follow on successive lines, in four columns separated
 
51
'\"     by tabs.
 
52
'\"
 
53
'\" .SE
 
54
'\"     End of list of standard options for a Tk widget.
 
55
'\"
 
56
'\" .OP cmdName dbName dbClass
 
57
'\"     Start of description of a specific option.  cmdName gives the
 
58
'\"     option's name as specified in the class command, dbName gives
 
59
'\"     the option's name in the option database, and dbClass gives
 
60
'\"     the option's class in the option database.
 
61
'\"
 
62
'\" .UL arg1 arg2
 
63
'\"     Print arg1 underlined, then print arg2 normally.
 
64
'\"
 
65
'\" SCCS: @(#) man.macros 1.8 96/02/15 20:02:24
 
66
'\"
 
67
'\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
 
68
.if t .wh -1.3i ^B
 
69
.nr ^l \n(.l
 
70
.ad b
 
71
'\"     # Start an argument description
 
72
.de AP
 
73
.ie !"\\$4"" .TP \\$4
 
74
.el \{\
 
75
.   ie !"\\$2"" .TP \\n()Cu
 
76
.   el          .TP 15
 
77
.\}
 
78
.ie !"\\$3"" \{\
 
79
.ta \\n()Au \\n()Bu
 
80
\&\\$1  \\fI\\$2\\fP    (\\$3)
 
81
.\".b
 
82
.\}
 
83
.el \{\
 
84
.br
 
85
.ie !"\\$2"" \{\
 
86
\&\\$1  \\fI\\$2\\fP
 
87
.\}
 
88
.el \{\
 
89
\&\\fI\\$1\\fP
 
90
.\}
 
91
.\}
 
92
..
 
93
'\"     # define tabbing values for .AP
 
94
.de AS
 
95
.nr )A 10n
 
96
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
 
97
.nr )B \\n()Au+15n
 
98
.\"
 
99
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
 
100
.nr )C \\n()Bu+\\w'(in/out)'u+2n
 
101
..
 
102
.AS Tcl_Interp Tcl_CreateInterp in/out
 
103
'\"     # BS - start boxed text
 
104
'\"     # ^y = starting y location
 
105
'\"     # ^b = 1
 
106
.de BS
 
107
.br
 
108
.mk ^y
 
109
.nr ^b 1u
 
110
.if n .nf
 
111
.if n .ti 0
 
112
.if n \l'\\n(.lu\(ul'
 
113
.if n .fi
 
114
..
 
115
'\"     # BE - end boxed text (draw box now)
 
116
.de BE
 
117
.nf
 
118
.ti 0
 
119
.mk ^t
 
120
.ie n \l'\\n(^lu\(ul'
 
121
.el \{\
 
122
.\"     Draw four-sided box normally, but don't draw top of
 
123
.\"     box if the box started on an earlier page.
 
124
.ie !\\n(^b-1 \{\
 
125
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
 
126
.\}
 
127
.el \}\
 
128
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
 
129
.\}
 
130
.\}
 
131
.fi
 
132
.br
 
133
.nr ^b 0
 
134
..
 
135
'\"     # VS - start vertical sidebar
 
136
'\"     # ^Y = starting y location
 
137
'\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
 
138
.de VS
 
139
.if !"\\$1"" .br
 
140
.mk ^Y
 
141
.ie n 'mc \s12\(br\s0
 
142
.el .nr ^v 1u
 
143
..
 
144
'\"     # VE - end of vertical sidebar
 
145
.de VE
 
146
.ie n 'mc
 
147
.el \{\
 
148
.ev 2
 
149
.nf
 
150
.ti 0
 
151
.mk ^t
 
152
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
 
153
.sp -1
 
154
.fi
 
155
.ev
 
156
.\}
 
157
.nr ^v 0
 
158
..
 
159
'\"     # Special macro to handle page bottom:  finish off current
 
160
'\"     # box/sidebar if in box/sidebar mode, then invoked standard
 
161
'\"     # page bottom macro.
 
162
.de ^B
 
163
.ev 2
 
164
'ti 0
 
165
'nf
 
166
.mk ^t
 
167
.if \\n(^b \{\
 
168
.\"     Draw three-sided box if this is the box's first page,
 
169
.\"     draw two sides but no top otherwise.
 
170
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
 
171
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
 
172
.\}
 
173
.if \\n(^v \{\
 
174
.nr ^x \\n(^tu+1v-\\n(^Yu
 
175
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
 
176
.\}
 
177
.bp
 
178
'fi
 
179
.ev
 
180
.if \\n(^b \{\
 
181
.mk ^y
 
182
.nr ^b 2
 
183
.\}
 
184
.if \\n(^v \{\
 
185
.mk ^Y
 
186
.\}
 
187
..
 
188
'\"     # DS - begin display
 
189
.de DS
 
190
.RS
 
191
.nf
 
192
.sp
 
193
..
 
194
'\"     # DE - end display
 
195
.de DE
 
196
.fi
 
197
.RE
 
198
.sp
 
199
..
 
200
'\"     # SO - start of list of standard options
 
201
.de SO
 
202
.SH "STANDARD OPTIONS"
 
203
.LP
 
204
.nf
 
205
.ta 4c 8c 12c
 
206
.ft B
 
207
..
 
208
'\"     # SE - end of list of standard options
 
209
.de SE
 
210
.fi
 
211
.ft R
 
212
.LP
 
213
See the \\fBoptions\\fR manual entry for details on the standard options.
 
214
..
 
215
'\"     # OP - start of full description for a single option
 
216
.de OP
 
217
.LP
 
218
.nf
 
219
.ta 4c
 
220
Command-Line Name:      \\fB\\$1\\fR
 
221
Database Name:  \\fB\\$2\\fR
 
222
Database Class: \\fB\\$3\\fR
 
223
.fi
 
224
.IP
 
225
..
 
226
'\"     # CS - begin code excerpt
 
227
.de CS
 
228
.RS
 
229
.nf
 
230
.ta .25i .5i .75i 1i
 
231
..
 
232
'\"     # CE - end code excerpt
 
233
.de CE
 
234
.fi
 
235
.RE
 
236
..
 
237
.de UL
 
238
\\$1\l'|0\(ul'\\$2
 
239
..
 
240
.lf 5 tcldgl.n
 
241
.TH TCLDGL 1 "Tcl Extension"
 
242
.BS
 
243
'\" Note:  do not modify the .SH NAME line immediately below!
 
244
.SH NAME
 
245
Tcldgl \- dynamic graph layout in tcl
 
246
.SH SYNOPSIS
 
247
 
 
248
#!/bin/sh
 
249
.br
 
250
# next line is a comment in tcl \\
 
251
.br
 
252
exec tclsh "$0" ${1+"$@"}
 
253
.br
 
254
package require Tcldgr
 
255
.br
 
256
package require Tcldgl
 
257
.BE
 
258
 
 
259
.SH USAGE
 
260
 
 
261
Requires the dynamic loading facilities of tcl7.6 or later.
 
262
Does \fInot\fR require tk, but the layout facilities are typically
 
263
used to drive a tk display.
 
264
 
 
265
.SH INTRODUCTION
 
266
 
 
267
.B Tcldgl
 
268
is a tcl dynamically loaded extension that uses 
 
269
the incremental graph layout capabilities of
 
270
.B libincr(3).  
 
271
Typically it is expected to be used in conjunction
 
272
with Tcldgr (and libgraph(3)) which provide for maniplutation of graph
 
273
structures.
 
274
 
 
275
This program is a significant evolution from its
 
276
.B tcldot
 
277
heritage. 
 
278
The major differences are the addition of "bindings" to graph 
 
279
and layout events to support incremental graphs.
 
280
The various built in renderers that were available in 
 
281
.B tcldot
 
282
are no longer provided.
 
283
Instead the script writer is expected to use the facilities of Tk.  
 
284
An example graph editor,
 
285
.B dge,
 
286
is provided in the distribution which provides an example of the use
 
287
of Tk as a renderer.
 
288
 
 
289
.SH COMMAND SUMMARY
 
290
 
 
291
.B Tcldgl
 
292
uses
 
293
.I Tcl
 
294
(Tool Command Language).
 
295
Tcl provides control flow (e.g., if, for, break),
 
296
expression evaluation and several other features such as recursion,
 
297
procedure definition, etc.
 
298
Commands used here but not defined (e.g.,
 
299
.BR set ,
 
300
.BR if ,
 
301
.BR exec )
 
302
are Tcl commands (see
 
303
.B Tcl(n)
 
304
).
 
305
.B Tcldgl
 
306
supports several additional commands, described below.
 
307
Nearly all
 
308
.B Tcldgl
 
309
commands return a value, usually the handle of a layout (graph), node, or edge.
 
310
The handles are themselves registered as commands to permit direct
 
311
operations on the objects after they have been created.
 
312
.B Tcldgl
 
313
initially adds only one user commands to the 
 
314
.B tcl
 
315
interpreter at start up, namely 
 
316
.B dglayout.
 
317
 
 
318
All other "commands" are of the form:
 
319
.I "handle
 
320
.B command
 
321
.I parameters"
 
322
where the
 
323
.I handle
 
324
refers to an existing layout.
 
325
 
 
326
The commands are described in detail below, but in summary:
 
327
.HP
 
328
Tcl commands are:
 
329
.br
 
330
dglayout.
 
331
.HP
 
332
Layout commands are:
 
333
.br
 
334
batch, bind, defaultedge, defaultnode, delete,
 
335
get_edge, get_node,
 
336
insert_edge, insert_node,
 
337
modify_edge, modify_node,
 
338
delete_edge, delete_node.
 
339
 
 
340
.SH LAYOUT COMMANDS
 
341
 
 
342
.TP
 
343
\fBdglayout\fR \fI?switch value?\fR ...
 
344
 
 
345
creates a new layout and returns its
 
346
.I layoutHandle.
 
347
 
 
348
\fIswitch\fR  can be any of the following:
 
349
.DS 
 
350
.ta 3c 
 
351
\fB-engine\fR   (enum)  (default geograph)
 
352
\fB-orientation\fR      (int)   (default 0) 
 
353
\fB-resolution\fR       (float) (default 1.0)
 
354
\fB-xseparation\fR      (float) (default 10.0)
 
355
\fB-yseparation\fR      (float) (default 40.0)
 
356
\fB-ticks\fR    (float) (default 1.0)
 
357
.DE
 
358
 
 
359
The possible engines are:
 
360
.DS
 
361
.ta 3c
 
362
\fBdynadag\fR   provides a strict-digraph layout with
 
363
        automatic node repositioning and spline
 
364
        curves used for edges.
 
365
\fBgeograph\fR  leaves the nodes as placed and draws
 
366
        "as-the-crow-flies" edges between them.
 
367
\fBorthogrid\fR leaves the nodes as placed and routes
 
368
        the edges in a "Manhattan" grid style.
 
369
.DE
 
370
 
 
371
The possible orientations are:
 
372
.DS
 
373
.ta 3c
 
374
\fB0\fR top to bottom
 
375
\fB1\fR left to right
 
376
\fB2\fR bottom to top
 
377
\fB3\fR right to left
 
378
.DE
 
379
 
 
380
.TP
 
381
\fIlayoutHandle\fR \fBbatch\fR \fIboolean\fI
 
382
 
 
383
When set, batches up all events in a buffer until cleared.
 
384
Initially batch is cleared so that events immediately
 
385
invoke any scripts that have been attached with "bind".
 
386
 
 
387
.TP
 
388
\fIlayoutHandle\fR \fBbind\fR \fIlayoutEvent ?script?\fR
 
389
 
 
390
attaches a script to be executed whenever a specified even occurs.
 
391
.I layoutEvent
 
392
can be any one of:
 
393
.DS 
 
394
.ta 3c 
 
395
\fBinsert_node\fR       %l %n %P
 
396
\fBinsert_edge\fR       %l %e %t %h %P
 
397
\fBmodify_node\fR       %l %n %P
 
398
\fBmodify_edge\fR       %l %e %P
 
399
\fBdelete_node\fR       %l %n
 
400
\fBdelete_edge\fR       %l %e
 
401
 
 
402
Where the substitutions are:
 
403
 
 
404
%l      the layout handle
 
405
%n      the node handle 
 
406
%t      the tail_node handle
 
407
%e      the edge handle
 
408
%h      the head_node handle
 
409
%P      the coordinates of an edge for insert_edge/modify_edge
 
410
        or the center position of a node for insert_node/modify_node
 
411
.DE
 
412
 
 
413
.PD 0
 
414
.TP
 
415
\fIlayoutHandle\fR \fBdefaultnode\fR \fI?nodeshapeswitch ...?\fR
 
416
.TP
 
417
\fIlayoutHandle\fR \fBdefaultedge\fR \fI?edgeshapeswitch ...?\fR
 
418
.PD
 
419
 
 
420
Set the default node and edge shapes in a layout.  Can be changed at
 
421
anytime but only affects the shape of nodes or edges created afterwards.
 
422
 
 
423
The possible shape switches are described in \fBSHAPES\fR.
 
424
 
 
425
.TP
 
426
\fIlayoutHandle\fR \fBdelete\fR
 
427
 
 
428
Delete all data structures associated with the layout
 
429
from the internal storage of the interpreter.
 
430
This command returns a null string.
 
431
 
 
432
.PD 0
 
433
.TP
 
434
\fIlayoutHandle\fR \fBdelete_node\fR \fInodeHandle\fR
 
435
.TP
 
436
\fIlayoutHandle\fR \fBdelete_edge\fR \fIedgeHandle\fR
 
437
.PD
 
438
 
 
439
Delete a node or edge from a layout.  The nodes existance in the
 
440
underlying graph is unaffected by this operation.
 
441
 
 
442
Execution of node or edge \fBdelete\fR from a layout will have the side effect
 
443
of also executing any scripts that have been attached to the
 
444
\fIdelete_node\fR, or \fIdelete_edge\fR, events by the
 
445
bind command on the layout.
 
446
 
 
447
.PD 0
 
448
.TP
 
449
\fIlayoutHandle\fR \fBget_node\fR \fI?nodeHandle?\fR
 
450
.TP
 
451
\fIlayoutHandle\fR \fBget_edge\fR \fI?edgeHandle?\fR
 
452
.PD
 
453
 
 
454
For nodes returns: \fIx y shape {coordinates} {nodedistances}\fR
 
455
.br
 
456
for edges returns: \fIshape {coordinates} {edgedistances}\fR
 
457
 
 
458
If the node or edge handle is ommitted then the command returns the
 
459
values of the default node or edge.
 
460
 
 
461
.PD 0
 
462
.TP
 
463
\fIlayoutHandle\fR \fBinsert_node\fR \fInodeHandle\fR \fI?nodeshapeswitch ...?\fR
 
464
.TP
 
465
\fIlayoutHandle\fR \fBinsert_edge\fR \fIedgeHandle\fR \fItailHandle\fR \fIheadHandle\fR \fI?edgeshapeswitch ...?\fR
 
466
.PD
 
467
 
 
468
Insert a node or edge into a layout.  
 
469
 
 
470
The possible shape switches are described in \fBSHAPES\fR.
 
471
 
 
472
Execution of \fBinsert_node\fR, will have the side effect of also executing
 
473
any scripts that have been attached to the \fIinsert_node\fR event by the
 
474
bind command on the layout.
 
475
 
 
476
.PD 0
 
477
.TP
 
478
\fIlayout\fR \fBmodify_node\fR \fInodeHandle\fR \fI?nodeshapeswitch ...?\fR
 
479
.TP
 
480
\fIlayout\fR \fBmodify_edge\fR \fIedgeHandle\fR \fI?edgeshapeswitch ...?\fR
 
481
.PD
 
482
 
 
483
Modify a node or edge in a layout.  
 
484
 
 
485
The possible shape switches are described in \fBSHAPES\fR.
 
486
 
 
487
Execution of \fBmodify_node\fR, will have the side effect of also executing
 
488
any scripts that have been attached to the \fImodify_node\fR event by the
 
489
bind command on the layout.
 
490
 
 
491
.SH SHAPES
 
492
 
 
493
.PD 0
 
494
.TP
 
495
\fB-shape\fR \fIpolygon|oval\fR
 
496
.TP
 
497
\fB-boundary\fR \fI{coordinates}\fR
 
498
.TP
 
499
\fB-at\fR \fIx y\fR
 
500
.TP
 
501
\fB-by\fR \fIdx dy\fR
 
502
.PD
 
503
 
 
504
These are the node shape switches.
 
505
 
 
506
The \fIshape\fR must be either \fBoval\fR or \fBpolygon\fR.  Oval
 
507
accepts just two coordinates in boundary representing a the diagonal
 
508
corners of a bounding box for the oval.  Polygons accept three or
 
509
more coordinates, each coordinate representing a vertex of the polygon
 
510
 
 
511
For \fB-boundary\fR the center of the coordinates is first computed and 
 
512
subtracted from all points. This allows shapes to be cloned
 
513
without concern for their original position.
 
514
 
 
515
\fB-at x y\fR is taken as a strong hint as to the absolute location of the node.
 
516
Some layout engines, such as \fBdynadag\fR, will modify this if the
 
517
position violates some layout constraint, such as overlapping nodes.
 
518
 
 
519
\fB-by dx dy\fR is taken as a strong hint as to the relative movement of the node.
 
520
Some layout engines, such as \fBdynadag\fR, will modify this if the new
 
521
position violates some layout constraint, such as overlapping nodes.
 
522
 
 
523
.PD 0
 
524
.TP
 
525
\fB-shape\fR \fIline|spline\fR
 
526
.TP
 
527
\fB-coordinates\fR \fI{coordinates}\fR
 
528
.PD
 
529
 
 
530
These are the edge shape switches.
 
531
 
 
532
The \fIshape\fR must be either \fBline\fR or \fBspline\fR.  
 
533
 
 
534
\fB-coordinates\fR are taken as a strpng hint as to the absolute
 
535
location of the edge.
 
536
 
 
537
.SH AUTHOR
 
538
 
 
539
John Ellson, Lucent Technologies, Holmdel, NJ. (ellson@lucent.com)
 
540
 
 
541
.SH ACKNOWLEDGEMENTS
 
542
 
 
543
John Ousterhout, of course, for 
 
544
.B tcl
 
545
and
 
546
.B tk.
 
547
Steven North and Eleftherios Koutsofios for
 
548
.B dot, libgraph
 
549
and
 
550
.B libincr.
 
551
Karl Lehenbauer and Mark Diekhans of NeoSoft
 
552
for the tclhandles.c code which was derived from tclXhandles.c.
 
553
 
 
554
.SH KEYWORDS
 
555
 
 
556
Tcldgl, Tcldgr, graph, tcl, tk, dot, tcldot, graphviz.