I have a small process graph that I want to lay out nicely. The graph should be aligned to the top and go from left to right. In some cases, the nodes and relationships don't position themselves as expected.
The following graphviz code can be used in the web editor: http://magjac.com/graphviz-visual-editor/
Case 1 (Works fine):
Graphviz Code
strict digraph {
node [fillcolor=yellow, style="rounded,filled", shape=diamond]
rankdir="LR";
graph [ordering=out, nodesep=0.3, ranksep=1];
ordering="out";
splines=polyline;
"C"-> "D";
"A"-> "B"[weight = 2];
"B"-> "C";
"A"-> "D";
"C"-> "E";
}
Result: Case 1
Case 2 (Strange behavior when adding a relation from C to a new node F):
Graphviz Code
strict digraph {
node [fillcolor=yellow, style="rounded,filled", shape=diamond]
rankdir="LR";
graph [ordering=out, nodesep=0.3, ranksep=1];
ordering="out";
splines=polyline;
"C"-> "D";
"A"-> "B"[weight = 2];
"B"-> "C";
"A"-> "D";
"C"-> "E";
"C"-> "F";
}
Result: Case 2
Question: I expected the edge from "A" to "D" to be drawn as in case 1. How can i change the code, so that my expected result is visualized?
Case 3 (Strange behavioe when adding more weights)
Graphviz Code
strict digraph {
node [fillcolor=yellow, style="rounded,filled", shape=diamond]
rankdir="LR";
graph [ordering=out, nodesep=0.3, ranksep=1];
ordering="out";
splines=polyline;
"C"-> "D" [weight = 10];
"A"-> "B"[weight = 5];
"B"-> "C"[weight = 10];
"A"-> "D" [weight = 2];
"C"-> "E";
"C"-> "F";
}
Result: Case 3
Question: I expected the edge from "A" to "D" to be drawn as in case 1. How can i change the code, so that my expected result is visualized?
If you want to know "why", read this document https://www.graphviz.org/pdf/dotguide.pdf and then read the code.
Stackoverflow is better suited for "My current Graphviz input produces graph X, how can I get it to produce Y?"