mbostock/d3 — pull request #1763 by mbostock (2014-03-04 16:39:34+00:00)
Title: Support custom interpolation functions.

If the target value of d3.interpolate exposes an interpolate property, use that as the interpolator rather than the default. Also define custom interpolators for colors.

This commit has two notable ramifications. First, it changes the behavior of interpolation when the target value is an instance of d3.hcl, d3.hsl or d3.lab: rather than using the RGB colorspace for interpolation, the colorspace of the target color is used. (Note that for HSL colors expressed as strings (i.e., "hsl(…)"), RGB interpolation is still used.) Second, if the target value has an "interpolate" property that is truthy but not a function, a TypeError is thrown.