Record example
Graphviz ยป Graphviz gallery

Prev:Finite state machine example


This example is adapted (and slightly altered) from https://graphviz.org/content/datastruct.

As it shows, special label syntax is still parsed, like escape sequences (see https://graphviz.org/content/attrs#kescString) or, in this case, record syntax (see https://graphviz.org/content/node-shapes#record). However, there is no equivalent to Graphviz's headport/tailport syntax, so we set the edge attributes explicitly.

USING: graphviz graphviz.notation graphviz.render ; <digraph> [graph "LR" =rankdir "8,8" =size ]; [node 8 =fontsize "record" =shape ]; "node0" [add-node "<f0> 0x10ba8| <f1>" =label ]; "node1" [add-node "<f0> 0xf7fc4380| <f1> | <f2> |-1" =label ]; "node2" [add-node "<f0> 0xf7fc44b8| | |2" =label ]; "node3" [add-node "<f0> 3.43322790286038071e-06|44.79998779296875|0" =label ]; "node4" [add-node "<f0> 0xf7fc4380| <f1> | <f2> |2" =label ]; "node5" [add-node "<f0> (nil)| | |-1" =label ]; "node6" [add-node "<f0> 0xf7fc4380| <f1> | <f2> |1" =label ]; "node7" [add-node "<f0> 0xf7fc4380| <f1> | <f2> |2" =label ]; "node8" [add-node "<f0> (nil)| | |-1" =label ]; "node9" [add-node "<f0> (nil)| | |-1" =label ]; "node10" [add-node "<f0> (nil)| <f1> | <f2> |-1" =label ]; "node11" [add-node "<f0> (nil)| <f1> | <f2> |-1" =label ]; "node12" [add-node "<f0> 0xf7fc43e0| | |1" =label ]; "node0" "node1" [-> "f0" =tailport "f0" =headport ]; "node0" "node2" [-> "f1" =tailport "f0" =headport ]; "node1" "node3" [-> "f0" =tailport "f0" =headport ]; "node1" "node4" [-> "f1" =tailport "f0" =headport ]; "node1" "node5" [-> "f2" =tailport "f0" =headport ]; "node4" "node3" [-> "f0" =tailport "f0" =headport ]; "node4" "node6" [-> "f1" =tailport "f0" =headport ]; "node4" "node10" [-> "f2" =tailport "f0" =headport ]; "node6" "node3" [-> "f0" =tailport "f0" =headport ]; "node6" "node7" [-> "f1" =tailport "f0" =headport ]; "node6" "node9" [-> "f2" =tailport "f0" =headport ]; "node7" "node3" [-> "f0" =tailport "f0" =headport ]; "node7" "node1" [-> "f1" =tailport "f0" =headport ]; "node7" "node8" [-> "f2" =tailport "f0" =headport ]; "node10" "node11" [-> "f1" =tailport "f0" =headport ]; "node10" "node12" [-> "f2" =tailport "f0" =headport ]; "node11" "node1" [-> "f2" =tailport "f0" =headport ]; preview