Skip to content

@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 ​

InterfaceDescription
ChartParamsParameters of the chart action.
CurrentA reactive value: read .current in a template, $derived or $effect.
UseChartWhat useChart returns. Every field is reactive.

Type Aliases ​

Type AliasDescription
DashboardSourceWhere a dashboard comes from: the object useDashboard returns, a getter, or the dashboard itself. Null or undefined while it loads.
MaybeGetterA value, or a function that returns it so runes can track what it reads.
RowsOptionsOptions for useRows: a page of filtered rows.

Functions ​

FunctionDescription
chartAn 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.
useChartAdd a chart to a dashboard for as long as the calling component lives.
useDashboardCreate 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.
useFilterOne chart's filter by id, or null. Pass a getter for an id that changes.
useFiltersEvery filter, by chart id: the same plain object as dashboard.filters.snapshot.filters, replaced on each change. Empty before the dashboard is ready.
useRowsThe filtered rows, fetched again after every update and whenever the query changes.
useSummarySelected and total row counts after the latest update, or null before the dashboard is ready.

Released under the MIT License.