Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Graph_Attributes · SwiftDocOrg/GraphViz Wiki · GitHub
Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Graph_Attributes · SwiftDocOrg/GraphViz Wiki · GitHub
Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Graph_Attributes · SwiftDocOrg/GraphViz Wiki · GitHub
Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Graph_Attributes · SwiftDocOrg/GraphViz Wiki · GitHub
Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Graph_Attributes · SwiftDocOrg/GraphViz Wiki · GitHub
Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Graph_Attributes · SwiftDocOrg/GraphViz Wiki · GitHub
Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Graph_Attributes · SwiftDocOrg/GraphViz Wiki · GitHub
Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Attributes

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Attributes

publicstruct Attributes: Hashable

Inheritance

Hashable

Properties

comment

Comments are inserted into output. Device-dependent

varcomment:String?

`class`

Unofficial, but supported by certain output formats, like svg.

var`class`:String?

layoutAlgorithm

Specifies the name of the layout algorithm to use, such as "dot" or "neato". Normally, graphs should be kept independent of a type of layout. In some cases, however, it can be convenient to embed the type of layout desired within the graph. For example, a graph containing position information from a layout might want to record what the associated layout algorithm was.

varlayoutAlgorithm:LayoutAlgorithm?

This attribute takes precedence over the -K flag or the actual command name used.

ordering

If the value of the attribute is "out", then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If the value of the attribute is "in", then the inedges of a node must appear left-to-right in the same order in which they are defined in the input. If defined as a graph or subgraph attribute, the value is applied to all nodes in the graph or subgraph. Note that the graph attribute takes precedence over the node attribute.

varordering:Ordering?

outputOrder

outputorder G outputMode breadthfirst

varoutputOrder:OutputOrder?

outputorder Specify order in which nodes and edges are drawn.

clusterRank

Mode used for handling clusters. If clusterrank is "local", a subgraph whose name begins with "cluster" is given special treatment. The subgraph is laid out separately, and then integrated as a unit into its parent graph, with a bounding rectangle drawn about it. If the cluster has a label parameter, this label is displayed within the rectangle. Note also that there can be clusters within clusters. At present, the modes "global" and "none" appear to be identical, both turning off the special cluster processing.

varclusterRank:ClusterMode?

concentrate

If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.

varconcentrate:Bool?

concentrate G bool false

overlap

Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If "true" , overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value converts to "false", and it is available, Prism, a proximity graph-based algorithm, is used to remove node overlaps. This can also be invoked explicitly with "overlap=prism". This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If Prism is not available, or the version of Graphviz is earlier than 2.28, "overlap=false" uses a Voronoi-based technique. This can always be invoked explicitly with "overlap=voronoi".

varoverlap:String?

If the value is "scalexy", x and y are separately scaled to remove overlaps.

If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with.

N.B.The remaining allowed values of overlap correspond to algorithms which, at present, can produce bad aspect ratios. In addition, we deprecate the use of the "ortho*" and "portho*".

If the value is "vpsc", overlap removal is done as a quadratic optimization to minimize node displacement while removing node overlaps.

If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two constraint problems, one for the x axis and one for the y. The suffix indicates which axis is processed first. If the value is "ortho", the technique is similar to "orthoxy" except a heuristic is used to reduce the bias between the two passes. If the value is "ortho_yx", the technique is the same as "ortho", except the roles of x and y are reversed. The values "portho", "porthoxy", "porthoxy", and "portho_yx" are similar to the previous four, except only pseudo-orthogonal ordering is enforced.

If the layout is done by neato with mode="ipsep", then one can use overlap=ipsep. In this case, the overlap removal constraints are incorporated into the layout algorithm itself. N.B. At present, this only supports one level of clustering.

Except for fdp and sfdp, the layouts assume overlap="true" as the default. Fdp first uses a number of passes using a built-in, force-directed technique to try to remove overlaps. Thus, fdp accepts overlap with an integer prefix followed by a colon, specifying the number of tries. If there is no prefix, no initial tries will be performed. If there is nothing following a colon, none of the above methods will be attempted. By default, fdp uses overlap="9:prism". Note that overlap="true", overlap="0:true" and overlap="0:" all turn off all overlap removal.

By default, sfdp uses overlap="prism0".

