Skip to main content

DragOptions

Options for element drag

Type Parameters

E

E

Properties

autoPan?

optional autoPan: boolean

Defaults to true, meaning the canvas will pan automatically to track elements that have been dragged out of the visible area.


autoPanBoundsStrategy?

optional autoPanBoundsStrategy: AutoPanBoundsStrategy

When 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?

optional autoPanDelta: number

When auto-panning, this is the number of pixels that the canvas repositions itself on each tick. Defaults to 5.


autoPanRepeat?

optional autoPanRepeat: number

When auto-panning, this is the speed (in milliseconds) at which the canvas repositions itself. Defaults to 15ms.


canDrop()?

optional canDrop: (candidate, target?, onCanvas?) => boolean

Optional 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.

Parameters

candidate

Node | Group

target?

Node | Group

onCanvas?

boolean

Returns

boolean


constrainFunction?

optional constrainFunction: DragConstrainFunction<E>

Optional function to use to constrain element dragging.

Param

Param

Param

Param


cssFilter?

optional cssFilter: string

Optional CSS3 selector identifying parts of nodes/groups that should not cause a drag to start.


filter?

optional filter: VertexDragFilter<E>

Optional function to invoke prior to a drag starting.