Creates a new instance of the pan interaction handler.
The NVL instance to attach the interaction handler to
Internal
callbackInternal
Internal
Enables or disables global text selection during a drag or pan operation.
Whether to enable or disable global text selection
Optional
eventFunction: ((this: HTMLElement, ev: MouseEvent) => void)The event function to be added/removed when text selection is disabled/enabled
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.