Skip to content

ele.indegree(includeLoops?)

eles.indegree — Collection > Algorithms > Structural measures. Cytoscape.js signatures, parameters and return contract.

eles.indegree — Collection › Algorithms › Structural measures

Preview · Collection › Algorithms › Structural measures

Read in the complete API reference · All API members

// The first element's in-degree, in O(1)
ele.indegree(includeLoops?: boolean): number | undefined

The first element's in-degree, in O(1). Singular, like degree().

Parameters
NameDescription
includeLoops: boolean?Default: true

whether self-loops count

Returns number | undefined

the in-degree, or undefined when not a live node

Example

console.log(eles.indegree()); // 0

Example graph and handle setup