OptionalaxisAxis to zoom
OptionalcenterPlace this point at center during zoom instead of current mouse position
OptionalinterruptStop smoothing with any user input on the viewport
OptionalkeyArray containing KeyboardEvent.code values of keys that can be pressed for the zoom to be triggered, e.g.: ['ShiftLeft', 'ShiftRight'}.
OptionallineScaling factor for non-DOM_DELTA_PIXEL scrolling events
OptionalpercentAdjusts the zoom speed. Despite its name, this is not the percent zoomed per spin.
Each wheel event multiplies the scale by 2 ^ ((1 + percent) * -deltaY / 500)
(or 2 ^ ((1 + percent) * trackpadPinchSpeed * -deltaY / 200) for a trackpad pinch with trackpadPinch on).
For a typical mouse wheel notch (deltaY = 100) this zooms by about:
-0.5 → 7%0 → 15%0.1 (default) → 16.5%0.5 → 23%1 → 32%Use a negative value to zoom slower than the default. -1 stops zooming and values below -1 reverse it.
deltaY varies by browser, OS, and device, so the actual amount per notch varies too.
OptionalreverseReverse the direction of the scroll
Optionalsmoothsmooth the zooming by providing the number of frames to zoom between wheel spins
OptionaltrackpadPinch the trackpad to zoom. Browsers send a trackpad pinch as wheel events with ctrlKey set; with this on,
those events zoom using trackpadPinchSpeed (and zoom even when wheelZoom is false).
OptionaltrackpadMultiplies the zoom speed of a trackpad pinch (only used when trackpadPinch is on). Unlike percent, it
doesn't change mouse wheel zooming.
A pinch arrives as many wheel events with small deltas (deltaY around 2 to 10). At 1, an event with
deltaY = 5 zooms by about 2%; at 2.5, about 5%, which is close to how map apps feel.
Optionalwheelzooms on wheel spin (use this as an alternative to drag.options.wheel)
Options for Wheel.