Skip to main content
Module

x/graphviz/mod.ts

🦕 Simple Graphviz library for Deno.
Latest
import * as graphviz from "https://deno.land/x/graphviz@v0.2.1/mod.ts";

Namespaces

Module defining attributes.

Classes

A set of attribute values for any object.

c
Cluster
abstract

Base class for clusters.

Digraph object.

c
DotObject
abstract

Classes implemented in the 'ts-graphviz' library that implement the toDot method are designed to inherit from this class.

Graph object.

Classes implemented in the 'ts-graphviz' library are designed to inherit from this class.

Node object.

An object that represents a Node where port and compass are specified.

c
RootCluster
abstract

Base class for RootCluster.

Subgraph object.

Variables

A string in the xdot format specifying an arbitrary background. During rendering, the canvas is first filled as described in the bgcolor attribute. Then, if _background is defined, the graphics operations described in the string are performed on the canvas.

Indicates the preferred area for a node or empty cluster when laid out by patchwork.

Style of arrowhead on the head node of an edge. This will only appear if the dir attribute is "forward" or "both".

Multiplicative scale factor for arrowheads.

Style of arrowhead on the tail node of an edge. This will only appear if the dir attribute is "back" or "both".

Bounding box of drawing in points.

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.

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

Specifies the character encoding used when interpreting string input as a text label. The default value is "UTF-8". The other legal value is "iso-8859-1" or, equivalently, "Latin1". The charset attribute is case-insensitive. Note that if the character encoding used in the input does not match the charset value, the resulting output may be very strange.

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.

Basic drawing color for graphics, not text. For the latter, use the fontcolor attribute.

This attribute specifies a color scheme namespace. If defined, it specifies the context for interpreting color names. In particular, if a color value has form "xxx" or "//xxx", then the color xxx will be evaluated according to the current color scheme. If no color scheme is set, the standard X11 naming is used. For example, if colorscheme=bugn9, then color=7 is interpreted as "/bugn9/7".

Comments are inserted into output. Device-dependent

If true, allow edges between clusters. (See lhead and ltail below.)

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.

If false, the edge is not used in ranking the nodes. For example, in the graph

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.

If true, attach edge label to edge by a 2-segment polyline, underlining the label, then going to the closest point of spline.

This specifies the distance between nodes in separate connected components. If set too small, connected components may overlap. Only applicable if pack=false.

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

Set the number of dimensions used for rendering. The maximum value allowed is 10. If both dimen and dim are set, the latter specifies the dimension used for layout, and the former for rendering. If only dimen is set, this is used for both layout and rendering dimensions.

Set edge type for drawing arrowheads. This indicates which ends of the edge should be decorated with an arrowhead. The actual style of the arrowhead can be specified using the arrowhead and arrowtail attributes. See limitation.

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.

Distortion factor for shape=polygon. Positive values cause top part to be larger than bottom; negative values do the opposite.

This specifies the expected number of pixels per inch on a display device. For bitmap output, this guarantees that text rendering will be done more accurately, both in size and in placement. For SVG output, it is used to guarantee that the dimensions in the output correspond to the correct number of points or inches.

Synonym for edgeURL.

If the edge has a URL or edgeURL attribute, this attribute determines which window of the browser is used for the URL attached to the non-label part of the edge. Setting it to "_graphviz" will open a new window if it doesn't already exist, or reuse it if it does. If undefined, the value of the target is used.

Tooltip annotation attached to the non-label part of an edge. This is used only if the edge has a URL or edgeURL attribute.

If edgeURL is defined, this is the link used for the non-label parts of an edge. This value overrides any URL defined for the edge. Also, this value is used near the head or tail node unless overridden by a headURL or tailURL value, respectively. See limitation.

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

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.

Color used to fill the background of a node or cluster assuming style=filled, or a filled arrowhead. If fillcolor is not defined, color is used. (For clusters, if color is not defined, bgcolor is used.) If this is not defined, the default is used, except for shape=point or when the output format is MIF, which use black by default.

If false, the size of a node is determined by smallest width and height needed to contain its label and image, if any, with a margin specified by the margin attribute. The width and height must also be at least as large as the sizes specified by the width and height attributes, which specify the minimum values for these parameters.

Color used for text.

Font used for text. This very much depends on the output format and, for non-bitmap output such as PostScript or SVG, the availability of the font when the graph is displayed or printed. As such, it is best to rely on font faces that are generally available, such as Times-Roman, Helvetica or Courier.

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.

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.

Font size, in points, used for text.

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

If a gradient fill is being used, this determines the angle of the fill. For linear fills, the colors transform along a line specified by the angle and the center of the object. For radial fills, a value of zero causes the colors to transform radially from the center; for non-zero values, the colors transform from a point near the object's periphery as specified by the value.

