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

Search the Graphviz codebase for "cluster"

Last modified September 17, 2022: Update cluster.md: remove duplicate dot (f227bc5)