Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Node Shapes Daniel@0: Daniel@0: Daniel@0: Daniel@0:

Node Shapes

Daniel@0:
Daniel@0: The geometries of all node shapes are affected by Daniel@0: the node attributes Daniel@0: fixedsize, Daniel@0: fontname, Daniel@0: fontsize, Daniel@0: height, Daniel@0: label, Daniel@0: style and Daniel@0: width. Daniel@0: Daniel@0:

Polygon-based Nodes

Daniel@0: The possible polygon-based shapes are displayed below. Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
box Daniel@0: polygon Daniel@0: ellipse Daniel@0: circle Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
point Daniel@0: egg Daniel@0: triangle Daniel@0: plaintext Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
diamond Daniel@0: trapezium Daniel@0: parallelogram Daniel@0: house Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
pentagon Daniel@0: hexagon Daniel@0: septagon Daniel@0: octagon Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
doublecircle Daniel@0: doubleoctagon Daniel@0: tripleoctagon Daniel@0: invtriangle Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
invtrapezium Daniel@0: invhouse Daniel@0: Mdiamond Daniel@0: Msquare Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
Mcircle Daniel@0: rect Daniel@0: rectangle Daniel@0: none Daniel@0:
Daniel@0: Daniel@0: Daniel@0: Daniel@0:
note Daniel@0: tab Daniel@0: folder Daniel@0: box3d Daniel@0:
Daniel@0:
component Daniel@0:
Daniel@0: As the figures suggest, the shapes rect and rectangle are synonyms for box, and none is a synonym for plaintext. Daniel@0: Also, unlike the rest, we have shown these last two Daniel@0: without style=filled Daniel@0: to indicate the normal use. If fill were turned on, the label text would Daniel@0: appear in a filled rectangle. Daniel@0:

Daniel@0: The geometries of polygon-based shapes are also affected Daniel@0: by the node attributes Daniel@0: regular, Daniel@0: peripheries and Daniel@0: orientation. Daniel@0: If shape="polygon", the attributes Daniel@0: sides, Daniel@0: skew and Daniel@0: distortion are also used. Daniel@0: If unset, they default to 4, 0.0 and 0.0, respectively. Daniel@0: In addition, the 3 M* shapes support auxiliary labels using Daniel@0: the toplabel and Daniel@0: bottomlabel attributes. Daniel@0: On the other hand, the point shape is special in that it is Daniel@0: only affected by the peripheries, Daniel@0: width and Daniel@0: height attributes. Daniel@0: Daniel@0:

Record-based Nodes

Daniel@0: These are specified by shape values of "record" and "Mrecord". Daniel@0: The structure of a record-based node is determined by Daniel@0: its label, Daniel@0: which has the following schema: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0:
rlabel=field ( '|' field )*
where field=fieldId or '{' rlabel '}'
and fieldId= [ '<' string '>'] [ string ]
Daniel@0: Literal braces, vertical bars and angle brackets must be escaped. Daniel@0: Spaces are interpreted as separators between tokens, Daniel@0: so they must be escaped if you want spaces in the text. Daniel@0:

Daniel@0: The first string in fieldId assigns a portname to the field and can Daniel@0: be combined with the node name to indicate where to attach an edge Daniel@0: to the node. (See portPos.) Daniel@0: The second string is used as the text for the field; it supports the usual Daniel@0: escape sequences \n, \l and \r. Daniel@0:

Daniel@0: Visually, a record is a box, with fields represented by alternating Daniel@0: rows of horizontal or vertical subboxes. The Mrecord shape is identical Daniel@0: to a record shape, except that the outermost box has rounded corners. Daniel@0: Flipping between horizontal and vertical layouts is done by nesting Daniel@0: fields in braces "{...}". The top-level orientation in a record is Daniel@0: horizontal. Thus, a record with label "A | B | C | D" will have 4 fields Daniel@0: oriented left to right, while "{A | B | C | D}" will have them Daniel@0: from top to bottom and "A | { B | C } | D" will have "B" over "C", with Daniel@0: "A" to the left and "D" to the right of "B" and "C". Daniel@0:

