Skip to content

eles.allAreNeighbors(other)

eles.allAreNeighbors — Collection > Comparison. Cytoscape.js signatures, parameters and return contract.

eles.allAreNeighbors — Collection › Comparison

Preview · Collection › Comparison

Read in the complete API reference · All API members

// Whether every element of other is in this collection's neighborhood
eles.allAreNeighbors(other: Collection): boolean

Whether every element of other is in this collection's neighborhood.

Parameters
NameDescription
other: Collection

the elements to test

Returns boolean

true when all of them are neighbors

Example

const other = cy.getElementById('b');
console.log(cy.getElementById('a').allAreNeighbors(other)); // true

Example graph and handle setup

Also spelled eles.allAreNeighbours.