import type { AnyDatapoint, DatapointMetadata, XYChartAxisInternal } from '../../types/xy-chart-internals.js'; import type { AreaDatapoint, BarDatapoint } from '../../types/xy-chart.js'; export interface StackingResult { calcDatapoint: AnyDatapoint; datapointMetadata: DatapointMetadata; shouldContinue: boolean; } export declare class StackableSeriesHelper { private static readonly STARTING_POINT; private readonly stackGroups; private readonly stackDomainData; constructor(); /** * Accumulates total positive and negative values per stack key. * Should be called during the preprocess phase before processing individual datapoints. * This is needed so that binDomain can be included in metadata for relative stacking. */ processStackDomain(datapoint: BarDatapoint | AreaDatapoint, chartOrientation: 'vertical' | 'horizontal', xAxis: XYChartAxisInternal, yAxis: XYChartAxisInternal): void; /** * Returns the total bin domain for a given stack key. * The bin domain is the total height of the stack, including both positive and negative values. * Note: totalNegative is already stored as an absolute value. */ getStackBinDomain(stackKey: string): number | undefined; /** * Processes a datapoint for stacking, calculating the offset and updating stack groups. * Returns the calculated datapoint with stacking offsets applied and enriched metadata. */ processStackedDatapoint(datapoint: BarDatapoint | AreaDatapoint, chartOrientation: 'vertical' | 'horizontal', xAxis: XYChartAxisInternal, yAxis: XYChartAxisInternal, datapointMetadata: DatapointMetadata): StackingResult; }