@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
| Interface | Description |
|---|---|
| ChartProps | Props for Chart. Other props go to the div the chart draws into. |
| UseChartResult | What useChart returns. |
Functions
| Function | Description |
|---|---|
| Chart | A chart drawn by its renderer into a div. Same lifetime rules as useChart. |
| useChart | Add a chart to a dashboard for the lifetime of a component and follow its data and filter. |
| useDashboard | Create a dashboard for the lifetime of a component. Returns null until the engine has loaded the data, and always while rendering on the server. |
| useFilter | One chart's filter by id, or null. |
| 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 and on the server. |
| useRows | Rows 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. |
| useSummary | Selected and total row counts after the latest update, or null before the dashboard is ready. |