Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphviz: Distance between edge and by passed nodes with neato

Tags:

graphviz

neato

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?

like image 346
Mike M Avatar asked Oct 03 '13 12:10

Mike M


2 Answers

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.

like image 167
Toryu Avatar answered Oct 23 '22 05:10

Toryu


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.

like image 35
rob99985 Avatar answered Oct 23 '22 04:10

rob99985