API reference
@salmonui/pivot-table
94 exported symbols: 4 components, 12 functions, 1 class, 58 interfaces, 18 types and 1 constant. Each name links its page with the signature, docs and members. Names re-exported from another entry point are listed there, linked below.
import { … } from '@salmonui/pivot-table';Components
PivotAxisBarThe axis bar. Bind it to the same store as the table: <PivotAxisBar pivot={pivot} />.PivotFieldListThe field list. Bind it to the same store as the table: <PivotFieldList pivot={pivot} />.PivotTableThe pivot table.PivotToolbarThe toolbar.
Functions
drillChartPointChart point click → pivot: 'auto' expands the category member when it can expand, else opens drill through for the point's cell; 'collapse' collapses the categ…pivotChartImageA chart image for exportPivot({ format: 'pdf', chart }) or api.exportToPdf({ chart }) (table and chart in one PDF): the chart's PNG (or JPEG) with its drawing…pivotChartPropsChart props of the controller's current result: <Chart {...pivotChartProps(pivot, { type: 'column' })} />. Not memoized; in components use usePivotChartProps().pivotChartPropsOfChartProps of pivot chart data: data, series, axes and an onPointClick that drills the pivot.pivotChartSeriesOptionsThe Chart series options a pivot chart type draws with (type, plus curve / stack / closed).pivotToSeriesConverts a pivot result into Chart data and series for one measure.usePivotCreates the pivot store shared by PivotTable, PivotFieldList, PivotAxisBar, PivotToolbar and the chart adapters. The component that calls it re-renders when th…usePivotChartDatapivotToSeries() of the controller's current result, recomputed when the result changes.usePivotChartPropspivotChartProps() of the store's current result, recomputed only when the result or an option changes.usePivotStateSubscribes to one field of the pivot store. selector must return a value that keeps its identity.
Classes
PivotControllerThe store of one pivot report. Create it with usePivot(); pass it to the pivot parts as pivot.
Interfaces
PivotAggregateMenuOpenEventonBeforeAggregateMenuOpen.PivotAxisBarOptionsPivotAxisBarPropsPivotCalculatedFieldChangeEventonBeforeCalculatedFieldChange / onCalculatedFieldChange.PivotCellClickEventonCellClick.PivotCellContextContext of renderCell / getCellClassName.PivotCellKeyA selected cell (rowKey|columnKey).PivotChartDataPivotChartPointWhere a chart point comes from (drill down, drill through).PivotChartPropsThe Chart props of a pivot (spread them on <Chart> from @salmonui/charts/chart).PivotChartPropsOptionsPivotChartSeriesOne Chart series (ChartSeriesOptions) of a pivot measure.PivotCommandOptionsOptions of a model command.PivotComputeEventonComputeStart / onComputeEnd.PivotDataChangeEventonDataChange: drill-through edits wrote these rows.PivotDisplayPropsDisplay props forwarded to the Data Grid renderer by whitelist.PivotDrillThroughEventonBeforeDrillThrough / onDrillThrough.PivotErrorEventonError.PivotEventHandlersEvent handlers shared by usePivot() and PivotTable (the controller reads the latest ones).PivotExpandedChangeEventonBeforeExpandedChange / onExpandedChange.PivotExportEventonBeforeExport / onExport.PivotExportFileA written export file (api.exportToExcel() and friends resolve with it; null when cancelled).PivotExportOptionsOptions of api.exportToExcel() / exportToCsv() / exportToPdf(), passed through to exportPivot() (file name, row layout, styles, cell hook, ...).PivotExportWritersLoader of the pivot writers: a dynamic import of the pivot subpath of thePivotFieldListPropsPivotFieldMoveEventonBeforeFieldMove / onFieldMove.PivotFilterChangeEventonBeforeFilterChange / onFilterChange.PivotHeaderContextContext of renderHeader: row and column headers.PivotLoadingContextContext of renderLoading.PivotMemberEditorOpenEventonBeforeMemberEditorOpen.PivotModelChangeEventonBeforePivotModelChange / onPivotModelChange.PivotPersistStatePersistence.PivotSelectionChangeEventonBeforeSelectionChange / onSelectionChange.PivotSortChangeEventonBeforeSortChange / onSortChange (member sort and value sort).PivotStateSnapshot of the controller store; every field keeps its identity until it changes.PivotTableApiInstance API of PivotTable (ref).PivotTablePropsPivotTableStateSerializable state (api.getState()).PivotToSeriesOptionsPivotToolbarItemPivotToolbarPropsPivotTooltipContextContext of renderTooltip.PivotWorkerLikeA Worker (or a MessagePort-like object) running @salmonui/pivot-table/engine/worker.PivotWriterModuleThe loaded pivot writer module (the pivot subpath of theUsePivotOptionsOptions of usePivot() (and the matching PivotTable props).
Types
PivotActionWhat a model change does.PivotAxisThe four report axes plus null (not on the report).PivotChartDrillModeWhat a chart point click does: drill down when possible, else drill through ('auto'); one of them only; or drill up ('collapse').PivotChartSeriesShapeThe Chart series options of one pivot chart type.PivotChartSeriesTypePivot chart types. Each maps to Chart series options (pivotChartSeriesOptions()): spline is a line with curve: 'natural', stepLine a line with curve: 'step', t…PivotDialogStatePivotEventBase of every pivot event (the Data Grid event model: before-events cancel with preventDefault()).PivotEventSourcePivotLocaleTextPivotLocaleTextKeyPivotTableLayoutPivotToolbarItemId
Constants
Re-exported entry points
@salmonui/pivot-table/engine21 symbols: 2 functions, 13 interfaces and 6 types