d3 / d3-transition

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

transition.{attr,style} should use interpolateNumber if the target value is a number. #87

Closed mbostock closed 5 years ago

mbostock commented 5 years ago

67 fixed the short-circuit comparison when transition.attr or transition.style is passed a constant, but changed the interpolator to use interpolateString rather than interpolateNumber. (And I don’t recall my reasoning in https://github.com/d3/d3-transition/pull/67#issuecomment-345290841, since the interpolator is chosen based on the target value, not the current value.) We should still use interpolateNumber if the target value is a number.