Skip to content

API reference

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

cy.userZoomingEnabled — Core › Interaction controls

Preview · Core › Interaction controls

Read in the complete API reference · All API members

#cy.userZoomingEnabled()

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

Read whether the user may zoom by wheel or pinch. Programmatic zoom() is unaffected.

Returns boolean

the current userZoomingEnabled value

Example

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

Example graph and handle setup

#cy.userZoomingEnabled(bool)

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

Set whether the user may zoom by wheel or pinch. Programmatic zoom() is unaffected.

Parameters
NameDescription
bool: boolean

the new setting

Returns this

this core, for chaining

Example

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

Example graph and handle setup