Skip to content

cy.hasCompoundNodes()

cy.hasCompoundNodes — Core > Metadata and environment. Cytoscape.js signatures, parameters and return contract.

cy.hasCompoundNodes — Core › Metadata and environment

Preview · Core › Metadata and environment

Read in the complete API reference · All API members

// Whether any node currently has a parent
cy.hasCompoundNodes(): boolean

Whether any node currently has a parent. Worth checking because the compound tier changes paint evaluation and draw order; the renderer pays nothing for compounds while this is false.

Returns boolean

true when the graph has at least one parent/child relation

Example

console.log(cy.hasCompoundNodes()); // false

Example graph and handle setup