Skip to content

API reference

cy.maxZoom — Core > Viewport manipulation > Pan, zoom, fit and bounds. Cytoscape.js signatures, parameters and return contract.

cy.maxZoom — Core › Viewport manipulation › Pan, zoom, fit and bounds

Preview · Core › Viewport manipulation › Pan, zoom, fit and bounds

Read in the complete API reference · All API members

#cy.maxZoom()

// Get the maximum zoom, or set it
cy.maxZoom(): number

Get the maximum zoom, or set it. Setting re-clamps the current zoom.

Returns number

the current maxZoom value

Example

console.log(cy.maxZoom()); // 1e+50

Example graph and handle setup

#cy.maxZoom(zoom)

// Get the maximum zoom, or set it
cy.maxZoom(zoom: number): this

Get the maximum zoom, or set it. Setting re-clamps the current zoom.

Parameters
NameDescription
zoom: number

the new maximum

Returns this

this core, for chaining

Example

const result = cy.maxZoom(1e+50);
console.log(result === cy); // true

Example graph and handle setup