Assign attributes to multiple nodes at once

yes & no

this works:

node [shape=square color=green]  // and/or other attributes
a b c
node [shape=circle color=red]  // and/or other attributes
d e f

and this works:

node [shape=rectangle]  // and/or other attributes
A
{
node [shape=square color=green]  // and/or other attributes
a b c
}
{
node [shape=circle color=red]  // and/or other attributes
d e f
}
B  // rectangle applies

But once a node or edge has been defined (referenced), I am pretty sure you can’t change attribute values of that node/edge later in the input.
Neither is there a general-purpose way to define style(s) and apply them throughout the input or from one file to the next (CSS-like) (requested, but not implemented, yet)

See Color a specific node and its children nodes/edges in one color, and grey everything else out and Using node attributes in HTML style label - #2 by steveroush
and Styles for GraphViz (#1566) · Issues · graphviz / graphviz · GitLab and How can I create named edge "types" in Graphviz/dot/neato? - Stack Overflow

1 Like