From 93b3eb96aa7e89deb64eaa03347ab0b1b316e7e0 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Tue, 7 Jun 2016 17:57:08 -0700 Subject: [PATCH] d3-interpolate 0.9.0 --- d3-interpolate.v0.9.js | 538 +++++++++++++++++++++++++++++++++++++ d3-interpolate.v0.9.min.js | 2 + 2 files changed, 540 insertions(+) create mode 100644 d3-interpolate.v0.9.js create mode 100644 d3-interpolate.v0.9.min.js diff --git a/d3-interpolate.v0.9.js b/d3-interpolate.v0.9.js new file mode 100644 index 00000000..b0e73964 --- /dev/null +++ b/d3-interpolate.v0.9.js @@ -0,0 +1,538 @@ +// https://d3js.org/d3-interpolate/ Version 0.9.0. Copyright 2016 Mike Bostock. +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) : + typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) : + (factory((global.d3 = global.d3 || {}),global.d3)); +}(this, function (exports,d3Color) { 'use strict'; + + function basis(t1, v0, v1, v2, v3) { + var t2 = t1 * t1, t3 = t2 * t1; + return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + + (4 - 6 * t2 + 3 * t3) * v1 + + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + + t3 * v3) / 6; + } + + function basis$1(values) { + var n = values.length - 1; + return function(t) { + var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), + v1 = values[i], + v2 = values[i + 1], + v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, + v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; + } + + function basisClosed(values) { + var n = values.length; + return function(t) { + var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), + v0 = values[(i + n - 1) % n], + v1 = values[i % n], + v2 = values[(i + 1) % n], + v3 = values[(i + 2) % n]; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; + } + + function constant(x) { + return function() { + return x; + }; + } + + function linear(a, d) { + return function(t) { + return a + t * d; + }; + } + + function exponential(a, b, y) { + return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { + return Math.pow(a + t * b, y); + }; + } + + function hue(a, b) { + var d = b - a; + return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a); + } + + function gamma(y) { + return (y = +y) === 1 ? nogamma : function(a, b) { + return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a); + }; + } + + function nogamma(a, b) { + var d = b - a; + return d ? linear(a, d) : constant(isNaN(a) ? b : a); + } + + var rgb$1 = (function rgbGamma(y) { + var color = gamma(y); + + function rgb(start, end) { + var r = color((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r), + g = color(start.g, end.g), + b = color(start.b, end.b), + opacity = color(start.opacity, end.opacity); + return function(t) { + start.r = r(t); + start.g = g(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; + } + + rgb.gamma = rgbGamma; + + return rgb; + })(1); + + function rgbSpline(spline) { + return function(colors) { + var n = colors.length, + r = new Array(n), + g = new Array(n), + b = new Array(n), + i, color; + for (i = 0; i < n; ++i) { + color = d3Color.rgb(colors[i]); + r[i] = color.r || 0; + g[i] = color.g || 0; + b[i] = color.b || 0; + } + r = spline(r); + g = spline(g); + b = spline(b); + color.opacity = 1; + return function(t) { + color.r = r(t); + color.g = g(t); + color.b = b(t); + return color + ""; + }; + }; + } + + var rgbBasis = rgbSpline(basis$1); + var rgbBasisClosed = rgbSpline(basisClosed); + + function array(a, b) { + var nb = b ? b.length : 0, + na = a ? Math.min(nb, a.length) : 0, + x = new Array(nb), + c = new Array(nb), + i; + + for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); + for (; i < nb; ++i) c[i] = b[i]; + + return function(t) { + for (i = 0; i < na; ++i) c[i] = x[i](t); + return c; + }; + } + + function number(a, b) { + return a = +a, b -= a, function(t) { + return a + b * t; + }; + } + + function object(a, b) { + var i = {}, + c = {}, + k; + + if (a === null || typeof a !== "object") a = {}; + if (b === null || typeof b !== "object") b = {}; + + for (k in b) { + if (k in a) { + i[k] = value(a[k], b[k]); + } else { + c[k] = b[k]; + } + } + + return function(t) { + for (k in i) c[k] = i[k](t); + return c; + }; + } + + var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; + var reB = new RegExp(reA.source, "g"); + function zero(b) { + return function() { + return b; + }; + } + + function one(b) { + return function(t) { + return b(t) + ""; + }; + } + + function string(a, b) { + var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b + am, // current match in a + bm, // current match in b + bs, // string preceding current number in b, if any + i = -1, // index in s + s = [], // string constants and placeholders + q = []; // number interpolators + + // Coerce inputs to strings. + a = a + "", b = b + ""; + + // Interpolate pairs of numbers in a & b. + while ((am = reA.exec(a)) + && (bm = reB.exec(b))) { + if ((bs = bm.index) > bi) { // a string precedes the next number in b + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match + if (s[i]) s[i] += bm; // coalesce with previous string + else s[++i] = bm; + } else { // interpolate non-matching numbers + s[++i] = null; + q.push({i: i, x: number(am, bm)}); + } + bi = reB.lastIndex; + } + + // Add remains of b. + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + + // Special optimization for only a single match. + // Otherwise, interpolate each of the numbers and rejoin the string. + return s.length < 2 ? (q[0] + ? one(q[0].x) + : zero(b)) + : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); + } + + function value(a, b) { + var t = typeof b, c; + return b == null || t === "boolean" ? constant(b) + : (t === "number" ? number + : t === "string" ? ((c = d3Color.color(b)) ? (b = c, rgb$1) : string) + : b instanceof d3Color.color ? rgb$1 + : Array.isArray(b) ? array + : object)(a, b); + } + + function round(a, b) { + return a = +a, b -= a, function(t) { + return Math.round(a + b * t); + }; + } + + var rad2deg = 180 / Math.PI; + + var identity = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 + }; + + function decompose(a, b, c, d, e, f) { + if (a * d === b * c) return null; + + var scaleX = Math.sqrt(a * a + b * b); + a /= scaleX, b /= scaleX; + + var skewX = a * c + b * d; + c -= a * skewX, d -= b * skewX; + + var scaleY = Math.sqrt(c * c + d * d); + c /= scaleY, d /= scaleY, skewX /= scaleY; + + if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; + + return { + translateX: e, + translateY: f, + rotate: Math.atan2(b, a) * rad2deg, + skewX: Math.atan(skewX) * rad2deg, + scaleX: scaleX, + scaleY: scaleY + }; + } + + var cssNode; + var cssRoot; + var cssView; + var svgNode; + function parseCss(value) { + if (value === "none") return identity; + if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; + cssNode.style.transform = value; + value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); + cssRoot.removeChild(cssNode); + var m = value.slice(7, -1).split(","); + return decompose(+m[0], +m[1], +m[2], +m[3], +m[4], +m[5]); + } + + function parseSvg(value) { + if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); + svgNode.setAttribute("transform", value == null ? "" : value); + var m = svgNode.transform.baseVal.consolidate().matrix; + return decompose(m.a, m.b, m.c, m.d, m.e, m.f); + } + + function interpolateTransform(parse, pxComma, pxParen, degParen) { + + function pop(s) { + return s.length ? s.pop() + " " : ""; + } + + function translate(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push("translate(", null, pxComma, null, pxParen); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb || yb) { + s.push("translate(" + xb + pxComma + yb + pxParen); + } + } + + function rotate(a, b, s, q) { + if (a !== b) { + if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path + q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "rotate(" + b + degParen); + } + } + + function skewX(a, b, s, q) { + if (a !== b) { + q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "skewX(" + b + degParen); + } + } + + function scale(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push(pop(s) + "scale(", null, ",", null, ")"); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb !== 1 || yb !== 1) { + s.push(pop(s) + "scale(" + xb + "," + yb + ")"); + } + } + + return function(a, b) { + var s = [], // string constants and placeholders + q = []; // number interpolators + a = parse(a), b = parse(b); + translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); + rotate(a.rotate, b.rotate, s, q); + skewX(a.skewX, b.skewX, s, q); + scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); + a = b = null; // gc + return function(t) { + var i = -1, n = q.length, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + }; + } + + var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); + var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); + + var rho = Math.SQRT2; + var rho2 = 2; + var rho4 = 4; + var epsilon2 = 1e-12; + function cosh(x) { + return ((x = Math.exp(x)) + 1 / x) / 2; + } + + function sinh(x) { + return ((x = Math.exp(x)) - 1 / x) / 2; + } + + function tanh(x) { + return ((x = Math.exp(2 * x)) - 1) / (x + 1); + } + + // p0 = [ux0, uy0, w0] + // p1 = [ux1, uy1, w1] + function zoom(p0, p1) { + var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], + ux1 = p1[0], uy1 = p1[1], w1 = p1[2], + dx = ux1 - ux0, + dy = uy1 - uy0, + d2 = dx * dx + dy * dy, + i, + S; + + // Special case for u0 ≅ u1. + if (d2 < epsilon2) { + S = Math.log(w1 / w0) / rho; + i = function(t) { + return [ + ux0 + t * dx, + uy0 + t * dy, + w0 * Math.exp(rho * t * S) + ]; + } + } + + // General case. + else { + var d1 = Math.sqrt(d2), + b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), + b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), + r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), + r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); + S = (r1 - r0) / rho; + i = function(t) { + var s = t * S, + coshr0 = cosh(r0), + u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); + return [ + ux0 + u * dx, + uy0 + u * dy, + w0 * coshr0 / cosh(rho * s + r0) + ]; + } + } + + i.duration = S * 1000; + + return i; + } + + function hsl$1(hue) { + return function(start, end) { + var h = hue((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h), + s = nogamma(start.s, end.s), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } + } + + var hsl$2 = hsl$1(hue); + var hslLong = hsl$1(nogamma); + + function lab$1(start, end) { + var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l), + a = nogamma(start.a, end.a), + b = nogamma(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.l = l(t); + start.a = a(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; + } + + function hcl$1(hue) { + return function(start, end) { + var h = hue((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h), + c = nogamma(start.c, end.c), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.c = c(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } + } + + var hcl$2 = hcl$1(hue); + var hclLong = hcl$1(nogamma); + + function cubehelix$1(hue) { + return (function cubehelixGamma(y) { + y = +y; + + function cubehelix(start, end) { + var h = hue((start = d3Color.cubehelix(start)).h, (end = d3Color.cubehelix(end)).h), + s = nogamma(start.s, end.s), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(Math.pow(t, y)); + start.opacity = opacity(t); + return start + ""; + }; + } + + cubehelix.gamma = cubehelixGamma; + + return cubehelix; + })(1); + } + + var cubehelix$2 = cubehelix$1(hue); + var cubehelixLong = cubehelix$1(nogamma); + + function quantize(interpolate, n) { + var samples = new Array(n); + for (var i = 0; i < n; ++i) samples[i] = interpolate(i / (n - 1)); + return samples; + } + + exports.interpolate = value; + exports.interpolateArray = array; + exports.interpolateBasis = basis$1; + exports.interpolateBasisClosed = basisClosed; + exports.interpolateNumber = number; + exports.interpolateObject = object; + exports.interpolateRound = round; + exports.interpolateString = string; + exports.interpolateTransformCss = interpolateTransformCss; + exports.interpolateTransformSvg = interpolateTransformSvg; + exports.interpolateZoom = zoom; + exports.interpolateRgb = rgb$1; + exports.interpolateRgbBasis = rgbBasis; + exports.interpolateRgbBasisClosed = rgbBasisClosed; + exports.interpolateHsl = hsl$2; + exports.interpolateHslLong = hslLong; + exports.interpolateLab = lab$1; + exports.interpolateHcl = hcl$2; + exports.interpolateHclLong = hclLong; + exports.interpolateCubehelix = cubehelix$2; + exports.interpolateCubehelixLong = cubehelixLong; + exports.quantize = quantize; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); \ No newline at end of file diff --git a/d3-interpolate.v0.9.min.js b/d3-interpolate.v0.9.min.js new file mode 100644 index 00000000..ef3e4322 --- /dev/null +++ b/d3-interpolate.v0.9.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-interpolate/ Version 0.9.0. Copyright 2016 Mike Bostock. +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],n):n(t.d3=t.d3||{},t.d3)}(this,function(t,n){"use strict";function r(t,n,r,e,o){var u=t*t,a=u*t;return((1-3*t+3*u-a)*n+(4-6*u+3*a)*r+(1+3*t+3*u-3*a)*e+a*o)/6}function e(t){var n=t.length-1;return function(e){var o=0>=e?e=0:e>=1?(e=1,n-1):Math.floor(e*n),u=t[o],a=t[o+1],i=o>0?t[o-1]:2*u-a,l=n-1>o?t[o+2]:2*a-u;return r((e-o/n)*n,i,u,a,l)}}function o(t){var n=t.length;return function(e){var o=Math.floor(((e%=1)<0?++e:e)*n),u=t[(o+n-1)%n],a=t[o%n],i=t[(o+1)%n],l=t[(o+2)%n];return r((e-o/n)*n,u,a,i,l)}}function u(t){return function(){return t}}function a(t,n){return function(r){return t+r*n}}function i(t,n,r){return t=Math.pow(t,r),n=Math.pow(n,r)-t,r=1/r,function(e){return Math.pow(t+e*n,r)}}function l(t,n){var r=n-t;return r?a(t,r>180||-180>r?r-360*Math.round(r/360):r):u(isNaN(t)?n:t)}function c(t){return 1===(t=+t)?f:function(n,r){return r-n?i(n,r,t):u(isNaN(n)?r:n)}}function f(t,n){var r=n-t;return r?a(t,r):u(isNaN(t)?n:t)}function s(t){return function(r){var e,o,u=r.length,a=new Array(u),i=new Array(u),l=new Array(u);for(e=0;u>e;++e)o=n.rgb(r[e]),a[e]=o.r||0,i[e]=o.g||0,l[e]=o.b||0;return a=t(a),i=t(i),l=t(l),o.opacity=1,function(t){return o.r=a(t),o.g=i(t),o.b=l(t),o+""}}}function p(t,n){var r,e=n?n.length:0,o=t?Math.min(e,t.length):0,u=new Array(e),a=new Array(e);for(r=0;o>r;++r)u[r]=b(t[r],n[r]);for(;e>r;++r)a[r]=n[r];return function(t){for(r=0;o>r;++r)a[r]=u[r](t);return a}}function h(t,n){return t=+t,n-=t,function(r){return t+n*r}}function d(t,n){var r,e={},o={};null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={});for(r in n)r in t?e[r]=b(t[r],n[r]):o[r]=n[r];return function(t){for(r in e)o[r]=e[r](t);return o}}function g(t){return function(){return t}}function v(t){return function(n){return t(n)+""}}function y(t,n){var r,e,o,u=T.lastIndex=O.lastIndex=0,a=-1,i=[],l=[];for(t+="",n+="";(r=T.exec(t))&&(e=O.exec(n));)(o=e.index)>u&&(o=n.slice(u,o),i[a]?i[a]+=o:i[++a]=o),(r=r[0])===(e=e[0])?i[a]?i[a]+=e:i[++a]=e:(i[++a]=null,l.push({i:a,x:h(r,e)})),u=O.lastIndex;return ue;++e)i[(r=l[e]).i]=r.x(t);return i.join("")})}function b(t,r){var e,o=typeof r;return null==r||"boolean"===o?u(r):("number"===o?h:"string"===o?(e=n.color(r))?(r=e,L):y:r instanceof n.color?L:Array.isArray(r)?p:d)(t,r)}function x(t,n){return t=+t,n-=t,function(r){return Math.round(t+n*r)}}function m(t,n,r,e,o,u){if(t*e===n*r)return null;var a=Math.sqrt(t*t+n*n);t/=a,n/=a;var i=t*r+n*e;r-=t*i,e-=n*i;var l=Math.sqrt(r*r+e*e);return r/=l,e/=l,i/=l,n*r>t*e&&(t=-t,n=-n,i=-i,a=-a),{translateX:o,translateY:u,rotate:Math.atan2(n,t)*_,skewX:Math.atan(i)*_,scaleX:a,scaleY:l}}function M(t){if("none"===t)return z;I||(I=document.createElement("DIV"),S=document.documentElement,B=document.defaultView),I.style.transform=t,t=B.getComputedStyle(S.appendChild(I),null).getPropertyValue("transform"),S.removeChild(I);var n=t.slice(7,-1).split(",");return m(+n[0],+n[1],+n[2],+n[3],+n[4],+n[5])}function w(t){H||(H=document.createElementNS("http://www.w3.org/2000/svg","g")),H.setAttribute("transform",null==t?"":t);var n=H.transform.baseVal.consolidate().matrix;return m(n.a,n.b,n.c,n.d,n.e,n.f)}function X(t,n,r,e){function o(t){return t.length?t.pop()+" ":""}function u(t,e,o,u,a,i){if(t!==o||e!==u){var l=a.push("translate(",null,n,null,r);i.push({i:l-4,x:h(t,o)},{i:l-2,x:h(e,u)})}else(o||u)&&a.push("translate("+o+n+u+r)}function a(t,n,r,u){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),u.push({i:r.push(o(r)+"rotate(",null,e)-2,x:h(t,n)})):n&&r.push(o(r)+"rotate("+n+e)}function i(t,n,r,u){t!==n?u.push({i:r.push(o(r)+"skewX(",null,e)-2,x:h(t,n)}):n&&r.push(o(r)+"skewX("+n+e)}function l(t,n,r,e,u,a){if(t!==r||n!==e){var i=u.push(o(u)+"scale(",null,",",null,")");a.push({i:i-4,x:h(t,r)},{i:i-2,x:h(n,e)})}else 1===r&&1===e||u.push(o(u)+"scale("+r+","+e+")")}return function(n,r){var e=[],o=[];return n=t(n),r=t(r),u(n.translateX,n.translateY,r.translateX,r.translateY,e,o),a(n.rotate,r.rotate,e,o),i(n.skewX,r.skewX,e,o),l(n.scaleX,n.scaleY,r.scaleX,r.scaleY,e,o),n=r=null,function(t){for(var n,r=-1,u=o.length;++rp)e=Math.log(c/a)/Z,r=function(t){return[o+t*f,u+t*s,a*Math.exp(Z*t*e)]};else{var h=Math.sqrt(p),d=(c*c-a*a+G*p)/(2*a*F*h),g=(c*c-a*a-G*p)/(2*c*F*h),v=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(g*g+1)-g);e=(y-v)/Z,r=function(t){var n=t*e,r=A(v),i=a/(F*h)*(r*N(Z*n+v)-C(v));return[o+i*f,u+i*s,a*r/A(Z*n+v)]}}return r.duration=1e3*e,r}function j(t){return function(r,e){var o=t((r=n.hsl(r)).h,(e=n.hsl(e)).h),u=f(r.s,e.s),a=f(r.l,e.l),i=f(r.opacity,e.opacity);return function(t){return r.h=o(t),r.s=u(t),r.l=a(t),r.opacity=i(t),r+""}}}function q(t,r){var e=f((t=n.lab(t)).l,(r=n.lab(r)).l),o=f(t.a,r.a),u=f(t.b,r.b),a=f(t.opacity,r.opacity);return function(n){return t.l=e(n),t.a=o(n),t.b=u(n),t.opacity=a(n),t+""}}function k(t){return function(r,e){var o=t((r=n.hcl(r)).h,(e=n.hcl(e)).h),u=f(r.c,e.c),a=f(r.l,e.l),i=f(r.opacity,e.opacity);return function(t){return r.h=o(t),r.c=u(t),r.l=a(t),r.opacity=i(t),r+""}}}function R(t){return function r(e){function o(r,o){var u=t((r=n.cubehelix(r)).h,(o=n.cubehelix(o)).h),a=f(r.s,o.s),i=f(r.l,o.l),l=f(r.opacity,o.opacity);return function(t){return r.h=u(t),r.s=a(t),r.l=i(Math.pow(t,e)),r.opacity=l(t),r+""}}return e=+e,o.gamma=r,o}(1)}function E(t,n){for(var r=new Array(n),e=0;n>e;++e)r[e]=t(e/(n-1));return r}var I,S,B,H,L=function rt(t){function r(t,r){var o=e((t=n.rgb(t)).r,(r=n.rgb(r)).r),u=e(t.g,r.g),a=e(t.b,r.b),i=e(t.opacity,r.opacity);return function(n){return t.r=o(n),t.g=u(n),t.b=a(n),t.opacity=i(n),t+""}}var e=c(t);return r.gamma=rt,r}(1),V=s(e),P=s(o),T=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,O=new RegExp(T.source,"g"),_=180/Math.PI,z={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},D=X(M,"px, ","px)","deg)"),Q=X(w,", ",")",")"),Z=Math.SQRT2,F=2,G=4,J=1e-12,K=j(l),U=j(f),W=k(l),$=k(f),tt=R(l),nt=R(f);t.interpolate=b,t.interpolateArray=p,t.interpolateBasis=e,t.interpolateBasisClosed=o,t.interpolateNumber=h,t.interpolateObject=d,t.interpolateRound=x,t.interpolateString=y,t.interpolateTransformCss=D,t.interpolateTransformSvg=Q,t.interpolateZoom=Y,t.interpolateRgb=L,t.interpolateRgbBasis=V,t.interpolateRgbBasisClosed=P,t.interpolateHsl=K,t.interpolateHslLong=U,t.interpolateLab=q,t.interpolateHcl=W,t.interpolateHclLong=$,t.interpolateCubehelix=tt,t.interpolateCubehelixLong=nt,t.quantize=E,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file