If the end points of an edge belong to the same group, i.e., have the same group attribute, parameters are set to avoid crossings and keep the edges straight.

Position of an edge's head label, in points. The position indicates the center of the label.

If true, the head of an edge is clipped to the boundary of the head node; otherwise, the end of the edge goes to the center of the node, or the center of a port, if applicable.

Synonym for headURL.

Text label to be placed near head of edge. See limitation.

Indicates where on the head node to attach the head of the edge. In the default case, the edge is aimed towards the center of the node, and then clipped at the node boundary. See limitation.

If the edge has a headURL, this attribute determines which window of the browser is used for the URL. Setting it to "_graphviz" will open a new window if it doesn't already exist, or reuse it if it does. If undefined, the value of the target is used.

Tooltip annotation attached to the head of an edge. This is used only if the edge has a headURL attribute.

If headURL is defined, it is output as part of the head label of the edge. Also, this value is used near the head node, overriding any URL value. See limitation.

Height of node, in inches. This is taken as the initial, minimum height of the node. If fixedsize is true, this will be the final height of the node. Otherwise, if the node label requires more height to fit, the node's height will be increased to contain the label. Note also that, if the output format is dot, the value given to height will be the final value.

Synonym for URL.

Allows the graph author to provide an id for graph objects which is to be included in the output. Normal "\N", "\E", "\G" substitutions are applied. If provided, it is the responsibility of the provider to keep its values sufficiently unique for its intended downstream use. Note, in particular, that "\E" does not provide a unique id for multi-edges. If no id attribute is provided, then a unique internal id is used. However, this value is unpredictable by the graph writer. An externally provided id is not used internally.

Gives the name of a file containing an image to be displayed inside a node. The image file must be in one of the recognized formats, typically JPEG, PNG, GIF, BMP, SVG or Postscript, and be able to be converted into the desired output format.

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.

Attribute controlling how an image is positioned within its containing node. This only has an effect when the image is smaller than the containing node. The default is to be centered both horizontally and vertically. Valid values:

Attribute controlling how an image fills its containing node. In general, the image is given its natural size, (cf. dpi), and the node size is made large enough to contain its image, its label, its margin, and its peripheries. Its width and height will also be at least as large as its minimum width and height. If, however, fixedsize=true, the width and height attributes specify the exact size of the node.

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.

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.

Text label attached to objects. If a node's shape is record, then the label can have a special format which describes the record layout.

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.

This, along with labeldistance, determine where the headlabel (taillabel) are placed with respect to the head (tail) in polar coordinates. The origin in the coordinate system is the point where the edge touches the node. The ray of 0 degrees goes from the origin back along the edge, parallel to the edge at the origin.

Multiplicative scaling factor adjusting the distance that the headlabel(taillabel) is from the head(tail) node. The default distance is 10 points. See labelangle for more details.

If true, allows edge labels to be less constrained in position. In particular, it may appear on top of other edges.

Color used for headlabel and taillabel. If not set, defaults to edge's fontcolor.

Font used for headlabel and taillabel. If not set, defaults to edge's fontname.

Font size, in points, used for headlabel and taillabel. If not set, defaults to edge's fontsize.

Synonym for labelURL.

Justification for cluster labels. If "r", the label is right-justified within bounding rectangle; if "l", left-justified; else the label is centered. Note that a subgraph inherits attributes from its parent. Thus, if the root graph sets labeljust to "l", the subgraph inherits this value.

Vertical placement of labels for nodes, root graphs and clusters.

If the edge has a URL or labelURL attribute, this attribute determines which window of the browser is used for the URL attached to the label. Setting it to "_graphviz" will open a new window if it doesn't already exist, or reuse it if it does. If undefined, the value of the target is used.

Tooltip annotation attached to label of an edge. This is used only if the edge has a URL or labelURL attribute.

If labelURL is defined, this is the link used for the label of an edge. This value overrides any URL defined for the edge.

If true, the graph is rendered in landscape mode. Synonymous with rotate | rotate=90 or orientation | orientation=landscape.

Specifies layers in which the node, edge or cluster is present.

Specifies the separator characters used to split an attribute of type layerRange into a list of ranges.

Specifies a linearly ordered list of layer names attached to the graph The graph is then output in separate layers. Only those components belonging to the current output layer appear. For more information, see the page How to use drawing layers (overlays).

Selects a list of layers to be emitted.

Specifies the separator characters used to split the layers attribute into a list of layer names.

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.

Preferred edge length, in inches.

Number of levels allowed in the multilevel scheme.

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.

