Graphviz ignore edge when deciding layout
Asked Answered
N

1

7

I have an edge in a dot graph that I need to be ignored by other edges during the layout. I have tried feeding the first part of the code through dot and then adding dotted edges below, however the other solid edges still keep being affected by them.

The code:

digraph structs {
    rankdir=LR
    edge [tailclip=false];
    node [shape=record];
    header [label="{<0> |<1> header|<2>  }"];
    data0 [label="{<0> |<1> data0|<2> }"];
    data1 [label="{<0> |<1> data1|<2> }"];
    trailer [label="{<0> |<1> trailer|<2> }"];

    header -> data0 -> data1 -> trailer [style=invis, weight=100];
    edge [arrowhead=vee, arrowtail=dot, dir=both, weight=40];
    header:2:c -> data0:1:n;
    data0:0:c -> header:1:s;


    data0:2:c -> data1:1:n;
    data1:0:c -> data0:1:s;

    data1:2:c -> trailer:1:n ;
    trailer:0:c -> data1:1:s;

    edge [constraint=false, style=dashed, weight=0, layer=1];
    data0:2:c -> trailer:1:n [weight=0];
    trailer:0:c -> data0:1:s [weight=0];

}

The results: The result

Nitrile answered 1/4, 2018 at 4:35 Comment(2)
I don't understand what you mean by your question. Can you give an explanation of what goes wrong (maybe also an image of the situation "before" and the wanted situation).Paulino
This is exactly my question. I want to draw certain edges while the layout algorithm should ignore them when positioning the nodes. I know dot can do this but I don't know how to look it up in the documentation.Hedgepeth
P
0

If constraint=false is inadequate, then

  • run dot -Tdot ... >myfile.dot without the "ignore me" edges
  • using a text editor, add the "ignore me" edges to myfile.dot (pretty much anywhere before the last brace)
Prunella answered 4/10 at 20:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.