You need to sign in or sign up before continuing.
setting rankdir causes odd node ordering
Steps to reproduce
(rankdirBug.gv is attached)
- run dot -Tpng rankdirBug.gv >rankdirBug.png ## rankdir=LR
- then dot -Grankdir="" -Tpng rankdirBug.gv >rankdirBugOK.png
- compare the two output files, note that the node order within the subgraphs is different
Expected Behaviour
the order of the nodes within the subgraphs should be as directed by the input (controlled by edge weights)
Actual Behaviour
When rankdir=LR, the node order is not the desired order
OS Version
Ubuntu 18.04.4 LTS on Windows 10 WSL
Graphviz Version
dot - graphviz version 2.40.1 (20161225.0304)
and
dot - graphviz version 2.46.2~dev.20210215.0502 (20210215.0502)
Additional info
rankdirBug.gv:
digraph video {
graph[rankdir="LR"] // here lies the issue
subgraph cluster_main{
MAIN
}
subgraph cluster_ingest {
{rank=same
edge [ weight=999 style=invis ]
A->B->C->D->E->F->G->H->I->J
}
}
subgraph cluster_onprem {
{rank=same
edge [weight=999 style=invis]
M1 -> M2 -> M3 -> M4 -> M5;
}
}
edge [weight=1]
D -> M1
E -> M2
F -> M3
G -> M3
H -> M3
I -> M4
J -> M5
A -> MAIN
B -> MAIN
C -> MAIN
D -> MAIN
M1 -> MAIN
M2 -> MAIN
}