# Playback (Sankey example)

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

Quarterly frames with play / pause and a scrubber built in.

- Chart type: `sankey` (Sankey)
- Collection: Sankey · Sankey
- Raw configuration: https://westcoast-charts.com/gallery-src/sankey/playback.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/premium/sankey/playback.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import premium from 'west-coast-charts/premium'

WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
```

## Options

```js
const options = {
  chart: {
    height: 420,
    toolbar: {
      show: false
    },
    type: "sankey"
  },
  series: [
    {
      data: [
        ["Organic", "Sign-ups", 380],
        ["Paid", "Sign-ups", 290],
        ["Partners", "Sign-ups", 110],
        ["Sign-ups", "Activated", 500],
        ["Sign-ups", "Dormant", 280],
        ["Activated", "Paying", 210],
        ["Activated", "Free", 290]
      ]
    }
  ],
  plotOptions: {
    sankey: {
      playback: {
        frames: [
          {
            label: "Q1",
            data: [
              ["Organic", "Sign-ups", 380],
              ["Paid", "Sign-ups", 290],
              ["Partners", "Sign-ups", 110],
              ["Sign-ups", "Activated", 500],
              ["Sign-ups", "Dormant", 280],
              ["Activated", "Paying", 210],
              ["Activated", "Free", 290]
            ]
          },
          {
            label: "Q2",
            data: [
              ["Organic", "Sign-ups", 490],
              ["Paid", "Sign-ups", 440],
              ["Partners", "Sign-ups", 165],
              ["Sign-ups", "Activated", 640],
              ["Sign-ups", "Dormant", 395],
              ["Activated", "Paying", 285],
              ["Activated", "Free", 355]
            ]
          },
          {
            label: "Q3",
            data: [
              ["Organic", "Sign-ups", 600],
              ["Paid", "Sign-ups", 290],
              ["Partners", "Sign-ups", 220],
              ["Sign-ups", "Activated", 780],
              ["Sign-ups", "Dormant", 330],
              ["Activated", "Paying", 360],
              ["Activated", "Free", 420]
            ]
          },
          {
            label: "Q4",
            data: [
              ["Organic", "Sign-ups", 710],
              ["Paid", "Sign-ups", 440],
              ["Partners", "Sign-ups", 275],
              ["Sign-ups", "Activated", 920],
              ["Sign-ups", "Dormant", 445],
              ["Activated", "Paying", 435],
              ["Activated", "Free", 485]
            ]
          }
        ],
        autoplay: true
      }
    }
  },
  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 sankey-playback.json --out sankey-playback.svg --with-table` (save the options above as JSON first)
