Reputation: 5590
I use the DOT
language to create a diagram in R
. As I get a strange result, I am interested how to swap positions of two nodes: node 8 and node c4?
The code:
digraph DAG {
# Initialization of node attributes
node [shape = box, color = blue]; 2; 3; 4;
# Revision to node attributes
{ node [shape = box,style = filled,fillcolor = yellow]; 8}
# Revision to node attributes
{ node [shape = diamond, color = "red"]; c1; c2; c3; c4}
{ rank=same; c1; c2; c3}
{ rank=same; 8; c4}
# Initialization of edge attributes
edge [color = green, rel = yields]
# Edge statements
2->c1 [headport = w];
c1->c2->c3
c2->c1 [tailport = n, headport = n];
8->c3 [tailport = n, headport = s];
c3->3 [tailport = e, headport = n];
c3->c2 [tailport = n, headport = n];
3->c4 [tailport = s, headport = n];
c4->4 [tailport = s, headport = n];
c4->8 [tailport = w, headport = e];
}
The (incorrect) result is:
Upvotes: 0
Views: 415
Reputation: 3759
for "wrong way" edges you may
dir = back
to invert its 'force'constraint = none
to disable its 'force'in your case you substitute
8->c4 [tailport = e, headport = w, dir = back];
by either
c4->8 [tailport = w, headport = e, constraint = none];
or by
8->c4 [tailport = e, headport = w, dir = back];
Upvotes: 3