Reputation: 13386
I'm making sorta super simplified class diagram in dot language. The diagram contains only simple nodes with class names, inheritance and aggregation.
In order to have a specific style for inheritance edges, and to display children classes below their parent, I use this setup:
subgraph inheritance {
edge[dir="back"; arrowtail="empty"; arrowsize="1.75"];
color=white;
subgraph clusterExpression{
Expression -> VariableExpression;
Expression -> AssignmentExpression;
Everything works fine, but when I have a lot of subclasses my diagram becomes really wide. I don't care about subclasses being on the same level or not.
Is there a way to display all subclasses below superclass but in most compact way? Instead of this:
I want to get something like this:
Upvotes: 1
Views: 531
Reputation: 56466
You may try the graphviz tool called unflatten :
unflatten is a preprocessor to dot that is used to improve the aspect ratio of graphs having many leaves or disconnected nodes. The usual layout for such a graph is generally very wide or tall. unflatten inserts invisible edges or adjusts the minlen on edges to improve layout compaction.
You can pipe it into your command line - see these answers for examples.
Upvotes: 2