Hierarchical treemap with squarified tile layout — pure SVG, zero JS.
Each tile's area is proportional to its value. Tiles animate in with staggered fade. Label is clipped to fit within each tile.
Examples
<.treemap_chart data={[
%{label: "React", value: 450},
%{label: "Vue", value: 280},
%{label: "Angular", value: 210},
%{label: "Svelte", value: 120},
%{label: "Solid", value: 80}
]} />
<.treemap_chart
data={[%{label: "A", value: 60}, %{label: "B", value: 40}]}
colors={["oklch(0.60 0.20 240)", "oklch(0.65 0.22 30)"]}
/>
Summary
Functions
Attributes
data(:list) (required) - List of%{label, value}(and optional:color).colors(:list) - Override default palette. Defaults to[].animate(:boolean) - Defaults totrue.animation_duration(:integer) - Defaults to500.id(:string) - Unique ID for the chart (auto-generated if not provided). Defaults tonil.title(:string) - Chart title rendered above the visualization. Defaults tonil.description(:string) - Chart description for context (rendered below title). Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.