Skip to content

eles.sources()

eles.sources — Collection > Traversing > Incidence and neighbourhood. Cytoscape.js signatures, parameters and return contract.

eles.sources — Collection › Traversing › Incidence and neighbourhood

Preview · Collection › Traversing › Incidence and neighbourhood

Read in the complete API reference · All API members

// The source nodes of every edge in the collection, deduped
eles.sources(): Collection<NodeData, EdgeData, NodeData>

The source nodes of every edge in the collection, deduped.

Returns Collection<NodeData, EdgeData, NodeData>

the source nodes

Example

console.log(eles.sources().map(ele => ele.id())); // ["a","b"]

Example graph and handle setup