Allow nodes to be centered in a cluster
Steps to reproduce
Here are two potential (and related) graph definitions:
digraph G {
bgcolor="gray"
node [
style=filled
shape="circle"
fillcolor="green4"
penwidth="2"
color="green1"
fontcolor="white"
]
root [
shape="box"
color="white"
fontcolor="white"
label="hello"
]
AAA_1 [
label="AAA"
]
BBB_2 [
label="BBB"
]
subgraph cluster_ccc {
color=gray
fillcolor="blue"
style=filled
label="ccccc"
labelloc=b
fontcolor="white"
labeljust=l
subgraph cluster_south_a {
label="aaaaaaaaaaaaaaaaaaaaaa"
5 [ label="" fillcolor="red" ]
6 [ label="" fillcolor="red" ]
5 -> 6
}
subgraph cluster_south_b {
label="bbbbbbbbbbbbbbbbbbbbbb"
7 [ label="" fillcolor="red" ]
8 [ label="" fillcolor="red" ]
7 -> 8
}
}
root -> AAA_1
root -> BBB_2
AAA_1 -> 7
BBB_2 -> 5
}
and
digraph G {
bgcolor="gray"
node [
style=filled
shape="circle"
fillcolor="green4"
penwidth="2"
color="green1"
fontcolor="white"
]
root [
shape="box"
color="white"
fontcolor="white"
label="hello"
]
AAA_1 [
label="AAA"
]
BBB_2 [
label="BBB"
]
subgraph cluster_ccc {
color=gray
fillcolor="blue"
style=filled
label="ccccc"
labelloc=b
fontcolor="white"
labeljust=l
subgraph cluster_south_a {
label="aaaaaaaaaaaaaaaaaaaaaa"
5 [ label="" fillcolor="red" ]
6 [ label="" fillcolor="red" ]
5 -> 6
}
subgraph cluster_south_b {
label="bbbbbbbbbbbbbbbbbbbbbb"
7 [ label="" fillcolor="red" ]
8 [ label="" fillcolor="red" ]
9 [ label="" fillcolor="red" ]
10 [ label="" fillcolor="red" ]
7 -> 8
7 -> 9
8 -> 9
8 -> 10
9 -> 10
}
}
root -> AAA_1
root -> BBB_2
AAA_1 -> 7
BBB_2 -> 5
}
Expected Behaviour
I expected to see the red nodes horizontally centered in the cluster to which they belong.
Actual Behaviour
These produce:
OS Version
http://magjac.com/graphviz-visual-editor/
Graphviz Version
http://magjac.com/graphviz-visual-editor/
Additional info
SO Question : https://stackoverflow.com/questions/77984074/how-can-i-center-nodes-in-a-graphviz-cluster
Forum Thread: https://forum.graphviz.org/t/how-can-i-center-nodes-in-a-graphviz-cluster/2020/4
It may be possible to manually fine-tune the graph attribute nodesep
to get close to the desired output, but that is not a practical solution for me.