@gglib/content 0.6.1 → 0.8.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/LICENSE +7 -0
- package/Readme.md +1 -1
- package/dist/bundles/content.esm.js +1050 -0
- package/dist/bundles/content.esm.js.map +1 -0
- package/dist/content/src/AssetContainer.d.ts +18 -0
- package/dist/content/src/AssetContainer.d.ts.map +1 -0
- package/dist/content/src/AssetContainer.js +30 -0
- package/dist/content/src/AssetContainer.js.map +1 -0
- package/dist/content/src/AssetLoaderRegistry.d.ts +21 -0
- package/dist/content/src/AssetLoaderRegistry.d.ts.map +1 -0
- package/dist/content/src/AssetLoaderRegistry.js +28 -0
- package/dist/content/src/AssetLoaderRegistry.js.map +1 -0
- package/dist/content/src/AssetType.d.ts +13 -0
- package/dist/content/src/AssetType.d.ts.map +1 -0
- package/dist/content/src/AssetType.js +6 -0
- package/dist/content/src/AssetType.js.map +1 -0
- package/dist/content/src/AsyncExecutor.d.ts +63 -0
- package/dist/content/src/AsyncExecutor.d.ts.map +1 -0
- package/dist/content/src/AsyncExecutor.js +166 -0
- package/dist/content/src/AsyncExecutor.js.map +1 -0
- package/dist/content/src/ContentLoader.d.ts +266 -0
- package/dist/content/src/ContentLoader.d.ts.map +1 -0
- package/dist/content/src/ContentLoader.js +341 -0
- package/dist/content/src/ContentLoader.js.map +1 -0
- package/dist/content/src/ContentType.d.ts.map +1 -1
- package/dist/content/src/ContentType.js +6 -10
- package/dist/content/src/ContentType.js.map +1 -1
- package/dist/content/src/HttpClient.d.ts +48 -0
- package/dist/content/src/HttpClient.d.ts.map +1 -0
- package/dist/content/src/HttpClient.js +139 -0
- package/dist/content/src/HttpClient.js.map +1 -0
- package/dist/content/src/MaterialRegistry.d.ts +14 -0
- package/dist/content/src/MaterialRegistry.d.ts.map +1 -0
- package/dist/content/src/MaterialRegistry.js +24 -0
- package/dist/content/src/MaterialRegistry.js.map +1 -0
- package/dist/content/src/ResourceGraph.d.ts +54 -0
- package/dist/content/src/ResourceGraph.d.ts.map +1 -0
- package/dist/content/src/ResourceGraph.js +195 -0
- package/dist/content/src/ResourceGraph.js.map +1 -0
- package/dist/content/src/TextureLoader.d.ts +14 -0
- package/dist/content/src/TextureLoader.d.ts.map +1 -0
- package/dist/content/src/TextureLoader.js +70 -0
- package/dist/content/src/TextureLoader.js.map +1 -0
- package/dist/content/src/index.d.ts +8 -7
- package/dist/content/src/index.d.ts.map +1 -1
- package/dist/content/src/index.js +8 -7
- package/dist/content/src/index.js.map +1 -1
- package/dist/content/tsconfig.build.tsbuildinfo +1 -0
- package/dist/content/tsconfig.spec.tsbuildinfo +1 -0
- package/dist/stats.html +1248 -637
- package/package.json +19 -8
- package/dist/bundles/content.umd.js +0 -713
- package/dist/bundles/content.umd.js.map +0 -1
- package/dist/content/src/ContentManager.d.ts +0 -153
- package/dist/content/src/ContentManager.d.ts.map +0 -1
- package/dist/content/src/ContentManager.js +0 -361
- package/dist/content/src/ContentManager.js.map +0 -1
- package/dist/content/src/ContentType.spec.d.ts +0 -2
- package/dist/content/src/ContentType.spec.d.ts.map +0 -1
- package/dist/content/src/ContentType.spec.js +0 -27
- package/dist/content/src/ContentType.spec.js.map +0 -1
- package/dist/content/src/Data.d.ts +0 -37
- package/dist/content/src/Data.d.ts.map +0 -1
- package/dist/content/src/Data.js +0 -34
- package/dist/content/src/Data.js.map +0 -1
- package/dist/content/src/Loader.d.ts +0 -69
- package/dist/content/src/Loader.d.ts.map +0 -1
- package/dist/content/src/Loader.js +0 -16
- package/dist/content/src/Loader.js.map +0 -1
- package/dist/content/src/Pipeline.d.ts +0 -38
- package/dist/content/src/Pipeline.d.ts.map +0 -1
- package/dist/content/src/Pipeline.js +0 -182
- package/dist/content/src/Pipeline.js.map +0 -1
- package/dist/content/src/Pipeline.spec.d.ts +0 -2
- package/dist/content/src/Pipeline.spec.d.ts.map +0 -1
- package/dist/content/src/Pipeline.spec.js +0 -121
- package/dist/content/src/Pipeline.spec.js.map +0 -1
- package/dist/content/src/PipelineContext.d.ts +0 -40
- package/dist/content/src/PipelineContext.d.ts.map +0 -1
- package/dist/content/src/PipelineContext.js +0 -2
- package/dist/content/src/PipelineContext.js.map +0 -1
- package/dist/content/src/symbols.d.ts +0 -2
- package/dist/content/src/symbols.d.ts.map +0 -1
- package/dist/content/src/symbols.js +0 -2
- package/dist/content/src/symbols.js.map +0 -1
- package/dist/content/src/utils.d.ts +0 -17
- package/dist/content/src/utils.d.ts.map +0 -1
- package/dist/content/src/utils.js +0 -42
- package/dist/content/src/utils.js.map +0 -1
- package/dist/content/tsconfig.tsbuildinfo +0 -2778
package/dist/stats.html
CHANGED
|
@@ -56,13 +56,14 @@ body {
|
|
|
56
56
|
|
|
57
57
|
svg {
|
|
58
58
|
vertical-align: middle;
|
|
59
|
+
width: 100%;
|
|
59
60
|
height: 100%;
|
|
61
|
+
max-height: 100vh;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
main {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
height: 100%;
|
|
65
|
+
flex-grow: 1;
|
|
66
|
+
height: 100vh;
|
|
66
67
|
padding: 20px;
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -120,21 +121,25 @@ main {
|
|
|
120
121
|
align-items: center;
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
.
|
|
124
|
+
.module-filters {
|
|
125
|
+
display: flex;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.module-filter {
|
|
124
129
|
display: flex;
|
|
125
130
|
flex-direction: row;
|
|
126
131
|
align-items: center;
|
|
127
132
|
justify-content: center;
|
|
128
133
|
flex: 1;
|
|
129
134
|
}
|
|
130
|
-
.filter input {
|
|
135
|
+
.module-filter input {
|
|
131
136
|
flex: 1;
|
|
132
137
|
height: 1rem;
|
|
133
|
-
padding: 0.
|
|
138
|
+
padding: 0.01rem;
|
|
134
139
|
font-size: 0.7rem;
|
|
135
140
|
margin-left: 0.3rem;
|
|
136
141
|
}
|
|
137
|
-
.filter + .filter {
|
|
142
|
+
.module-filter + .module-filter {
|
|
138
143
|
margin-left: 0.5rem;
|
|
139
144
|
}
|
|
140
145
|
</style>
|
|
@@ -143,18 +148,14 @@ main {
|
|
|
143
148
|
<main></main>
|
|
144
149
|
<script>
|
|
145
150
|
/*<!--*/
|
|
146
|
-
var drawChart = (function () {
|
|
151
|
+
var drawChart = (function (exports) {
|
|
147
152
|
'use strict';
|
|
148
153
|
|
|
149
|
-
var n,u,i,t,o,r
|
|
150
|
-
|
|
151
|
-
var n$1=function(t,s,r,e){var u;s[0]=0;for(var h=1;h<s.length;h++){var p=s[h++],a=s[h]?(s[0]|=p?1:2,r[s[h++]]):s[++h];3===p?e[0]=a:4===p?e[1]=Object.assign(e[1]||{},a):5===p?(e[1]=e[1]||{})[s[++h]]=a:6===p?e[1][s[++h]]+=a+"":p?(u=t.apply(a,n$1(t,a,r,["",null])),e.push(u),a[0]?s[0]|=2:(s[h-2]=0,s[h]=u)):e.push(a);}return e},t$1=new Map;function e$1(s){var r=t$1.get(this);return r||(r=new Map,t$1.set(this,r)),(r=n$1(this,r.get(s)||(r.set(s,r=function(n){for(var t,s,r=1,e="",u="",h=[0],p=function(n){1===r&&(n||(e=e.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?h.push(0,n,e):3===r&&(n||e)?(h.push(3,n,e),r=2):2===r&&"..."===e&&n?h.push(4,n,0):2===r&&e&&!n?h.push(5,0,!0,e):r>=5&&((e||!n&&5===r)&&(h.push(r,0,e,s),r=6),n&&(h.push(r,n,0,s),r=6)),e="";},a=0;a<n.length;a++){a&&(1===r&&p(),p(a));for(var l=0;l<n[a].length;l++)t=n[a][l],1===r?"<"===t?(p(),h=[h],r=3):e+=t:4===r?"--"===e&&">"===t?(r=1,e=""):e=t+e[0]:u?t===u?u="":e+=t:'"'===t||"'"===t?u=t:">"===t?(p(),r=1):r&&("="===t?(r=5,s=e,e=""):"/"===t&&(r<5||">"===n[a][l+1])?(p(),3===r&&(h=h[0]),r=h,(h=h[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(p(),r=2):e+=t),3===r&&"!--"===e&&(r=4,h=h[0]);}return p(),h}(s)),r),arguments,[])).length>1?r:r[0]}
|
|
154
|
+
var n,u$1,i$1,t$1,o$2,r$1={},f$1=[],e$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c$1(n,l){for(var u in l)n[u]=l[u];return n}function s$1(n){var l=n.parentNode;l&&l.removeChild(n);}function a$1(n,l,u){var i,t,o,r=arguments,f={};for(o in l)"key"==o?i=l[o]:"ref"==o?t=l[o]:f[o]=l[o];if(arguments.length>3)for(u=[u],o=3;o<arguments.length;o++)u.push(r[o]);if(null!=u&&(f.children=u),"function"==typeof n&&null!=n.defaultProps)for(o in n.defaultProps)void 0===f[o]&&(f[o]=n.defaultProps[o]);return v$1(n,f,i,t,null)}function v$1(l,u,i,t,o){var r={type:l,props:u,key:i,ref:t,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++n.__v:o};return null!=n.vnode&&n.vnode(r),r}function y$1(n){return n.children}function p$1(n,l){this.props=n,this.context=l;}function d$1(n,l){if(null==l)return n.__?d$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?d$1(n):null}function _(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 _(n)}}function k$1(l){(!l.__d&&(l.__d=!0)&&u$1.push(l)&&!b$1.__r++||t$1!==n.debounceRendering)&&((t$1=n.debounceRendering)||i$1)(b$1);}function b$1(){for(var n;b$1.__r=u$1.length;)n=u$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),u$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=c$1({},t)).__v=t.__v+1,I(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?d$1(t):o,t.__h),T(u,t),t.__e!=o&&_(t)));});}function m$1(n,l,u,i,t,o,e,c,s,a){var h,p,_,k,b,m,w,A=i&&i.__k||f$1,P=A.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(y$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===(_=A[h])||_&&k.key==_.key&&k.type===_.type)A[h]=void 0;else for(p=0;p<P;p++){if((_=A[p])&&k.key==_.key&&k.type===_.type){A[p]=void 0;break}_=null;}I(n,k,_=_||r$1,t,o,e,c,s,a),b=k.__e,(p=k.ref)&&_.ref!=p&&(w||(w=[]),_.ref&&w.push(_.ref,null,k),w.push(p,k.__c||b,k)),null!=b?(null==m&&(m=b),"function"==typeof k.type&&null!=k.__k&&k.__k===_.__k?k.__d=s=g$1(k,s,n):s=x$1(n,k,_,A,b,s),a||"option"!==u.type?"function"==typeof u.type&&(u.__d=s):n.value=""):s&&_.__e==s&&s.parentNode!=n&&(s=d$1(_));}for(u.__e=m,h=P;h--;)null!=A[h]&&("function"==typeof u.type&&null!=A[h].__e&&A[h].__e==u.__d&&(u.__d=d$1(i,h+1)),L(A[h],A[h]));if(w)for(h=0;h<w.length;h++)z(w[h],w[++h],w[++h]);}function g$1(n,l,u){var i,t;for(i=0;i<n.__k.length;i++)(t=n.__k[i])&&(t.__=n,l="function"==typeof t.type?g$1(t,l,u):x$1(u,t,t,n.__k,t.__e,l));return l}function x$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 A$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||C$1(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]||C$1(n,o,l[o],u[o],i);}function P(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||e$1.test(l)?u:u+"px";}function C$1(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||P(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||P(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?H:$,o):n.removeEventListener(l,o?H:$,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 $(l){this.l[l.type+!1](n.event?n.event(l):l);}function H(l){this.l[l.type+!0](n.event?n.event(l):l);}function I(l,u,i,t,o,r,f,e,s){var a,v,h,d,_,k,b,g,w,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(s=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=n.__b)&&a(u);try{n:if("function"==typeof P){if(g=u.props,w=(a=P.contextType)&&t[a.__c],x=a?w?w.props.value:a.__:t,i.__c?b=(v=u.__c=i.__c).__=v.__E:("prototype"in P&&P.prototype.render?u.__c=v=new P(g,x):(u.__c=v=new p$1(g,x),v.constructor=P,v.render=M),w&&w.sub(v),v.props=g,v.state||(v.state={}),v.context=x,v.__n=t,h=v.__d=!0,v.__h=[]),null==v.__s&&(v.__s=v.state),null!=P.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=c$1({},v.__s)),c$1(v.__s,P.getDerivedStateFromProps(g,v.__s))),d=v.props,_=v.state,h)null==P.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else {if(null==P.getDerivedStateFromProps&&g!==d&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(g,x),!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(g,v.__s,x)||u.__v===i.__v){v.props=g,v.state=v.__s,u.__v!==i.__v&&(v.__d=!1),v.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),v.__h.length&&f.push(v);break n}null!=v.componentWillUpdate&&v.componentWillUpdate(g,v.__s,x),null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(d,_,k);});}v.context=x,v.props=g,v.state=v.__s,(a=n.__r)&&a(u),v.__d=!1,v.__v=u,v.__P=l,a=v.render(v.props,v.state,v.context),v.state=v.__s,null!=v.getChildContext&&(t=c$1(c$1({},t),v.getChildContext())),h||null==v.getSnapshotBeforeUpdate||(k=v.getSnapshotBeforeUpdate(d,_)),A=null!=a&&a.type===y$1&&null==a.key?a.props.children:a,m$1(l,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,s),v.base=u.__e,u.__h=null,v.__h.length&&f.push(v),b&&(v.__E=v.__=null),v.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=j$1(i.__e,u,i,t,o,r,f,s);(a=n.diffed)&&a(u);}catch(l){u.__v=null,(s||null!=r)&&(u.__e=e,u.__h=!!s,r[r.indexOf(e)]=null),n.__e(l,u,i);}}function T(l,u){n.__c&&n.__c(u,l),l.some(function(u){try{l=u.__h,u.__h=[],l.some(function(n){n.call(u);});}catch(l){n.__e(l,u.__v);}});}function j$1(n,l,u,i,t,o,e,c){var a,v,h,y,p=u.props,d=l.props,_=l.type,k=0;if("svg"===_&&(t=!0),null!=o)for(;k<o.length;k++)if((a=o[k])&&(a===n||(_?a.localName==_:3==a.nodeType))){n=a,o[k]=null;break}if(null==n){if(null===_)return document.createTextNode(d);n=t?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),o=null,c=!1;}if(null===_)p===d||c&&n.data===d||(n.data=d);else {if(o=o&&f$1.slice.call(n.childNodes),v=(p=u.props||r$1).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!c){if(null!=o)for(p={},y=0;y<n.attributes.length;y++)p[n.attributes[y].name]=n.attributes[y].value;(h||v)&&(h&&(v&&h.__html==v.__html||h.__html===n.innerHTML)||(n.innerHTML=h&&h.__html||""));}if(A$1(n,d,p,t,c),h)l.__k=[];else if(k=l.props.children,m$1(n,Array.isArray(k)?k:[k],l,u,i,t&&"foreignObject"!==_,o,e,n.firstChild,c),null!=o)for(k=o.length;k--;)null!=o[k]&&s$1(o[k]);c||("value"in d&&void 0!==(k=d.value)&&(k!==n.value||"progress"===_&&!k)&&C$1(n,"value",k,p.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==n.checked&&C$1(n,"checked",k,p.checked,!1));}return n}function z(l,u,i){try{"function"==typeof l?l(u):l.current=u;}catch(l){n.__e(l,i);}}function L(l,u,i){var t,o,r;if(n.unmount&&n.unmount(l),(t=l.ref)&&(t.current&&t.current!==l.__e||z(t,null,u)),i||"function"==typeof l.type||(i=null!=(o=l.__e)),l.__e=l.__d=void 0,null!=(t=l.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(l){n.__e(l,u);}t.base=t.__P=null;}if(t=l.__k)for(r=0;r<t.length;r++)t[r]&&L(t[r],u,i);null!=o&&s$1(o);}function M(n,l,u){return this.constructor(n,u)}function N(l,u,i){var t,o,e;n.__&&n.__(l,u),o=(t="function"==typeof i)?null:i&&i.__k||u.__k,e=[],I(u,l=(!t&&i||u).__k=a$1(y$1,null,[l]),o||r$1,r$1,void 0!==u.ownerSVGElement,!t&&i?[i]:o?null:u.firstChild?f$1.slice.call(u.childNodes):null,e,!t&&i?i:o?o.__e:u.firstChild,t),T(e,l);}function q(n,l){var u={__c:l="__cC"+o$2++,__: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(k$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:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n},__v:0},p$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=c$1({},this.state),"function"==typeof n&&(n=n(c$1({},u),this.props)),n&&c$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),k$1(this));},p$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),k$1(this));},p$1.prototype.render=y$1,u$1=[],i$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b$1.__r=0,o$2=0;
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
function o$1(_,o,e,n$1,t){var f={};for(var l in o)"ref"!=l&&(f[l]=o[l]);var s,u,a={type:_,props:f,key:e,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++n.__v,__source:n$1,__self:t};if("function"==typeof _&&(s=_.defaultProps))for(u in s)void 0===f[u]&&(f[u]=s[u]);return n.vnode&&n.vnode(a),a}
|
|
154
157
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
function count(node) {
|
|
158
|
+
function count$1(node) {
|
|
158
159
|
var sum = 0,
|
|
159
160
|
children = node.children,
|
|
160
161
|
i = children && children.length;
|
|
@@ -164,7 +165,7 @@ var drawChart = (function () {
|
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
function node_count() {
|
|
167
|
-
return this.eachAfter(count);
|
|
168
|
+
return this.eachAfter(count$1);
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
function node_each(callback, that) {
|
|
@@ -317,7 +318,7 @@ var drawChart = (function () {
|
|
|
317
318
|
children = objectChildren;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
|
-
var root = new Node(data),
|
|
321
|
+
var root = new Node$1(data),
|
|
321
322
|
node,
|
|
322
323
|
nodes = [root],
|
|
323
324
|
child,
|
|
@@ -329,7 +330,7 @@ var drawChart = (function () {
|
|
|
329
330
|
if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {
|
|
330
331
|
node.children = childs;
|
|
331
332
|
for (i = n - 1; i >= 0; --i) {
|
|
332
|
-
nodes.push(child = childs[i] = new Node(childs[i]));
|
|
333
|
+
nodes.push(child = childs[i] = new Node$1(childs[i]));
|
|
333
334
|
child.parent = node;
|
|
334
335
|
child.depth = node.depth + 1;
|
|
335
336
|
}
|
|
@@ -362,15 +363,15 @@ var drawChart = (function () {
|
|
|
362
363
|
while ((node = node.parent) && (node.height < ++height));
|
|
363
364
|
}
|
|
364
365
|
|
|
365
|
-
function Node(data) {
|
|
366
|
+
function Node$1(data) {
|
|
366
367
|
this.data = data;
|
|
367
368
|
this.depth =
|
|
368
369
|
this.height = 0;
|
|
369
370
|
this.parent = null;
|
|
370
371
|
}
|
|
371
372
|
|
|
372
|
-
Node.prototype = hierarchy.prototype = {
|
|
373
|
-
constructor: Node,
|
|
373
|
+
Node$1.prototype = hierarchy.prototype = {
|
|
374
|
+
constructor: Node$1,
|
|
374
375
|
count: node_count,
|
|
375
376
|
each: node_each,
|
|
376
377
|
eachAfter: node_eachAfter,
|
|
@@ -499,7 +500,7 @@ var drawChart = (function () {
|
|
|
499
500
|
return squarify;
|
|
500
501
|
})(phi);
|
|
501
502
|
|
|
502
|
-
function
|
|
503
|
+
function treemap() {
|
|
503
504
|
var tile = squarify,
|
|
504
505
|
round = false,
|
|
505
506
|
dx = 1,
|
|
@@ -622,57 +623,137 @@ var drawChart = (function () {
|
|
|
622
623
|
return resquarify;
|
|
623
624
|
})(phi);
|
|
624
625
|
|
|
626
|
+
const isModuleTree = (mod) => "children" in mod;
|
|
627
|
+
|
|
628
|
+
let count = 0;
|
|
629
|
+
class Id {
|
|
630
|
+
constructor(id) {
|
|
631
|
+
this._id = id;
|
|
632
|
+
const url = new URL(window.location.href);
|
|
633
|
+
url.hash = id;
|
|
634
|
+
this._href = url.toString();
|
|
635
|
+
}
|
|
636
|
+
get id() {
|
|
637
|
+
return this._id;
|
|
638
|
+
}
|
|
639
|
+
get href() {
|
|
640
|
+
return this._href;
|
|
641
|
+
}
|
|
642
|
+
toString() {
|
|
643
|
+
return `url(${this.href})`;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
function generateUniqueId(name) {
|
|
647
|
+
count += 1;
|
|
648
|
+
const id = ["O", name, count].filter(Boolean).join("-");
|
|
649
|
+
return new Id(id);
|
|
650
|
+
}
|
|
651
|
+
|
|
625
652
|
const LABELS = {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
653
|
+
renderedLength: "Rendered",
|
|
654
|
+
gzipLength: "Gzip",
|
|
655
|
+
brotliLength: "Brotli",
|
|
656
|
+
};
|
|
657
|
+
const getAvailableSizeOptions = (options) => {
|
|
658
|
+
const availableSizeProperties = ["renderedLength"];
|
|
659
|
+
if (options.gzip) {
|
|
660
|
+
availableSizeProperties.push("gzipLength");
|
|
661
|
+
}
|
|
662
|
+
if (options.brotli) {
|
|
663
|
+
availableSizeProperties.push("brotliLength");
|
|
664
|
+
}
|
|
665
|
+
return availableSizeProperties;
|
|
629
666
|
};
|
|
630
667
|
|
|
631
|
-
|
|
632
|
-
const availableSizeProperties = ["renderedLength"];
|
|
633
|
-
if (options.gzip) {
|
|
634
|
-
availableSizeProperties.push("gzipLength");
|
|
635
|
-
}
|
|
636
|
-
if (options.brotli) {
|
|
637
|
-
availableSizeProperties.push("brotliLength");
|
|
638
|
-
}
|
|
668
|
+
var t,u,r,o=0,i=[],c=n.__b,f=n.__r,e=n.diffed,a=n.__c,v=n.unmount;function m(t,r){n.__h&&n.__h(u,t,o||r),o=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function l(n){return o=1,p(w,n)}function p(n,r,o){var i=m(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w(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 y(r,o){var i=m(t++,3);!n.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function h(r,o){var i=m(t++,4);!n.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i));}function s(n){return o=5,d(function(){return {current:n}},[])}function d(n,u){var r=m(t++,7);return k(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function F(n){var r=u.context[n.__c],o=m(t++,9);return o.__c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function x(){i.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(g),t.__H.__h.forEach(j),t.__H.__h=[];}catch(u){t.__H.__h=[],n.__e(u,t.__v);}}),i=[];}n.__b=function(n){u=null,c&&c(n);},n.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g),r.__h.forEach(j),r.__h=[]);},n.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===n.requestAnimationFrame||((r=n.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x)),u=void 0;},n.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g),t.__h=t.__h.filter(function(n){return !n.__||j(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],n.__e(r,t.__v);}}),a&&a(t,u);},n.unmount=function(t){v&&v(t);var u=t.__c;if(u&&u.__H)try{u.__H.__.forEach(g);}catch(t){n.__e(t,u.__v);}};var b="function"==typeof requestAnimationFrame;function g(n){var t=u;"function"==typeof n.__c&&n.__c(),u=t;}function j(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w(n,t){return "function"==typeof t?t(n):t}
|
|
639
669
|
|
|
640
|
-
|
|
670
|
+
const SideBar = ({ availableSizeProperties, sizeProperty, setSizeProperty, onExcludeChange, onIncludeChange, }) => {
|
|
671
|
+
const [includeValue, setIncludeValue] = l("");
|
|
672
|
+
const [excludeValue, setExcludeValue] = l("");
|
|
673
|
+
const handleSizePropertyChange = (sizeProp) => () => {
|
|
674
|
+
if (sizeProp !== sizeProperty) {
|
|
675
|
+
setSizeProperty(sizeProp);
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
const handleIncludeChange = (event) => {
|
|
679
|
+
const value = event.currentTarget.value;
|
|
680
|
+
setIncludeValue(value);
|
|
681
|
+
onIncludeChange(value);
|
|
682
|
+
};
|
|
683
|
+
const handleExcludeChange = (event) => {
|
|
684
|
+
const value = event.currentTarget.value;
|
|
685
|
+
setExcludeValue(value);
|
|
686
|
+
onExcludeChange(value);
|
|
687
|
+
};
|
|
688
|
+
return (o$1("aside", Object.assign({ className: "sidebar" }, { children: [o$1("div", Object.assign({ className: "size-selectors" }, { children: availableSizeProperties.length > 1 &&
|
|
689
|
+
availableSizeProperties.map((sizeProp) => {
|
|
690
|
+
const id = `selector-${sizeProp}`;
|
|
691
|
+
return (o$1("div", Object.assign({ className: "size-selector" }, { children: [o$1("input", { type: "radio", id: id, checked: sizeProp === sizeProperty, onChange: handleSizePropertyChange(sizeProp) }, void 0),
|
|
692
|
+
o$1("label", Object.assign({ htmlFor: id }, { children: LABELS[sizeProp] }), void 0)] }), sizeProp));
|
|
693
|
+
}) }), void 0),
|
|
694
|
+
o$1("div", Object.assign({ className: "module-filters" }, { children: [o$1("div", Object.assign({ className: "module-filter" }, { children: [o$1("label", Object.assign({ htmlFor: "module-filter-exclude" }, { children: "Exclude" }), void 0),
|
|
695
|
+
o$1("input", { type: "text", id: "module-filter-exclude", value: excludeValue, onInput: handleExcludeChange }, void 0)] }), void 0),
|
|
696
|
+
o$1("div", Object.assign({ className: "module-filter" }, { children: [o$1("label", Object.assign({ htmlFor: "module-filter-include" }, { children: "Include" }), void 0),
|
|
697
|
+
o$1("input", { type: "text", id: "module-filter-include", value: includeValue, onInput: handleIncludeChange }, void 0)] }), void 0)] }), void 0)] }), void 0));
|
|
641
698
|
};
|
|
642
699
|
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
700
|
+
const throttleFilter = (callback, limit) => {
|
|
701
|
+
let waiting = false;
|
|
702
|
+
return (val) => {
|
|
703
|
+
if (!waiting) {
|
|
704
|
+
callback(val);
|
|
705
|
+
waiting = true;
|
|
706
|
+
setTimeout(() => {
|
|
707
|
+
waiting = false;
|
|
708
|
+
}, limit);
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
const useFilter = () => {
|
|
713
|
+
const [includeFilter, setIncludeFilter] = l("");
|
|
714
|
+
const [excludeFilter, setExcludeFilter] = l("");
|
|
715
|
+
const setIncludeFilterTrottled = d(() => throttleFilter(setIncludeFilter, 200), []);
|
|
716
|
+
const setExcludeFilterTrottled = d(() => throttleFilter(setExcludeFilter, 200), []);
|
|
717
|
+
const isModuleIncluded = d(() => {
|
|
718
|
+
if (includeFilter === "") {
|
|
719
|
+
return () => true;
|
|
720
|
+
}
|
|
721
|
+
try {
|
|
722
|
+
const re = new RegExp(includeFilter);
|
|
723
|
+
return ({ id }) => re.test(id);
|
|
724
|
+
}
|
|
725
|
+
catch (err) {
|
|
726
|
+
return () => false;
|
|
727
|
+
}
|
|
728
|
+
}, [includeFilter]);
|
|
729
|
+
const isModuleExcluded = d(() => {
|
|
730
|
+
if (excludeFilter === "") {
|
|
731
|
+
return () => false;
|
|
732
|
+
}
|
|
733
|
+
try {
|
|
734
|
+
const re = new RegExp(excludeFilter);
|
|
735
|
+
return ({ id }) => re.test(id);
|
|
736
|
+
}
|
|
737
|
+
catch (err) {
|
|
738
|
+
return () => false;
|
|
739
|
+
}
|
|
740
|
+
}, [excludeFilter]);
|
|
741
|
+
const isDefaultInclude = includeFilter === "";
|
|
742
|
+
const getModuleFilterMultiplier = d(() => {
|
|
743
|
+
return (data) => {
|
|
744
|
+
if (isDefaultInclude) {
|
|
745
|
+
return isModuleExcluded(data) ? 0 : 1;
|
|
746
|
+
}
|
|
747
|
+
return isModuleExcluded(data) && !isModuleIncluded(data) ? 0 : 1;
|
|
748
|
+
};
|
|
749
|
+
}, [isDefaultInclude, isModuleExcluded, isModuleIncluded]);
|
|
750
|
+
return {
|
|
751
|
+
getModuleFilterMultiplier,
|
|
752
|
+
includeFilter,
|
|
753
|
+
excludeFilter,
|
|
754
|
+
setExcludeFilter: setExcludeFilterTrottled,
|
|
755
|
+
setIncludeFilter: setIncludeFilterTrottled,
|
|
756
|
+
};
|
|
676
757
|
};
|
|
677
758
|
|
|
678
759
|
function ascending(a, b) {
|
|
@@ -724,26 +805,121 @@ var drawChart = (function () {
|
|
|
724
805
|
return (d, x) => ascending(f(d), x);
|
|
725
806
|
}
|
|
726
807
|
|
|
727
|
-
function number(x) {
|
|
808
|
+
function number$1(x) {
|
|
728
809
|
return x === null ? NaN : +x;
|
|
729
810
|
}
|
|
730
811
|
|
|
731
812
|
const ascendingBisect = bisector(ascending);
|
|
732
813
|
const bisectRight = ascendingBisect.right;
|
|
733
|
-
|
|
814
|
+
bisector(number$1).center;
|
|
815
|
+
|
|
816
|
+
function getAugmentedNamespace(n) {
|
|
817
|
+
if (n.__esModule) return n;
|
|
818
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
819
|
+
Object.keys(n).forEach(function (k) {
|
|
820
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
821
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
822
|
+
enumerable: true,
|
|
823
|
+
get: function () {
|
|
824
|
+
return n[k];
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
});
|
|
828
|
+
return a;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
function createCommonjsModule(fn) {
|
|
832
|
+
var module = { exports: {} };
|
|
833
|
+
return fn(module, module.exports), module.exports;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
var internmap = createCommonjsModule(function (module, exports) {
|
|
837
|
+
// https://github.com/mbostock/internmap/ v1.0.1 Copyright 2021 Mike Bostock
|
|
838
|
+
(function (global, factory) {
|
|
839
|
+
factory(exports) ;
|
|
840
|
+
}(this, (function (exports) {
|
|
841
|
+
class InternMap extends Map {
|
|
842
|
+
constructor(entries, key = keyof) {
|
|
843
|
+
super();
|
|
844
|
+
Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
|
|
845
|
+
if (entries != null) for (const [key, value] of entries) this.set(key, value);
|
|
846
|
+
}
|
|
847
|
+
get(key) {
|
|
848
|
+
return super.get(intern_get(this, key));
|
|
849
|
+
}
|
|
850
|
+
has(key) {
|
|
851
|
+
return super.has(intern_get(this, key));
|
|
852
|
+
}
|
|
853
|
+
set(key, value) {
|
|
854
|
+
return super.set(intern_set(this, key), value);
|
|
855
|
+
}
|
|
856
|
+
delete(key) {
|
|
857
|
+
return super.delete(intern_delete(this, key));
|
|
858
|
+
}
|
|
859
|
+
}
|
|
734
860
|
|
|
735
|
-
|
|
861
|
+
class InternSet extends Set {
|
|
862
|
+
constructor(values, key = keyof) {
|
|
863
|
+
super();
|
|
864
|
+
Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
|
|
865
|
+
if (values != null) for (const value of values) this.add(value);
|
|
866
|
+
}
|
|
867
|
+
has(value) {
|
|
868
|
+
return super.has(intern_get(this, value));
|
|
869
|
+
}
|
|
870
|
+
add(value) {
|
|
871
|
+
return super.add(intern_set(this, value));
|
|
872
|
+
}
|
|
873
|
+
delete(value) {
|
|
874
|
+
return super.delete(intern_delete(this, value));
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
function intern_get({_intern, _key}, value) {
|
|
879
|
+
const key = _key(value);
|
|
880
|
+
return _intern.has(key) ? _intern.get(key) : value;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
function intern_set({_intern, _key}, value) {
|
|
884
|
+
const key = _key(value);
|
|
885
|
+
if (_intern.has(key)) return _intern.get(key);
|
|
886
|
+
_intern.set(key, value);
|
|
887
|
+
return value;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function intern_delete({_intern, _key}, value) {
|
|
891
|
+
const key = _key(value);
|
|
892
|
+
if (_intern.has(key)) {
|
|
893
|
+
value = _intern.get(value);
|
|
894
|
+
_intern.delete(key);
|
|
895
|
+
}
|
|
896
|
+
return value;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
function keyof(value) {
|
|
900
|
+
return value !== null && typeof value === "object" ? value.valueOf() : value;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
exports.InternMap = InternMap;
|
|
904
|
+
exports.InternSet = InternSet;
|
|
905
|
+
|
|
906
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
907
|
+
|
|
908
|
+
})));
|
|
909
|
+
});
|
|
910
|
+
|
|
911
|
+
function identity$1(x) {
|
|
736
912
|
return x;
|
|
737
913
|
}
|
|
738
914
|
|
|
739
915
|
function group(values, ...keys) {
|
|
740
|
-
return nest(values, identity, identity, keys);
|
|
916
|
+
return nest(values, identity$1, identity$1, keys);
|
|
741
917
|
}
|
|
742
918
|
|
|
743
919
|
function nest(values, map, reduce, keys) {
|
|
744
920
|
return (function regroup(values, i) {
|
|
745
921
|
if (i >= keys.length) return reduce(values);
|
|
746
|
-
const groups = new
|
|
922
|
+
const groups = new internmap.InternMap();
|
|
747
923
|
const keyof = keys[i++];
|
|
748
924
|
let index = -1;
|
|
749
925
|
for (const value of values) {
|
|
@@ -776,16 +952,18 @@ var drawChart = (function () {
|
|
|
776
952
|
if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];
|
|
777
953
|
|
|
778
954
|
if (step > 0) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
955
|
+
let r0 = Math.round(start / step), r1 = Math.round(stop / step);
|
|
956
|
+
if (r0 * step < start) ++r0;
|
|
957
|
+
if (r1 * step > stop) --r1;
|
|
958
|
+
ticks = new Array(n = r1 - r0 + 1);
|
|
959
|
+
while (++i < n) ticks[i] = (r0 + i) * step;
|
|
783
960
|
} else {
|
|
784
961
|
step = -step;
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
962
|
+
let r0 = Math.round(start * step), r1 = Math.round(stop * step);
|
|
963
|
+
if (r0 / step < start) ++r0;
|
|
964
|
+
if (r1 / step > stop) --r1;
|
|
965
|
+
ticks = new Array(n = r1 - r0 + 1);
|
|
966
|
+
while (++i < n) ticks[i] = (r0 + i) / step;
|
|
789
967
|
}
|
|
790
968
|
|
|
791
969
|
if (reverse) ticks.reverse();
|
|
@@ -812,6 +990,90 @@ var drawChart = (function () {
|
|
|
812
990
|
return stop < start ? -step1 : step1;
|
|
813
991
|
}
|
|
814
992
|
|
|
993
|
+
const TOP_PADDING = 20;
|
|
994
|
+
const PADDING = 2;
|
|
995
|
+
|
|
996
|
+
const Node = ({ node, onMouseOver, onClick, selected }) => {
|
|
997
|
+
const { getModuleColor } = F(StaticContext);
|
|
998
|
+
const { backgroundColor, fontColor } = getModuleColor(node);
|
|
999
|
+
const { x0, x1, y1, y0, data, children = null } = node;
|
|
1000
|
+
const textRef = s();
|
|
1001
|
+
const textRectRef = s();
|
|
1002
|
+
const width = x1 - x0;
|
|
1003
|
+
const height = y1 - y0;
|
|
1004
|
+
const textProps = {
|
|
1005
|
+
"font-size": "0.7em",
|
|
1006
|
+
"dominant-baseline": "middle",
|
|
1007
|
+
"text-anchor": "middle",
|
|
1008
|
+
x: width / 2,
|
|
1009
|
+
};
|
|
1010
|
+
if (children != null) {
|
|
1011
|
+
textProps.y = (TOP_PADDING + PADDING) / 2;
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
textProps.y = height / 2;
|
|
1015
|
+
}
|
|
1016
|
+
h(() => {
|
|
1017
|
+
if (width == 0 || height == 0) {
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
if (textRectRef.current == null) {
|
|
1021
|
+
textRectRef.current = textRef.current.getBoundingClientRect();
|
|
1022
|
+
}
|
|
1023
|
+
let scale = 1;
|
|
1024
|
+
if (children != null) {
|
|
1025
|
+
scale = Math.min((width * 0.9) / textRectRef.current.width, Math.min(height, TOP_PADDING + PADDING) / textRectRef.current.height);
|
|
1026
|
+
scale = Math.min(1, scale);
|
|
1027
|
+
textRef.current.setAttribute("y", String(Math.min(TOP_PADDING + PADDING, height) / 2 / scale));
|
|
1028
|
+
textRef.current.setAttribute("x", String(width / 2 / scale));
|
|
1029
|
+
}
|
|
1030
|
+
else {
|
|
1031
|
+
scale = Math.min((width * 0.9) / textRectRef.current.width, (height * 0.9) / textRectRef.current.height);
|
|
1032
|
+
scale = Math.min(1, scale);
|
|
1033
|
+
textRef.current.setAttribute("y", String(height / 2 / scale));
|
|
1034
|
+
textRef.current.setAttribute("x", String(width / 2 / scale));
|
|
1035
|
+
}
|
|
1036
|
+
textRef.current.setAttribute("transform", `scale(${scale.toFixed(2)})`);
|
|
1037
|
+
}, [children, height, width]);
|
|
1038
|
+
if (width == 0 || height == 0) {
|
|
1039
|
+
return null;
|
|
1040
|
+
}
|
|
1041
|
+
return (o$1("g", Object.assign({ className: "node", transform: `translate(${x0},${y0})`, onClick: (event) => {
|
|
1042
|
+
event.stopPropagation();
|
|
1043
|
+
onClick(node);
|
|
1044
|
+
}, onMouseOver: (event) => {
|
|
1045
|
+
event.stopPropagation();
|
|
1046
|
+
onMouseOver(node);
|
|
1047
|
+
} }, { children: [o$1("rect", { fill: backgroundColor, rx: 2, ry: 2, width: x1 - x0, height: y1 - y0, stroke: selected ? "#fff" : undefined, "stroke-width": selected ? 2 : undefined }, void 0),
|
|
1048
|
+
o$1("text", Object.assign({ ref: textRef, fill: fontColor, onClick: (event) => {
|
|
1049
|
+
var _a;
|
|
1050
|
+
if (((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) !== "") {
|
|
1051
|
+
event.stopPropagation();
|
|
1052
|
+
}
|
|
1053
|
+
} }, textProps, { children: data.name }), void 0)] }), void 0));
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1056
|
+
const TreeMap = ({ root, onNodeHover, selectedNode, onNodeClick }) => {
|
|
1057
|
+
const { width, height, getModuleIds } = F(StaticContext);
|
|
1058
|
+
console.time("layering");
|
|
1059
|
+
// this will make groups by height
|
|
1060
|
+
const nestedData = d(() => {
|
|
1061
|
+
const nestedDataMap = group(root.descendants(), (d) => d.height);
|
|
1062
|
+
const nestedData = Array.from(nestedDataMap, ([key, values]) => ({
|
|
1063
|
+
key,
|
|
1064
|
+
values,
|
|
1065
|
+
}));
|
|
1066
|
+
nestedData.sort((a, b) => b.key - a.key);
|
|
1067
|
+
return nestedData;
|
|
1068
|
+
}, [root]);
|
|
1069
|
+
console.timeEnd("layering");
|
|
1070
|
+
return (o$1("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, { children: nestedData.map(({ key, values }) => {
|
|
1071
|
+
return (o$1("g", Object.assign({ className: "layer" }, { children: values.map((node) => {
|
|
1072
|
+
return (o$1(Node, { node: node, onMouseOver: onNodeHover, selected: selectedNode === node, onClick: onNodeClick }, getModuleIds(node.data).nodeUid.id));
|
|
1073
|
+
}) }), key));
|
|
1074
|
+
}) }), void 0));
|
|
1075
|
+
};
|
|
1076
|
+
|
|
815
1077
|
/*!
|
|
816
1078
|
* bytes
|
|
817
1079
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
@@ -898,360 +1160,155 @@ var drawChart = (function () {
|
|
|
898
1160
|
return str + unitSeparator + unit;
|
|
899
1161
|
}
|
|
900
1162
|
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
</rect>
|
|
963
|
-
<clipPath id=${clipUid.id}>
|
|
964
|
-
<use xlink:href=${nodeUid.href} />
|
|
965
|
-
</clipPath>
|
|
966
|
-
<text
|
|
967
|
-
clip-path=${clipUid}
|
|
968
|
-
fill=${fontColor}
|
|
969
|
-
onClick=${handleClickSelection}
|
|
970
|
-
>
|
|
971
|
-
<tspan ...${tspan1Props} font-size="0.7em">${data.name}</tspan>
|
|
972
|
-
<tspan ...${tspan2Props} fill-opacity=${0.7} font-size="0.7em"
|
|
973
|
-
>${format_1(originalValue[sizeProperty])}</tspan
|
|
974
|
-
>
|
|
975
|
-
</text>
|
|
976
|
-
</g>
|
|
977
|
-
`;
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
const TreeMap = ({
|
|
981
|
-
root,
|
|
982
|
-
layout,
|
|
983
|
-
color,
|
|
984
|
-
width,
|
|
985
|
-
height,
|
|
986
|
-
onNodeHover,
|
|
987
|
-
sizeProperty,
|
|
988
|
-
}) => {
|
|
989
|
-
const [selectedNode, setSelectedNode] = m$2(null);
|
|
990
|
-
|
|
991
|
-
const desiredValue = root.originalValue[sizeProperty] * 0.2;
|
|
992
|
-
|
|
993
|
-
//handle zoom of selected node
|
|
994
|
-
const selectedNodeMultiplier =
|
|
995
|
-
selectedNode != null
|
|
996
|
-
? desiredValue > selectedNode.originalValue[sizeProperty]
|
|
997
|
-
? desiredValue / selectedNode.originalValue[sizeProperty]
|
|
998
|
-
: 3
|
|
999
|
-
: 1;
|
|
1000
|
-
|
|
1001
|
-
// i only need to increase value of leaf nodes
|
|
1002
|
-
// as folders will sum they up
|
|
1003
|
-
const nodesToIncrease =
|
|
1004
|
-
selectedNode != null
|
|
1005
|
-
? selectedNode.children != null
|
|
1006
|
-
? selectedNode.leaves()
|
|
1007
|
-
: [selectedNode]
|
|
1008
|
-
: [];
|
|
1009
|
-
|
|
1010
|
-
const nodesToIncreaseSet = new Set(nodesToIncrease);
|
|
1011
|
-
|
|
1012
|
-
// update value for nodes
|
|
1013
|
-
root = root.eachAfter((node) => {
|
|
1014
|
-
let sum = 0;
|
|
1015
|
-
const children = node.children;
|
|
1016
|
-
if (children != null) {
|
|
1017
|
-
let i = children.length;
|
|
1018
|
-
while (--i >= 0) sum += children[i].value;
|
|
1019
|
-
} else {
|
|
1020
|
-
sum = nodesToIncreaseSet.has(node)
|
|
1021
|
-
? node.originalValue[sizeProperty] * selectedNodeMultiplier
|
|
1022
|
-
: node.originalValue[sizeProperty];
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
node.value = sum;
|
|
1026
|
-
});
|
|
1027
|
-
|
|
1028
|
-
layout(root);
|
|
1029
|
-
|
|
1030
|
-
// this will make groups by height
|
|
1031
|
-
const nestedDataMap = group(root.descendants(), (d) => d.height);
|
|
1032
|
-
const nestedData = Array.from(nestedDataMap, ([key, values]) => ({
|
|
1033
|
-
key,
|
|
1034
|
-
values,
|
|
1035
|
-
}));
|
|
1036
|
-
nestedData.sort((a, b) => b.key - a.key);
|
|
1037
|
-
|
|
1038
|
-
return m$1`
|
|
1039
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox=${`0 0 ${width} ${height}`}>
|
|
1040
|
-
${nestedData.map(({ key, values }) => {
|
|
1041
|
-
return m$1`
|
|
1042
|
-
<g class="layer" key=${key}>
|
|
1043
|
-
${values.map((node) => {
|
|
1044
|
-
const { backgroundColor, fontColor } = color(node);
|
|
1045
|
-
return m$1`
|
|
1046
|
-
<${Node$1}
|
|
1047
|
-
node=${node}
|
|
1048
|
-
backgroundColor=${backgroundColor}
|
|
1049
|
-
fontColor=${fontColor}
|
|
1050
|
-
onClick=${() =>
|
|
1051
|
-
setSelectedNode(selectedNode === node ? null : node)}
|
|
1052
|
-
isSelected=${selectedNode === node}
|
|
1053
|
-
onNodeHover=${onNodeHover}
|
|
1054
|
-
sizeProperty=${sizeProperty}
|
|
1055
|
-
/>
|
|
1056
|
-
`;
|
|
1057
|
-
})}
|
|
1058
|
-
</g>
|
|
1059
|
-
`;
|
|
1060
|
-
})}
|
|
1061
|
-
</svg>
|
|
1062
|
-
`;
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
const Tooltip = ({
|
|
1066
|
-
node,
|
|
1067
|
-
visible,
|
|
1068
|
-
root,
|
|
1069
|
-
sizeProperty,
|
|
1070
|
-
availableSizeProperties,
|
|
1071
|
-
importedByCache,
|
|
1072
|
-
}) => {
|
|
1073
|
-
const ref = h$1();
|
|
1074
|
-
const [style, setStyle] = m$2({});
|
|
1075
|
-
const content = _$1(() => {
|
|
1076
|
-
if (!node) return null;
|
|
1077
|
-
|
|
1078
|
-
const mainSize = node.originalValue[sizeProperty];
|
|
1079
|
-
|
|
1080
|
-
const percentageNum = (100 * mainSize) / root.originalValue[sizeProperty];
|
|
1081
|
-
const percentage = percentageNum.toFixed(2);
|
|
1082
|
-
const percentageString = percentage + "%";
|
|
1083
|
-
|
|
1084
|
-
const uid = node.data.uid;
|
|
1085
|
-
|
|
1086
|
-
const path = node
|
|
1087
|
-
.ancestors()
|
|
1088
|
-
.reverse()
|
|
1089
|
-
.map((d) => d.data.name)
|
|
1090
|
-
.join("/");
|
|
1091
|
-
|
|
1092
|
-
return m$1`
|
|
1093
|
-
<div>${path}</div>
|
|
1094
|
-
${availableSizeProperties.map((sizeProp) => {
|
|
1095
|
-
if (sizeProp === sizeProperty) {
|
|
1096
|
-
return m$1`
|
|
1097
|
-
<div>
|
|
1098
|
-
<b>${LABELS[sizeProp]}:${" "}${format_1(mainSize)}</b
|
|
1099
|
-
>${" "}(${percentageString})
|
|
1100
|
-
</div>
|
|
1101
|
-
`;
|
|
1102
|
-
} else {
|
|
1103
|
-
return m$1`
|
|
1104
|
-
<div>
|
|
1105
|
-
${LABELS[sizeProp]}:${" "}
|
|
1106
|
-
${format_1(node.originalValue[sizeProp])}
|
|
1107
|
-
</div>
|
|
1108
|
-
`;
|
|
1109
|
-
}
|
|
1110
|
-
})}
|
|
1111
|
-
${uid &&
|
|
1112
|
-
importedByCache.has(uid) &&
|
|
1113
|
-
m$1`
|
|
1114
|
-
<div>
|
|
1115
|
-
<div><b>Imported By</b>:</div>
|
|
1116
|
-
${[...new Set(importedByCache.get(uid).map(({ id }) => id))].map(
|
|
1117
|
-
(id) => m$1` <div>${id}</div> `
|
|
1118
|
-
)}
|
|
1119
|
-
</div>
|
|
1120
|
-
`}
|
|
1121
|
-
`;
|
|
1122
|
-
}, [node]);
|
|
1123
|
-
|
|
1124
|
-
const updatePosition = (mouseCoords) => {
|
|
1125
|
-
const pos = {
|
|
1126
|
-
left: mouseCoords.x + Tooltip.marginX,
|
|
1127
|
-
top: mouseCoords.y + Tooltip.marginY,
|
|
1128
|
-
};
|
|
1129
|
-
|
|
1130
|
-
const boundingRect = ref.current.getBoundingClientRect();
|
|
1131
|
-
|
|
1132
|
-
if (pos.left + boundingRect.width > window.innerWidth) {
|
|
1133
|
-
// Shifting horizontally
|
|
1134
|
-
pos.left = window.innerWidth - boundingRect.width;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
if (pos.top + boundingRect.height > window.innerHeight) {
|
|
1138
|
-
// Flipping vertically
|
|
1139
|
-
pos.top = mouseCoords.y - Tooltip.marginY - boundingRect.height;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
setStyle(pos);
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
const handleMouseMove = (event) => {
|
|
1146
|
-
updatePosition({
|
|
1147
|
-
x: event.pageX,
|
|
1148
|
-
y: event.pageY,
|
|
1149
|
-
});
|
|
1150
|
-
};
|
|
1151
|
-
|
|
1152
|
-
y(() => {
|
|
1153
|
-
document.addEventListener("mousemove", handleMouseMove, true);
|
|
1154
|
-
return () => {
|
|
1155
|
-
document.removeEventListener("mousemove", handleMouseMove, true);
|
|
1163
|
+
const Tooltip_marginX = 10;
|
|
1164
|
+
const Tooltip_marginY = 30;
|
|
1165
|
+
const SOURCEMAP_RENDERED = (o$1("span", { children: [" ", o$1("b", { children: LABELS.renderedLength }, void 0), " is a number of characters in the file after individual and ", o$1("br", {}, void 0), " whole bundle transformations according to sourcemap."] }, void 0));
|
|
1166
|
+
const RENDRED = (o$1("span", { children: [o$1("b", { children: LABELS.renderedLength }, void 0), " is a byte size of individual file after transformations and treeshake."] }, void 0));
|
|
1167
|
+
const COMPRESSED = (o$1("span", { children: [o$1("b", { children: LABELS.gzipLength }, void 0), " and ", o$1("b", { children: LABELS.brotliLength }, void 0), " is a byte size of individual file after individual", " ", "transformations,", o$1("br", {}, void 0), " treeshake and compression."] }, void 0));
|
|
1168
|
+
const Tooltip = ({ node, visible, root, sizeProperty }) => {
|
|
1169
|
+
const { availableSizeProperties, getModuleSize, data } = F(StaticContext);
|
|
1170
|
+
const ref = s();
|
|
1171
|
+
const [style, setStyle] = l({});
|
|
1172
|
+
const content = d(() => {
|
|
1173
|
+
if (!node)
|
|
1174
|
+
return null;
|
|
1175
|
+
const mainSize = getModuleSize(node.data, sizeProperty);
|
|
1176
|
+
const percentageNum = (100 * mainSize) / getModuleSize(root.data, sizeProperty);
|
|
1177
|
+
const percentage = percentageNum.toFixed(2);
|
|
1178
|
+
const percentageString = percentage + "%";
|
|
1179
|
+
const path = node
|
|
1180
|
+
.ancestors()
|
|
1181
|
+
.reverse()
|
|
1182
|
+
.map((d) => d.data.name)
|
|
1183
|
+
.join("/");
|
|
1184
|
+
let dataNode = null;
|
|
1185
|
+
if (!isModuleTree(node.data)) {
|
|
1186
|
+
const mainUid = data.nodeParts[node.data.uid].mainUid;
|
|
1187
|
+
dataNode = data.nodeMetas[mainUid];
|
|
1188
|
+
}
|
|
1189
|
+
return (o$1(y$1, { children: [o$1("div", { children: path }, void 0),
|
|
1190
|
+
availableSizeProperties.map((sizeProp) => {
|
|
1191
|
+
if (sizeProp === sizeProperty) {
|
|
1192
|
+
return (o$1("div", { children: [o$1("b", { children: [LABELS[sizeProp], ": ", format_1(mainSize)] }, void 0), " ", "(", percentageString, ")"] }, void 0));
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
return (o$1("div", { children: [LABELS[sizeProp], ": ", format_1(getModuleSize(node.data, sizeProp))] }, void 0));
|
|
1196
|
+
}
|
|
1197
|
+
}),
|
|
1198
|
+
o$1("br", {}, void 0),
|
|
1199
|
+
dataNode && dataNode.importedBy.length > 0 && (o$1("div", { children: [o$1("div", { children: [o$1("b", { children: "Imported By" }, void 0), ":"] }, void 0),
|
|
1200
|
+
dataNode.importedBy.map(({ uid }) => {
|
|
1201
|
+
const id = data.nodeMetas[uid].id;
|
|
1202
|
+
return o$1("div", { children: id }, id);
|
|
1203
|
+
})] }, void 0)),
|
|
1204
|
+
o$1("br", {}, void 0),
|
|
1205
|
+
o$1("small", { children: data.options.sourcemap ? SOURCEMAP_RENDERED : RENDRED }, void 0),
|
|
1206
|
+
(data.options.gzip || data.options.brotli) && (o$1(y$1, { children: [o$1("br", {}, void 0),
|
|
1207
|
+
o$1("small", { children: COMPRESSED }, void 0)] }, void 0))] }, void 0));
|
|
1208
|
+
}, [availableSizeProperties, data, getModuleSize, node, root.data, sizeProperty]);
|
|
1209
|
+
const updatePosition = (mouseCoords) => {
|
|
1210
|
+
const pos = {
|
|
1211
|
+
left: mouseCoords.x + Tooltip_marginX,
|
|
1212
|
+
top: mouseCoords.y + Tooltip_marginY,
|
|
1213
|
+
};
|
|
1214
|
+
const boundingRect = ref.current.getBoundingClientRect();
|
|
1215
|
+
if (pos.left + boundingRect.width > window.innerWidth) {
|
|
1216
|
+
// Shifting horizontally
|
|
1217
|
+
pos.left = window.innerWidth - boundingRect.width;
|
|
1218
|
+
}
|
|
1219
|
+
if (pos.top + boundingRect.height > window.innerHeight) {
|
|
1220
|
+
// Flipping vertically
|
|
1221
|
+
pos.top = mouseCoords.y - Tooltip_marginY - boundingRect.height;
|
|
1222
|
+
}
|
|
1223
|
+
setStyle(pos);
|
|
1156
1224
|
};
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1225
|
+
y(() => {
|
|
1226
|
+
const handleMouseMove = (event) => {
|
|
1227
|
+
updatePosition({
|
|
1228
|
+
x: event.pageX,
|
|
1229
|
+
y: event.pageY,
|
|
1230
|
+
});
|
|
1231
|
+
};
|
|
1232
|
+
document.addEventListener("mousemove", handleMouseMove, true);
|
|
1233
|
+
return () => {
|
|
1234
|
+
document.removeEventListener("mousemove", handleMouseMove, true);
|
|
1235
|
+
};
|
|
1236
|
+
}, []);
|
|
1237
|
+
return (o$1("div", Object.assign({ className: `tooltip ${visible ? "" : "tooltip-hidden"}`, ref: ref, style: style }, { children: content }), void 0));
|
|
1168
1238
|
};
|
|
1169
1239
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
};
|
|
1190
|
-
|
|
1191
|
-
y(() => {
|
|
1192
|
-
document.addEventListener("mouseover", handleMouseOut);
|
|
1193
|
-
return () => {
|
|
1194
|
-
document.removeEventListener("mouseover", handleMouseOut);
|
|
1195
|
-
};
|
|
1196
|
-
}, []);
|
|
1197
|
-
|
|
1198
|
-
return m$1`
|
|
1199
|
-
<${TreeMap}
|
|
1200
|
-
layout=${layout}
|
|
1201
|
-
root=${root}
|
|
1202
|
-
color=${color}
|
|
1203
|
-
width=${width}
|
|
1204
|
-
height=${height}
|
|
1205
|
-
sizeProperty=${sizeProperty}
|
|
1206
|
-
availableSizeProperties=${availableSizeProperties}
|
|
1207
|
-
onNodeHover=${(node) => {
|
|
1208
|
-
setTooltipNode(node);
|
|
1209
|
-
setShowTooltip(true);
|
|
1210
|
-
}}
|
|
1211
|
-
/>
|
|
1212
|
-
<${Tooltip}
|
|
1213
|
-
visible=${showTooltip}
|
|
1214
|
-
node=${tooltipNode}
|
|
1215
|
-
root=${root}
|
|
1216
|
-
sizeProperty=${sizeProperty}
|
|
1217
|
-
availableSizeProperties=${availableSizeProperties}
|
|
1218
|
-
importedByCache=${importedByCache}
|
|
1219
|
-
importedCache=${importedCache}
|
|
1220
|
-
/>
|
|
1221
|
-
`;
|
|
1240
|
+
const Chart = ({ root, sizeProperty, selectedNode, setSelectedNode }) => {
|
|
1241
|
+
const [showTooltip, setShowTooltip] = l(false);
|
|
1242
|
+
const [tooltipNode, setTooltipNode] = l(undefined);
|
|
1243
|
+
y(() => {
|
|
1244
|
+
const handleMouseOut = () => {
|
|
1245
|
+
setShowTooltip(false);
|
|
1246
|
+
};
|
|
1247
|
+
document.addEventListener("mouseover", handleMouseOut);
|
|
1248
|
+
return () => {
|
|
1249
|
+
document.removeEventListener("mouseover", handleMouseOut);
|
|
1250
|
+
};
|
|
1251
|
+
}, []);
|
|
1252
|
+
return (o$1(y$1, { children: [o$1(TreeMap, { root: root, onNodeHover: (node) => {
|
|
1253
|
+
setTooltipNode(node);
|
|
1254
|
+
setShowTooltip(true);
|
|
1255
|
+
}, selectedNode: selectedNode, onNodeClick: (node) => {
|
|
1256
|
+
setSelectedNode(selectedNode === node ? undefined : node);
|
|
1257
|
+
} }, void 0),
|
|
1258
|
+
o$1(Tooltip, { visible: showTooltip, node: tooltipNode, root: root, sizeProperty: sizeProperty }, void 0)] }, void 0));
|
|
1222
1259
|
};
|
|
1223
1260
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1261
|
+
const Main = () => {
|
|
1262
|
+
const { availableSizeProperties, rawHierarchy, getModuleSize, layout, data } = F(StaticContext);
|
|
1263
|
+
const [sizeProperty, setSizeProperty] = l(availableSizeProperties[0]);
|
|
1264
|
+
const [selectedNode, setSelectedNode] = l(undefined);
|
|
1265
|
+
const { getModuleFilterMultiplier, setExcludeFilter, setIncludeFilter } = useFilter();
|
|
1266
|
+
console.time("getNodeSizeMultiplier");
|
|
1267
|
+
const getNodeSizeMultiplier = d(() => {
|
|
1268
|
+
const rootSize = getModuleSize(rawHierarchy.data, sizeProperty);
|
|
1269
|
+
const selectedSize = selectedNode ? getModuleSize(selectedNode.data, sizeProperty) : 1;
|
|
1270
|
+
const multiplier = rootSize * 0.2 > selectedSize ? (rootSize * 0.2) / selectedSize : 3;
|
|
1271
|
+
if (selectedNode === undefined) {
|
|
1272
|
+
return () => 1;
|
|
1273
|
+
}
|
|
1274
|
+
else if (isModuleTree(selectedNode.data)) {
|
|
1275
|
+
const leaves = new Set(selectedNode.leaves().map((d) => d.data));
|
|
1276
|
+
return (node) => {
|
|
1277
|
+
if (leaves.has(node)) {
|
|
1278
|
+
return multiplier;
|
|
1279
|
+
}
|
|
1280
|
+
return 1;
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
else {
|
|
1284
|
+
return (node) => {
|
|
1285
|
+
if (node === selectedNode.data) {
|
|
1286
|
+
return multiplier;
|
|
1287
|
+
}
|
|
1288
|
+
return 1;
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
}, [getModuleSize, rawHierarchy.data, selectedNode, sizeProperty]);
|
|
1292
|
+
console.timeEnd("getNodeSizeMultiplier");
|
|
1293
|
+
console.time("root hierarchy compute");
|
|
1294
|
+
// root here always be the same as rawHierarchy even after layouting
|
|
1295
|
+
const root = d(() => {
|
|
1296
|
+
const rootWithSizesAndSorted = rawHierarchy
|
|
1297
|
+
.sum((node) => {
|
|
1298
|
+
if (isModuleTree(node))
|
|
1299
|
+
return 0;
|
|
1300
|
+
const ownSize = getModuleSize(node, sizeProperty);
|
|
1301
|
+
const zoomMultiplier = getNodeSizeMultiplier(node);
|
|
1302
|
+
const filterMultiplier = getModuleFilterMultiplier(data.nodeMetas[data.nodeParts[node.uid].mainUid]);
|
|
1303
|
+
return ownSize * zoomMultiplier * filterMultiplier;
|
|
1304
|
+
})
|
|
1305
|
+
.sort((a, b) => getModuleSize(a.data, sizeProperty) - getModuleSize(b.data, sizeProperty));
|
|
1306
|
+
return layout(rootWithSizesAndSorted);
|
|
1307
|
+
}, [data, getModuleFilterMultiplier, getModuleSize, getNodeSizeMultiplier, layout, rawHierarchy, sizeProperty]);
|
|
1308
|
+
console.timeEnd("root hierarchy compute");
|
|
1309
|
+
return (o$1(y$1, { children: [o$1(SideBar, { sizeProperty: sizeProperty, availableSizeProperties: availableSizeProperties, setSizeProperty: setSizeProperty, onExcludeChange: setExcludeFilter, onIncludeChange: setIncludeFilter }, void 0),
|
|
1310
|
+
o$1(Chart, { root: root, sizeProperty: sizeProperty, selectedNode: selectedNode, setSelectedNode: setSelectedNode }, void 0)] }, void 0));
|
|
1311
|
+
};
|
|
1255
1312
|
|
|
1256
1313
|
function initRange(domain, range) {
|
|
1257
1314
|
switch (arguments.length) {
|
|
@@ -1661,7 +1718,239 @@ var drawChart = (function () {
|
|
|
1661
1718
|
: m1) * 255;
|
|
1662
1719
|
}
|
|
1663
1720
|
|
|
1664
|
-
|
|
1721
|
+
const radians = Math.PI / 180;
|
|
1722
|
+
const degrees = 180 / Math.PI;
|
|
1723
|
+
|
|
1724
|
+
// https://observablehq.com/@mbostock/lab-and-rgb
|
|
1725
|
+
const K = 18,
|
|
1726
|
+
Xn = 0.96422,
|
|
1727
|
+
Yn = 1,
|
|
1728
|
+
Zn = 0.82521,
|
|
1729
|
+
t0 = 4 / 29,
|
|
1730
|
+
t1 = 6 / 29,
|
|
1731
|
+
t2 = 3 * t1 * t1,
|
|
1732
|
+
t3 = t1 * t1 * t1;
|
|
1733
|
+
|
|
1734
|
+
function labConvert(o) {
|
|
1735
|
+
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
|
|
1736
|
+
if (o instanceof Hcl) return hcl2lab(o);
|
|
1737
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
1738
|
+
var r = rgb2lrgb(o.r),
|
|
1739
|
+
g = rgb2lrgb(o.g),
|
|
1740
|
+
b = rgb2lrgb(o.b),
|
|
1741
|
+
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
|
|
1742
|
+
if (r === g && g === b) x = z = y; else {
|
|
1743
|
+
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
|
|
1744
|
+
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
|
|
1745
|
+
}
|
|
1746
|
+
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
function gray(l, opacity) {
|
|
1750
|
+
return new Lab(l, 0, 0, opacity == null ? 1 : opacity);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
function lab(l, a, b, opacity) {
|
|
1754
|
+
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
function Lab(l, a, b, opacity) {
|
|
1758
|
+
this.l = +l;
|
|
1759
|
+
this.a = +a;
|
|
1760
|
+
this.b = +b;
|
|
1761
|
+
this.opacity = +opacity;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
define(Lab, lab, extend(Color, {
|
|
1765
|
+
brighter: function(k) {
|
|
1766
|
+
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1767
|
+
},
|
|
1768
|
+
darker: function(k) {
|
|
1769
|
+
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1770
|
+
},
|
|
1771
|
+
rgb: function() {
|
|
1772
|
+
var y = (this.l + 16) / 116,
|
|
1773
|
+
x = isNaN(this.a) ? y : y + this.a / 500,
|
|
1774
|
+
z = isNaN(this.b) ? y : y - this.b / 200;
|
|
1775
|
+
x = Xn * lab2xyz(x);
|
|
1776
|
+
y = Yn * lab2xyz(y);
|
|
1777
|
+
z = Zn * lab2xyz(z);
|
|
1778
|
+
return new Rgb(
|
|
1779
|
+
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
|
|
1780
|
+
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
|
|
1781
|
+
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
|
|
1782
|
+
this.opacity
|
|
1783
|
+
);
|
|
1784
|
+
}
|
|
1785
|
+
}));
|
|
1786
|
+
|
|
1787
|
+
function xyz2lab(t) {
|
|
1788
|
+
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
function lab2xyz(t) {
|
|
1792
|
+
return t > t1 ? t * t * t : t2 * (t - t0);
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
function lrgb2rgb(x) {
|
|
1796
|
+
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
function rgb2lrgb(x) {
|
|
1800
|
+
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
function hclConvert(o) {
|
|
1804
|
+
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
|
|
1805
|
+
if (!(o instanceof Lab)) o = labConvert(o);
|
|
1806
|
+
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
1807
|
+
var h = Math.atan2(o.b, o.a) * degrees;
|
|
1808
|
+
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
function lch(l, c, h, opacity) {
|
|
1812
|
+
return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
function hcl(h, c, l, opacity) {
|
|
1816
|
+
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
function Hcl(h, c, l, opacity) {
|
|
1820
|
+
this.h = +h;
|
|
1821
|
+
this.c = +c;
|
|
1822
|
+
this.l = +l;
|
|
1823
|
+
this.opacity = +opacity;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
function hcl2lab(o) {
|
|
1827
|
+
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
|
|
1828
|
+
var h = o.h * radians;
|
|
1829
|
+
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
define(Hcl, hcl, extend(Color, {
|
|
1833
|
+
brighter: function(k) {
|
|
1834
|
+
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
|
|
1835
|
+
},
|
|
1836
|
+
darker: function(k) {
|
|
1837
|
+
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
|
|
1838
|
+
},
|
|
1839
|
+
rgb: function() {
|
|
1840
|
+
return hcl2lab(this).rgb();
|
|
1841
|
+
}
|
|
1842
|
+
}));
|
|
1843
|
+
|
|
1844
|
+
var A = -0.14861,
|
|
1845
|
+
B = +1.78277,
|
|
1846
|
+
C = -0.29227,
|
|
1847
|
+
D = -0.90649,
|
|
1848
|
+
E = +1.97294,
|
|
1849
|
+
ED = E * D,
|
|
1850
|
+
EB = E * B,
|
|
1851
|
+
BC_DA = B * C - D * A;
|
|
1852
|
+
|
|
1853
|
+
function cubehelixConvert(o) {
|
|
1854
|
+
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
|
|
1855
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
1856
|
+
var r = o.r / 255,
|
|
1857
|
+
g = o.g / 255,
|
|
1858
|
+
b = o.b / 255,
|
|
1859
|
+
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
|
|
1860
|
+
bl = b - l,
|
|
1861
|
+
k = (E * (g - l) - C * bl) / D,
|
|
1862
|
+
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
|
|
1863
|
+
h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;
|
|
1864
|
+
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
function cubehelix(h, s, l, opacity) {
|
|
1868
|
+
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
function Cubehelix(h, s, l, opacity) {
|
|
1872
|
+
this.h = +h;
|
|
1873
|
+
this.s = +s;
|
|
1874
|
+
this.l = +l;
|
|
1875
|
+
this.opacity = +opacity;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
define(Cubehelix, cubehelix, extend(Color, {
|
|
1879
|
+
brighter: function(k) {
|
|
1880
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1881
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
1882
|
+
},
|
|
1883
|
+
darker: function(k) {
|
|
1884
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
1885
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
1886
|
+
},
|
|
1887
|
+
rgb: function() {
|
|
1888
|
+
var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,
|
|
1889
|
+
l = +this.l,
|
|
1890
|
+
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
|
|
1891
|
+
cosh = Math.cos(h),
|
|
1892
|
+
sinh = Math.sin(h);
|
|
1893
|
+
return new Rgb(
|
|
1894
|
+
255 * (l + a * (A * cosh + B * sinh)),
|
|
1895
|
+
255 * (l + a * (C * cosh + D * sinh)),
|
|
1896
|
+
255 * (l + a * (E * cosh)),
|
|
1897
|
+
this.opacity
|
|
1898
|
+
);
|
|
1899
|
+
}
|
|
1900
|
+
}));
|
|
1901
|
+
|
|
1902
|
+
var src = /*#__PURE__*/Object.freeze({
|
|
1903
|
+
__proto__: null,
|
|
1904
|
+
color: color,
|
|
1905
|
+
rgb: rgb,
|
|
1906
|
+
hsl: hsl,
|
|
1907
|
+
lab: lab,
|
|
1908
|
+
hcl: hcl,
|
|
1909
|
+
lch: lch,
|
|
1910
|
+
gray: gray,
|
|
1911
|
+
cubehelix: cubehelix
|
|
1912
|
+
});
|
|
1913
|
+
|
|
1914
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(src);
|
|
1915
|
+
|
|
1916
|
+
var d3Interpolate = createCommonjsModule(function (module, exports) {
|
|
1917
|
+
// https://d3js.org/d3-interpolate/ v2.0.1 Copyright 2020 Mike Bostock
|
|
1918
|
+
(function (global, factory) {
|
|
1919
|
+
factory(exports, require$$0) ;
|
|
1920
|
+
}(this, function (exports, d3Color) {
|
|
1921
|
+
function basis(t1, v0, v1, v2, v3) {
|
|
1922
|
+
var t2 = t1 * t1, t3 = t2 * t1;
|
|
1923
|
+
return ((1 - 3 * t1 + 3 * t2 - t3) * v0
|
|
1924
|
+
+ (4 - 6 * t2 + 3 * t3) * v1
|
|
1925
|
+
+ (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
|
|
1926
|
+
+ t3 * v3) / 6;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
function basis$1(values) {
|
|
1930
|
+
var n = values.length - 1;
|
|
1931
|
+
return function(t) {
|
|
1932
|
+
var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
|
|
1933
|
+
v1 = values[i],
|
|
1934
|
+
v2 = values[i + 1],
|
|
1935
|
+
v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
|
|
1936
|
+
v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
|
|
1937
|
+
return basis((t - i / n) * n, v0, v1, v2, v3);
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
function basisClosed(values) {
|
|
1942
|
+
var n = values.length;
|
|
1943
|
+
return function(t) {
|
|
1944
|
+
var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
|
|
1945
|
+
v0 = values[(i + n - 1) % n],
|
|
1946
|
+
v1 = values[i % n],
|
|
1947
|
+
v2 = values[(i + 1) % n],
|
|
1948
|
+
v3 = values[(i + 2) % n];
|
|
1949
|
+
return basis((t - i / n) * n, v0, v1, v2, v3);
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
var constant = x => () => x;
|
|
1665
1954
|
|
|
1666
1955
|
function linear(a, d) {
|
|
1667
1956
|
return function(t) {
|
|
@@ -1675,22 +1964,27 @@ var drawChart = (function () {
|
|
|
1675
1964
|
};
|
|
1676
1965
|
}
|
|
1677
1966
|
|
|
1967
|
+
function hue(a, b) {
|
|
1968
|
+
var d = b - a;
|
|
1969
|
+
return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1678
1972
|
function gamma(y) {
|
|
1679
1973
|
return (y = +y) === 1 ? nogamma : function(a, b) {
|
|
1680
|
-
return b - a ? exponential(a, b, y) : constant
|
|
1974
|
+
return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
|
1681
1975
|
};
|
|
1682
1976
|
}
|
|
1683
1977
|
|
|
1684
1978
|
function nogamma(a, b) {
|
|
1685
1979
|
var d = b - a;
|
|
1686
|
-
return d ? linear(a, d) : constant
|
|
1980
|
+
return d ? linear(a, d) : constant(isNaN(a) ? b : a);
|
|
1687
1981
|
}
|
|
1688
1982
|
|
|
1689
|
-
var rgb
|
|
1983
|
+
var rgb = (function rgbGamma(y) {
|
|
1690
1984
|
var color = gamma(y);
|
|
1691
1985
|
|
|
1692
|
-
function rgb
|
|
1693
|
-
var r = color((start = rgb(start)).r, (end = rgb(end)).r),
|
|
1986
|
+
function rgb(start, end) {
|
|
1987
|
+
var r = color((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r),
|
|
1694
1988
|
g = color(start.g, end.g),
|
|
1695
1989
|
b = color(start.b, end.b),
|
|
1696
1990
|
opacity = nogamma(start.opacity, end.opacity);
|
|
@@ -1703,11 +1997,40 @@ var drawChart = (function () {
|
|
|
1703
1997
|
};
|
|
1704
1998
|
}
|
|
1705
1999
|
|
|
1706
|
-
rgb
|
|
2000
|
+
rgb.gamma = rgbGamma;
|
|
1707
2001
|
|
|
1708
|
-
return rgb
|
|
2002
|
+
return rgb;
|
|
1709
2003
|
})(1);
|
|
1710
2004
|
|
|
2005
|
+
function rgbSpline(spline) {
|
|
2006
|
+
return function(colors) {
|
|
2007
|
+
var n = colors.length,
|
|
2008
|
+
r = new Array(n),
|
|
2009
|
+
g = new Array(n),
|
|
2010
|
+
b = new Array(n),
|
|
2011
|
+
i, color;
|
|
2012
|
+
for (i = 0; i < n; ++i) {
|
|
2013
|
+
color = d3Color.rgb(colors[i]);
|
|
2014
|
+
r[i] = color.r || 0;
|
|
2015
|
+
g[i] = color.g || 0;
|
|
2016
|
+
b[i] = color.b || 0;
|
|
2017
|
+
}
|
|
2018
|
+
r = spline(r);
|
|
2019
|
+
g = spline(g);
|
|
2020
|
+
b = spline(b);
|
|
2021
|
+
color.opacity = 1;
|
|
2022
|
+
return function(t) {
|
|
2023
|
+
color.r = r(t);
|
|
2024
|
+
color.g = g(t);
|
|
2025
|
+
color.b = b(t);
|
|
2026
|
+
return color + "";
|
|
2027
|
+
};
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
var rgbBasis = rgbSpline(basis$1);
|
|
2032
|
+
var rgbBasisClosed = rgbSpline(basisClosed);
|
|
2033
|
+
|
|
1711
2034
|
function numberArray(a, b) {
|
|
1712
2035
|
if (!b) b = [];
|
|
1713
2036
|
var n = a ? Math.min(b.length, a.length) : 0,
|
|
@@ -1723,6 +2046,10 @@ var drawChart = (function () {
|
|
|
1723
2046
|
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
1724
2047
|
}
|
|
1725
2048
|
|
|
2049
|
+
function array(a, b) {
|
|
2050
|
+
return (isNumberArray(b) ? numberArray : genericArray)(a, b);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
1726
2053
|
function genericArray(a, b) {
|
|
1727
2054
|
var nb = b ? b.length : 0,
|
|
1728
2055
|
na = a ? Math.min(nb, a.length) : 0,
|
|
@@ -1730,7 +2057,7 @@ var drawChart = (function () {
|
|
|
1730
2057
|
c = new Array(nb),
|
|
1731
2058
|
i;
|
|
1732
2059
|
|
|
1733
|
-
for (i = 0; i < na; ++i) x[i] =
|
|
2060
|
+
for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);
|
|
1734
2061
|
for (; i < nb; ++i) c[i] = b[i];
|
|
1735
2062
|
|
|
1736
2063
|
return function(t) {
|
|
@@ -1746,7 +2073,7 @@ var drawChart = (function () {
|
|
|
1746
2073
|
};
|
|
1747
2074
|
}
|
|
1748
2075
|
|
|
1749
|
-
function
|
|
2076
|
+
function number(a, b) {
|
|
1750
2077
|
return a = +a, b = +b, function(t) {
|
|
1751
2078
|
return a * (1 - t) + b * t;
|
|
1752
2079
|
};
|
|
@@ -1762,7 +2089,7 @@ var drawChart = (function () {
|
|
|
1762
2089
|
|
|
1763
2090
|
for (k in b) {
|
|
1764
2091
|
if (k in a) {
|
|
1765
|
-
i[k] =
|
|
2092
|
+
i[k] = value(a[k], b[k]);
|
|
1766
2093
|
} else {
|
|
1767
2094
|
c[k] = b[k];
|
|
1768
2095
|
}
|
|
@@ -1814,7 +2141,7 @@ var drawChart = (function () {
|
|
|
1814
2141
|
else s[++i] = bm;
|
|
1815
2142
|
} else { // interpolate non-matching numbers
|
|
1816
2143
|
s[++i] = null;
|
|
1817
|
-
q.push({i: i, x:
|
|
2144
|
+
q.push({i: i, x: number(am, bm)});
|
|
1818
2145
|
}
|
|
1819
2146
|
bi = reB.lastIndex;
|
|
1820
2147
|
}
|
|
@@ -1837,38 +2164,358 @@ var drawChart = (function () {
|
|
|
1837
2164
|
});
|
|
1838
2165
|
}
|
|
1839
2166
|
|
|
1840
|
-
function
|
|
2167
|
+
function value(a, b) {
|
|
1841
2168
|
var t = typeof b, c;
|
|
1842
|
-
return b == null || t === "boolean" ? constant
|
|
1843
|
-
: (t === "number" ?
|
|
1844
|
-
: t === "string" ? ((c = color(b)) ? (b = c, rgb
|
|
1845
|
-
: b instanceof color ? rgb
|
|
2169
|
+
return b == null || t === "boolean" ? constant(b)
|
|
2170
|
+
: (t === "number" ? number
|
|
2171
|
+
: t === "string" ? ((c = d3Color.color(b)) ? (b = c, rgb) : string)
|
|
2172
|
+
: b instanceof d3Color.color ? rgb
|
|
1846
2173
|
: b instanceof Date ? date
|
|
1847
2174
|
: isNumberArray(b) ? numberArray
|
|
1848
2175
|
: Array.isArray(b) ? genericArray
|
|
1849
2176
|
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
|
|
1850
|
-
:
|
|
2177
|
+
: number)(a, b);
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
function discrete(range) {
|
|
2181
|
+
var n = range.length;
|
|
2182
|
+
return function(t) {
|
|
2183
|
+
return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
function hue$1(a, b) {
|
|
2188
|
+
var i = hue(+a, +b);
|
|
2189
|
+
return function(t) {
|
|
2190
|
+
var x = i(t);
|
|
2191
|
+
return x - 360 * Math.floor(x / 360);
|
|
2192
|
+
};
|
|
1851
2193
|
}
|
|
1852
2194
|
|
|
1853
|
-
function
|
|
2195
|
+
function round(a, b) {
|
|
1854
2196
|
return a = +a, b = +b, function(t) {
|
|
1855
2197
|
return Math.round(a * (1 - t) + b * t);
|
|
1856
2198
|
};
|
|
1857
2199
|
}
|
|
1858
2200
|
|
|
2201
|
+
var degrees = 180 / Math.PI;
|
|
2202
|
+
|
|
2203
|
+
var identity = {
|
|
2204
|
+
translateX: 0,
|
|
2205
|
+
translateY: 0,
|
|
2206
|
+
rotate: 0,
|
|
2207
|
+
skewX: 0,
|
|
2208
|
+
scaleX: 1,
|
|
2209
|
+
scaleY: 1
|
|
2210
|
+
};
|
|
2211
|
+
|
|
2212
|
+
function decompose(a, b, c, d, e, f) {
|
|
2213
|
+
var scaleX, scaleY, skewX;
|
|
2214
|
+
if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
|
|
2215
|
+
if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
|
|
2216
|
+
if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
|
|
2217
|
+
if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
|
|
2218
|
+
return {
|
|
2219
|
+
translateX: e,
|
|
2220
|
+
translateY: f,
|
|
2221
|
+
rotate: Math.atan2(b, a) * degrees,
|
|
2222
|
+
skewX: Math.atan(skewX) * degrees,
|
|
2223
|
+
scaleX: scaleX,
|
|
2224
|
+
scaleY: scaleY
|
|
2225
|
+
};
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
var svgNode;
|
|
2229
|
+
|
|
2230
|
+
/* eslint-disable no-undef */
|
|
2231
|
+
function parseCss(value) {
|
|
2232
|
+
const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
|
2233
|
+
return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
function parseSvg(value) {
|
|
2237
|
+
if (value == null) return identity;
|
|
2238
|
+
if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
2239
|
+
svgNode.setAttribute("transform", value);
|
|
2240
|
+
if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
|
|
2241
|
+
value = value.matrix;
|
|
2242
|
+
return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
|
2246
|
+
|
|
2247
|
+
function pop(s) {
|
|
2248
|
+
return s.length ? s.pop() + " " : "";
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
function translate(xa, ya, xb, yb, s, q) {
|
|
2252
|
+
if (xa !== xb || ya !== yb) {
|
|
2253
|
+
var i = s.push("translate(", null, pxComma, null, pxParen);
|
|
2254
|
+
q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
|
|
2255
|
+
} else if (xb || yb) {
|
|
2256
|
+
s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
function rotate(a, b, s, q) {
|
|
2261
|
+
if (a !== b) {
|
|
2262
|
+
if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
|
|
2263
|
+
q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)});
|
|
2264
|
+
} else if (b) {
|
|
2265
|
+
s.push(pop(s) + "rotate(" + b + degParen);
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
function skewX(a, b, s, q) {
|
|
2270
|
+
if (a !== b) {
|
|
2271
|
+
q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)});
|
|
2272
|
+
} else if (b) {
|
|
2273
|
+
s.push(pop(s) + "skewX(" + b + degParen);
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
function scale(xa, ya, xb, yb, s, q) {
|
|
2278
|
+
if (xa !== xb || ya !== yb) {
|
|
2279
|
+
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
2280
|
+
q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
|
|
2281
|
+
} else if (xb !== 1 || yb !== 1) {
|
|
2282
|
+
s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
return function(a, b) {
|
|
2287
|
+
var s = [], // string constants and placeholders
|
|
2288
|
+
q = []; // number interpolators
|
|
2289
|
+
a = parse(a), b = parse(b);
|
|
2290
|
+
translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
|
|
2291
|
+
rotate(a.rotate, b.rotate, s, q);
|
|
2292
|
+
skewX(a.skewX, b.skewX, s, q);
|
|
2293
|
+
scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
|
|
2294
|
+
a = b = null; // gc
|
|
2295
|
+
return function(t) {
|
|
2296
|
+
var i = -1, n = q.length, o;
|
|
2297
|
+
while (++i < n) s[(o = q[i]).i] = o.x(t);
|
|
2298
|
+
return s.join("");
|
|
2299
|
+
};
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
|
2304
|
+
var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
|
2305
|
+
|
|
2306
|
+
var epsilon2 = 1e-12;
|
|
2307
|
+
|
|
2308
|
+
function cosh(x) {
|
|
2309
|
+
return ((x = Math.exp(x)) + 1 / x) / 2;
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
function sinh(x) {
|
|
2313
|
+
return ((x = Math.exp(x)) - 1 / x) / 2;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
function tanh(x) {
|
|
2317
|
+
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
var zoom = (function zoomRho(rho, rho2, rho4) {
|
|
2321
|
+
|
|
2322
|
+
// p0 = [ux0, uy0, w0]
|
|
2323
|
+
// p1 = [ux1, uy1, w1]
|
|
2324
|
+
function zoom(p0, p1) {
|
|
2325
|
+
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
|
|
2326
|
+
ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
|
|
2327
|
+
dx = ux1 - ux0,
|
|
2328
|
+
dy = uy1 - uy0,
|
|
2329
|
+
d2 = dx * dx + dy * dy,
|
|
2330
|
+
i,
|
|
2331
|
+
S;
|
|
2332
|
+
|
|
2333
|
+
// Special case for u0 ≅ u1.
|
|
2334
|
+
if (d2 < epsilon2) {
|
|
2335
|
+
S = Math.log(w1 / w0) / rho;
|
|
2336
|
+
i = function(t) {
|
|
2337
|
+
return [
|
|
2338
|
+
ux0 + t * dx,
|
|
2339
|
+
uy0 + t * dy,
|
|
2340
|
+
w0 * Math.exp(rho * t * S)
|
|
2341
|
+
];
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
// General case.
|
|
2346
|
+
else {
|
|
2347
|
+
var d1 = Math.sqrt(d2),
|
|
2348
|
+
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
|
2349
|
+
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
|
2350
|
+
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
|
2351
|
+
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
2352
|
+
S = (r1 - r0) / rho;
|
|
2353
|
+
i = function(t) {
|
|
2354
|
+
var s = t * S,
|
|
2355
|
+
coshr0 = cosh(r0),
|
|
2356
|
+
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
2357
|
+
return [
|
|
2358
|
+
ux0 + u * dx,
|
|
2359
|
+
uy0 + u * dy,
|
|
2360
|
+
w0 * coshr0 / cosh(rho * s + r0)
|
|
2361
|
+
];
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
i.duration = S * 1000 * rho / Math.SQRT2;
|
|
2366
|
+
|
|
2367
|
+
return i;
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
zoom.rho = function(_) {
|
|
2371
|
+
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
|
|
2372
|
+
return zoomRho(_1, _2, _4);
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2375
|
+
return zoom;
|
|
2376
|
+
})(Math.SQRT2, 2, 4);
|
|
2377
|
+
|
|
2378
|
+
function hsl(hue) {
|
|
2379
|
+
return function(start, end) {
|
|
2380
|
+
var h = hue((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h),
|
|
2381
|
+
s = nogamma(start.s, end.s),
|
|
2382
|
+
l = nogamma(start.l, end.l),
|
|
2383
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
2384
|
+
return function(t) {
|
|
2385
|
+
start.h = h(t);
|
|
2386
|
+
start.s = s(t);
|
|
2387
|
+
start.l = l(t);
|
|
2388
|
+
start.opacity = opacity(t);
|
|
2389
|
+
return start + "";
|
|
2390
|
+
};
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
var hsl$1 = hsl(hue);
|
|
2395
|
+
var hslLong = hsl(nogamma);
|
|
2396
|
+
|
|
2397
|
+
function lab(start, end) {
|
|
2398
|
+
var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l),
|
|
2399
|
+
a = nogamma(start.a, end.a),
|
|
2400
|
+
b = nogamma(start.b, end.b),
|
|
2401
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
2402
|
+
return function(t) {
|
|
2403
|
+
start.l = l(t);
|
|
2404
|
+
start.a = a(t);
|
|
2405
|
+
start.b = b(t);
|
|
2406
|
+
start.opacity = opacity(t);
|
|
2407
|
+
return start + "";
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
function hcl(hue) {
|
|
2412
|
+
return function(start, end) {
|
|
2413
|
+
var h = hue((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h),
|
|
2414
|
+
c = nogamma(start.c, end.c),
|
|
2415
|
+
l = nogamma(start.l, end.l),
|
|
2416
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
2417
|
+
return function(t) {
|
|
2418
|
+
start.h = h(t);
|
|
2419
|
+
start.c = c(t);
|
|
2420
|
+
start.l = l(t);
|
|
2421
|
+
start.opacity = opacity(t);
|
|
2422
|
+
return start + "";
|
|
2423
|
+
};
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
var hcl$1 = hcl(hue);
|
|
2428
|
+
var hclLong = hcl(nogamma);
|
|
2429
|
+
|
|
2430
|
+
function cubehelix(hue) {
|
|
2431
|
+
return (function cubehelixGamma(y) {
|
|
2432
|
+
y = +y;
|
|
2433
|
+
|
|
2434
|
+
function cubehelix(start, end) {
|
|
2435
|
+
var h = hue((start = d3Color.cubehelix(start)).h, (end = d3Color.cubehelix(end)).h),
|
|
2436
|
+
s = nogamma(start.s, end.s),
|
|
2437
|
+
l = nogamma(start.l, end.l),
|
|
2438
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
2439
|
+
return function(t) {
|
|
2440
|
+
start.h = h(t);
|
|
2441
|
+
start.s = s(t);
|
|
2442
|
+
start.l = l(Math.pow(t, y));
|
|
2443
|
+
start.opacity = opacity(t);
|
|
2444
|
+
return start + "";
|
|
2445
|
+
};
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
cubehelix.gamma = cubehelixGamma;
|
|
2449
|
+
|
|
2450
|
+
return cubehelix;
|
|
2451
|
+
})(1);
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
var cubehelix$1 = cubehelix(hue);
|
|
2455
|
+
var cubehelixLong = cubehelix(nogamma);
|
|
2456
|
+
|
|
2457
|
+
function piecewise(interpolate, values) {
|
|
2458
|
+
if (values === undefined) values = interpolate, interpolate = value;
|
|
2459
|
+
var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
|
|
2460
|
+
while (i < n) I[i] = interpolate(v, v = values[++i]);
|
|
2461
|
+
return function(t) {
|
|
2462
|
+
var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
|
|
2463
|
+
return I[i](t - i);
|
|
2464
|
+
};
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
function quantize(interpolator, n) {
|
|
2468
|
+
var samples = new Array(n);
|
|
2469
|
+
for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
|
|
2470
|
+
return samples;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
exports.interpolate = value;
|
|
2474
|
+
exports.interpolateArray = array;
|
|
2475
|
+
exports.interpolateBasis = basis$1;
|
|
2476
|
+
exports.interpolateBasisClosed = basisClosed;
|
|
2477
|
+
exports.interpolateCubehelix = cubehelix$1;
|
|
2478
|
+
exports.interpolateCubehelixLong = cubehelixLong;
|
|
2479
|
+
exports.interpolateDate = date;
|
|
2480
|
+
exports.interpolateDiscrete = discrete;
|
|
2481
|
+
exports.interpolateHcl = hcl$1;
|
|
2482
|
+
exports.interpolateHclLong = hclLong;
|
|
2483
|
+
exports.interpolateHsl = hsl$1;
|
|
2484
|
+
exports.interpolateHslLong = hslLong;
|
|
2485
|
+
exports.interpolateHue = hue$1;
|
|
2486
|
+
exports.interpolateLab = lab;
|
|
2487
|
+
exports.interpolateNumber = number;
|
|
2488
|
+
exports.interpolateNumberArray = numberArray;
|
|
2489
|
+
exports.interpolateObject = object;
|
|
2490
|
+
exports.interpolateRgb = rgb;
|
|
2491
|
+
exports.interpolateRgbBasis = rgbBasis;
|
|
2492
|
+
exports.interpolateRgbBasisClosed = rgbBasisClosed;
|
|
2493
|
+
exports.interpolateRound = round;
|
|
2494
|
+
exports.interpolateString = string;
|
|
2495
|
+
exports.interpolateTransformCss = interpolateTransformCss;
|
|
2496
|
+
exports.interpolateTransformSvg = interpolateTransformSvg;
|
|
2497
|
+
exports.interpolateZoom = zoom;
|
|
2498
|
+
exports.piecewise = piecewise;
|
|
2499
|
+
exports.quantize = quantize;
|
|
2500
|
+
|
|
2501
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2502
|
+
|
|
2503
|
+
}));
|
|
2504
|
+
});
|
|
2505
|
+
|
|
1859
2506
|
function constants(x) {
|
|
1860
2507
|
return function() {
|
|
1861
2508
|
return x;
|
|
1862
2509
|
};
|
|
1863
2510
|
}
|
|
1864
2511
|
|
|
1865
|
-
function number
|
|
2512
|
+
function number(x) {
|
|
1866
2513
|
return +x;
|
|
1867
2514
|
}
|
|
1868
2515
|
|
|
1869
2516
|
var unit = [0, 1];
|
|
1870
2517
|
|
|
1871
|
-
function identity
|
|
2518
|
+
function identity(x) {
|
|
1872
2519
|
return x;
|
|
1873
2520
|
}
|
|
1874
2521
|
|
|
@@ -1916,7 +2563,7 @@ var drawChart = (function () {
|
|
|
1916
2563
|
};
|
|
1917
2564
|
}
|
|
1918
2565
|
|
|
1919
|
-
function copy(source, target) {
|
|
2566
|
+
function copy$1(source, target) {
|
|
1920
2567
|
return target
|
|
1921
2568
|
.domain(source.domain())
|
|
1922
2569
|
.range(source.range())
|
|
@@ -1925,36 +2572,36 @@ var drawChart = (function () {
|
|
|
1925
2572
|
.unknown(source.unknown());
|
|
1926
2573
|
}
|
|
1927
2574
|
|
|
1928
|
-
function transformer() {
|
|
2575
|
+
function transformer$1() {
|
|
1929
2576
|
var domain = unit,
|
|
1930
2577
|
range = unit,
|
|
1931
|
-
interpolate
|
|
2578
|
+
interpolate = d3Interpolate.interpolate,
|
|
1932
2579
|
transform,
|
|
1933
2580
|
untransform,
|
|
1934
2581
|
unknown,
|
|
1935
|
-
clamp = identity
|
|
2582
|
+
clamp = identity,
|
|
1936
2583
|
piecewise,
|
|
1937
2584
|
output,
|
|
1938
2585
|
input;
|
|
1939
2586
|
|
|
1940
2587
|
function rescale() {
|
|
1941
2588
|
var n = Math.min(domain.length, range.length);
|
|
1942
|
-
if (clamp !== identity
|
|
2589
|
+
if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
|
|
1943
2590
|
piecewise = n > 2 ? polymap : bimap;
|
|
1944
2591
|
output = input = null;
|
|
1945
2592
|
return scale;
|
|
1946
2593
|
}
|
|
1947
2594
|
|
|
1948
2595
|
function scale(x) {
|
|
1949
|
-
return isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate
|
|
2596
|
+
return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));
|
|
1950
2597
|
}
|
|
1951
2598
|
|
|
1952
2599
|
scale.invert = function(y) {
|
|
1953
|
-
return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
|
|
2600
|
+
return clamp(untransform((input || (input = piecewise(range, domain.map(transform), d3Interpolate.interpolateNumber)))(y)));
|
|
1954
2601
|
};
|
|
1955
2602
|
|
|
1956
2603
|
scale.domain = function(_) {
|
|
1957
|
-
return arguments.length ? (domain = Array.from(_, number
|
|
2604
|
+
return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
|
|
1958
2605
|
};
|
|
1959
2606
|
|
|
1960
2607
|
scale.range = function(_) {
|
|
@@ -1962,15 +2609,15 @@ var drawChart = (function () {
|
|
|
1962
2609
|
};
|
|
1963
2610
|
|
|
1964
2611
|
scale.rangeRound = function(_) {
|
|
1965
|
-
return range = Array.from(_), interpolate
|
|
2612
|
+
return range = Array.from(_), interpolate = d3Interpolate.interpolateRound, rescale();
|
|
1966
2613
|
};
|
|
1967
2614
|
|
|
1968
2615
|
scale.clamp = function(_) {
|
|
1969
|
-
return arguments.length ? (clamp = _ ? true : identity
|
|
2616
|
+
return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
|
|
1970
2617
|
};
|
|
1971
2618
|
|
|
1972
2619
|
scale.interpolate = function(_) {
|
|
1973
|
-
return arguments.length ? (interpolate
|
|
2620
|
+
return arguments.length ? (interpolate = _, rescale()) : interpolate;
|
|
1974
2621
|
};
|
|
1975
2622
|
|
|
1976
2623
|
scale.unknown = function(_) {
|
|
@@ -1984,9 +2631,14 @@ var drawChart = (function () {
|
|
|
1984
2631
|
}
|
|
1985
2632
|
|
|
1986
2633
|
function continuous() {
|
|
1987
|
-
return transformer()(identity
|
|
2634
|
+
return transformer$1()(identity, identity);
|
|
1988
2635
|
}
|
|
1989
2636
|
|
|
2637
|
+
var d3Format = createCommonjsModule(function (module, exports) {
|
|
2638
|
+
// https://d3js.org/d3-format/ v2.0.0 Copyright 2020 Mike Bostock
|
|
2639
|
+
(function (global, factory) {
|
|
2640
|
+
factory(exports) ;
|
|
2641
|
+
}(this, (function (exports) {
|
|
1990
2642
|
function formatDecimal(x) {
|
|
1991
2643
|
return Math.abs(x = Math.round(x)) >= 1e21
|
|
1992
2644
|
? x.toLocaleString("en").replace(/,/g, "")
|
|
@@ -2140,19 +2792,19 @@ var drawChart = (function () {
|
|
|
2140
2792
|
"x": (x) => Math.round(x).toString(16)
|
|
2141
2793
|
};
|
|
2142
2794
|
|
|
2143
|
-
function identity
|
|
2795
|
+
function identity(x) {
|
|
2144
2796
|
return x;
|
|
2145
2797
|
}
|
|
2146
2798
|
|
|
2147
|
-
var map
|
|
2799
|
+
var map = Array.prototype.map,
|
|
2148
2800
|
prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
|
|
2149
2801
|
|
|
2150
2802
|
function formatLocale(locale) {
|
|
2151
|
-
var group = locale.grouping === undefined || locale.thousands === undefined ? identity
|
|
2803
|
+
var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
|
|
2152
2804
|
currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
|
|
2153
2805
|
currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
|
|
2154
2806
|
decimal = locale.decimal === undefined ? "." : locale.decimal + "",
|
|
2155
|
-
numerals = locale.numerals === undefined ? identity
|
|
2807
|
+
numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),
|
|
2156
2808
|
percent = locale.percent === undefined ? "%" : locale.percent + "",
|
|
2157
2809
|
minus = locale.minus === undefined ? "−" : locale.minus + "",
|
|
2158
2810
|
nan = locale.nan === undefined ? "NaN" : locale.nan + "";
|
|
@@ -2285,8 +2937,6 @@ var drawChart = (function () {
|
|
|
2285
2937
|
}
|
|
2286
2938
|
|
|
2287
2939
|
var locale;
|
|
2288
|
-
var format$1;
|
|
2289
|
-
var formatPrefix;
|
|
2290
2940
|
|
|
2291
2941
|
defaultLocale({
|
|
2292
2942
|
thousands: ",",
|
|
@@ -2296,8 +2946,8 @@ var drawChart = (function () {
|
|
|
2296
2946
|
|
|
2297
2947
|
function defaultLocale(definition) {
|
|
2298
2948
|
locale = formatLocale(definition);
|
|
2299
|
-
format
|
|
2300
|
-
formatPrefix = locale.formatPrefix;
|
|
2949
|
+
exports.format = locale.format;
|
|
2950
|
+
exports.formatPrefix = locale.formatPrefix;
|
|
2301
2951
|
return locale;
|
|
2302
2952
|
}
|
|
2303
2953
|
|
|
@@ -2314,31 +2964,44 @@ var drawChart = (function () {
|
|
|
2314
2964
|
return Math.max(0, exponent(max) - exponent(step)) + 1;
|
|
2315
2965
|
}
|
|
2316
2966
|
|
|
2967
|
+
exports.FormatSpecifier = FormatSpecifier;
|
|
2968
|
+
exports.formatDefaultLocale = defaultLocale;
|
|
2969
|
+
exports.formatLocale = formatLocale;
|
|
2970
|
+
exports.formatSpecifier = formatSpecifier;
|
|
2971
|
+
exports.precisionFixed = precisionFixed;
|
|
2972
|
+
exports.precisionPrefix = precisionPrefix;
|
|
2973
|
+
exports.precisionRound = precisionRound;
|
|
2974
|
+
|
|
2975
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2976
|
+
|
|
2977
|
+
})));
|
|
2978
|
+
});
|
|
2979
|
+
|
|
2317
2980
|
function tickFormat(start, stop, count, specifier) {
|
|
2318
2981
|
var step = tickStep(start, stop, count),
|
|
2319
2982
|
precision;
|
|
2320
|
-
specifier = formatSpecifier(specifier == null ? ",f" : specifier);
|
|
2983
|
+
specifier = d3Format.formatSpecifier(specifier == null ? ",f" : specifier);
|
|
2321
2984
|
switch (specifier.type) {
|
|
2322
2985
|
case "s": {
|
|
2323
2986
|
var value = Math.max(Math.abs(start), Math.abs(stop));
|
|
2324
|
-
if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
|
|
2325
|
-
return formatPrefix(specifier, value);
|
|
2987
|
+
if (specifier.precision == null && !isNaN(precision = d3Format.precisionPrefix(step, value))) specifier.precision = precision;
|
|
2988
|
+
return d3Format.formatPrefix(specifier, value);
|
|
2326
2989
|
}
|
|
2327
2990
|
case "":
|
|
2328
2991
|
case "e":
|
|
2329
2992
|
case "g":
|
|
2330
2993
|
case "p":
|
|
2331
2994
|
case "r": {
|
|
2332
|
-
if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
|
|
2995
|
+
if (specifier.precision == null && !isNaN(precision = d3Format.precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
|
|
2333
2996
|
break;
|
|
2334
2997
|
}
|
|
2335
2998
|
case "f":
|
|
2336
2999
|
case "%": {
|
|
2337
|
-
if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
|
|
3000
|
+
if (specifier.precision == null && !isNaN(precision = d3Format.precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
|
|
2338
3001
|
break;
|
|
2339
3002
|
}
|
|
2340
3003
|
}
|
|
2341
|
-
return format
|
|
3004
|
+
return d3Format.format(specifier);
|
|
2342
3005
|
}
|
|
2343
3006
|
|
|
2344
3007
|
function linearish(scale) {
|
|
@@ -2395,11 +3058,11 @@ var drawChart = (function () {
|
|
|
2395
3058
|
return scale;
|
|
2396
3059
|
}
|
|
2397
3060
|
|
|
2398
|
-
function linear
|
|
3061
|
+
function linear() {
|
|
2399
3062
|
var scale = continuous();
|
|
2400
3063
|
|
|
2401
3064
|
scale.copy = function() {
|
|
2402
|
-
return copy(scale, linear
|
|
3065
|
+
return copy$1(scale, linear());
|
|
2403
3066
|
};
|
|
2404
3067
|
|
|
2405
3068
|
initRange.apply(scale, arguments);
|
|
@@ -2407,19 +3070,19 @@ var drawChart = (function () {
|
|
|
2407
3070
|
return linearish(scale);
|
|
2408
3071
|
}
|
|
2409
3072
|
|
|
2410
|
-
function transformer
|
|
3073
|
+
function transformer() {
|
|
2411
3074
|
var x0 = 0,
|
|
2412
3075
|
x1 = 1,
|
|
2413
3076
|
t0,
|
|
2414
3077
|
t1,
|
|
2415
3078
|
k10,
|
|
2416
3079
|
transform,
|
|
2417
|
-
interpolator = identity
|
|
3080
|
+
interpolator = identity,
|
|
2418
3081
|
clamp = false,
|
|
2419
3082
|
unknown;
|
|
2420
3083
|
|
|
2421
3084
|
function scale(x) {
|
|
2422
|
-
return isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
|
|
3085
|
+
return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
|
|
2423
3086
|
}
|
|
2424
3087
|
|
|
2425
3088
|
scale.domain = function(_) {
|
|
@@ -2441,9 +3104,9 @@ var drawChart = (function () {
|
|
|
2441
3104
|
};
|
|
2442
3105
|
}
|
|
2443
3106
|
|
|
2444
|
-
scale.range = range(interpolate);
|
|
3107
|
+
scale.range = range(d3Interpolate.interpolate);
|
|
2445
3108
|
|
|
2446
|
-
scale.rangeRound = range(interpolateRound);
|
|
3109
|
+
scale.rangeRound = range(d3Interpolate.interpolateRound);
|
|
2447
3110
|
|
|
2448
3111
|
scale.unknown = function(_) {
|
|
2449
3112
|
return arguments.length ? (unknown = _, scale) : unknown;
|
|
@@ -2455,7 +3118,7 @@ var drawChart = (function () {
|
|
|
2455
3118
|
};
|
|
2456
3119
|
}
|
|
2457
3120
|
|
|
2458
|
-
function copy
|
|
3121
|
+
function copy(source, target) {
|
|
2459
3122
|
return target
|
|
2460
3123
|
.domain(source.domain())
|
|
2461
3124
|
.interpolator(source.interpolator())
|
|
@@ -2464,10 +3127,10 @@ var drawChart = (function () {
|
|
|
2464
3127
|
}
|
|
2465
3128
|
|
|
2466
3129
|
function sequential() {
|
|
2467
|
-
var scale = linearish(transformer
|
|
3130
|
+
var scale = linearish(transformer()(identity));
|
|
2468
3131
|
|
|
2469
3132
|
scale.copy = function() {
|
|
2470
|
-
return copy
|
|
3133
|
+
return copy(scale, sequential());
|
|
2471
3134
|
};
|
|
2472
3135
|
|
|
2473
3136
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -2481,181 +3144,129 @@ var drawChart = (function () {
|
|
|
2481
3144
|
const bc = 0.0722;
|
|
2482
3145
|
// low-gamma adjust coefficient
|
|
2483
3146
|
const lowc = 1 / 12.92;
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
return Math.pow((_ + 0.055) / 1.055, 2.4);
|
|
3147
|
+
function adjustGamma(p) {
|
|
3148
|
+
return Math.pow((p + 0.055) / 1.055, 2.4);
|
|
2487
3149
|
}
|
|
2488
|
-
|
|
2489
3150
|
function relativeLuminance(o) {
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
return r * rc + g * gc + b * bc;
|
|
3151
|
+
const rsrgb = o.r / 255;
|
|
3152
|
+
const gsrgb = o.g / 255;
|
|
3153
|
+
const bsrgb = o.b / 255;
|
|
3154
|
+
const r = rsrgb <= 0.03928 ? rsrgb * lowc : adjustGamma(rsrgb);
|
|
3155
|
+
const g = gsrgb <= 0.03928 ? gsrgb * lowc : adjustGamma(gsrgb);
|
|
3156
|
+
const b = bsrgb <= 0.03928 ? bsrgb * lowc : adjustGamma(bsrgb);
|
|
3157
|
+
return r * rc + g * gc + b * bc;
|
|
2499
3158
|
}
|
|
2500
|
-
|
|
2501
3159
|
const createRainbowColor = (root) => {
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
root.children.forEach((c, id) => {
|
|
2510
|
-
colorParentMap.set(c, colorScale(id));
|
|
2511
|
-
});
|
|
2512
|
-
}
|
|
2513
|
-
|
|
2514
|
-
const colorMap = new Map();
|
|
2515
|
-
|
|
2516
|
-
const lightScale = linear$1().domain([0, root.height]).range([0.9, 0.3]);
|
|
2517
|
-
|
|
2518
|
-
const getBackgroundColor = (node) => {
|
|
2519
|
-
const parents = node.ancestors();
|
|
2520
|
-
const colorStr =
|
|
2521
|
-
parents.length === 1
|
|
2522
|
-
? colorParentMap.get(parents[0])
|
|
2523
|
-
: colorParentMap.get(parents[parents.length - 2]);
|
|
2524
|
-
|
|
2525
|
-
const hslColor = hsl(colorStr);
|
|
2526
|
-
hslColor.l = lightScale(node.depth);
|
|
2527
|
-
|
|
2528
|
-
return hslColor;
|
|
2529
|
-
};
|
|
2530
|
-
|
|
2531
|
-
return (node) => {
|
|
2532
|
-
if (!colorMap.has(node)) {
|
|
2533
|
-
const backgroundColor = getBackgroundColor(node);
|
|
2534
|
-
const l = relativeLuminance(backgroundColor.rgb());
|
|
2535
|
-
const fontColor = l > 0.179 ? "#000" : "#fff";
|
|
2536
|
-
colorMap.set(node, { backgroundColor, fontColor });
|
|
3160
|
+
const colorParentMap = new Map();
|
|
3161
|
+
colorParentMap.set(root, COLOR_BASE);
|
|
3162
|
+
if (root.children != null) {
|
|
3163
|
+
const colorScale = sequential([0, root.children.length], (n) => hsl(360 * n, 0.6, 0.85));
|
|
3164
|
+
root.children.forEach((c, id) => {
|
|
3165
|
+
colorParentMap.set(c, colorScale(id).toString());
|
|
3166
|
+
});
|
|
2537
3167
|
}
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
3168
|
+
const colorMap = new Map();
|
|
3169
|
+
const lightScale = linear().domain([0, root.height]).range([0.9, 0.3]);
|
|
3170
|
+
const getBackgroundColor = (node) => {
|
|
3171
|
+
const parents = node.ancestors();
|
|
3172
|
+
const colorStr = parents.length === 1 ? colorParentMap.get(parents[0]) : colorParentMap.get(parents[parents.length - 2]);
|
|
3173
|
+
const hslColor = hsl(colorStr);
|
|
3174
|
+
hslColor.l = lightScale(node.depth);
|
|
3175
|
+
return hslColor;
|
|
3176
|
+
};
|
|
3177
|
+
return (node) => {
|
|
3178
|
+
if (!colorMap.has(node)) {
|
|
3179
|
+
const backgroundColor = getBackgroundColor(node);
|
|
3180
|
+
const l = relativeLuminance(backgroundColor.rgb());
|
|
3181
|
+
const fontColor = l > 0.179 ? "#000" : "#fff";
|
|
3182
|
+
colorMap.set(node, {
|
|
3183
|
+
backgroundColor: backgroundColor.toString(),
|
|
3184
|
+
fontColor,
|
|
3185
|
+
});
|
|
3186
|
+
}
|
|
3187
|
+
return colorMap.get(node);
|
|
3188
|
+
};
|
|
2541
3189
|
};
|
|
2542
3190
|
|
|
2543
|
-
const
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
.
|
|
2555
|
-
.
|
|
2556
|
-
.
|
|
2557
|
-
.
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
.
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
}
|
|
2575
|
-
} else if (node.data.children != null) {
|
|
2576
|
-
const children = node.children;
|
|
2577
|
-
let i = node.data.children.length;
|
|
2578
|
-
while (--i >= 0) {
|
|
2579
|
-
for (const prop of availableSizeProperties) {
|
|
2580
|
-
value[prop] += children[i].originalValue[prop] || 0;
|
|
2581
|
-
}
|
|
3191
|
+
const StaticContext = q({});
|
|
3192
|
+
const drawChart = (parentNode, data, width, height) => {
|
|
3193
|
+
const availableSizeProperties = getAvailableSizeOptions(data.options);
|
|
3194
|
+
console.time("layout create");
|
|
3195
|
+
const layout = treemap()
|
|
3196
|
+
.size([width, height])
|
|
3197
|
+
.paddingOuter(PADDING)
|
|
3198
|
+
.paddingTop(TOP_PADDING)
|
|
3199
|
+
.paddingInner(PADDING)
|
|
3200
|
+
.round(true)
|
|
3201
|
+
.tile(treemapResquarify);
|
|
3202
|
+
console.timeEnd("layout create");
|
|
3203
|
+
console.time("rawHierarchy create");
|
|
3204
|
+
const rawHierarchy = hierarchy(data.tree);
|
|
3205
|
+
console.timeEnd("rawHierarchy create");
|
|
3206
|
+
const nodeSizesCache = new Map();
|
|
3207
|
+
const nodeIdsCache = new Map();
|
|
3208
|
+
const getModuleSize = (node, sizeKey) => { var _a, _b; return (_b = (_a = nodeSizesCache.get(node)) === null || _a === void 0 ? void 0 : _a[sizeKey]) !== null && _b !== void 0 ? _b : 0; };
|
|
3209
|
+
console.time("rawHierarchy eachAfter cache");
|
|
3210
|
+
rawHierarchy.eachAfter((node) => {
|
|
3211
|
+
var _a;
|
|
3212
|
+
const nodeData = node.data;
|
|
3213
|
+
nodeIdsCache.set(nodeData, {
|
|
3214
|
+
nodeUid: generateUniqueId("node"),
|
|
3215
|
+
clipUid: generateUniqueId("clip"),
|
|
3216
|
+
});
|
|
3217
|
+
const sizes = { renderedLength: 0, gzipLength: 0, brotliLength: 0 };
|
|
3218
|
+
if (isModuleTree(nodeData)) {
|
|
3219
|
+
for (const sizeKey of availableSizeProperties) {
|
|
3220
|
+
sizes[sizeKey] = nodeData.children.reduce((acc, child) => getModuleSize(child, sizeKey) + acc, 0);
|
|
3221
|
+
}
|
|
2582
3222
|
}
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
3223
|
+
else {
|
|
3224
|
+
for (const sizeKey of availableSizeProperties) {
|
|
3225
|
+
sizes[sizeKey] = (_a = data.nodeParts[nodeData.uid][sizeKey]) !== null && _a !== void 0 ? _a : 0;
|
|
3226
|
+
}
|
|
2586
3227
|
}
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
if (!importedByCache.has(target)) {
|
|
2606
|
-
importedByCache.set(target, []);
|
|
2607
|
-
}
|
|
2608
|
-
if (!importedCache.has(source)) {
|
|
2609
|
-
importedCache.set(source, []);
|
|
2610
|
-
}
|
|
2611
|
-
|
|
2612
|
-
importedByCache.get(target).push({ uid: source, ...nodes[source] });
|
|
2613
|
-
importedCache.get(source).push({ uid: target, ...nodes[target] });
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
return m$1`
|
|
2617
|
-
<${SideBar}
|
|
2618
|
-
sizeProperty=${sizeProperty}
|
|
2619
|
-
availableSizeProperties=${availableSizeProperties}
|
|
2620
|
-
setSizeProperty=${setSizeProperty}
|
|
2621
|
-
/>
|
|
2622
|
-
<${Chart}
|
|
2623
|
-
layout=${layout}
|
|
2624
|
-
root=${root}
|
|
2625
|
-
color=${color}
|
|
2626
|
-
width=${width}
|
|
2627
|
-
height=${height}
|
|
2628
|
-
sizeProperty=${sizeProperty}
|
|
2629
|
-
availableSizeProperties=${availableSizeProperties}
|
|
2630
|
-
importedByCache=${importedByCache}
|
|
2631
|
-
importedCache=${importedCache}
|
|
2632
|
-
/>
|
|
2633
|
-
`;
|
|
3228
|
+
nodeSizesCache.set(nodeData, sizes);
|
|
3229
|
+
});
|
|
3230
|
+
console.timeEnd("rawHierarchy eachAfter cache");
|
|
3231
|
+
const getModuleIds = (node) => nodeIdsCache.get(node);
|
|
3232
|
+
console.time("color");
|
|
3233
|
+
const getModuleColor = createRainbowColor(rawHierarchy);
|
|
3234
|
+
console.timeEnd("color");
|
|
3235
|
+
N(o$1(StaticContext.Provider, Object.assign({ value: {
|
|
3236
|
+
data,
|
|
3237
|
+
availableSizeProperties,
|
|
3238
|
+
width,
|
|
3239
|
+
height,
|
|
3240
|
+
getModuleSize,
|
|
3241
|
+
getModuleIds,
|
|
3242
|
+
getModuleColor,
|
|
3243
|
+
rawHierarchy,
|
|
3244
|
+
layout,
|
|
3245
|
+
} }, { children: o$1(Main, {}, void 0) }), void 0), parentNode);
|
|
2634
3246
|
};
|
|
2635
3247
|
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
);
|
|
2641
|
-
};
|
|
3248
|
+
exports.StaticContext = StaticContext;
|
|
3249
|
+
exports.default = drawChart;
|
|
3250
|
+
|
|
3251
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2642
3252
|
|
|
2643
|
-
return
|
|
3253
|
+
return exports;
|
|
2644
3254
|
|
|
2645
|
-
}());
|
|
3255
|
+
}({}));
|
|
3256
|
+
//# sourceMappingURL=treemap.js.map
|
|
2646
3257
|
|
|
2647
3258
|
/*-->*/
|
|
2648
3259
|
</script>
|
|
2649
3260
|
<script>
|
|
2650
3261
|
/*<!--*/
|
|
2651
|
-
const data = {"version":
|
|
3262
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"content.esm.js","children":[{"name":"E:/glib","children":[{"name":"node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs","uid":"8d85-145"},{"name":"packages/content/dist/content/src","children":[{"uid":"8d85-147","name":"AssetType.js"},{"uid":"8d85-149","name":"AssetContainer.js"},{"uid":"8d85-151","name":"AssetLoaderRegistry.js"},{"uid":"8d85-153","name":"AsyncExecutor.js"},{"uid":"8d85-155","name":"HttpClient.js"},{"uid":"8d85-157","name":"ContentLoader.js"},{"uid":"8d85-159","name":"ContentType.js"},{"uid":"8d85-161","name":"MaterialRegistry.js"},{"uid":"8d85-163","name":"TextureLoader.js"},{"uid":"8d85-165","name":"ResourceGraph.js"},{"uid":"8d85-167","name":"index.js"}]}]}]}],"isRoot":true},"nodeParts":{"8d85-145":{"renderedLength":2094,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-144"},"8d85-147":{"renderedLength":92,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-146"},"8d85-149":{"renderedLength":957,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-148"},"8d85-151":{"renderedLength":640,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-150"},"8d85-153":{"renderedLength":5496,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-152"},"8d85-155":{"renderedLength":4813,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-154"},"8d85-157":{"renderedLength":12646,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-156"},"8d85-159":{"renderedLength":486,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-158"},"8d85-161":{"renderedLength":498,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-160"},"8d85-163":{"renderedLength":2782,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-162"},"8d85-165":{"renderedLength":6580,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-164"},"8d85-167":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"8d85-166"}},"nodeMetas":{"8d85-144":{"id":"E:\\glib\\node_modules\\.pnpm\\tslib@2.8.1\\node_modules\\tslib\\tslib.es6.mjs","moduleParts":{"content.esm.js":"8d85-145"},"imported":[],"importedBy":[{"uid":"8d85-148"},{"uid":"8d85-152"},{"uid":"8d85-156"},{"uid":"8d85-162"},{"uid":"8d85-164"},{"uid":"8d85-154"}]},"8d85-146":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\AssetType.js","moduleParts":{"content.esm.js":"8d85-147"},"imported":[],"importedBy":[{"uid":"8d85-166"},{"uid":"8d85-148"},{"uid":"8d85-156"}]},"8d85-148":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\AssetContainer.js","moduleParts":{"content.esm.js":"8d85-149"},"imported":[{"uid":"8d85-144"},{"uid":"8d85-146"}],"importedBy":[{"uid":"8d85-166"},{"uid":"8d85-162"}]},"8d85-150":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\AssetLoaderRegistry.js","moduleParts":{"content.esm.js":"8d85-151"},"imported":[],"importedBy":[{"uid":"8d85-166"},{"uid":"8d85-156"}]},"8d85-152":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\AsyncExecutor.js","moduleParts":{"content.esm.js":"8d85-153"},"imported":[{"uid":"8d85-144"}],"importedBy":[{"uid":"8d85-166"},{"uid":"8d85-156"}]},"8d85-154":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\HttpClient.js","moduleParts":{"content.esm.js":"8d85-155"},"imported":[{"uid":"8d85-144"}],"importedBy":[{"uid":"8d85-156"}]},"8d85-156":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\ContentLoader.js","moduleParts":{"content.esm.js":"8d85-157"},"imported":[{"uid":"8d85-144"},{"uid":"8d85-168"},{"uid":"8d85-169"},{"uid":"8d85-170"},{"uid":"8d85-150"},{"uid":"8d85-146"},{"uid":"8d85-152"},{"uid":"8d85-154"}],"importedBy":[{"uid":"8d85-166"},{"uid":"8d85-162"}]},"8d85-158":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\ContentType.js","moduleParts":{"content.esm.js":"8d85-159"},"imported":[],"importedBy":[{"uid":"8d85-166"}]},"8d85-160":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\MaterialRegistry.js","moduleParts":{"content.esm.js":"8d85-161"},"imported":[],"importedBy":[{"uid":"8d85-166"}]},"8d85-162":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\TextureLoader.js","moduleParts":{"content.esm.js":"8d85-163"},"imported":[{"uid":"8d85-144"},{"uid":"8d85-168"},{"uid":"8d85-148"},{"uid":"8d85-156"}],"importedBy":[{"uid":"8d85-166"}]},"8d85-164":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\ResourceGraph.js","moduleParts":{"content.esm.js":"8d85-165"},"imported":[{"uid":"8d85-144"}],"importedBy":[{"uid":"8d85-166"}]},"8d85-166":{"id":"E:\\glib\\packages\\content\\dist\\content\\src\\index.js","moduleParts":{"content.esm.js":"8d85-167"},"imported":[{"uid":"8d85-148"},{"uid":"8d85-150"},{"uid":"8d85-152"},{"uid":"8d85-156"},{"uid":"8d85-158"},{"uid":"8d85-160"},{"uid":"8d85-162"},{"uid":"8d85-164"},{"uid":"8d85-146"}],"importedBy":[],"isEntry":true},"8d85-168":{"id":"@gglib/graphics","moduleParts":{},"imported":[],"importedBy":[{"uid":"8d85-156"},{"uid":"8d85-162"}],"isExternal":true},"8d85-169":{"id":"@gglib/model","moduleParts":{},"imported":[],"importedBy":[{"uid":"8d85-156"}],"isExternal":true},"8d85-170":{"id":"@gglib/utils","moduleParts":{},"imported":[],"importedBy":[{"uid":"8d85-156"}],"isExternal":true}},"env":{"rollup":"2.80.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
2652
3263
|
|
|
2653
3264
|
const run = () => {
|
|
2654
3265
|
const width = window.innerWidth;
|
|
2655
3266
|
const height = window.innerHeight;
|
|
2656
3267
|
|
|
2657
3268
|
const chartNode = document.querySelector("main");
|
|
2658
|
-
drawChart(chartNode, data, width, height);
|
|
3269
|
+
drawChart.default(chartNode, data, width, height);
|
|
2659
3270
|
};
|
|
2660
3271
|
|
|
2661
3272
|
window.addEventListener('resize', run);
|