2012-10-24 16 views
10

मैं subgraph clusterCG (clusterCG 3 शामिल नहीं schould)ग्राफवीज सबग्राफ रैंक कैसे बदलें?

digraph G{ 
rankdir = LR; 
node [shape = none] 

1->2->3->4[arrowhead=none] 

node [shape = ellipse] 

A->A2->A3; 

subgraph clusterCG{ 
    shape = rect; 
    rank=same; 
    A2; 
    B; 
    C; 
    color=blue; 
    label="C"; 
} 

{ rank=same; 1; A;} 
{ rank=same; 3; CG;} 
{ rank=same; 4; A3;} 
} 

enter image description here

तटरक्षक रैंक के साथ स्वतंत्र नोड के रूप में उत्पन्न होता है 3.

मैं subgraph clusterCG चाहते 3 के रूप में एक ही रैंक करना चाहते हैं रैंक 3.

+0

FDSg के साथ प्रयोग के विभिन्न रैंक एल्गोरिथ्म, आप जवाब नहीं स्वीकार करना चाहिए। यह मुझे अच्छा लग रहा है! मुझे पता है कि आपने इसे स्वयं लिखा है, लेकिन यह काफी उपयोगी था। –

+0

मैं सहमत हूं। इससे मुझे एक अलग तरह के लेआउट में एक मुश्किल समस्या का पता लगाने में मदद मिली। धन्यवाद। – melston

उत्तर

7

शायद सबसे अच्छा समाधान नहीं है, लेकिन ऐसा लगता है कि शून्य आकार नोड्स एकमात्र चीज है जो

0 काम करती है
digraph G{ 
rankdir = LR; 
node [shape = none] 

1->2->3->4[arrowhead=none] 

node [shape = ellipse] 
ACG[shape = none,label="",width=0, height=0]; 

CG->A2 [style=invis,constraint=false]; 

A->ACG[arrowhead=none]; 
ACG->A2->A3; 

subgraph clusterCG{ 
    shape = rect; 
    rank=same; 
    A2; 
    B; 
    C; 
    color=blue; 
    label="C"; 
} 

{ rank=same; 1; A;} 
{ rank=same; 2; ACG;} 
{ rank=same; 4; A3;} 

} 

enter image description here

2

"newrank = सच"

digraph G { 
newrank=true 
rankdir = LR; 
node [shape = none] 

1->2->3->4[arrowhead=none] 

node [shape = ellipse] 

A->A2->A3; 

subgraph clusterCG{ 
    shape = rect; 
    rank=same; 

    A2; 
    B; 
    C; 
    color=blue; 
    label="C"; 
} 

{ rank=same; 1; A;} 
{ rank=same; 3; A2} 
{ rank=same; 4; A3;} 
}