UNPKG

@mindfiredigital/pivothead

Version:

PivotHead is a powerful and flexible library for creating interactive pivot tables in JavaScript applications. It provides a core engine for data manipulation and, in the future, will be compatible with wrappers for React, Vue, Svelte, and Angular, making

30 lines 1.5 kB
import { PivotEngine } from './pivotEngine'; import type { AggregationType, AxisConfig, DataRecord, MeasureConfig, FieldType, FieldInfo, LayoutSelection } from '../types/interfaces'; export type { FieldType, FieldInfo }; /** * FieldService: Helper utilities to drive field selection and aggregations from UI. * - Discover fields and their inferred types from engine raw data * - Build Axis and Measure configs * - Update per-measure aggregation using engine APIs */ export declare class FieldService { /** Returns all fields inferred from the engine's raw data */ static getAvailableFields<TRow extends DataRecord>(engine: PivotEngine<TRow>): FieldInfo[]; /** Supported aggregations */ static getSupportedAggregations(): AggregationType[]; /** Change aggregation for a specific measure and refresh engine */ static setMeasureAggregation<TRow extends DataRecord>(engine: PivotEngine<TRow>, field: string, aggregation: AggregationType): void; /** Build complete layout (rows, columns, measures) from selection */ static buildLayout(selection: LayoutSelection): { rows: AxisConfig[]; columns: AxisConfig[]; measures: MeasureConfig[]; }; /** Build a single MeasureConfig */ static buildMeasure(field: string, aggregation?: AggregationType): MeasureConfig; private static inferFieldType; private static looksLikeDate; private static toCaption; private static capitalize; } //# sourceMappingURL=fieldService.d.ts.map