I'm writing a simulation demo, using d3. I'd like to show the evolution of the solution state.
If I embed the d3 rendering in the simulation loop, then the browser doesn't show anything until the end. It's busy, I suppose.
What I'd like to achieve is to do some calculating, some d3 updating, and then wait for all the transitions to complete, within the main loop.
Since the transitions are asynchronous, I can't figure out a way to wait for them.
It works to use setInterval to run the main loop, kinda, but not well.
Is there a "usual" way to do achieve the goal of lock-stepping a calculation with d3 transitions?