Skip to content

API reference

cy.removeData — Core > Data and scratch. Cytoscape.js signatures, parameters and return contract.

cy.removeData — Core › Data and scratch

Preview · Core › Data and scratch

Read in the complete API reference · All API members

#cy.removeData()

// Remove all keys
cy.removeData(): this

Delete graph-level data keys. Emits a data event when anything was removed.

Returns this

this core, for chaining

Example

cy.data('temporary', 1);
cy.removeData();
console.log(cy.data('temporary')); // undefined

Example graph and handle setup

#cy.removeData(names)

// Remove the specified keys
cy.removeData(names: string): this

Delete graph-level data keys. Emits a data event when anything was removed.

Parameters
NameDescription
names: string

space-separated key names; omit to clear everything

Returns this

this core, for chaining

Example

cy.data('temporary', 1);
cy.removeData('temporary');
console.log(cy.data('temporary')); // undefined

Example graph and handle setup

Also spelled cy.removeAttr.