W3cubDocs

/Graphviz

cluster

Whether the subgraph is a cluster

type: bool, default: false

Subgraph clusters are rendered differently, e.g. dot renders a box around subgraph clusters, but doesn't draw a box around non-subgraph clusters.

Example:

digraph cats {
  subgraph cluster_big_cats {
    // This subgraph is a cluster, because the name begins with "cluster"
    
    "Lion";
    "Snow Leopard";
  }

  subgraph domestic_cats {
    // This subgraph is also a cluster, because cluster=true.
    cluster=true;

    "Siamese";
    "Persian";
  }

  subgraph not_a_cluster {
    // This subgraph is not a cluster, because it doesn't start with "cluster",
    // nor sets cluster=true.
    
    "Wildcat";
  }
}
Valid on:
  • Clusters
  • Subgraphs

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