简体   繁体   中英

Change edge placement from beneath to above nodes in Graphviz

It took me some time to make the graph below look like it does right now, and I'm almost satisfied. The one thing that still bothers me is that the connection between D and B should be above all nodes for the sake of aesthetics.

The funny thing is, that supplying the ports for the edge doesn't impress dot which just makes the edge cross the connected nodes.

Do you have an idea on how to avoid this?

我的图表

digraph {
    graph [splines=ortho, nodesep=0.2, fontname="DejaVu Sans", rankdir=LR]
    node [shape=box, fontsize=8]
    edge [arrowsize=0.5]

    subgraph cluster {
        style=invis;
        A -> B -> C;
        A -> B -> C;
        A -> B -> C -> D;
        D -> E;
        D:nw -> B:ne;
    }
    {
        D -> F -> { C; E };
    }
}

PS: You need the latest Graphviz version in order to get orthogonal edges .

It may be a function of the version of the engine you use. I'm not sure what version of dot the GraphViz Workspace http://graphviz-dev.appspot.com/ uses but it does run your problem connector across the top.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM