I have the following code:
digraph G {
bgcolor=antiquewhite;
compound=true;
{
rankdir=LR ;
rank=same g0 p1 p2 p3 h1;
}
subgraph cluster0 {
style=filled;
color=khaki;
g0 [label="G",shape=circle,style="filled", color="red", fillcolor="lightpink"]
label = "Cluster 0";
g0 -> p1;
}
subgraph cluster1 {
style=filled;
color=khaki;
p1 [label="S2",shape=box,style="filled", color="blue", fillcolor="skyblue"];
p2 [label="S3",shape=box,style="filled", color="blue", fillcolor="skyblue"];
p3 [label="S3",shape=box,style="filled", color="blue", fillcolor="skyblue"];
label = "Cluster 1";
p1 -> p2 -> p3 [arrowhead=none] ;
}
subgraph cluster2 {
style=filled;
color=khaki;
h1 [label="h1",shape=box,style="invis"];
label = "Cluster 2";
p3 -> h1;
}
}
Everything works perfect except the subgraphs don't show up. As soon as rank is defined outside the clusters the subgraphs disappear.
If defined inside a cluster body, same rank between clusters is lost.