graphviz - 如何在 GraphViz 中使用分割箭头?

标签 graphviz arrows

我想要像这样的图表的分支箭头:

enter image description here

这是我当前的代码:

digraph {
    splines=curved
    a -> b -> c -> d -> e 
    e -> a [ label=1 ]
    e -> f [ label=2 ]
}

使用neato,您可以看到箭头并非来自同一个根:

enter image description here

a trick to use an invisible joint node

digraph {
    splines=curved
    a -> b -> c -> d -> e 
    e -> joint [ dir=none ]
    joint [shape="none", label="", width=0, height=0]
    joint -> a [ label=1 ]
    joint -> f [ label=2 ]
}

但是e -> a 箭头太长了。并且箭头 2 仍然不与箭头 1 相切。

enter image description here

有没有办法达到这样的效果?

最佳答案

这里有一个提示:

digraph {
    splines=curved
    a -> b -> c -> d -> e 
    e -> joint [ dir=none ]
    joint [shape="none", label="", width=0, height=0]
    joint -> a [ label=1 ]
    joint -> f [ label=2 ]
    a -> f [style=invis]  //pull a and f together ~ "tangent" effect
}

我怀疑是否有更好的解决方案,Graphviz 就是这样。

enter image description here

关于graphviz - 如何在 GraphViz 中使用分割箭头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67986775/

相关文章:

haskell - 为什么 Conduit 和 Pipe 不能有 Arrow 实例?

haskell - 有人可以向我解释为什么ArrowApply的应用程序功能使它们像monad一样强大吗?

unique - 子图具有相同的节点,如何使其唯一

Python:pygraphviz 和 graphviz 的安装问题

GraphViz 点文件。节点作为国际象棋顺序

在多个页面上拆分大图的算法

graph - 为Networkx和Graphviz中的特定节点着色

haskell - 奇怪的 ghc 错误消息, "My brain just exploded"?

haskell - 箭头的创造性使用

haskell - 为什么静态箭头概括了箭头?