Graphviz: Distance between edge and by passed nodes with neato
Asked Answered
J

2

10

Layout engine is neato. I would like to have some more space between the arrow from a to c and the node b. margin and pad don't help with neato. This is my graph:

digraph G {
  splines=true      

  a [pos="0.0,0.0!"];
  b [pos="0.0,1.0!"];
  c [pos="0.0,2.0!"];  

  a -> b;
  a -> c;
  b -> c;
}

Current graph

Is that possible?

Joktan answered 3/10, 2013 at 12:46 Comment(0)
P
10

Taking your original graph definition, adding a esep=1 attribute to obtain the following:

digraph G {
  splines=true; esep=1;


  a [pos="0.0,0.0!"];
  b [pos="0.0,1.0!"];
  c [pos="0.0,2.0!"];  

  a -> b;
  a -> c;
  b -> c;
}

will output the following with neato:

Output with added <code>esep</code> attribute

As per the documentation for that attribute:

Margin used around polygons for purposes of spline edge routing. The interpretation is the same as given for sep. This should normally be strictly less than sep.

Pickled answered 4/12, 2013 at 17:39 Comment(1)
Sorry, somehow I didn't see your answer the last days. Thank you, you're right this works. But it seems my tiny example here is to tiny. The problem is, the routing only works, when the nodes have a minimal distance between them. I cannot enforce this distance in my application, nodes might be very close to each other. esep enlarges this distance, so that routing won't work in my cases. Any idea, if one can get around this problem? But it feels like this is intrinsic to Graphviz.Joktan
F
2

Assuming this was solved (or irrelevant now!) given how old it is but you can attach a minus to esep (i.e. esep = -0.4) and that brings the nodes closer together.

Fleda answered 22/10, 2019 at 21:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.