Skip to main content

LassoOptions

Options for a lasso

Properties​

armTimeout?​

optional armTimeout: number

Timeout in ms for autoArm long press. Defaults to 500ms.


autoArm?​

optional autoArm: boolean

Defaults to false. If true, the lasso will arm itself after a long press.


autoPan?​

optional autoPan: boolean

Defaults to true, meaning the canvas will pan automatically to track the lasso


enableInGroups?​

optional enableInGroups: boolean | "metaKey"

Optional setting for whether lasso inside groups is enabled - it is by default. Setting this to false will mean that the user cannot lasso items inside a group. Setting to "metaKey" will mean that lasso is supported inside groups if the user is holding the meta key down (ie the Window key, or Cmd on macs).


invert?​

optional invert: boolean

Set this to true to have the lasso drawn as set of overlays which mask the whole browser window except for the lassoed area.


mapToGrid()?​

optional mapToGrid: (p) => PointXY

optionally users of the lasso can impose a grid on its movement. used internally by the vertex drawing plugin.

Parameters​

p​

PointXY

Returns​

PointXY


onClick()?​

optional onClick: (p, e) => any

Will be invoked if the user does mousedown then mouseup without moving in between. Used by the vertex drawing plugin

Parameters​

p​

PointXY

e​

MouseEvent

Returns​

any