Options for element drag in a Surface.

interface SurfaceDragOptions {
    addHelperClasses?: boolean;
    autoPan?: boolean;
    autoPanDelta?: number;
    autoPanRepeat?: number;
    constrainFunction?: ((desiredLoc, dragEl, constrainRect, size, currentLoc) => PointXY);
    filter?: string;
}

Hierarchy

  • Omit<DragOptions, "grid">
    • SurfaceDragOptions

Properties

addHelperClasses?: boolean

Defaults to true, meaning that when element dragging is occurring a class is added to the document body and also to the surface container.

autoPan?: boolean

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

autoPanDelta?: number

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

autoPanRepeat?: number

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

constrainFunction?: ((desiredLoc, dragEl, constrainRect, size, currentLoc) => PointXY)

Optional function to use to constrain element dragging.

Type declaration

filter?: string

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