Manual Page Result
0
Command: graphdraw | Section: 9 | Source: UNIX v10 | File: graphdraw.9
GRAPHDRAW(9.1) GRAPHDRAW(9.1)
NAME
graphdraw graphpic - edit (combinatoric) graphs, convert to pic files
SYNOPSIS
graphdraw [ file ]
graphpic [ option ... ] file
DESCRIPTION
Graphdraw interactively edits and displays undirected graphs, and can
also be used to display real-time animation of algorithms. If a file
is mentioned, the graph stored in that file is edited.
Click button 1 in command line (at bottom of window) to type in com-
mands:
r file Read file and display graph.
w file Write current graph to file.
cd directory Change directory.
! program file Execute animation program with file as input.
q Quit.
Button 3 gets a menu of actions, which are usually accomplished by
pointing with button 1. The parenthesized equivalents in the following
list are explained under `Algorithm animation'.
create vertex
Vertex is placed where button 1 is clicked. (vc x y)
delete
Delete selected vertex and associated edges. (vd i)
move
Selected vertex moves with mouse until button 1 is released. (vm i)
copy
Copy of selected vertex and associated edges moves with mouse. (vc i x
y)
create/delete edge
Point to first endpoint and click button 1. Point to second endpoint
and click button 1. Continue selecting second endpoints with button 1.
To unselect first endpoint, click button 2. (ec i j / ed i j)
restart
Click button 1 to clear screen and discard current graph. (pr)
standard window
Restart and reshape window to standard size, in which the drawing area
is square and as large as possible.
small/large/no grid
Impose/remove visible grid to which all new coordinates will be
rounded.
exit
Click button 1 to confirm.
labels menu
label vertex
Select vertex with button 1. Current label appears on command
line. To accept it, click button 1. Otherwise, type in new la-
bel and hit return. (vl i w)
number vertices
Vertex labels are set to the consecutive integers 1,2,...; this
is the default. (vn)
label edge
Default is (el i j w)
show/hide vertex labels (vs, vh)
show/hide edge labels (es, eh)
turn Euclidean edge labels on/off
Distances are measured in pixels. (ee)
show/hide sum of edges
graphics menu
light/heavy/empty/full/invisible vertex
Select style from menu with button 3; select vertices to change
with button 1. The default is (vg i c)
light/heavy edge (eg i j c)
macros menu
Arrange for sets of vertices to act together. Actions on any vertex in
the set apply to the whole set. Copying duplicates edges internal to
the set. Creating an edge between vertexes in two different sets cre-
ates edges from every vertex in one set to every vertex in the other
(bipartite subgraph).
select set
Sweep a rectangle around the set with button 1. Dissociate con-
flicting sets.
unselect set
Dissociate set containing selected vertex.
shrink/expand set
Selected set is shrunk/expanded about its center.
reshape set
Selected set is redrawn in swept rectangle.
complete/disconnect subgraph
Create/delete edges between every pair of vertices in a set.
Graphpic is a filter which, when applied to a file in graphdraw format,
outputs pic code for the graph. The options are:
-v Print vertex labels.
-e Print edge labels.
-i Optimize for imagen printer (default is d202).
File format
Graphs are stored as adjacency lists.
First line: n m t, where n is the number of vertices, m is the number
of edges, and t is an optional graph type. The only legal type is the
default type u (undirected).
For each vertex, an initial line: d w x y c, where d is the degree of
the vertex, w is its label, x and y are its coordinates in the window,
and c is an optional graphics code, L=light (default), H=heavy (circled
dot), F=full (large bullet), E=empty (empty circle), I =invisible.
Window coordinates will be scaled to fit when graph is read in.
After the initial line follow d lines for the vertex's edges: i w c,
where i is the index (1 to n) of the other endpoint, w is the edge la-
bel, and c is an optional graphics code, L or H.
Algorithm animation
The typed command !program file causes the standard output of program
to be captured by the host and interpreted as commands to graphdraw.
The resulting movie can be killed or temporarily halted from the the
terminal by clicking button 2 and choosing the desired option from the
resulting menu.
Animation codes (defined parenthetically with menu items above) appear
one per line. Their arguments are: i, index of a vertex (normally the
ith to be created); x, y, integer coordinates in the range 0 to maxco-
ord; w a label; or c, a graphic code.
Other animation codes are
pw n Change the value of maxcoord to n. Default is 10,000.
vl i w Give vertex i the label w.
pd t Delay program for t clicks of the 60Hz clock.
ps Halt program until user clicks button 2 to continue.
pm message Print message on command line.
SEE ALSO
dag(1), pic(1)
BUGS
It is impossible to move or reshape a graphdraw layer, except via
GRAPHDRAW(9.1)