Skip to main content

Home > @jsplumbtoolkit/drop > SurfaceDropManagerOptions

SurfaceDropManagerOptions interface

Options for the SurfaceDropManager.


export interface SurfaceDropManagerOptions<T> 


allowDropOnCanvas?boolean(Optional) Defaults to true. Allows items to be dropped onto whitespace.
allowDropOnEdge?boolean(Optional) Defaults to true. Allows items to be dropped onto edges in the canvas.
allowDropOnGroup?boolean(Optional) Defaults to true. Allows items to be dropped onto groups in the canvas.
allowDropOnNode?boolean(Optional) Defaults to false. Allows items to be dropped onto nodes in the canvas. If this is true and an element is dropped onto a node, the result is the same as if the element has been dropped onto whitespace.
canvasSelector?string(Optional) Optional selector specifying what parts of the surface's canvas should be considered whitespace. If you're using a decorator, for instance, you might want to add a selector for that decorator's elements so that items can be dropped onto them.
dataGenerator?DataGeneratorFunction<T>(Optional) Optional function to generate an initial payload from an element that has started to be dragged.
elementGenerator?(el: Element) => Element(Optional)
groupIdentifier?GroupIdentifierFunction<T>(Optional) Optional function to use to determine if the element being dragged represents a group. If you do not provide this, the default behaviour is to check for the presence of a data-jtk-is-group attribute on the element, with a value of true.
ignoreConstrainFunction?boolean(Optional) If true, the manager will ignore any element constrain function that may be set on the surface
ignoreGrid?boolean(Optional) Defaults to false. By default this class will conform to any grid in place in the surface to which it is attached when dragging items around.
ignoreZoom?boolean(Optional) By default, the SurfaceDropManager will apply a scale transform to elements that are being dragged so that they appear at the same size as the Surface they're being dragged to. Setting this flag to true will switch off that behaviour.
magnetize?boolean(Optional) If true, the surface will be instructed to magnetize after dropping a new element.
onVertexAdded?(v: Vertex) => any(Optional) Optional callback that will be invoked after a new vertex has been dropped and added to the dataset.
selectorstringA CSS selector identifying children of source that are draggable
sourceElementThe element containing things that will be dragged.
surfaceSurfaceThe surface to attach to.
typeGenerator?TypeGeneratorFunction<T>(Optional) Optional function to determine the type of the data object being dragged from an element that has started to be dragged.