How to create rounded and filled record nodes?

In the following simple graph

digraph rounded_record {
    rankdir=LR
    node [shape=record
          style=filled
          style=rounded
          ]
    A [label = <Oben | Unten>]
    B [label = <Arriba | Debajo>]
    A -> B
}

I get only the rounded shape:

rounded-records_rounded

Or if I remove the style=rounded I get only the filled shape:

rounded-records_filled

I guess the style attribute can hold only one term…

But can I create rounded and filled record nodes?

Graphviz is a little different in how it sets attribute values, it uses a “last-one-in” scheme instead of “use-them-all”. But not worries, just combine the values in a comma or whitespace string style="filled,rounded". Documentation here Node Shapes | Graphviz

digraph rounded_record {
    rankdir=LR
    node [shape=record
          style="filled,rounded" fillcolor=lightblue
          ]
    A [label = <Oben | Unten>]
    B [label = <Arriba | Debajo>]
    A -> B
}

Giving:
filledAndRounded1

2 Likes

Thanks so much @steveroush ! I didn’t think of this very logical way to provide two values to an attribute. You made my day. :smile:

1 Like