I'm using cytoscape.js with the arbor layout. Is there a way to manually stop the layout rendering ? In the doc i saw a 'layoutstop' event but no way to actually stop the layout.
Thanks
I'm using cytoscape.js with the arbor layout. Is there a way to manually stop the layout rendering ? In the doc i saw a 'layoutstop' event but no way to actually stop the layout.
Thanks
Here is how I worked around the problem if someone's interested : I just put a global stop_layout var in the stableEnergy function. Ugly but it works. Yay!
var stop_layout = false;
layout_params = {
name: 'arbor',
stableEnergy: function(energy){
var e = energy;
return (e.max <= 0.5) || (e.mean <= 0.3) || stop_layout;
}
};
// Then change the stop_layout value when you want to run or stop layout processing
layoutstop
is an event to indicate that the layout has stopped running. Arbor includes a maxSimulationTime
option so you can stop the layout early: http://cytoscape.github.io/cytoscape.js/#layouts/arbor