UNPKG

@deltares/fews-web-oc-charts

Version:
46 lines (45 loc) 1.6 kB
import type { Axes } from '../Axes/axes.js'; import { CartesianAxes, D3Selection, ModifierKey } from '../index.js'; import type { Visitor } from './visitor.js'; export declare const ZoomMode: { X: string; XY: string; Y: string; }; export type ZoomMode = (typeof ZoomMode)[keyof typeof ZoomMode]; export declare enum WheelMode { X = 0, XY = 1, Y = 2, NONE = 3 } export interface ZoomHandlerOptions { wheelMode: WheelMode; sharedZoomMode: ZoomMode; scrollModifierKey: ModifierKey; } type BrushGroup = D3Selection<SVGElement, null>; export declare class ZoomHandler implements Visitor { private brushStartPoint; private axes; private mode; private options; private readonly MINMOVE; private lastPoint; constructor(wheelMode?: WheelMode, scrollModifierKey?: ModifierKey); constructor(options?: Partial<ZoomHandlerOptions>); visit(axis: Axes): void; updateOptions(options: Partial<ZoomHandlerOptions>): void; createHandler(axis: CartesianAxes): void; private updateWheelMode; private dispatchZoomEvent; private updateZoomAxisScales; zoom(axis: CartesianAxes, factor: number, point: [number, number]): void; initSelection(axis: Axes, mouseGroup: any, brushGroup: BrushGroup, point: [number, number]): void; updateSelection(axis: Axes, brushGroup: BrushGroup, point: [number, number]): void; private updateAxisScales; endSelection(axis: CartesianAxes, mouseGroup: any, brushGroup: BrushGroup, point: [number, number]): void; resetZoom(axis: Axes): void; redraw(): void; } export {};