Options for how to respond to wheel events.

interface WheelOptions {
    axis?: "both" | "x" | "y";
    filter?: ((e) => boolean);
    pan?: boolean;
    reverse?: boolean;
    sensitivity?: number;
    useMetaKey?: boolean;
    zoom?: boolean;


axis?: "both" | "x" | "y"

For use with pan:true - defines the axes in which the widget will pan in response to the wheel

filter?: ((e) => boolean)

Optional function to call to check if wheel zooming should be enabled for the current event target.

Type declaration

    • (e): boolean
    • Parameters

      • e: MouseEvent

        Mouse event for the wheel

      Returns boolean

pan?: boolean

Whether or not to pan the display when the wheel is moved. Defaults to false.

reverse?: boolean

Defaults to false. If true, the zoom direction is reversed: wheel up zooms out, and wheel down zooms in.

sensitivity?: number

How sensitive the wheel should be.

useMetaKey?: boolean

If true, the "meta" key (CMD on Mac, Ctrl on windows/linux) must be pressed in order for wheel zoom to operate. This can be useful if your UI fills the screen in one or more axes and your users would not be able to scroll past the Surface widget.

zoom?: boolean

Whether or not wheel zoom is enabled. Defaults to true.