Skip to content

cy.panBy(delta)

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

cy.panBy — 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

// Shift the pan by a delta
cy.panBy(delta: Position): this

Shift the pan by a delta. A no-op while panningEnabled() is false.

Parameters
NameDescription
delta: Position

the rendered-space offset to add

Fields of delta
NameDescription
x: number
y: number
Returns this

this core, for chaining

Example

cy.pan({ x: 0, y: 0 });
cy.panBy({ x: 10, y: 5 });
console.log(cy.pan()); // { x: 10, y: 5 }

Example graph and handle setup