user1318499
user1318499

Reputation: 1354

How to control ordering of root nodes?

I can control ordering of other nodes using ordering="in", but root nodes have no incoming edges to define the order by that way.

Eg:

digraph {
  A -> B
  C -> D
  D -> X
  B -> X
  X [ordering="in"]
}

It generates this: actual output but I want this: desired output

Upvotes: 0

Views: 87

Answers (1)

Jason Pan
Jason Pan

Reputation: 782

This question may be duplicated with the question here. The following approach using additional invisible edges works perfectly for this graph:

digraph {
  A -> B
  A -> D[style=invis];
  C -> B[style=invis];
  C -> D
  D -> X
  B -> X
  X [ordering="in"]
}

enter image description here

Upvotes: 2

Related Questions