Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/graphviz/dotneato/dot.man

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TH DOT 1 "02 December 1996" \*(eX
.SH NAME
dot \- preprocessor for drawing directed graphs
.SH SYNOPSIS
\fBdot\fR [\fB\-G\fIname=value\fR]
[\fB\-N\fIname=value\fR]
[\-E\fIname=value\fR]
[\fB\-T\fIlang\fR]
[\fB\-l \fIlibfile\fR]
[\fB\-o \fIoutfile\fR]
[files]
.SH DESCRIPTION
.I dot
draws directed graphs.  It works well on DAGs and other graphs
that can be drawn as hierarchies.
It reads attributed graph files and writes drawings.
By default, the output format
.I dot
is the input file with layout coordinates appended.
To generate PostScript, use the \fB\-Tps\fP option.
Other choices are \fB-Tmif\fP (FrameMaker graphics),
\fB-Thpgl\fP (HP pen plotters), and \fB-Tpcl\fP (Laserjet printers),
\fB-Tgif\fP (pixel graphics),
\fB-Timap\fP,
and \fB-Tismap\fP (imagemap files for httpd servers 
that mark out rectangles
for each node that has a non-null URL attribute.),
\fB-Tcmap\fP, (client-side imagemap for use in html).
.PP
Here is a synopsis of the graph file language.
.PP
\fBdigraph \fIname\fP { \fIstatement-list\fP }\fR is the top level graph.
Statements may be:
.PP
\fIname\fB=\fIval\fB;\fR
.br
\fBnode [\fIname\fB=\fIval\fB];\fR
.br
\fBedge [\fIname\fB=\fIval\fB];\fR
Set default graph, node, or edge attribute \fIname\fP to \fIval\fP.
Any subgraph, node, or edge appearing after this inherits the new
default attributes.
.PP
\fBn0 [\fIname0=val0,name1=val1,...\fB];\fR
Creates node \fBn0\fP (if it does not already exist)
and sets its attributes according to the optional list. 
.PP
\fBn0 \-> n1 \-> \fI...\fB \-> nn [\fIname0=val0,name1=val1,...\fB];\fR
Creates edges between nodes \fBn0\fP, \fBn1\fP, ..., \fBnn\fP and sets
their attributes according to the optional list.
Creates nodes as necessary.
.PP
\fBsubgraph \fIname\fB { \fIstatement-list \fB}\fR
Creates a subgraph.  Subgraphs may be used in place
of \fBn0\fP, ..., \fBnn\fP in the above statements to create edges.
\fBsubgraph \fIname\fR is optional;
if missing, the subgraph is assigned an internal name. 
.PP
Comments may be /*C-like*/ or //C++-like.
.PP
Attribute names and values are ordinary (C-style) strings.
The following sections describe attributes that control graph layout.
.SH "GRAPH ATTRIBUTES"
.PP
\fBsize="\fIx,y\fP"\fR sets bounding box of drawing in inches.
.PP
\fBpage="\fIx,y\fP"\fR sets the PostScript pagination unit.
.PP
\fBratio=\fIf\fR sets the aspect ratio to \fIf\fP which may be
a floating point number, or one of the keywords \fBfill\fP,
\fBcompress\fP, or \fBauto\fP.
.PP
\fBmargin=\fIf\fR sets the page margin (included in the page size).
.PP
\fBnodesep=\fIf\fR sets the minimum separation between nodes.
.PP
\fBranksep=\fIf\fR sets the minimum separation between ranks.
.PP
\fBordering=out\fR constrains order of out-edges in a subgraph
according to their file sequence.
.PP
\fBrankdir=LR\fR requests a left-to-right drawing.
.PP
\fBpagedir=\fR[TBLR][TBLR] sets the major and minor order of pagination.
.PP
\fBrank=same\fR (or \fBmin\fP or \fBmax\fP) in a subgraph
constrains the rank assignment of its nodes.   If a subgraph's
name has the prefix \fBcluster\fP, its nodes are drawn in
a distinct rectangle of the layout.  Clusters may be nested.
.PP
\fBrotate=90\fR sets landscape mode. 
(\fBorientation=land\fR is backward compatible but obsolete.)
.PP
\fBcenter=\fIn\fR a non-zero value centers the drawing on the page.
.PP
\fBnslimit=\fIf\fR or \fBmclimit=\fIf\fR adjusts the bound on the
number of network simplex or mincross iterations by the given ratio.
For example, \fBmclimit=2.0\fP runs twice as long.
.PP
\fBlayers="\fIid:id:id:id\fR" is a sequence of layer identifiers for
overlay diagrams.  The PostScript array variable \fIlayercolorseq\fR
sets the assignment of colors to layers. The least index is 1 and 
each element must be a 3-element array to be interpreted as a color coordinate.
.PP
\fBcolor=\fIcolorvalue\fR sets foreground color (\fBbgcolor\fP for background).
.PP
\fBURL=\fI"url"\fR the default url for image map files; in PostScript files,
the base URL for all relative URLs, as recognized by Acrobat Distiller
3.0 and up.
\fBstylesheet=\fI"file.css"\fR includes a reference to a stylesheet
in -Tsvg and -Tsvgz outputs.  Ignored by other formats.
.SH "NODE ATTRIBUTES"
.PP
\fBheight=\fId\fR or \fBwidth=\fId\fR sets minimum height or width.
Adding \fBfixedsize=true\fP forces these to be the actual size
(text labels are ignored).
.PP
\fBshape=record polygon epsf \fIbuiltin_polygon\fR
.br
\fIbuiltin_polygon\fR is one of: \fBplaintext ellipse circle egg 
triangle box diamond trapezium parallelogram house hexagon octagon.\fR
(Polygons are defined or modified by the following node attributes:
\fBregular\fR, \fBperipheries\fR, \fBsides\fR, \fBorientation\fR,
\fBdistortion\fR and \fBskew\fR.)  \fBepsf\fR uses the node's
\fBshapefile\fR attribute as the path name of an external
EPSF file to be automatically loaded for the node shape.
.PP
\fBlabel=\fItext\fR where \fItext\fP may include escaped newlines
\\\|n, \\\|l, or \\\|r for center, left, and right justified lines.
The string '\\N' value will be replaced by the node name.
Record labels may contain recursive box lists delimited by { | }.
Port identifiers in labels are set off by angle brackets < >.
In the graph file, use colon (such as, \fBnode0:port28\fR).
.PP
\fBfontsize=\fIn\fR sets the label type size to \fIn\fP points.
.PP
\fBfontname=\fIname\fR sets the label font family name.
.PP
\fBcolor=\fIcolorvalue\fR sets the outline color, and the default fill color
if style=filled and \fBfillcolor\fR is not specified.
.PP
\fBfillcolor=\fIcolorvalue\fR sets the fill color
when style=filled.  If not specified, the fillcolor when style=filled defaults
to be the same as the outline color.
.PP
\fBfontcolor=\fIcolorvalue\fR sets the label text color.
.PP
A \fIcolorvalue\fP may be "\fIh,s,v\fB"\fR (hue, saturation, brightness)
floating point numbers between 0 and 1, or an X11 color name such as
\fBwhite black red green blue yellow magenta cyan\fR or \fBburlywood\fR,
or a "\fI#rrggbb" (red, green, blue, 2 hex characters each) value.
.PP
\fBstyle=filled solid dashed dotted bold invis\fP or any Postscript code.
.PP
\fBlayer=\fIid\fR or \fIid:id\fR or "all" sets the node's active layers.
The empty string means no layers (invisible).
.PP
The following attributes apply only to polygon shape nodes:
.PP
\fBregular=\fIn\fR if \fIn\fR is non-zero then the polygon is made 
regular, i.e. symmetric about the x and y axis, otherwise the
polygon takes on the aspect ratio of the label. 
\fIbuiltin_polygons\fR that are not already regular are made regular
by this attribute.
\fIbuiltin_polygons\fR that are already regular are not affected (i.e.
they cannot be made asymmetric).
.PP
\fBperipheries=\fIn\fR sets the number of periphery lines drawn around
the polygon.  This value supercedes the number of periphery lines
of \fIbuiltin_polygons\fR.
.PP
\fBsides=\fIn\fR sets the number of sides to the polygon. \fIn\fR<3
results in an ellipse.
This attribute is ignored by \fIbuiltin_polygons\fR.
.PP
\fBorientation=\fIf\fR sets the orientation of the first apex of the
polygon counterclockwise from the vertical, in degrees.
\fIf\fR may be a floating point number.
The orientation of labels is not affected by this attribute.
This attribute is added to the initial orientation of \fIbuiltin_polygons.\fR
.PP
\fBdistortion=\fIf\fR sets the amount of broadening of the top and
narrowing of the bottom of the polygon (relative to its orientation). 
Floating point values between -1 and +1 are suggested.
This attribute is ignored by \fIbuiltin_polygons\fR.
.PP                                                            
\fBskew=\fIf\fR sets the amount of right-displacement of the top and
left-displacement of the bottom of the polygon (relative to its
orientation).
Floating point values between -1 and +1 are suggested.
This attribute is ignored by \fIbuiltin_polygons\fR.
.PP
\fBURL=\fI"url"\fR sets the url for the node in imagemap, PostScript and SVG
files.
The substring '\\N' is substituted in the same manner as
for the node label attribute.
.PP
\fBtooltip=\fI"tooltip"\fR is a tooltip string for client-side imagemaps
effective when nodes have a URL.  The tooltip string defaults to be the
same as the label string, but this attribute permits nodes without
labels to still have tooltips thus permitting denser graphs.
The substring '\\N' is substituted in the same manner as
for the node label attribute.
.SH "EDGE ATTRIBUTES"
\fBminlen=\fIn\fR where \fIn\fP is an integer factor that applies
to the edge length (ranks for normal edges, or minimum node separation
for flat edges).
.PP
\fBweight=\fIn\fR where \fIn\fP is the integer cost of the edge.
Values greater than 1 tend to shorten the edge.  Weight 0 flat
edges are ignored for ordering nodes.
.PP
\fBlabel=\fItext\fR where \fItext\fR may include escaped newlines
\\\|n, \\\|l, or \\\|r for centered, left, or right justified lines.
If the substring '\\T' is found in a label it will be replaced by the tail_node name.
If the substring '\\H' is found in a label it will be replaced by the head_node name.
If the substring '\\E' value is found in a label it will be replaced by: tail_node_name->head_node_name
or by: tail_node_name--head_node_name for undirected graphs.
.PP
\fBfontsize=\fIn\fR sets the label type size to \fIn\fP points.
.PP
\fBfontname=\fIname\fR sets the label font family name.
.PP
\fBfontcolor=\fIcolorvalue\fR sets the label text color.
.PP
\fBstyle=solid dashed dotted bold invis\fP
.PP
\fBcolor=\fIcolorvalue\fR sets the line color for edges.
.PP
\fBdir=forward back both none\fP controls arrow direction.
.PP
\fBtailclip,headclip=false\fP disables endpoint shape clipping.
.PP
\fBURL=\fI"url"\fR sets the url for the node in imagemap, PostScript and SVG
files.
The substrings '\\T', '\\H', and '\\E' are substituted in the same manner as
for the edge label attribute.
.PP
\fBtooltip=\fI"tooltip"\fR is a tooltip string for client-side imagemaps
effective when edges have a URL.  The tooltip string defaults to be the
same as the edge label string. 
The substrings '\\T', '\\H', and '\\E' are substituted in the same manner as
for the edge label attribute.
.PP
\fBarrowhead,arrowtail=none, normal, inv, dot, odot, invdot, invodot,
tee, empty, invempty, open, halfopen, diamond, odiamond, box, obox, crow\fP.
.PP
\fBarrowsize\fP (norm_length=10,norm_width=5,
inv_length=6,inv_width=7,dot_radius=2) 
.PP
\fBheadlabel,taillabel=string\fP for port labels.
\fBlabelfontcolor\fP,\fBlabelfontname\fP,\fBlabelfontsize\fP
for head and tail labels.
The substrings '\\T', '\\H', and '\\E' are substituted in the same manner as
for the edge label attribute.
.PP
\fBheadURL=\fI"url"\fR sets the url for the head port in imagemap, PostScript and SVG files.
The substrings '\\T', '\\H', and '\\E' are substituted in the same manner as
for the edge label attribute.
.PP
\fBheadtooltip=\fI"tooltip"\fR is a tooltip string for client-side imagemaps
effective when head ports have a URL.  The tooltip string defaults to be the
same as the headlabel string. 
The substrings '\\T', '\\H', and '\\E' are substituted in the same manner as
for the edge label attribute.
.PP
\fBtailURL=\fI"url"\fR sets the url for the tail port in imagemap, PostScript and SVG files.
The substrings '\\T', '\\H', and '\\E' are substituted in the same manner as
for the edge label attribute.
.PP
\fBtailtooltip=\fI"tooltip"\fR is a tooltip string for client-side imagemaps
effective when tail ports have a URL.  The tooltip string defaults to be the
same as the taillabel string. 
The substrings '\\T', '\\H', and '\\E' are substituted in the same manner as
for the edge label attribute.
.PP
\fBlabeldistance\fP and \fPport_label_distance\fP set distance; also
\fBlabelangle\fP (in degrees CCW)
\.PP
\fBdecorate\fP draws line from edge to label.
.PP
\fBsamehead,sametail\fP aim edges having the same value to the
same port, using the average landing point.
.PP
\fBconstraint=false\fP causes an edge to be ignored for rank assignment.
.PP
\fBlayer=\fIid\fR or \fIid:id\fR or "all" sets the edgess active layers.
The empty string means no layers (invisible).
.SH "OPTIONS"
\fB\-G\fP sets a default graph attribute.
\fB\-N\fP and \fB\-E\fP set default attributes for nodes and edges.
Some examples: \fB\-Gsize="7,8"\fP or \fB\-Nshape=box\fP or \fB\-Efontsize=8\fP.
.PP
\fB\-l\fIfile\fR loads custom PostScript library files.
Usually these define custom shapes or styles.
If \fB-l\fP is given by itself, the standard library is omitted.
.PP
\fB\-T\fIlang\fR sets the output language as described above.
.SH "EXAMPLE"
.br
digraph test123 {
.br
        a \-> b \-> c;
.br
        a \-> {x y};
.br
        b [shape=box];
.br
        c [label="hello\\\|nworld",color=blue,fontsize=24,
.br
             fontname="Palatino-Italic",fontcolor=red,style=filled];
.br
        a \-> z [label="hi", weight=100];
.br
        x \-> z [label="multi-line\\\|nlabel"];
.br
        edge [style=dashed,color=red];
.br
        b \-> x;
.br
        {rank=same; b x}
.br
}
.br
.SH "BUGS"
Edge splines can overlap unintentionally.
.PP
Flat edge labels are slightly broken.
Intercluster edge labels are totally broken.
.PP
.SH "SEE ALSO"
.PP
dotty(1)
.br
neato(1)
.br
tcldot(n)
.br
xcolors(1)
.br
libgraph(3)
.PP
E. R. Gansner, S. C. North,  K. P. Vo, "DAG \(em A Program to Draw Directed Graphs", Software \(em  Practice and Experience 17(1), 1988, pp. 1047-1062.
.br
E. R. Gansner, E. Koutsofios, S. C. North,  K. P. Vo, "A Technique for Drawing Directed Graphs," IEEE Trans. on Soft. Eng. 19(3), 1993, pp. 214-230.
.br
S. North and E. Koutsofios, "Applications of graph visualization",
Graphics Interface 94, pp. 234-245.
.br
E. Koutsofios and S. C. North, "Drawing Graphs with dot," 
Available on research.att.com in dist/drawdag/dotguide.ps.Z.
.br
The GIF driver is a publically available library from the Quest Center
at Cold Spring Harbor Labs (courtesy Tom Boutell, [email protected]).
The Truetype font renderer for the GIF driver was written by
the Freetype Project (David Turner, Robert Wilhelm, and Werner Lemberg)
(who can be contacted at [email protected]).

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].