Skip to content

ele.source()

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

eles.source — Collection › Traversing › Incidence and neighbourhood

Preview · Collection › Traversing › Incidence and neighbourhood

Read in the complete API reference · All API members

// The source node of the first edge
ele.source(): Collection<NodeData, EdgeData, NodeData>

The source node of the first edge.

Returns Collection<NodeData, EdgeData, NodeData>

the source node, or an empty collection for a non-edge

Example

console.log(cy.getElementById('ab').source().id()); // 'a'

Example graph and handle setup