PanZoomOptions
What an environment supplies to usePanZoomGestures: the arithmetic of its own view, not the binding.
@internote/canvas-sdk/reactimport { PanZoomOptions } from '@internote/canvas-sdk/react';#Fields
baseReturns the view a gesture starts from: the reader's, else the one the surface drew.
null declines the gesture. A move already queued this frame takes precedence.V | nullclampReturns a queued view held to the limits the reader may not leave.
VcommitCalled at most once a frame, with the view as it settled.
voiddragReturns the view after the pointer moved, or
null to ignore the move. Absent means this surface does not pan.V | nullenabledWhether the gestures are bound at all. When false the reader may not move this view.
booleanresetCalled on double-click, to hand the frame back to the author.
voidwheelReturns the view after one wheel notch, or
null to ignore it.V | null#Example
usePanZoomGestures(svgRef, {
enabled: explorable,
base: () => view.current(ctx),
wheel: (from, event) => zoomAbout(from, event.deltaY, pointOf(event)),
drag: (from, was, now) => panBy(from, now.x - was.x, now.y - was.y),
commit: (next) => view.glide(ctx, next),
reset: () => view.reset(ctx),
});Declared in packages/canvas-sdk/src/react/use-pan-zoom-gestures.ts:51.