Treemap drilldown
Click a group to zoom in; the breadcrumb returns.
Why it matters nested treemap zooms into a group on click with animated layout and a breadcrumb; no app code
Open the chart without page chrome ↗
const options = {
chart: {
height: 460,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "treemap",
toolbar: {
show: false
}
},
series: [
{
name: "Budget k€",
data: [
{
x: "Engineering",
children: [
{
x: "Platform",
children: [
{
x: "Compute",
y: 420
},
{
x: "Storage",
y: 260
},
{
x: "Network",
y: 140
},
{
x: "Observability",
y: 90
}
]
},
{
x: "Product",
children: [
{
x: "Web app",
y: 310
},
{
x: "Mobile",
y: 220
},
{
x: "Growth",
y: 120
}
]
},
{
x: "Security",
y: 160
}
]
},
{
x: "Go-to-market",
children: [
{
x: "Sales",
children: [
{
x: "Americas",
y: 380
},
{
x: "Europe",
y: 240
},
{
x: "Asia Pacific",
y: 150
}
]
},
{
x: "Marketing",
children: [
{
x: "Paid",
y: 210
},
{
x: "Events",
y: 95
},
{
x: "Content",
y: 60
}
]
}
]
},
{
x: "Operations",
children: [
{
x: "Finance",
y: 120
},
{
x: "People",
y: 105
},
{
x: "Legal",
y: 70
},
{
x: "Facilities",
y: 85
}
]
}
]
}
],
plotOptions: {
treemap: {
tint: 0.1,
parents: {
header: {
showValue: true
}
}
}
},
title: {
text: "Budget by org (click a group)"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
const options = {
chart: {
height: 460,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "treemap",
toolbar: {
show: false
}
},
series: [
{
name: "Budget k€",
data: [
{
x: "Engineering",
children: [
{
x: "Platform",
children: [
{
x: "Compute",
y: 420
},
{
x: "Storage",
y: 260
},
{
x: "Network",
y: 140
},
{
x: "Observability",
y: 90
}
]
},
{
x: "Product",
children: [
{
x: "Web app",
y: 310
},
{
x: "Mobile",
y: 220
},
{
x: "Growth",
y: 120
}
]
},
{
x: "Security",
y: 160
}
]
},
{
x: "Go-to-market",
children: [
{
x: "Sales",
children: [
{
x: "Americas",
y: 380
},
{
x: "Europe",
y: 240
},
{
x: "Asia Pacific",
y: 150
}
]
},
{
x: "Marketing",
children: [
{
x: "Paid",
y: 210
},
{
x: "Events",
y: 95
},
{
x: "Content",
y: 60
}
]
}
]
},
{
x: "Operations",
children: [
{
x: "Finance",
y: 120
},
{
x: "People",
y: 105
},
{
x: "Legal",
y: 70
},
{
x: "Facilities",
y: 85
}
]
}
]
}
],
plotOptions: {
treemap: {
tint: 0.1,
parents: {
header: {
showValue: true
}
}
}
},
title: {
text: "Budget by org (click a group)"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export treemap-treemap-with-drilldown.json --out treemap-treemap-with-drilldown.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/treemap/treemap-with-drilldown/index.md …