# Treemap drilldown (Treemap example)

> WestCoast Charts 1.1.5, release, public Core release, on npm. HTML: https://westcoast-charts.com/gallery/treemap/treemap-with-drilldown/ · Index for agents: https://westcoast-charts.com/llms.txt

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

- Chart type: `treemap` (Treemap)
- Collection: Treemap · Treemap
- Raw configuration: https://westcoast-charts.com/gallery-src/treemap/treemap-with-drilldown.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/treemap/treemap-with-drilldown.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
```

## Options

```js
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()
```

## Verify

- Text check (Library 1.1.5): load `west-coast-charts/agent/describe` and call `chart.describe({ format: "json" })` for the actual drawn state. The live reader is on this example’s HTML page.
- Command line (Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm, https://westcoast-charts.com/docs/cli/index.md): `wcc chart export treemap-treemap-with-drilldown.json --out treemap-treemap-with-drilldown.svg --with-table` (save the options above as JSON first)
