-2

image.dot

I am beginner using Graphviz. what can I do for getting like this? Can you guys please help me, Thanks in advance.

albert
  • 8,285
  • 3
  • 19
  • 32
Anusha Konduru
  • 111
  • 2
  • 3
  • 11
  • Welcome to SO. Please **visit** the **[help center](http://stackoverflow.com/tour)** and take the tour to see what and how to ask. HINT: Post codes and efforts – – B001ᛦ Aug 07 '17 at 11:51
  • I love to help in GraphViz questions, but I need to see what you've tried in order to help you. Please post your DOT file so we can assist. – TomServo Aug 07 '17 at 11:58

1 Answers1

1

Use "same" rank to build columns out of clustered nodes

Use "invisible" arrows to "align" top nodes at each cluster in a row

Use "newrank=true" and "{rank=same ...}" for all top nodes from each first cluster in each row. If you do not do that your graph will fell apart by removing links to a start node.

digraph G {

    rankdir=LR;
    newrank=true;

    subgraph cluster_a {
        subgraph cluster_a0 {
            rank=same;
            a00;a01;a02;a03;
        }
        subgraph cluster_a1 {
            rank=same;
            a10;a11;a12;
        }
    }

    subgraph cluster_b {
        subgraph cluster_b0 {
            rank=same;
            b00;b01;
        }
        subgraph cluster_b1 {
            rank=same;
            b10;b11;b12;b13;
        }
        subgraph cluster_b2 {
            rank=same;
            b20;b21;b22;
        }
    }

    subgraph cluster_c {
        subgraph cluster_c0 {
            rank=same;
            c00;c01;
        }
    }

    first -> second;

    second -> a00;
    second -> b00;
    second -> c00;

    a00 -> a10 [style=invisible, arrowhead=none];
    b00 -> b10 -> b20 [style=invisible, arrowhead=none];

    {rank=same a00 b00 c00}
}

enter image description here

nachocab
  • 13,328
  • 21
  • 91
  • 149
slk
  • 86
  • 3
  • You may as well add `compound=true;` and `second -> a00 [lhead=cluster_a0];` to let the arrow point not to the node but the cluster. – slk Aug 09 '17 at 18:55