UML class diagrams with Graphviz

UML class diagram rendered with Graphviz

Class diagrams can be created with Graphviz quite nicely: hierachical structure, reversed arrows, empty arrowtails and records as node shapes, pretty compliant. Code follows, rendered result above.


digraph hierarchy {
size="5,5"
node[shape=record,style=filled,fillcolor=gray95]
edge[dir=back, arrowtail=empty]

2[label = "{AbstractSuffixTree|+ text\n+ root|...}"]
3[label = "{SimpleSuffixTree|...| + constructTree()\l...}"]
4[label = "{CompactSuffixTree|...| + compactNodes()\l...}"]
5[label = "{SuffixTreeNode|...|+ addSuffix(...)\l...}"]
6[label = "{SuffixTreeEdge|...|+ compactLabel(...)\l...}"]

2->3
2->4
5->5[constraint=false, arrowtail=odiamond]
4->3[constraint=false, arrowtail=odiamond]
2->5[constraint=false, arrowtail=odiamond]
5->6[arrowtail=odiamond]
}


About this entry