d3 / d3-interpolate

Interpolate numbers, colors, strings, arrays, objects, whatever!
https://d3js.org/d3-interpolate
ISC License
494 stars 69 forks source link

Interpolation of objects without prototype results in error #35

Closed devgru closed 7 years ago

devgru commented 7 years ago

Calling interpolate with objects without prototype:

var a = Object.create(null);
a.value = 0;
var b = Object.create(null);
b.value = 10;
var interpolator = interpolate(a, b)

results in error:

TypeError: Cannot convert object to primitive value
    at isNaN (native)

I've created pull request to fix this: https://github.com/d3/d3-interpolate/pull/34

mbostock commented 7 years ago

Fixed in #34.