Node Shapes


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

Polygon-based Nodes

The possible polygon-based shapes are displayed below.
box polygon ellipse circle
point egg triangle plaintext
diamond trapezium parallelogram house
pentagon hexagon septagon octagon
doublecircle doubleoctagon tripleoctagon invtriangle
invtrapezium invhouse Mdiamond Msquare
Mcircle rect rectangle
As the figures suggest, the shapes rect and rectangle are synonyms for box.

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

Record-based Nodes

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

The first string in fieldId gives a name to the field and can be combined with the node name to denote the end of an edge. The second string is used as the text for the field; it supports the usual escape sequences \n, \l and \r.

Visually, a record is a box, with fields represented by alternating rows of horizontal or vertical subboxes. The Mrecord shape is identical to a record shape, except that the outermost box has rounded corners.

As an example of a record node, the dot input

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

User-defined Nodes

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