I’m using Graphviz (and the dot language) to document the operations for a web app . Since there are often many operations available on a page, I’ve been grouping the mappings for neatness and to prevent repeating myself.
However, I’m unable to get edges to point to the correct field in a record, when the edges are defined in a group. Individually they work fine.
Before anyone asks, I realise record-based nodes are largely superseded by HTML-like labels. However, those are too verbose for what I’m trying to achieve and I don’t need the extra features, so I’m sticking with the original.
Here’s a working example:
digraph site_map {
// Pages
{
node[shape=component]
page1[label="Page 1"]
page2[label="Page 2"]
}
// Operations
{
node[shape=record style=filled fillcolor=green]
entity1[label="Entity 1 | {<save> Save |<get> Get |<del> Del}"]
entity2[label="Entity 2 | {<save> Save |<get> Get |<del> Del}"]
}
// Mappings: Page -> Operation
{
// Page 1 - short form (doesn't work)
page1 -> {
entity1:save
entity1:get
entity1:del
entity2:get
}
// Page 2 - Long form
page2 -> entity1:save
page2 -> entity1:get
page2 -> entity1:del
page2 -> entity2:get
}
}
I originally posted this question on Stackoverflow here