# Treemap highlight (Highlight & filter example)

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

Each store tile shows its online part inside the faded whole; switch the measure with the buttons.

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

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import highlightFilter from 'west-coast-charts/features/highlight-filter'

WestCoastCharts.use(types).use(highlightFilter)
```

## Options

```js
const options = {
  chart: {
    height: 380,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "treemap",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Sales",
      data: [
        {
          x: "North 1",
          y: 63,
          highlight: 22
        },
        {
          x: "North 2",
          y: 49,
          highlight: 32
        },
        {
          x: "North 3",
          y: 32,
          highlight: 25
        },
        {
          x: "South 1",
          y: 64,
          highlight: 33
        },
        {
          x: "South 2",
          y: 31,
          highlight: 8
        },
        {
          x: "South 3",
          y: 68,
          highlight: 38
        },
        {
          x: "East 1",
          y: 28,
          highlight: 19
        },
        {
          x: "East 2",
          y: 56,
          highlight: 32
        },
        {
          x: "East 3",
          y: 55,
          highlight: 18
        },
        {
          x: "West 1",
          y: 40,
          highlight: 21
        },
        {
          x: "West 2",
          y: 61,
          highlight: 42
        },
        {
          x: "West 3",
          y: 50,
          highlight: 23
        },
        {
          x: "Central 1",
          y: 35,
          highlight: 24
        },
        {
          x: "Central 2",
          y: 58,
          highlight: 13
        },
        {
          x: "Central 3",
          y: 90,
          highlight: 62
        }
      ]
    }
  ],
  plotOptions: {
    treemap: {
      distributed: true,
      enableShades: false
    }
  },
  legend: {
    show: false
  },
  title: {
    text: "Store sales, of which online"
  },
  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 highlight-filter-treemap-highlight.json --out highlight-filter-treemap-highlight.svg --with-table` (save the options above as JSON first)
