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