2

If I run graphviz on this digraph:

digraph G {
    subgraph cluster_0 {
        style=filled;
        color=lightgrey;
        node [style=filled,color=white];
        a0; a1;  a2;  a3;
        label = "sources";
    }

    subgraph cluster_1 {
        style=filled;
        color=lightgrey;
        node [style=filled,color=white];
        b0; b1; b2; b3;
        label = "intermediaries";
    }
        a0 -> b0; a1 -> b0;
        a0 -> b1; a1 -> b1;
        a2 -> b2; b0 -> b2;
        b1 -> b2; a3 -> b3;
        b0 -> b3; b1 -> b3;
}

I get

enter image description here

with many edges intersecting the "intermediaries" label. How do I get graphviz to make edges avoid labels?

einpoklum
  • 118,144
  • 57
  • 340
  • 684

1 Answers1

2

As a workaround:

digraph G {
    subgraph cluster_0 {
        style=filled;
        color=lightgrey;
        node [style=filled,color=white];
        a0; a1;  a2;  a3;
        label = "sources";
    }

    subgraph cluster_1 {
        style=filled;
        color=lightgrey;
        node [style=filled,color=white];
        nodelabel [label="intermediaries"; style=filled; color=lightgrey]
        nodelabel -> b1 [style=invis];
        nodelabel -> b0 [style=invis];
        b0; b1; b2; b3;
    }
        a0 -> b0; a1 -> b0;
        a0 -> b1; a1 -> b1;
        a2 -> b2; b0 -> b2;
        b1 -> b2; a3 -> b3;
        b0 -> b3; b1 -> b3;
}

produce:

output

Ohad Eytan
  • 8,114
  • 1
  • 22
  • 31
  • 2
    That is a workaround, albeit it does introduce an extra level and puts the label on that level, which I did not actually want to do. Still, +1 for the effort. – einpoklum Aug 25 '16 at 16:38