GraphViz, grouping the same edges

后端 未结 2 472
甜味超标
甜味超标 2020-12-06 04:55
digraph G {
  a -> b [ label = \"foo\" ];
  a -> b [ label = \"bar\" ];
}

This will create two edges between the \'a\' and \'b\' nodes. Is th

相关标签:
2条回答
  • 2020-12-06 05:08

    I think it really depends on what your desired output would be. One possibility is:

    digraph G {
       graph [ splines = false ]
       a -> b [ label = "foo" ];
       a -> b [ label = "bar" ];
     }
    

    Where not using splines draws edges with straight line segments and so duplicate edges will not be distinguished visually.

    In your ideal output, what would the single edge look like since there are to be two different labels for it?

    0 讨论(0)
  • 2020-12-06 05:24

    The "strict" keyword may help you.

    strict digraph G {
      a -> b [ label = "foo" ];
      a -> b [ label = "bar" ];
    }
    

    This will combine the edges. But I believe it will only apply the first label.

    0 讨论(0)
提交回复
热议问题