@crossplot/svelte
Svelte 5 bindings for crossplot: runes that create a dashboard, add linked charts and follow the selection, plus a chart action that draws one chart in an element.
Interfaces
| Interface | Description |
|---|---|
| ChartParams | Parameters of the chart action. |
| Current | A reactive value: read .current in a template, $derived or $effect. |
| UseChart | What useChart returns. Every field is reactive. |
Type Aliases
| Type Alias | Description |
|---|---|
| DashboardSource | Where a dashboard comes from: the object useDashboard returns, a getter, or the dashboard itself. Null or undefined while it loads. |
| MaybeGetter | A value, or a function that returns it so runes can track what it reads. |
| RowsOptions | Options for useRows: a page of filtered rows. |
Functions
| Function | Description |
|---|---|
| chart | An action that adds a chart and draws it in the element with the spec's renderer or the dashboard's. The chart lives as long as the element. A new dashboard or a change to the spec's id, dimension, value or extra recreates it; a new view or renderer only redraws it. |
| useChart | Add a chart to a dashboard for as long as the calling component lives. |
| useDashboard | Create a dashboard and destroy it when the calling component is destroyed. current is null until the engine has loaded the data, and always during server rendering. |
| useFilter | One chart's filter by id, or null. Pass a getter for an id that changes. |
| useFilters | Every filter, by chart id: the same plain object as dashboard.filters.snapshot.filters, replaced on each change. Empty before the dashboard is ready. |
| useRows | The filtered rows, fetched again after every update and whenever the query changes. |
| useSummary | Selected and total row counts after the latest update, or null before the dashboard is ready. |