UNPKG

@adaptabletools/adaptable-cjs

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

19 lines (18 loc) 866 B
import { IAggFuncParams } from 'ag-grid-enterprise'; export declare const getNumericValue: (input: unknown) => number | null; /** * Computes a weighted average aggregation: Σ(value × weight) / Σ(weight) * * AG Grid calls agg functions bottom-up through the group hierarchy. For each group: * - Leaf children contribute their raw value × weight * - Sub-group children already have partial sums from a previous pass, * so we combine those directly instead of re-traversing to leaves * * The returned object stores partial sums ([columnId] and [weightColumnId]) * so parent groups can combine sub-group results correctly. */ export declare const weightedAverage: (params: IAggFuncParams, columnId: string, weightColumnId: string) => { [x: string]: number | (() => string) | (() => number); toString: () => string; toNumber: () => number; };