changing nodes level

Hello,

I tried this code :

strict digraph {

    graph [splines=polyline];

    D2_0 -> D1_0;

    D1_0 -> "O'a";

    D1_0 -> "O'b";

    D1_0 -> "O'c";

    D1_0 -> "O'd";

    U0 -> D2_0     [color=red];

    U0 -> D1_0     [color=red];

    U0 -> D2_1     [color=red];

    U0 -> D1_1     [color=red];

    D2_1 -> D1_1;

    D1_1 -> "O'a";

    D1_1 -> "O'b";

    D1_1 -> "O'c";

    D1_1 -> "O'd";

    "I'a" -> U0     [color=red];

    "I'b" -> U0     [color=red];

    "I'c" -> U0     [color=red];

    "I'd" -> U0     [color=red];

}

I obtained box.pdf. I'd like to put node U0 at the same level than D1_0 and D1_1 and nodes I'a to I'd at the same level than O'a to O'd having red edges go up to U0 and D2_0 (sbox2.pdf). I tried putting all the nodes I'a..I'dO'a..O'd in the same subgraph, also all the D2_i and D1_i but nothing go well. I also tried invisible edges between U0, D1_0 and D1_1 or I'a to O'd or D2_0 and D2_1 but nothing go well. Do you have any idea how to do that ?

Thanks

Chorose

AttachmentSize
sbox.pdf9.77 KB
sbox2.pdf13.46 KB

Add the lines     {rank=same

Add the lines

    {rank=same D2_1 D2_0 }
    {rank=same U0 D1_1 D1_0 }
    {rank=same "O'a" "O'b" "O'c" "O'd" "I'a" "I'b" "I'c" "I'd" }

right after

    graph [splines=polyline];

 

Recent comments