Daniel@0: The initial orientation of a record node depends on the Daniel@0: rankdir attribute. If this attribute Daniel@0: is TB (the default) or TB, corresponding to vertical Daniel@0: layouts, the top-level fields in a record are displayed horizontally. Daniel@0: If, however, this attribute is LR or RL, Daniel@0: corresponding to horizontal layouts, the top-level fields are Daniel@0: displayed vertically. Daniel@0:

Daniel@0: As an example of a record node, the dot input Daniel@0:

Daniel@0: digraph structs { Daniel@0: node [shape=record]; Daniel@0: struct1 [label="<f0> left|<f1> mid\ dle|<f2> right"]; Daniel@0: struct2 [label="<f0> one|<f1> two"]; Daniel@0: struct3 [label="hello\nworld |{ b |{c|<here> d|e}| f}| g | h"]; Daniel@0: struct1:f1 -> struct2:f0; Daniel@0: struct1:f2 -> struct3:here; Daniel@0: } Daniel@0: Daniel@0: Daniel@0: yields the figure
Daniel@0: Daniel@0:

Daniel@0: If we add the line Daniel@0:

Daniel@0: rankdir=LR Daniel@0: Daniel@0: we get the layout
Daniel@0: Daniel@0:

Daniel@0: If we change node struct1 to have shape Mrecord, Daniel@0: it then looks like:
Daniel@0: Daniel@0: Daniel@0:

Styles for Nodes

Daniel@0: The style Daniel@0: attribute can be used to modify the appearance of a node. Daniel@0: At present, there are 8 style values recognized: Daniel@0: filled, invisible, diagonals, rounded. Daniel@0: dashed, dotted, solid and bold. Daniel@0: As usual, the value of the style Daniel@0: attribute can be a comma-separated list of any of these. If the Daniel@0: style contains conflicts (e.g, style="dotted, solid"), the last Daniel@0: attribute wins. Daniel@0:
Daniel@0:
filled Daniel@0:
This value indicates that the node's interior should be filled. Daniel@0: The color used is the node's fillcolor or, if that's not defined, its Daniel@0: color. For unfilled nodes, the interior of the node is transparent to Daniel@0: whatever color is the current graph or cluster background color. Daniel@0: Note that point shapes are always filled. Daniel@0:

Daniel@0: Thus, the code Daniel@0:

Daniel@0: digraph G { Daniel@0: rankdir=LR Daniel@0: node [shape=box, color=blue] Daniel@0: node1 [style=filled] Daniel@0: node2 [style=filled, fillcolor=red] Daniel@0: node0 -> node1 -> node2 Daniel@0: } Daniel@0: Daniel@0: yields the figure
Daniel@0: Daniel@0: Daniel@0:
invisible Daniel@0:
Setting this style causes the node not to be displayed at all. Daniel@0: Note that the node is still used in laying out the graph. Daniel@0: Daniel@0:
diagonals Daniel@0:
The diagonals style causes small chords to be drawn near the vertices Daniel@0: of the node's polygon or, in case of circles and ellipses, two chords near Daniel@0: the top and the bottom of the shape. The special node shapes Daniel@0: Msquare, Daniel@0: Mcircle, and Daniel@0: Mdiamond Daniel@0: are simply an ordinary square, circle and Daniel@0: diamond with the diagonals style set. Daniel@0: Daniel@0:
rounded Daniel@0:
The rounded style causes the polygonal corners to be smoothed. Daniel@0: Note that this style also applies to record-based nodes. Indeed, Daniel@0: the Mrecord shape is simply shorthand for setting this style. Daniel@0: Also, prior to 26 April 2005, the rounded and filled styles were Daniel@0: mutually exclusive. Daniel@0:

Daniel@0: As an example of rounding, dot uses the graph Daniel@0:

