如何在正交图中组合边?

时间:2016-11-05 19:01:55

标签: graphviz

我正在使用splines=ortho,我希望边缘能够一起折叠。为了说明,我想完成这个:

enter image description here

我试过了:

digraph G {
  splines=ortho;

  edge [dir=none];
  node [shape=diamond, label="", height=0.1, width=0.1];

  start -> a [weight=10];
  start -> b;
  start -> c;
  start -> d;
  start -> e;
}

但最终看起来像这样:

enter image description here

关于如何使边缘相互重叠的任何线索?

1 个答案:

答案 0 :(得分:0)

您需要在与start相同的级别创建空节点并首先连接到它们,然后绘制图表的其余部分:

digraph G
{  
  node[ shape = point, label="", height=0, width=0 ] 01 02 03 04; 
  node[ shape=diamond, label="", height=0.1, width=0.1 ];
  { rank = same; start 01 02 03 04; }

  edge [dir=none];
  start -> 01 -> 02 -> 03 -> 04[ minlen = 2 ];
  start -> a [weight=2];
  01 -> b;
  02 -> c;
  03 -> d;
  04 -> e;
}

产量

![enter image description here