3

There are multiple questions e.g. here, here, and here. Asking how to force straight edges for connectors in Graphviz (dot).

The answers include:

  • splines=line;
  • splines=false;
  • compiling with neato
  • and a longer example that creates straight lines by creating invisible nodes.

(How) can I force straight connectors from the top of one record to another with this example without resorting to invisible nodes (if possible)?

digraph select {
    splines=line;
    // splines=false;
    node [shape=record];
    rec1 [label="<f0> left|<f1> middle|<f2> right"];
    rec1:f0:n -> rec1:f2:n;
}

Edit: a question was asked - how can the record have a connecting edge if it's one record and how can that not be straight?

A record can point at different parts of itself. The question is how to get that to be straight i.e. go out turn at a 90 degree angle, go, turn at a 90 degree angle, and connect?

i.e. not a curved edge: connector with curved edge

d-cubed
  • 1,034
  • 5
  • 30
  • 58
  • Only one record involved. How would a straight edge be visible? – sroush Feb 19 '22 at 23:53
  • 2
    The answer should be "splines=ortho" (https://graphviz.org/docs/attrs/splines/). But in this case (both ports on same node) it fails miserably (try it). "splines=polyline" also fails. It is possible to post-process the curved splines to make 90 degree angles (I'd use GVPR), but that is probably more effort than you want. – sroush Feb 21 '22 at 19:12

0 Answers0