Optional
allowWhen in tap mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drawing method also still works)
Optional
allowDefaults to true. Allows items to be dropped onto whitespace.
Optional
allowDefaults to true. Allows items to be dropped onto edges in the canvas.
Optional
allowDefaults to true. Allows items to be dropped onto groups in the canvas.
Optional
allowDefaults 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.
Optional
canvasOptional 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.
Optional
dataOptional function to generate an initial payload from an element that has started to be dragged.
Optional
dragOptional size to use for dragged elements.
Optional
groupOptional 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
.
Optional
ignoreIf true, the manager will ignore any element constrain function that may be set on the surface
Optional
ignoreDefaults 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.
Optional
ignoreBy 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.
Optional
lassoWhen in 'tap' mode, you can optionally provide a class to set on the lasso used by the vertex drawing plugin.
Optional
magnetizeIf true, the surface will be instructed to magnetize after dropping a new element.
Optional
modeMode to operate in - 'drag' or 'tap'. Defaults to 'drag'.
Optional
onOptional callback that will be invoked after a new vertex has been dropped and added to the dataset.
A CSS selector identifying children of source
that are draggable
The element containing things that will be dragged.
The surface to attach to.
Optional
typeOptional function to determine the type of the data object being dragged from an element that has started to be dragged.
Optional
vertexWhen in tap mode, this function can be used to provide the element shown to the user as a new vertex is being drawn.
Optional
vertexWhen in tap mode this function is repeatedly called as the mouse is dragging a new shape. It provides a hook for you to update the element's appearance. This is only called if you provided a vertexPreviewGenerator and it has returned a valid DOM element at the start of a drag.
Options for the SurfaceDropManager.