A reusable transition function stores shared animation parameters once, then applies them to multiple D3 selections. This keeps enter and exit transitions consistent while reducing repetition. section 7.4.3
Build one transition and reuse it:
- Create a transition with d3.transition(). section 7.4.3
- Pass the saved transition to transition(t) for both enter and exit selections. section 7.4.3
Consistent chart updates
Declare const t = d3.transition().duration(800).ease(d3.easeExpOut), then call enter.transition(t) and exit.transition(t) while updating the circles.
