Comparing version 2.2.1 to 2.2.2
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-scale/ v2.2.1 Copyright 2019 Mike Bostock | ||
// https://d3js.org/d3-scale/ v2.2.2 Copyright 2019 Mike Bostock | ||
(function (global, factory) { | ||
@@ -1111,2 +1111,12 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-collection'), require('d3-array'), require('d3-interpolate'), require('d3-format'), require('d3-time'), require('d3-time-format')) : | ||
function divergingSymlog() { | ||
var scale = symlogish(transformer$2()); | ||
scale.copy = function() { | ||
return copy$1(scale, divergingSymlog()).constant(scale.constant()); | ||
}; | ||
return initInterpolator.apply(scale, arguments); | ||
} | ||
function divergingPow() { | ||
@@ -1151,2 +1161,3 @@ var scale = powish(transformer$2()); | ||
exports.scaleDivergingSqrt = divergingSqrt; | ||
exports.scaleDivergingSymlog = divergingSymlog; | ||
exports.tickFormat = tickFormat; | ||
@@ -1153,0 +1164,0 @@ |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-scale/ v2.2.1 Copyright 2019 Mike Bostock | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-collection"),require("d3-array"),require("d3-interpolate"),require("d3-format"),require("d3-time"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","d3-collection","d3-array","d3-interpolate","d3-format","d3-time","d3-time-format"],t):t(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3,n.d3,n.d3)}(this,function(n,t,e,r,u,i,o){"use strict";function a(n,t){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(t).domain(n)}return this}function c(n,t){switch(arguments.length){case 0:break;case 1:this.interpolator(n);break;default:this.interpolator(t).domain(n)}return this}var l=Array.prototype,f=l.map,p=l.slice,h={name:"implicit"};function s(){var n=t.map(),e=[],r=[],u=h;function i(t){var i=t+"",o=n.get(i);if(!o){if(u!==h)return u;n.set(i,o=e.push(t))}return r[(o-1)%r.length]}return i.domain=function(r){if(!arguments.length)return e.slice();e=[],n=t.map();for(var u,o,a=-1,c=r.length;++a<c;)n.has(o=(u=r[a])+"")||n.set(o,e.push(u));return i},i.range=function(n){return arguments.length?(r=p.call(n),i):r.slice()},i.unknown=function(n){return arguments.length?(u=n,i):u},i.copy=function(){return s(e,r).unknown(u)},a.apply(i,arguments),i}function g(){var n,t,r=s().unknown(void 0),u=r.domain,i=r.range,o=[0,1],c=!1,l=0,f=0,p=.5;function h(){var r=u().length,a=o[1]<o[0],h=o[a-0],s=o[1-a];n=(s-h)/Math.max(1,r-l+2*f),c&&(n=Math.floor(n)),h+=(s-h-n*(r-l))*p,t=n*(1-l),c&&(h=Math.round(h),t=Math.round(t));var g=e.range(r).map(function(t){return h+n*t});return i(a?g.reverse():g)}return delete r.unknown,r.domain=function(n){return arguments.length?(u(n),h()):u()},r.range=function(n){return arguments.length?(o=[+n[0],+n[1]],h()):o.slice()},r.rangeRound=function(n){return o=[+n[0],+n[1]],c=!0,h()},r.bandwidth=function(){return t},r.step=function(){return n},r.round=function(n){return arguments.length?(c=!!n,h()):c},r.padding=function(n){return arguments.length?(l=Math.min(1,f=+n),h()):l},r.paddingInner=function(n){return arguments.length?(l=Math.min(1,n),h()):l},r.paddingOuter=function(n){return arguments.length?(f=+n,h()):f},r.align=function(n){return arguments.length?(p=Math.max(0,Math.min(1,n)),h()):p},r.copy=function(){return g(u(),o).round(c).paddingInner(l).paddingOuter(f).align(p)},a.apply(h(),arguments)}function d(n){return+n}var m=[0,1];function v(n){return n}function M(n,t){return(t-=n=+n)?function(e){return(e-n)/t}:(e=isNaN(t)?NaN:.5,function(){return e});var e}function y(n){var t,e=n[0],r=n[n.length-1];return e>r&&(t=e,e=r,r=t),function(n){return Math.max(e,Math.min(r,n))}}function k(n,t,e){var r=n[0],u=n[1],i=t[0],o=t[1];return u<r?(r=M(u,r),i=e(o,i)):(r=M(r,u),i=e(i,o)),function(n){return i(r(n))}}function w(n,t,r){var u=Math.min(n.length,t.length)-1,i=new Array(u),o=new Array(u),a=-1;for(n[u]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++a<u;)i[a]=M(n[a],n[a+1]),o[a]=r(t[a],t[a+1]);return function(t){var r=e.bisect(n,t,1,u)-1;return o[r](i[r](t))}}function x(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function N(){var n,t,e,u,i,o,a=m,c=m,l=r.interpolate,h=v;function s(){return u=Math.min(a.length,c.length)>2?w:k,i=o=null,g}function g(t){return isNaN(t=+t)?e:(i||(i=u(a.map(n),c,l)))(n(h(t)))}return g.invert=function(e){return h(t((o||(o=u(c,a.map(n),r.interpolateNumber)))(e)))},g.domain=function(n){return arguments.length?(a=f.call(n,d),h===v||(h=y(a)),s()):a.slice()},g.range=function(n){return arguments.length?(c=p.call(n),s()):c.slice()},g.rangeRound=function(n){return c=p.call(n),l=r.interpolateRound,s()},g.clamp=function(n){return arguments.length?(h=n?y(a):v,g):h!==v},g.interpolate=function(n){return arguments.length?(l=n,s()):l},g.unknown=function(n){return arguments.length?(e=n,g):e},function(e,r){return n=e,t=r,s()}}function b(n,t){return N()(n,t)}function q(n,t,r,i){var o,a=e.tickStep(n,t,r);switch((i=u.formatSpecifier(null==i?",f":i)).type){case"s":var c=Math.max(Math.abs(n),Math.abs(t));return null!=i.precision||isNaN(o=u.precisionPrefix(a,c))||(i.precision=o),u.formatPrefix(i,c);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=u.precisionRound(a,Math.max(Math.abs(n),Math.abs(t))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=u.precisionFixed(a))||(i.precision=o-2*("%"===i.type))}return u.format(i)}function S(n){var t=n.domain;return n.ticks=function(n){var r=t();return e.ticks(r[0],r[r.length-1],null==n?10:n)},n.tickFormat=function(n,e){var r=t();return q(r[0],r[r.length-1],null==n?10:n,e)},n.nice=function(r){null==r&&(r=10);var u,i=t(),o=0,a=i.length-1,c=i[o],l=i[a];return l<c&&(u=c,c=l,l=u,u=o,o=a,a=u),(u=e.tickIncrement(c,l,r))>0?(c=Math.floor(c/u)*u,l=Math.ceil(l/u)*u,u=e.tickIncrement(c,l,r)):u<0&&(c=Math.ceil(c*u)/u,l=Math.floor(l*u)/u,u=e.tickIncrement(c,l,r)),u>0?(i[o]=Math.floor(c/u)*u,i[a]=Math.ceil(l/u)*u,t(i)):u<0&&(i[o]=Math.ceil(c*u)/u,i[a]=Math.floor(l*u)/u,t(i)),n},n}function D(n,t){var e,r=0,u=(n=n.slice()).length-1,i=n[r],o=n[u];return o<i&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function I(n){return Math.log(n)}function O(n){return Math.exp(n)}function F(n){return-Math.log(-n)}function P(n){return-Math.exp(-n)}function A(n){return isFinite(n)?+("1e"+n):n<0?0:n}function E(n){return function(t){return-n(-t)}}function L(n){var t,r,i=n(I,O),o=i.domain,a=10;function c(){return t=function(n){return n===Math.E?Math.log:10===n&&Math.log10||2===n&&Math.log2||(n=Math.log(n),function(t){return Math.log(t)/n})}(a),r=function(n){return 10===n?A:n===Math.E?Math.exp:function(t){return Math.pow(n,t)}}(a),o()[0]<0?(t=E(t),r=E(r),n(F,P)):n(I,O),i}return i.base=function(n){return arguments.length?(a=+n,c()):a},i.domain=function(n){return arguments.length?(o(n),c()):o()},i.ticks=function(n){var u,i=o(),c=i[0],l=i[i.length-1];(u=l<c)&&(s=c,c=l,l=s);var f,p,h,s=t(c),g=t(l),d=null==n?10:+n,m=[];if(!(a%1)&&g-s<d){if(s=Math.round(s)-1,g=Math.round(g)+1,c>0){for(;s<g;++s)for(p=1,f=r(s);p<a;++p)if(!((h=f*p)<c)){if(h>l)break;m.push(h)}}else for(;s<g;++s)for(p=a-1,f=r(s);p>=1;--p)if(!((h=f*p)<c)){if(h>l)break;m.push(h)}}else m=e.ticks(s,g,Math.min(g-s,d)).map(r);return u?m.reverse():m},i.tickFormat=function(n,e){if(null==e&&(e=10===a?".0e":","),"function"!=typeof e&&(e=u.format(e)),n===1/0)return e;null==n&&(n=10);var o=Math.max(1,a*n/i.ticks().length);return function(n){var u=n/r(Math.round(t(n)));return u*a<a-.5&&(u*=a),u<=o?e(n):""}},i.nice=function(){return o(D(o(),{floor:function(n){return r(Math.floor(t(n)))},ceil:function(n){return r(Math.ceil(t(n)))}}))},i}function R(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function T(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function Q(n){var t=1,e=n(R(t),T(t));return e.constant=function(e){return arguments.length?n(R(t=+e),T(t)):t},S(e)}function U(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function Y(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function j(n){return n<0?-n*n:n*n}function B(n){var t=n(v,v),e=1;return t.exponent=function(t){return arguments.length?1===(e=+t)?n(v,v):.5===e?n(Y,j):n(U(e),U(1/e)):e},S(t)}function C(){var n=B(N());return n.copy=function(){return x(n,C()).exponent(n.exponent())},a.apply(n,arguments),n}var H=1e3,W=60*H,_=60*W,z=24*_,G=7*z,J=30*z,K=365*z;function V(n){return new Date(n)}function X(n){return n instanceof Date?+n:+new Date(+n)}function Z(n,t,r,u,i,o,a,c,l){var p=b(v,v),h=p.invert,s=p.domain,g=l(".%L"),d=l(":%S"),m=l("%I:%M"),M=l("%I %p"),y=l("%a %d"),k=l("%b %d"),w=l("%B"),N=l("%Y"),q=[[a,1,H],[a,5,5*H],[a,15,15*H],[a,30,30*H],[o,1,W],[o,5,5*W],[o,15,15*W],[o,30,30*W],[i,1,_],[i,3,3*_],[i,6,6*_],[i,12,12*_],[u,1,z],[u,2,2*z],[r,1,G],[t,1,J],[t,3,3*J],[n,1,K]];function S(e){return(a(e)<e?g:o(e)<e?d:i(e)<e?m:u(e)<e?M:t(e)<e?r(e)<e?y:k:n(e)<e?w:N)(e)}function I(t,r,u,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(u-r)/t,a=e.bisector(function(n){return n[2]}).right(q,o);a===q.length?(i=e.tickStep(r/K,u/K,t),t=n):a?(i=(a=q[o/q[a-1][2]<q[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(e.tickStep(r,u,t),1),t=c)}return null==i?t:t.every(i)}return p.invert=function(n){return new Date(h(n))},p.domain=function(n){return arguments.length?s(f.call(n,X)):s().map(V)},p.ticks=function(n,t){var e,r=s(),u=r[0],i=r[r.length-1],o=i<u;return o&&(e=u,u=i,i=e),e=(e=I(n,u,i,t))?e.range(u,i+1):[],o?e.reverse():e},p.tickFormat=function(n,t){return null==t?S:l(t)},p.nice=function(n,t){var e=s();return(n=I(n,e[0],e[e.length-1],t))?s(D(e,n)):p},p.copy=function(){return x(p,Z(n,t,r,u,i,o,a,c,l))},p}function $(){var n,t,e,r,u,i=0,o=1,a=v,c=!1;function l(t){return isNaN(t=+t)?u:a(0===e?.5:(t=(r(t)-n)*e,c?Math.max(0,Math.min(1,t)):t))}return l.domain=function(u){return arguments.length?(n=r(i=+u[0]),t=r(o=+u[1]),e=n===t?0:1/(t-n),l):[i,o]},l.clamp=function(n){return arguments.length?(c=!!n,l):c},l.interpolator=function(n){return arguments.length?(a=n,l):a},l.unknown=function(n){return arguments.length?(u=n,l):u},function(u){return r=u,n=u(i),t=u(o),e=n===t?0:1/(t-n),l}}function nn(n,t){return t.domain(n.domain()).interpolator(n.interpolator()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=B($());return n.copy=function(){return nn(n,tn()).exponent(n.exponent())},c.apply(n,arguments)}function en(){var n,t,e,r,u,i,o,a=0,c=.5,l=1,f=v,p=!1;function h(n){return isNaN(n=+n)?o:(n=.5+((n=+i(n))-t)*(n<t?r:u),f(p?Math.max(0,Math.min(1,n)):n))}return h.domain=function(o){return arguments.length?(n=i(a=+o[0]),t=i(c=+o[1]),e=i(l=+o[2]),r=n===t?0:.5/(t-n),u=t===e?0:.5/(e-t),h):[a,c,l]},h.clamp=function(n){return arguments.length?(p=!!n,h):p},h.interpolator=function(n){return arguments.length?(f=n,h):f},h.unknown=function(n){return arguments.length?(o=n,h):o},function(o){return i=o,n=o(a),t=o(c),e=o(l),r=n===t?0:.5/(t-n),u=t===e?0:.5/(e-t),h}}function rn(){var n=B(en());return n.copy=function(){return nn(n,rn()).exponent(n.exponent())},c.apply(n,arguments)}n.scaleBand=g,n.scalePoint=function(){return function n(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return n(e())},t}(g.apply(null,arguments).paddingInner(1))},n.scaleIdentity=function n(t){var e;function r(n){return isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=f.call(n,d),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return n(t).unknown(e)},t=arguments.length?f.call(t,d):[0,1],S(r)},n.scaleLinear=function n(){var t=b(v,v);return t.copy=function(){return x(t,n())},a.apply(t,arguments),S(t)},n.scaleLog=function n(){var t=L(N()).domain([1,10]);return t.copy=function(){return x(t,n()).base(t.base())},a.apply(t,arguments),t},n.scaleSymlog=function n(){var t=Q(N());return t.copy=function(){return x(t,n()).constant(t.constant())},a.apply(t,arguments)},n.scaleOrdinal=s,n.scaleImplicit=h,n.scalePow=C,n.scaleSqrt=function(){return C.apply(null,arguments).exponent(.5)},n.scaleQuantile=function n(){var t,r=[],u=[],i=[];function o(){var n=0,t=Math.max(1,u.length);for(i=new Array(t-1);++n<t;)i[n-1]=e.quantile(r,n/t);return c}function c(n){return isNaN(n=+n)?t:u[e.bisect(i,n)]}return c.invertExtent=function(n){var t=u.indexOf(n);return t<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]},c.domain=function(n){if(!arguments.length)return r.slice();r=[];for(var t,u=0,i=n.length;u<i;++u)null==(t=n[u])||isNaN(t=+t)||r.push(t);return r.sort(e.ascending),o()},c.range=function(n){return arguments.length?(u=p.call(n),o()):u.slice()},c.unknown=function(n){return arguments.length?(t=n,c):t},c.quantiles=function(){return i.slice()},c.copy=function(){return n().domain(r).range(u).unknown(t)},a.apply(c,arguments)},n.scaleQuantize=function n(){var t,r=0,u=1,i=1,o=[.5],c=[0,1];function l(n){return n<=n?c[e.bisect(o,n,0,i)]:t}function f(){var n=-1;for(o=new Array(i);++n<i;)o[n]=((n+1)*u-(n-i)*r)/(i+1);return l}return l.domain=function(n){return arguments.length?(r=+n[0],u=+n[1],f()):[r,u]},l.range=function(n){return arguments.length?(i=(c=p.call(n)).length-1,f()):c.slice()},l.invertExtent=function(n){var t=c.indexOf(n);return t<0?[NaN,NaN]:t<1?[r,o[0]]:t>=i?[o[i-1],u]:[o[t-1],o[t]]},l.unknown=function(n){return arguments.length?(t=n,l):l},l.thresholds=function(){return o.slice()},l.copy=function(){return n().domain([r,u]).range(c).unknown(t)},a.apply(S(l),arguments)},n.scaleThreshold=function n(){var t,r=[.5],u=[0,1],i=1;function o(n){return n<=n?u[e.bisect(r,n,0,i)]:t}return o.domain=function(n){return arguments.length?(r=p.call(n),i=Math.min(r.length,u.length-1),o):r.slice()},o.range=function(n){return arguments.length?(u=p.call(n),i=Math.min(r.length,u.length-1),o):u.slice()},o.invertExtent=function(n){var t=u.indexOf(n);return[r[t-1],r[t]]},o.unknown=function(n){return arguments.length?(t=n,o):t},o.copy=function(){return n().domain(r).range(u).unknown(t)},a.apply(o,arguments)},n.scaleTime=function(){return a.apply(Z(i.timeYear,i.timeMonth,i.timeWeek,i.timeDay,i.timeHour,i.timeMinute,i.timeSecond,i.timeMillisecond,o.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},n.scaleUtc=function(){return a.apply(Z(i.utcYear,i.utcMonth,i.utcWeek,i.utcDay,i.utcHour,i.utcMinute,i.utcSecond,i.utcMillisecond,o.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},n.scaleSequential=function n(){var t=S($()(v));return t.copy=function(){return nn(t,n())},c.apply(t,arguments)},n.scaleSequentialLog=function n(){var t=L($()).domain([1,10]);return t.copy=function(){return nn(t,n()).base(t.base())},c.apply(t,arguments)},n.scaleSequentialPow=tn,n.scaleSequentialSqrt=function(){return tn.apply(null,arguments).exponent(.5)},n.scaleSequentialSymlog=function n(){var t=Q($());return t.copy=function(){return nn(t,n()).constant(t.constant())},c.apply(t,arguments)},n.scaleSequentialQuantile=function n(){var t=[],r=v;function u(n){if(!isNaN(n=+n))return r((e.bisect(t,n)-1)/(t.length-1))}return u.domain=function(n){if(!arguments.length)return t.slice();t=[];for(var r,i=0,o=n.length;i<o;++i)null==(r=n[i])||isNaN(r=+r)||t.push(r);return t.sort(e.ascending),u},u.interpolator=function(n){return arguments.length?(r=n,u):r},u.copy=function(){return n(r).domain(t)},c.apply(u,arguments)},n.scaleDiverging=function n(){var t=S(en()(v));return t.copy=function(){return nn(t,n())},c.apply(t,arguments)},n.scaleDivergingLog=function n(){var t=L(en()).domain([.1,1,10]);return t.copy=function(){return nn(t,n()).base(t.base())},c.apply(t,arguments)},n.scaleDivergingPow=rn,n.scaleDivergingSqrt=function(){return rn.apply(null,arguments).exponent(.5)},n.tickFormat=q,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-scale/ v2.2.2 Copyright 2019 Mike Bostock | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-collection"),require("d3-array"),require("d3-interpolate"),require("d3-format"),require("d3-time"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","d3-collection","d3-array","d3-interpolate","d3-format","d3-time","d3-time-format"],t):t(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3,n.d3,n.d3)}(this,function(n,t,e,r,u,i,o){"use strict";function a(n,t){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(t).domain(n)}return this}function c(n,t){switch(arguments.length){case 0:break;case 1:this.interpolator(n);break;default:this.interpolator(t).domain(n)}return this}var l=Array.prototype,f=l.map,p=l.slice,h={name:"implicit"};function s(){var n=t.map(),e=[],r=[],u=h;function i(t){var i=t+"",o=n.get(i);if(!o){if(u!==h)return u;n.set(i,o=e.push(t))}return r[(o-1)%r.length]}return i.domain=function(r){if(!arguments.length)return e.slice();e=[],n=t.map();for(var u,o,a=-1,c=r.length;++a<c;)n.has(o=(u=r[a])+"")||n.set(o,e.push(u));return i},i.range=function(n){return arguments.length?(r=p.call(n),i):r.slice()},i.unknown=function(n){return arguments.length?(u=n,i):u},i.copy=function(){return s(e,r).unknown(u)},a.apply(i,arguments),i}function g(){var n,t,r=s().unknown(void 0),u=r.domain,i=r.range,o=[0,1],c=!1,l=0,f=0,p=.5;function h(){var r=u().length,a=o[1]<o[0],h=o[a-0],s=o[1-a];n=(s-h)/Math.max(1,r-l+2*f),c&&(n=Math.floor(n)),h+=(s-h-n*(r-l))*p,t=n*(1-l),c&&(h=Math.round(h),t=Math.round(t));var g=e.range(r).map(function(t){return h+n*t});return i(a?g.reverse():g)}return delete r.unknown,r.domain=function(n){return arguments.length?(u(n),h()):u()},r.range=function(n){return arguments.length?(o=[+n[0],+n[1]],h()):o.slice()},r.rangeRound=function(n){return o=[+n[0],+n[1]],c=!0,h()},r.bandwidth=function(){return t},r.step=function(){return n},r.round=function(n){return arguments.length?(c=!!n,h()):c},r.padding=function(n){return arguments.length?(l=Math.min(1,f=+n),h()):l},r.paddingInner=function(n){return arguments.length?(l=Math.min(1,n),h()):l},r.paddingOuter=function(n){return arguments.length?(f=+n,h()):f},r.align=function(n){return arguments.length?(p=Math.max(0,Math.min(1,n)),h()):p},r.copy=function(){return g(u(),o).round(c).paddingInner(l).paddingOuter(f).align(p)},a.apply(h(),arguments)}function d(n){return+n}var m=[0,1];function v(n){return n}function M(n,t){return(t-=n=+n)?function(e){return(e-n)/t}:(e=isNaN(t)?NaN:.5,function(){return e});var e}function y(n){var t,e=n[0],r=n[n.length-1];return e>r&&(t=e,e=r,r=t),function(n){return Math.max(e,Math.min(r,n))}}function k(n,t,e){var r=n[0],u=n[1],i=t[0],o=t[1];return u<r?(r=M(u,r),i=e(o,i)):(r=M(r,u),i=e(i,o)),function(n){return i(r(n))}}function w(n,t,r){var u=Math.min(n.length,t.length)-1,i=new Array(u),o=new Array(u),a=-1;for(n[u]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++a<u;)i[a]=M(n[a],n[a+1]),o[a]=r(t[a],t[a+1]);return function(t){var r=e.bisect(n,t,1,u)-1;return o[r](i[r](t))}}function x(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function N(){var n,t,e,u,i,o,a=m,c=m,l=r.interpolate,h=v;function s(){return u=Math.min(a.length,c.length)>2?w:k,i=o=null,g}function g(t){return isNaN(t=+t)?e:(i||(i=u(a.map(n),c,l)))(n(h(t)))}return g.invert=function(e){return h(t((o||(o=u(c,a.map(n),r.interpolateNumber)))(e)))},g.domain=function(n){return arguments.length?(a=f.call(n,d),h===v||(h=y(a)),s()):a.slice()},g.range=function(n){return arguments.length?(c=p.call(n),s()):c.slice()},g.rangeRound=function(n){return c=p.call(n),l=r.interpolateRound,s()},g.clamp=function(n){return arguments.length?(h=n?y(a):v,g):h!==v},g.interpolate=function(n){return arguments.length?(l=n,s()):l},g.unknown=function(n){return arguments.length?(e=n,g):e},function(e,r){return n=e,t=r,s()}}function b(n,t){return N()(n,t)}function q(n,t,r,i){var o,a=e.tickStep(n,t,r);switch((i=u.formatSpecifier(null==i?",f":i)).type){case"s":var c=Math.max(Math.abs(n),Math.abs(t));return null!=i.precision||isNaN(o=u.precisionPrefix(a,c))||(i.precision=o),u.formatPrefix(i,c);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=u.precisionRound(a,Math.max(Math.abs(n),Math.abs(t))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=u.precisionFixed(a))||(i.precision=o-2*("%"===i.type))}return u.format(i)}function S(n){var t=n.domain;return n.ticks=function(n){var r=t();return e.ticks(r[0],r[r.length-1],null==n?10:n)},n.tickFormat=function(n,e){var r=t();return q(r[0],r[r.length-1],null==n?10:n,e)},n.nice=function(r){null==r&&(r=10);var u,i=t(),o=0,a=i.length-1,c=i[o],l=i[a];return l<c&&(u=c,c=l,l=u,u=o,o=a,a=u),(u=e.tickIncrement(c,l,r))>0?(c=Math.floor(c/u)*u,l=Math.ceil(l/u)*u,u=e.tickIncrement(c,l,r)):u<0&&(c=Math.ceil(c*u)/u,l=Math.floor(l*u)/u,u=e.tickIncrement(c,l,r)),u>0?(i[o]=Math.floor(c/u)*u,i[a]=Math.ceil(l/u)*u,t(i)):u<0&&(i[o]=Math.ceil(c*u)/u,i[a]=Math.floor(l*u)/u,t(i)),n},n}function D(n,t){var e,r=0,u=(n=n.slice()).length-1,i=n[r],o=n[u];return o<i&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function I(n){return Math.log(n)}function O(n){return Math.exp(n)}function F(n){return-Math.log(-n)}function P(n){return-Math.exp(-n)}function A(n){return isFinite(n)?+("1e"+n):n<0?0:n}function E(n){return function(t){return-n(-t)}}function L(n){var t,r,i=n(I,O),o=i.domain,a=10;function c(){return t=function(n){return n===Math.E?Math.log:10===n&&Math.log10||2===n&&Math.log2||(n=Math.log(n),function(t){return Math.log(t)/n})}(a),r=function(n){return 10===n?A:n===Math.E?Math.exp:function(t){return Math.pow(n,t)}}(a),o()[0]<0?(t=E(t),r=E(r),n(F,P)):n(I,O),i}return i.base=function(n){return arguments.length?(a=+n,c()):a},i.domain=function(n){return arguments.length?(o(n),c()):o()},i.ticks=function(n){var u,i=o(),c=i[0],l=i[i.length-1];(u=l<c)&&(s=c,c=l,l=s);var f,p,h,s=t(c),g=t(l),d=null==n?10:+n,m=[];if(!(a%1)&&g-s<d){if(s=Math.round(s)-1,g=Math.round(g)+1,c>0){for(;s<g;++s)for(p=1,f=r(s);p<a;++p)if(!((h=f*p)<c)){if(h>l)break;m.push(h)}}else for(;s<g;++s)for(p=a-1,f=r(s);p>=1;--p)if(!((h=f*p)<c)){if(h>l)break;m.push(h)}}else m=e.ticks(s,g,Math.min(g-s,d)).map(r);return u?m.reverse():m},i.tickFormat=function(n,e){if(null==e&&(e=10===a?".0e":","),"function"!=typeof e&&(e=u.format(e)),n===1/0)return e;null==n&&(n=10);var o=Math.max(1,a*n/i.ticks().length);return function(n){var u=n/r(Math.round(t(n)));return u*a<a-.5&&(u*=a),u<=o?e(n):""}},i.nice=function(){return o(D(o(),{floor:function(n){return r(Math.floor(t(n)))},ceil:function(n){return r(Math.ceil(t(n)))}}))},i}function R(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function T(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function Q(n){var t=1,e=n(R(t),T(t));return e.constant=function(e){return arguments.length?n(R(t=+e),T(t)):t},S(e)}function U(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function Y(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function j(n){return n<0?-n*n:n*n}function B(n){var t=n(v,v),e=1;return t.exponent=function(t){return arguments.length?1===(e=+t)?n(v,v):.5===e?n(Y,j):n(U(e),U(1/e)):e},S(t)}function C(){var n=B(N());return n.copy=function(){return x(n,C()).exponent(n.exponent())},a.apply(n,arguments),n}var H=1e3,W=60*H,_=60*W,z=24*_,G=7*z,J=30*z,K=365*z;function V(n){return new Date(n)}function X(n){return n instanceof Date?+n:+new Date(+n)}function Z(n,t,r,u,i,o,a,c,l){var p=b(v,v),h=p.invert,s=p.domain,g=l(".%L"),d=l(":%S"),m=l("%I:%M"),M=l("%I %p"),y=l("%a %d"),k=l("%b %d"),w=l("%B"),N=l("%Y"),q=[[a,1,H],[a,5,5*H],[a,15,15*H],[a,30,30*H],[o,1,W],[o,5,5*W],[o,15,15*W],[o,30,30*W],[i,1,_],[i,3,3*_],[i,6,6*_],[i,12,12*_],[u,1,z],[u,2,2*z],[r,1,G],[t,1,J],[t,3,3*J],[n,1,K]];function S(e){return(a(e)<e?g:o(e)<e?d:i(e)<e?m:u(e)<e?M:t(e)<e?r(e)<e?y:k:n(e)<e?w:N)(e)}function I(t,r,u,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(u-r)/t,a=e.bisector(function(n){return n[2]}).right(q,o);a===q.length?(i=e.tickStep(r/K,u/K,t),t=n):a?(i=(a=q[o/q[a-1][2]<q[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(e.tickStep(r,u,t),1),t=c)}return null==i?t:t.every(i)}return p.invert=function(n){return new Date(h(n))},p.domain=function(n){return arguments.length?s(f.call(n,X)):s().map(V)},p.ticks=function(n,t){var e,r=s(),u=r[0],i=r[r.length-1],o=i<u;return o&&(e=u,u=i,i=e),e=(e=I(n,u,i,t))?e.range(u,i+1):[],o?e.reverse():e},p.tickFormat=function(n,t){return null==t?S:l(t)},p.nice=function(n,t){var e=s();return(n=I(n,e[0],e[e.length-1],t))?s(D(e,n)):p},p.copy=function(){return x(p,Z(n,t,r,u,i,o,a,c,l))},p}function $(){var n,t,e,r,u,i=0,o=1,a=v,c=!1;function l(t){return isNaN(t=+t)?u:a(0===e?.5:(t=(r(t)-n)*e,c?Math.max(0,Math.min(1,t)):t))}return l.domain=function(u){return arguments.length?(n=r(i=+u[0]),t=r(o=+u[1]),e=n===t?0:1/(t-n),l):[i,o]},l.clamp=function(n){return arguments.length?(c=!!n,l):c},l.interpolator=function(n){return arguments.length?(a=n,l):a},l.unknown=function(n){return arguments.length?(u=n,l):u},function(u){return r=u,n=u(i),t=u(o),e=n===t?0:1/(t-n),l}}function nn(n,t){return t.domain(n.domain()).interpolator(n.interpolator()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=B($());return n.copy=function(){return nn(n,tn()).exponent(n.exponent())},c.apply(n,arguments)}function en(){var n,t,e,r,u,i,o,a=0,c=.5,l=1,f=v,p=!1;function h(n){return isNaN(n=+n)?o:(n=.5+((n=+i(n))-t)*(n<t?r:u),f(p?Math.max(0,Math.min(1,n)):n))}return h.domain=function(o){return arguments.length?(n=i(a=+o[0]),t=i(c=+o[1]),e=i(l=+o[2]),r=n===t?0:.5/(t-n),u=t===e?0:.5/(e-t),h):[a,c,l]},h.clamp=function(n){return arguments.length?(p=!!n,h):p},h.interpolator=function(n){return arguments.length?(f=n,h):f},h.unknown=function(n){return arguments.length?(o=n,h):o},function(o){return i=o,n=o(a),t=o(c),e=o(l),r=n===t?0:.5/(t-n),u=t===e?0:.5/(e-t),h}}function rn(){var n=B(en());return n.copy=function(){return nn(n,rn()).exponent(n.exponent())},c.apply(n,arguments)}n.scaleBand=g,n.scalePoint=function(){return function n(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return n(e())},t}(g.apply(null,arguments).paddingInner(1))},n.scaleIdentity=function n(t){var e;function r(n){return isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=f.call(n,d),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return n(t).unknown(e)},t=arguments.length?f.call(t,d):[0,1],S(r)},n.scaleLinear=function n(){var t=b(v,v);return t.copy=function(){return x(t,n())},a.apply(t,arguments),S(t)},n.scaleLog=function n(){var t=L(N()).domain([1,10]);return t.copy=function(){return x(t,n()).base(t.base())},a.apply(t,arguments),t},n.scaleSymlog=function n(){var t=Q(N());return t.copy=function(){return x(t,n()).constant(t.constant())},a.apply(t,arguments)},n.scaleOrdinal=s,n.scaleImplicit=h,n.scalePow=C,n.scaleSqrt=function(){return C.apply(null,arguments).exponent(.5)},n.scaleQuantile=function n(){var t,r=[],u=[],i=[];function o(){var n=0,t=Math.max(1,u.length);for(i=new Array(t-1);++n<t;)i[n-1]=e.quantile(r,n/t);return c}function c(n){return isNaN(n=+n)?t:u[e.bisect(i,n)]}return c.invertExtent=function(n){var t=u.indexOf(n);return t<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]},c.domain=function(n){if(!arguments.length)return r.slice();r=[];for(var t,u=0,i=n.length;u<i;++u)null==(t=n[u])||isNaN(t=+t)||r.push(t);return r.sort(e.ascending),o()},c.range=function(n){return arguments.length?(u=p.call(n),o()):u.slice()},c.unknown=function(n){return arguments.length?(t=n,c):t},c.quantiles=function(){return i.slice()},c.copy=function(){return n().domain(r).range(u).unknown(t)},a.apply(c,arguments)},n.scaleQuantize=function n(){var t,r=0,u=1,i=1,o=[.5],c=[0,1];function l(n){return n<=n?c[e.bisect(o,n,0,i)]:t}function f(){var n=-1;for(o=new Array(i);++n<i;)o[n]=((n+1)*u-(n-i)*r)/(i+1);return l}return l.domain=function(n){return arguments.length?(r=+n[0],u=+n[1],f()):[r,u]},l.range=function(n){return arguments.length?(i=(c=p.call(n)).length-1,f()):c.slice()},l.invertExtent=function(n){var t=c.indexOf(n);return t<0?[NaN,NaN]:t<1?[r,o[0]]:t>=i?[o[i-1],u]:[o[t-1],o[t]]},l.unknown=function(n){return arguments.length?(t=n,l):l},l.thresholds=function(){return o.slice()},l.copy=function(){return n().domain([r,u]).range(c).unknown(t)},a.apply(S(l),arguments)},n.scaleThreshold=function n(){var t,r=[.5],u=[0,1],i=1;function o(n){return n<=n?u[e.bisect(r,n,0,i)]:t}return o.domain=function(n){return arguments.length?(r=p.call(n),i=Math.min(r.length,u.length-1),o):r.slice()},o.range=function(n){return arguments.length?(u=p.call(n),i=Math.min(r.length,u.length-1),o):u.slice()},o.invertExtent=function(n){var t=u.indexOf(n);return[r[t-1],r[t]]},o.unknown=function(n){return arguments.length?(t=n,o):t},o.copy=function(){return n().domain(r).range(u).unknown(t)},a.apply(o,arguments)},n.scaleTime=function(){return a.apply(Z(i.timeYear,i.timeMonth,i.timeWeek,i.timeDay,i.timeHour,i.timeMinute,i.timeSecond,i.timeMillisecond,o.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},n.scaleUtc=function(){return a.apply(Z(i.utcYear,i.utcMonth,i.utcWeek,i.utcDay,i.utcHour,i.utcMinute,i.utcSecond,i.utcMillisecond,o.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},n.scaleSequential=function n(){var t=S($()(v));return t.copy=function(){return nn(t,n())},c.apply(t,arguments)},n.scaleSequentialLog=function n(){var t=L($()).domain([1,10]);return t.copy=function(){return nn(t,n()).base(t.base())},c.apply(t,arguments)},n.scaleSequentialPow=tn,n.scaleSequentialSqrt=function(){return tn.apply(null,arguments).exponent(.5)},n.scaleSequentialSymlog=function n(){var t=Q($());return t.copy=function(){return nn(t,n()).constant(t.constant())},c.apply(t,arguments)},n.scaleSequentialQuantile=function n(){var t=[],r=v;function u(n){if(!isNaN(n=+n))return r((e.bisect(t,n)-1)/(t.length-1))}return u.domain=function(n){if(!arguments.length)return t.slice();t=[];for(var r,i=0,o=n.length;i<o;++i)null==(r=n[i])||isNaN(r=+r)||t.push(r);return t.sort(e.ascending),u},u.interpolator=function(n){return arguments.length?(r=n,u):r},u.copy=function(){return n(r).domain(t)},c.apply(u,arguments)},n.scaleDiverging=function n(){var t=S(en()(v));return t.copy=function(){return nn(t,n())},c.apply(t,arguments)},n.scaleDivergingLog=function n(){var t=L(en()).domain([.1,1,10]);return t.copy=function(){return nn(t,n()).base(t.base())},c.apply(t,arguments)},n.scaleDivergingPow=rn,n.scaleDivergingSqrt=function(){return rn.apply(null,arguments).exponent(.5)},n.scaleDivergingSymlog=function n(){var t=Q(en());return t.copy=function(){return nn(t,n()).constant(t.constant())},c.apply(t,arguments)},n.tickFormat=q,Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-scale", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Encodings that map abstract data to visual representation.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -68,3 +68,4 @@ export { | ||
divergingPow as scaleDivergingPow, | ||
divergingSqrt as scaleDivergingSqrt | ||
divergingSqrt as scaleDivergingSqrt, | ||
divergingSymlog as scaleDivergingSymlog | ||
} from "./diverging"; | ||
@@ -71,0 +72,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194541
2082