Creates a new instance of the pan interaction handler.
The NVL instance to attach the interaction handler to.
Returns the current options of the interaction.
The current options of the interaction.
Removes the related event listeners from the canvas.
Remove a callback for a given event of type.
The name of the event.
Enables or disables global text selection during a drag or pan operation.
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.
Add or update a callback for a given event of type.
The name of the event.
The callback to be called when the event is triggered.
Updates which type of graph elements should hinder panning.
The graph elements that should hinder panning.
If true, the node margin will not hinder panning. By default, panning is hindered by nodes and relationships.
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)
Interaction handler for panning the scene, which is achieved by clicking and moving the scene.
For examples, head to the Pan Interaction documentation page.