import { DomainAnchor, ZoomWindow } from '../../shared/kernel'; import { Switchable } from '../../shared/options'; export type { DomainAnchor, ZoomWindow }; export interface ZoomOptions extends Switchable { /** Which axes are zoomable ('x' by default). */ axes?: 'x' | 'y' | 'xy'; /** Mouse wheel zoom (true by default). */ wheelZoom?: boolean; /** Pan by dragging (true by default). */ dragPan?: boolean; /** Modifier key for panning; without it, dragging selects an area (box-zoom). */ panKey?: 'alt' | 'ctrl' | 'shift' | 'meta'; /** Drag to select an area → zoom (false by default). */ dragSelect?: boolean; /** Reset on double click (true by default). */ doubleClickReset?: boolean; /** Zoom step per wheel tick (0.1 by default). */ wheelStep?: number; /** Minimum window width (fraction of the domain, 0.05 by default). */ minRatio?: number; /** * Initial window sized to this many items along the category axis. * Applies even without `enabled`, and yields to an explicit `navigator.min`/`max`. * `minRatio` does not clamp it: an explicit count outranks the interaction floor. */ visibleCount?: number; /** Which end of the domain `visibleCount` starts from ('start' by default). */ visibleAnchor?: DomainAnchor; } export declare const FULL_WINDOW: ZoomWindow; export declare function isZoomed(window: ZoomWindow): boolean; /** Zoom around a point: pivot is the cursor position as a fraction of the window (0..1). */ export declare function zoomAround(window: ZoomWindow, pivot: number, factor: number, minRatio: number): ZoomWindow; /** Shifts the window by a fraction of its width. */ export declare function panWindow(window: ZoomWindow, deltaRatio: number): ZoomWindow; /** * Window showing `count` of `total` items, anchored to one end of the domain. * The full window comes back when the count covers everything or makes no sense. */ export declare function windowForCount(count: number, total: number, anchor?: DomainAnchor): ZoomWindow; /** Slices a categorical domain by the window. */ export declare function sliceDomain(domain: unknown[], window: ZoomWindow): unknown[]; /** Window of a numeric domain. */ export declare function windowExtent(values: number[], window: ZoomWindow): number[];