@kanunilabs/pivotgrid / PivotField
Interface: PivotField<TRow, TCellTemplate, TStyle>
Describes a single field (dimension or measure) in the pivot grid.
Type Parameters
TRow
TRow = any
Shape of source data rows.
TCellTemplate
TCellTemplate = PivotCellTemplate
Custom cell render function type.
TStyle
TStyle = any
Style object type for conditional formatting rules.
Properties
area?
optionalarea?:PivotArea
Which pivot area this field belongs to.
areaIndex?
optionalareaIndex?:number
Position index within the area.
calculateCustomSort?
optionalcalculateCustomSort?: (a,b,cellA?,cellB?) =>number
Custom sort comparator for header values.
Parameters
a
any
b
any
cellA?
PivotCell<any>
cellB?
PivotCell<any>
Returns
number
calculateCustomSummary?
optionalcalculateCustomSummary?:string| ((options) =>void)
calculateExpression?
optionalcalculateExpression?:string| ((row) =>string|number)
Row-level expression evaluated via CSP-safe engine.
calculateSummaryExpression?
optionalcalculateSummaryExpression?:string| ((cellValues) =>number)
Summary-level expression combining other data field values.
caption
caption:
string
Display label shown in headers and field chooser.
cellTemplate?
optionalcellTemplate?:TCellTemplate
Custom cell render function.
conditionalFormatting?
optionalconditionalFormatting?:PivotConditionRule<TStyle>[]
Conditional formatting rules evaluated per cell.
dataField?
optionaldataField?:string|Extract<keyofTRow,string>
Source property name in the data row.
dataType
dataType:
"string"|"number"|"boolean"|"date"
Data type used for encoding, formatting, and grouping.
filterType?
optionalfilterType?:"include"|"exclude"
Whether filterValues is an include list or exclude list.
filterValues?
optionalfilterValues?:Set<any>
Active filter values for header filter (include/exclude mode).
format?
optionalformat?:NumberFormatOptions|DateTimeFormatOptions| ((value) =>string)
Intl format options or custom formatter for cell display values.
formulaString?
optionalformulaString?:string
formulaType?
optionalformulaType?:"row"|"summary"
groupInterval?
optionalgroupInterval?:number|PivotGroupInterval
Date/numeric grouping interval.
id
id:
string
Unique identifier for this field.
isCalculated?
optionalisCalculated?:boolean
True for calculated (virtual) fields that derive from other fields.
sortBySummaryField?
optionalsortBySummaryField?:string
Data field ID to sort rows by summary value.
sortBySummaryPath?
optionalsortBySummaryPath?:string
Column path key for sort-by-summary targeting.
sortOrder?
optionalsortOrder?:"asc"|"desc"
Sort direction for this field's header values.
summaryDisplayMode?
optionalsummaryDisplayMode?:PivotSummaryDisplayMode
Post-aggregation display transformation (e.g. percent of total).
summaryType?
optionalsummaryType?:PivotSummaryType
Aggregation type — computed in the Web Worker for all types.
topN?
optionaltopN?:number
Show only top N values; requires sortBySummaryField.
topNOthersCaption?
optionaltopNOthersCaption?:string
Custom caption for the "Others" row when topN is active.
topNShowOthers?
optionaltopNShowOthers?:boolean
Whether to aggregate remaining values into an "Others" row.
visible?
optionalvisible?:boolean
Whether the field is visible in the field chooser.