Skip to content

eles.maxDegree(includeLoops?)

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

eles.maxDegree — Collection › Algorithms › Structural measures

Preview · Collection › Algorithms › Structural measures

Read in the complete API reference · All API members

// The largest total degree among the collection's nodes
eles.maxDegree(includeLoops?: boolean): number | undefined

The largest total degree among the collection's nodes.

Parameters
NameDescription
includeLoops: boolean?Default: true

whether self-loops count

Returns number | undefined

the maximum degree, or undefined when there are no nodes

Example

console.log(eles.maxDegree()); // 2

Example graph and handle setup