// Re-measure the container, redraw and emit 'resize' (the redraw is a no-op when headless; the event still fires)
cy.resize(): thisRe-measure the container, redraw and emit a resize event (the redraw is a no-op when headless; the event still fires).
Rarely needed: a ResizeObserver on the container re-measures on every size change and emits a resize event itself — once per change, and not again for a change this call already applied — so container size changes are handled automatically. Call it where no observer exists or none can see the change.
thisthis core
Example
// After the graph container changes size, refresh viewport dimensions.cy.resize();console.log(cy.width() > 0); // trueAlso spelled cy.invalidateSize.