d3 / d3-transition

Animated transitions for D3 selections.
https://d3js.org/d3-transition
ISC License
224 stars 65 forks source link

Reuse transition tweens & interpolators in common case. #28

Closed mbostock closed 8 years ago

mbostock commented 8 years ago

When creating interpolators in transition.style and transition.attr, we could check if the start and end values are the same as the previous node, and if so, reuse the previous interpolator. This is a very simple heuristic that would optimize the common case of selecting multiple nodes that share the same start & end values.

Likewise, when creating a tween in transition.styleTween and transition.attrTween, we could check if the current interpolator is the same instance as the previous interpolator, and if so reuse the previous tween.

mbostock commented 8 years ago

Fixed.