<!-- Save as .github/copilot-instructions.md, or append to it. -->

## WestCoast Charts

WestCoast Charts (1.1.5, release, public Core release, on npm) is an ApexCharts-4.x-compatible charting library. Docs for agents: https://westcoast-charts.com/llms.txt

- Install the current MIT Core with `npm install west-coast-charts@1.1.5`. Alternative versioned archives and checksums: https://westcoast-charts.com/download/index.md. Import the default export: `import WestCoastCharts from 'west-coast-charts'`. Do not import from `apexcharts`.
- Create charts with `const chart = new WestCoastCharts(element, options)` and `await chart.render()`; call `chart.destroy()` when the element is removed (React effect cleanup, Vue `onBeforeUnmount`, Svelte `onDestroy`, Angular `ngOnDestroy`).
- Options use the ApexCharts 4.x format. Before using an option you are not sure about, look it up in https://westcoast-charts.com/docs/reference/options/index.md (premium types: https://westcoast-charts.com/docs/reference/premium-options/index.md). Never guess option names.
- Extra MIT chart types (gauge, funnel, waterfall, sunburst, ...): `import types from 'west-coast-charts/types'` and `WestCoastCharts.use(types)`, or import one type, e.g. `'west-coast-charts/types/gauge'`.
- Premium types (sankey, chord, gantt, tree, stock, map, marimekko, network, radialColumn, quintTimeline, quintConvergence, vitalsClock, schedule): `import premium from 'west-coast-charts/premium'`, `WestCoastCharts.use(premium)`, and `WestCoastCharts.setLicenseKey(key)` read from configuration, never hard-coded. Localhost evaluation needs no key. The Free Core and MIT-marked source remain under their stated MIT licence; Premium distribution, updates and support have separate business terms. See https://westcoast-charts.com/maintenance/#licensing and https://westcoast-charts.com/terms/.
- Quint types (`quintTimeline`, `quintConvergence`) also use the separate module: `import quint from 'west-coast-charts/layers/quint'` and `WestCoastCharts.use(quint)`. It is not part of the Premium bundle. Read https://westcoast-charts.com/docs/quint/index.md for lanes, units and the labelled time-axis lens.
- If `render()` rejects naming a missing import, add that import; do not switch to another chart type.
- Medical/practice types require explicit modules in addition to Premium: `west-coast-charts/layers/vitals` for `vitalsClock`, and `west-coast-charts/layers/schedule` for `schedule`. They are not autoloaded. Bands, alarms and scores come from the caller; the library supplies no clinical thresholds or clinical score/alarm logic. Schedule changes are proposals; the caller decides and updates the model. Read https://westcoast-charts.com/docs/medical/index.md.
- Orient is optional MIT: import and register `west-coast-charts/features/orient` with the core runtime before creating the chart. /full already includes it. Supported types and limits: https://westcoast-charts.com/docs/features/orient/index.md. It is not a Premium family; check the current headless module matrix before using it through CLI or MCP.
- Update data with `chart.updateSeries(series)` or `chart.updateOptions(options)` instead of re-creating the chart.
- For machine-readable validation, load `west-coast-charts/agent/validate`, use `WestCoastCharts.validate(options)`, inspect `issues`, apply suggested fixes with `WestCoastCharts.applyFixes(options, issues)` and validate again.
- Load `west-coast-charts/agent/describe` and call `chart.describe({format: "json"})` after rendering for values, aggregates, scales, filters and table from the actual drawn state. Do not sum non-additive measures.
- Inspect `schemaVersion` and the options schema https://westcoast-charts.com/wcc/schema/wcc-options.schema.json. Result schema: https://westcoast-charts.com/wcc/schema/wcc-describe.schema.json. Respect missing/null fields and table truncation; never infer unavailable aggregates from a stub result.
- With MCP, discover available types/examples and narrow schema paths before validating, rendering and describing. Require `validator: "e1"` and `tableSource: "describe"` for the current tools; absent providers must fail explicitly rather than silently substituting stubs. Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Verify the resolved runtime and current module support before using Quint, Orient, vitalsClock or schedule. Tool errors use `isError` and a JSON envelope in the second text content block. See https://westcoast-charts.com/agents/index.md.
- Headless Premium rendering requires a configured key or explicit evaluation mode; browser localhost behaviour does not remove this requirement. Keep licence keys out of shared specs. The seven MCP tools do not write files; CLI export and skills-install commands do.
- For a working starting point, copy a gallery example: https://westcoast-charts.com/gallery/index.md (every entry has its full options).
