5

I would like to point an edge towards another edge in graphviz using the dot format.

What I got so far:

digraph G {
    Hello->dummy;
    dummy->World;
    dummy[shape=point width=0];
    Test->dummy;
}

which produces

current status

what I would like to get is something more similar to this:

enter image description here

Any ideas how to do so?

Seanny123
  • 8,776
  • 13
  • 68
  • 124
Sebastian
  • 1,873
  • 4
  • 25
  • 57
  • [This SO post](http://stackoverflow.com/questions/4671238/forcing-main-line-nodes-into-a-straight-line-in-graphviz-or-alternatives) details a few tricks to force a straight line. But it appears that the nodes which you want to be in a line have to be in the same group (i.e. have to all have the same properties). – Tim Biegeleisen Jul 16 '16 at 11:12

2 Answers2

5

Maybe rank = same does the trick?

digraph G
{
  { rank = same; Test; dummy }        // dummy and Test on the same level
  dummy[ shape = point, width = 0 ];                         // connector
  Hello -> dummy[ arrowhead = none ];    // remove arrowhead to connector
  dummy -> Test[ dir = back ];         // you want Test on the right side
  dummy -> World;
}

yields

enter image description here

vaettchen
  • 7,299
  • 22
  • 41
  • Hmm, this will only work for a small example like the one above. My problem is, that I would like to plot "Extended Argumentation Frameworks" where you have a lot of contradictory attacks and attacks on attacks. A typical network could look like the following screenshot: https://www.dropbox.com/s/qphs9uk1fxk88cn/Screenshot%202016-07-18%2017.26.43.png?dl=0 As you can see, this would be rather difficult to represent with the above approach. I know it from tikzpicture in latex that you can simply draw edges and define that there is an anchor point in the center of the edge. That would be awesome! – Sebastian Jul 18 '16 at 16:24
  • i had to put `width=0.0001` in connector line to make it work – lowtech Feb 20 '21 at 21:27
0

[arrowhead=none] with you dummy middleman does the job for me.

digraph G {
    Hello->dummy[arrowhead=none];
    dummy->World;
    dummy[shape=point width=0];
    Test->dummy;
}

result graph

I've added feature request for it in Graphviz's issue tracker.

maciek
  • 3,198
  • 2
  • 26
  • 33