ResizingToolsPluginOptions
Options for the resizing tool plugin.
| Name | Type | Description |
|---|---|---|
| borderHandleSize? | number | Size of handles when using "border" resize. Defaults to 6 pixels. |
| bordersVisible? | boolean | When 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) => boolean | Optional function that can decide on whether or not the given vertex should be resizable |
| canRotateFilter? | (v:Vertex, el:BrowserElement) => boolean | Optional function that can decide on whether or not the given vertex should be rotatable |
| constrainGroups? | boolean | Defaults to true, meaning groups will not be shrunk to the point that one or more of their child vertices is no longer visible. |
| handleOffset? | number | How much to offset the resize frame and handles from the bounds of the shape. Defaults to 5 pixels. |
| handlerFactory? | ResizingToolsHandlerFactory | Optional 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? | number | Width/height to use for handles. Defaults to 20 pixels. |
| heightAttribute? | string | Attribute to use for vertex height - defaults to 'height' |
| ignoreGrid? | boolean | Defaults to false, meaning size changes conform to an underlying grid, if present |
| leftAttribute? | string | Attribute to use for vertex left position - defaults to 'left' |
| minimumHeight? | number | Minimum height the user can shrink a vertex to. Defaults to 30. |
| minimumWidth? | number | Minimum width the user can shrink a vertex to. Defaults to 30. |
| modelUpdater? | ResizingToolsModelUpdater | Optional function that can inject extra model updates each time a vertex is resized. |
| onDemand? | boolean | Defaults to false, meaning the resizing tool plugin switches on whenever a new vertex is selected. |
| onEdit? | (o:Node | Group, surface:Surface, toolkit:VisuallyJsModel) => any | Optional callback invoked after an edit has occurred |
| payloadGenerator? | (v:Node, p:ObjectData) => ObjectData | Optional 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? | ResizingToolsResizeMethod | Method to use for resize - handles on the corners, or borders. Defaults to handles. |
| resizeX? | boolean | Whether or not to support resize in the X axis. Defaults to true. |
| resizeY? | boolean | Whether or not to support resize in the Y axis. Defaults to true. |
| rotatable? | boolean | Whether or not to support rotation on all elements.. Defaults to false. |
| rotateHandleSize? | number | Size of the rotate handle. Defaults to 16 pixels. |
| rotateLeaderLength? | number | Length of the leader line to the resize handle when using the resizing tools in an SVG container. Defaults to 30 pixels. |
| rotationStops? | number | Optional 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? | string | Attribute to use for vertex top position - defaults to 'top' |
| widthAttribute? | string | Attribute to use for vertex width - defaults to 'width' |