Usage guidesInteraction

Zoom canvas

Use the mouse wheel to zoom around the canvas center.

Use the mouse wheel to zoom around the canvas center.

Configuration

Set wheel sensitivity with sensitivity and the wheel zoom range with minZoom and maxZoom.

Example

Loading example…
Scroll to zoom or drag empty space to pan.
const behaviors = [
  { type: 'zoom-canvas', sensitivity: 1.4, minZoom: 0.4, maxZoom: 2 },
  { type: 'drag-canvas', ignoreModifierKeys: true },
] satisfies [BuiltInBehaviorConfig, BuiltInBehaviorConfig];

Options and defaults