Skip to content

@crossplot/react ​

React hooks and a component for crossplot dashboards. The dashboard, its charts and the filter state stay in @crossplot/core; these hooks create them with a component's lifetime and re-render when they change.

Interfaces ​

InterfaceDescription
ChartPropsProps for Chart. Other props go to the div the chart draws into.
UseChartResultWhat useChart returns.

Functions ​

FunctionDescription
ChartA chart drawn by its renderer into a div. Same lifetime rules as useChart.
useChartAdd a chart to a dashboard for the lifetime of a component and follow its data and filter.
useDashboardCreate a dashboard for the lifetime of a component. Returns null until the engine has loaded the data, and always while rendering on the server.
useFilterOne chart's filter by id, or null.
useFiltersEvery filter, by chart id: the same plain object as dashboard.filters.snapshot.filters, replaced on each change. Empty before the dashboard is ready and on the server.
useRowsRows passing every filter, fetched again after every update; null until the first page arrives. Answers that arrive out of order are dropped. query is compared as JSON.
useSummarySelected and total row counts after the latest update, or null before the dashboard is ready.

Released under the MIT License.