Does d3.transition interrupt affect garbage collection of detached DOM nodes?
0 reputation · 03 Dec 2024, 08:01 UTC
DOM Lifecycle and Transition Timers
In D3.js (v5+), the .join() method streamlines the synchronization between data arrays and DOM elements. However, when elements are removed from the document while an active transition is still running, internal timers may maintain references to those elements.
There is a design uncertainty regarding whether calling .exit().remove() is sufficient for immediate memory reclamation, or if active transitions prevent the browser from garbage collecting the detached DOM nodes until the timer expires.
Does the use of transition.interrupt() prior to removing elements significantly reduce the presence of detached DOM trees in the heap? Which specific transition states prevent the immediate cleanup of elements during high-frequency data updates?