d3.interpolate()

d3.interpolate(a, b)

Returns an interpolator between the two arbitrary values a and b. The interpolator implementation is based on the type of the end value b, using the following algorithm:

  1. If b is null, undefined or a boolean, use the constant b.
  2. If b is a number, use interpolateNumber.
  3. If b is a color or a string coercible to a color, use interpolateRgb.
  4. If b is a date, use interpolateDate.
  5. If b is a string, use interpolateString.
  6. If b is an array, use interpolateArray.
  7. If b is coercible to a number, use interpolateNumber.
  8. Use interpolateObject.

Based on the chosen interpolator, a is coerced to the suitable corresponding type.

doc_D3_Js
2016-11-24 10:26:44
Comments
Leave a Comment

Please login to continue.