Does the dot Directed Graph allow for subgraphs with a different rankdir?
Asked Answered
I

3

12

Using the dot directed graph language, is it possible to create subgraphs with a different rankdir?

I tried the following, which didn't work. Both graphs were left to right, despite the presence of rankdir="TB" in the subgraph.

digraph g {
    rankdir="LR";
    LEFT->RIGHT;
    clusterrank="local";

    subgraph cluster1 { 
        rankdir="TB";    
        node[style=filled];         
        color=black;
        TOP->BOTTOM;                
    }   
}

Is there some other syntax to get a Top/Bottom and Left/Right graph in the same diagram, or is this not possible?

Illjudged answered 18/6, 2009 at 17:34 Comment(0)
W
9

Seems like this is a long standing feature request:

Wagonage answered 1/3, 2010 at 12:52 Comment(1)
Ah, a canonical "you can't do that". Thank you!Illjudged
G
0

There's a clusterrank attribute for subgraphs, try this:

clusterrank=local;
Goudy answered 18/6, 2009 at 17:44 Comment(1)
Thank you, but could you expand on that? It's my understanding that clusterrank=local just turns on scanning for cluster subgraphs (i.e. if the name begins with cluster, it's get separate layout treatment). Adding this in (see above) still gave me a graph where everything was Left to Right.Illjudged
I
0

Desperately wanting the same feature, i Googled and there is a "trick": Essentially, you add invisible edges (and nodes if required) to sink the ranks.

Indulgent answered 15/9, 2011 at 10:56 Comment(1)
Forbidden link :( Could you expand on this?Littlefield

© 2022 - 2024 — McMap. All rights reserved.