import type { AxisPluginModuleInstance, DynamicContext, LabelObstacle, NormalisedAxisCrossLineOptions } from 'ag-charts-core'; import { AbstractModuleInstance } from 'ag-charts-core'; import type { AxisContext } from '../../module/axisContext'; import type { ChartAxisRegistry } from '../../module/moduleContext'; import type { BBox } from '../../scene/bbox'; import type { LabelSource } from '../layout/labelManager'; import type { CrossLine } from './crossLine'; /** * Axis plugin that owns a per-axis runtime list of {@link CrossLine} instances along with the * scene-graph groups they render into. * * Ownership model (post-refactor — the axis itself has no cross-line awareness): * - The plugin creates its own per-axis `rangeGroup` / `lineGroup` / `labelGroup` and attaches * them to the chart-level scene-graph zones owned by {@link AxisManager}. Those zones already * sit at the correct z-indices for cross-line rendering. * - Per-instance `CrossLine` runtime is constructed by reading `ctx.crossLine`, a factory * installed via `DynamicContext.factory()` by the owning axis-plugin module's `register` hook. * The community `CrossLinesModule` (scoped to `chartType: 'cartesian'`) installs the cartesian * implementation; the enterprise `PolarCrossLinesModule` (scoped to `chartType: 'polar'`) installs * a polar-aware factory that branches on `axisCtx.axisType` between angle and radius variants. * The two modules are distinct registry entries that share the same `optionsKey: 'crossLines'`, * so `axis.crossLines` works uniformly across cartesian and polar axes. * - Lifecycle is driven by the generic {@link AxisPluginModuleInstance} hooks * ({@link update}, {@link layout}, {@link onScaleChange}, {@link onGridChange}). The axis * invokes them generically without knowing what cross-lines are. * * `applyOptions` is called every `Chart.applyAxes` cycle (whether or not the cross-lines options * changed), so the body short-circuits when the new options are structurally equivalent to the * previous call — preserving the pre-refactor `jsonDiff`-gated setter behaviour and avoiding * scene-graph detach/recreate churn on no-op updates. Per invariant I1 the options array is * read-only — the plugin stores its own runtime state on the per-instance `CrossLine`s. */ export declare class CrossLinesPlugin extends AbstractModuleInstance implements AxisPluginModuleInstance, LabelSource { static readonly className = "CrossLines"; readonly id: string; /** A reserved label never moves, so the plugin only ever contributes obstacles. */ readonly usesPlacedLabels = false; /** Bumped whenever the label inputs change, so placement can skip an unchanged solve. */ nodeDataVersion: number; private readonly ctx; private readonly axisCtx; private readonly rangeGroup; private readonly lineGroup; private readonly labelGroup; private instances; private visible; private lastOptions; private readonly removePointerListeners; constructor(ctx: DynamicContext>); private pickCrosslines; private toParamsArray; private onSeriesAreaContextMenu; private onSeriesAreaCanvasClick; applyOptions(options: NormalisedAxisCrossLineOptions[] | undefined): void; onAxisUpdate(): void; onAxisLayout(): void; onScaleChange(): void; onGridChange(): void; setVisible(visible: boolean): void; getInstances(): readonly CrossLine[]; /** * Reserved cross-line labels, as obstacles in placement space. Seeded before any label resolves, so * every other label routes around them whatever order the sources are solved in. */ getLabelObstacles(seriesRect: BBox): LabelObstacle[] | undefined; destroy(): void; private attachInstance; private detachInstance; private initInstance; private optionsEquivalent; }