W3cubDocs

/Graphviz

class

Classnames to attach to the node, edge, graph, or cluster's SVG element

type: string, default: ""

Combine with stylesheet for styling SVG output using CSS classnames.

Multiple space-separated classes are supported.

See also:

Example:

digraph G {
  graph [class="cats"];

  subgraph cluster_big {
    graph [class="big_cats"];

    "Lion" [class="yellow social"];
    "Snow Leopard" [class="white solitary"];
  }
}
Valid on:
  • Edges
  • Nodes
  • Clusters
  • Graphs

Note: svg only.

© 2025 The Graphviz Authors
Licensed under the Eclipse Public License 1.0.
https://www.graphviz.org/docs/attrs/class/