For the life of me I can't enforce node order

Hi, I hope it's appropriate to post this here.

I'm trying to create a flow control diagram. It's a VERY SIMPLE one-dimensional order of operations. I use subgraphs to denote scope and it works well enough so long I don't have any edges. However, once edges are introduced the order starts flipping. The standard way to deal with this, I gather, is to use invisible edges. However even if I set the weight of these edges to 100, it refuses to conform to any rational expectation.

This is using dot 2.38.0. Here the edges are visible for debugging purposes, but in production they would be made invisible.


digraph G {
rankdir = LR;
subgraph cluster_I {
label="Incoming Numbers";
node [style=filled,color=white];
"thisExtention" [shape=square style="rounded, filled" color=lightskyblue1 label="Extension 20"];
"+15412362468" [shape=rectangle style="rounded, filled" color=azure];
"+15412362468" -> "thisExtention" [tailport=e];
"+12069732753" [shape=rectangle style="rounded, filled" color=azure];
"+12069732753" -> "thisExtention" [tailport=e];
"+441134037186" [shape=rectangle style="rounded, filled" color=azure];
"+441134037186" -> "thisExtention" [tailport=e];
{ rank=same; "+15412362468"; "+12069732753"; "+441134037186"; }
subgraph cluster_A {
subgraph cluster_1W {
"actionstart" [label="Start Inbound Action Steps\n(can be interrupted by menu dial)"]
"thisExtention" -> "actionstart" [tailport=e];
subgraph cluster_2G {
"8if" [shape=diamond color=azure label="IF MENUKEY does equal 4"];
"9if" [shape=diamond color=azure label="IF SUM does equal 2\nAND INSIDE “BUSINESS HOURS”"];
"10ring" [shape=rectangle color=azure label="ring"];
"12playrecording" [shape=rectangle color=azure label="playrecording"];
subgraph cluster_3Y {
"13else" [shape=diamond color=azure label=ELSE];
"14playrecording" [shape=rectangle color=azure label="playrecording"];
subgraph cluster_W4 {
"15transfer" [shape=rectangle color=azure label="transfer"];
subgraph cluster_5G {
"16else" [shape=diamond color=azure label=ELSE];
"17hangup" [shape=rectangle color=azure label="hangup"];
subgraph cluster_O {
label="Dial Menu"
"18ring" [shape=rectangle color=azure label="DIAL (#):\nring"];
"19ring" [shape=rectangle color=azure label="DIAL (✽):\nring"];
"20set" [shape=rectangle color=azure label="DIAL ①:\nset"];
"21playrecording" [shape=rectangle color=azure label="DIAL ②:\nplayrecording"];
"22huntgroup" [shape=rectangle color=azure label="DIAL ③:\nRing HuntGroup: "];
"23transfer" [shape=rectangle color=azure label="DIAL ④:\ntransfer"];
"24huntgroup" [shape=rectangle color=azure label="DIAL ⑤:\nRing HuntGroup: "];
{ rank="same"; "actionstart"; "8if"; "9if"; "10ring"; "12playrecording"; "13else"; "14playrecording"; "15transfer"; "16else"; "17hangup"; "18ring"; "19ring"; "20set"; "21playrecording"; "22huntgroup"; "23transfer"; "24huntgroup"; }
"actionstart" -> "8if" -> "9if" -> "10ring" -> "12playrecording" -> "13else" -> "14playrecording" -> "15transfer" -> "16else" -> "17hangup" -> "18ring" -> "19ring" -> "20set" -> "21playrecording" -> "22huntgroup" -> "23transfer" -> "24huntgroup" [weight=100];
subgraph columnthree {
"Extension 10" [shape=square shape=square style="rounded, filled" fillcolor=lightskyblue1];
"15transfer" -> "Extension 10" [tailport=e weight=0];
"HuntGroup " [shape=square shape=septagon style="filled" fillcolor=lightcyan1];
"22huntgroup" -> "HuntGroup " [tailport=e weight=0];
"Extension " [shape=square shape=square style="rounded, filled" fillcolor=lightskyblue1];
"23transfer" -> "Extension " [tailport=e weight=0];
"HuntGroup " [shape=square shape=septagon style="filled" fillcolor=lightcyan1];
"24huntgroup" -> "HuntGroup " [tailport=e weight=0];

If it works without the

If it works without the edges, why are you using the edges? What order do you wish to see the nodes occur in? Do you really want all the nodes in a single row? Maybe you could supply a simpler example where things go wrong, and explain what you want to see.

(thread notificaiton doesn't

(thread notificaiton doesn't appear to work on this site, so I don't know when people respond to me)

It needs edges because everythying gets out of order.

The only solution was to remove the rankstep=LR and then reverse all the edges and rankings. rankstep=LR seems utterly hosed for anything but the simplest of diagrams. 


Recent comments