Skip to main content
ResizingToolsPluginOptions
Options for the resizing tool plugin.
NameTypeDescription
borderHandleSize?numberSize of handles when using "border" resize. Defaults to 6 pixels.
bordersVisible?booleanWhen resizeMethod is "borders", set this to make the borders visible. Internally this just sets a CSS class on the draw skeleton's parent DOM element, and the appearance of the borders is then controlled via CSS.
canResizeFilter?(v:Vertex, el:BrowserElement) => booleanOptional function that can decide on whether or not the given vertex should be resizable
canRotateFilter?(v:Vertex, el:BrowserElement) => booleanOptional function that can decide on whether or not the given vertex should be rotatable
constrainGroups?booleanDefaults to true, meaning groups will not be shrunk to the point that one or more of their child vertices is no longer visible.
handleOffset?numberHow much to offset the resize frame and handles from the bounds of the shape. Defaults to 5 pixels.
handlerFactory?ResizingToolsHandlerFactoryOptional factory that can return a resize handler for some given vertex. You can use this to override the default behaviour for any vertex you choose
handleShape?"circle" | "rectangle"Shape of resize handles. Defaults to circle.
handleSize?numberWidth/height to use for handles. Defaults to 20 pixels.
heightAttribute?stringAttribute to use for vertex height - defaults to 'height'
ignoreGrid?booleanDefaults to false, meaning size changes conform to an underlying grid, if present
leftAttribute?stringAttribute to use for vertex left position - defaults to 'left'
minimumHeight?numberMinimum height the user can shrink a vertex to. Defaults to 30.
minimumWidth?numberMinimum width the user can shrink a vertex to. Defaults to 30.
modelUpdater?ResizingToolsModelUpdaterOptional function that can inject extra model updates each time a vertex is resized.
onDemand?booleanDefaults to false, meaning the resizing tool plugin switches on whenever a new vertex is selected.
onEdit?(o:Node | Group, surface:Surface, toolkit:VisuallyJsModel) => anyOptional callback invoked after an edit has occurred
payloadGenerator?(v:Node, p:ObjectData) => ObjectDataOptional function to invoke when a resize has occurred. The values the resizing plugin wants to write for the vertex are merged on top of the value returned from this function, and the combined payload is written as an update to the vertex in the data model. This exists for internal use mostly but there's no harm in it being exposed for your enjoyment.
resizeMethod?ResizingToolsResizeMethodMethod to use for resize - handles on the corners, or borders. Defaults to handles.
resizeX?booleanWhether or not to support resize in the X axis. Defaults to true.
resizeY?booleanWhether or not to support resize in the Y axis. Defaults to true.
rotatable?booleanWhether or not to support rotation on all elements.. Defaults to false.
rotateHandleSize?numberSize of the rotate handle. Defaults to 16 pixels.
rotateLeaderLength?numberLength of the leader line to the resize handle when using the resizing tools in an SVG container. Defaults to 30 pixels.
rotationStops?numberOptional number of stops to use when rotating. If not provided vertices can be rotated to any angle. If provided, the value is divided into 360 and the result is the angle between each stop. For example, a value of 12 means each stop is 30 degrees.
topAttribute?stringAttribute to use for vertex top position - defaults to 'top'
widthAttribute?stringAttribute to use for vertex width - defaults to 'width'