Change subgraph cluster shape to rounded rectangle
Asked Answered
U

2

13

I have the following graph:

digraph G {rankdir="LR"; 
node [fontname = "font-awesome"];
subgraph cluster17 {
    2 [id=2, shape=rect;color="#A4A4A4";fillcolor="white";label=<<TABLE BORDER="0">
    <TR><TD>1:10</TD></TR>
    </TABLE>>, style="filled",fontsize=6,fixedsize=true,width=0.5,height=0.2,shape=Mrecord];

    2 -> 4 [id="2t4",color="#717070",arrowsize=.5];

    subgraph cluster3 {
        4 [id=4,fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
        <TR><TD>1:12</TD></TR>
        </TABLE>>, style="filled",shape=Mrecord];
        5 [id=5,fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
        <TR><TD>1:13</TD></TR>
        </TABLE>>, style="filled",shape=Mrecord];
        6 [id=6,fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
        <TR><TD>1:14</TD></TR>
        </TABLE>>, style="filled",shape=Mrecord];
        7 [id=7,fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
        <TR><TD>1:15</TD></TR>
        </TABLE>>, style="filled",shape=Mrecord];
        8 [id=8,fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
        <TR><TD>1:19</TD></TR>
        </TABLE>>, style="filled",shape=Mrecord];

        6 -> 7 [id="6t7",color="#717070",arrowsize=.5]; 
        4 -> 5 [id="4t5",color="#717070",arrowsize=.5];
        8 -> 4[id="8t4",color="#717070",arrowsize=.5];
        5 -> 6 [id="5t6",color="#717070",arrowsize=.5];
        7 -> 8 [id="7t8",color="#717070",arrowsize=.5];

        label=<<TABLE BORDER="0">
        <TR><TD>Loop</TD></TR>
        <TR><TD>1:11</TD></TR>
        </TABLE>>;
        style="filled"
        fillcolor="#EDF1F2"
        color="#028d35"

        id=3
    }

    4 -> 10 [id="4t10",color="#717070",arrowsize=.5];
    10 [id=10, shape=rect;color="#A4A4A4";fillcolor="white";label=<<TABLE BORDER="0">
    <TR><TD>1:20</TD></TR>
    </TABLE>>,fontsize=6,fixedsize=true,width=0.5,height=0.2,shape=Mrecord, style="filled"];

    label=<<TABLE BORDER="0">
    <TR><TD>1:9</TD></TR>
    </TABLE>>;
    style="filled"
    fillcolor="#EDF1F2"
    color="#A4A4A4"
    id=17
}
}

which gives the following graph: enter image description here I wanted to change the graph of the cluster3 to a rectangle with rounded corner. I tried to insert shape=Mrecord, but it doesn't work. How can I change the shape of the cluster to a rectangle with rounded corner?

Unpin answered 6/3, 2018 at 20:0 Comment(0)
L
18

Instead of

style="filled"

you may use

    style="rounded"
    bgcolor="#028d35"

The style rounded does not use fillcolor, but bgcolor instead.

Lager answered 7/3, 2018 at 7:13 Comment(1)
The only way it worked for me was using style="rounded,filled", since according to the docs: "prior to 26 April 2005, the rounded and filled styles were mutually exclusive." (which implies that they're not anymore)Finale
S
4

These are the valid styles for cluster:

Squinch answered 14/6, 2021 at 16:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.