Skip to main content

DiagramToolsPluginOptions

Options for the diagram tools plugin

Extends

Properties

allowClone?

optional allowClone: boolean

Whether or not to allow clone of vertices. Defaults to true; is overriden by any canClone function passed in.


allowDelete?

optional allowDelete: boolean

Whether or not to allow delete of vertices. Defaults to true; is overriden by any canDelete function passed in.


optional allowLink: boolean

Whether or not to show a handle from which a user can drag a link to other vertices. Defaults to true; is overriden by any canShowLinkButton function passed in.


borderHandleSize?

optional borderHandleSize: number

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

Inherited from

ResizingToolsPluginOptions.borderHandleSize


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.

Inherited from

ResizingToolsPluginOptions.bordersVisible


buttonSize?

optional buttonSize: number

width/height of buttons. Defaults to 15 pixels.


canClone()?

optional canClone: (v, el) => boolean

A function that you can provide to instruct the plugin whether or not to show a clone button. The return value of this function overrides the setting of allowClone.

Parameters

v

Vertex

el

BrowserElement

Returns

boolean


canDelete()?

optional canDelete: (v, el) => boolean

A function that you can provide to instruct the plugin whether or not to show a delete button. The return value of this function overrides the setting of allowDelete.

Parameters

v

Vertex

el

BrowserElement

Returns

boolean


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

Inherited from

ResizingToolsPluginOptions.canResizeFilter


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

Inherited from

ResizingToolsPluginOptions.canRotateFilter


canShowLinkButton()?

optional canShowLinkButton: (v, el) => boolean

A function that you can provide to instruct the plugin whether or not to show a link handle. The return value of this function overrides the setting of allowLink.

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.

Inherited from

ResizingToolsPluginOptions.constrainGroups


handleOffset?

optional handleOffset: number

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

Inherited from

ResizingToolsPluginOptions.handleOffset


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

Inherited from

ResizingToolsPluginOptions.handlerFactory


handleShape?

optional handleShape: "circle" | "rectangle"

Shape of resize handles. Defaults to circle.

Inherited from

ResizingToolsPluginOptions.handleShape


handleSize?

optional handleSize: number

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

Inherited from

ResizingToolsPluginOptions.handleSize


heightAttribute?

optional heightAttribute: string

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

Inherited from

ResizingToolsPluginOptions.heightAttribute


ignoreGrid?

optional ignoreGrid: boolean

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

Inherited from

ResizingToolsPluginOptions.ignoreGrid


leftAttribute?

optional leftAttribute: string

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

Inherited from

ResizingToolsPluginOptions.leftAttribute


minimumHeight?

optional minimumHeight: number

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

Inherited from

ResizingToolsPluginOptions.minimumHeight


minimumWidth?

optional minimumWidth: number

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

Inherited from

ResizingToolsPluginOptions.minimumWidth


modelUpdater?

optional modelUpdater: ResizingToolsModelUpdater

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

Inherited from

ResizingToolsPluginOptions.modelUpdater


onDemand?

optional onDemand: boolean

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

Inherited from

ResizingToolsPluginOptions.onDemand


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

Inherited from

ResizingToolsPluginOptions.onEdit


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

Inherited from

ResizingToolsPluginOptions.payloadGenerator


resizeMethod?

optional resizeMethod: ResizingToolsResizeMethod

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

Inherited from

ResizingToolsPluginOptions.resizeMethod


resizeX?

optional resizeX: boolean

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

Inherited from

ResizingToolsPluginOptions.resizeX


resizeY?

optional resizeY: boolean

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

Inherited from

ResizingToolsPluginOptions.resizeY


rotatable?

optional rotatable: boolean

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

Inherited from

ResizingToolsPluginOptions.rotatable


rotateHandleSize?

optional rotateHandleSize: number

Size of the rotate handle. Defaults to 16 pixels.

Inherited from

ResizingToolsPluginOptions.rotateHandleSize


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.

Inherited from

ResizingToolsPluginOptions.rotateLeaderLength


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.

Inherited from

ResizingToolsPluginOptions.rotationStops


shouldDeleteGroupMembers()?

optional shouldDeleteGroupMembers: (g, el) => boolean

A function that you can provide to instruct the plugin whether or not, when removing a group, to also remove its child members. You need to return boolean true from this method in order for group members to be deleted.

Parameters

g

Group

el

BrowserElement

Returns

boolean


topAttribute?

optional topAttribute: string

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

Inherited from

ResizingToolsPluginOptions.topAttribute


widthAttribute?

optional widthAttribute: string

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

Inherited from

ResizingToolsPluginOptions.widthAttribute