Skip to content

API reference

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

cy.userPanningEnabled — Core › Interaction controls

Preview · Core › Interaction controls

Read in the complete API reference · All API members

#cy.userPanningEnabled()

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

Read whether the user may pan by dragging. Programmatic pan() is unaffected.

Returns boolean

the current userPanningEnabled value

Example

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

Example graph and handle setup

#cy.userPanningEnabled(bool)

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

Set whether the user may pan by dragging. Programmatic pan() is unaffected.

Parameters
NameDescription
bool: boolean

the new setting

Returns this

this core, for chaining

Example

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

Example graph and handle setup