Daniel@0: digraph R { Daniel@0: rankdir=LR Daniel@0: node [style=rounded] Daniel@0: node1 [shape=box] Daniel@0: node2 [fillcolor=yellow, style="rounded,filled", shape=diamond] Daniel@0: node3 [shape=record, label="{ a | b | c }"] Daniel@0: Daniel@0: node1 -> node2 -> node3 Daniel@0: } Daniel@0: Daniel@0: to produce the figure
Daniel@0: Daniel@0:
dashed Daniel@0:
This style causes the node's border to be drawn as a dashed line. Daniel@0:
dotted Daniel@0:
This style causes the node's border to be drawn as a dotted line. Daniel@0:
solid Daniel@0:
This style causes the node's border to be drawn as a solid line, Daniel@0: which is the default. Daniel@0:
bold Daniel@0:
This style causes the node's border to be drawn as a bold line. Daniel@0: See also setlinewidth. Daniel@0: Daniel@0:
Daniel@0: Daniel@0:

Daniel@0: Additional styles may be available with a specific code generator. Daniel@0:

HTML-Like Labels

Daniel@0: Daniel@0: NOTE:This feature is only available on versions of Graphviz Daniel@0: that are newer than mid-November 2003. In particular, it is not part Daniel@0: of release 1.10. Daniel@0:

Daniel@0: If the value of a label attribute Daniel@0: (label for nodes, edges, clusters, and Daniel@0: graphs, and the Daniel@0: headlabel and Daniel@0: taillabel Daniel@0: attributes of an edge) is given as an Daniel@0: HTML string, Daniel@0: that is, delimited by <...> Daniel@0: rather than "...", Daniel@0: the label is interpreted as Daniel@0: an HTML description. At their simplest, such labels Daniel@0: can describe multiple lines of variously aligned text as provided by ordinary Daniel@0: string labels. More generally, the Daniel@0: label can specify a table similar to those provided by HTML, Daniel@0: with different graphical attributes at each level. Daniel@0:

Daniel@0: NOTE: The features and syntax supported by these labels are Daniel@0: modeled on HTML. However, there are many aspects that are relevant Daniel@0: to Graphviz labels that are not in HTML and, conversely, HTML allows Daniel@0: various constructs which are meaningless in Graphviz. We will generally Daniel@0: refer to these labels as "HTML labels" rather than the cumbersome Daniel@0: "HTML-like labels" but the reader is warned that these are not really Daniel@0: HTML. The grammar below describes precisely what Graphviz will accept. Daniel@0:

Daniel@0: Although HTML labels are not, strictly speaking, a shape, they can be Daniel@0: viewed as a generalization of the record shapes described above. Daniel@0: In particular, if a node has set its Daniel@0: shape Daniel@0: attribute to plaintext, the HTML label will be the node's Daniel@0: shape. On the other hand, if the node has any other shape (except Daniel@0: point), the HTML label will be embedded within the node the Daniel@0: same way an ordinary label would be. Daniel@0:

Daniel@0: The following is an abstract grammar for HTML labels. Daniel@0: Terminals, corresponding to elements, are shown in bold font, Daniel@0: and nonterminals in italics. Daniel@0: Square brackets [ and ] enclose optional items. Daniel@0: Vertical bars | separate alternatives. Daniel@0: Note that, as in HTML, element and attribute names are case-insensitive. Daniel@0: (cf. sections 3.2.1 and 3.2.2 of the Daniel@0: HTML 4.01 specification). Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0: Daniel@0:
label:text
|table
text:textitem
|text textitem
textitem:string
|<BR/>
|<FONT> text </FONT>
table:[ <FONT> ] <TABLE> rows </TABLE> [ </FONT> ]
rows:row
|rows row
row:<TR> cells </TR>
cells:cell
|cells cell
cell:<TD> label </TD>
|<TD> <IMG/> </TD>
Daniel@0:

Daniel@0: Above, a string is any collection of printable characters, including Daniel@0: all spaces. Note that outside of the body of a <TD> element, Daniel@0: whitespace characters are ignored; within a <TD> element, spaces Daniel@0: are preserved but all other white space characters are discarded. Daniel@0: HTML comments are allowed within an HTML string. They can occur anywhere Daniel@0: provided that, if they contain part of an HTML element, they must contain Daniel@0: the entire element. Daniel@0:

Daniel@0: As is obvious from the above description, the interpretation of white space Daniel@0: characters is one place where HTML-like labels is very different from Daniel@0: standard HTML. In HTML, any sequence of white space characters is Daniel@0: collapsed to a single space, If the user does not want this to happen, the Daniel@0: input must use non-breaking spaces "&nbsp;". This makes sense in Daniel@0: HTML, where text layout depends dynamically on the space available. In Daniel@0: Graphviz, the layout is statically determined by the input, so it is Daniel@0: reasonable to treat ordinary space characters as non-breaking. In addition, Daniel@0: ignoring tabs and newlines allows the input text to be formatted for Daniel@0: easier reading. Daniel@0:

Daniel@0: Each of the HTML elements has a set of optional attributes. Daniel@0: Attribute values must appear in double quotes. Daniel@0:

<TABLE
Daniel@0:   ALIGN="CENTER|LEFT|RIGHT"
Daniel@0:   BGCOLOR="color"
Daniel@0:   BORDER="value"
Daniel@0:   CELLBORDER="value"
Daniel@0:   CELLPADDING="value"
Daniel@0:   CELLSPACING="value"
Daniel@0:   COLOR="color"
Daniel@0:   FIXEDSIZE="FALSE|TRUE"
Daniel@0:   HEIGHT="value"
Daniel@0:   HREF="value"
Daniel@0:   PORT="portName"
Daniel@0:   TARGET="value"
Daniel@0:   TITLE="value"
Daniel@0:   TOOLTIP="value"
Daniel@0:   VALIGN="MIDDLE|BOTTOM|TOP"
Daniel@0:   WIDTH="value"
Daniel@0: >
Daniel@0: 
Daniel@0:

Daniel@0:

<TR
Daniel@0:   <!-- No attributes -->
Daniel@0: >
Daniel@0: 
Daniel@0:

Daniel@0:

<TD
Daniel@0:   ALIGN="CENTER|LEFT|RIGHT|TEXT"
Daniel@0:   BALIGN="CENTER|LEFT|RIGHT"
Daniel@0:   BGCOLOR="color"
Daniel@0:   BORDER="value"
Daniel@0:   CELLPADDING="value"
Daniel@0:   CELLSPACING="value"
Daniel@0:   COLOR="color"
Daniel@0:   COLSPAN="value"
Daniel@0:   FIXEDSIZE="FALSE|TRUE"
Daniel@0:   HEIGHT="value"
Daniel@0:   HREF="value"
Daniel@0:   PORT="portName"
Daniel@0:   ROWSPAN="value"
Daniel@0:   TARGET="value"
Daniel@0:   TITLE="value"
Daniel@0:   TOOLTIP="value"
Daniel@0:   VALIGN="MIDDLE|BOTTOM|TOP"
Daniel@0:   WIDTH="value"
Daniel@0: >
Daniel@0: 
Daniel@0: Daniel@0:

Daniel@0:

<FONT
Daniel@0:   COLOR="color"
Daniel@0:   FACE="fontname"
Daniel@0:   POINT-SIZE="value"
Daniel@0: >
Daniel@0: 
Daniel@0: Daniel@0:

Daniel@0:

<BR
Daniel@0:   ALIGN="CENTER|LEFT|RIGHT"
Daniel@0: >
Daniel@0: 
Daniel@0: Daniel@0:

Daniel@0:

<IMG
Daniel@0:   SCALE="FALSE|TRUE|WIDTH|HEIGHT|BOTH"
Daniel@0:   SRC="value"
Daniel@0: >
Daniel@0: 
Daniel@0: Daniel@0:

Daniel@0: ALIGN Daniel@0:

Daniel@0: specifies horizontal placement. When an object is allocated Daniel@0: more space than required, this value determines where the extra space Daniel@0: is placed left and right of the object. Daniel@0:

Daniel@0:

Daniel@0:

Daniel@0: The contents of a cell are normally aligned as a block. In particular, Daniel@0: lines of text are first aligned as a text block based on the width of Daniel@0: the widest line and the corresponding <BR> elements. Then, Daniel@0: the entire text block is aligned within a cell. If, however, the Daniel@0: cell's ALIGN value is "TEXT", and the cell contains Daniel@0: lines of text, then the lines are justified using the entire available Daniel@0: width of the cell. If the cell does not contain text, then the contained Daniel@0: image or table is centered. Daniel@0:

Daniel@0: Daniel@0: BALIGN Daniel@0:
Daniel@0: specifies the default alignment of <BR> elements contained Daniel@0: in the cell. That is, if a <BR> element has no Daniel@0: explicit ALIGN attribute, the attribute value is specified Daniel@0: by the value of BALIGN. Daniel@0:
Daniel@0: Daniel@0: BGCOLOR="color" Daniel@0:
Daniel@0: sets the color of the background. This color can be Daniel@0: overridden by a BGCOLOR attribute in descendents. Daniel@0:
Daniel@0: Daniel@0: BORDER="value" Daniel@0:
Daniel@0: specifies the width of the border around the object in points. Daniel@0: A value of zero indicates no border. The default is 1. Daniel@0: The maximum value is 255. Daniel@0: If set in a table, and CELLBORDER is not set, Daniel@0: this value is also used for all cells in the table. Daniel@0: It can be overridden by a BORDER tag in a cell. Daniel@0:
Daniel@0: Daniel@0: CELLBORDER="value" Daniel@0:
Daniel@0: specifies the width of the border for all cells in a table. Daniel@0: It can be overridden by a BORDER tag in a cell. Daniel@0: The maximum value is 255. Daniel@0:
Daniel@0: Daniel@0: CELLPADDING="value" Daniel@0:
Daniel@0: specifies the space, in points, between a cell's border and its content. Daniel@0: The default is 2. Daniel@0: The maximum value is 255. Daniel@0:
Daniel@0: Daniel@0: CELLSPACING="value" Daniel@0:
Daniel@0: specifies the space, in points, between cells in a table and between Daniel@0: a cell and the table's border. The default is 2. Daniel@0: The maximum value is 127. Daniel@0:
Daniel@0: Daniel@0: COLOR="color" Daniel@0:
Daniel@0: sets the color of the font within the scope of Daniel@0: <FONT>...</FONT>, or the border color Daniel@0: of the table or cell within the scope of Daniel@0: <TABLE>...</TABLE>, Daniel@0: or <TD>...</TD>. Daniel@0: This color can be Daniel@0: overridden by a COLOR attribute in descendents. Daniel@0: By default, the font color is determined by the Daniel@0: fontcolor attribute of Daniel@0: the corresponding node, edge or graph, and the border color Daniel@0: is determined by the Daniel@0: color attribute of Daniel@0: the corresponding node, edge or graph. Daniel@0:
Daniel@0: Daniel@0: COLSPAN="value" Daniel@0:
Daniel@0: specifies the number of columns spanned by the cell. The default is 1. Daniel@0: The maximum value is 65535. Daniel@0:
Daniel@0: Daniel@0: FACE="fontname" Daniel@0:
Daniel@0: specifies the font to use within the scope of Daniel@0: <FONT>...</FONT>. Daniel@0: This can be Daniel@0: overridden by a FACE attribute in descendents. Daniel@0: By default, the font name is determined by the Daniel@0: fontname attribute of the corresponding Daniel@0: node, edge or graph. Daniel@0:
Daniel@0: Daniel@0: FIXEDSIZE Daniel@0:
Daniel@0: specifies whether the values given by the WIDTH Daniel@0: and HEIGHT attributes are enforced. Daniel@0:

Daniel@0:

Daniel@0:
Daniel@0: Daniel@0: HEIGHT="value" Daniel@0:
Daniel@0: specifies the mininum height, in points, of the object. The height Daniel@0: includes the contents, any spacing and the border. Unless Daniel@0: FIXEDSIZE is true, the height will be expanded to allow Daniel@0: the contents to fit. Daniel@0: The maximum value is 65535. Daniel@0:
Daniel@0: Daniel@0: HREF="value" Daniel@0:
Daniel@0: attaches a URL to the object. Daniel@0:
Daniel@0: Daniel@0: POINT-SIZE="value" Daniel@0:
Daniel@0: sets the size of the font, in points, used within the scope of Daniel@0: <FONT>...</FONT>. Daniel@0: This can be Daniel@0: overridden by a POINT-SIZE attribute in descendents. Daniel@0: By default, the font size is determined by the Daniel@0: fontsize attribute of the corresponding Daniel@0: node, edge or graph. Daniel@0:
Daniel@0: Daniel@0: PORT="value" Daniel@0:
Daniel@0: attaches a portname to the object. Daniel@0: (See portPos.) Daniel@0: This can be used to modify the head Daniel@0: or tail of an edge, so that the end attaches directly to the object. Daniel@0:
Daniel@0: Daniel@0: ROWSPAN="value" Daniel@0:
Daniel@0: specifies the number of rows spanned by the cell. The default is 1. Daniel@0: The maximum value is 65535. Daniel@0:
Daniel@0: Daniel@0: SCALE Daniel@0:
Daniel@0: specifies how an image will use any extra space available in its cell. Daniel@0: Allowed values are Daniel@0: Daniel@0: If this attribute is undefined, Daniel@0: the image inherits the imagescale Daniel@0: attribute of the graph object being drawn. Daniel@0: As with the imagescale Daniel@0: attribute, if the cell has a fixed size and the image is too large, Daniel@0: any offending dimension will be shrunk to fit the space, the Daniel@0: scaling being uniform in width and height if SCALE="true". Daniel@0:
Daniel@0: Daniel@0: SRC="value" Daniel@0:
Daniel@0: specifies the image file to be displayed in the cell. Daniel@0: Note that if the software is used as a web server, file system access Daniel@0: to images is more restricted. See GV_FILE_PATH Daniel@0: and SERVER_NAME. Daniel@0:
Daniel@0: Daniel@0: TARGET="value" Daniel@0:
Daniel@0: determines which window of the browser is used for the URL if the object Daniel@0: has one. Daniel@0: See W3C documentation. Daniel@0:
Daniel@0: Daniel@0: TITLE="value" Daniel@0:
Daniel@0: sets the tooltip annotation attached to the element. Daniel@0: This is used only if the element has a HREF attribute. Daniel@0:
Daniel@0: Daniel@0: TOOLTIP="value" Daniel@0:
Daniel@0: is an alias for TITLE. Daniel@0:
Daniel@0: Daniel@0:

Daniel@0: VALIGN Daniel@0:

Daniel@0: specifies vertical placement. When an object is allocated Daniel@0: more space than required, this value determines where the extra space Daniel@0: is placed above and below the object. Daniel@0:

Daniel@0:

Daniel@0:
Daniel@0: Daniel@0: WIDTH="value" Daniel@0:
Daniel@0: specifies the mininum width, in points, of the object. The width Daniel@0: includes the contents, any spacing and the border. Unless Daniel@0: FIXEDSIZE is true, the width will be expanded to allow Daniel@0: the contents to fit. Daniel@0: The maximum value is 65535. Daniel@0:
Daniel@0: Daniel@0:

Daniel@0: There is some inheritance among the attributes. If a table specifies Daniel@0: a CELLPADDING, CELLBORDER or BORDER Daniel@0: value, this value is used by the table's Daniel@0: cells unless overridden. If a cell or table specifies a BGCOLOR, Daniel@0: this will be the background color for all of its descendents. Daniel@0: Of course, if a background or fill color is specified for the Daniel@0: graph object owning the label, this will be the original Daniel@0: background for the label. Daniel@0: The object's fontname, fontcolor and fontsize attributes Daniel@0: are the default for drawing text. These can be overridden by using Daniel@0: FONT to set new values. The new font values will hold Daniel@0: until overridden by an enclosed FONT element. Daniel@0: Finally, the pencolor or color of the graph object will be used as Daniel@0: the border color. Daniel@0:

Daniel@0: Because of certain limitations in handling tables in a device-independent Daniel@0: manner, when BORDER is 1 and both table and cell borders Daniel@0: are on and CELLSPACING is less than 2, anomalies can arise Daniel@0: in the output, such as gaps between sides of borders which should be Daniel@0: abutting or even collinear. The user can usual get around this by increasing Daniel@0: the border size or the spacing, or turning off the table border. Daniel@0:

Daniel@0: As an example of HTML labels, the dot input Daniel@0:

Daniel@0: digraph structs { Daniel@0: node [shape=plaintext] Daniel@0: struct1 [label=< Daniel@0: <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> Daniel@0: <TR><TD>left</TD><TD PORT="f1">mid dle</TD><TD PORT="f2">right</TD></TR> Daniel@0: </TABLE>>]; Daniel@0: struct2 [label=< Daniel@0: <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> Daniel@0: <TR><TD PORT="f0">one</TD><TD>two</TD></TR> Daniel@0: </TABLE>>]; Daniel@0: struct3 [label=< Daniel@0: <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> Daniel@0: <TR> Daniel@0: <TD ROWSPAN="3">hello<BR/>world</TD> Daniel@0: <TD COLSPAN="3">b</TD> Daniel@0: <TD ROWSPAN="3">g</TD> Daniel@0: <TD ROWSPAN="3">h</TD> Daniel@0: </TR> Daniel@0: <TR> Daniel@0: <TD>c</TD><TD PORT="here">d</TD><TD>e</TD> Daniel@0: </TR> Daniel@0: <TR> Daniel@0: <TD COLSPAN="3">f</TD> Daniel@0: </TR> Daniel@0: </TABLE>>]; Daniel@0: struct1:f1 -> struct2:f0; Daniel@0: struct1:f2 -> struct3:here; Daniel@0: } Daniel@0: Daniel@0: produces the HTML analogue of the record example above
Daniel@0: Daniel@0:

Daniel@0: As usual, an HTML specification is more verbose. On the other hand, Daniel@0: HTML labels are much more general, as the following example shows: Daniel@0:

Daniel@0: Daniel@0:

Daniel@0: The source for this graph can be found here. Daniel@0:

Daniel@0: Here is an example using <FONT> elements Daniel@0:

Daniel@0: Daniel@0:

Daniel@0: with the input graph. Daniel@0:

Daniel@0: Here is an example using an <IMG> element Daniel@0:

Daniel@0: Daniel@0:

Daniel@0: with the input graph. Daniel@0: Daniel@0:

User-defined Nodes

Daniel@0: Daniel@0: There is a third type of node shape which is specified by the user. Daniel@0: Typically, these shapes rely on the details of a concrete graphics Daniel@0: format. At present, shapes can be described using PostScript, via a Daniel@0: file or add-on library, for use in PostScript output, or shapes can Daniel@0: be specified by a bitmap-image file for use with SVG or bitmap (jpeg, Daniel@0: gif, etc.) output. More information can be found on the page Daniel@0: Daniel@0: How to create custom shapes. Daniel@0: Daniel@0:

SDL Shapes for PostScript

Daniel@0: One example of user-defined node shapes is provided by Mark Rison of CSR. Daniel@0: These are the SDL shapes. Daniel@0: These are available as PostScript functions whose use is described in Daniel@0: External PostScript procedures. Daniel@0: The necessary PostScript library file and sample use can be found in the Daniel@0: contrib/sdlshapes directory in the release. Please note the Daniel@0: COPYRIGHT AND PERMISSION NOTICE contained in the library file sdl.ps. Daniel@0:

Daniel@0: The table below Daniel@0: gives the shape names and the corresponding node shapes. Daniel@0: Daniel@0: Daniel@0: