#cy.boxSelectionMode()
// What the box-selection gesture counts as caught: 'contain' (default) selects only elements wholly inside the band; 'overlap' selects anything the band touches — a node whose box intersects it, an edge any part of whose drawn path crosses it.
cy.boxSelectionMode(): BoxSelectionModeWhat the box-selection gesture counts as caught: 'contain' (default) selects only elements wholly inside the band; 'overlap' selects anything the band touches — a node whose box intersects it, an edge any part of whose drawn path crosses it..
Two notes on the boundary. This setting is read by the gesture only: cy.elementsInBox() stays the pure geometric containment query it has always been, so a programmatic caller's results do not change under this setting. And boxSelectionIncludesLabels reverses sense with the mode, because it can only mean one thing in each: under 'contain' the label box must also be inside, under 'overlap' a label that crosses the band is enough.
BoxSelectionModethe current boxSelectionMode value
#cy.boxSelectionMode(mode)
// What the box-selection gesture counts as caught: 'contain' (default) selects only elements wholly inside the band; 'overlap' selects anything the band touches — a node whose box intersects it, an edge any part of whose drawn path crosses it.
cy.boxSelectionMode(mode: BoxSelectionMode): thisWhat the box-selection gesture counts as caught: 'contain' (default) selects only elements wholly inside the band; 'overlap' selects anything the band touches — a node whose box intersects it, an edge any part of whose drawn path crosses it..
Two notes on the boundary. This setting is read by the gesture only: cy.elementsInBox() stays the pure geometric containment query it has always been, so a programmatic caller's results do not change under this setting. And boxSelectionIncludesLabels reverses sense with the mode, because it can only mean one thing in each: under 'contain' the label box must also be inside, under 'overlap' a label that crosses the band is enough.
| Name | Description |
|---|---|
mode: BoxSelectionMode | the new mode |
thisthis core, for chaining
Example
const result = cy.boxSelectionMode("contain");console.log(result === cy); // trueif mode is neither 'contain' nor 'overlap'