import { PointReducer, PointReducerConfig, PointReducerInstance, PointReducerAccumulator } from "./PointReducer"; import { RenderingContext } from "../../ui/RenderingContext"; import { NumberProp, Bind, Prop, DataRecord } from "../../ui/Prop"; import { AccessorChain } from "../../data/createAccessorModelProxy"; export interface SnapAccumulator extends PointReducerAccumulator { cursor: { x: number | null; y: number | null; mapped: boolean; mappedX?: number | null; mappedY?: number | null; }; dist: number; snapX: any; snapY: any; snapRecord?: any; xAxis: any; yAxis: any; } export interface SnapPointFinderInstance extends PointReducerInstance { xAxis?: any; yAxis?: any; } export interface SnapPointFinderConfig extends PointReducerConfig { /** Cursor X value. */ cursorX?: NumberProp; /** Cursor Y value */ cursorY?: NumberProp; /** A binding used to receive the x value of the nearest point.*/ snapX?: Bind | AccessorChain | AccessorChain; /** A binding used to receive the y value of the nearest point. */ snapY?: Bind | AccessorChain | AccessorChain; /** A binding used to receive the record prop */ snapRecord?: Prop; /** Maximum distance between cursor and the snap point. Default value is 50. Adjust accordingly for large distances, e.g. set to Infinity when using TimeAxis */ maxDistance?: number; /** A function used to convert x values into numeric format. Commonly used with dates. */ convertX?: (value: number | string) => number; /** A function used to convert y values into numeric format. Commonly used with dates. */ convertY?: (value: number | string) => number; /** Name of the x-axis. Default is 'x'. */ xAxis?: string; /** Name of the y-axis. Default is 'y'. */ yAxis?: string; } export declare class SnapPointFinder extends PointReducer { maxDistance: number; convertX: (value: any) => number; convertY: (value: any) => number; xAxis: string; yAxis: string; constructor(config?: SnapPointFinderConfig); declareData(...args: any[]): void; explore(context: RenderingContext, instance: SnapPointFinderInstance): void; onInitAccumulator: (acc: SnapAccumulator, { data, xAxis, yAxis }: SnapPointFinderInstance) => void; onMap: (acc: SnapAccumulator, x: any, y: any, name: string, p: any) => void; onReduce: (acc: SnapAccumulator, instance: PointReducerInstance) => void; } //# sourceMappingURL=SnapPointFinder.d.ts.map