Skip to content

eles.collection()

eles.collection — Collection > Metadata and identity. Cytoscape.js signatures, parameters and return contract.

eles.collection — Collection › Metadata and identity

Preview · Collection › Metadata and identity

Read in the complete API reference · All API members

// Create an empty collection bound to the same core
eles.collection(): Collection<NodeData, EdgeData, Data>

Create an empty collection bound to the same core. Takes no arguments. Use union() to build a set from existing elements, or filter() to select members of this collection.

Returns Collection<NodeData, EdgeData, Data>

a fresh empty collection bound to this core — the seed for building a set up by union

Example

console.log(eles.collection().map(ele => ele.id())); // []

Example graph and handle setup

Throws

if called with any argument — use cy.add() to insert definitions or set operations to build collections