OptionalallowWhen 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)
OptionalallowDefaults to true. Allows items to be dropped onto whitespace.
OptionalallowDefaults to true. Allows items to be dropped onto edges in the canvas.
OptionalallowDefaults to true. Allows items to be dropped onto groups in the canvas.
OptionalallowDefaults 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.
OptionalcanvasOptional filter to test if objects may be dropped on the canvas. This method is invoked at the start of a drag and is passed the candidate drag object's data.
OptionalcanvasOptional 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.
OptionaldataOptional function to generate an initial payload from an element that has started to be dragged.
OptionaldragOptional size to use for dragged elements.
OptionalelementOptional function to generate a drag element when the user begins a drag from the drop manager.
The element the user is dragging
Mouse event that instigated the drag
OptionalgroupOptional 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.
OptionalignoreIf true, the manager will ignore any element constrain function that may be set on the surface
OptionalignoreDefaults 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.
OptionalignoreBy 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.
OptionallassoWhen in 'tap' mode, you can optionally provide a class to set on the lasso used by the vertex drawing plugin.
OptionalmagnetizeIf true, the surface will be instructed to magnetize after dropping a new element.
OptionalmodeMode to operate in - 'drag' or 'tap'. Defaults to 'drag'.
OptionalonOptional callback that will be invoked after a new vertex has been dropped and added to the dataset.
OptionalselectorA CSS selector identifying children of source that are draggable
The element containing things that will be dragged.
The surface to attach to.
OptionaltypeOptional function to determine the type of the data object being dragged from an element that has started to be dragged.
OptionalvertexWhen in tap mode, this function can be used to provide the element shown to the user as a new vertex is being drawn.
OptionalvertexWhen 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.
The element you returned from vertexPreviewGenerator.
The canvas location of the new vertex's top/left corner.
The current size of the new vertex.
The return value from the dataGenerator
Options for the SurfaceDropManager.