Skip to content

cy.reset()

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

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

// Reset the viewport to zoom 1, pan (0, 0)
cy.reset(): this

Reset the viewport to zoom 1, pan (0, 0).

Returns this

Example

cy.pan({ x: 40, y: 20 });
cy.zoom(2);
cy.reset();
cy.zoom(1);
console.log(cy.zoom()); // 1

Example graph and handle setup