UNPKG

ag-charts-community

Version:

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

103 lines (102 loc) 3.35 kB
import type { Size } from 'ag-charts-core'; import type { TextOrSegments } from 'ag-charts-types'; import type { FromToFns } from '../../motion/fromToMotion'; import type { Group, TranslatableGroup } from '../../scene/group'; import type { Line } from '../../scene/shape/line'; import type { Rect } from '../../scene/shape/rect'; import type { RotatableText } from '../../scene/shape/text'; export declare enum NiceMode { TickAndDomain = 0, TicksOnly = 1, Off = 2 } export interface TickDatum { index: number; tickLabel: TextOrSegments | undefined; tick: any; tickId: string; translation: number; textUntruncated: string | undefined; isPrimary: boolean; textMetrics: Size; } export interface AxisLineDatum { tickId: string; offset: number; x1: number; x2: number; y1: number; y2: number; stroke: string | undefined; strokeWidth: number; lineDash: number[] | undefined; } export interface AxisFillDatum { tickId: string; x1: number; x2: number; y1: number; y2: number; fill: string | undefined; fillOpacity: number | undefined; } export interface AxisAnimationContext { visible: boolean; min: number; max: number; } export interface AxisGroupDatum { rotation: number; rotationCenterX: number; rotationCenterY: number; translationX: number; translationY: number; } export interface AxisLabelDatum { tickId: string; x: number; y: number; rotationCenterX: number; rotationCenterY: number; rotation: number; range: number[]; } export type AxisGroupTranslation = Pick<AxisGroupDatum, 'translationX' | 'translationY'>; export type AxisLineDatumCoords = Pick<AxisLineDatum, 'x1' | 'x2' | 'y1' | 'y2'>; export type AxisLineOpacity = AxisLineDatumCoords & { opacity?: number; }; export type AxisGroupDatumTranslation = Pick<AxisGroupDatum, 'translationX' | 'translationY'>; export type AxisLabelDatumRotation = Pick<AxisLabelDatum, 'x' | 'y' | 'rotationCenterX' | 'rotationCenterY' | 'rotation'>; export declare function prepareAxisAnimationContext(axis: { range: number[]; }): AxisAnimationContext; export declare function prepareAxisAnimationFunctions(ctx: AxisAnimationContext): { tick: FromToFns<AxisLineDatum, Line<AxisLineDatum>, AxisLineOpacity>; line: FromToFns<AxisLineDatumCoords, Line<AxisLineDatumCoords>, AxisLineDatumCoords>; label: FromToFns<AxisLabelDatumRotation, RotatableText<AxisLabelDatumRotation>, AxisLabelDatumRotation>; group: FromToFns<AxisGroupDatumTranslation, TranslatableGroup<AxisGroupDatumTranslation>, AxisGroupTranslation>; }; export declare function resetAxisGroupFn(): (_node: Group, datum: AxisGroupDatumTranslation) => { translationX: number; translationY: number; }; export declare function resetAxisLabelSelectionFn(): (_node: RotatableText, datum: AxisLabelDatumRotation) => { x: number; y: number; rotationCenterX: number; rotationCenterY: number; rotation: number; }; export declare function resetAxisLineSelectionFn(): (_node: Line, datum: AxisLineDatumCoords) => { x1: number; x2: number; y1: number; y2: number; }; export declare function resetAxisFillSelectionFn(): (_node: Rect, datum: AxisFillDatum) => { x: number; y: number; width: number; height: number; };