Skip to main content
DragOptions
Options for element drag
NameTypeDescription
autoPan?booleanDefaults to true, meaning the canvas will pan automatically to track elements that have been dragged out of the visible area.
autoPanBoundsStrategy?AutoPanBoundsStrategyWhen auto-panning, this flag instructs the auto pan how to determine if an element is inside the root bounds or not. A value of "contained" (the default), means the whole element has to be inside the root bounds. A value of "intersecting" means that the element needs to just intersect the root bounds by some amount.
autoPanDelta?numberWhen auto-panning, this is the number of pixels that the canvas repositions itself on each tick. Defaults to 5.
autoPanRepeat?numberWhen auto-panning, this is the speed (in milliseconds) at which the canvas repositions itself. Defaults to 15ms.
canDrop?(candidate:Node | Group, target:Node | Group, onCanvas:boolean) => booleanOptional function that is invoked at the start of a drag, and which identifies allowed drop targets. Each target - the canvas, nodes and groups - is passed in turn to this method; returning false indicates that the given target is not valid for that drag.
constrainFunction?DragConstrainFunction<E>Optional function to use to constrain element dragging.
cssFilter?stringOptional CSS3 selector identifying parts of nodes/groups that should not cause a drag to start.
filter?VertexDragFilter<E>Optional function to invoke prior to a drag starting.