# Rocket payloads (Unit example)

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

Payload mass by customer inside a rocket.

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

## Setup

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

WestCoastCharts.use(types)
```

## Options

```js
const options = {
  chart: {
    height: 460,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "unit",
    toolbar: {
      show: false
    }
  },
  series: [60, 40, 24, 12],
  labels: ["Telecom", "Earth obs.", "Science", "Rideshare"],
  plotOptions: {
    unit: {
      positions: {
        name: "rocket",
        category: "transport",
        kind: "silhouette",
        rings: [
          [
            [0.5, 0],
            [0.68, 0.2],
            [0.7, 0.62],
            [0.92, 0.82],
            [0.92, 1],
            [0.66, 0.88],
            [0.34, 0.88],
            [0.08, 1],
            [0.08, 0.82],
            [0.3, 0.62],
            [0.32, 0.2]
          ]
        ],
        source: "original",
        minUnits: 30,
        aspect: 0.6,
        order: "rowsUp",
        cx: undefined,
        cy: undefined,
        shape: {
          name: "rocket",
          category: "transport",
          kind: "silhouette",
          minUnits: 30,
          order: "rowsUp",
          source: "original"
        },
        with: e=>St({...t,...e||{}}),
        outlined: function outlined(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.16;const n=t.rings.map(t=>{const n=t.reduce((t,e)=>t+e[0],0)/t.length,a=t.reduce((t,e)=>t+e[1],0)/t.length;return t.map(t=>{let o=b(t,2);return[n+(o[0]-n)*(1-e),a+(o[1]-a)*(1-e)]})});return St({...t,name:t.name+"-outlined",kind:"stroke",rings:t.rings.concat(n)})},
        fill: (t,n)=>wt(e,t,n),
        isUnitShape: true
      }
    }
  },
  title: {
    text: "Payload mass (1 dot = 100 kg)"
  },
  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-rocket-payloads.json --out unit-rocket-payloads.svg --with-table` (save the options above as JSON first)
