1

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;

}

enter image description here

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;

}

enter image description here

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.

TylerH
  • 19,065
  • 49
  • 65
  • 86
mroavi
  • 109
  • 2
  • 7
  • Welcome please supply the details. Read [How to Ask](http://stackoverflow.com/help/how-to-ask) and [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – albert Aug 27 '18 at 15:38
  • I rephrased the question. Hopefully, it's more clear now. – mroavi Aug 29 '18 at 11:18

0 Answers0