Rank between cluster

Hello

Is it possible to have 2 nodes from different cluster to be ranked ?

here an example :

digraph G {

subgraph cluster_TIME {
00 [label="Minuit"];
03;06;09;
12 [label="Midi"];
15;
18;
21;
24 [label="Minuit +1"];
label = "MDS";
00 -> 03 -> 06 -> 09 -> 12 -> 15 -> 18 -> 21 -> 24;
}

subgraph cluster_MDS {
DayStart [style=filled,color=green];

a1 [style=filled,color=green];
a2 [style=filled,color=blue];
a3 [style=filled,color=red];
p1 [style=filled,color=blue,shape=diamond,label="price fe1"];
p2 [style=filled,color=blue,shape=diamond,label="price fe2"];
p1 -> a3;
p2 -> a3;
DayStart -> a1;
DayStart -> a2;
DayStart -> p1;
DayStart -> p2;
a1 -> a3;
a2 -> a3;

label = "MDS";
}
}

The goal is to have aN and pN ranked with the hour.

Thanks,
Nicolas

Yes, assuming you have

Yes, assuming you have version 2.30 or later of Graphviz. Say you want a2 and p2 to be on the same rank as 06. You would then add the subgraph

{ rank=same 06 a2 p2}

and run dot with -Gnewrank. This uses a new ranking function that first appeared in 2.30 that allows much more flexibility in mixing subgraph constraints.

My previous test was

My previous test was wrong.

I retry it and it works perfectly !!

 

thanks a lot

Nicolas

I try to add this

I try to add this :

newrank=true;

in my javascript script but it's not working. Any idea why ?

i have the last version 2.30.1

 

Recent comments