当使用花键= true中的graphviz中时,平行边缘将合并为1

发布于 2025-01-30 04:17:14 字数 1651 浏览 2 评论 0原文

我正在使用graphviz(dot)生成一个无向的多编码,其中许多边缘与节点重叠,我还必须平行边缘(2个带有多个边缘的节点)。

我尝试使用花键= true来删除重叠,但这只是使大量的平行边缘合并到一个边缘中。

这是我的图表上带有和没有花纹的图片:

使用splines = true

使用花键= false

我想要获得的东西将是一种可视化并行边缘而无需妥协的方式图形清晰度。

我用较小的图表复制了这个问题:

使用spline = true

使用splines = false

这是此较小图的点代码:

graph G {
    bgcolor = grey
    layout = fdp
    outputorder = edgesfirst
    splines = false
    
    
    a [color = white, style = filled, shape = circle ]
    b [color = white, style = filled, shape = circle ]
    b [color = white, style = filled, shape = circle ]
    c [color = white, style = filled, shape = circle ]
    d [color = white, style = filled, shape = circle ]
    e [color = white, style = filled, shape = circle ]
    f [color = white, style = filled, shape = circle ]
    g [color = white, style = filled, shape = circle ]
    h [color = white, style = filled, shape = circle ];

    a--b [color=red]
    a--b [color=blue]
    a--g [color=red]
    a--f [color=blue]
    a--c [color=black]
    a--d [color=red]
    b--h [color=black]
    e--h [color=blue]
    e--d [color=black]
    e--g [color=red]
    c--f [color=black]
    c--f [color=red]
    b--d [color=blue]
    g--b [color=black]
    h--a [color=red]

I'm using graphviz (dot) to generate an undirected multigraph where a lot of the edges are overlapping with nodes and I also have to parallel edges (2 nodes with multiple edges).

I tried to use splines = true to remove the overlap but that just made a ton of parallel edges merge into a single edge.

Here is a Picture on my graph with and without splines:

using splines = true

using splines = false

What I am looking to get would be a way to visualize the parallel edges without having to compromise with graph clarity.

I replicated this issue with a smaller graph:

using splines = true

using splines = false

Here is the dot code for this smaller graph:

graph G {
    bgcolor = grey
    layout = fdp
    outputorder = edgesfirst
    splines = false
    
    
    a [color = white, style = filled, shape = circle ]
    b [color = white, style = filled, shape = circle ]
    b [color = white, style = filled, shape = circle ]
    c [color = white, style = filled, shape = circle ]
    d [color = white, style = filled, shape = circle ]
    e [color = white, style = filled, shape = circle ]
    f [color = white, style = filled, shape = circle ]
    g [color = white, style = filled, shape = circle ]
    h [color = white, style = filled, shape = circle ];

    a--b [color=red]
    a--b [color=blue]
    a--g [color=red]
    a--f [color=blue]
    a--c [color=black]
    a--d [color=red]
    b--h [color=black]
    e--h [color=blue]
    e--d [color=black]
    e--g [color=red]
    c--f [color=black]
    c--f [color=red]
    b--d [color=blue]
    g--b [color=black]
    h--a [color=red]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

飘逸的'云 2025-02-06 04:17:15

您正在击中一个错误,该错误是在版本2.43.0后某个时候引入的。它似乎会影响除 dot 外的每个引擎。
我建议在这里报告此错误: https://gitlab.com/graphviz/graphviz/graphviz/graphviz/graphviz/-/issues
尚未找到工作。

You are hitting a bug, introduced sometime after version 2.43.0. It seems to affect every engine except dot.
I suggest reporting this bug here: https://gitlab.com/graphviz/graphviz/-/issues.
No work-arounds found, yet.

許願樹丅啲祈禱 2025-02-06 04:17:15
  • 您的示例图最少缺少闭合支架。不确定是否缺少任何节点或边缘,
  • 您的图实际使用 fdp 引擎,而不是 dot 引擎引擎layout = fdp
  • 美学通常在旁观者的眼睛,但这里有一些建议:
  • your example graph is minimally missing a closing brace. Not sure if any nodes or edges are missing
  • your graph is actually using the fdp engine, not the dot engine layout = fdp
  • aesthetics are often in the eye of the beholder, but here are some suggestions:
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文