0

I'm creating a switch topology with subgraphs. How is below possible to re-organize so Bridge1 is on the top, Bridge2 is below, etc... Thanks in advance! I It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details.

digraph G {
node [shape=box,style=filled];
newrank=True;
rankdir=TB;

subgraph cluster_1 {
label="Bridge1\n8001.5254aabbcce6";
rank=same;
rstp_1_1[label="port1\nD\n20000"];
rstp_1_2[label="port2\nR\n20000"];
rstp_1_3[label="port3\nD\n20000"];
rstp_1_4[label="port4\nD\n20000"];
}
subgraph cluster_2 {
label="Bridge2\n8001.5254aabbcca6";
rank=same;
rstp_2_1[label="port1\nD\n20000"];
rstp_2_2[label="port2\nD\n20000"];
rstp_2_3[label="port3\nD\n20000"];
rstp_2_4[label="port4\nR\n20000"];
}
subgraph cluster_3 {
label="Bridge3\n8001.5254aabbcc6c";
rank=same;
bgcolor=red;
rstp_3_1[label="port1\nD\n0"];
rstp_3_2[label="port2\nD\n0"];
rstp_3_3[label="port3\nD\n0"];
rstp_3_4[label="port4\nD\n0"];
}
subgraph cluster_4 {
label="Bridge4\n8001.5254aabbccba";
rank=same;
rstp_4_1[label="port1\nD\n20000"];
rstp_4_2[label="port2\nD\n20000"];
rstp_4_3[label="port3\nR\n20000"];
rstp_4_4[label="port4\nD\n20000"];
}
subgraph cluster_5 {
label="Bridge5\n8001.5254aabbccb2";
rank=same;
rstp_5_1[label="port1\nD\n20000"];
rstp_5_2[label="port2\nD\n20000"];
rstp_5_3[label="port3\nR\n20000"];
rstp_5_4[label="port4\nD\n20000"];
}
rstp_1_2 -> rstp_5_2 [arrowhead=none];
rstp_2_3 -> rstp_5_3 [arrowhead=none];
rstp_2_4 -> rstp_3_4 [arrowhead=none];
rstp_3_3 -> rstp_4_3 [arrowhead=none];
rstp_4_4 -> rstp_5_4 [arrowhead=none];
}
ravenspoint
  • 19,093
  • 6
  • 57
  • 103
  • 2
    Does this answer your question? [Control position of clusters in Graphviz](https://stackoverflow.com/questions/53606827/control-position-of-clusters-in-graphviz) – ravenspoint Dec 22 '22 at 17:15

1 Answers1

0

I have added below after rankdir=TB and it did the job:

rstp_1_1->rstp_2_1 [style=invis];
rstp_2_1->rstp_3_1 [style=invis];
rstp_3_1->rstp_4_1 [style=invis];
rstp_4_1->rstp_5_1 [style=invis];
rstp_5_1->rstp_6_1 [style=invis];
rstp_6_1->rstp_7_1 [style=invis];
rstp_7_1->rstp_8_1 [style=invis];
rstp_8_1->rstp_9_1 [style=invis];
rstp_9_1->rstp_10_1 [style=invis];
albert
  • 8,285
  • 3
  • 19
  • 32