cluster changes nodes order ??
Submitted by tamar_a_roulettes on Mon, 01/07/2013 - 14:40
Hi,
I am facing a strange behaviour; with the following specification, nodes are drawn, from left to right, 0 then 1:
graph "test0" {
0;
1;
}
But with a cluster, the nodes are drawn 1 then 0:
graph "test1" {
subgraph cluster0 {
graph [style=invis];
0;
1;
}
}
How could you explain that and ensure the order the nodes are drawn could be mastered ?
Thanks
Recent comments
- I was able to resolve this
21 hours 29 min ago - x11 event bindings
2 days 14 hours ago - One could probable work
2 days 15 hours ago - Would it be possible to
2 days 16 hours ago - The simplest way is to set
2 days 16 hours ago - Thanks, and self-learning for Graphviz
1 week 1 day ago - There are various ways.
1 week 1 day ago - that did work
1 week 2 days ago - Hello,
You can also use
1 week 2 days ago - The boxes around clusters are
1 week 3 days ago

This isn't the nicest answer
To guarantee relative ordering, you need to provide extra constraints for dot to satisfy. This is normally done via edges, but edges also imply a top-down ordering. To prevent this, specify that 0 and 1 should lie on the same rank:
graph "test0" { subgraph cluster0 { style=invis { rank=same 0 -- 1 [style=invis] } } }