Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Icicle — Hierarchical Banded Chart

Signature

sp.icicle(title, labels, parents, values, *, variant="basic", palette=None, **kwargs) -> Chart

Aliases: sp.icicle, sp.icicles, sp.icicle_chart, sp.icicle_family, sp.build_icicle

Description

sp.icicle() renders a hierarchy as stacked bands: each depth level of the tree is one horizontal row, and the width of each node inside its row is proportional to its value. It is a rectangular alternative to sunburst() and shares the exact same input schema (labels / parents / values), so any dataset already used with sunburst() or treemap() works unchanged.

Hierarchy encodinglabels lists every node, parents gives the parent label of each node ("" for a root). Leaf values come from values; internal-node values at 0 are auto-rolled-up from descendants.

Variants

Data

labels (list[str]) — Node labels (one per row). parents (list[str]) — Parent label of each node ("" for roots). values (list[float]) — Leaf values; internal zeros are auto-rolled-up.

Parameters

Themes

Returns

Chart — object with .html property and .show() method.

Root row at the top, depth-based opacity, white separators between bands.

Variant "basic"Aliases basic / default / classic / layers
Preview

Rounded corners with a small gap between every node, both across and between rows.

Variant "gapped"Aliases gapped / spaced / isolated / padded
Preview

Root column on the left, depth grows rightward instead of downward.

Variant "horizontal"Aliases horizontal / h / sideways / left_to_right
Preview

The same hierarchy in polar coordinates instead of cartesian — depth becomes ring radius, horizontal span becomes angular span. The classic icicle/sunburst duality: identical data, identical layout math (`xspan`, `depth`), different coordinate system.

Variant "radial"Aliases radial / sunburst / polar / mandala
Preview

Colors every node by its value rank among its same-depth peers (indigo → red, lowest to highest) instead of by raw share of the grand total — makes cross-branch comparisons at a given level obvious even when one branch is much bigger than another.

Variant "rank"Aliases rank / percentile / peer_rank / standing
Preview