Skip to content

layout.stop()

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

layout.stop — Layouts › Layout handle

Preview · Layouts › Layout handle

Read in the complete API reference · All API members

// Ask the layout to stop early, by calling the impl's optional stop()
layout.stop(): this

Ask the layout to stop early, by calling the impl's optional stop(). An impl without one simply runs to completion. Once the impl has settled and only its finisher tween is in flight, the tween stops where it got to and layoutstop fires now, as a built-in's stop() does.

Returns this

this layout, for chaining

Example

layout.run();
layout.stop();
await layout.promise();
console.log(cy.nodes().length); // 3

Example graph and handle setup