Skip to content

cy.destroy()

cy.destroy — Core > Initialisation and lifecycle. Cytoscape.js signatures, parameters and return contract.

cy.destroy — Core › Initialisation and lifecycle

Preview · Core › Initialisation and lifecycle

Read in the complete API reference · All API members

// Tear the instance down: emit destroy, drop every listener, and release the pointer handler and the renderer (with its GPU resources)
cy.destroy(): this

Tear the instance down: emit a destroy event, drop every listener, and release the pointer handler and the renderer (with its GPU resources). Idempotent. The store is left intact but the instance must not be used afterwards.

Returns this

this core

Example

cy.destroy();
console.log(cy.destroyed()); // true

Example graph and handle setup