How to set the order of the nodes in one layer by the order of the definition of edges rather than the definition of nodes when using dot to draw a tree diagram?
For example, For some reasons i need to first define node1, node2, and node3, and then draw the edges: node3 -> node2, and node3 -> node1, and i hope that the edges are drawn as they are defined.
below are the .dot files
digraph G {
node1 [label = 1];
node2 [label = 2];
node3 [label = 3];
node3 -> node2;
node3 -> node1;
}
but I want it to be like this:
How can i realize this? Thank you for help.
How to set the order of the nodes in one layer by the order of the definition of edges rather than the definition of nodes when using dot to draw a tree diagram?