I\'ve been struggling with this for a while and cannot seem to find a straight answer. I\'m working with compound subgraphs in graphviz and cannot seem to find the right combina
A possible (bad but working) solution would be to use invisible nodes and set width. Consider the following:
digraph g {
compound=true;
subgraph cluster_top {
graph [color=black, label="Top", rank=min];
nodeAI0 [style=invisible]
nodeAI1 [style=invisible]
nodeAI2 [style=invisible,fixedsize=true,width=1.65]
nodeA; nodeB; nodeC
cluster_top_DUMMY [shape=point style=invis]
}
subgraph cluster_service {
graph [color=black, label="Bottom", rank=min];
node1; node2; node3; node4; node5; extra_long_node
cluster_bottom_DUMMY [shape=point style=invis]
}
cluster_top_DUMMY -> cluster_bottom_DUMMY [ style=invis ]
}
The invisible nodes (NodeAI0-NodeAI2) take the space. fixedsize=true,width=1.65 makes the last one take exactly 1.65 inches.
Another, better solution would be to also set the relevant longer node specifically (to avoid having to look for the correct value) by adding something like:
node [fixedsize=true,width=0.75]
after the compound=true portion.