// Pan so the given elements are centred, leaving the zoom alone
cy.center(eles?: Collection): thisPan so the given elements are centred, leaving the zoom alone. Bounds include labels, as in fit().
| Name | Description |
|---|---|
eles: Collection? | the elements to centre on; omit for the whole graph |
Returns
thisthis core, for chaining
Example
cy.center(cy.nodes());console.log(Number.isFinite(cy.pan().x)); // trueAlso spelled cy.centre.