import type { XYChartSelectionRectangleMetadata } from '../../hooks/useSortRectangleDatapoints.js'; import type { XYChartAxisInternal, XYChartVariantsInternal } from '../../types/xy-chart-internals.js'; import type { XYChartSelectionLinearMetadata } from '../../types/xy-chart-selection.js'; import type { XYChartData } from '../../types/xy-chart.js'; import type { ControlFlowCommand, MutableProcessingContext, SeriesConstructor } from '../types/processing-types.js'; import { SeriesBaseStrategy } from './base-series.js'; /** * Abstract base for series strategies that can opt into a fast processing * path on a per-slot basis. Mirrors `SeriesBaseStrategy` (which provides * the slow / generic `preprocess` + `process` orchestration) and layers a * routing step on top: at preprocess time the strategy decides per slot * whether the fast path applies, caches that decision, and dispatches every * subsequent per-datum `process` call accordingly. * * The default hooks (`isEligibleForFastPath`, `preprocessFastPath`, * `processFastPath`) are no-ops, so extending this class without overriding * them yields exactly the same behavior as extending `SeriesBaseStrategy` * directly — the only added cost is one `Map.get` per datum. * * Concrete fast paths live in the subclass. This keeps the scratch storage * for each variant (numeric/numeric bars, time/numeric timeseries, * categorical/numeric bars, …) co-located with the implementation that * owns it, while sharing the routing scaffolding here. * * The concrete bar fast paths cover vertical, label-free slots on a linear * value axis: numerical/histogram bars (linear or time x, single or stacked) * and categorical bars (single or grouped). Categorical stacking and the * remaining series types (line/area/dot) were intentionally left for follow-up * work so each technique can be evaluated and rolled back independently. */ export declare abstract class FastSeriesBaseStrategy extends SeriesBaseStrategy { /** * Per-slot eligibility cache. Populated by `preprocess` via * `isEligibleForFastPath`; consumed by `process`. Keyed on * `seriesProps.id` (the slot identifier). Strategy instances are * reconstructed per render, so this never leaks across renders. */ private readonly fastEligibleBySlot; constructor(initializer: SeriesConstructor); preprocess(data: XYChartData[], seriesProps: XYChartVariantsInternal, xAxis: XYChartAxisInternal, yAxis: XYChartAxisInternal, context: MutableProcessingContext): ControlFlowCommand; process(datum: XYChartData, seriesProps: XYChartVariantsInternal, xAxis: XYChartAxisInternal, yAxis: XYChartAxisInternal, context: MutableProcessingContext): ControlFlowCommand; /** * Whether the slot + data satisfy the preconditions for the fast path. * Called once per slot during `preprocess`; the result is cached for the * subsequent per-datum `process` calls of that slot. Override in * subclasses that provide a fast path. Defaults to `false`. */ protected isEligibleForFastPath(_data: XYChartData[], _seriesProps: XYChartVariantsInternal, _xAxis: XYChartAxisInternal, _yAxis: XYChartAxisInternal): boolean; /** * Fast-path preprocess hook. Invoked once per slot when * `isEligibleForFastPath` returned `true` for that slot. Default is a * no-op; override alongside `processFastPath` and `isEligibleForFastPath`. */ protected preprocessFastPath(_data: XYChartData[], _seriesProps: XYChartVariantsInternal, _xAxis: XYChartAxisInternal, _yAxis: XYChartAxisInternal, _context: MutableProcessingContext): ControlFlowCommand; /** * Fast-path process hook. Invoked per datum when the slot was marked as * fast-eligible during preprocess. Default is a no-op; override alongside * `preprocessFastPath` and `isEligibleForFastPath`. */ protected processFastPath(_datum: XYChartData, _seriesProps: XYChartVariantsInternal, _xAxis: XYChartAxisInternal, _yAxis: XYChartAxisInternal, _context: MutableProcessingContext): ControlFlowCommand; } //# sourceMappingURL=fast-series.d.ts.map