// Pan and zoom so the given elements fill the viewport
cy.fit(eles?: Collection, padding?: number): thisPan and zoom so the given elements fill the viewport.
Bounds include labels by default, so a fit never clips the text it was asked to show; edge-label terms are conservative, so a fit may slightly over-fit but never under-fits.
| Name | Description |
|---|---|
eles: Collection? | the elements to fit; omit for the whole graph |
padding: number?Default: 0 | rendered-space padding around the box |
Returns
thisthis core, for chaining