Except for the Voronoi and prism methods, all of these transforms preserve the orthogonal ordering of the original layout. That is, if the x coordinates of two nodes are originally the same, they will remain the same, and if the x coordinate of one node is originally less than the x coordinate of another, this relation will still hold in the transformed layout. The similar properties hold for the y coordinates. This is not quite true for the "porth*" cases. For these, orthogonal ordering is only preserved among nodes related by an edge.

overlap G string bool true not dot

normalize

normalize If set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the angle of the first edge is specified by the value of normalize in degrees. If normalize is not a number, it is evaluated as a bool, with true corresponding to 0 degrees. NOTE:​ Since the attribute is evaluated first as a number, 0 and 1 cannot be used for false and true.

varnormalize:Double?

G double bool false not dot

nodeSeparation

varnodeSeparation:Double?

Minimum space between two adjacent nodes in the same rank, in inches.

 In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.
For other layouts, this affects the spacing between loops on a single node, or multiedges between a pair of nodes.

pageSize

Width and height of output pages, in inches. If only a single value is given, this is used for both the width and height. If this is set and is smaller than the size of the layout, a rectangular array of pages of the specified page size is overlaid on the layout, with origins aligned in the lower-left corner, thereby partitioning the layout into pages. The pages are then produced one at a time, in pagedir order.

varpageSize:Size?

At present, this only works for PostScript output. For other types of output, one should use another tool to split the output into multiple output files. Or use the viewport to generate multiple files.

pageDirection

If the page attribute is set and applicable, this attribute specifies the order in which the pages are emitted. This is limited to one of the 8 row or column major orders.

varpageDirection:PageDirection?

boundingBox

Bounding box of drawing in points. bb G rect write only

varboundingBox:Rectangle?

margin

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep. G addDouble addPoint +3 not dot

varmargin:Double?

center

If true, the drawing is centered in the output canvas.

varcenter:Bool?

aspectRatio

varaspectRatio:AspectRatio?

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced.

If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up.

If ratio = "fill" and the size attribute is set, the drawing is scaled to achieve the aspect ratio implied by size. As size is set, when the drawing is later scaled to fit that rectangle, the resulting picture will fill the rectangle.

If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry.

orientation

If 90, set drawing orientation to landscape. rotate G int 0

varorientation:Orientation?

rotation

Causes the final layout to be rotated counter-clockwise by the specified number of degrees. G int 0 rotation G double 0 sfdp only

varrotation:Double?

scale

If set, after the initial layout, the layout is scaled by the given factors. If only a single number is given, this is used for both factors.

varscale:Size?
not dot

backgroundColor

When attached to the root graph, this color is used as the background for entire canvas. When a cluster attribute, it is used as the initial background for the cluster. If a cluster has a filled style, the cluster's fillcolor will overlay the background color.

varbackgroundColor:Color?

If the value is a colorList, a gradient fill is used. By default, this is a linear fill; setting style=radial will cause a radial fill. At present, only two colors are used. If the second color (after a colon) is missing, the default color is used for it. See also the gradientangle attribute for setting the gradient angle.

For certain output formats, such as PostScript, no fill is done for the root graph unless bgcolor is explicitly set. For bitmap formats, however, the bits need to be initialized to something, so the canvas is filled with white by default. This means that if the bitmap output is included in some other document, all of the bits within the bitmap's bounding box will be set, overwriting whatever color or graphics were already on the page. If this effect is not desired, and you only want to set bits explicitly assigned in drawing the graph, set bgcolor="transparent".

href

varhref:String?

url

varurl:URL?

label

varlabel:String?

Text label attached to objects. Different from ids labels can contain almost any special character, but not ".

If a node does not have the attribute label, the value of the attribute id is used. If a node shall not have a label, label="" must be used.

The escape sequences "\n", "\l" and "\r" divide the label into lines, centered, left-justified and right-justified, respectively.

Change the appearance of the labels with the attributes fontname, fontcolor and fontsize.

forceLabels

If true, all xlabel attributes are placed, even if there is some overlap with nodes or other labels.

varforceLabels:Bool?

textColor

vartextColor:Color?

The font color for object labels.

fontName

varfontName:String?

The name of the used font. (System dependend) The font size for object labels.

fontSize

varfontSize:Double?

labelDimensionUnit

If quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum.

varlabelDimensionUnit:Double?

G double 0.0 0.0

noJustify

