cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Stop the physics simulation in neovis.js

lx2pwnd
Node Clone

I draw correctly the graph using neovis.js, but I want to stop the physics simulation. Reading the documentation, I tried to use the method stabilize() in this way

let content = new NeoVis.default(config);
content.render();
content.stabilize();

But I recieve this error:

Cannot read property 'stopSimulation' of null

What's wrong?

1 REPLY 1

Good question.  In 2023 I'm also asking it but there is not a wealth of documentation (other than api reference) on the github site.   I have been trying to use:

  neoViz = new NeoVis.default(config);
  neoViz.render();
}
neoViz.network.fit();

or

  neoViz = new NeoVis.default(config);
  neoViz.render();
  neoViz.network.fit();
}

or

 <body onload="draw(); neoViz.network.fit()" 

But I am always getting various 'Cannot read properties of undefined (reading 'network')
at (index):416:8' 

And yet with browser console open I can run neoViz.network.fit() or neoViz.network.stabilize() with no problem.   Where and how can this be run?