UNPKG

ag-charts-enterprise

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

35 lines (34 loc) 1.95 kB
import { _ModuleSupport } from 'ag-charts-community'; type TransactionCollectionState<T> = _ModuleSupport.TransactionCollectionState<T>; declare const DataSet: typeof _ModuleSupport.DataSet; /** * DataSet subclass that understands hierarchical/nested data (e.g. treemap with `childrenKey`). * Extends ID-based transaction logic to find, update, and remove items nested within children arrays. */ export declare class HierarchyDataSet<T = unknown> extends DataSet<T> { private readonly childrenKey; constructor(data: T[], dataIdKey: string | undefined, childrenKey: string); /** * After the base commit, remove any root-level items whose IDs already exist * nested in the tree. This handles the case where the user manually adds an item * to a parent's children array and also calls applyTransaction({ add: [item] }), * which would otherwise duplicate the item at root level. */ commitPendingTransactions(): boolean; private removeNestedDuplicatesFromRoot; private collectNestedIds; /** Recursively indexes all items (root and nested) by ID, mapping each to the root ancestor's index. */ protected getIdToIndexMap(): Map<string | number, number>; private indexItemRecursively; /** Handles updates for both root-level and nested items. */ protected collectUpdatedOriginalIndicesById(toUpdate: Map<string | number, T>, state: TransactionCollectionState<T>): void; /** Handles removals for both root-level and nested items. */ protected applyRemovalsById(remove: T[], state: TransactionCollectionState<T>): void; /** Walks the tree to find and replace a nested item by ID. Returns true if found. */ private replaceNestedItem; /** Walks the tree to find and splice a nested item by ID. Returns true if found. */ private removeNestedItem; /** Removes items from groups by matching their ID values. */ private removeFromGroupsByIdForHierarchy; } export {};