jnns
jnns

Reputation: 5634

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?

My graph

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.

Upvotes: 5

Views: 2964

Answers (1)

ob1
ob1

Reputation: 1792

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.

enter image description here

Upvotes: 3

Related Questions