Skip to main content

React API

Component API Reference

Props

The PivotHead component accepts the following props:

PropTypeDefaultDescription
mode'default' | 'minimal' | 'none''default'Rendering mode
dataPivotDataRecord[]-Dataset to analyze
optionsPivotOptions-Pivot configuration
filtersFilterConfig[]-Active filters
paginationPartial<PaginationConfig>-Pagination settings
classNamestring-CSS class name
styleReact.CSSProperties-Inline styles
headerSlotReact.ReactNode-Header content for minimal mode
bodySlotReact.ReactNode-Body content for minimal mode

Events

EventTypeDescription
onStateChange(e: CustomEvent<PivotTableState>) => voidFired when pivot state changes
onViewModeChange(e: CustomEvent<{mode: 'raw' | 'processed'}>) => voidFired when view mode changes
onPaginationChange(e: CustomEvent<PaginationConfig>) => voidFired when pagination changes

Available Methods

MethodParametersReturnsDescription
getState()-PivotTableStateGet current state
refresh()-voidRefresh the pivot
sort(field, direction)field: string, direction: 'asc' | 'desc'voidSort by field
setMeasures(measures)measures: MeasureConfig[]voidUpdate measures
setDimensions(dimensions)dimensions: Dimension[]voidUpdate dimensions
getFilters()-FilterConfig[]Get current filters
getPagination()-PaginationConfigGet pagination state
getData()-PivotDataRecord[]Get raw data
getProcessedData()-unknownGet processed data
setPageSize(size)size: numbervoidSet page size
goToPage(page)page: numbervoidNavigate to page
nextPage()-voidGo to next page
previousPage()-voidGo to previous page
setViewMode(mode)mode: 'raw' | 'processed'voidSwitch view mode
getViewMode()-'raw' | 'processed'Get current view mode
exportToHTML(filename?)filename?: stringvoidExport as HTML
exportToPDF(filename?)filename?: stringvoidExport as PDF
exportToExcel(filename?)filename?: stringvoidExport as Excel
openPrintDialog()-voidOpen print dialog
formatValue(value, field)value: unknown, field: stringstringFormat a value
updateFieldFormatting(field, format)field: string, format: FormatOptionsvoidUpdate field formatting
showFormatPopup()-voidShow format dialog