Dendrogram
Signature
sp.dendrogram(title, labels, *, matrix=None, parents=None, clusters=3, variant="vertical", **kwargs) -> Chart
Aliases: sp.dendrogram, sp.dendro, sp.tree, sp.tree_diagram, sp.hierarchy, sp.hierarchical
Description
Dendrograms display hierarchical tree structures using right-angle elbow connectors (vertical/horizontal) or smooth bezier curves (elegant) or a radial circular layout. Pass matrix -- one row of numeric coordinates per label -- for a genuine average-linkage agglomerative clustering with real merge heights (matching hclust/scipy), including automatic coloring of the top clusters groups with the trunk above the cut shown in neutral gray. Without matrix, parents describes a plain hand-specified hierarchy (each entry names its parent's label, empty string for a root) with no real distance semantics.
Variants
Data
labels (list[str]) — Node names. parents (list[str]) — Parent name per node ("" = root). width / height (int) — Chart dimensions.
Parameters
Themes
Returns
Chart — object with .html property and .show() method.
Root at top, leaves at bottom (elbow connectors)
Root at left, leaves at right
Circular radial tree layout
Tighter spacing, smaller font
Smooth cubic bezier curves
Connects parent to child with a single straight diagonal line — a third connector style alongside the right-angle elbows (vertical/horizontal) and smooth beziers (elegant).