Skip to content

API reference

cy.zoomingEnabled — Core > Interaction controls. Cytoscape.js signatures, parameters and return contract.

cy.zoomingEnabled — Core › Interaction controls

Preview · Core › Interaction controls

Read in the complete API reference · All API members

#cy.zoomingEnabled()

// Check whether zooming is enabled
cy.zoomingEnabled(): boolean

Read whether zooming is allowed at all — programmatic zoom() included. Use userZoomingEnabled() to block only the gesture.

Returns boolean

the current zoomingEnabled value

Example

console.log(cy.zoomingEnabled()); // true

Example graph and handle setup

#cy.zoomingEnabled(bool)

// Enable or disable zooming
cy.zoomingEnabled(bool: boolean): this

Set whether zooming is allowed at all — programmatic zoom() included. Use userZoomingEnabled() to block only the gesture.

Parameters
NameDescription
bool: boolean

the new setting

Returns this

this core, for chaining

Example

const result = cy.zoomingEnabled(true);
console.log(result === cy); // true

Example graph and handle setup