Daniel@0: Daniel@0: Daniel@0: Daniel@0:
Daniel@0:Daniel@0: All Graphviz attributes are specified by name-value pairs. Thus, to Daniel@0: set the fillcolor of a node abc, one would use Daniel@0:
abc [fillcolor = red] |
abc -> def [arrowhead = diamond] |
Daniel@0: At present, most device-independent units are either inches or Daniel@0: Daniel@0: points, Daniel@0: which we take as 72 points per inch. Daniel@0:
Daniel@0: Note: Some attributes, such as Daniel@0: dir or arrowtail, are Daniel@0: ambiguous when used in Daniel@0: DOT Daniel@0: with an undirected graph since the head and tail of an edge are meaningless. Daniel@0: As a convention, the first time an undirected edge appears, the Daniel@0: DOT Daniel@0: parser will assign the left node as the tail node and the right node as Daniel@0: the head. For example, the edge A -- B will have tail A Daniel@0: and head B. It is the user's responsibility to handle such Daniel@0: edges consistently. If the edge appears later, in the format Daniel@0:
B -- A [taillabel = "tail"] |
Daniel@0: The tools accept standard C representations for int and Daniel@0: double types. Daniel@0: For the bool type, TRUE values are Daniel@0: represented by "true" (case-insensitive) Daniel@0: and any non-zero integer, and FALSE values by "false" (case-insensitive) Daniel@0: and zero. Daniel@0: In addition, there are a variety of specialized types such as Daniel@0: arrowType, color, Daniel@0: pointf and rankdir. Legal values for these types are given Daniel@0: at the end. Daniel@0:
Daniel@0: In the Used By field, the Daniel@0: characters E, N, G, S and C Daniel@0: represent edges, nodes, the root graph, subgraphs Daniel@0: and cluster subgraphs, respectively. Daniel@0: This field indicates which graph component uses the attribute. Daniel@0:
Name | Used By | Type | Default | Minimum | Notes |
---|---|---|---|---|---|
Damping Daniel@0: | G | double | 0.99 | 0.0 | neato only |
K Daniel@0: | GC | double | 0.3 | 0 | sfdp, fdp only |
URL Daniel@0: | ENGC | escString Daniel@0: | <none> | svg, postscript, map only | |
arrowhead Daniel@0: | E | arrowType Daniel@0: | normal | ||
arrowsize Daniel@0: | E | double | 1.0 | 0.0 | |
arrowtail Daniel@0: | E | arrowType Daniel@0: | normal | ||
aspect Daniel@0: | G | aspectType Daniel@0: | dot only | ||
bb Daniel@0: | G | rect Daniel@0: | write only | ||
bgcolor Daniel@0: | GC | color Daniel@0: | <none> | ||
center Daniel@0: | G | bool Daniel@0: | false | ||
charset Daniel@0: | G | string | "UTF-8" | ||
clusterrank Daniel@0: | G | clusterMode Daniel@0: | local | dot only | |
color Daniel@0: | ENC | color
Daniel@0: colorList Daniel@0: | black | ||
colorscheme Daniel@0: | ENCG | string | "" | ||
comment Daniel@0: | ENG | string | "" | ||
compound Daniel@0: | G | bool Daniel@0: | false | dot only | |
concentrate Daniel@0: | G | bool Daniel@0: | false | ||
constraint Daniel@0: | E | bool Daniel@0: | true | dot only | |
decorate Daniel@0: | E | bool Daniel@0: | false | ||
defaultdist Daniel@0: | G | double | 1+(avg. len)*sqrt(|V|) | epsilon | neato only |
dim Daniel@0: | G | int | 2 | 2 | sfdp, fdp, neato only |
dimen Daniel@0: | G | int | 2 | 2 | sfdp, fdp, neato only |
dir Daniel@0: | E | dirType Daniel@0: | forward(directed) none(undirected) | ||
diredgeconstraints Daniel@0: | G | string bool Daniel@0: | false | neato only | |
distortion Daniel@0: | N | double | 0.0 | -100.0 | |
dpi Daniel@0: | G | double | 96.0 0.0 | svg, bitmap output only | |
edgeURL Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
edgehref Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
edgetarget Daniel@0: | E | escString Daniel@0: | <none> | svg, map only | |
edgetooltip Daniel@0: | E | escString Daniel@0: | "" | svg, cmap only | |
epsilon Daniel@0: | G | double | .0001 * # nodes(mode == KK) .0001(mode == major) | neato only | |
esep Daniel@0: | G | double pointf Daniel@0: | +3 | not dot | |
fillcolor Daniel@0: | NC | color Daniel@0: | lightgrey(nodes) black(clusters) | ||
fixedsize Daniel@0: | N | bool Daniel@0: | false | ||
fontcolor Daniel@0: | ENGC | color Daniel@0: | black | ||
fontname Daniel@0: | ENGC | string | "Times-Roman" | ||
fontnames Daniel@0: | G | string | "" | svg only | |
fontpath Daniel@0: | G | string | system-dependent | ||
fontsize Daniel@0: | ENGC | double | 14.0 | 1.0 | |
group Daniel@0: | N | string | "" | dot only | |
headURL Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
headclip Daniel@0: | E | bool Daniel@0: | true | ||
headhref Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
headlabel Daniel@0: | E | lblString Daniel@0: | "" | ||
headport Daniel@0: | E | portPos Daniel@0: | center | ||
headtarget Daniel@0: | E | escString Daniel@0: | <none> | svg, map only | |
headtooltip Daniel@0: | E | escString Daniel@0: | "" | svg, cmap only | |
height Daniel@0: | N | double | 0.5 | 0.02 | |
href Daniel@0: | E | escString Daniel@0: | "" | svg, postscript, map only | |
id Daniel@0: | GNE | lblString Daniel@0: | "" | svg, postscript, map only | |
image Daniel@0: | N | string | "" | ||
imagescale Daniel@0: | N | bool
Daniel@0: string | false | ||
label Daniel@0: | ENGC | lblString Daniel@0: | "\N" (nodes) "" (otherwise) | ||
labelURL Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
labelangle Daniel@0: | E | double | -25.0 | -180.0 | |
labeldistance Daniel@0: | E | double | 1.0 | 0.0 | |
labelfloat Daniel@0: | E | bool Daniel@0: | false | ||
labelfontcolor Daniel@0: | E | color Daniel@0: | black | ||
labelfontname Daniel@0: | E | string | "Times-Roman" | ||
labelfontsize Daniel@0: | E | double | 14.0 | 1.0 | |
labelhref Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
labeljust Daniel@0: | GC | string | "c" | ||
labelloc Daniel@0: | GC | string | "t"(clusters) "b"(root graphs) | ||
labelloc Daniel@0: | N | string | "c"(clusters) | ||
labeltarget Daniel@0: | E | escString Daniel@0: | <none> | svg, map only | |
labeltooltip Daniel@0: | E | escString Daniel@0: | "" | svg, cmap only | |
landscape Daniel@0: | G | bool Daniel@0: | false | ||
layer Daniel@0: | EN | layerRange Daniel@0: | "" | ||
layers Daniel@0: | G | layerList Daniel@0: | "" | ||
layersep Daniel@0: | G | string | " :\t" | ||
layout Daniel@0: | G | string | "" | ||
len Daniel@0: | E | double | 1.0(neato) 0.3(fdp) | fdp, neato only | |
levels Daniel@0: | G | int | MAXINT | 0.0 | sfdp only |
levelsgap Daniel@0: | G | double | 0.0 | neato only | |
lhead Daniel@0: | E | string | "" | dot only | |
lp Daniel@0: | EGC | point Daniel@0: | write only | ||
ltail Daniel@0: | E | string | "" | dot only | |
margin Daniel@0: | NG | double pointf Daniel@0: | <device-dependent> | ||
maxiter Daniel@0: | G | int | 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) | fdp, neato only | |
mclimit Daniel@0: | G | double | 1.0 | dot only | |
mindist Daniel@0: | G | double | 1.0 | 0.0 | circo only |
minlen Daniel@0: | E | int | 1 | 0 | dot only |
mode Daniel@0: | G | string | "major" | neato only | |
model Daniel@0: | G | string | "shortpath" | neato only | |
mosek Daniel@0: | G | bool Daniel@0: | false | neato only | |
nodesep Daniel@0: | G | double | 0.25 | 0.02 | dot only |
nojustify Daniel@0: | GCNE | bool Daniel@0: | false | ||
normalize Daniel@0: | G | bool Daniel@0: | false | not dot | |
nslimit
Daniel@0: nslimit1 Daniel@0: | G | double | dot only | ||
ordering Daniel@0: | G | string | "" | dot only | |
orientation Daniel@0: | N | double | 0.0 | 360.0 | |
orientation Daniel@0: | G | string | "" | ||
outputorder Daniel@0: | G | outputMode Daniel@0: | breadthfirst | ||
overlap Daniel@0: | G | string bool Daniel@0: | true | not dot | |
overlap_scaling Daniel@0: | G | double | -4 | -1.0e10 | prism only |
pack Daniel@0: | G | bool
Daniel@0: int | false | not dot | |
packmode Daniel@0: | G | packMode Daniel@0: | node | not dot | |
pad Daniel@0: | G | double pointf Daniel@0: | 0.0555 (4 points) | ||
page Daniel@0: | G | pointf Daniel@0: | |||
pagedir Daniel@0: | G | pagedir Daniel@0: | BL | ||
pencolor Daniel@0: | C | color Daniel@0: | black | ||
penwidth Daniel@0: | CNE | double | 1.0 | 0.0 | |
peripheries Daniel@0: | NC | int | shape default(nodes) 1(clusters) | 0 | |
pin Daniel@0: | N | bool Daniel@0: | false | fdp, neato only | |
pos Daniel@0: | EN | point
Daniel@0: splineType Daniel@0: | |||
quadtree Daniel@0: | G | quadType
Daniel@0: bool Daniel@0: | "normal" | sfdp only | |
quantum Daniel@0: | G | double | 0.0 | 0.0 | |
rank Daniel@0: | S | rankType Daniel@0: | dot only | ||
rankdir Daniel@0: | G | rankdir Daniel@0: | TB | dot only | |
ranksep Daniel@0: | G | double | 0.5(dot) 1.0(twopi) | 0.02 | twopi, dot only |
ratio Daniel@0: | G | double string | |||
rects Daniel@0: | N | rect Daniel@0: | write only | ||
regular Daniel@0: | N | bool Daniel@0: | false | ||
remincross Daniel@0: | G | bool Daniel@0: | false | dot only | |
repulsiveforce Daniel@0: | G | double | 1.0 | 0.0 | sfdp only |
resolution Daniel@0: | G | double | 96.0 0.0 | svg, bitmap output only | |
root Daniel@0: | GN | string bool Daniel@0: | ""(graphs) false(nodes) | circo, twopi only | |
rotate Daniel@0: | G | int | 0 | ||
samehead Daniel@0: | E | string | "" | dot only | |
sametail Daniel@0: | E | string | "" | dot only | |
samplepoints Daniel@0: | N | int | 8(output) 20(overlap and image maps) | ||
searchsize Daniel@0: | G | int | 30 | dot only | |
sep Daniel@0: | G | double pointf Daniel@0: | +4 | not dot | |
shape Daniel@0: | N | shape Daniel@0: | ellipse | ||
shapefile Daniel@0: | N | string | "" | ||
showboxes Daniel@0: | ENG | int | 0 | 0 | dot only |
sides Daniel@0: | N | int | 4 | 0 | |
size Daniel@0: | G | pointf Daniel@0: | |||
skew Daniel@0: | N | double | 0.0 | -100.0 | |
smoothing Daniel@0: | G | smoothType Daniel@0: | "none" | sfdp only | |
sortv Daniel@0: | GCN | int | 0 | 0 | |
splines Daniel@0: | G | bool
Daniel@0: string | |||
start Daniel@0: | G | startType Daniel@0: | "" | fdp, neato only | |
style Daniel@0: | ENC | style Daniel@0: | |||
stylesheet Daniel@0: | G | string | "" | svg only | |
tailURL Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
tailclip Daniel@0: | E | bool Daniel@0: | true | ||
tailhref Daniel@0: | E | escString Daniel@0: | "" | svg, map only | |
taillabel Daniel@0: | E | lblString Daniel@0: | "" | ||
tailport Daniel@0: | E | portPos Daniel@0: | center | ||
tailtarget Daniel@0: | E | escString Daniel@0: | <none> | svg, map only | |
tailtooltip Daniel@0: | E | escString Daniel@0: | "" | svg, cmap only | |
target Daniel@0: | ENGC | escString
Daniel@0: string | <none> | svg, map only | |
tooltip Daniel@0: | NEC | escString Daniel@0: | "" | svg, cmap only | |
truecolor Daniel@0: | G | bool Daniel@0: | bitmap output only | ||
vertices Daniel@0: | N | pointfList Daniel@0: | write only | ||
viewport Daniel@0: | G | viewPort Daniel@0: | "" | ||
voro_margin Daniel@0: | G | double | 0.05 | 0.0 | not dot |
weight Daniel@0: | E | double | 1.0 | 0(dot) 1(neato,fdp,sfdp) | |
width Daniel@0: | N | double | 0.75 | 0.01 | |
z Daniel@0: | N | double | 0.0 | -MAXFLOAT -1000 |
Daniel@0: For svg, cmapx and imap output, the active area for a node is its Daniel@0: visible image. Daniel@0: For example, an unfilled Daniel@0: node with no drawn boundary will only be active on its label. Daniel@0: For other output, the active area is its bounding box. Daniel@0: The active area for a cluster is its bounding box. Daniel@0: For edges, the active areas are small circles where the edge contacts its head Daniel@0: and tail nodes. In addition, for svg, cmapx and imap, the active area Daniel@0: includes a thin polygon approximating the edge. The circles may Daniel@0: overlap the related node, and the edge URL dominates. Daniel@0: If the edge has a label, this will also be active. Daniel@0: Finally, if the edge has a head or tail label, this will also be active. Daniel@0:
Daniel@0: Note that, for edges, the attributes headURL, Daniel@0: tailURL, labelURL and Daniel@0: edgeURL allow control of various parts of an Daniel@0: edge. Daniel@0: Also note that, if active areas of two edges overlap, it is unspecified Daniel@0: which area dominates. Daniel@0: Daniel@0:
Daniel@0: By default, dot will do 5 passes attempting to achieve the desired Daniel@0: aspect ratio. For certain graphs, more passes will be needed to get Daniel@0: close enough. The aspect attribute can also be used to Daniel@0: specify the maximum number of passes to try. Daniel@0:
Daniel@0: At present, there is no mechanism for widening a very tall layout.
Daniel@0: Also, the algorithm doesn't handle clusters, nor disconnected graphs.
Daniel@0: For the latter case, one can split the pipeline
Daniel@0: ccomps -x | dot | gvpack | neato -n2
Daniel@0: to get a similar effect.
Daniel@0:
Daniel@0:
Daniel@0: If no background color is specified for the root graph, no graphics Daniel@0: operation are performed on the background. This works fine for Daniel@0: PostScript but for bitmap output, all bits are initialized to something. Daniel@0: This means that when the bitmap output is included in some other Daniel@0: document, all of the bits within the bitmap's bounding box will be Daniel@0: set, overwriting whatever color or graphics where already on the page. Daniel@0: If this effect is not desired, and you only want to set bits explicitly Daniel@0: assigned in drawing the graph, set bgcolor="transparent". Daniel@0: Daniel@0:
Daniel@0: For edges, the value Daniel@0: can either be a single color or a colorList. Daniel@0: In the latter case, the edge is drawn using parallel splines or lines, Daniel@0: one for each color in the list, in the order given. Daniel@0: The head arrow, if any, is drawn using the first color in the list, Daniel@0: and the tail arrow, if any, the second color. This supports the common Daniel@0: case of drawing opposing edges, but using parallel splines instead of Daniel@0: separately routed multiedges. For example, the graph Daniel@0:
Daniel@0: digraph G { Daniel@0: a -> b [dir=both color="red:blue"] Daniel@0: } Daniel@0:Daniel@0: yields
Daniel@0: digraph G { Daniel@0: a -> c; Daniel@0: a -> b; Daniel@0: b -> c [constraint=false]; Daniel@0: } Daniel@0:Daniel@0: the edge
b -> c
does not add a constraint during rank
Daniel@0: assignment, so the only constraints are that a be above b and c,
Daniel@0: yielding the graph:Daniel@0: Note that a cluster inherits the root graph's attributes if defined. Daniel@0: Thus, if the root graph has defined a fillcolor, this will override a Daniel@0: color or bgcolor attribute set for the cluster. Daniel@0: Daniel@0:
Daniel@0: If Graphviz was built using the Daniel@0: fontconfig library, the latter library Daniel@0: will be used to search for the font. However, if the fontname string Daniel@0: contains a slash character "/", it is treated as a pathname for the font Daniel@0: file, though font lookup will append the usual font suffixes. Daniel@0:
Daniel@0: If Graphviz does not use fontconfig, fontname will be Daniel@0: considered the name of a Type 1 or True Type font file. Daniel@0: If you specify fontname=schlbk, the tool will look for a Daniel@0: file named schlbk.ttf or schlbk.pfa or schlbk.pfb Daniel@0: in one of the directories specified by Daniel@0: the fontpath attribute. Daniel@0: The lookup does support various aliases for the common fonts. Daniel@0: Daniel@0:
Daniel@0: Unlike with the shapefile attribute, Daniel@0: the image is treated as node Daniel@0: content rather than the entire node. In particular, an image can Daniel@0: be contained in a node of any shape, not just a rectangle. Daniel@0: Daniel@0:
Daniel@0: During rendering, in the default case (imagescale=false), Daniel@0: the image retains its natural size. Daniel@0: If imagescale=true, Daniel@0: the image is uniformly scaled (i.e., its aspect ratio is Daniel@0: preserved) to fit inside the node. Daniel@0: At least one dimension of the image will be as large as possible Daniel@0: given the size of the node. Daniel@0: When imagescale=width, Daniel@0: the width of the image is scaled to fill the node width. Daniel@0: The corresponding property holds when imagescale=height. Daniel@0: When imagescale=both, Daniel@0: both the height and the width are scaled separately to fill the node. Daniel@0:
Daniel@0: In all cases, if a dimension of the image is larger than the Daniel@0: corresponding dimension of the node, that dimension of the Daniel@0: image is scaled down to fit the node. As with the case of Daniel@0: expansion, if imagescale=true, width and height are Daniel@0: scaled uniformly. Daniel@0: Daniel@0:
Daniel@0: The angle, in degrees, specifies the rotation from the 0 degree ray, Daniel@0: with positive angles moving counterclockwise and negative angles Daniel@0: moving clockwise. Daniel@0: Daniel@0:
Daniel@0: This attribute takes precedence over Daniel@0: the -K flag Daniel@0: or the actual command name used. Daniel@0: Daniel@0:
Daniel@0: Note that the margin is not part of the drawing but just empty space Daniel@0: left around the drawing. It basically corresponds to a translation of Daniel@0: drawing, as would be necessary to center a drawing on a page. Nothing Daniel@0: is actually drawn in the margin. To actually extend the background of Daniel@0: a drawing, see the pad attribute. Daniel@0:
Daniel@0: For nodes, this attribute specifies space left around the node's label. Daniel@0: By default, the value is 0.11,0.055. Daniel@0: Daniel@0:
Daniel@0: There are two new, experimental modes in neato, "hier", which adds a top-down Daniel@0: directionality similar to the layout used in dot, and "ipsep", which Daniel@0: allows the graph to specify minimum vertical and horizontal distances Daniel@0: between nodes. (See the sep attribute.) Daniel@0: Daniel@0:
Daniel@0: If sfdp is available, one can set overlap to "prism" to use a Daniel@0: proximity graph-based algorithm for overlap removal. Daniel@0: This is the preferred technique, Daniel@0: though "scale" and "false" can work well with small graphs. Daniel@0: This technique starts with a Daniel@0: small scaling up, controlled by the Daniel@0: overlap_scaling attribute, Daniel@0: which can remove a significant portion of the overlap. Daniel@0: The prism option also accepts an optional non-negative integer suffix. Daniel@0: This can be used to control the number of attempts made at overlap Daniel@0: removal. By default, overlap="prism" is equivalent to Daniel@0: overlap="prism1000". Setting overlap="prism0" Daniel@0: causes only the scaling phase to be run. Daniel@0:
Daniel@0: If the value is "compress", the layout will be scaled down as much as Daniel@0: possible without introducing any overlaps, obviously assuming there are Daniel@0: none to begin with. Daniel@0:
Daniel@0: N.B.The remaining allowed values of overlap Daniel@0: correspond to algorithms which, at present, can produce bad aspect ratios. Daniel@0: In addition, we deprecate the use of the "ortho*" and "portho*". Daniel@0:
Daniel@0: If the value is "vpsc", overlap removal is done as a Daniel@0: quadratic optimization to minimize node displacement while removing Daniel@0: node overlaps. Daniel@0:
Daniel@0: If the value is "orthoxy" or "orthoyx", overlaps Daniel@0: are moved by optimizing two constraint problems, one for the x axis and Daniel@0: one for the y. The suffix indicates which axis is processed first. Daniel@0: If the value is "ortho", the technique is similar to "orthoxy" except a Daniel@0: heuristic is used to reduce the bias between the two passes. Daniel@0: If the value is "ortho_yx", the technique is the same as "ortho", except Daniel@0: the roles of x and y are reversed. Daniel@0: The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar Daniel@0: to the previous four, except only pseudo-orthogonal ordering is Daniel@0: enforced. Daniel@0:
Daniel@0: If the layout is done by neato with mode="ipsep", Daniel@0: then one can use overlap=ipsep. Daniel@0: In this case, the overlap removal constraints are Daniel@0: incorporated into the layout algorithm itself. Daniel@0: N.B. At present, this only supports one level of clustering. Daniel@0:
Daniel@0: Except for fdp and sfdp, the layouts assume overlap="true" as the default. Daniel@0: Fdp first uses a number of passes using built-in, force-directed technique Daniel@0: to remove overlaps. Thus, fdp accepts overlap with an integer Daniel@0: prefix followed by a colon, specifying the number of tries. If there is Daniel@0: no prefix, no initial tries will be performed. If there is nothing following Daniel@0: a colon, none of the above methods will be attempted. By default, fdp Daniel@0: uses overlap="9:portho". Note that overlap="true", Daniel@0: overlap="0:true" and overlap="0:" all turn off all overlap Daniel@0: removal. Daniel@0:
Daniel@0: By default, sfdp uses overlap="prism0". Daniel@0:
Daniel@0: Except for the Voronoi and prism methods, all of these transforms preserve the Daniel@0: orthogonal ordering of the original layout. That is, if the x coordinates Daniel@0: of two nodes are originally the same, they will remain the same, and if Daniel@0: the x coordinate of one node is originally less than the x coordinate of Daniel@0: another, this relation will still hold in the transformed layout. The Daniel@0: similar properties hold for the y coordinates. Daniel@0: This is not quite true for the "porth*" cases. For these, orthogonal Daniel@0: ordering is only preserved among nodes related by an edge. Daniel@0: Daniel@0:
Daniel@0: If overlap_scaling is negative, the layout is scaled by Daniel@0: -1*overlap_scaling times the average label size. Daniel@0: If overlap_scaling is positive, the layout is scaled by Daniel@0: overlap_scaling. Daniel@0: If overlap_scaling is zero, no scaling is done. Daniel@0: Daniel@0:
Daniel@0: For layouts which always do packing, such a twopi, the pack Daniel@0: attribute is just used to set the margin. Daniel@0: Daniel@0:
Daniel@0: Normally, a small pad is used for aesthetic reasons, especially when Daniel@0: a background color is used, to avoid having nodes and edges abutting Daniel@0: the boundary of the drawn region. Daniel@0: Daniel@0:
Daniel@0: At present, this only works for PostScript output. For other types of Daniel@0: output, one should use another tool to split the output into multiple Daniel@0: output files. Or use the viewport to generate Daniel@0: multiple files. Daniel@0: Daniel@0:
Daniel@0: Note that a cluster inherits the root graph's attributes if defined. Daniel@0: Thus, if the root graph has defined a pencolor, this will override a Daniel@0: color or bgcolor attribute set for the cluster. Daniel@0: Daniel@0:
Daniel@0: Previous to 31 January 2008, the effect of penwidth=W Daniel@0: was achieved by including setlinewidth(W) Daniel@0: as part of a style specification. Daniel@0: If both are used, penwidth will be used. Daniel@0: Daniel@0:
Daniel@0: Note: Due to an artifact of the implementation, final coordinates Daniel@0: are translated to the origin. Thus, if you look at the output coordinates Daniel@0: given in the (x)dot or plain format, pinned nodes will not have the same Daniel@0: output coordinates as were given on input. If this is important, a Daniel@0: simple workaround is to maintain the coordinates of a pinned node. The vector Daniel@0: difference between the old and new coordinates will give the translation, Daniel@0: which can then be subtracted from all of the appropriate coordinates. Daniel@0: Daniel@0:
Daniel@0: In neato and fdp, pos can be used to set the initial position of a node. Daniel@0: By default, the coordinates are assumed to be in inches. However, the Daniel@0: -s command line flag can be used to specify Daniel@0: different units. As the output coordinates are in points, Daniel@0: feeding the output of a graph laid out by a Graphviz program into Daniel@0: neato or fdp will almost always require the -s flag. Daniel@0:
Daniel@0: When the -n command line flag is used with Daniel@0: neato, it is assumed the positions have been set by one of the layout Daniel@0: programs, and are therefore in points. Thus, neato -n can accept Daniel@0: input correctly without requiring a -s flag and, in fact, Daniel@0: ignores any such flag. Daniel@0: Daniel@0:
Daniel@0: A TRUE bool value corresponds to "normal"; Daniel@0: a FALSE bool value corresponds to "none". Daniel@0: As a slight exception to the normal interpretation of bool, Daniel@0: a value of "2" corresponds to "fast". Daniel@0: Daniel@0:
T -> H;
will go
Daniel@0: from left to right. By default, graphs are laid out from top to bottom.
Daniel@0: Daniel@0: This attribute also has a side-effect in determining how record nodes Daniel@0: are interpreted. See record shapes. Daniel@0: Daniel@0:
Daniel@0: If ratio is numeric, it is taken as the desired aspect ratio. Daniel@0: Then, if the actual aspect ratio is less than the desired ratio, Daniel@0: the drawing height is scaled up to achieve the Daniel@0: desired ratio; if the actual ratio is greater than that desired ratio, Daniel@0: the drawing width is scaled up. Daniel@0:
Daniel@0: If ratio = "fill" and the size Daniel@0: attribute is set, node positions are scaled, separately in both x Daniel@0: and y, so that the final drawing exactly fills the specified size. Daniel@0:
Daniel@0: If ratio = "compress" and the size Daniel@0: attribute is set, dot attempts to compress the initial layout to fit Daniel@0: in the given size. This achieves a tighter packing of nodes but Daniel@0: reduces the balance and symmetry. This feature only works in dot. Daniel@0:
Daniel@0: If ratio = "expand", the size Daniel@0: attribute is set, and both the width and the height of the graph are Daniel@0: less than the value in size, node positions are scaled Daniel@0: uniformly until at least Daniel@0: one dimension fits size exactly. Daniel@0: Note that this is distinct from using size as the Daniel@0: desired size, as here the drawing is expanded before edges are generated and Daniel@0: all node and text sizes remain unchanged. Daniel@0:
Daniel@0: If ratio = "auto", the page Daniel@0: attribute is set and the graph cannot be drawn on a single page, Daniel@0: then size is set to an ``ideal'' value. Daniel@0: In particular, the size in a given dimension will be the smallest integral Daniel@0: multiple of the page size in that dimension which is at least half the Daniel@0: current size. The two dimensions are then scaled independently to the Daniel@0: new size. This feature only works in dot. Daniel@0: Daniel@0:
Daniel@0: If the attribute begins with a plus sign '+', an additive margin is Daniel@0: specified. That is, "+w,h" causes the node's bounding box to be increased Daniel@0: by w Daniel@0: points on the left and right sides, and by h points on the top and bottom. Daniel@0: Without a plus sign, the node is scaled by 1 + w in the x coordinate Daniel@0: and 1 + h in the y coordinate. Daniel@0:
Daniel@0: If only a single number is given, this is used for both dimensions. Daniel@0:
Daniel@0: If unset but esep is defined, the sep values Daniel@0: will be set to the esep values divided by 0.8. Daniel@0: If esep is unset, the default value is used. Daniel@0: Daniel@0:
Daniel@0: There is one exception to this usage. Daniel@0: If shape is set to "epsf", shapefile gives Daniel@0: a filename containing a definition of the node in PostScript. Daniel@0: The graphics defined must be contain all of the Daniel@0: node content, including any desired boundaries. Daniel@0: For further details, see Daniel@0: Daniel@0: External PostScript files. Daniel@0: Daniel@0:
Daniel@0: If size ends in an exclamation point (!), Daniel@0: then it is taken to be Daniel@0: the desired size. In this case, if both dimensions of the drawing are Daniel@0: less than size, the drawing is scaled up uniformly until at Daniel@0: least one dimension equals its dimension in size. Daniel@0:
Daniel@0: Note that there is some interaction between the size and Daniel@0: ratio attributes. Daniel@0: Daniel@0:
Daniel@0: (1 March 2007) The values line and spline can be Daniel@0: used as synonyms for false and true, respectively. Daniel@0: In addition, the value polyline specifies that edges should be Daniel@0: drawn as polylines. Daniel@0:
Daniel@0: By default, the attribute is unset. How this is interpreted depends on Daniel@0: the layout. For dot, the default is to draw edges as splines. For all Daniel@0: other layouts, the default is to draw edges as line segments. Note that Daniel@0: for these latter layouts, if splines="true", this Daniel@0: requires non-overlapping nodes (cf. overlap). Daniel@0: If fdp is used for layout and splines="compound", then the edges are Daniel@0: drawn to avoid clusters as well as nodes. Daniel@0: Daniel@0:
Daniel@0: Use of color palettes results in less memory usage during creation of the Daniel@0: bitmaps and smaller output files. Daniel@0:
Daniel@0: Usually, the only time it is necessary to specify the truetype model Daniel@0: is if the graph uses more than 256 colors. Daniel@0: However, if one uses bgcolor=transparent with Daniel@0: a color palette, font Daniel@0: antialiasing can show up as a fuzzy white area around characters. Daniel@0: Using truecolor=true avoids this problem. Daniel@0: Daniel@0:
Daniel@0: Provides z coordinate value for 3D layouts and displays. If the Daniel@0: graph has dim set to 3 (or more), Daniel@0: neato will use a node's z value Daniel@0: for the z coordinate of its initial position if Daniel@0: its pos attribute is also defined. Daniel@0:
Daniel@0: Even if no z values are specified in the input, it is necessary to Daniel@0: declare a z attribute for nodes, e.g, using node[z=""] Daniel@0: in order to get z values on output. Daniel@0: Thus, setting dim=3 but not declaring z will Daniel@0: cause neato -Tvrml to Daniel@0: layout the graph in 3D but project the layout onto the xy-plane Daniel@0: for the rendering. If the z attribute is declared, the final rendering Daniel@0: will be in 3D. Daniel@0: Daniel@0:
"normal" | ![]() | "inv" | ![]() |
"dot" | ![]() | "invdot" | ![]() |
"odot" | ![]() | "invodot" | ![]() |
"none" | ![]() | "tee" | ![]() |
"empty" | ![]() | "invempty" | ![]() |
"diamond" | ![]() | "odiamond" | ![]() |
"ediamond" | ![]() | "crow" | ![]() |
"box" | ![]() | "obox" | ![]() |
"open" | ![]() | "halfopen" | ![]() |
"vee" | ![]() |
Daniel@0: These are the basic set of backward-compatible arrow shapes. In addition, Daniel@0: there is a grammar of arrow shapes Daniel@0: which can be used to describe a collection of 1,544,761 arrow combinations of the 36 varations of the primitive set of 9 arrows. The basic arrows shown Daniel@0: above contain all of the primitive shapes Daniel@0: (box, crow, diamond, Daniel@0: dot, inv, none, Daniel@0: normal, tee, vee) Daniel@0: plus ones that can be derived from the grammar Daniel@0: (odot, invdot, invodot, Daniel@0: obox, odiamond) Daniel@0: plus some supported as special cases for backward-compatibility Daniel@0: (ediamond, open, halfopen, Daniel@0: empty, invempty). Daniel@0: Daniel@0:
An aspect ratio, double, followed optionally by a ',' and a maximum pass Daniel@0: count. If the aspect ratio is given, but no maximum pass count, the Daniel@0: latter defaults to 5. Daniel@0: Daniel@0:
"#%2x%2x%2x" | Red-Green-Blue (RGB) |
"#%2x%2x%2x%2x" | Red-Green-Blue-Alpha (RGBA) |
H[, ]+S[, ]+V | Hue-Saturation-Value (HSV) 0.0 <= H,S,V <= 1.0 |
string | color name |
Daniel@0: String-valued color specifications are case-insensitive and interpreted Daniel@0: in the context of the current color scheme, as specified by the Daniel@0: colorscheme attribute. If this is undefined, Daniel@0: the X11 naming scheme will be used. Daniel@0: An initial "/" character can be used to override the use of Daniel@0: the colorscheme attribute. In particular, a single initial Daniel@0: "/" will cause the string to be evaluated using the default Daniel@0: X11 naming. If the color value has the form "/ssss/yyyy", Daniel@0: the name yyyy is interpreted using the schema ssss. Daniel@0: If the color scheme name is empty, i.e., the color has the Daniel@0: form "//yyyy", the colorscheme attribute is used. Daniel@0: Thus, the forms "yyyy" and "//yyyy" are Daniel@0: equivalent. Daniel@0:
At present, Graphviz recognizes the default color scheme X11, Daniel@0: and the Brewer color schemes. Please note that Brewer Daniel@0: color schemes are covered by this license. Daniel@0:
Daniel@0: Examples:
Daniel@0:
Color | RGB | HSV | String |
---|---|---|---|
White | "#ffffff" | "0.000 0.000 1.000" | "white" |
Black | "#000000" | "0.000 0.000 0.000" | "black" |
Red | "#ff0000" | "0.000 1.000 1.000" | "red" |
Turquoise | "#40e0d0" | "0.482 0.714 0.878" | "turquoise" |
Sienna | "#a0522d" | "0.051 0.718 0.627" | "sienna" |
Daniel@0: Note that some output formats, e.g., mif, Daniel@0: only support a limited number of specific colors. Daniel@0:
Daniel@0: The string value transparent can be used to indicate no color. Daniel@0: This is only available in the output formats Daniel@0: ps, svg, fig, vmrl, and the bitmap formats. It can be used whenever a Daniel@0: color is needed but is most useful with Daniel@0: the bgcolor attribute. Daniel@0: Usually, the same effect can be achieved by setting Daniel@0: style to invis. Daniel@0: Daniel@0:
T -> H;
Daniel@0: "forward" | ![]() | "back" | ![]() |
"both" | ![]() | "none" | ![]() |
T -- H;
, one of the nodes, usually
Daniel@0: the righthand one, is treated as the head for the purpose of
Daniel@0: interpreting "forward" and "back".
Daniel@0:
Daniel@0: Daniel@0: In addition, if the associated attribute is Daniel@0: label, Daniel@0: headlabel or taillabel, Daniel@0: the escape sequences "\n", "\l" and "\r" Daniel@0: divide the label into lines, centered, left-justified, and right-justified, Daniel@0: respectively. Daniel@0: Daniel@0:
Daniel@0: The modes "node", "clust" or "graph" Daniel@0: specify that the components should be packed together tightly, using Daniel@0: the specified granularity. Daniel@0: A value of "node" causes Daniel@0: packing at the node and edge level, with no overlapping of these objects. Daniel@0: This produces a layout with the least area, but it also allows interleaving, Daniel@0: where a node of one component may lie between two nodes in another Daniel@0: component. A value of "graph" does a packing using the bounding box of the Daniel@0: component. Thus, there will be a rectangular region around a component Daniel@0: free of elements of any other component. Daniel@0: A value of "clust" guarantees that top-level clusters are kept intact. Daniel@0: What effect a value has also depends on the layout algorithm. For Daniel@0: example, neato does not support clusters, so a value of "clust" will Daniel@0: have the same effect as the default "node" value. Daniel@0:
Daniel@0: The mode "array[_flags][%d]" Daniel@0: indicates that the components should be packed at the Daniel@0: graph level into an array of graphs. By default, the components Daniel@0: are in row-major order, with the number of columns roughly the Daniel@0: square root of the number of components. If the optional flags Daniel@0: contains "c", then column-major order is used. Finally, if the Daniel@0: optional integer suffix is used, this specifies the number of Daniel@0: columns for row-major or the number of rows for column-major. Daniel@0: Thus, the mode "array_c4" indicates array packing, with 4 rows, Daniel@0: starting in the upper left and going down the first column, then Daniel@0: down the second column, etc., until all components are used. Daniel@0:
Daniel@0: If the optional flags contains "u", this causes the insertion Daniel@0: order of elements in the array to be determined by user-supplied Daniel@0: values. Each component can specify its sort value by a Daniel@0: non-negative integer using the sortv attribute. Daniel@0: Components are Daniel@0: inserted in order, starting with the one with the smallest Daniel@0: sort value. If no sort value is specified, zero is used. Daniel@0: Daniel@0:
Daniel@0: If dim is 3 or more, point may also have Daniel@0: the format "%f,%f,%f"('!') to represent the point (x,y,z). Daniel@0: Daniel@0:
Daniel@0: If a compass point is used, it must have the form Daniel@0: "n","ne","e","se","s","sw","w","nw","c","_". This modifies the edge Daniel@0: placement to aim for the corresponding compass point on the port or, Daniel@0: in the second form where no portname is supplied, on the node Daniel@0: itself. The compass point "c" specifies the center of the node or port. Daniel@0: The compass point "_" specifies that an appropriate side of the port Daniel@0: adjacent to the exterior of the node should be used, if such exists. Daniel@0: Otherwise, the center is used. Daniel@0: If no compass point is used with a portname, the default value is "_". Daniel@0:
Daniel@0:
Daniel@0: This attribute can be attached to an edge using the Daniel@0: headport and Daniel@0: tailport attributes, or as part of the Daniel@0: edge description as in Daniel@0:
Daniel@0: Note that it is legal to have a portname the same as one of Daniel@0: the compass points. In this case, this reference will be resolved to Daniel@0: the port. Thus, if node A has a port w, then Daniel@0: headport=w will refer to the port and not the compass point. Daniel@0: At present, in this case, there is no way to specify that the compass Daniel@0: point should be used. Daniel@0: Daniel@0:
Daniel@0: Using "fast" gives about a 2-4 times overall speedup compared with "normal", Daniel@0: though layout quality can suffer a little. Daniel@0: Daniel@0:
where spline | = | (endp)? (startp)? point (triple)+ |
and triple | = | point point point |
and endp | = | "e,%f,%f" |
and startp | = | "s,%f,%f" |
Daniel@0: If style is present, it must be one of the strings "regular", Daniel@0: "self", or "random". In the first case, the nodes are Daniel@0: placed regularly about a circle. In the second case, Daniel@0: an abbreviated version of neato is run to obtain the initial layout. Daniel@0: In the last case, the nodes are placed randomly in a unit square. Daniel@0:
Daniel@0: If seed is present, it specifies a seed for the random number Daniel@0: generator. If seed is a positive number, this is used as the Daniel@0: seed. If it is anything else, Daniel@0: the current time, and possibly the process id, is used to pick a seed, Daniel@0: thereby making the choice more random. In this case, the seed value Daniel@0: is stored in the graph. Daniel@0:
Daniel@0: If the value is just "random", a time-based seed is chosen. Daniel@0:
Daniel@0: Note that input positions, specified by a node's Daniel@0: pos Daniel@0: attribute, are only used when the style is "random". Daniel@0: Daniel@0:
where styleItem | = | name or name'('args')' |
and args | = | name ( ',' name )* |
and name | = | [^)(, ][^)(,]* |
Daniel@0: At present, the recognized style names are Daniel@0: "dashed", "dotted", "solid", "invis" and "bold" for nodes and edges, Daniel@0: and "filled", "diagonals" and "rounded" for nodes only. Daniel@0: The styles "filled" and "rounded" are recognized for clusters. Daniel@0: Additional styles are available in Daniel@0: device-dependent form. Style lists are passed to device drivers, which Daniel@0: can use this to generate appropriate output. Daniel@0:
Daniel@0: The setlinewidth style value can be Daniel@0: used for more control over the width of node borders and edges than is Daniel@0: allowed by bold. This style value takes an argument, specifying the Daniel@0: width of the line in points. For example, style="bold" is Daniel@0: equivalent to style="setlinewidth(2)". Daniel@0: The use of setlinewidth is deprecated; one should use the Daniel@0: penwidth attribute instead. Daniel@0: Daniel@0:
Daniel@0: The viewPort W,H,Z,x,y or W,H,Z,N Daniel@0: specifies a viewport for the final image. The pair (W,H) gives the Daniel@0: dimensions (width and height) of the final image, in Daniel@0: points. Daniel@0: The optional Z is the zoom factor, i.e., the image in the original layout will be Daniel@0: W/Z by H/Z points in size. By default, Z is 1. Daniel@0: The optional last part is either a pair (x,y) giving a position in the original layout of the Daniel@0: graph, in Daniel@0: points, of the center of the viewport, or the name N Daniel@0: of a node whose center should used as the focus. Daniel@0: By default, the focus is the center of the graph bounding box, i.e., Daniel@0: (bbx/2,bby/2), where "bbx,bby" is the Daniel@0: value of the bounding box attribute bb. Daniel@0:
Daniel@0: Sample values: 50,50,.5,'2.8 BSD' or 100,100,2,450,300. Daniel@0: The first will take the 100x100 point square centered on the node 2.8 BSD Daniel@0: and scale it down by 0.5, yielding a 50x50 point final image. Daniel@0: Daniel@0: