Skip to content

eles.expand(timing?)

eles.expand — Collection > Compound nodes. Cytoscape.js signatures, parameters and return contract.

eles.expand — Collection › Compound nodes

Preview · Collection › Compound nodes

Read in the complete API reference · All API members

// Restore each collapsed compound parent’s descendants by reversing its currently applied scale around the parent’s current centre
eles.expand(timing?: Pick<AnimateOptions, 'duration' | 'easing'>): this

Restore each collapsed compound parent’s descendants by reversing its currently applied scale around the parent’s current centre. Pass { duration, easing } to animate the restoration; without options, the operation is immediate.

Parameters
NameDescription
timing: Pick<AnimateOptions, 'duration' | 'easing'>?

optional animation duration and easing

Returns this

this collection, for chaining

Example

const parent = cy.add({ data: { id: 'parent' } });
cy.getElementById('a').move({ parent: 'parent' });
parent.collapse();
parent.expand();
console.log(parent.collapsed()); // false

Example graph and handle setup