Search code examples
graphgraphvizdot

Edge pointing at edge with Graphviz and Dot


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?


Solution

  • 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