Comparing version 2.2.2 to 3.0.0
@@ -1,7 +0,7 @@ | ||
// https://d3js.org/d3-scale/ v2.2.2 Copyright 2019 Mike Bostock | ||
// https://d3js.org/d3-scale/ v3.0.0 Copyright 2019 Mike Bostock | ||
(function (global, factory) { | ||
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')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-collection', 'd3-array', 'd3-interpolate', 'd3-format', 'd3-time', 'd3-time-format'], factory) : | ||
(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3,global.d3,global.d3)); | ||
}(this, (function (exports,d3Collection,d3Array,d3Interpolate,d3Format,d3Time,d3TimeFormat) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-interpolate'), require('d3-format'), require('d3-time'), require('d3-time-format')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-interpolate', 'd3-format', 'd3-time', 'd3-time-format'], factory) : | ||
(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3,global.d3)); | ||
}(this, (function (exports,d3Array,d3Interpolate,d3Format,d3Time,d3TimeFormat) { 'use strict'; | ||
@@ -26,11 +26,6 @@ function initRange(domain, range) { | ||
var array = Array.prototype; | ||
const implicit = Symbol("implicit"); | ||
var map = array.map; | ||
var slice = array.slice; | ||
var implicit = {name: "implicit"}; | ||
function ordinal() { | ||
var index = d3Collection.map(), | ||
var index = new Map(), | ||
domain = [], | ||
@@ -51,5 +46,8 @@ range = [], | ||
if (!arguments.length) return domain.slice(); | ||
domain = [], index = d3Collection.map(); | ||
var i = -1, n = _.length, d, key; | ||
while (++i < n) if (!index.has(key = (d = _[i]) + "")) index.set(key, domain.push(d)); | ||
domain = [], index = new Map(); | ||
for (const value of _) { | ||
const key = value + ""; | ||
if (index.has(key)) continue; | ||
index.set(key, domain.push(value)); | ||
} | ||
return scale; | ||
@@ -59,3 +57,3 @@ }; | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), scale) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), scale) : range.slice(); | ||
}; | ||
@@ -80,3 +78,4 @@ | ||
ordinalRange = scale.range, | ||
range = [0, 1], | ||
r0 = 0, | ||
r1 = 1, | ||
step, | ||
@@ -93,5 +92,5 @@ bandwidth, | ||
var n = domain().length, | ||
reverse = range[1] < range[0], | ||
start = range[reverse - 0], | ||
stop = range[1 - reverse]; | ||
reverse = r1 < r0, | ||
start = reverse ? r1 : r0, | ||
stop = reverse ? r0 : r1; | ||
step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2); | ||
@@ -111,7 +110,7 @@ if (round) step = Math.floor(step); | ||
scale.range = function(_) { | ||
return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice(); | ||
return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1]; | ||
}; | ||
scale.rangeRound = function(_) { | ||
return range = [+_[0], +_[1]], round = true, rescale(); | ||
return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale(); | ||
}; | ||
@@ -148,3 +147,3 @@ | ||
scale.copy = function() { | ||
return band(domain(), range) | ||
return band(domain(), [r0, r1]) | ||
.round(round) | ||
@@ -273,11 +272,11 @@ .paddingInner(paddingInner) | ||
scale.domain = function(_) { | ||
return arguments.length ? (domain = map.call(_, number), clamp === identity || (clamp = clamper(domain)), rescale()) : domain.slice(); | ||
return arguments.length ? (domain = Array.from(_, number), clamp === identity || (clamp = clamper(domain)), rescale()) : domain.slice(); | ||
}; | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), rescale()) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), rescale()) : range.slice(); | ||
}; | ||
scale.rangeRound = function(_) { | ||
return range = slice.call(_), interpolate = d3Interpolate.interpolateRound, rescale(); | ||
return range = Array.from(_), interpolate = d3Interpolate.interpolateRound, rescale(); | ||
}; | ||
@@ -412,3 +411,3 @@ | ||
scale.domain = scale.range = function(_) { | ||
return arguments.length ? (domain = map.call(_, number), scale) : domain.slice(); | ||
return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice(); | ||
}; | ||
@@ -424,3 +423,3 @@ | ||
domain = arguments.length ? map.call(domain, number) : [0, 1]; | ||
domain = arguments.length ? Array.from(domain, number) : [0, 1]; | ||
@@ -696,3 +695,3 @@ return linearish(scale); | ||
domain = []; | ||
for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); | ||
for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d); | ||
domain.sort(d3Array.ascending); | ||
@@ -703,3 +702,3 @@ return rescale(); | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), rescale()) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), rescale()) : range.slice(); | ||
}; | ||
@@ -745,7 +744,7 @@ | ||
scale.domain = function(_) { | ||
return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1]; | ||
return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1]; | ||
}; | ||
scale.range = function(_) { | ||
return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice(); | ||
return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice(); | ||
}; | ||
@@ -790,7 +789,7 @@ | ||
scale.domain = function(_) { | ||
return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice(); | ||
return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice(); | ||
}; | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice(); | ||
}; | ||
@@ -908,3 +907,3 @@ | ||
scale.domain = function(_) { | ||
return arguments.length ? domain(map.call(_, number$1)) : domain().map(date); | ||
return arguments.length ? domain(Array.from(_, number$1)) : domain().map(date); | ||
}; | ||
@@ -966,3 +965,3 @@ | ||
scale.domain = function(_) { | ||
return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1]; | ||
return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1]; | ||
}; | ||
@@ -1051,3 +1050,3 @@ | ||
domain = []; | ||
for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); | ||
for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d); | ||
domain.sort(d3Array.ascending); | ||
@@ -1087,3 +1086,3 @@ return scale; | ||
scale.domain = function(_) { | ||
return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), t2 = transform(x2 = +_[2]), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), scale) : [x0, x1, x2]; | ||
return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), scale) : [x0, x1, x2]; | ||
}; | ||
@@ -1090,0 +1089,0 @@ |
@@ -1,2 +0,2 @@ | ||
// 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})}); | ||
// https://d3js.org/d3-scale/ v3.0.0 Copyright 2019 Mike Bostock | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array"),require("d3-interpolate"),require("d3-format"),require("d3-time"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","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)}(this,function(n,t,r,e,u,i){"use strict";function o(n,t){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(t).domain(n)}return this}function a(n,t){switch(arguments.length){case 0:break;case 1:this.interpolator(n);break;default:this.interpolator(t).domain(n)}return this}const c=Symbol("implicit");function f(){var n=new Map,t=[],r=[],e=c;function u(u){var i=u+"",o=n.get(i);if(!o){if(e!==c)return e;n.set(i,o=t.push(u))}return r[(o-1)%r.length]}return u.domain=function(r){if(!arguments.length)return t.slice();t=[],n=new Map;for(const e of r){const r=e+"";n.has(r)||n.set(r,t.push(e))}return u},u.range=function(n){return arguments.length?(r=Array.from(n),u):r.slice()},u.unknown=function(n){return arguments.length?(e=n,u):e},u.copy=function(){return f(t,r).unknown(e)},o.apply(u,arguments),u}function l(){var n,r,e=f().unknown(void 0),u=e.domain,i=e.range,a=0,c=1,p=!1,s=0,h=0,g=.5;function m(){var e=u().length,o=c<a,f=o?c:a,l=o?a:c;n=(l-f)/Math.max(1,e-s+2*h),p&&(n=Math.floor(n)),f+=(l-f-n*(e-s))*g,r=n*(1-s),p&&(f=Math.round(f),r=Math.round(r));var m=t.range(e).map(function(t){return f+n*t});return i(o?m.reverse():m)}return delete e.unknown,e.domain=function(n){return arguments.length?(u(n),m()):u()},e.range=function(n){return arguments.length?([a,c]=n,a=+a,c=+c,m()):[a,c]},e.rangeRound=function(n){return[a,c]=n,a=+a,c=+c,p=!0,m()},e.bandwidth=function(){return r},e.step=function(){return n},e.round=function(n){return arguments.length?(p=!!n,m()):p},e.padding=function(n){return arguments.length?(s=Math.min(1,h=+n),m()):s},e.paddingInner=function(n){return arguments.length?(s=Math.min(1,n),m()):s},e.paddingOuter=function(n){return arguments.length?(h=+n,m()):h},e.align=function(n){return arguments.length?(g=Math.max(0,Math.min(1,n)),m()):g},e.copy=function(){return l(u(),[a,c]).round(p).paddingInner(s).paddingOuter(h).align(g)},o.apply(m(),arguments)}function p(n){return+n}var s=[0,1];function h(n){return n}function g(n,t){return(t-=n=+n)?function(r){return(r-n)/t}:(r=isNaN(t)?NaN:.5,function(){return r});var r}function m(n){var t,r=n[0],e=n[n.length-1];return r>e&&(t=r,r=e,e=t),function(n){return Math.max(r,Math.min(e,n))}}function d(n,t,r){var e=n[0],u=n[1],i=t[0],o=t[1];return u<e?(e=g(u,e),i=r(o,i)):(e=g(e,u),i=r(i,o)),function(n){return i(e(n))}}function y(n,r,e){var u=Math.min(n.length,r.length)-1,i=new Array(u),o=new Array(u),a=-1;for(n[u]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<u;)i[a]=g(n[a],n[a+1]),o[a]=e(r[a],r[a+1]);return function(r){var e=t.bisect(n,r,1,u)-1;return o[e](i[e](r))}}function v(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function M(){var n,t,e,u,i,o,a=s,c=s,f=r.interpolate,l=h;function g(){return u=Math.min(a.length,c.length)>2?y:d,i=o=null,v}function v(t){return isNaN(t=+t)?e:(i||(i=u(a.map(n),c,f)))(n(l(t)))}return v.invert=function(e){return l(t((o||(o=u(c,a.map(n),r.interpolateNumber)))(e)))},v.domain=function(n){return arguments.length?(a=Array.from(n,p),l===h||(l=m(a)),g()):a.slice()},v.range=function(n){return arguments.length?(c=Array.from(n),g()):c.slice()},v.rangeRound=function(n){return c=Array.from(n),f=r.interpolateRound,g()},v.clamp=function(n){return arguments.length?(l=n?m(a):h,v):l!==h},v.interpolate=function(n){return arguments.length?(f=n,g()):f},v.unknown=function(n){return arguments.length?(e=n,v):e},function(r,e){return n=r,t=e,g()}}function k(n,t){return M()(n,t)}function w(n,r,u,i){var o,a=t.tickStep(n,r,u);switch((i=e.formatSpecifier(null==i?",f":i)).type){case"s":var c=Math.max(Math.abs(n),Math.abs(r));return null!=i.precision||isNaN(o=e.precisionPrefix(a,c))||(i.precision=o),e.formatPrefix(i,c);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=e.precisionRound(a,Math.max(Math.abs(n),Math.abs(r))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=e.precisionFixed(a))||(i.precision=o-2*("%"===i.type))}return e.format(i)}function x(n){var r=n.domain;return n.ticks=function(n){var e=r();return t.ticks(e[0],e[e.length-1],null==n?10:n)},n.tickFormat=function(n,t){var e=r();return w(e[0],e[e.length-1],null==n?10:n,t)},n.nice=function(e){null==e&&(e=10);var u,i=r(),o=0,a=i.length-1,c=i[o],f=i[a];return f<c&&(u=c,c=f,f=u,u=o,o=a,a=u),(u=t.tickIncrement(c,f,e))>0?(c=Math.floor(c/u)*u,f=Math.ceil(f/u)*u,u=t.tickIncrement(c,f,e)):u<0&&(c=Math.ceil(c*u)/u,f=Math.floor(f*u)/u,u=t.tickIncrement(c,f,e)),u>0?(i[o]=Math.floor(c/u)*u,i[a]=Math.ceil(f/u)*u,r(i)):u<0&&(i[o]=Math.ceil(c*u)/u,i[a]=Math.floor(f*u)/u,r(i)),n},n}function N(n,t){var r,e=0,u=(n=n.slice()).length-1,i=n[e],o=n[u];return o<i&&(r=e,e=u,u=r,r=i,i=o,o=r),n[e]=t.floor(i),n[u]=t.ceil(o),n}function b(n){return Math.log(n)}function S(n){return Math.exp(n)}function q(n){return-Math.log(-n)}function A(n){return-Math.exp(-n)}function D(n){return isFinite(n)?+("1e"+n):n<0?0:n}function I(n){return function(t){return-n(-t)}}function O(n){var r,u,i=n(b,S),o=i.domain,a=10;function c(){return r=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),u=function(n){return 10===n?D:n===Math.E?Math.exp:function(t){return Math.pow(n,t)}}(a),o()[0]<0?(r=I(r),u=I(u),n(q,A)):n(b,S),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 e,i=o(),c=i[0],f=i[i.length-1];(e=f<c)&&(h=c,c=f,f=h);var l,p,s,h=r(c),g=r(f),m=null==n?10:+n,d=[];if(!(a%1)&&g-h<m){if(h=Math.round(h)-1,g=Math.round(g)+1,c>0){for(;h<g;++h)for(p=1,l=u(h);p<a;++p)if(!((s=l*p)<c)){if(s>f)break;d.push(s)}}else for(;h<g;++h)for(p=a-1,l=u(h);p>=1;--p)if(!((s=l*p)<c)){if(s>f)break;d.push(s)}}else d=t.ticks(h,g,Math.min(g-h,m)).map(u);return e?d.reverse():d},i.tickFormat=function(n,t){if(null==t&&(t=10===a?".0e":","),"function"!=typeof t&&(t=e.format(t)),n===1/0)return t;null==n&&(n=10);var o=Math.max(1,a*n/i.ticks().length);return function(n){var e=n/u(Math.round(r(n)));return e*a<a-.5&&(e*=a),e<=o?t(n):""}},i.nice=function(){return o(N(o(),{floor:function(n){return u(Math.floor(r(n)))},ceil:function(n){return u(Math.ceil(r(n)))}}))},i}function F(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function P(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function E(n){var t=1,r=n(F(t),P(t));return r.constant=function(r){return arguments.length?n(F(t=+r),P(t)):t},x(r)}function L(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function R(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function T(n){return n<0?-n*n:n*n}function Q(n){var t=n(h,h),r=1;return t.exponent=function(t){return arguments.length?1===(r=+t)?n(h,h):.5===r?n(R,T):n(L(r),L(1/r)):r},x(t)}function U(){var n=Q(M());return n.copy=function(){return v(n,U()).exponent(n.exponent())},o.apply(n,arguments),n}var Y=1e3,j=60*Y,B=60*j,C=24*B,H=7*C,W=30*C,_=365*C;function z(n){return new Date(n)}function G(n){return n instanceof Date?+n:+new Date(+n)}function J(n,r,e,u,i,o,a,c,f){var l=k(h,h),p=l.invert,s=l.domain,g=f(".%L"),m=f(":%S"),d=f("%I:%M"),y=f("%I %p"),M=f("%a %d"),w=f("%b %d"),x=f("%B"),b=f("%Y"),S=[[a,1,Y],[a,5,5*Y],[a,15,15*Y],[a,30,30*Y],[o,1,j],[o,5,5*j],[o,15,15*j],[o,30,30*j],[i,1,B],[i,3,3*B],[i,6,6*B],[i,12,12*B],[u,1,C],[u,2,2*C],[e,1,H],[r,1,W],[r,3,3*W],[n,1,_]];function q(t){return(a(t)<t?g:o(t)<t?m:i(t)<t?d:u(t)<t?y:r(t)<t?e(t)<t?M:w:n(t)<t?x:b)(t)}function A(r,e,u,i){if(null==r&&(r=10),"number"==typeof r){var o=Math.abs(u-e)/r,a=t.bisector(function(n){return n[2]}).right(S,o);a===S.length?(i=t.tickStep(e/_,u/_,r),r=n):a?(i=(a=S[o/S[a-1][2]<S[a][2]/o?a-1:a])[1],r=a[0]):(i=Math.max(t.tickStep(e,u,r),1),r=c)}return null==i?r:r.every(i)}return l.invert=function(n){return new Date(p(n))},l.domain=function(n){return arguments.length?s(Array.from(n,G)):s().map(z)},l.ticks=function(n,t){var r,e=s(),u=e[0],i=e[e.length-1],o=i<u;return o&&(r=u,u=i,i=r),r=(r=A(n,u,i,t))?r.range(u,i+1):[],o?r.reverse():r},l.tickFormat=function(n,t){return null==t?q:f(t)},l.nice=function(n,t){var r=s();return(n=A(n,r[0],r[r.length-1],t))?s(N(r,n)):l},l.copy=function(){return v(l,J(n,r,e,u,i,o,a,c,f))},l}function K(){var n,t,r,e,u,i=0,o=1,a=h,c=!1;function f(t){return isNaN(t=+t)?u:a(0===r?.5:(t=(e(t)-n)*r,c?Math.max(0,Math.min(1,t)):t))}return f.domain=function(u){return arguments.length?([i,o]=u,n=e(i=+i),t=e(o=+o),r=n===t?0:1/(t-n),f):[i,o]},f.clamp=function(n){return arguments.length?(c=!!n,f):c},f.interpolator=function(n){return arguments.length?(a=n,f):a},f.unknown=function(n){return arguments.length?(u=n,f):u},function(u){return e=u,n=u(i),t=u(o),r=n===t?0:1/(t-n),f}}function V(n,t){return t.domain(n.domain()).interpolator(n.interpolator()).clamp(n.clamp()).unknown(n.unknown())}function X(){var n=Q(K());return n.copy=function(){return V(n,X()).exponent(n.exponent())},a.apply(n,arguments)}function Z(){var n,t,r,e,u,i,o,a=0,c=.5,f=1,l=h,p=!1;function s(n){return isNaN(n=+n)?o:(n=.5+((n=+i(n))-t)*(n<t?e:u),l(p?Math.max(0,Math.min(1,n)):n))}return s.domain=function(o){return arguments.length?([a,c,f]=o,n=i(a=+a),t=i(c=+c),r=i(f=+f),e=n===t?0:.5/(t-n),u=t===r?0:.5/(r-t),s):[a,c,f]},s.clamp=function(n){return arguments.length?(p=!!n,s):p},s.interpolator=function(n){return arguments.length?(l=n,s):l},s.unknown=function(n){return arguments.length?(o=n,s):o},function(o){return i=o,n=o(a),t=o(c),r=o(f),e=n===t?0:.5/(t-n),u=t===r?0:.5/(r-t),s}}function $(){var n=Q(Z());return n.copy=function(){return V(n,$()).exponent(n.exponent())},a.apply(n,arguments)}n.scaleBand=l,n.scalePoint=function(){return function n(t){var r=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return n(r())},t}(l.apply(null,arguments).paddingInner(1))},n.scaleIdentity=function n(t){var r;function e(n){return isNaN(n=+n)?r:n}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=Array.from(n,p),e):t.slice()},e.unknown=function(n){return arguments.length?(r=n,e):r},e.copy=function(){return n(t).unknown(r)},t=arguments.length?Array.from(t,p):[0,1],x(e)},n.scaleLinear=function n(){var t=k(h,h);return t.copy=function(){return v(t,n())},o.apply(t,arguments),x(t)},n.scaleLog=function n(){var t=O(M()).domain([1,10]);return t.copy=function(){return v(t,n()).base(t.base())},o.apply(t,arguments),t},n.scaleSymlog=function n(){var t=E(M());return t.copy=function(){return v(t,n()).constant(t.constant())},o.apply(t,arguments)},n.scaleOrdinal=f,n.scaleImplicit=c,n.scalePow=U,n.scaleSqrt=function(){return U.apply(null,arguments).exponent(.5)},n.scaleQuantile=function n(){var r,e=[],u=[],i=[];function a(){var n=0,r=Math.max(1,u.length);for(i=new Array(r-1);++n<r;)i[n-1]=t.quantile(e,n/r);return c}function c(n){return isNaN(n=+n)?r:u[t.bisect(i,n)]}return c.invertExtent=function(n){var t=u.indexOf(n);return t<0?[NaN,NaN]:[t>0?i[t-1]:e[0],t<i.length?i[t]:e[e.length-1]]},c.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let t of n)null==t||isNaN(t=+t)||e.push(t);return e.sort(t.ascending),a()},c.range=function(n){return arguments.length?(u=Array.from(n),a()):u.slice()},c.unknown=function(n){return arguments.length?(r=n,c):r},c.quantiles=function(){return i.slice()},c.copy=function(){return n().domain(e).range(u).unknown(r)},o.apply(c,arguments)},n.scaleQuantize=function n(){var r,e=0,u=1,i=1,a=[.5],c=[0,1];function f(n){return n<=n?c[t.bisect(a,n,0,i)]:r}function l(){var n=-1;for(a=new Array(i);++n<i;)a[n]=((n+1)*u-(n-i)*e)/(i+1);return f}return f.domain=function(n){return arguments.length?([e,u]=n,e=+e,u=+u,l()):[e,u]},f.range=function(n){return arguments.length?(i=(c=Array.from(n)).length-1,l()):c.slice()},f.invertExtent=function(n){var t=c.indexOf(n);return t<0?[NaN,NaN]:t<1?[e,a[0]]:t>=i?[a[i-1],u]:[a[t-1],a[t]]},f.unknown=function(n){return arguments.length?(r=n,f):f},f.thresholds=function(){return a.slice()},f.copy=function(){return n().domain([e,u]).range(c).unknown(r)},o.apply(x(f),arguments)},n.scaleThreshold=function n(){var r,e=[.5],u=[0,1],i=1;function a(n){return n<=n?u[t.bisect(e,n,0,i)]:r}return a.domain=function(n){return arguments.length?(e=Array.from(n),i=Math.min(e.length,u.length-1),a):e.slice()},a.range=function(n){return arguments.length?(u=Array.from(n),i=Math.min(e.length,u.length-1),a):u.slice()},a.invertExtent=function(n){var t=u.indexOf(n);return[e[t-1],e[t]]},a.unknown=function(n){return arguments.length?(r=n,a):r},a.copy=function(){return n().domain(e).range(u).unknown(r)},o.apply(a,arguments)},n.scaleTime=function(){return o.apply(J(u.timeYear,u.timeMonth,u.timeWeek,u.timeDay,u.timeHour,u.timeMinute,u.timeSecond,u.timeMillisecond,i.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},n.scaleUtc=function(){return o.apply(J(u.utcYear,u.utcMonth,u.utcWeek,u.utcDay,u.utcHour,u.utcMinute,u.utcSecond,u.utcMillisecond,i.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},n.scaleSequential=function n(){var t=x(K()(h));return t.copy=function(){return V(t,n())},a.apply(t,arguments)},n.scaleSequentialLog=function n(){var t=O(K()).domain([1,10]);return t.copy=function(){return V(t,n()).base(t.base())},a.apply(t,arguments)},n.scaleSequentialPow=X,n.scaleSequentialSqrt=function(){return X.apply(null,arguments).exponent(.5)},n.scaleSequentialSymlog=function n(){var t=E(K());return t.copy=function(){return V(t,n()).constant(t.constant())},a.apply(t,arguments)},n.scaleSequentialQuantile=function n(){var r=[],e=h;function u(n){if(!isNaN(n=+n))return e((t.bisect(r,n)-1)/(r.length-1))}return u.domain=function(n){if(!arguments.length)return r.slice();r=[];for(let t of n)null==t||isNaN(t=+t)||r.push(t);return r.sort(t.ascending),u},u.interpolator=function(n){return arguments.length?(e=n,u):e},u.copy=function(){return n(e).domain(r)},a.apply(u,arguments)},n.scaleDiverging=function n(){var t=x(Z()(h));return t.copy=function(){return V(t,n())},a.apply(t,arguments)},n.scaleDivergingLog=function n(){var t=O(Z()).domain([.1,1,10]);return t.copy=function(){return V(t,n()).base(t.base())},a.apply(t,arguments)},n.scaleDivergingPow=$,n.scaleDivergingSqrt=function(){return $.apply(null,arguments).exponent(.5)},n.scaleDivergingSymlog=function n(){var t=E(Z());return t.copy=function(){return V(t,n()).constant(t.constant())},a.apply(t,arguments)},n.tickFormat=w,Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-scale", | ||
"version": "2.2.2", | ||
"version": "3.0.0", | ||
"description": "Encodings that map abstract data to visual representation.", | ||
@@ -32,4 +32,3 @@ "keywords": [ | ||
"dependencies": { | ||
"d3-array": "^1.2.0", | ||
"d3-collection": "1", | ||
"d3-array": "^1.2.0 || 2", | ||
"d3-format": "1", | ||
@@ -36,0 +35,0 @@ "d3-interpolate": "1", |
@@ -9,3 +9,4 @@ import {range as sequence} from "d3-array"; | ||
ordinalRange = scale.range, | ||
range = [0, 1], | ||
r0 = 0, | ||
r1 = 1, | ||
step, | ||
@@ -22,5 +23,5 @@ bandwidth, | ||
var n = domain().length, | ||
reverse = range[1] < range[0], | ||
start = range[reverse - 0], | ||
stop = range[1 - reverse]; | ||
reverse = r1 < r0, | ||
start = reverse ? r1 : r0, | ||
stop = reverse ? r0 : r1; | ||
step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2); | ||
@@ -40,7 +41,7 @@ if (round) step = Math.floor(step); | ||
scale.range = function(_) { | ||
return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice(); | ||
return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1]; | ||
}; | ||
scale.rangeRound = function(_) { | ||
return range = [+_[0], +_[1]], round = true, rescale(); | ||
return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale(); | ||
}; | ||
@@ -77,3 +78,3 @@ | ||
scale.copy = function() { | ||
return band(domain(), range) | ||
return band(domain(), [r0, r1]) | ||
.round(round) | ||
@@ -80,0 +81,0 @@ .paddingInner(paddingInner) |
import {bisect} from "d3-array"; | ||
import {interpolate as interpolateValue, interpolateNumber, interpolateRound} from "d3-interpolate"; | ||
import {map, slice} from "./array"; | ||
import constant from "./constant"; | ||
@@ -93,11 +92,11 @@ import number from "./number"; | ||
scale.domain = function(_) { | ||
return arguments.length ? (domain = map.call(_, number), clamp === identity || (clamp = clamper(domain)), rescale()) : domain.slice(); | ||
return arguments.length ? (domain = Array.from(_, number), clamp === identity || (clamp = clamper(domain)), rescale()) : domain.slice(); | ||
}; | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), rescale()) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), rescale()) : range.slice(); | ||
}; | ||
scale.rangeRound = function(_) { | ||
return range = slice.call(_), interpolate = interpolateRound, rescale(); | ||
return range = Array.from(_), interpolate = interpolateRound, rescale(); | ||
}; | ||
@@ -104,0 +103,0 @@ |
@@ -28,3 +28,3 @@ import {identity} from "./continuous"; | ||
scale.domain = function(_) { | ||
return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), t2 = transform(x2 = +_[2]), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), scale) : [x0, x1, x2]; | ||
return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), scale) : [x0, x1, x2]; | ||
}; | ||
@@ -31,0 +31,0 @@ |
@@ -1,2 +0,1 @@ | ||
import {map} from "./array"; | ||
import {linearish} from "./linear"; | ||
@@ -15,3 +14,3 @@ import number from "./number"; | ||
scale.domain = scale.range = function(_) { | ||
return arguments.length ? (domain = map.call(_, number), scale) : domain.slice(); | ||
return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice(); | ||
}; | ||
@@ -27,5 +26,5 @@ | ||
domain = arguments.length ? map.call(domain, number) : [0, 1]; | ||
domain = arguments.length ? Array.from(domain, number) : [0, 1]; | ||
return linearish(scale); | ||
} |
@@ -1,9 +0,7 @@ | ||
import {map} from "d3-collection"; | ||
import {slice} from "./array"; | ||
import {initRange} from "./init"; | ||
export var implicit = {name: "implicit"}; | ||
export const implicit = Symbol("implicit"); | ||
export default function ordinal() { | ||
var index = map(), | ||
var index = new Map(), | ||
domain = [], | ||
@@ -24,5 +22,8 @@ range = [], | ||
if (!arguments.length) return domain.slice(); | ||
domain = [], index = map(); | ||
var i = -1, n = _.length, d, key; | ||
while (++i < n) if (!index.has(key = (d = _[i]) + "")) index.set(key, domain.push(d)); | ||
domain = [], index = new Map(); | ||
for (const value of _) { | ||
const key = value + ""; | ||
if (index.has(key)) continue; | ||
index.set(key, domain.push(value)); | ||
} | ||
return scale; | ||
@@ -32,3 +33,3 @@ }; | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), scale) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), scale) : range.slice(); | ||
}; | ||
@@ -35,0 +36,0 @@ |
import {ascending, bisect, quantile as threshold} from "d3-array"; | ||
import {slice} from "./array"; | ||
import {initRange} from "./init"; | ||
@@ -33,3 +32,3 @@ | ||
domain = []; | ||
for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); | ||
for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d); | ||
domain.sort(ascending); | ||
@@ -40,3 +39,3 @@ return rescale(); | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), rescale()) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), rescale()) : range.slice(); | ||
}; | ||
@@ -43,0 +42,0 @@ |
import {bisect} from "d3-array"; | ||
import {slice} from "./array"; | ||
import {linearish} from "./linear"; | ||
@@ -26,7 +25,7 @@ import {initRange} from "./init"; | ||
scale.domain = function(_) { | ||
return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1]; | ||
return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1]; | ||
}; | ||
scale.range = function(_) { | ||
return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice(); | ||
return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice(); | ||
}; | ||
@@ -33,0 +32,0 @@ |
@@ -24,3 +24,3 @@ import {identity} from "./continuous"; | ||
scale.domain = function(_) { | ||
return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1]; | ||
return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1]; | ||
}; | ||
@@ -27,0 +27,0 @@ |
@@ -16,3 +16,3 @@ import {ascending, bisect} from "d3-array"; | ||
domain = []; | ||
for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); | ||
for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d); | ||
domain.sort(ascending); | ||
@@ -19,0 +19,0 @@ return scale; |
import {bisect} from "d3-array"; | ||
import {slice} from "./array"; | ||
import {initRange} from "./init"; | ||
@@ -16,7 +15,7 @@ | ||
scale.domain = function(_) { | ||
return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice(); | ||
return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice(); | ||
}; | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice(); | ||
return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice(); | ||
}; | ||
@@ -23,0 +22,0 @@ |
import {bisector, tickStep} from "d3-array"; | ||
import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from "d3-time"; | ||
import {timeFormat} from "d3-time-format"; | ||
import {map} from "./array"; | ||
import continuous, {copy, identity} from "./continuous"; | ||
@@ -100,3 +99,3 @@ import {initRange} from "./init"; | ||
scale.domain = function(_) { | ||
return arguments.length ? domain(map.call(_, number)) : domain().map(date); | ||
return arguments.length ? domain(Array.from(_, number)) : domain().map(date); | ||
}; | ||
@@ -103,0 +102,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
5
190137
31
2076
952
+ Addedd3-array@2.12.1(transitive)
+ Addedinternmap@1.0.1(transitive)
- Removedd3-collection@1
- Removedd3-array@1.2.4(transitive)
- Removedd3-collection@1.0.7(transitive)
Updatedd3-array@^1.2.0 || 2