@tanstack/react-table 8.2.6 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/react-table/src/index.js +1 -0
- package/build/cjs/react-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +67 -3
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +67 -4
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1451 -106
- package/build/stats-react.json +18 -18
- package/build/umd/index.development.js +67 -3
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
package/build/stats-html.html
CHANGED
|
@@ -8,19 +8,12 @@
|
|
|
8
8
|
<title>RollUp Visualizer</title>
|
|
9
9
|
<style>
|
|
10
10
|
:root {
|
|
11
|
-
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
--
|
|
15
|
-
--text-color: #333;
|
|
11
|
+
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
|
|
12
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
13
|
+
--background-color: #2b2d42;
|
|
14
|
+
--text-color: #edf2f4;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
@media (prefers-color-scheme: dark) {
|
|
19
|
-
:root {
|
|
20
|
-
--background-color: #2b2d42;
|
|
21
|
-
--text-color: #edf2f4;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
17
|
html {
|
|
25
18
|
box-sizing: border-box;
|
|
26
19
|
}
|
|
@@ -151,9 +144,9 @@ main {
|
|
|
151
144
|
var drawChart = (function (exports) {
|
|
152
145
|
'use strict';
|
|
153
146
|
|
|
154
|
-
var n,l$1,u$1,t$1,
|
|
147
|
+
var n,l$1,u$1,t$1,o$2,r$1,f$1={},e$2=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s$1(n,l){for(var u in l)n[u]=l[u];return n}function a$1(n){var l=n.parentNode;l&&l.removeChild(n);}function h$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _$1(n,l){if(null==l)return n.__?_$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_$1(n):null}function k$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$1.__r++||o$2!==l$1.debounceRendering)&&((o$2=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s$1({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_$1(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$2,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$1(k,s,n):s=A$1(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_$1(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=_$1(i,h+1)),N(x[h],x[h]));if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$1(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$1(i,l,u):A$1(u,i,i,t,i.__e,l));return l}function A$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c$1.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$1(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);try{n:if("function"==typeof H){if(g=u.props,m=(a=H.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in H&&H.prototype.render?u.__c=h=new H(g,x):(u.__c=h=new d$1(g,x),h.constructor=H,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=H.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s$1({},h.__s)),s$1(h.__s,H.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==H.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==H.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,A=l$1.__r,C=0,"prototype"in H&&H.prototype.render)h.state=h.__s,h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context);else do{h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++C<25);h.state=h.__s,null!=h.getChildContext&&(t=s$1(s$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),$=null!=a&&a.type===p$1&&null==a.key?a.props.children:a,w$1(n,Array.isArray($)?$:[$],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l$1.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),h=(y=i.props||f$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C$1(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w$1(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_$1(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a$1(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||a$1(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j$1(i,u=(!o&&t||i).__k=h$1(p$1,null,[u]),r||f$1,f$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z$1(e,u);}function B$1(n,l){var u={__c:l="__cC"+r$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(b$1);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=e$2.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,d$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s$1({},this.state),"function"==typeof n&&(n=n(s$1({},u),this.props)),n&&s$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b$1(this));},d$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b$1(this));},d$1.prototype.render=p$1,t$1=[],g$1.__r=0,r$1=0;
|
|
155
148
|
|
|
156
|
-
var o$1=0;function e$1(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:_,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o$1,__source:
|
|
149
|
+
var o$1=0;function e$1(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:_,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o$1,__source:f,__self:t};if("function"==typeof _&&(l=_.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return l$1.vnode&&l$1.vnode(a),a}
|
|
157
150
|
|
|
158
151
|
function count$1(node) {
|
|
159
152
|
var sum = 0,
|
|
@@ -423,6 +416,8 @@ var drawChart = (function (exports) {
|
|
|
423
416
|
}
|
|
424
417
|
}
|
|
425
418
|
|
|
419
|
+
Object.create(Node$1.prototype);
|
|
420
|
+
|
|
426
421
|
function treemapSlice(parent, x0, y0, x1, y1) {
|
|
427
422
|
var nodes = parent.children,
|
|
428
423
|
node,
|
|
@@ -665,11 +660,11 @@ var drawChart = (function (exports) {
|
|
|
665
660
|
return availableSizeProperties;
|
|
666
661
|
};
|
|
667
662
|
|
|
668
|
-
var t,u,r,o=0,
|
|
663
|
+
var t,u,r,o,i=0,c=[],f=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function p(t,r){l$1.__h&&l$1.__h(u,t,i||r),i=0;var o=u.__H||(u.__H={__:[],__h:[]});return t>=o.__.length&&o.__.push({__V:f}),o.__[t]}function y(n){return i=1,d(z,n)}function d(n,r,o){var i=p(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):z(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function _(r,o){var i=p(t++,3);!l$1.__s&&w(i.__H,o)&&(i.__=r,i.u=o,u.__H.__h.push(i));}function h(r,o){var i=p(t++,4);!l$1.__s&&w(i.__H,o)&&(i.__=r,i.u=o,u.__h.push(i));}function s(n){return i=5,F(function(){return {current:n}},[])}function F(n,u){var r=p(t++,7);return w(r.__H,u)?(r.__V=n(),r.u=u,r.__h=n,r.__V):r.__}function q(n){var r=u.context[n.__c],o=p(t++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function b(){for(var t;t=c.shift();)if(t.__P)try{t.__H.__h.forEach(j),t.__H.__h.forEach(k),t.__H.__h=[];}catch(u){t.__H.__h=[],l$1.__e(u,t.__v);}}l$1.__b=function(n){u=null,e&&e(n);},l$1.__r=function(n){a&&a(n),t=0;var o=(u=n.__c).__H;o&&(r===u?(o.__h=[],u.__h=[],o.__.forEach(function(n){n.__V=f,n.u=void 0;})):(o.__h.forEach(j),o.__h.forEach(k),o.__h=[])),r=u;},l$1.diffed=function(t){v&&v(t);var i=t.__c;i&&i.__H&&(i.__H.__h.length&&(1!==c.push(i)&&o===l$1.requestAnimationFrame||((o=l$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),g&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);g&&(t=requestAnimationFrame(u));})(b)),i.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.__V!==f&&(n.__=n.__V),n.u=void 0,n.__V=f;})),r=u=null;},l$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(j),t.__h=t.__h.filter(function(n){return !n.__||k(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],l$1.__e(r,t.__v);}}),l&&l(t,u);},l$1.unmount=function(t){m&&m(t);var u,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{j(n);}catch(n){u=n;}}),u&&l$1.__e(u,r.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t=u,r=n.__c;"function"==typeof r&&(n.__c=void 0,r()),u=t;}function k(n){var t=u;n.__c=n.__(),u=t;}function w(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function z(n,t){return "function"==typeof t?t(n):t}
|
|
669
664
|
|
|
670
665
|
const SideBar = ({ availableSizeProperties, sizeProperty, setSizeProperty, onExcludeChange, onIncludeChange, }) => {
|
|
671
|
-
const [includeValue, setIncludeValue] =
|
|
672
|
-
const [excludeValue, setExcludeValue] =
|
|
666
|
+
const [includeValue, setIncludeValue] = y("");
|
|
667
|
+
const [excludeValue, setExcludeValue] = y("");
|
|
673
668
|
const handleSizePropertyChange = (sizeProp) => () => {
|
|
674
669
|
if (sizeProp !== sizeProperty) {
|
|
675
670
|
setSizeProperty(sizeProp);
|
|
@@ -688,8 +683,8 @@ var drawChart = (function (exports) {
|
|
|
688
683
|
return (e$1("aside", Object.assign({ className: "sidebar" }, { children: [e$1("div", Object.assign({ className: "size-selectors" }, { children: availableSizeProperties.length > 1 &&
|
|
689
684
|
availableSizeProperties.map((sizeProp) => {
|
|
690
685
|
const id = `selector-${sizeProp}`;
|
|
691
|
-
return (e$1("div", Object.assign({ className: "size-selector" }, { children: [e$1("input", { type: "radio", id: id, checked: sizeProp === sizeProperty, onChange: handleSizePropertyChange(sizeProp) }
|
|
692
|
-
}) })
|
|
686
|
+
return (e$1("div", Object.assign({ className: "size-selector" }, { children: [e$1("input", { type: "radio", id: id, checked: sizeProp === sizeProperty, onChange: handleSizePropertyChange(sizeProp) }), e$1("label", Object.assign({ htmlFor: id }, { children: LABELS[sizeProp] }))] }), sizeProp));
|
|
687
|
+
}) })), e$1("div", Object.assign({ className: "module-filters" }, { children: [e$1("div", Object.assign({ className: "module-filter" }, { children: [e$1("label", Object.assign({ htmlFor: "module-filter-exclude" }, { children: "Exclude" })), e$1("input", { type: "text", id: "module-filter-exclude", value: excludeValue, onInput: handleExcludeChange, placeholder: "RegExp" })] })), e$1("div", Object.assign({ className: "module-filter" }, { children: [e$1("label", Object.assign({ htmlFor: "module-filter-include" }, { children: "Include" })), e$1("input", { type: "text", id: "module-filter-include", value: includeValue, onInput: handleIncludeChange, placeholder: "RegExp" })] }))] }))] })));
|
|
693
688
|
};
|
|
694
689
|
|
|
695
690
|
const throttleFilter = (callback, limit) => {
|
|
@@ -705,11 +700,11 @@ var drawChart = (function (exports) {
|
|
|
705
700
|
};
|
|
706
701
|
};
|
|
707
702
|
const useFilter = () => {
|
|
708
|
-
const [includeFilter, setIncludeFilter] =
|
|
709
|
-
const [excludeFilter, setExcludeFilter] =
|
|
710
|
-
const setIncludeFilterTrottled =
|
|
711
|
-
const setExcludeFilterTrottled =
|
|
712
|
-
const isModuleIncluded =
|
|
703
|
+
const [includeFilter, setIncludeFilter] = y("");
|
|
704
|
+
const [excludeFilter, setExcludeFilter] = y("");
|
|
705
|
+
const setIncludeFilterTrottled = F(() => throttleFilter(setIncludeFilter, 200), []);
|
|
706
|
+
const setExcludeFilterTrottled = F(() => throttleFilter(setExcludeFilter, 200), []);
|
|
707
|
+
const isModuleIncluded = F(() => {
|
|
713
708
|
if (includeFilter === "") {
|
|
714
709
|
return () => true;
|
|
715
710
|
}
|
|
@@ -721,7 +716,7 @@ var drawChart = (function (exports) {
|
|
|
721
716
|
return () => false;
|
|
722
717
|
}
|
|
723
718
|
}, [includeFilter]);
|
|
724
|
-
const isModuleExcluded =
|
|
719
|
+
const isModuleExcluded = F(() => {
|
|
725
720
|
if (excludeFilter === "") {
|
|
726
721
|
return () => false;
|
|
727
722
|
}
|
|
@@ -734,7 +729,7 @@ var drawChart = (function (exports) {
|
|
|
734
729
|
}
|
|
735
730
|
}, [excludeFilter]);
|
|
736
731
|
const isDefaultInclude = includeFilter === "";
|
|
737
|
-
const getModuleFilterMultiplier =
|
|
732
|
+
const getModuleFilterMultiplier = F(() => {
|
|
738
733
|
return (data) => {
|
|
739
734
|
if (isDefaultInclude) {
|
|
740
735
|
return isModuleExcluded(data) ? 0 : 1;
|
|
@@ -755,15 +750,30 @@ var drawChart = (function (exports) {
|
|
|
755
750
|
return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
756
751
|
}
|
|
757
752
|
|
|
753
|
+
function descending(a, b) {
|
|
754
|
+
return a == null || b == null ? NaN
|
|
755
|
+
: b < a ? -1
|
|
756
|
+
: b > a ? 1
|
|
757
|
+
: b >= a ? 0
|
|
758
|
+
: NaN;
|
|
759
|
+
}
|
|
760
|
+
|
|
758
761
|
function bisector(f) {
|
|
759
|
-
let
|
|
760
|
-
let compare1 = f;
|
|
761
|
-
let compare2 = f;
|
|
762
|
+
let compare1, compare2, delta;
|
|
762
763
|
|
|
764
|
+
// If an accessor is specified, promote it to a comparator. In this case we
|
|
765
|
+
// can test whether the search value is (self-) comparable. We can’t do this
|
|
766
|
+
// for a comparator (except for specific, known comparators) because we can’t
|
|
767
|
+
// tell if the comparator is symmetric, and an asymmetric comparator can’t be
|
|
768
|
+
// used to test whether a single value is comparable.
|
|
763
769
|
if (f.length !== 2) {
|
|
764
|
-
delta = (d, x) => f(d) - x;
|
|
765
770
|
compare1 = ascending;
|
|
766
771
|
compare2 = (d, x) => ascending(f(d), x);
|
|
772
|
+
delta = (d, x) => f(d) - x;
|
|
773
|
+
} else {
|
|
774
|
+
compare1 = f === ascending || f === descending ? f : zero$1;
|
|
775
|
+
compare2 = f;
|
|
776
|
+
delta = f;
|
|
767
777
|
}
|
|
768
778
|
|
|
769
779
|
function left(a, x, lo = 0, hi = a.length) {
|
|
@@ -798,6 +808,10 @@ var drawChart = (function (exports) {
|
|
|
798
808
|
return {left, center, right};
|
|
799
809
|
}
|
|
800
810
|
|
|
811
|
+
function zero$1() {
|
|
812
|
+
return 0;
|
|
813
|
+
}
|
|
814
|
+
|
|
801
815
|
function number$1(x) {
|
|
802
816
|
return x === null ? NaN : +x;
|
|
803
817
|
}
|
|
@@ -805,7 +819,6 @@ var drawChart = (function (exports) {
|
|
|
805
819
|
const ascendingBisect = bisector(ascending);
|
|
806
820
|
const bisectRight = ascendingBisect.right;
|
|
807
821
|
bisector(number$1).center;
|
|
808
|
-
var bisect = bisectRight;
|
|
809
822
|
|
|
810
823
|
class InternMap extends Map {
|
|
811
824
|
constructor(entries, key = keyof) {
|
|
@@ -938,7 +951,7 @@ var drawChart = (function (exports) {
|
|
|
938
951
|
const PADDING = 2;
|
|
939
952
|
|
|
940
953
|
const Node = ({ node, onMouseOver, onClick, selected }) => {
|
|
941
|
-
const { getModuleColor } =
|
|
954
|
+
const { getModuleColor } = q(StaticContext);
|
|
942
955
|
const { backgroundColor, fontColor } = getModuleColor(node);
|
|
943
956
|
const { x0, x1, y1, y0, data, children = null } = node;
|
|
944
957
|
const textRef = s(null);
|
|
@@ -988,19 +1001,19 @@ var drawChart = (function (exports) {
|
|
|
988
1001
|
}, onMouseOver: (event) => {
|
|
989
1002
|
event.stopPropagation();
|
|
990
1003
|
onMouseOver(node);
|
|
991
|
-
} }, { children: [e$1("rect", { fill: backgroundColor, rx: 2, ry: 2, width: x1 - x0, height: y1 - y0, stroke: selected ? "#fff" : undefined, "stroke-width": selected ? 2 : undefined }
|
|
1004
|
+
} }, { children: [e$1("rect", { fill: backgroundColor, rx: 2, ry: 2, width: x1 - x0, height: y1 - y0, stroke: selected ? "#fff" : undefined, "stroke-width": selected ? 2 : undefined }), e$1("text", Object.assign({ ref: textRef, fill: fontColor, onClick: (event) => {
|
|
992
1005
|
var _a;
|
|
993
1006
|
if (((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) !== "") {
|
|
994
1007
|
event.stopPropagation();
|
|
995
1008
|
}
|
|
996
|
-
} }, textProps, { children: data.name })
|
|
1009
|
+
} }, textProps, { children: data.name }))] })));
|
|
997
1010
|
};
|
|
998
1011
|
|
|
999
1012
|
const TreeMap = ({ root, onNodeHover, selectedNode, onNodeClick }) => {
|
|
1000
|
-
const { width, height, getModuleIds } =
|
|
1013
|
+
const { width, height, getModuleIds } = q(StaticContext);
|
|
1001
1014
|
console.time("layering");
|
|
1002
1015
|
// this will make groups by height
|
|
1003
|
-
const nestedData =
|
|
1016
|
+
const nestedData = F(() => {
|
|
1004
1017
|
const nestedDataMap = group(root.descendants(), (d) => d.height);
|
|
1005
1018
|
const nestedData = Array.from(nestedDataMap, ([key, values]) => ({
|
|
1006
1019
|
key,
|
|
@@ -1014,7 +1027,7 @@ var drawChart = (function (exports) {
|
|
|
1014
1027
|
return (e$1("g", Object.assign({ className: "layer" }, { children: values.map((node) => {
|
|
1015
1028
|
return (e$1(Node, { node: node, onMouseOver: onNodeHover, selected: selectedNode === node, onClick: onNodeClick }, getModuleIds(node.data).nodeUid.id));
|
|
1016
1029
|
}) }), key));
|
|
1017
|
-
}) })
|
|
1030
|
+
}) })));
|
|
1018
1031
|
};
|
|
1019
1032
|
|
|
1020
1033
|
var bytes$1 = {exports: {}};
|
|
@@ -1181,19 +1194,23 @@ var drawChart = (function (exports) {
|
|
|
1181
1194
|
unit = results[4].toLowerCase();
|
|
1182
1195
|
}
|
|
1183
1196
|
|
|
1197
|
+
if (isNaN(floatValue)) {
|
|
1198
|
+
return null;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1184
1201
|
return Math.floor(map$1[unit] * floatValue);
|
|
1185
1202
|
}
|
|
1186
1203
|
|
|
1187
1204
|
const Tooltip_marginX = 10;
|
|
1188
1205
|
const Tooltip_marginY = 30;
|
|
1189
|
-
const SOURCEMAP_RENDERED = (e$1("span", { children: [" ", e$1("b", { children: LABELS.renderedLength }
|
|
1190
|
-
const RENDRED = (e$1("span", { children: [e$1("b", { children: LABELS.renderedLength }
|
|
1191
|
-
const COMPRESSED = (e$1("span", { children: [e$1("b", { children: LABELS.gzipLength }
|
|
1206
|
+
const SOURCEMAP_RENDERED = (e$1("span", { children: [" ", e$1("b", { children: LABELS.renderedLength }), " is a number of characters in the file after individual and ", e$1("br", {}), " whole bundle transformations according to sourcemap."] }));
|
|
1207
|
+
const RENDRED = (e$1("span", { children: [e$1("b", { children: LABELS.renderedLength }), " is a byte size of individual file after transformations and treeshake."] }));
|
|
1208
|
+
const COMPRESSED = (e$1("span", { children: [e$1("b", { children: LABELS.gzipLength }), " and ", e$1("b", { children: LABELS.brotliLength }), " is a byte size of individual file after individual", " ", "transformations,", e$1("br", {}), " treeshake and compression."] }));
|
|
1192
1209
|
const Tooltip = ({ node, visible, root, sizeProperty }) => {
|
|
1193
|
-
const { availableSizeProperties, getModuleSize, data } =
|
|
1210
|
+
const { availableSizeProperties, getModuleSize, data } = q(StaticContext);
|
|
1194
1211
|
const ref = s(null);
|
|
1195
|
-
const [style, setStyle] =
|
|
1196
|
-
const content =
|
|
1212
|
+
const [style, setStyle] = y({});
|
|
1213
|
+
const content = F(() => {
|
|
1197
1214
|
if (!node)
|
|
1198
1215
|
return null;
|
|
1199
1216
|
const mainSize = getModuleSize(node.data, sizeProperty);
|
|
@@ -1210,17 +1227,17 @@ var drawChart = (function (exports) {
|
|
|
1210
1227
|
const mainUid = data.nodeParts[node.data.uid].mainUid;
|
|
1211
1228
|
dataNode = data.nodeMetas[mainUid];
|
|
1212
1229
|
}
|
|
1213
|
-
return (e$1(
|
|
1230
|
+
return (e$1(p$1, { children: [e$1("div", { children: path }), availableSizeProperties.map((sizeProp) => {
|
|
1214
1231
|
if (sizeProp === sizeProperty) {
|
|
1215
|
-
return (e$1("div", { children: [e$1("b", { children: [LABELS[sizeProp], ": ", format_1(mainSize)] }
|
|
1232
|
+
return (e$1("div", { children: [e$1("b", { children: [LABELS[sizeProp], ": ", format_1(mainSize)] }), " ", "(", percentageString, ")"] }));
|
|
1216
1233
|
}
|
|
1217
1234
|
else {
|
|
1218
|
-
return (e$1("div", { children: [LABELS[sizeProp], ": ", format_1(getModuleSize(node.data, sizeProp))] }
|
|
1235
|
+
return (e$1("div", { children: [LABELS[sizeProp], ": ", format_1(getModuleSize(node.data, sizeProp))] }));
|
|
1219
1236
|
}
|
|
1220
|
-
}), e$1("br", {}
|
|
1237
|
+
}), e$1("br", {}), dataNode && dataNode.importedBy.length > 0 && (e$1("div", { children: [e$1("div", { children: [e$1("b", { children: "Imported By" }), ":"] }), dataNode.importedBy.map(({ uid }) => {
|
|
1221
1238
|
const id = data.nodeMetas[uid].id;
|
|
1222
1239
|
return e$1("div", { children: id }, id);
|
|
1223
|
-
})] }
|
|
1240
|
+
})] })), e$1("br", {}), e$1("small", { children: data.options.sourcemap ? SOURCEMAP_RENDERED : RENDRED }), (data.options.gzip || data.options.brotli) && (e$1(p$1, { children: [e$1("br", {}), e$1("small", { children: COMPRESSED })] }))] }));
|
|
1224
1241
|
}, [availableSizeProperties, data, getModuleSize, node, root.data, sizeProperty]);
|
|
1225
1242
|
const updatePosition = (mouseCoords) => {
|
|
1226
1243
|
if (!ref.current)
|
|
@@ -1240,7 +1257,7 @@ var drawChart = (function (exports) {
|
|
|
1240
1257
|
}
|
|
1241
1258
|
setStyle(pos);
|
|
1242
1259
|
};
|
|
1243
|
-
|
|
1260
|
+
_(() => {
|
|
1244
1261
|
const handleMouseMove = (event) => {
|
|
1245
1262
|
updatePosition({
|
|
1246
1263
|
x: event.pageX,
|
|
@@ -1252,13 +1269,13 @@ var drawChart = (function (exports) {
|
|
|
1252
1269
|
document.removeEventListener("mousemove", handleMouseMove, true);
|
|
1253
1270
|
};
|
|
1254
1271
|
}, []);
|
|
1255
|
-
return (e$1("div", Object.assign({ className: `tooltip ${visible ? "" : "tooltip-hidden"}`, ref: ref, style: style }, { children: content })
|
|
1272
|
+
return (e$1("div", Object.assign({ className: `tooltip ${visible ? "" : "tooltip-hidden"}`, ref: ref, style: style }, { children: content })));
|
|
1256
1273
|
};
|
|
1257
1274
|
|
|
1258
1275
|
const Chart = ({ root, sizeProperty, selectedNode, setSelectedNode }) => {
|
|
1259
|
-
const [showTooltip, setShowTooltip] =
|
|
1260
|
-
const [tooltipNode, setTooltipNode] =
|
|
1261
|
-
|
|
1276
|
+
const [showTooltip, setShowTooltip] = y(false);
|
|
1277
|
+
const [tooltipNode, setTooltipNode] = y(undefined);
|
|
1278
|
+
_(() => {
|
|
1262
1279
|
const handleMouseOut = () => {
|
|
1263
1280
|
setShowTooltip(false);
|
|
1264
1281
|
};
|
|
@@ -1267,21 +1284,21 @@ var drawChart = (function (exports) {
|
|
|
1267
1284
|
document.removeEventListener("mouseover", handleMouseOut);
|
|
1268
1285
|
};
|
|
1269
1286
|
}, []);
|
|
1270
|
-
return (e$1(
|
|
1287
|
+
return (e$1(p$1, { children: [e$1(TreeMap, { root: root, onNodeHover: (node) => {
|
|
1271
1288
|
setTooltipNode(node);
|
|
1272
1289
|
setShowTooltip(true);
|
|
1273
1290
|
}, selectedNode: selectedNode, onNodeClick: (node) => {
|
|
1274
1291
|
setSelectedNode(selectedNode === node ? undefined : node);
|
|
1275
|
-
} }
|
|
1292
|
+
} }), e$1(Tooltip, { visible: showTooltip, node: tooltipNode, root: root, sizeProperty: sizeProperty })] }));
|
|
1276
1293
|
};
|
|
1277
1294
|
|
|
1278
1295
|
const Main = () => {
|
|
1279
|
-
const { availableSizeProperties, rawHierarchy, getModuleSize, layout, data } =
|
|
1280
|
-
const [sizeProperty, setSizeProperty] =
|
|
1281
|
-
const [selectedNode, setSelectedNode] =
|
|
1296
|
+
const { availableSizeProperties, rawHierarchy, getModuleSize, layout, data } = q(StaticContext);
|
|
1297
|
+
const [sizeProperty, setSizeProperty] = y(availableSizeProperties[0]);
|
|
1298
|
+
const [selectedNode, setSelectedNode] = y(undefined);
|
|
1282
1299
|
const { getModuleFilterMultiplier, setExcludeFilter, setIncludeFilter } = useFilter();
|
|
1283
1300
|
console.time("getNodeSizeMultiplier");
|
|
1284
|
-
const getNodeSizeMultiplier =
|
|
1301
|
+
const getNodeSizeMultiplier = F(() => {
|
|
1285
1302
|
const rootSize = getModuleSize(rawHierarchy.data, sizeProperty);
|
|
1286
1303
|
const selectedSize = selectedNode ? getModuleSize(selectedNode.data, sizeProperty) : 1;
|
|
1287
1304
|
const multiplier = rootSize * 0.2 > selectedSize ? (rootSize * 0.2) / selectedSize : 3;
|
|
@@ -1309,7 +1326,7 @@ var drawChart = (function (exports) {
|
|
|
1309
1326
|
console.timeEnd("getNodeSizeMultiplier");
|
|
1310
1327
|
console.time("root hierarchy compute");
|
|
1311
1328
|
// root here always be the same as rawHierarchy even after layouting
|
|
1312
|
-
const root =
|
|
1329
|
+
const root = F(() => {
|
|
1313
1330
|
const rootWithSizesAndSorted = rawHierarchy
|
|
1314
1331
|
.sum((node) => {
|
|
1315
1332
|
if (isModuleTree(node))
|
|
@@ -1323,7 +1340,7 @@ var drawChart = (function (exports) {
|
|
|
1323
1340
|
return layout(rootWithSizesAndSorted);
|
|
1324
1341
|
}, [data, getModuleFilterMultiplier, getModuleSize, getNodeSizeMultiplier, layout, rawHierarchy, sizeProperty]);
|
|
1325
1342
|
console.timeEnd("root hierarchy compute");
|
|
1326
|
-
return (e$1(
|
|
1343
|
+
return (e$1(p$1, { children: [e$1(SideBar, { sizeProperty: sizeProperty, availableSizeProperties: availableSizeProperties, setSizeProperty: setSizeProperty, onExcludeChange: setExcludeFilter, onIncludeChange: setIncludeFilter }), e$1(Chart, { root: root, sizeProperty: sizeProperty, selectedNode: selectedNode, setSelectedNode: setSelectedNode })] }));
|
|
1327
1344
|
};
|
|
1328
1345
|
|
|
1329
1346
|
function initRange(domain, range) {
|
|
@@ -1370,15 +1387,15 @@ var drawChart = (function (exports) {
|
|
|
1370
1387
|
var brighter = 1 / darker;
|
|
1371
1388
|
|
|
1372
1389
|
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
1373
|
-
reN = "\\s*([+-]?\\d
|
|
1374
|
-
reP = "\\s*([+-]?\\d
|
|
1390
|
+
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
1391
|
+
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
1375
1392
|
reHex = /^#([0-9a-f]{3,8})$/,
|
|
1376
|
-
reRgbInteger = new RegExp(
|
|
1377
|
-
reRgbPercent = new RegExp(
|
|
1378
|
-
reRgbaInteger = new RegExp(
|
|
1379
|
-
reRgbaPercent = new RegExp(
|
|
1380
|
-
reHslPercent = new RegExp(
|
|
1381
|
-
reHslaPercent = new RegExp(
|
|
1393
|
+
reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
|
|
1394
|
+
reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
|
|
1395
|
+
reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
|
|
1396
|
+
reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
|
|
1397
|
+
reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
|
|
1398
|
+
reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
1382
1399
|
|
|
1383
1400
|
var named = {
|
|
1384
1401
|
aliceblue: 0xf0f8ff,
|
|
@@ -1532,14 +1549,15 @@ var drawChart = (function (exports) {
|
|
|
1532
1549
|
};
|
|
1533
1550
|
|
|
1534
1551
|
define(Color, color, {
|
|
1535
|
-
copy
|
|
1552
|
+
copy(channels) {
|
|
1536
1553
|
return Object.assign(new this.constructor, this, channels);
|
|
1537
1554
|
},
|
|
1538
|
-
displayable
|
|
1555
|
+
displayable() {
|
|
1539
1556
|
return this.rgb().displayable();
|
|
1540
1557
|
},
|
|
1541
1558
|
hex: color_formatHex, // Deprecated! Use color.formatHex.
|
|
1542
1559
|
formatHex: color_formatHex,
|
|
1560
|
+
formatHex8: color_formatHex8,
|
|
1543
1561
|
formatHsl: color_formatHsl,
|
|
1544
1562
|
formatRgb: color_formatRgb,
|
|
1545
1563
|
toString: color_formatRgb
|
|
@@ -1549,6 +1567,10 @@ var drawChart = (function (exports) {
|
|
|
1549
1567
|
return this.rgb().formatHex();
|
|
1550
1568
|
}
|
|
1551
1569
|
|
|
1570
|
+
function color_formatHex8() {
|
|
1571
|
+
return this.rgb().formatHex8();
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1552
1574
|
function color_formatHsl() {
|
|
1553
1575
|
return hslConvert(this).formatHsl();
|
|
1554
1576
|
}
|
|
@@ -1604,18 +1626,21 @@ var drawChart = (function (exports) {
|
|
|
1604
1626
|
}
|
|
1605
1627
|
|
|
1606
1628
|
define(Rgb, rgb$1, extend(Color, {
|
|
1607
|
-
brighter
|
|
1629
|
+
brighter(k) {
|
|
1608
1630
|
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1609
1631
|
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1610
1632
|
},
|
|
1611
|
-
darker
|
|
1633
|
+
darker(k) {
|
|
1612
1634
|
k = k == null ? darker : Math.pow(darker, k);
|
|
1613
1635
|
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1614
1636
|
},
|
|
1615
|
-
rgb
|
|
1637
|
+
rgb() {
|
|
1616
1638
|
return this;
|
|
1617
1639
|
},
|
|
1618
|
-
|
|
1640
|
+
clamp() {
|
|
1641
|
+
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
1642
|
+
},
|
|
1643
|
+
displayable() {
|
|
1619
1644
|
return (-0.5 <= this.r && this.r < 255.5)
|
|
1620
1645
|
&& (-0.5 <= this.g && this.g < 255.5)
|
|
1621
1646
|
&& (-0.5 <= this.b && this.b < 255.5)
|
|
@@ -1623,25 +1648,34 @@ var drawChart = (function (exports) {
|
|
|
1623
1648
|
},
|
|
1624
1649
|
hex: rgb_formatHex, // Deprecated! Use color.formatHex.
|
|
1625
1650
|
formatHex: rgb_formatHex,
|
|
1651
|
+
formatHex8: rgb_formatHex8,
|
|
1626
1652
|
formatRgb: rgb_formatRgb,
|
|
1627
1653
|
toString: rgb_formatRgb
|
|
1628
1654
|
}));
|
|
1629
1655
|
|
|
1630
1656
|
function rgb_formatHex() {
|
|
1631
|
-
return
|
|
1657
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
function rgb_formatHex8() {
|
|
1661
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
1632
1662
|
}
|
|
1633
1663
|
|
|
1634
1664
|
function rgb_formatRgb() {
|
|
1635
|
-
|
|
1636
|
-
return
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1665
|
+
const a = clampa(this.opacity);
|
|
1666
|
+
return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
function clampa(opacity) {
|
|
1670
|
+
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
function clampi(value) {
|
|
1674
|
+
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
1641
1675
|
}
|
|
1642
1676
|
|
|
1643
1677
|
function hex(value) {
|
|
1644
|
-
value =
|
|
1678
|
+
value = clampi(value);
|
|
1645
1679
|
return (value < 16 ? "0" : "") + value.toString(16);
|
|
1646
1680
|
}
|
|
1647
1681
|
|
|
@@ -1690,15 +1724,15 @@ var drawChart = (function (exports) {
|
|
|
1690
1724
|
}
|
|
1691
1725
|
|
|
1692
1726
|
define(Hsl, hsl, extend(Color, {
|
|
1693
|
-
brighter
|
|
1727
|
+
brighter(k) {
|
|
1694
1728
|
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1695
1729
|
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1696
1730
|
},
|
|
1697
|
-
darker
|
|
1731
|
+
darker(k) {
|
|
1698
1732
|
k = k == null ? darker : Math.pow(darker, k);
|
|
1699
1733
|
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1700
1734
|
},
|
|
1701
|
-
rgb
|
|
1735
|
+
rgb() {
|
|
1702
1736
|
var h = this.h % 360 + (this.h < 0) * 360,
|
|
1703
1737
|
s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
|
1704
1738
|
l = this.l,
|
|
@@ -1711,21 +1745,29 @@ var drawChart = (function (exports) {
|
|
|
1711
1745
|
this.opacity
|
|
1712
1746
|
);
|
|
1713
1747
|
},
|
|
1714
|
-
|
|
1748
|
+
clamp() {
|
|
1749
|
+
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
1750
|
+
},
|
|
1751
|
+
displayable() {
|
|
1715
1752
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s))
|
|
1716
1753
|
&& (0 <= this.l && this.l <= 1)
|
|
1717
1754
|
&& (0 <= this.opacity && this.opacity <= 1);
|
|
1718
1755
|
},
|
|
1719
|
-
formatHsl
|
|
1720
|
-
|
|
1721
|
-
return
|
|
1722
|
-
+ (this.h || 0) + ", "
|
|
1723
|
-
+ (this.s || 0) * 100 + "%, "
|
|
1724
|
-
+ (this.l || 0) * 100 + "%"
|
|
1725
|
-
+ (a === 1 ? ")" : ", " + a + ")");
|
|
1756
|
+
formatHsl() {
|
|
1757
|
+
const a = clampa(this.opacity);
|
|
1758
|
+
return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
|
1726
1759
|
}
|
|
1727
1760
|
}));
|
|
1728
1761
|
|
|
1762
|
+
function clamph(value) {
|
|
1763
|
+
value = (value || 0) % 360;
|
|
1764
|
+
return value < 0 ? value + 360 : value;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
function clampt(value) {
|
|
1768
|
+
return Math.max(0, Math.min(1, value || 0));
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1729
1771
|
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
1730
1772
|
function hsl2rgb(h, m1, m2) {
|
|
1731
1773
|
return (h < 60 ? m1 + (m2 - m1) * h / 60
|
|
@@ -1734,6 +1776,179 @@ var drawChart = (function (exports) {
|
|
|
1734
1776
|
: m1) * 255;
|
|
1735
1777
|
}
|
|
1736
1778
|
|
|
1779
|
+
const radians = Math.PI / 180;
|
|
1780
|
+
const degrees = 180 / Math.PI;
|
|
1781
|
+
|
|
1782
|
+
// https://observablehq.com/@mbostock/lab-and-rgb
|
|
1783
|
+
const K = 18,
|
|
1784
|
+
Xn = 0.96422,
|
|
1785
|
+
Yn = 1,
|
|
1786
|
+
Zn = 0.82521,
|
|
1787
|
+
t0$1 = 4 / 29,
|
|
1788
|
+
t1$1 = 6 / 29,
|
|
1789
|
+
t2 = 3 * t1$1 * t1$1,
|
|
1790
|
+
t3 = t1$1 * t1$1 * t1$1;
|
|
1791
|
+
|
|
1792
|
+
function labConvert(o) {
|
|
1793
|
+
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
|
|
1794
|
+
if (o instanceof Hcl) return hcl2lab(o);
|
|
1795
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
1796
|
+
var r = rgb2lrgb(o.r),
|
|
1797
|
+
g = rgb2lrgb(o.g),
|
|
1798
|
+
b = rgb2lrgb(o.b),
|
|
1799
|
+
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
|
|
1800
|
+
if (r === g && g === b) x = z = y; else {
|
|
1801
|
+
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
|
|
1802
|
+
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
|
|
1803
|
+
}
|
|
1804
|
+
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
function lab(l, a, b, opacity) {
|
|
1808
|
+
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
function Lab(l, a, b, opacity) {
|
|
1812
|
+
this.l = +l;
|
|
1813
|
+
this.a = +a;
|
|
1814
|
+
this.b = +b;
|
|
1815
|
+
this.opacity = +opacity;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
define(Lab, lab, extend(Color, {
|
|
1819
|
+
brighter(k) {
|
|
1820
|
+
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1821
|
+
},
|
|
1822
|
+
darker(k) {
|
|
1823
|
+
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1824
|
+
},
|
|
1825
|
+
rgb() {
|
|
1826
|
+
var y = (this.l + 16) / 116,
|
|
1827
|
+
x = isNaN(this.a) ? y : y + this.a / 500,
|
|
1828
|
+
z = isNaN(this.b) ? y : y - this.b / 200;
|
|
1829
|
+
x = Xn * lab2xyz(x);
|
|
1830
|
+
y = Yn * lab2xyz(y);
|
|
1831
|
+
z = Zn * lab2xyz(z);
|
|
1832
|
+
return new Rgb(
|
|
1833
|
+
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
|
|
1834
|
+
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
|
|
1835
|
+
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
|
|
1836
|
+
this.opacity
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
}));
|
|
1840
|
+
|
|
1841
|
+
function xyz2lab(t) {
|
|
1842
|
+
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0$1;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
function lab2xyz(t) {
|
|
1846
|
+
return t > t1$1 ? t * t * t : t2 * (t - t0$1);
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
function lrgb2rgb(x) {
|
|
1850
|
+
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
function rgb2lrgb(x) {
|
|
1854
|
+
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
function hclConvert(o) {
|
|
1858
|
+
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
|
|
1859
|
+
if (!(o instanceof Lab)) o = labConvert(o);
|
|
1860
|
+
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
1861
|
+
var h = Math.atan2(o.b, o.a) * degrees;
|
|
1862
|
+
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
function hcl(h, c, l, opacity) {
|
|
1866
|
+
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
function Hcl(h, c, l, opacity) {
|
|
1870
|
+
this.h = +h;
|
|
1871
|
+
this.c = +c;
|
|
1872
|
+
this.l = +l;
|
|
1873
|
+
this.opacity = +opacity;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
function hcl2lab(o) {
|
|
1877
|
+
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
|
|
1878
|
+
var h = o.h * radians;
|
|
1879
|
+
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
define(Hcl, hcl, extend(Color, {
|
|
1883
|
+
brighter(k) {
|
|
1884
|
+
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
|
|
1885
|
+
},
|
|
1886
|
+
darker(k) {
|
|
1887
|
+
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
|
|
1888
|
+
},
|
|
1889
|
+
rgb() {
|
|
1890
|
+
return hcl2lab(this).rgb();
|
|
1891
|
+
}
|
|
1892
|
+
}));
|
|
1893
|
+
|
|
1894
|
+
var A = -0.14861,
|
|
1895
|
+
B = +1.78277,
|
|
1896
|
+
C = -0.29227,
|
|
1897
|
+
D = -0.90649,
|
|
1898
|
+
E = +1.97294,
|
|
1899
|
+
ED = E * D,
|
|
1900
|
+
EB = E * B,
|
|
1901
|
+
BC_DA = B * C - D * A;
|
|
1902
|
+
|
|
1903
|
+
function cubehelixConvert(o) {
|
|
1904
|
+
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
|
|
1905
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
1906
|
+
var r = o.r / 255,
|
|
1907
|
+
g = o.g / 255,
|
|
1908
|
+
b = o.b / 255,
|
|
1909
|
+
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
|
|
1910
|
+
bl = b - l,
|
|
1911
|
+
k = (E * (g - l) - C * bl) / D,
|
|
1912
|
+
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
|
|
1913
|
+
h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;
|
|
1914
|
+
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
function cubehelix$1(h, s, l, opacity) {
|
|
1918
|
+
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
function Cubehelix(h, s, l, opacity) {
|
|
1922
|
+
this.h = +h;
|
|
1923
|
+
this.s = +s;
|
|
1924
|
+
this.l = +l;
|
|
1925
|
+
this.opacity = +opacity;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
define(Cubehelix, cubehelix$1, extend(Color, {
|
|
1929
|
+
brighter(k) {
|
|
1930
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1931
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
1932
|
+
},
|
|
1933
|
+
darker(k) {
|
|
1934
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
1935
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
1936
|
+
},
|
|
1937
|
+
rgb() {
|
|
1938
|
+
var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,
|
|
1939
|
+
l = +this.l,
|
|
1940
|
+
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
|
|
1941
|
+
cosh = Math.cos(h),
|
|
1942
|
+
sinh = Math.sin(h);
|
|
1943
|
+
return new Rgb(
|
|
1944
|
+
255 * (l + a * (A * cosh + B * sinh)),
|
|
1945
|
+
255 * (l + a * (C * cosh + D * sinh)),
|
|
1946
|
+
255 * (l + a * (E * cosh)),
|
|
1947
|
+
this.opacity
|
|
1948
|
+
);
|
|
1949
|
+
}
|
|
1950
|
+
}));
|
|
1951
|
+
|
|
1737
1952
|
var constant = x => () => x;
|
|
1738
1953
|
|
|
1739
1954
|
function linear$1(a, d) {
|
|
@@ -1748,6 +1963,11 @@ var drawChart = (function (exports) {
|
|
|
1748
1963
|
};
|
|
1749
1964
|
}
|
|
1750
1965
|
|
|
1966
|
+
function hue(a, b) {
|
|
1967
|
+
var d = b - a;
|
|
1968
|
+
return d ? linear$1(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1751
1971
|
function gamma(y) {
|
|
1752
1972
|
return (y = +y) === 1 ? nogamma : function(a, b) {
|
|
1753
1973
|
return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
|
@@ -1929,6 +2149,105 @@ var drawChart = (function (exports) {
|
|
|
1929
2149
|
};
|
|
1930
2150
|
}
|
|
1931
2151
|
|
|
2152
|
+
var epsilon2 = 1e-12;
|
|
2153
|
+
|
|
2154
|
+
function cosh(x) {
|
|
2155
|
+
return ((x = Math.exp(x)) + 1 / x) / 2;
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
function sinh(x) {
|
|
2159
|
+
return ((x = Math.exp(x)) - 1 / x) / 2;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
function tanh(x) {
|
|
2163
|
+
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
((function zoomRho(rho, rho2, rho4) {
|
|
2167
|
+
|
|
2168
|
+
// p0 = [ux0, uy0, w0]
|
|
2169
|
+
// p1 = [ux1, uy1, w1]
|
|
2170
|
+
function zoom(p0, p1) {
|
|
2171
|
+
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
|
|
2172
|
+
ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
|
|
2173
|
+
dx = ux1 - ux0,
|
|
2174
|
+
dy = uy1 - uy0,
|
|
2175
|
+
d2 = dx * dx + dy * dy,
|
|
2176
|
+
i,
|
|
2177
|
+
S;
|
|
2178
|
+
|
|
2179
|
+
// Special case for u0 ≅ u1.
|
|
2180
|
+
if (d2 < epsilon2) {
|
|
2181
|
+
S = Math.log(w1 / w0) / rho;
|
|
2182
|
+
i = function(t) {
|
|
2183
|
+
return [
|
|
2184
|
+
ux0 + t * dx,
|
|
2185
|
+
uy0 + t * dy,
|
|
2186
|
+
w0 * Math.exp(rho * t * S)
|
|
2187
|
+
];
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
// General case.
|
|
2192
|
+
else {
|
|
2193
|
+
var d1 = Math.sqrt(d2),
|
|
2194
|
+
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
|
2195
|
+
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
|
2196
|
+
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
|
2197
|
+
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
2198
|
+
S = (r1 - r0) / rho;
|
|
2199
|
+
i = function(t) {
|
|
2200
|
+
var s = t * S,
|
|
2201
|
+
coshr0 = cosh(r0),
|
|
2202
|
+
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
2203
|
+
return [
|
|
2204
|
+
ux0 + u * dx,
|
|
2205
|
+
uy0 + u * dy,
|
|
2206
|
+
w0 * coshr0 / cosh(rho * s + r0)
|
|
2207
|
+
];
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
i.duration = S * 1000 * rho / Math.SQRT2;
|
|
2212
|
+
|
|
2213
|
+
return i;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
zoom.rho = function(_) {
|
|
2217
|
+
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
|
|
2218
|
+
return zoomRho(_1, _2, _4);
|
|
2219
|
+
};
|
|
2220
|
+
|
|
2221
|
+
return zoom;
|
|
2222
|
+
}))(Math.SQRT2, 2, 4);
|
|
2223
|
+
|
|
2224
|
+
function cubehelix(hue) {
|
|
2225
|
+
return (function cubehelixGamma(y) {
|
|
2226
|
+
y = +y;
|
|
2227
|
+
|
|
2228
|
+
function cubehelix(start, end) {
|
|
2229
|
+
var h = hue((start = cubehelix$1(start)).h, (end = cubehelix$1(end)).h),
|
|
2230
|
+
s = nogamma(start.s, end.s),
|
|
2231
|
+
l = nogamma(start.l, end.l),
|
|
2232
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
2233
|
+
return function(t) {
|
|
2234
|
+
start.h = h(t);
|
|
2235
|
+
start.s = s(t);
|
|
2236
|
+
start.l = l(Math.pow(t, y));
|
|
2237
|
+
start.opacity = opacity(t);
|
|
2238
|
+
return start + "";
|
|
2239
|
+
};
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
cubehelix.gamma = cubehelixGamma;
|
|
2243
|
+
|
|
2244
|
+
return cubehelix;
|
|
2245
|
+
})(1);
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
cubehelix(hue);
|
|
2249
|
+
cubehelix(nogamma);
|
|
2250
|
+
|
|
1932
2251
|
function constants(x) {
|
|
1933
2252
|
return function() {
|
|
1934
2253
|
return x;
|
|
@@ -1984,7 +2303,7 @@ var drawChart = (function (exports) {
|
|
|
1984
2303
|
}
|
|
1985
2304
|
|
|
1986
2305
|
return function(x) {
|
|
1987
|
-
var i =
|
|
2306
|
+
var i = bisectRight(domain, x, 1, j) - 1;
|
|
1988
2307
|
return r[i](d[i](x));
|
|
1989
2308
|
};
|
|
1990
2309
|
}
|
|
@@ -2220,7 +2539,7 @@ var drawChart = (function (exports) {
|
|
|
2220
2539
|
var map = Array.prototype.map,
|
|
2221
2540
|
prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
|
|
2222
2541
|
|
|
2223
|
-
function formatLocale(locale) {
|
|
2542
|
+
function formatLocale$1(locale) {
|
|
2224
2543
|
var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
|
|
2225
2544
|
currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
|
|
2226
2545
|
currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
|
|
@@ -2357,21 +2676,21 @@ var drawChart = (function (exports) {
|
|
|
2357
2676
|
};
|
|
2358
2677
|
}
|
|
2359
2678
|
|
|
2360
|
-
var locale;
|
|
2679
|
+
var locale$1;
|
|
2361
2680
|
var format;
|
|
2362
2681
|
var formatPrefix;
|
|
2363
2682
|
|
|
2364
|
-
defaultLocale({
|
|
2683
|
+
defaultLocale$1({
|
|
2365
2684
|
thousands: ",",
|
|
2366
2685
|
grouping: [3],
|
|
2367
2686
|
currency: ["$", ""]
|
|
2368
2687
|
});
|
|
2369
2688
|
|
|
2370
|
-
function defaultLocale(definition) {
|
|
2371
|
-
locale = formatLocale(definition);
|
|
2372
|
-
format = locale.format;
|
|
2373
|
-
formatPrefix = locale.formatPrefix;
|
|
2374
|
-
return locale;
|
|
2689
|
+
function defaultLocale$1(definition) {
|
|
2690
|
+
locale$1 = formatLocale$1(definition);
|
|
2691
|
+
format = locale$1.format;
|
|
2692
|
+
formatPrefix = locale$1.formatPrefix;
|
|
2693
|
+
return locale$1;
|
|
2375
2694
|
}
|
|
2376
2695
|
|
|
2377
2696
|
function precisionFixed(step) {
|
|
@@ -2480,6 +2799,1032 @@ var drawChart = (function (exports) {
|
|
|
2480
2799
|
return linearish(scale);
|
|
2481
2800
|
}
|
|
2482
2801
|
|
|
2802
|
+
var t0 = new Date,
|
|
2803
|
+
t1 = new Date;
|
|
2804
|
+
|
|
2805
|
+
function newInterval(floori, offseti, count, field) {
|
|
2806
|
+
|
|
2807
|
+
function interval(date) {
|
|
2808
|
+
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
interval.floor = function(date) {
|
|
2812
|
+
return floori(date = new Date(+date)), date;
|
|
2813
|
+
};
|
|
2814
|
+
|
|
2815
|
+
interval.ceil = function(date) {
|
|
2816
|
+
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
2817
|
+
};
|
|
2818
|
+
|
|
2819
|
+
interval.round = function(date) {
|
|
2820
|
+
var d0 = interval(date),
|
|
2821
|
+
d1 = interval.ceil(date);
|
|
2822
|
+
return date - d0 < d1 - date ? d0 : d1;
|
|
2823
|
+
};
|
|
2824
|
+
|
|
2825
|
+
interval.offset = function(date, step) {
|
|
2826
|
+
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2829
|
+
interval.range = function(start, stop, step) {
|
|
2830
|
+
var range = [], previous;
|
|
2831
|
+
start = interval.ceil(start);
|
|
2832
|
+
step = step == null ? 1 : Math.floor(step);
|
|
2833
|
+
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
2834
|
+
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
2835
|
+
while (previous < start && start < stop);
|
|
2836
|
+
return range;
|
|
2837
|
+
};
|
|
2838
|
+
|
|
2839
|
+
interval.filter = function(test) {
|
|
2840
|
+
return newInterval(function(date) {
|
|
2841
|
+
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
2842
|
+
}, function(date, step) {
|
|
2843
|
+
if (date >= date) {
|
|
2844
|
+
if (step < 0) while (++step <= 0) {
|
|
2845
|
+
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
2846
|
+
} else while (--step >= 0) {
|
|
2847
|
+
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
});
|
|
2851
|
+
};
|
|
2852
|
+
|
|
2853
|
+
if (count) {
|
|
2854
|
+
interval.count = function(start, end) {
|
|
2855
|
+
t0.setTime(+start), t1.setTime(+end);
|
|
2856
|
+
floori(t0), floori(t1);
|
|
2857
|
+
return Math.floor(count(t0, t1));
|
|
2858
|
+
};
|
|
2859
|
+
|
|
2860
|
+
interval.every = function(step) {
|
|
2861
|
+
step = Math.floor(step);
|
|
2862
|
+
return !isFinite(step) || !(step > 0) ? null
|
|
2863
|
+
: !(step > 1) ? interval
|
|
2864
|
+
: interval.filter(field
|
|
2865
|
+
? function(d) { return field(d) % step === 0; }
|
|
2866
|
+
: function(d) { return interval.count(0, d) % step === 0; });
|
|
2867
|
+
};
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
return interval;
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
var millisecond = newInterval(function() {
|
|
2874
|
+
// noop
|
|
2875
|
+
}, function(date, step) {
|
|
2876
|
+
date.setTime(+date + step);
|
|
2877
|
+
}, function(start, end) {
|
|
2878
|
+
return end - start;
|
|
2879
|
+
});
|
|
2880
|
+
|
|
2881
|
+
// An optimized implementation for this simple case.
|
|
2882
|
+
millisecond.every = function(k) {
|
|
2883
|
+
k = Math.floor(k);
|
|
2884
|
+
if (!isFinite(k) || !(k > 0)) return null;
|
|
2885
|
+
if (!(k > 1)) return millisecond;
|
|
2886
|
+
return newInterval(function(date) {
|
|
2887
|
+
date.setTime(Math.floor(date / k) * k);
|
|
2888
|
+
}, function(date, step) {
|
|
2889
|
+
date.setTime(+date + step * k);
|
|
2890
|
+
}, function(start, end) {
|
|
2891
|
+
return (end - start) / k;
|
|
2892
|
+
});
|
|
2893
|
+
};
|
|
2894
|
+
millisecond.range;
|
|
2895
|
+
|
|
2896
|
+
const durationSecond = 1000;
|
|
2897
|
+
const durationMinute = durationSecond * 60;
|
|
2898
|
+
const durationHour = durationMinute * 60;
|
|
2899
|
+
const durationDay = durationHour * 24;
|
|
2900
|
+
const durationWeek = durationDay * 7;
|
|
2901
|
+
|
|
2902
|
+
var second = newInterval(function(date) {
|
|
2903
|
+
date.setTime(date - date.getMilliseconds());
|
|
2904
|
+
}, function(date, step) {
|
|
2905
|
+
date.setTime(+date + step * durationSecond);
|
|
2906
|
+
}, function(start, end) {
|
|
2907
|
+
return (end - start) / durationSecond;
|
|
2908
|
+
}, function(date) {
|
|
2909
|
+
return date.getUTCSeconds();
|
|
2910
|
+
});
|
|
2911
|
+
second.range;
|
|
2912
|
+
|
|
2913
|
+
var minute = newInterval(function(date) {
|
|
2914
|
+
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
|
2915
|
+
}, function(date, step) {
|
|
2916
|
+
date.setTime(+date + step * durationMinute);
|
|
2917
|
+
}, function(start, end) {
|
|
2918
|
+
return (end - start) / durationMinute;
|
|
2919
|
+
}, function(date) {
|
|
2920
|
+
return date.getMinutes();
|
|
2921
|
+
});
|
|
2922
|
+
minute.range;
|
|
2923
|
+
|
|
2924
|
+
var hour = newInterval(function(date) {
|
|
2925
|
+
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
|
2926
|
+
}, function(date, step) {
|
|
2927
|
+
date.setTime(+date + step * durationHour);
|
|
2928
|
+
}, function(start, end) {
|
|
2929
|
+
return (end - start) / durationHour;
|
|
2930
|
+
}, function(date) {
|
|
2931
|
+
return date.getHours();
|
|
2932
|
+
});
|
|
2933
|
+
hour.range;
|
|
2934
|
+
|
|
2935
|
+
var day = newInterval(
|
|
2936
|
+
date => date.setHours(0, 0, 0, 0),
|
|
2937
|
+
(date, step) => date.setDate(date.getDate() + step),
|
|
2938
|
+
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
|
2939
|
+
date => date.getDate() - 1
|
|
2940
|
+
);
|
|
2941
|
+
day.range;
|
|
2942
|
+
|
|
2943
|
+
function weekday(i) {
|
|
2944
|
+
return newInterval(function(date) {
|
|
2945
|
+
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
2946
|
+
date.setHours(0, 0, 0, 0);
|
|
2947
|
+
}, function(date, step) {
|
|
2948
|
+
date.setDate(date.getDate() + step * 7);
|
|
2949
|
+
}, function(start, end) {
|
|
2950
|
+
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
2951
|
+
});
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
var sunday = weekday(0);
|
|
2955
|
+
var monday = weekday(1);
|
|
2956
|
+
var tuesday = weekday(2);
|
|
2957
|
+
var wednesday = weekday(3);
|
|
2958
|
+
var thursday = weekday(4);
|
|
2959
|
+
var friday = weekday(5);
|
|
2960
|
+
var saturday = weekday(6);
|
|
2961
|
+
|
|
2962
|
+
sunday.range;
|
|
2963
|
+
monday.range;
|
|
2964
|
+
tuesday.range;
|
|
2965
|
+
wednesday.range;
|
|
2966
|
+
thursday.range;
|
|
2967
|
+
friday.range;
|
|
2968
|
+
saturday.range;
|
|
2969
|
+
|
|
2970
|
+
var month = newInterval(function(date) {
|
|
2971
|
+
date.setDate(1);
|
|
2972
|
+
date.setHours(0, 0, 0, 0);
|
|
2973
|
+
}, function(date, step) {
|
|
2974
|
+
date.setMonth(date.getMonth() + step);
|
|
2975
|
+
}, function(start, end) {
|
|
2976
|
+
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
2977
|
+
}, function(date) {
|
|
2978
|
+
return date.getMonth();
|
|
2979
|
+
});
|
|
2980
|
+
month.range;
|
|
2981
|
+
|
|
2982
|
+
var year = newInterval(function(date) {
|
|
2983
|
+
date.setMonth(0, 1);
|
|
2984
|
+
date.setHours(0, 0, 0, 0);
|
|
2985
|
+
}, function(date, step) {
|
|
2986
|
+
date.setFullYear(date.getFullYear() + step);
|
|
2987
|
+
}, function(start, end) {
|
|
2988
|
+
return end.getFullYear() - start.getFullYear();
|
|
2989
|
+
}, function(date) {
|
|
2990
|
+
return date.getFullYear();
|
|
2991
|
+
});
|
|
2992
|
+
|
|
2993
|
+
// An optimized implementation for this simple case.
|
|
2994
|
+
year.every = function(k) {
|
|
2995
|
+
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
2996
|
+
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
2997
|
+
date.setMonth(0, 1);
|
|
2998
|
+
date.setHours(0, 0, 0, 0);
|
|
2999
|
+
}, function(date, step) {
|
|
3000
|
+
date.setFullYear(date.getFullYear() + step * k);
|
|
3001
|
+
});
|
|
3002
|
+
};
|
|
3003
|
+
year.range;
|
|
3004
|
+
|
|
3005
|
+
var utcMinute = newInterval(function(date) {
|
|
3006
|
+
date.setUTCSeconds(0, 0);
|
|
3007
|
+
}, function(date, step) {
|
|
3008
|
+
date.setTime(+date + step * durationMinute);
|
|
3009
|
+
}, function(start, end) {
|
|
3010
|
+
return (end - start) / durationMinute;
|
|
3011
|
+
}, function(date) {
|
|
3012
|
+
return date.getUTCMinutes();
|
|
3013
|
+
});
|
|
3014
|
+
utcMinute.range;
|
|
3015
|
+
|
|
3016
|
+
var utcHour = newInterval(function(date) {
|
|
3017
|
+
date.setUTCMinutes(0, 0, 0);
|
|
3018
|
+
}, function(date, step) {
|
|
3019
|
+
date.setTime(+date + step * durationHour);
|
|
3020
|
+
}, function(start, end) {
|
|
3021
|
+
return (end - start) / durationHour;
|
|
3022
|
+
}, function(date) {
|
|
3023
|
+
return date.getUTCHours();
|
|
3024
|
+
});
|
|
3025
|
+
utcHour.range;
|
|
3026
|
+
|
|
3027
|
+
var utcDay = newInterval(function(date) {
|
|
3028
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3029
|
+
}, function(date, step) {
|
|
3030
|
+
date.setUTCDate(date.getUTCDate() + step);
|
|
3031
|
+
}, function(start, end) {
|
|
3032
|
+
return (end - start) / durationDay;
|
|
3033
|
+
}, function(date) {
|
|
3034
|
+
return date.getUTCDate() - 1;
|
|
3035
|
+
});
|
|
3036
|
+
utcDay.range;
|
|
3037
|
+
|
|
3038
|
+
function utcWeekday(i) {
|
|
3039
|
+
return newInterval(function(date) {
|
|
3040
|
+
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
3041
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3042
|
+
}, function(date, step) {
|
|
3043
|
+
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
3044
|
+
}, function(start, end) {
|
|
3045
|
+
return (end - start) / durationWeek;
|
|
3046
|
+
});
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
var utcSunday = utcWeekday(0);
|
|
3050
|
+
var utcMonday = utcWeekday(1);
|
|
3051
|
+
var utcTuesday = utcWeekday(2);
|
|
3052
|
+
var utcWednesday = utcWeekday(3);
|
|
3053
|
+
var utcThursday = utcWeekday(4);
|
|
3054
|
+
var utcFriday = utcWeekday(5);
|
|
3055
|
+
var utcSaturday = utcWeekday(6);
|
|
3056
|
+
|
|
3057
|
+
utcSunday.range;
|
|
3058
|
+
utcMonday.range;
|
|
3059
|
+
utcTuesday.range;
|
|
3060
|
+
utcWednesday.range;
|
|
3061
|
+
utcThursday.range;
|
|
3062
|
+
utcFriday.range;
|
|
3063
|
+
utcSaturday.range;
|
|
3064
|
+
|
|
3065
|
+
var utcMonth = newInterval(function(date) {
|
|
3066
|
+
date.setUTCDate(1);
|
|
3067
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3068
|
+
}, function(date, step) {
|
|
3069
|
+
date.setUTCMonth(date.getUTCMonth() + step);
|
|
3070
|
+
}, function(start, end) {
|
|
3071
|
+
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|
3072
|
+
}, function(date) {
|
|
3073
|
+
return date.getUTCMonth();
|
|
3074
|
+
});
|
|
3075
|
+
utcMonth.range;
|
|
3076
|
+
|
|
3077
|
+
var utcYear = newInterval(function(date) {
|
|
3078
|
+
date.setUTCMonth(0, 1);
|
|
3079
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3080
|
+
}, function(date, step) {
|
|
3081
|
+
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
3082
|
+
}, function(start, end) {
|
|
3083
|
+
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
3084
|
+
}, function(date) {
|
|
3085
|
+
return date.getUTCFullYear();
|
|
3086
|
+
});
|
|
3087
|
+
|
|
3088
|
+
// An optimized implementation for this simple case.
|
|
3089
|
+
utcYear.every = function(k) {
|
|
3090
|
+
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
3091
|
+
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
3092
|
+
date.setUTCMonth(0, 1);
|
|
3093
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3094
|
+
}, function(date, step) {
|
|
3095
|
+
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
3096
|
+
});
|
|
3097
|
+
};
|
|
3098
|
+
utcYear.range;
|
|
3099
|
+
|
|
3100
|
+
function localDate(d) {
|
|
3101
|
+
if (0 <= d.y && d.y < 100) {
|
|
3102
|
+
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
3103
|
+
date.setFullYear(d.y);
|
|
3104
|
+
return date;
|
|
3105
|
+
}
|
|
3106
|
+
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
function utcDate(d) {
|
|
3110
|
+
if (0 <= d.y && d.y < 100) {
|
|
3111
|
+
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
3112
|
+
date.setUTCFullYear(d.y);
|
|
3113
|
+
return date;
|
|
3114
|
+
}
|
|
3115
|
+
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
function newDate(y, m, d) {
|
|
3119
|
+
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
function formatLocale(locale) {
|
|
3123
|
+
var locale_dateTime = locale.dateTime,
|
|
3124
|
+
locale_date = locale.date,
|
|
3125
|
+
locale_time = locale.time,
|
|
3126
|
+
locale_periods = locale.periods,
|
|
3127
|
+
locale_weekdays = locale.days,
|
|
3128
|
+
locale_shortWeekdays = locale.shortDays,
|
|
3129
|
+
locale_months = locale.months,
|
|
3130
|
+
locale_shortMonths = locale.shortMonths;
|
|
3131
|
+
|
|
3132
|
+
var periodRe = formatRe(locale_periods),
|
|
3133
|
+
periodLookup = formatLookup(locale_periods),
|
|
3134
|
+
weekdayRe = formatRe(locale_weekdays),
|
|
3135
|
+
weekdayLookup = formatLookup(locale_weekdays),
|
|
3136
|
+
shortWeekdayRe = formatRe(locale_shortWeekdays),
|
|
3137
|
+
shortWeekdayLookup = formatLookup(locale_shortWeekdays),
|
|
3138
|
+
monthRe = formatRe(locale_months),
|
|
3139
|
+
monthLookup = formatLookup(locale_months),
|
|
3140
|
+
shortMonthRe = formatRe(locale_shortMonths),
|
|
3141
|
+
shortMonthLookup = formatLookup(locale_shortMonths);
|
|
3142
|
+
|
|
3143
|
+
var formats = {
|
|
3144
|
+
"a": formatShortWeekday,
|
|
3145
|
+
"A": formatWeekday,
|
|
3146
|
+
"b": formatShortMonth,
|
|
3147
|
+
"B": formatMonth,
|
|
3148
|
+
"c": null,
|
|
3149
|
+
"d": formatDayOfMonth,
|
|
3150
|
+
"e": formatDayOfMonth,
|
|
3151
|
+
"f": formatMicroseconds,
|
|
3152
|
+
"g": formatYearISO,
|
|
3153
|
+
"G": formatFullYearISO,
|
|
3154
|
+
"H": formatHour24,
|
|
3155
|
+
"I": formatHour12,
|
|
3156
|
+
"j": formatDayOfYear,
|
|
3157
|
+
"L": formatMilliseconds,
|
|
3158
|
+
"m": formatMonthNumber,
|
|
3159
|
+
"M": formatMinutes,
|
|
3160
|
+
"p": formatPeriod,
|
|
3161
|
+
"q": formatQuarter,
|
|
3162
|
+
"Q": formatUnixTimestamp,
|
|
3163
|
+
"s": formatUnixTimestampSeconds,
|
|
3164
|
+
"S": formatSeconds,
|
|
3165
|
+
"u": formatWeekdayNumberMonday,
|
|
3166
|
+
"U": formatWeekNumberSunday,
|
|
3167
|
+
"V": formatWeekNumberISO,
|
|
3168
|
+
"w": formatWeekdayNumberSunday,
|
|
3169
|
+
"W": formatWeekNumberMonday,
|
|
3170
|
+
"x": null,
|
|
3171
|
+
"X": null,
|
|
3172
|
+
"y": formatYear,
|
|
3173
|
+
"Y": formatFullYear,
|
|
3174
|
+
"Z": formatZone,
|
|
3175
|
+
"%": formatLiteralPercent
|
|
3176
|
+
};
|
|
3177
|
+
|
|
3178
|
+
var utcFormats = {
|
|
3179
|
+
"a": formatUTCShortWeekday,
|
|
3180
|
+
"A": formatUTCWeekday,
|
|
3181
|
+
"b": formatUTCShortMonth,
|
|
3182
|
+
"B": formatUTCMonth,
|
|
3183
|
+
"c": null,
|
|
3184
|
+
"d": formatUTCDayOfMonth,
|
|
3185
|
+
"e": formatUTCDayOfMonth,
|
|
3186
|
+
"f": formatUTCMicroseconds,
|
|
3187
|
+
"g": formatUTCYearISO,
|
|
3188
|
+
"G": formatUTCFullYearISO,
|
|
3189
|
+
"H": formatUTCHour24,
|
|
3190
|
+
"I": formatUTCHour12,
|
|
3191
|
+
"j": formatUTCDayOfYear,
|
|
3192
|
+
"L": formatUTCMilliseconds,
|
|
3193
|
+
"m": formatUTCMonthNumber,
|
|
3194
|
+
"M": formatUTCMinutes,
|
|
3195
|
+
"p": formatUTCPeriod,
|
|
3196
|
+
"q": formatUTCQuarter,
|
|
3197
|
+
"Q": formatUnixTimestamp,
|
|
3198
|
+
"s": formatUnixTimestampSeconds,
|
|
3199
|
+
"S": formatUTCSeconds,
|
|
3200
|
+
"u": formatUTCWeekdayNumberMonday,
|
|
3201
|
+
"U": formatUTCWeekNumberSunday,
|
|
3202
|
+
"V": formatUTCWeekNumberISO,
|
|
3203
|
+
"w": formatUTCWeekdayNumberSunday,
|
|
3204
|
+
"W": formatUTCWeekNumberMonday,
|
|
3205
|
+
"x": null,
|
|
3206
|
+
"X": null,
|
|
3207
|
+
"y": formatUTCYear,
|
|
3208
|
+
"Y": formatUTCFullYear,
|
|
3209
|
+
"Z": formatUTCZone,
|
|
3210
|
+
"%": formatLiteralPercent
|
|
3211
|
+
};
|
|
3212
|
+
|
|
3213
|
+
var parses = {
|
|
3214
|
+
"a": parseShortWeekday,
|
|
3215
|
+
"A": parseWeekday,
|
|
3216
|
+
"b": parseShortMonth,
|
|
3217
|
+
"B": parseMonth,
|
|
3218
|
+
"c": parseLocaleDateTime,
|
|
3219
|
+
"d": parseDayOfMonth,
|
|
3220
|
+
"e": parseDayOfMonth,
|
|
3221
|
+
"f": parseMicroseconds,
|
|
3222
|
+
"g": parseYear,
|
|
3223
|
+
"G": parseFullYear,
|
|
3224
|
+
"H": parseHour24,
|
|
3225
|
+
"I": parseHour24,
|
|
3226
|
+
"j": parseDayOfYear,
|
|
3227
|
+
"L": parseMilliseconds,
|
|
3228
|
+
"m": parseMonthNumber,
|
|
3229
|
+
"M": parseMinutes,
|
|
3230
|
+
"p": parsePeriod,
|
|
3231
|
+
"q": parseQuarter,
|
|
3232
|
+
"Q": parseUnixTimestamp,
|
|
3233
|
+
"s": parseUnixTimestampSeconds,
|
|
3234
|
+
"S": parseSeconds,
|
|
3235
|
+
"u": parseWeekdayNumberMonday,
|
|
3236
|
+
"U": parseWeekNumberSunday,
|
|
3237
|
+
"V": parseWeekNumberISO,
|
|
3238
|
+
"w": parseWeekdayNumberSunday,
|
|
3239
|
+
"W": parseWeekNumberMonday,
|
|
3240
|
+
"x": parseLocaleDate,
|
|
3241
|
+
"X": parseLocaleTime,
|
|
3242
|
+
"y": parseYear,
|
|
3243
|
+
"Y": parseFullYear,
|
|
3244
|
+
"Z": parseZone,
|
|
3245
|
+
"%": parseLiteralPercent
|
|
3246
|
+
};
|
|
3247
|
+
|
|
3248
|
+
// These recursive directive definitions must be deferred.
|
|
3249
|
+
formats.x = newFormat(locale_date, formats);
|
|
3250
|
+
formats.X = newFormat(locale_time, formats);
|
|
3251
|
+
formats.c = newFormat(locale_dateTime, formats);
|
|
3252
|
+
utcFormats.x = newFormat(locale_date, utcFormats);
|
|
3253
|
+
utcFormats.X = newFormat(locale_time, utcFormats);
|
|
3254
|
+
utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
|
3255
|
+
|
|
3256
|
+
function newFormat(specifier, formats) {
|
|
3257
|
+
return function(date) {
|
|
3258
|
+
var string = [],
|
|
3259
|
+
i = -1,
|
|
3260
|
+
j = 0,
|
|
3261
|
+
n = specifier.length,
|
|
3262
|
+
c,
|
|
3263
|
+
pad,
|
|
3264
|
+
format;
|
|
3265
|
+
|
|
3266
|
+
if (!(date instanceof Date)) date = new Date(+date);
|
|
3267
|
+
|
|
3268
|
+
while (++i < n) {
|
|
3269
|
+
if (specifier.charCodeAt(i) === 37) {
|
|
3270
|
+
string.push(specifier.slice(j, i));
|
|
3271
|
+
if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
|
|
3272
|
+
else pad = c === "e" ? " " : "0";
|
|
3273
|
+
if (format = formats[c]) c = format(date, pad);
|
|
3274
|
+
string.push(c);
|
|
3275
|
+
j = i + 1;
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3279
|
+
string.push(specifier.slice(j, i));
|
|
3280
|
+
return string.join("");
|
|
3281
|
+
};
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
function newParse(specifier, Z) {
|
|
3285
|
+
return function(string) {
|
|
3286
|
+
var d = newDate(1900, undefined, 1),
|
|
3287
|
+
i = parseSpecifier(d, specifier, string += "", 0),
|
|
3288
|
+
week, day$1;
|
|
3289
|
+
if (i != string.length) return null;
|
|
3290
|
+
|
|
3291
|
+
// If a UNIX timestamp is specified, return it.
|
|
3292
|
+
if ("Q" in d) return new Date(d.Q);
|
|
3293
|
+
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));
|
|
3294
|
+
|
|
3295
|
+
// If this is utcParse, never use the local timezone.
|
|
3296
|
+
if (Z && !("Z" in d)) d.Z = 0;
|
|
3297
|
+
|
|
3298
|
+
// The am-pm flag is 0 for AM, and 1 for PM.
|
|
3299
|
+
if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
|
3300
|
+
|
|
3301
|
+
// If the month was not specified, inherit from the quarter.
|
|
3302
|
+
if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
|
3303
|
+
|
|
3304
|
+
// Convert day-of-week and week-of-year to day-of-year.
|
|
3305
|
+
if ("V" in d) {
|
|
3306
|
+
if (d.V < 1 || d.V > 53) return null;
|
|
3307
|
+
if (!("w" in d)) d.w = 1;
|
|
3308
|
+
if ("Z" in d) {
|
|
3309
|
+
week = utcDate(newDate(d.y, 0, 1)), day$1 = week.getUTCDay();
|
|
3310
|
+
week = day$1 > 4 || day$1 === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
|
3311
|
+
week = utcDay.offset(week, (d.V - 1) * 7);
|
|
3312
|
+
d.y = week.getUTCFullYear();
|
|
3313
|
+
d.m = week.getUTCMonth();
|
|
3314
|
+
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
3315
|
+
} else {
|
|
3316
|
+
week = localDate(newDate(d.y, 0, 1)), day$1 = week.getDay();
|
|
3317
|
+
week = day$1 > 4 || day$1 === 0 ? monday.ceil(week) : monday(week);
|
|
3318
|
+
week = day.offset(week, (d.V - 1) * 7);
|
|
3319
|
+
d.y = week.getFullYear();
|
|
3320
|
+
d.m = week.getMonth();
|
|
3321
|
+
d.d = week.getDate() + (d.w + 6) % 7;
|
|
3322
|
+
}
|
|
3323
|
+
} else if ("W" in d || "U" in d) {
|
|
3324
|
+
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
3325
|
+
day$1 = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
|
3326
|
+
d.m = 0;
|
|
3327
|
+
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day$1 + 5) % 7 : d.w + d.U * 7 - (day$1 + 6) % 7;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
3331
|
+
// offset according to the specified time zone.
|
|
3332
|
+
if ("Z" in d) {
|
|
3333
|
+
d.H += d.Z / 100 | 0;
|
|
3334
|
+
d.M += d.Z % 100;
|
|
3335
|
+
return utcDate(d);
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3338
|
+
// Otherwise, all fields are in local time.
|
|
3339
|
+
return localDate(d);
|
|
3340
|
+
};
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
function parseSpecifier(d, specifier, string, j) {
|
|
3344
|
+
var i = 0,
|
|
3345
|
+
n = specifier.length,
|
|
3346
|
+
m = string.length,
|
|
3347
|
+
c,
|
|
3348
|
+
parse;
|
|
3349
|
+
|
|
3350
|
+
while (i < n) {
|
|
3351
|
+
if (j >= m) return -1;
|
|
3352
|
+
c = specifier.charCodeAt(i++);
|
|
3353
|
+
if (c === 37) {
|
|
3354
|
+
c = specifier.charAt(i++);
|
|
3355
|
+
parse = parses[c in pads ? specifier.charAt(i++) : c];
|
|
3356
|
+
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
|
|
3357
|
+
} else if (c != string.charCodeAt(j++)) {
|
|
3358
|
+
return -1;
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
return j;
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3365
|
+
function parsePeriod(d, string, i) {
|
|
3366
|
+
var n = periodRe.exec(string.slice(i));
|
|
3367
|
+
return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
3368
|
+
}
|
|
3369
|
+
|
|
3370
|
+
function parseShortWeekday(d, string, i) {
|
|
3371
|
+
var n = shortWeekdayRe.exec(string.slice(i));
|
|
3372
|
+
return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3375
|
+
function parseWeekday(d, string, i) {
|
|
3376
|
+
var n = weekdayRe.exec(string.slice(i));
|
|
3377
|
+
return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
function parseShortMonth(d, string, i) {
|
|
3381
|
+
var n = shortMonthRe.exec(string.slice(i));
|
|
3382
|
+
return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
function parseMonth(d, string, i) {
|
|
3386
|
+
var n = monthRe.exec(string.slice(i));
|
|
3387
|
+
return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
function parseLocaleDateTime(d, string, i) {
|
|
3391
|
+
return parseSpecifier(d, locale_dateTime, string, i);
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
function parseLocaleDate(d, string, i) {
|
|
3395
|
+
return parseSpecifier(d, locale_date, string, i);
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
function parseLocaleTime(d, string, i) {
|
|
3399
|
+
return parseSpecifier(d, locale_time, string, i);
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
function formatShortWeekday(d) {
|
|
3403
|
+
return locale_shortWeekdays[d.getDay()];
|
|
3404
|
+
}
|
|
3405
|
+
|
|
3406
|
+
function formatWeekday(d) {
|
|
3407
|
+
return locale_weekdays[d.getDay()];
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
function formatShortMonth(d) {
|
|
3411
|
+
return locale_shortMonths[d.getMonth()];
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
function formatMonth(d) {
|
|
3415
|
+
return locale_months[d.getMonth()];
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
function formatPeriod(d) {
|
|
3419
|
+
return locale_periods[+(d.getHours() >= 12)];
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
function formatQuarter(d) {
|
|
3423
|
+
return 1 + ~~(d.getMonth() / 3);
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
function formatUTCShortWeekday(d) {
|
|
3427
|
+
return locale_shortWeekdays[d.getUTCDay()];
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
function formatUTCWeekday(d) {
|
|
3431
|
+
return locale_weekdays[d.getUTCDay()];
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
function formatUTCShortMonth(d) {
|
|
3435
|
+
return locale_shortMonths[d.getUTCMonth()];
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
function formatUTCMonth(d) {
|
|
3439
|
+
return locale_months[d.getUTCMonth()];
|
|
3440
|
+
}
|
|
3441
|
+
|
|
3442
|
+
function formatUTCPeriod(d) {
|
|
3443
|
+
return locale_periods[+(d.getUTCHours() >= 12)];
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3446
|
+
function formatUTCQuarter(d) {
|
|
3447
|
+
return 1 + ~~(d.getUTCMonth() / 3);
|
|
3448
|
+
}
|
|
3449
|
+
|
|
3450
|
+
return {
|
|
3451
|
+
format: function(specifier) {
|
|
3452
|
+
var f = newFormat(specifier += "", formats);
|
|
3453
|
+
f.toString = function() { return specifier; };
|
|
3454
|
+
return f;
|
|
3455
|
+
},
|
|
3456
|
+
parse: function(specifier) {
|
|
3457
|
+
var p = newParse(specifier += "", false);
|
|
3458
|
+
p.toString = function() { return specifier; };
|
|
3459
|
+
return p;
|
|
3460
|
+
},
|
|
3461
|
+
utcFormat: function(specifier) {
|
|
3462
|
+
var f = newFormat(specifier += "", utcFormats);
|
|
3463
|
+
f.toString = function() { return specifier; };
|
|
3464
|
+
return f;
|
|
3465
|
+
},
|
|
3466
|
+
utcParse: function(specifier) {
|
|
3467
|
+
var p = newParse(specifier += "", true);
|
|
3468
|
+
p.toString = function() { return specifier; };
|
|
3469
|
+
return p;
|
|
3470
|
+
}
|
|
3471
|
+
};
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3474
|
+
var pads = {"-": "", "_": " ", "0": "0"},
|
|
3475
|
+
numberRe = /^\s*\d+/, // note: ignores next directive
|
|
3476
|
+
percentRe = /^%/,
|
|
3477
|
+
requoteRe = /[\\^$*+?|[\]().{}]/g;
|
|
3478
|
+
|
|
3479
|
+
function pad(value, fill, width) {
|
|
3480
|
+
var sign = value < 0 ? "-" : "",
|
|
3481
|
+
string = (sign ? -value : value) + "",
|
|
3482
|
+
length = string.length;
|
|
3483
|
+
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
|
|
3484
|
+
}
|
|
3485
|
+
|
|
3486
|
+
function requote(s) {
|
|
3487
|
+
return s.replace(requoteRe, "\\$&");
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3490
|
+
function formatRe(names) {
|
|
3491
|
+
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
function formatLookup(names) {
|
|
3495
|
+
return new Map(names.map((name, i) => [name.toLowerCase(), i]));
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
function parseWeekdayNumberSunday(d, string, i) {
|
|
3499
|
+
var n = numberRe.exec(string.slice(i, i + 1));
|
|
3500
|
+
return n ? (d.w = +n[0], i + n[0].length) : -1;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
function parseWeekdayNumberMonday(d, string, i) {
|
|
3504
|
+
var n = numberRe.exec(string.slice(i, i + 1));
|
|
3505
|
+
return n ? (d.u = +n[0], i + n[0].length) : -1;
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
function parseWeekNumberSunday(d, string, i) {
|
|
3509
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3510
|
+
return n ? (d.U = +n[0], i + n[0].length) : -1;
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
function parseWeekNumberISO(d, string, i) {
|
|
3514
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3515
|
+
return n ? (d.V = +n[0], i + n[0].length) : -1;
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
function parseWeekNumberMonday(d, string, i) {
|
|
3519
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3520
|
+
return n ? (d.W = +n[0], i + n[0].length) : -1;
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3523
|
+
function parseFullYear(d, string, i) {
|
|
3524
|
+
var n = numberRe.exec(string.slice(i, i + 4));
|
|
3525
|
+
return n ? (d.y = +n[0], i + n[0].length) : -1;
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
function parseYear(d, string, i) {
|
|
3529
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3530
|
+
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
function parseZone(d, string, i) {
|
|
3534
|
+
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
|
3535
|
+
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
function parseQuarter(d, string, i) {
|
|
3539
|
+
var n = numberRe.exec(string.slice(i, i + 1));
|
|
3540
|
+
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
function parseMonthNumber(d, string, i) {
|
|
3544
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3545
|
+
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
|
3546
|
+
}
|
|
3547
|
+
|
|
3548
|
+
function parseDayOfMonth(d, string, i) {
|
|
3549
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3550
|
+
return n ? (d.d = +n[0], i + n[0].length) : -1;
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
function parseDayOfYear(d, string, i) {
|
|
3554
|
+
var n = numberRe.exec(string.slice(i, i + 3));
|
|
3555
|
+
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
|
3556
|
+
}
|
|
3557
|
+
|
|
3558
|
+
function parseHour24(d, string, i) {
|
|
3559
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3560
|
+
return n ? (d.H = +n[0], i + n[0].length) : -1;
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
function parseMinutes(d, string, i) {
|
|
3564
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3565
|
+
return n ? (d.M = +n[0], i + n[0].length) : -1;
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
function parseSeconds(d, string, i) {
|
|
3569
|
+
var n = numberRe.exec(string.slice(i, i + 2));
|
|
3570
|
+
return n ? (d.S = +n[0], i + n[0].length) : -1;
|
|
3571
|
+
}
|
|
3572
|
+
|
|
3573
|
+
function parseMilliseconds(d, string, i) {
|
|
3574
|
+
var n = numberRe.exec(string.slice(i, i + 3));
|
|
3575
|
+
return n ? (d.L = +n[0], i + n[0].length) : -1;
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
function parseMicroseconds(d, string, i) {
|
|
3579
|
+
var n = numberRe.exec(string.slice(i, i + 6));
|
|
3580
|
+
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
|
|
3581
|
+
}
|
|
3582
|
+
|
|
3583
|
+
function parseLiteralPercent(d, string, i) {
|
|
3584
|
+
var n = percentRe.exec(string.slice(i, i + 1));
|
|
3585
|
+
return n ? i + n[0].length : -1;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
function parseUnixTimestamp(d, string, i) {
|
|
3589
|
+
var n = numberRe.exec(string.slice(i));
|
|
3590
|
+
return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
|
3591
|
+
}
|
|
3592
|
+
|
|
3593
|
+
function parseUnixTimestampSeconds(d, string, i) {
|
|
3594
|
+
var n = numberRe.exec(string.slice(i));
|
|
3595
|
+
return n ? (d.s = +n[0], i + n[0].length) : -1;
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
function formatDayOfMonth(d, p) {
|
|
3599
|
+
return pad(d.getDate(), p, 2);
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
function formatHour24(d, p) {
|
|
3603
|
+
return pad(d.getHours(), p, 2);
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
function formatHour12(d, p) {
|
|
3607
|
+
return pad(d.getHours() % 12 || 12, p, 2);
|
|
3608
|
+
}
|
|
3609
|
+
|
|
3610
|
+
function formatDayOfYear(d, p) {
|
|
3611
|
+
return pad(1 + day.count(year(d), d), p, 3);
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
function formatMilliseconds(d, p) {
|
|
3615
|
+
return pad(d.getMilliseconds(), p, 3);
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
function formatMicroseconds(d, p) {
|
|
3619
|
+
return formatMilliseconds(d, p) + "000";
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3622
|
+
function formatMonthNumber(d, p) {
|
|
3623
|
+
return pad(d.getMonth() + 1, p, 2);
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
function formatMinutes(d, p) {
|
|
3627
|
+
return pad(d.getMinutes(), p, 2);
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
function formatSeconds(d, p) {
|
|
3631
|
+
return pad(d.getSeconds(), p, 2);
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
function formatWeekdayNumberMonday(d) {
|
|
3635
|
+
var day = d.getDay();
|
|
3636
|
+
return day === 0 ? 7 : day;
|
|
3637
|
+
}
|
|
3638
|
+
|
|
3639
|
+
function formatWeekNumberSunday(d, p) {
|
|
3640
|
+
return pad(sunday.count(year(d) - 1, d), p, 2);
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
function dISO(d) {
|
|
3644
|
+
var day = d.getDay();
|
|
3645
|
+
return (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
3646
|
+
}
|
|
3647
|
+
|
|
3648
|
+
function formatWeekNumberISO(d, p) {
|
|
3649
|
+
d = dISO(d);
|
|
3650
|
+
return pad(thursday.count(year(d), d) + (year(d).getDay() === 4), p, 2);
|
|
3651
|
+
}
|
|
3652
|
+
|
|
3653
|
+
function formatWeekdayNumberSunday(d) {
|
|
3654
|
+
return d.getDay();
|
|
3655
|
+
}
|
|
3656
|
+
|
|
3657
|
+
function formatWeekNumberMonday(d, p) {
|
|
3658
|
+
return pad(monday.count(year(d) - 1, d), p, 2);
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
function formatYear(d, p) {
|
|
3662
|
+
return pad(d.getFullYear() % 100, p, 2);
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
function formatYearISO(d, p) {
|
|
3666
|
+
d = dISO(d);
|
|
3667
|
+
return pad(d.getFullYear() % 100, p, 2);
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
function formatFullYear(d, p) {
|
|
3671
|
+
return pad(d.getFullYear() % 10000, p, 4);
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
function formatFullYearISO(d, p) {
|
|
3675
|
+
var day = d.getDay();
|
|
3676
|
+
d = (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
3677
|
+
return pad(d.getFullYear() % 10000, p, 4);
|
|
3678
|
+
}
|
|
3679
|
+
|
|
3680
|
+
function formatZone(d) {
|
|
3681
|
+
var z = d.getTimezoneOffset();
|
|
3682
|
+
return (z > 0 ? "-" : (z *= -1, "+"))
|
|
3683
|
+
+ pad(z / 60 | 0, "0", 2)
|
|
3684
|
+
+ pad(z % 60, "0", 2);
|
|
3685
|
+
}
|
|
3686
|
+
|
|
3687
|
+
function formatUTCDayOfMonth(d, p) {
|
|
3688
|
+
return pad(d.getUTCDate(), p, 2);
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
function formatUTCHour24(d, p) {
|
|
3692
|
+
return pad(d.getUTCHours(), p, 2);
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3695
|
+
function formatUTCHour12(d, p) {
|
|
3696
|
+
return pad(d.getUTCHours() % 12 || 12, p, 2);
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
function formatUTCDayOfYear(d, p) {
|
|
3700
|
+
return pad(1 + utcDay.count(utcYear(d), d), p, 3);
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
function formatUTCMilliseconds(d, p) {
|
|
3704
|
+
return pad(d.getUTCMilliseconds(), p, 3);
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3707
|
+
function formatUTCMicroseconds(d, p) {
|
|
3708
|
+
return formatUTCMilliseconds(d, p) + "000";
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3711
|
+
function formatUTCMonthNumber(d, p) {
|
|
3712
|
+
return pad(d.getUTCMonth() + 1, p, 2);
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3715
|
+
function formatUTCMinutes(d, p) {
|
|
3716
|
+
return pad(d.getUTCMinutes(), p, 2);
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
function formatUTCSeconds(d, p) {
|
|
3720
|
+
return pad(d.getUTCSeconds(), p, 2);
|
|
3721
|
+
}
|
|
3722
|
+
|
|
3723
|
+
function formatUTCWeekdayNumberMonday(d) {
|
|
3724
|
+
var dow = d.getUTCDay();
|
|
3725
|
+
return dow === 0 ? 7 : dow;
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
function formatUTCWeekNumberSunday(d, p) {
|
|
3729
|
+
return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
function UTCdISO(d) {
|
|
3733
|
+
var day = d.getUTCDay();
|
|
3734
|
+
return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3737
|
+
function formatUTCWeekNumberISO(d, p) {
|
|
3738
|
+
d = UTCdISO(d);
|
|
3739
|
+
return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
function formatUTCWeekdayNumberSunday(d) {
|
|
3743
|
+
return d.getUTCDay();
|
|
3744
|
+
}
|
|
3745
|
+
|
|
3746
|
+
function formatUTCWeekNumberMonday(d, p) {
|
|
3747
|
+
return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
|
|
3748
|
+
}
|
|
3749
|
+
|
|
3750
|
+
function formatUTCYear(d, p) {
|
|
3751
|
+
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
3752
|
+
}
|
|
3753
|
+
|
|
3754
|
+
function formatUTCYearISO(d, p) {
|
|
3755
|
+
d = UTCdISO(d);
|
|
3756
|
+
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
function formatUTCFullYear(d, p) {
|
|
3760
|
+
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
function formatUTCFullYearISO(d, p) {
|
|
3764
|
+
var day = d.getUTCDay();
|
|
3765
|
+
d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
3766
|
+
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
3767
|
+
}
|
|
3768
|
+
|
|
3769
|
+
function formatUTCZone() {
|
|
3770
|
+
return "+0000";
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
function formatLiteralPercent() {
|
|
3774
|
+
return "%";
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3777
|
+
function formatUnixTimestamp(d) {
|
|
3778
|
+
return +d;
|
|
3779
|
+
}
|
|
3780
|
+
|
|
3781
|
+
function formatUnixTimestampSeconds(d) {
|
|
3782
|
+
return Math.floor(+d / 1000);
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
var locale;
|
|
3786
|
+
var utcFormat;
|
|
3787
|
+
var utcParse;
|
|
3788
|
+
|
|
3789
|
+
defaultLocale({
|
|
3790
|
+
dateTime: "%x, %X",
|
|
3791
|
+
date: "%-m/%-d/%Y",
|
|
3792
|
+
time: "%-I:%M:%S %p",
|
|
3793
|
+
periods: ["AM", "PM"],
|
|
3794
|
+
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
3795
|
+
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
3796
|
+
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
3797
|
+
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
3798
|
+
});
|
|
3799
|
+
|
|
3800
|
+
function defaultLocale(definition) {
|
|
3801
|
+
locale = formatLocale(definition);
|
|
3802
|
+
locale.format;
|
|
3803
|
+
locale.parse;
|
|
3804
|
+
utcFormat = locale.utcFormat;
|
|
3805
|
+
utcParse = locale.utcParse;
|
|
3806
|
+
return locale;
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3809
|
+
var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
|
|
3810
|
+
|
|
3811
|
+
function formatIsoNative(date) {
|
|
3812
|
+
return date.toISOString();
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
Date.prototype.toISOString
|
|
3816
|
+
? formatIsoNative
|
|
3817
|
+
: utcFormat(isoSpecifier);
|
|
3818
|
+
|
|
3819
|
+
function parseIsoNative(string) {
|
|
3820
|
+
var date = new Date(string);
|
|
3821
|
+
return isNaN(date) ? null : date;
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3824
|
+
+new Date("2000-01-01T00:00:00.000Z")
|
|
3825
|
+
? parseIsoNative
|
|
3826
|
+
: utcParse(isoSpecifier);
|
|
3827
|
+
|
|
2483
3828
|
function transformer() {
|
|
2484
3829
|
var x0 = 0,
|
|
2485
3830
|
x1 = 1,
|
|
@@ -2598,7 +3943,7 @@ var drawChart = (function (exports) {
|
|
|
2598
3943
|
};
|
|
2599
3944
|
};
|
|
2600
3945
|
|
|
2601
|
-
const StaticContext =
|
|
3946
|
+
const StaticContext = B$1({});
|
|
2602
3947
|
const drawChart = (parentNode, data, width, height) => {
|
|
2603
3948
|
const availableSizeProperties = getAvailableSizeOptions(data.options);
|
|
2604
3949
|
console.time("layout create");
|
|
@@ -2642,7 +3987,7 @@ var drawChart = (function (exports) {
|
|
|
2642
3987
|
console.time("color");
|
|
2643
3988
|
const getModuleColor = createRainbowColor(rawHierarchy);
|
|
2644
3989
|
console.timeEnd("color");
|
|
2645
|
-
|
|
3990
|
+
P(e$1(StaticContext.Provider, Object.assign({ value: {
|
|
2646
3991
|
data,
|
|
2647
3992
|
availableSizeProperties,
|
|
2648
3993
|
width,
|
|
@@ -2652,7 +3997,7 @@ var drawChart = (function (exports) {
|
|
|
2652
3997
|
getModuleColor,
|
|
2653
3998
|
rawHierarchy,
|
|
2654
3999
|
layout,
|
|
2655
|
-
} }, { children: e$1(Main, {}
|
|
4000
|
+
} }, { children: e$1(Main, {}) })), parentNode);
|
|
2656
4001
|
};
|
|
2657
4002
|
|
|
2658
4003
|
exports.StaticContext = StaticContext;
|
|
@@ -2669,7 +4014,7 @@ var drawChart = (function (exports) {
|
|
|
2669
4014
|
</script>
|
|
2670
4015
|
<script>
|
|
2671
4016
|
/*<!--*/
|
|
2672
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"
|
|
4017
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"1937-127"},{"name":"react-table/src/index.tsx","uid":"1937-129"}]}]}],"isRoot":true},"nodeParts":{"1937-127":{"renderedLength":136655,"gzipLength":23722,"brotliLength":0,"mainUid":"1937-126"},"1937-129":{"renderedLength":1900,"gzipLength":752,"brotliLength":0,"mainUid":"1937-128"}},"nodeMetas":{"1937-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"1937-127"},"imported":[],"importedBy":[{"uid":"1937-128"}]},"1937-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"1937-129"},"imported":[{"uid":"1937-130"},{"uid":"1937-126"}],"importedBy":[],"isEntry":true},"1937-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"1937-128"}],"isExternal":true}},"env":{"rollup":"2.77.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
2673
4018
|
|
|
2674
4019
|
const run = () => {
|
|
2675
4020
|
const width = window.innerWidth;
|