Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000349graphvizDotpublic2004-03-02 23:432011-04-28 04:02
ReporterMehrdad Reshadi2 
Assigned Togviz 
PlatformOS*-*-*OS Version
Summary0000349: rank and cluster works only if nodes are referenced in specific order!

I have some clusters and want to arrange them based on some nodes outside of them. The rank of the cluster can be adjusted by using the {rank=same;...} command. However, only a special order of rank commands works. In the following example, I have 3 clusters containing some random graph. Suppose the I want to adjust all of them with node K_2 in the outer cluster. If I use case1 or case3 in the example, all clustered will be placed at the top of the diagram. But if I use case2, it works. However, it works only if I set the rank of K_2 and the last cluster, then the last cluster and the one before, and so on.
The results are the same on both WindowsXP and Red Hat Linux 9.
Steps To Reproduce

digraph test {

    subgraph cluster_X

        subgraph cluster_I
            node [shape=circle]
            "I_0" [label="0"]
        subgraph cluster_O

            "O0" -> "O4"
            "O1" -> "O0"
            "O2" -> "O3"
            "O3" -> "O0"
            "O4" -> "O5"

            node [shape=circle]
            "O_0" [label="0"]
            "O_1" [label="1"]
            "O_2" [label="2"]
            "O_0" -> "O_1" -> "O_2"

        subgraph cluster_Y
            "Y0" -> { "Y1"; "Y2";}

            node [shape=circle]
            "Y_0" [label="0"]
            "Y_1" [label="1"]
            "Y_0" -> "Y_1"

        node [shape=circle]
        "K_0" [label="0"]
        "K_1" [label="1"]
        "K_2" [label="2"]
        "K_3" [label="3"]
         "K_0" -> "K_1" -> "K_2" -> "K_3"

        /*case 1: does not work correctly * /
        {rank=same; "K_2";"I_0";}
        {rank=same; "K_2";"O_0";}
        {rank=same; "K_2";"Y_0";}
        / **/

        /*case 2: works correcly on if the order is from last cluster to the first */
        {rank=same; "O_0";"I_0";}
        {rank=same; "Y_0";"O_0";}
        {rank=same; "K_2";"Y_0";}

        /*case 3: does not correcly because the order of ranks is different* /
        {rank=same; "Y_0";"O_0";}
        {rank=same; "O_0";"I_0";}
        {rank=same; "K_2";"Y_0";}
        / **/
Additional Information

[north] It's worse than that - in general, they don't work together at all.
Because rank=same and clusters both use similar mechanisms of node
collapsing during the level assignment phase, it's not possible to
assign the same rank to nodes in two different clusters. It's not
an unreasonable thing to want.
TagsNo tags attached.
VERSION     1.10
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:02 user1 New Issue
2011-04-28 04:02 user1 Assigned To => user1

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker