Skip to main content

ResizingToolsPluginOptions

Options for the resizing tool plugin.

Extends

Extended by

Properties

borderHandleSize?

optional borderHandleSize: number

Size of handles when using "border" resize. Defaults to 6 pixels.


bordersVisible?

optional 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()?

optional canResizeFilter: (v, el) => boolean

Optional function that can decide on whether or not the given vertex should be resizable

Parameters

v

Vertex

el

BrowserElement

Returns

boolean


canRotateFilter()?

optional canRotateFilter: (v, el) => boolean

Optional function that can decide on whether or not the given vertex should be rotatable

Parameters

v

Vertex

el

BrowserElement

Returns

boolean


constrainGroups?

optional 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?

optional handleOffset: number

How much to offset the resize frame and handles from the bounds of the shape. Defaults to 5 pixels.


handlerFactory?

optional 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

Param


handleShape?

optional handleShape: "circle" | "rectangle"

Shape of resize handles. Defaults to circle.


handleSize?

optional handleSize: number

Width/height to use for handles. Defaults to 20 pixels.


heightAttribute?

optional heightAttribute: string

Attribute to use for vertex height - defaults to 'height'


ignoreGrid?

optional ignoreGrid: boolean

Defaults to false, meaning size changes conform to an underlying grid, if present


leftAttribute?

optional leftAttribute: string

Attribute to use for vertex left position - defaults to 'left'


minimumHeight?

optional minimumHeight: number

Minimum height the user can shrink a vertex to. Defaults to 30.


minimumWidth?

optional minimumWidth: number

Minimum width the user can shrink a vertex to. Defaults to 30.


modelUpdater?

optional modelUpdater: ResizingToolsModelUpdater

Optional function that can inject extra model updates each time a vertex is resized.


onDemand?

optional onDemand: boolean

Defaults to false, meaning the resizing tool plugin switches on whenever a new vertex is selected.


onEdit()?

optional onEdit: (o, surface, toolkit) => any

Optional callback invoked after an edit has occurred

Parameters

o

Node | Group

surface

Surface

toolkit

VisuallyJsModel

Returns

any


payloadGenerator()?

optional payloadGenerator: (v, p) => 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.

Parameters

v

Node

p

ObjectData

Returns

ObjectData


resizeMethod?

optional resizeMethod: ResizingToolsResizeMethod

Method to use for resize - handles on the corners, or borders. Defaults to handles.


resizeX?

optional resizeX: boolean

Whether or not to support resize in the X axis. Defaults to true.


resizeY?

optional resizeY: boolean

Whether or not to support resize in the Y axis. Defaults to true.


rotatable?

optional rotatable: boolean

Whether or not to support rotation on all elements.. Defaults to false.


rotateHandleSize?

optional rotateHandleSize: number

Size of the rotate handle. Defaults to 16 pixels.


rotateLeaderLength?

optional 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?

optional 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?

optional topAttribute: string

Attribute to use for vertex top position - defaults to 'top'


widthAttribute?

optional widthAttribute: string

Attribute to use for vertex width - defaults to 'width'