Search notes:

Graphviz: record based nodes

A record based node is one of the three main types of nodes, the two others being polygon based and user defined.
A node becomes record based if its shape attribute is either record or Mrecord.
A record based node consists of fields that are visually drawn as rectangles. A field contains text or sub-fields.
If a node is record based, the string that is assigned to the node's label attribute may contain three special instructions:
The initial layout-orientation is determined by the rankdir attribute of the graph.

Example

The following example tries to demonstrate some of the features of record based nodes:
digraph RecordShapedNodes {

   rec_horizontal [ shape=record label="Vertical bars|seperate|the individual field" ]

   rec_vertical   [ shape=record label="The initial|{orientation|(top down|or left right)}|{is dependent|{on the|value}|{of|rankdir}|and can be|changed with curly braces}}"]

   rec_Mrecord    [ shape=Mrecord label="{An Mrecord|has rounded|corners}" ]

   rec_ports_1    [ shape=record  label="{ports|<from_2>to connect}|{allow|<to_1>fields and/or nodes}" ]

   rec_ports_2    [ shape=record  label="foo|<to_2>bar|baz}" ]

   rec_horizontal -> rec_vertical -> rec_Mrecord[ style=invis ]

   rec_Mrecord -> rec_ports_1:to_1
   rec_ports_1:from_2 -> rec_ports_2:to_2

}
Github repository about-Graphviz, path: /elems/node/main-types/record-based.dot

HTML like labels

Instead of using record based labels, one might consider to use HTML like labels.

Index