4
votes

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.

1
+1: Orthogonal edges are new to me. Looks good, apart from the problem that you've spotted. I note that the documentation you refer to says Currently, the routing does not handle ports or, in dot, edge labels which may be the cause of the problem. I thought inserting an invisible node between D and B might help resolve the problem, but I tried various ways of doing that and none of them improved matters. I'll think further about this. - Simon

1 Answers

3
votes

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