Skip to content

layout.reheat(alpha?)

layout.reheat — Layouts > Layout handle. Cytoscape.js signatures, parameters and return contract.

layout.reheat — Layouts › Layout handle

Preview · Layouts › Layout handle

Read in the complete API reference · All API members

// Heat a running layout back up (118.3), by calling the impl's optional reheat()
layout.reheat(alpha?: number): this

Heat a running layout back up (118.3), by calling the impl's optional reheat(). A force layout's infinite run ticks only while its field is moving and reheats itself on a drag, a moved node and an added or removed element; this is for a change it cannot see — an edge length that changed under a data mapping, a style that resized the boxes. An impl without one ignores it.

Parameters
NameDescription
alpha: number?

the temperature to restore; the force layout's default is 0.3, d3's drag convention

Returns this

this layout, for chaining

Example

const force = cy.layout({ name: 'force', infinite: true, executor: 'cpu' });
force.run();
force.reheat(0.5);
force.stop();
await force.promise();
console.log(cy.nodes().length); // 3

Example graph and handle setup