// Live, visible elements contained in the model-coordinate box (corners in any order): the box-selection query, answered by one columnar scan
cy.elementsInBox(x1: number, y1: number, x2: number, y2: number): Collection<NodeData, EdgeData>Live, visible elements contained in the model-coordinate box (corners in any order): the box-selection query, answered by one columnar scan. Nodes count when their bounding box lies fully inside; edges when both endpoint node centers do (straight-edge endpoints are taken at the node centers).
boxSelectionMode does not reach here: this stays the pure geometric containment query whatever the gesture is set to. For the overlap question, boxSelectionMode( 'overlap') and drag a box, or test intersection yourself against eles.boundingBox(). (boxSelectionIncludesLabels is the one interaction setting that does reach here: with it on, a node's label box must be contained too.)
| Name | Description |
|---|---|
x1: number | one corner's model x |
y1: number | that corner's model y |
x2: number | the opposite corner's model x |
y2: number | that corner's model y |
Collection<NodeData, EdgeData>the contained elements