By default, the justification of multi-line labels is done within the largest context that makes sense. Thus, in the label of a polygonal node, a left-justified line will align with the left side of the node (shifted by the prescribed margin). In record nodes, left-justified line will line up with the left side of the enclosing column of fields. If nojustify is "true", multi-line labels will be justified in the context of itself. For example, if the attribute is set, the first label line is long, and the second is shorter and left-justified, the second will align with the left-most character in the first line, regardless of how large the node might be.

varnoJustify:Bool?

guideBoxLocation

showboxes Print guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging)

varguideBoxLocation:Location?
ENG int 0 0 dot only

sortValue

If packmode indicates an array packing, this attribute specifies an insertion order among the components, with smaller values inserted first.

varsortValue:Int?

GCN int 0 0

splines

Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments. If set to none or "", no edges are drawn at all. (1 March 2007) The values line and spline can be used as synonyms for false and true, respectively. In addition, the value polyline specifies that edges should be drawn as polylines.

varsplines:Spline?

(28 Sep 2010) The value ortho specifies edges should be routed as polylines of axis-aligned segments. Currently, the routing does not handle ports or, in dot, edge labels.

(25 Sep 2012) The value curved specifies edges should be drawn as curved arcs.

By default, the attribute is unset. How this is interpreted depends on the layout. For dot, the default is to draw edges as splines. For all other layouts, the default is to draw edges as line segments. Note that for these latter layouts, if splines="true", this requires non-overlapping nodes (cf. overlap). If fdp is used for layout and splines="compound", then the edges are drawn to avoid clusters as well as nodes.

viewport

Clipping window on final drawing. Note that this attribute supersedes any size attribute. The width and height of the viewport specify precisely the final size of the output.

varviewport:Viewport?

rankDirection

Sets direction of graph layout. For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom. This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

varrankDirection:RankDirection?

dot only

compound

// If true, allow edges between clusters. (See lhead and ltail below.) // > compound G bool false dot only

varcompound:Bool?

runCrossingMinimizationOnce

If true and there are multiple clusters, run crossing minimization a second time.

varrunCrossingMinimizationOnce:Bool?

remincross G bool true dot only

minimumScaleFactor

mclimit Multiplicative scale factor used to alter the MinQuit (default = 8) and MaxIter (default = 24) parameters used during crossing minimization. These correspond to the number of tries without improvement before quitting and the maximum number of iterations in each pass.

varminimumScaleFactor:Double?

G double 1.0 dot only

useNewRankingAlgorithm

newrank The original ranking algorithm in dot is recursive on clusters. This can produce fewer ranks and a more compact layout, but sometimes at the cost of a head node being place on a higher rank than the tail node. It also assumes that a node is not constrained in separate, incompatible subgraphs. For example, a node cannot be in a cluster and also be constrained by rank=same with a node not in the cluster. If newrank=true, the ranking algorithm does a single global ranking, ignoring clusters. This allows nodes to be subject to multiple constraints. Rank constraints will usually take precedence over edge constraints.

varuseNewRankingAlgorithm:Bool?
G bool false dot only

searchSize

searchsize During network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value.

varsearchSize:Int?
dot only

maximumNetworkSimplexIterationsForComputingNodeCoordinates

nslimit nslimit1 G double dot only

varmaximumNetworkSimplexIterationsForComputingNodeCoordinates:Int?

nslimit , nslimit1 Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

maximumNetworkSimplexIterationsForRankingNodes

Used to set number of iterations in network simplex applications. nslimit is used in computing node x coordinates, nslimit1 for ranking nodes. If defined, # iterations = nslimit(1) * # nodes; otherwise, # iterations = MAXINT.

varmaximumNetworkSimplexIterationsForRankingNodes:Int?

rankSeparation

In dot, this gives the desired rank separation, in inches. This is the minimum vertical distance between the bottom of the nodes in one rank and the tops of nodes in the next. If the value contains "equally", the centers of all ranks are spaced equally apart. Note that both settings are possible, e.g., ranksep = "1.2 equally". In twopi, this attribute specifies the radial separation of concentric circles. For twopi, ranksep can also be a list of doubles. The first double specifies the radius of the inner circle; the second double specifies the increase in radius from the first circle to the second; etc. If there are more circles than numbers, the last number is used as the increment for the remainder.

varrankSeparation:Double?

dot and twopi only

voronoiMargin

