Skip to content

ele.group()

eles.group — Collection > Metadata and identity. Cytoscape.js signatures, parameters and return contract.

eles.group — Collection › Metadata and identity

Preview · Collection › Metadata and identity

Read in the complete API reference · All API members

// The first element's group
ele.group(): GroupName | undefined

The first element's group. Cached on the handle, so it stays readable after removal.

Returns GroupName | undefined

'nodes' or 'edges', or undefined when empty

Example

console.log(eles.group()); // "nodes"

Example graph and handle setup