PaletteComponent
Properties
allowClickToAdd?
optionalallowClickToAdd:boolean
When in draw mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drag to draw approach also still works)
allowDropOnCanvas?
optionalallowDropOnCanvas:boolean
Defaults to true. Allows items to be dropped onto whitespace.
Input
allowDropOnEdge?
optionalallowDropOnEdge:boolean|CanDropOnEdgeFilter=false
Defaults to true. Allows items to be dropped onto edges in the canvas.
Input
allowDropOnGroup?
optionalallowDropOnGroup:boolean
Defaults to true. Allows items to be dropped onto groups in the canvas.
Input
allowDropOnNode?
optionalallowDropOnNode:boolean
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.
Input
allowRotation?
optionalallowRotation:boolean
Whether or not to allow rotation of elements being dragged. Defaults to true.
autoEdgeConnect?
optionalautoEdgeConnect:boolean|AutoEdgeConnectOptions
Controls whether the palette will automatically connect a new vertex being dragged onto the canvas to existing vertices, if the shape definitions for the new vertex and/or the existing vertices have source/target elements. You can set this to simply 'true', and use defaults, or you can provide values for various options.
Input
canvasDropFilter?
optionalcanvasDropFilter:CanvasDropFilter
Optional 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.
Input
clickToAddOnly?
optionalclickToAddOnly:boolean
This flag relates to "draw" mode, and defaults to false. When true, the palette only supports click to draw new vertices, not drag. This flag is forced to true if the associated UI does not have useModelForSizes set, since there is no point in allowing a user to drag a vertex to some size if its not going to be honoured. When you set this flag and associated UI does have useModelForSizes set, the palette will use default sizes for new nodes/groups.
dataGenerator?
optionaldataGenerator:DataGeneratorFunction
Function to use to generate an initial payload when the user starts to drag something from this component, or taps on an item in tap/draw mode. Optional, and if omitted Visually JS will use a default data generator that extracts data values from any data-vjs-*** attributes on the element being dragged.
Input
dragSize?
optionaldragSize:Size
Optional size to use for dragged elements.
Input
groupIdentifier?
optionalgroupIdentifier:GroupIdentifierFunction
Optional function to use to determine if the object that is being dragged represents a group. If this function is present, and returns true, then the drag object is considered to be a group. In all other cases the drag object is considered to be a node.
Input
mode?
optionalmode:PaletteMode
Mode to use - drag or tap. Defaults to drag.
Input
onVertexAdded?
optionalonVertexAdded:OnVertexAddedCallback
Optional callback for when a new vertex has been added via this component.
Input
rotationSpeed?
optionalrotationSpeed:number
The number of milliseconds required to complete a full rotation of an element when the trigger key is held down. Defaults to 2000.
selectAfterAdd?
optionalselectAfterAdd:boolean
Defaults to false. When true, a newly added vertex is set as the model's current selection.
Input
selector?
optionalselector:string
CSS3 selector identifying the child elements of the the element on which this directive was declared that act as drag sources. Optional; if omitted Visually JS will use [data-vjs-type].
Input
typeGenerator?
optionaltypeGenerator:TypeGeneratorFunction
Optional function to use to determine the type of object that a user has just started dragging or tapped on