Factor to scale up drawing to allow margin for expansion in Voronoi technique. dim' = (1+2*margin)*dim.

varvoronoiMargin:Double?

voro_margin G double 0.05 0.0 not dot

mode

varmode:Mode?

model

model This value specifies how the distance matrix is computed for the input graph. The distance matrix specifies the ideal distance between every pair of nodes. neato attemps to find a layout which best achieves these distances. By default, it uses the length of the shortest path, where the length of each edge is given by its len attribute. If model is "circuit", neato uses the circuit resistance model to compute the distances. This tends to emphasize clusters. If model is "subset", neato uses the subset model. This sets the edge length to be the number of nodes that are neighbors of exactly one of the end points, and then calculates the shortest paths. This helps to separate nodes with high degree. For more control of distances, one can use model=mds. In this case, the len of an edge is used as the ideal distance between its vertices. A shortest path calculation is only used for pairs of nodes not connected by an edge. Thus, by supplying a complete graph, the input can specify all of the relevant distances.

varmodel:String?

model G string shortpath neato only

useMOSEK

mosek If Graphviz is built with MOSEK defined, mode=ipsep and mosek=true, the Mosek software (www.mosek.com) is use to solve the ipsep constraints.

varuseMOSEK:Bool?

mosek G bool false neato only

epsilon

Terminating condition. If the length squared of all energy gradients are < epsilon, the algorithm stops.

varepsilon:Double?

epsilon G double .0001 * # nodes(mode == KK) .0001(mode == major) neato only

defaultDistance

**

vardefaultDistance:Double?

noTranslate

notranslate By default, the final layout is translated so that the lower-left corner of the bounding box is at the origin. This can be annoying if some nodes are pinned or if the user runs neato -n. To avoid this translation, set notranslate to true.

varnoTranslate:Bool?

notranslate G bool false neato only

generateDirectedEdgeConstraints

Only valid when mode="ipsep". If true, constraints are generated for each edge in the largest (heuristic) directed acyclic subgraph such that the edge must point downwards. If "hier", generates level constraints similar to those used with mode="hier". The main difference is that, in the latter case, only these constraints are involved, so a faster solver can be used.

vargenerateDirectedEdgeConstraints:Bool?

string bool false neato only

renderingDimensions

**

varrenderingDimensions:Int?

layoutDimensions

Set the number of dimensions used for the layout. The maximum value allowed is 10.

varlayoutDimensions:Int?

dim int 2 2 sfdp, fdp, neato only

levelConstraintStrictness

Specifies strictness of level constraints in neato when mode="ipsep" or "hier". Larger positive values mean stricter constraints, which demand more separation between levels. On the other hand, negative values will relax the constraints by allowing some overlap between the levels.

varlevelConstraintStrictness:Double?

initialNodeLayoutStrategy

start Parameter used to determine the initial layout of nodes. If unset, the nodes are randomly placed in a unit square with the same seed is always used for the random number generator, so the initial placement is repeatable.

varinitialNodeLayoutStrategy:InitialNodeLayoutStrategy?

start G startType "" fdp, neato only

maximumNumberOfLayoutIterations

maxiter Sets the number of iterations used. int 100 * # nodes(mode == KK) 200(mode == major) 600(fdp) fdp, neato only

varmaximumNumberOfLayoutIterations:Int?

inputScale

