Skip to main content

LassoPluginOptions

Extends​

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.


autoExit?​

optional autoExit: boolean

When true (which is the default) the lasso exits after a selection has been made.


cssClass?​

optional cssClass: string

Extra class(es) to add to the lasso's DOM element


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).


filter?​

optional filter: string | (e) => boolean

Optional CSS3 filter identifying elements you do not want to lasso


generateLassoContent()?​

optional generateLassoContent: (origin, e) => BrowserElement

Optional function that generates the DOM element for the lasso to use. This is for advanced usage scenarios and most users will not need to supply this. Applies only to rectangular lasso; freehand and polygon use a built-in SVG path styled with the lasso CSS variables/classes.

Parameters​

origin​

PointXY

e​

MouseEvent

Returns​

BrowserElement


includeEdges?​

optional includeEdges: boolean

Defaults to false. If true, edges are included in the lasso selection.


invert?​

optional invert: boolean

Defaults to false. If true, shade outside the selected region instead of inside it.


onEnd?​

optional onEnd: Function

Optional function to call when lasso selection ends. Polygon gestures supply {shape:"polygon", cancelled:boolean} for completion or cancellation.


onSelect()?​

optional onSelect: (vertices) => any

Optional function to call when one or more objects has been selected by the lasso.

Parameters​

vertices​

Vertex[]

Returns​

any


onStart?​

optional onStart: Function

Optional function to call when lasso selection starts.


selectionFilter()?​

optional selectionFilter: (o) => boolean

Optional filter that is passed every vertex/edge that the lasso would ordinarily select, and if this function returns false then the vertex/edge is not added to the selection

Parameters​

o​

Edge or Vertex to possibly filter.

Edge | Vertex

Returns​

boolean


shape?​

optional shape: LassoShape

Selection shape. Defaults to "rectangle". "freehand" draws continuously; "polygon" adds vertices on clicks and completes with double-click or Enter.


simplificationTolerance?​

optional simplificationTolerance: number

Corner-preserving freehand simplification tolerance in screen pixels. Defaults to 1. Must be finite and non-negative; 0 disables simplification. Details smaller than this tolerance may disappear.