This is my solution (hack) for fixing the incorrectly animated tree.
The issue occurs because animations are interrupted when new data comes from an API at this speed. I know I can queue the data instead but I would prefer to try without doing that (it doesn't look as stuttery).
When loading a new path, d3 seems to give you the position the source node will be upon finishing the animation instead of a transitional value.
My fix for this is to assign the id of each node as an attribute so that when a path needs to load mid animation it can directly pull the position from the node instead of the data position used by d3. This feels ugly.
Does anyone have a better fix?