避免graphviz中的边缘相交

use*_*813 2 graphviz

假设我们有以下简单图形:

digraph Test {

    Start[shape = doublecircle];
    Foo[shape = square];
    Bar[shape = diamond];
    Baz[shape = square];
    Xyz[shape = square];

    Start -> Foo;
    Foo:s -> Bar:n;
    Bar:w -> Baz:n;
    Bar:e -> Xyz:n;
    Baz:s -> Foo:n;

}
Run Code Online (Sandbox Code Playgroud)

呈现如下:

渲染图

有没有办法告诉graphviz绘制Baz -> Foo没有与Foo -> Barnor 相交的边缘Bar -> Baz

Guy*_*ely 5

当涉及到graphviz布局时,您可以做的最好的事情就是尽可能地避免干扰:)

从您的文件中取出指南针:

digraph Test {

    Start[shape = doublecircle];
    Foo[shape = square];
    Bar[shape = diamond];
    Baz[shape = square];
    Xyz[shape = square];

    Start -> Foo;
    Foo -> Bar;
    Bar -> Baz;
    Bar -> Xyz;
    Baz -> Foo;

}
Run Code Online (Sandbox Code Playgroud)

你会得到:

在此处输入图片说明