Skip to content

eles.intersection(other)

eles.intersection — Collection > Building and filtering. Cytoscape.js signatures, parameters and return contract.

eles.intersection — Collection › Building and filtering

Preview · Collection › Building and filtering

Read in the complete API reference · All API members

// The elements present in both collections
eles.intersection(other: Collection): Collection<NodeData, EdgeData, Data>

The elements present in both collections.

Parameters
NameDescription
other: Collection

the collection to intersect with

Returns Collection<NodeData, EdgeData, Data>

a new collection

Example

const other = cy.getElementById('b');
console.log(cy.getElementById('a').intersection(other).map(ele => ele.id())); // []

Example graph and handle setup

Also spelled eles.intersect, eles.and.