【问题标题】:How to have split arrow in GraphViz?如何在 GraphViz 中使用拆分箭头?
【发布时间】:2021-12-30 23:31:14
【问题描述】:

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

这是我当前的代码:

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

使用neato,您可以看到箭头不是来自一个根:

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 相切。

有没有办法达到这个效果?

【问题讨论】:

    标签: graphviz arrows


    【解决方案1】:

    这里有一个提示:

    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 就是这样。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-22
      • 1970-01-01
      • 2011-05-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多