3
'\" Copyright (c) 1997 Lucent Technologies, Inc.
6
'\" The definitions below are for supplemental macros used in Tcl/Tk
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)
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.
22
'\" Start box enclosure. From here until next .BE, everything will be
23
'\" enclosed in one large box.
26
'\" End of box enclosure.
29
'\" Begin code excerpt.
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.
40
'\" End of vertical sidebar.
43
'\" Begin an indented unfilled display.
46
'\" End of indented unfilled display.
49
'\" Start of list of standard options for a Tk widget. The
50
'\" options follow on successive lines, in four columns separated
54
'\" End of list of standard options for a Tk widget.
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.
63
'\" Print arg1 underlined, then print arg2 normally.
65
'\" SCCS: @(#) man.macros 1.8 96/02/15 20:02:24
67
'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
71
'\" # Start an argument description
75
. ie !"\\$2"" .TP \\n()Cu
80
\&\\$1 \\fI\\$2\\fP (\\$3)
93
'\" # define tabbing values for .AP
96
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
99
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
100
.nr )C \\n()Bu+\\w'(in/out)'u+2n
102
.AS Tcl_Interp Tcl_CreateInterp in/out
103
'\" # BS - start boxed text
104
'\" # ^y = starting y location
112
.if n \l'\\n(.lu\(ul'
115
'\" # BE - end boxed text (draw box now)
120
.ie n \l'\\n(^lu\(ul'
122
.\" Draw four-sided box normally, but don't draw top of
123
.\" box if the box started on an earlier page.
125
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
128
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
135
'\" # VS - start vertical sidebar
136
'\" # ^Y = starting y location
137
'\" # ^v = 1 (for troff; for nroff this doesn't matter)
141
.ie n 'mc \s12\(br\s0
144
'\" # VE - end of vertical sidebar
152
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
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.
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
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
188
'\" # DS - begin display
194
'\" # DE - end display
200
'\" # SO - start of list of standard options
202
.SH "STANDARD OPTIONS"
208
'\" # SE - end of list of standard options
213
See the \\fBoptions\\fR manual entry for details on the standard options.
215
'\" # OP - start of full description for a single option
220
Command-Line Name: \\fB\\$1\\fR
221
Database Name: \\fB\\$2\\fR
222
Database Class: \\fB\\$3\\fR
226
'\" # CS - begin code excerpt
232
'\" # CE - end code excerpt
241
.TH TCLDGL 1 "Tcl Extension"
243
'\" Note: do not modify the .SH NAME line immediately below!
245
Tcldgl \- dynamic graph layout in tcl
250
# next line is a comment in tcl \\
252
exec tclsh "$0" ${1+"$@"}
254
package require Tcldgr
256
package require Tcldgl
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.
268
is a tcl dynamically loaded extension that uses
269
the incremental graph layout capabilities of
271
Typically it is expected to be used in conjunction
272
with Tcldgr (and libgraph(3)) which provide for maniplutation of graph
275
This program is a significant evolution from its
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
282
are no longer provided.
283
Instead the script writer is expected to use the facilities of Tk.
284
An example graph editor,
286
is provided in the distribution which provides an example of the use
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.,
302
are Tcl commands (see
306
supports several additional commands, described below.
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.
313
initially adds only one user commands to the
315
interpreter at start up, namely
318
All other "commands" are of the form:
324
refers to an existing layout.
326
The commands are described in detail below, but in summary:
334
batch, bind, defaultedge, defaultnode, delete,
336
insert_edge, insert_node,
337
modify_edge, modify_node,
338
delete_edge, delete_node.
343
\fBdglayout\fR \fI?switch value?\fR ...
345
creates a new layout and returns its
348
\fIswitch\fR can be any of the following:
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)
359
The possible engines are:
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.
371
The possible orientations are:
374
\fB0\fR top to bottom
375
\fB1\fR left to right
376
\fB2\fR bottom to top
377
\fB3\fR right to left
381
\fIlayoutHandle\fR \fBbatch\fR \fIboolean\fI
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".
388
\fIlayoutHandle\fR \fBbind\fR \fIlayoutEvent ?script?\fR
390
attaches a script to be executed whenever a specified even occurs.
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
402
Where the substitutions are:
406
%t the tail_node 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
415
\fIlayoutHandle\fR \fBdefaultnode\fR \fI?nodeshapeswitch ...?\fR
417
\fIlayoutHandle\fR \fBdefaultedge\fR \fI?edgeshapeswitch ...?\fR
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.
423
The possible shape switches are described in \fBSHAPES\fR.
426
\fIlayoutHandle\fR \fBdelete\fR
428
Delete all data structures associated with the layout
429
from the internal storage of the interpreter.
430
This command returns a null string.
434
\fIlayoutHandle\fR \fBdelete_node\fR \fInodeHandle\fR
436
\fIlayoutHandle\fR \fBdelete_edge\fR \fIedgeHandle\fR
439
Delete a node or edge from a layout. The nodes existance in the
440
underlying graph is unaffected by this operation.
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.
449
\fIlayoutHandle\fR \fBget_node\fR \fI?nodeHandle?\fR
451
\fIlayoutHandle\fR \fBget_edge\fR \fI?edgeHandle?\fR
454
For nodes returns: \fIx y shape {coordinates} {nodedistances}\fR
456
for edges returns: \fIshape {coordinates} {edgedistances}\fR
458
If the node or edge handle is ommitted then the command returns the
459
values of the default node or edge.
463
\fIlayoutHandle\fR \fBinsert_node\fR \fInodeHandle\fR \fI?nodeshapeswitch ...?\fR
465
\fIlayoutHandle\fR \fBinsert_edge\fR \fIedgeHandle\fR \fItailHandle\fR \fIheadHandle\fR \fI?edgeshapeswitch ...?\fR
468
Insert a node or edge into a layout.
470
The possible shape switches are described in \fBSHAPES\fR.
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.
478
\fIlayout\fR \fBmodify_node\fR \fInodeHandle\fR \fI?nodeshapeswitch ...?\fR
480
\fIlayout\fR \fBmodify_edge\fR \fIedgeHandle\fR \fI?edgeshapeswitch ...?\fR
483
Modify a node or edge in a layout.
485
The possible shape switches are described in \fBSHAPES\fR.
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.
495
\fB-shape\fR \fIpolygon|oval\fR
497
\fB-boundary\fR \fI{coordinates}\fR
501
\fB-by\fR \fIdx dy\fR
504
These are the node shape switches.
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
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.
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.
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.
525
\fB-shape\fR \fIline|spline\fR
527
\fB-coordinates\fR \fI{coordinates}\fR
530
These are the edge shape switches.
532
The \fIshape\fR must be either \fBline\fR or \fBspline\fR.
534
\fB-coordinates\fR are taken as a strpng hint as to the absolute
535
location of the edge.
539
John Ellson, Lucent Technologies, Holmdel, NJ. (ellson@lucent.com)
543
John Ousterhout, of course, for
547
Steven North and Eleftherios Koutsofios for
551
Karl Lehenbauer and Mark Diekhans of NeoSoft
552
for the tclhandles.c code which was derived from tclXhandles.c.
556
Tcldgl, Tcldgr, graph, tcl, tk, dot, tcldot, graphviz.