import type { AxisID, ChartAnimationPhase, DynamicContext, NormalisedBaseCartesianAxisOptions, Scale, ZoomMinMax } from 'ag-charts-core'; import { ChartAxisDirection, StateMachine } from 'ag-charts-core'; import type { AgCartesianAxisPosition, AgTimeInterval, AgTimeIntervalUnit } from 'ag-charts-types'; import type { AxisContext } from '../../module/axisContext'; import type { ChartRegistry } from '../../module/moduleContext'; import { type FromToDiff } from '../../motion/fromToMotion'; import { BBox } from '../../scene/bbox'; import { TranslatableGroup } from '../../scene/group'; import { Selection } from '../../scene/selection'; import { Line } from '../../scene/shape/line'; import { Rect } from '../../scene/shape/rect'; import type { AxisPrimaryTickCount } from '../../util/secondaryAxisTicks'; import { Caption } from '../caption'; import type { ChartLayout } from '../chartAxis'; import type { AnimationManager } from '../interaction/animationManager'; import type { ScrollbarLayout } from '../layout/layoutManager'; import { Axis, type LabelNodeDatum } from './axis'; import type { AxisFillDatum, AxisGroupDatumTranslation, AxisLineDatum, AxisLineDatumCoords, TickDatum } from './axisUtil'; import { NiceMode } from './axisUtil'; type AxisAnimationState = 'empty' | 'ready'; type AxisAnimationEvent = { reset: undefined; resize: undefined; update: FromToDiff; }; interface GeneratedTicks { ticks: TickDatum[]; tickLines: AxisLineDatum[]; gridLines: AxisLineDatum[]; gridFills: AxisFillDatum[]; labels: LabelNodeDatum[]; spacing: number; } export type GridLineStyleTickDatum = Pick; export declare abstract class CartesianAxis = Scale, D = any, TOptions extends NormalisedBaseCartesianAxisOptions = NormalisedBaseCartesianAxisOptions> extends Axis { static is(value: unknown): value is CartesianAxis; get position(): AgCartesianAxisPosition; readonly crossAxisTranslation: { x: number; y: number; }; private titleThickness; minimumTimeGranularity: AgTimeIntervalUnit | undefined; lineRange?: [number, number]; private zoom; getZoom(): ZoomMinMax; setZoom(zoom: ZoomMinMax): void; protected animationManager: AnimationManager; protected readonly headingLabelGroup: TranslatableGroup; protected readonly lineNodeGroup: TranslatableGroup; protected readonly lineNode: Line; protected tickLineGroupSelection: Selection>; protected gridLineGroupSelection: Selection>; protected gridFillGroupSelection: Selection>; private readonly tempText; private readonly tempCaption; protected readonly animationState: StateMachine; protected get horizontal(): boolean; constructor(moduleCtx: DynamicContext, id: AxisID, scale: S, options: TOptions); /** * Canvas-space alignment for a configured `label.textAlign`. Nullish means the axis's own * computed alignment, which is not the resolver's concern, so it passes straight through. */ private resolveLabelTextAlign; protected onGridVisibilityChange(): void; resetAnimation(phase: ChartAnimationPhase): void; get direction(): ChartAxisDirection.X | ChartAxisDirection.Y; protected get userListeners(): import("ag-charts-types").AgAxisListeners | undefined; createAxisContext(): AxisContext; protected updateDirection(): void; calculateLayout(primaryTickCount?: AxisPrimaryTickCount, chartLayout?: ChartLayout): { primaryTickCount?: AxisPrimaryTickCount; bbox?: BBox; }; calculateTickLayout(domain: D[], niceMode: NiceMode[], visibleRange: [number, number], initialPrimaryTickCount?: AxisPrimaryTickCount): { niceDomain: D[]; tickDomain: D[]; ticks: D[]; rawTickCount: number | undefined; fractionDigits: number; timeInterval: AgTimeInterval | AgTimeIntervalUnit | undefined; bbox: BBox; layout: GeneratedTicks; }; protected calculateGridLines(ticks: GridLineStyleTickDatum[], p1: number, p2: number): AxisLineDatum[]; protected calculateGridLine({ index: tickIndex, tickId, translation: offset }: GridLineStyleTickDatum, _index: number, p1: number, p2: number, _ticks: GridLineStyleTickDatum[]): AxisLineDatum; protected calculateGridFills(ticks: GridLineStyleTickDatum[], p1: number, p2: number): AxisFillDatum[]; protected calculateGridFill({ tickId, translation }: Pick, index: number, gridFillIndex: number, p1: number, p2: number, ticks: GridLineStyleTickDatum[]): AxisFillDatum; protected calculateTickLines(ticks: TickDatum[], direction: number, scrollbarThickness?: number): AxisLineDatum[]; protected calculateTickLine({ isPrimary, tickId, translation: offset }: Pick, _index: number, direction: number, _ticks: TickDatum[], scrollbarThickness?: number): AxisLineDatum; update(): void; private getAxisTransform; protected getLayoutTranslation(): { x: number; y: number; }; getLayoutState(): { position: AgCartesianAxisPosition; crosshairOffset: { x: number; y: number; }; id: string; rect: BBox; translation: { x: number; y: number; }; gridPadding: number; seriesAreaPadding: number; tickSize: number; labelThickness?: number; scrollbar?: { enabled: boolean; placement: import("ag-charts-types").AgScrollbarPlacement; spacing: number; thickness: number; offset: number; }; label: { fractionDigits: number; spacing: number; format?: string | Record; boxOffset: number; }; direction: ChartAxisDirection; domain: any[]; scale: Scale; }; protected updatePosition(): void; protected getCanvasBounds(): BBox; setAxisVisible(visible: boolean): void; private getAxisLineCoordinates; private getTickLineBBox; protected lineNodeBBox(): BBox; protected titleBBox(domain: D[], spacing: number): BBox; private wrapTitleText; protected getScrollbarThickness(scrollbar?: ScrollbarLayout): number; protected resolveScrollbarLayout(scrollbar: ScrollbarLayout | undefined, labelThickness: number): (ScrollbarLayout & { offset: number; }) | undefined; protected applyScrollbarLayout(boxes: BBox[], labelThickness: number, scrollbar: ScrollbarLayout | undefined): { spacing: number; scrollbarLayout: (ScrollbarLayout & { offset: number; }) | undefined; }; private measureAxisLayout; private isTitleAtEdge; private isLabelsAtEdge; private isCrosshairLabelAtEdge; crosshairLabelNeedsEdgeSpace(): boolean; /** The title and labels render in the same place unless exactly one of them is at the edge. */ private titleRendersWithLabels; /** The title only has to clear the labels when both render in the same place. */ private resolveTitleSpacing; /** Thickness occupied at the `position` edge and at the crossing point, which `crossAt` can split apart. */ getCrossAtThicknesses(): { atEdge: number; atCrossing: number; }; protected titleProps(caption: Caption, domain: D[], spacing: number): { visible: boolean; text: import("ag-charts-types").NormalisedTextOrSegments | undefined; textAlign: CanvasTextAlign; textBaseline: CanvasTextBaseline; x: number; y: number; rotationCenterX: number; rotationCenterY: number; rotation: number; }; /** See {@link AxisLayout.label.boxOffset}, which this is reported through. */ private labelBoxOffset; protected getLabelBoxOffset(): number; private getTickLabelProps; private resolveLabelBaseline; /** * Whether a configured `label.verticalAlign` will band-flush this axis's labels across the axis * line. Only a horizontal axis flushes on `verticalAlign`; on a vertical one the option acts * along the axis, where it cannot change the separation collision avoidance measures. */ private bandFlushesLabels; /** * How far the band flush will move each label across the axis, run on a throwaway copy of the * label data so collision avoidance can measure the geometry it will actually render. Shares * `alignLabelBands` rather than restating its band maths, so the two cannot drift apart. */ private measureLabelBandOffsets; /** * Re-anchor labels so that a configured `label.textAlign` / `label.verticalAlign` aligns them * within the band the axis reserved, rather than around their own anchor point - the latter * grows the glyphs inwards across the axis line and over the series area, where the series * paints over them. * * Each option owns the axis's cross direction for the orientation it acts across: `textAlign` on * a vertical axis and `verticalAlign` on a horizontal one. In the other orientation the option * acts along the axis instead, so only rotation can carry the glyphs across the axis line; the * correction there restores the cross-axis placement the axis's own computed alignment would * have produced, leaving the along-axis alignment alone. */ private alignLabelBands; /** * Shift that moves a rotated label back to the cross-axis offset the axis's computed alignment * would have given it, so the reserved band still contains it. */ private getCrossAxisCorrection; /** * Shift that moves a rotated label back to the cross-axis offset the axis's computed baseline * would have given it, so the reserved column still contains it. The transpose of * `getCrossAxisCorrection`, for a vertical axis where `verticalAlign` acts along the axis. */ private getVerticalCrossAxisCorrection; protected updateSelections(): void; protected updateGridLines(): void; protected updateGridFills(): void; protected updateTickLines(): void; protected updateTitle(domain: D[], spacing: number): void; protected updateLabels(): void; private animateReadyUpdate; protected resetSelectionNodes(): void; } export {};