Logical head of an edge. When compound is true, if lhead is defined and is the name of a cluster containing the real head, the edge is clipped to the boundary of the cluster. See the limitation.

Height of graph or cluster label, in inches.

Label position, in points. The position indicates the center of the label.

Logical tail of an edge. When compound is true, if ltail is defined and is the name of a cluster containing the real tail, the edge is clipped to the boundary of the cluster. See the limitation.

Width of graph or cluster label, in inches.

For graphs, this sets x and y margins of canvas, in inches. If the margin is a single double, both margins are set equal to the given value.

Sets the number of iterations used.

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.

Specifies the minimum separation between all nodes.

Minimum edge length (rank difference between head and tail).

Technique for optimizing the layout. For neato, if mode is "major", neato uses stress majorization. If mode is "KK", neato uses a version of the gradient descent method. The only advantage to the latter technique is that it is sometimes appreciably faster for small (number of nodes < 100) graphs. A significant disadvantage is that it may cycle.

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.

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.

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.

In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.

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.

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.

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.

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.

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.

Angle, in degrees, used to rotate polygon node shapes. For any number of polygon sides, 0 degrees rotation results in a flat base.

If "[lL]*", set graph orientation to landscape Used only if rotate is not defined.

Specify order in which nodes and edges are drawn.

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.

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 true, the overlap removal algorithm will perform a compression pass to reduce the size of the layout.

This is true if the value of pack is "true" (case-insensitive) or a non-negative integer. If true, each connected component of the graph is laid out separately, and then the graphs are packed together. If pack has an integral value, this is used as the size, in points, of a margin around each part; otherwise, a default margin of 8 is used. If pack is interpreted as false, the entire graph is laid out together. The granularity and method of packing is influenced by the packmode attribute.

This indicates how connected components should be packed (cf. packMode). Note that defining packmode will automatically turn on packing as though one had set pack=true.

The pad attribute specifies how much, in inches, to extend the drawing area around the minimal area needed to draw the graph. If the pad is a single double, both the x and y pad values are set equal to the given value. This area is part of the drawing and will be filled with the background color, if appropriate.

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 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.

Color used to draw the bounding box around a cluster. If pencolor is not defined, color is used. If this is not defined, bgcolor is used. If this is not defined, the default is used.

Specifies the width of the pen, in points, used to draw lines and curves, including the boundaries of edges and clusters. The value is inherited by subclusters. It has no effect on text.

Set number of peripheries used in polygonal shapes and cluster boundaries. Note that user-defined shapes are treated as a form of box shape, so the default peripheries value is 1 and the user-defined shape will be drawn in a bounding rectangle. Setting peripheries=0 will turn this off. Also, 1 is the maximum peripheries value for clusters.

If true and the node has a pos attribute on input, neato or fdp prevents the node from moving from the input position. This property can also be specified in the pos attribute itself (cf. the point type).

Position of node, or spline control points. For nodes, the position indicates the center of the node. On output, the coordinates are in points.

Quadtree scheme to use.

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

Rank constraints on the nodes in a subgraph. If rank="same", all nodes are placed on the same rank. If rank="min", all nodes are placed on the minimum rank. If rank="source", all nodes are placed on the minimum rank, and the only nodes on the minimum rank belong to some subgraph whose rank attribute is "source" or "min". Analogous criteria hold for rank="max" and rank="sink". (Note: the minimum rank is topmost or leftmost, and the maximum rank is bottommost or rightmost.)

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.

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".

Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the size attribute constraints are enforced. In addition, the calculations usually ignore the node sizes, so the final drawing size may only approximate what is desired.

Rectangles for fields of records, in points.

If true, force polygon to be regular, i.e., the vertices of the polygon will lie on a circle whose center is the center of the node.

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

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.

This is a synonym for the dpi attribute.

This specifies nodes to be used as the center of the layout and the root of the generated spanning tree. As a graph attribute, this gives the name of the node. As a node attribute, it specifies that the node should be used as a central node. In twopi, this will actually be the central node. In circo, the block containing the node will be central in the drawing of its connected component. If not defined, twopi will pick a most central node, and circo will pick a random node.

If 90, set drawing orientation to landscape.

Causes the final layout to be rotated counter-clockwise by the specified number of degrees.

Edges with the same head and the same samehead value are aimed at the same point on the head. This has no effect on loops. Each node can have at most 5 unique samehead values. See limitation.

Edges with the same tail and the same sametail value are aimed at the same point on the tail. This has no effect on loops. Each node can have at most 5 unique sametail values. See limitation.

If the input graph defines the vertices attribute, and output is dot or xdot, this gives the number of points used for a node whose shape is a circle or ellipse. It plays the same role in neato, when adjusting the layout to avoid overlapping nodes, and in image maps.

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.

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

