简体   繁体   English

如何在 Graphviz 中允许重叠边缘?

[英]How can I permit overlapping edges in Graphviz?

Background背景

I'm using Graphviz to create an Organizational Chart.我正在使用 Graphviz 创建组织结构图。

Problem问题

By default dot creates the following diagram:默认情况下dot创建以下图表:

默认输出

The desired output combines the edges so that they overlap, with elbow connections:所需的输出组合边缘,使它们重叠,肘部连接:

期望输出

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?如何dot在曼哈顿布局创建正交,肘部关节的边缘?

Ideas想法

I have tried various combinations of sametail and tailport to no avail.我尝试了sametailtailport各种组合都无济于事。

Creating "elbow-joint" edges is only possible by inserting invisible ("dummy") nodes.创建“肘关节”边只能通过插入不可见(“虚拟”)节点来实现。

See the answer to a similar question for details.有关详细信息,请参阅类似问题的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM