Neo4j Visualization Library
    Preparing search index...

    Interaction handler for panning the scene, which is achieved by clicking and moving the scene.

    For examples, head to the Pan Interaction documentation page.

    Hierarchy

    Index
    • get currentOptions(): P

      Returns the current options of the interaction.

      Returns P

      The current options of the interaction.

    • Removes the related 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

    • Enables or disables global text selection during a drag or pan operation.

      Parameters

      • enable: boolean

        Whether to enable or disable global text selection.

      • OptionaleventFunction: (this: HTMLElement, ev: MouseEvent) => void

        The event function to be added/removed when text selection is disabled/enabled.

      Returns void

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

      Parameters

      • name: string

        The name of the event.

      • callback: boolean | ((...args: unknown[]) => void)

        The callback to be called when the event is triggered.

      Returns void

    • Updates which type of graph elements should hinder panning.

      Parameters

      • targets: ("node" | "relationship")[]

        The graph elements that should hinder panning.

      • excludeNodeMargin: boolean

        If true, the node margin will not hinder panning. By default, panning is hindered by nodes and relationships.

      Returns void

      import { NVL } from '@neo4j-nvl/base'
      import { PanInteraction } from '@neo4j-nvl/interaction-handlers'

      const nvl = new NVL(document.createElement('div'), [{ id: '0' }], [])

      const panInteraction = new PanInteraction(nvl)

      // Pan canvas even when dragging on nodes and relationships
      panInteraction.updateTargets([], true)