ColumnFacetingFeature
Defined in: datagrid/core/features/column-faceting.svelte.ts:30
Class that implements the column faceting feature, responsible for calculating and managing numeric and categorical facets for each column in the datagrid.
Type Parameters
• TOriginalRow = any
Implements
Constructors
new ColumnFacetingFeature()
new ColumnFacetingFeature<
TOriginalRow>(datagrid,config?):ColumnFacetingFeature<TOriginalRow>
Defined in: datagrid/core/features/column-faceting.svelte.ts:52
Constructor for initializing the ColumnFacetingFeature with a reference to the datagrid and optional configuration.
Parameters
datagrid
DatagridCore<TOriginalRow>
The parent datagrid instance.
config?
Partial
Optional configuration to override the default facet feature state.
Returns
ColumnFacetingFeature<TOriginalRow>
Properties
Methods
calculateFacets()
calculateFacets(
rows,columns):void
Defined in: datagrid/core/features/column-faceting.svelte.ts:102
Calculates numeric and categorical facets for the provided rows and columns.
This method iterates over the rows and columns to compute the facets and updates the
_numericFacets and _categoricalFacets state properties accordingly.
Parameters
rows
TOriginalRow[]
The array of rows to calculate facets for.
columns
ColumnDef<TOriginalRow>[]
The array of columns for which facets need to be calculated.
Returns
void
getAllCategoricalFacets()
getAllCategoricalFacets():
object
Defined in: datagrid/core/features/column-faceting.svelte.ts:89
Retrieves all categorical facets for all columns.
Returns
object
A shallow copy of the categorical facets object.
getAllNumericFacets()
getAllNumericFacets():
object
Defined in: datagrid/core/features/column-faceting.svelte.ts:81
Retrieves all numeric facets for all columns.
Returns
object
A shallow copy of the numeric facets object.
getCategoricalFacet()
getCategoricalFacet(
columnId):object
Defined in: datagrid/core/features/column-faceting.svelte.ts:73
Retrieves the categorical facet (unique values and their count) for a specific column.
Parameters
columnId
string
The ID of the column.
Returns
object
The categorical facet for the column or null if no facet is available.
| Name | Type | Defined in | 
|---|---|---|
| uniqueValues | unknown[] | datagrid/core/features/column-faceting.svelte.ts:38 | 
| uniqueValuesCount | number | datagrid/core/features/column-faceting.svelte.ts:38 | 
getNumericFacet()
getNumericFacet(
columnId):object
Defined in: datagrid/core/features/column-faceting.svelte.ts:64
Retrieves the numeric facet (min and max values) for a specific column.
Parameters
columnId
string
The ID of the column.
Returns
object
The numeric facet for the column or null if no facet is available.
| Name | Type | Defined in | 
|---|---|---|
| max | number | datagrid/core/features/column-faceting.svelte.ts:35 | 
| min | number | datagrid/core/features/column-faceting.svelte.ts:35 |