# Marathon storyboard (Unit example)

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

Play a race story (start, halfway, finish); the marks regroup per frame, with transport, scrubber and captions.

- Chart type: `unit` (Unit)
- Collection: Unit · Unit & pictogram
- Raw configuration: https://westcoast-charts.com/gallery-src/unit/marathon-storyboard.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/unit/marathon-storyboard.html

## Setup

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

WestCoastCharts.use(types).use(narrative)
```

## Options

```js
const options = {
  chart: {
    height: 440,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "unit",
    toolbar: {
      show: false
    }
  },
  series: [400],
  labels: ["Running"],
  plotOptions: {
    unit: {
      transition: "flow",
      clusterLabels: {
        show: true
      }
    }
  },
  title: {
    text: "Marathon: Start"
  },
  wcc: {
    narrative: {
      enabled: true,
      frames: [
        {
          t: "Start",
          label: "Start",
          caption: "400 runners cross the start line.",
          series: [400],
          options: {
            labels: ["Running"],
            title: {
              text: "Marathon: Start"
            }
          }
        },
        {
          t: "Halfway",
          label: "Halfway",
          caption: "The field splits into a lead pack, the main field and walkers.",
          series: [120, 230, 50],
          options: {
            labels: ["Lead pack", "Main field", "Walking"],
            title: {
              text: "Marathon: Halfway"
            }
          }
        },
        {
          t: "Finish",
          label: "Finish",
          caption: "310 finish in time, 60 after the cut-off, 30 do not finish.",
          series: [310, 60, 30],
          options: {
            labels: ["Finished", "Cut-off", "DNF"],
            title: {
              text: "Marathon: Finish"
            }
          }
        }
      ],
      frameDuration: 1600,
      interpolate: false
    }
  },
  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 unit-marathon-storyboard.json --out unit-marathon-storyboard.svg --with-table` (save the options above as JSON first)