Specifies margin to leave around nodes when removing node overlap. This guarantees a minimal non-zero distance between nodes.

Set the shape of a node.

(Deprecated) If defined, shapefile specifies a file containing user-supplied node content. The shape of the node is set to box. The image in the shapefile must be rectangular. The image formats supported as well as the precise semantics of how the file is used depends on the output format. For further details, see Image Formats and External PostScript files.

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

Number of sides if shape=polygon.

Maximum width and height of drawing, in inches. If only a single number is given, this is used for both the width and the height.

Skew factor for shape=polygon. Positive values skew top of polygon to right; negative to left.

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

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

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.

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.

Set style information for components of the graph. For cluster subgraphs, if style="filled", the cluster box's background is filled.

A URL or pathname specifying an XML style sheet, used in SVG output.

Position of an edge's tail label, in points. The position indicates the center of the label.

If true, the tail of an edge is clipped to the boundary of the tail node; otherwise, the end of the edge goes to the center of the node, or the center of a port, if applicable.

Synonym for tailURL.

Text label to be placed near tail of edge. See limitation.

Indicates where on the tail node to attach the tail of the edge. See limitation.

If the edge has a tailURL, this attribute determines which window of the browser is used for the URL. Setting it to "_graphviz" will open a new window if it doesn't already exist, or reuse it if it does. If undefined, the value of the target is used.

Tooltip annotation attached to the tail of an edge. This is used only if the edge has a tailURL attribute.

If tailURL is defined, it is output as part of the tail label of the edge. Also, this value is used near the tail node, overriding any URL value. See limitation.

If the object has a URL, this attribute determines which window of the browser is used for the URL. See W3C documentation.

Tooltip annotation attached to the node or edge. If unset, Graphviz will use the object's label if defined. Note that if the label is a record specification or an HTML-like label, the resulting tooltip may be unhelpful. In this case, if tooltips will be generated, the user should set a tooltip attribute explicitly.

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.

Hyperlinks incorporated into device-dependent output. At present, used in ps2, cmap, imap and svg formats. For all these formats, URLs can be attached to nodes, edges and clusters. URL attributes can also be attached to the root graph in ps2, cmap and imap formats. This serves as the base URL for relative URLs in the former, and as the default image map file in the latter.

If the input graph defines this attribute, the node is polygonal, and output is dot or xdot, this attribute provides the coordinates of the vertices of the node's polygon, in inches. If the node is an ellipse or circle, the samplepoints attribute affects the output.

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.

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

Weight of edge. In dot, the heavier the weight, the shorter, straighter and more vertical the edge is. N.B. Weights in dot must be integers. For twopi, a weight of 0 indicates the edge should not be used in constructing a spanning tree from the root. For other layouts, a larger weight encourages the layout to make the edge length closer to that specified by the len attribute.

Width of node, in inches. This is taken as the initial, minimum width of the node. If fixedsize is true, this will be the final width of the node. Otherwise, if the node label requires more width to fit, the node's width will be increased to contain the label. Note also that, if the output format is dot, the value given to width will be the final value.

For xdot output, if this attribute is set, this determines the version of xdot used in output. If not set, the attribute will be set to the xdot version used for output.

External label for a node or edge. For nodes, the label will be placed outside of the node but near it. For edges, the label will be placed near the center of the edge. This can be useful in dot to avoid the occasional problem when the use of edge labels distorts the layout. For other layouts, the xlabel attribute can be viewed as a synonym for the label attribute.

Position of an exterior label, in points. The position indicates the center of the label.

v
attribute.z
deprecated

Deprecated:Use pos attribute, along with dimen and/or dim to specify dimensions.

Center

Left part

Upper part

Upper left

Upper right

Lower part

Lower left

Lower right

Right part

API for creating directional graph objects.

API for creating omnidirectional graph objects.

Provides a strict mode API.

Functions

Determine whether the character string satisfies the Compass condition.

Run dot command and output result to the specified path.

Type Aliases

Attribute types.

Attribute types available for cluster subgraph.

Attribute types available for edges.

Attribute types available for nodes.

Attribute types available for root cluster.

Attribute types available for subgraph.

An AttributesValue is one of the following:

  • Any string of alphabetic ([a-zA-Z\200-\377]) characters, underscores ('_') or digits ([0-9]), not beginning with a digit;
  • a numeral [-]?(.[0-9]+ | [0-9]+(.[0-9]*)? );
  • any double-quoted string ("...") possibly containing escaped quotes (")1;
  • an HTML Like string (<...>).

Directive indicating which direction the Edge should point.

Objects that can be Edge destinations satisfy this interface.

string or an object implementing IEdgeTarget.