Search code examples
memgraphdb

What is the purpose of the SIMULATION_END event in Orb?


When using Orb to draw a graph, then add nodes to the graph and render(), I find that the nodes then subsequently jump around the canvas. It's like their first position after rendering is not the correct position and it takes an event to put them into the right place.

What is the purpose of the SIMULATION_END event? Would it help me to use that event to remove this minor annoyance?


Solution

  • SIMULATION_END event ensures that you only render the graph after the simulation has completed. When you add nodes to the graph and call render(), the node's positions might not be fully calculated yet, causing the jumping effect you observe