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 rendering of vis.js graph

Does anyone have enough experience with vis.js to know how to stop the nodes from continually trying to update? I have played around with the physics and stabilization settings to no avail. There are less than 1000 nodes.

4 REPLIES 4

You should be able to use stopSimulation() to turn off the physics. I can't recall but there may be events which restart the simulation, like dragging a node.

Is the model never stabilizing, or is the simulation restarting after it has stabilized?

https://visjs.github.io/vis-network/docs/network/#methodPhysics

Best,
ABK

The model never seems to stabilize. If I use the stopSimulation, it does stop moving, but then I can't move the nodes around. I left it running for 10 minutes and part of the graph never stops moving.

Ah, I see. Stabilizing graph physics can be tricky. When developing Bloom, we had often stumbled across pathological cases where the physics creates all kinds of strange motion. Odd behavior occurs because of how the graph is interconnected and can happen even with relatively small graphs.

@jens.oknelid Do you have any tips or tricks which you could share?

-ABK

I don't have any super concrete tips without seeing what the physics is actually doing. In the past where we have had situations with nodes bouncing back and forth (like a spring that never stops) and never coming to a stop it helped with reducing the spring force of the relationships and increasing the friction. It could also help tweaking the starting positions of the nodes if that's possible to do with visjs (try making them start further apart or sort them in some way so that the forces generated in the beginning are less extreme)