Interaction handler for zooming the canvas, which is achieved by scrolling the mouse wheel on the canvas.

For examples, head to the Zoom Interaction documentation page.

Hierarchy

Constructors

  • Creates a new instance of the zoom interaction handler.

    Parameters

    • nvl: NVL

      The NVL instance to attach the interaction handler to

    • options: {} = {}

      Returns ZoomInteraction

    Properties

    callbackMap: Map<"onZoom", undefined | boolean | ((zoomLevel: number, event: WheelEvent) => void)>

    Accessors

    • get containerInstance(): HTMLElement
    • Internal

      Returns HTMLElement

    • get currentOptions(): P
    • Returns P

    • get nvlInstance(): NVL
    • Internal

      Returns NVL

    Methods

    • Internal

      Parameters

      • type: keyof HTMLElementEventMap
      • listener: ((event: Event) => void)
          • (event): void
          • Parameters

            • event: Event

            Returns void

      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Internal

      Parameters

      • name: "onZoom"
      • Rest...args: unknown[]

      Returns void

    • Removes the relevant event listeners from the canvas.

      Returns void

    • Remove a callback for a given event of type.

      Parameters

      • name: string

        The name of the event

      Returns void

    • Internal

      Parameters

      • type: keyof HTMLElementEventMap
      • listener: ((event: Event) => void)
          • (event): void
          • Parameters

            • event: Event

            Returns void

      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Add or update a callback for a given event of type.

      Parameters

      • name: string

        The name of the event

      • callback: undefined | boolean | ((zoomLevel: number, event: WheelEvent) => void)

        The callback to be called when the event is triggered

      Returns void