Skip to content

eles.edgesWith(others)

eles.edgesWith — Collection > Traversing > Edge relations. Cytoscape.js signatures, parameters and return contract.

eles.edgesWith — Collection › Traversing › Edge relations

Preview · Collection › Traversing › Edge relations

Read in the complete API reference · All API members

// The edges connecting this collection's nodes with others, in either direction
eles.edgesWith(others: Collection): Collection<NodeData, EdgeData, EdgeData>

The edges connecting this collection's nodes with others, in either direction.

Parameters
NameDescription
others: Collection

the nodes on the far side (a collection, never a selector string)

Returns Collection<NodeData, EdgeData, EdgeData>

the connecting edges

Example

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

Example graph and handle setup