11

Background

I'm using Graphviz to create an Organizational Chart.

Problem

By default dot creates the following diagram:

Default Output

The desired output combines the edges so that they overlap, with elbow connections:

Desired Output

Source Code

The following source code generates the problematic diagram:

digraph G {
  splines = ortho;
  concentrate = true;

  node [shape="box", style="rounded", penwidth = 2];
  edge [color="#142b30", arrowhead="vee", penwidth = 2];

  {
    rank = same
    "1";
    "2";
    "3";
    "4";
  }

  "Main Node" -> "1";
  "Main Node" -> "2";
  "Main Node" -> "3";
  "Main Node" -> "4";

  {
    rank = same
    "5";
    "6";
    "7";
  }

  "1" -> "5";
  "1" -> "6";
  "1" -> "7";
}

Question

How can dot create orthogonal, elbow-joint edges in a Manhattan layout?

Ideas

I have tried various combinations of sametail and tailport to no avail.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
  • Similar to @marapet's answer, you can take inspiration from http://stackoverflow.com/questions/3718025/graphviz-dot-how-to-insert-arrows-from-a-node-to-center-of-an-arrow – Stéphane Gourichon Oct 02 '15 at 15:07

1 Answers1

9

Creating "elbow-joint" edges is only possible by inserting invisible ("dummy") nodes.

See the answer to a similar question for details.

Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
marapet
  • 54,856
  • 12
  • 170
  • 184