inputscale For layout algorithms that support initial input positions (specified by the pos attribute), this attribute can be used to appropriately scale the values. By default, fdp and neato interpret the x and y values of pos as being in inches. (NOTE:​ neato -n(2) treats the coordinates as being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if the graph has pos attributes in points, one should set inputscale=72. This can also be set on the command line using the -s flag flag. If not set, no scaling is done and the units on input are treated as inches. A value of 0 is equivalent to inputscale=72.

varinputScale:Double?

G double fdp, neato only

damping

Factor damping force motions. On each iteration, a nodes movement is limited to this factor of its potential motion. By being less than 1.0, the system tends to ``cool'', thereby preventing cycling.

vardamping:Double?

labelScheme

label_scheme The value indicates whether to treat a node whose name has the form |edgelabel|* as a special node representing an edge label. The default (0) produces no effect. If the attribute is set to 1, sfdp uses a penalty-based method to make that kind of node close to the center of its neighbor. With a value of 2, sfdp uses a penalty-based method to make that kind of node close to the old center of its neighbor. Finally, a value of 3 invokes a two-step process of overlap removal and straightening.

varlabelScheme:LabelScheme?
int 0 0 sfdp only

quadtreeScheme

Quadtree scheme to use. A TRUE bool value corresponds to "normal"; a FALSE bool value corresponds to "none". As a slight exception to the normal interpretation of bool, a value of "2" corresponds to "fast".

varquadtreeScheme:QuadtreeScheme?

G quadType bool normal sfdp only

repulsiveForce

repulsiveforce The power of the repulsive force used in an extended Fruchterman-Reingold force directed model. Values larger than 1 tend to reduce the warping effect at the expense of less clustering.

varrepulsiveForce:Double?
G double 1.0 0.0 sfdp only

smoothing

smoothing Specifies a post-processing step used to smooth out an uneven distribution of nodes.

varsmoothing:Smoothing?
G smoothType "none" sfdp only

numberOfLevels

Number of levels allowed in the multilevel scheme.

varnumberOfLevels:Int?

levels G int MAXINT 0.0 sfdp only

springConstant

Spring constant used in virtual physical model. It roughly corresponds to an ideal edge length (in inches), in that increasing K tends to increase the distance between nodes. Note that the edge attribute len can be used to override this value for adjacent nodes. K GC double 0.3 0 sfdp, fdp only

varspringConstant:Double?

overlapScaling

overlap_scaling When overlap=prism, the layout is scaled by this factor, thereby removing a fair amount of node overlap, and making node overlap removal faster and better able to retain the graph's shape. If overlap_scaling is negative, the layout is scaled by -1*overlap_scaling times the average label size. If overlap_scaling is positive, the layout is scaled by overlap_scaling. If overlap_scaling is zero, no scaling is done. overlap_scaling G double -4 -1.0e10 prism only

varoverlapScaling:Double?

overlapShrink

overlap_shrink If true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout. overlap_shrink G bool true prism only

varoverlapShrink:Bool?

minimumNodeSeparation

mindist Specifies the minimum separation between all nodes.

varminimumNodeSeparation:Double?

G double 1.0 0.0 circo only

fontPath

Directory list used by libgd to search for bitmap fonts if Graphviz was not built with the fontconfig library. If fontpath is not set, the environment variable DOTFONTPATH is checked. If that is not set, GDFONTPATH is checked. If not set, libgd uses its compiled-in font path. Note that fontpath is an attribute of the root graph.

varfontPath:URL?

fontNamingConvention

Allows user control of how basic fontnames are represented in SVG output. If fontnames is undefined or "svg", the output will try to use known SVG fontnames. For example, the default font "Times-Roman" will be mapped to the basic SVG font "serif". This can be overridden by setting fontnames to "ps" or "gd". In the former case, known PostScript font names such as "Times-Roman" will be used in the output. In the latter case, the fontconfig font conventions are used. Thus, "Times-Roman" would be treated as "Nimbus Roman No9 L". These last two options are useful with SVG viewers that support these richer fontname spaces.

varfontNamingConvention:FontNamingConvention?

SVG only

stylesheetURL

A URL or pathname specifying an XML style sheet, used in SVG output. G string "" svg only

varstylesheetURL:URL?

imagePath

Specifies a list of directories in which to look for image files as specified by the image attribute or using the IMG element in HTML-like labels. The string should be a list of (absolute or relative) pathnames, each separated by a semicolon (for Windows) or a colon (all other OS). The first directory in which a file of the given name is found will be used to load the image. If imagepath is not set, relative pathnames for the image file will be interpreted with respect to the current working directory.

varimagePath:URL?

trueColor

If set explicitly to true or false, the value determines whether or not internal bitmap rendering relies on a truecolor color model or uses a color palette. If the attribute is unset, truecolor is not used unless there is a shapefile property for some node in the graph. The output model will use the input model when possible. Use of color palettes results in less memory usage during creation of the bitmaps and smaller output files.

vartrueColor:Bool?

Usually, the only time it is necessary to specify the truecolor model is if the graph uses more than 256 colors. However, if one uses bgcolor=transparent with a color palette, font antialiasing can show up as a fuzzy white area around characters. Using truecolor=true avoids this problem.

truecolor G bool bitmap output only

dictionaryValue

vardictionaryValue:[String:Any]

Clone this wiki locally