I have a program that automatically generates dot graphs representing the structure of a system. The system is defined by the user using a set of equations.
I would like to force dot displaying only straight and orthogonal edges between nodes. The placement of the nodes can be anywhere as long these two requirements are met.
For example, I want to prevent the edge corners that the following code generates:
digraph R {
graph [splines=ortho, nodesep=1]
node [shape=record];
rA -> sA;
sA -> vB;
t -> rA;
uB -> vB;
wB -> u;
wB -> tA;
}
I found that one way to achieve this is by using the rank
attribute. For example:
digraph R {
graph [splines=ortho, nodesep=1]
node [shape=record];
{ rank=same rA sA tA }
{ rank=same uB vB wB }
rA -> sA;
sA -> vB;
t -> rA;
uB -> vB;
wB -> u;
wB -> tA;
}
However, using the rank
attribute does not solve my problem since it would be very difficult to automate this for any graph. The logic for assigning ranks (which influences the node placement) to every node would be extremely complex (the graphs can become quite large). I want to know if there is another way of obtaining this output that does not require the use of the rank
attribute.