Skip to content

API reference

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

cy.panningEnabled — Core › Interaction controls

Preview · Core › Interaction controls

Read in the complete API reference · All API members

#cy.panningEnabled()

// Check whether panning is enabled
cy.panningEnabled(): boolean

Read whether panning is allowed at all — programmatic pan() included. Use userPanningEnabled() to block only the gesture.

Returns boolean

the current panningEnabled value

Example

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

Example graph and handle setup

#cy.panningEnabled(bool)

// Enable or disable panning
cy.panningEnabled(bool: boolean): this

Set whether panning is allowed at all — programmatic pan() included. Use userPanningEnabled() to block only the gesture.

Parameters
NameDescription
bool: boolean

the new setting

Returns this

this core, for chaining

Example

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

Example graph and handle setup