d3-flame-graph
Advanced tools
Comparing version 2.1.9 to 2.1.10
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):((t=t||self).d3=t.d3||{},t.d3.flamegraph=n())}(this,(function(){"use strict";var t="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function e(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function r(n){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===t&&e.documentElement.namespaceURI===t?e.createElement(n):e.createElementNS(r,n)}}function i(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function o(t){var n=e(t);return(n.local?i:r)(n)}function a(){}function u(t){return null==t?a:function(){return this.querySelector(t)}}function l(){return[]}function s(t){return null==t?l:function(){return this.querySelectorAll(t)}}function c(t){return function(){return this.matches(t)}}function h(t){return new Array(t.length)}function f(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}f.prototype={constructor:f,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var p="$";function d(t,n,e,r,i,o){for(var a,u=0,l=n.length,s=o.length;u<s;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new f(t,o[u]);for(;u<l;++u)(a=n[u])&&(i[u]=a)}function v(t,n,e,r,i,o,a){var u,l,s,c={},h=n.length,d=o.length,v=new Array(h);for(u=0;u<h;++u)(l=n[u])&&(v[u]=s=p+a.call(l,l.__data__,u,n),s in c?i[u]=l:c[s]=l);for(u=0;u<d;++u)(l=c[s=p+a.call(t,o[u],u,o)])?(r[u]=l,l.__data__=o[u],c[s]=null):e[u]=new f(t,o[u]);for(u=0;u<h;++u)(l=n[u])&&c[v[u]]===l&&(i[u]=l)}function g(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function m(t){return function(){this.removeAttribute(t)}}function y(t){return function(){this.removeAttributeNS(t.space,t.local)}}function w(t,n){return function(){this.setAttribute(t,n)}}function _(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function x(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function b(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function M(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function N(t){return function(){this.style.removeProperty(t)}}function A(t,n,e){return function(){this.style.setProperty(t,n,e)}}function k(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function E(t,n){return t.style.getPropertyValue(n)||M(t).getComputedStyle(t,null).getPropertyValue(n)}function S(t){return function(){delete this[t]}}function T(t,n){return function(){this[t]=n}}function C(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function P(t){return t.trim().split(/^|\s+/)}function q(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=P(t.getAttribute("class")||"")}function $(t,n){for(var e=q(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function L(t,n){for(var e=q(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function j(t){return function(){$(this,t)}}function z(t){return function(){L(this,t)}}function O(t,n){return function(){(n.apply(this,arguments)?$:L)(this,t)}}function B(){this.textContent=""}function D(t){return function(){this.textContent=t}}function X(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function R(){this.innerHTML=""}function I(t){return function(){this.innerHTML=t}}function V(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function Y(){this.nextSibling&&this.parentNode.appendChild(this)}function F(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U(){return null}function W(){var t=this.parentNode;t&&t.removeChild(this)}function G(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function Z(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}H.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var J={};"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(J={mouseenter:"mouseover",mouseleave:"mouseout"}));function K(t,n,e){return t=Q(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Q(t,n,e){return function(r){try{t.call(this,this.__data__,n,e)}finally{}}}function tt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function nt(t,n,e){var r=J.hasOwnProperty(t.type)?K:Q;return function(i,o,a){var u,l=this.__on,s=r(n,o,a);if(l)for(var c=0,h=l.length;c<h;++c)if((u=l[c]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=s,u.capture=e),void(u.value=n);this.addEventListener(t.type,s,e),u={type:t.type,name:t.name,value:n,listener:s,capture:e},l?l.push(u):this.__on=[u]}}function et(t,n,e){var r=M(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function rt(t,n){return function(){return et(this,t,n)}}function it(t,n){return function(){return et(this,t,n.apply(this,arguments))}}var ot=[null];function at(t,n){this._groups=t,this._parents=n}function ut(){return new at([[document.documentElement]],ot)}function lt(t){return"string"==typeof t?new at([[document.querySelector(t)]],[document.documentElement]):new at([[t]],ot)}function st(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function ct(t){return(t=st(Math.abs(t)))?t[1]:NaN}at.prototype=ut.prototype={constructor:at,select:function(t){"function"!=typeof t&&(t=u(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,l=n[i],s=l.length,c=r[i]=new Array(s),h=0;h<s;++h)(o=l[h])&&(a=t.call(o,o.__data__,h,l))&&("__data__"in o&&(a.__data__=o.__data__),c[h]=a);return new at(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=s(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],l=u.length,c=0;c<l;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new at(r,i)},filter:function(t){"function"!=typeof t&&(t=c(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new at(r,this._parents)},data:function(t,n){if(!t)return g=new Array(this.size()),c=-1,this.each((function(t){g[++c]=t})),g;var e,r=n?v:d,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),l=new Array(a),s=new Array(a),c=0;c<a;++c){var h=i[c],f=o[c],p=f.length,g=t.call(h,h&&h.__data__,c,i),m=g.length,y=l[c]=new Array(m),w=u[c]=new Array(m);r(h,f,y,w,s[c]=new Array(p),g,n);for(var _,x,b=0,M=0;b<m;++b)if(_=y[b]){for(b>=M&&(M=b+1);!(x=w[M])&&++M<m;);_._next=x||null}}return(u=new at(u,i))._enter=l,u._exit=s,u},enter:function(){return new at(this._enter||this._groups.map(h),this._parents)},exit:function(){return new at(this._exit||this._groups.map(h),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var l,s=n[u],c=e[u],h=s.length,f=a[u]=new Array(h),p=0;p<h;++p)(l=s[p]||c[p])&&(f[p]=l);for(;u<r;++u)a[u]=n[u];return new at(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=g);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],l=u.length,s=i[o]=new Array(l),c=0;c<l;++c)(a=u[c])&&(s[c]=a);s.sort(n)}return new at(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var r=e(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==n?r.local?y:m:"function"==typeof n?r.local?b:x:r.local?_:w)(r,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?N:"function"==typeof n?k:A)(t,n,null==e?"":e)):E(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?S:"function"==typeof n?C:T)(t,n)):this.node()[t]},classed:function(t,n){var e=P(t+"");if(arguments.length<2){for(var r=q(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?O:n?j:z)(e,n))},text:function(t){return arguments.length?this.each(null==t?B:("function"==typeof t?X:D)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?R:("function"==typeof t?V:I)(t)):this.node().innerHTML},raise:function(){return this.each(Y)},lower:function(){return this.each(F)},append:function(t){var n="function"==typeof t?t:o(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:o(t),r=null==n?U:"function"==typeof n?n:u(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(W)},clone:function(t){return this.select(t?Z:G)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?nt:tt,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var l,s=0,c=u.length;s<c;++s)for(r=0,l=u[s];r<a;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,n){return this.each(("function"==typeof n?it:rt)(t,n))}};var ht,ft=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pt(t){if(!(n=ft.exec(t)))throw new Error("invalid format: "+t);var n;return new dt({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function dt(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function vt(t,n){var e=st(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}pt.prototype=dt.prototype,dt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var gt={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return vt(100*t,n)},r:vt,s:function(t,n){var e=st(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ht=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+st(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function mt(t){return t}var yt,wt,_t,xt=Array.prototype.map,bt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Mt(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?mt:(n=xt.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),o.push(t.substring(i-=u,i+u)),!((l+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?mt:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(xt.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"-":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var n=(t=pt(t)).fill,e=t.align,h=t.sign,f=t.symbol,p=t.zero,d=t.width,v=t.comma,g=t.precision,m=t.trim,y=t.type;"n"===y?(v=!0,y="g"):gt[y]||(void 0===g&&(g=12),m=!0,y="g"),(p||"0"===n&&"="===e)&&(p=!0,n="0",e="=");var w="$"===f?i:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",_="$"===f?o:/[%p]/.test(y)?l:"",x=gt[y],b=/[defgprs%]/.test(y);function M(t){var i,o,l,f=w,M=_;if("c"===y)M=x(t)+M,t="";else{var N=(t=+t)<0;if(t=isNaN(t)?c:x(Math.abs(t),g),m&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),N&&0==+t&&(N=!1),f=(N?"("===h?h:s:"-"===h||"("===h?"":h)+f,M=("s"===y?bt[8+ht/3]:"")+M+(N&&"("===h?")":""),b)for(i=-1,o=t.length;++i<o;)if(48>(l=t.charCodeAt(i))||l>57){M=(46===l?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}v&&!p&&(t=r(t,1/0));var A=f.length+t.length+M.length,k=A<d?new Array(d-A+1).join(n):"";switch(v&&p&&(t=r(k+t,k.length?d-M.length:1/0),k=""),e){case"<":t=f+t+M+k;break;case"=":t=f+k+t+M;break;case"^":t=k.slice(0,A=k.length>>1)+f+t+M+k.slice(A);break;default:t=k+f+t+M}return u(t)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),M.toString=function(){return t+""},M}return{format:h,formatPrefix:function(t,n){var e=h(((t=pt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ct(n)/3))),i=Math.pow(10,-r),o=bt[8+r/3];return function(t){return e(i*t)+o}}}}function Nt(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}yt=Mt({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),wt=yt.format,_t=yt.formatPrefix;var At,kt,Et=(1===(At=Nt).length&&(kt=At,At=function(t,n){return Nt(kt(t),n)}),{left:function(t,n,e,r){for(null==e&&(e=0),null==r&&(r=t.length);e<r;){var i=e+r>>>1;At(t[i],n)<0?e=i+1:r=i}return e},right:function(t,n,e,r){for(null==e&&(e=0),null==r&&(r=t.length);e<r;){var i=e+r>>>1;At(t[i],n)>0?r=i:e=i+1}return e}}).right,St=Math.sqrt(50),Tt=Math.sqrt(10),Ct=Math.sqrt(2);function Pt(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=St?10:o>=Tt?5:o>=Ct?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=St?10:o>=Tt?5:o>=Ct?2:1)}function qt(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function Ht(t,n){var e,r,i,o,a,u=new zt(t),l=+t.value&&(u.value=t.value),s=[u];for(null==n&&(n=$t);e=s.pop();)if(l&&(e.value=+e.data.value),(i=n(e.data))&&(a=i.length))for(e.children=new Array(a),o=a-1;o>=0;--o)s.push(r=e.children[o]=new zt(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(jt)}function $t(t){return t.children}function Lt(t){t.data=t.data.data}function jt(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function zt(t){this.data=t,this.depth=this.height=0,this.parent=null}function Ot(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Bt(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&function(t,n,e,r,i){for(var o,a=t.children,u=-1,l=a.length,s=t.value&&(r-n)/t.value;++u<l;)(o=a[u]).y0=e,o.y1=i,o.x0=n,o.x1=n+=o.value*s}(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a<i&&(i=a=(i+a)/2),u<o&&(o=u=(o+u)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=u}}(n,o)),r&&i.eachBefore(Ot),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(t){return arguments.length?(e=+t,i):e},i}function Dt(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}zt.prototype=Ht.prototype={constructor:zt,count:function(){return this.eachAfter(qt)},each:function(t){var n,e,r,i,o=this,a=[o];do{for(n=a.reverse(),a=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r<i;++r)a.push(e[r])}while(a.length);return this},eachAfter:function(t){for(var n,e,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),n=i.children)for(e=0,r=n.length;e<r;++e)o.push(n[e]);for(;i=a.pop();)t(i);return this},eachBefore:function(t){for(var n,e,r=this,i=[r];r=i.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;t=e.pop(),n=r.pop();for(;t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Ht(this).eachBefore(Lt)}};function Xt(){}function Rt(t,n){var e=new Xt;if(t instanceof Xt)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var a in t)e.set(a,t[a]);return e}function It(){}Xt.prototype=Rt.prototype={constructor:Xt,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var Vt=Rt.prototype;It.prototype=function(t,n){var e=new It;if(t instanceof It)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}.prototype={constructor:It,has:Vt.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Vt.remove,clear:Vt.clear,values:Vt.keys,size:Vt.size,empty:Vt.empty,each:Vt.each};var Yt=Array.prototype,Ft=Yt.map,Ut=Yt.slice;function Wt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Gt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Zt(){}var Jt="\\s*([+-]?\\d+)\\s*",Kt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tn=/^#([0-9a-f]{3,8})$/,nn=new RegExp("^rgb\\("+[Jt,Jt,Jt]+"\\)$"),en=new RegExp("^rgb\\("+[Qt,Qt,Qt]+"\\)$"),rn=new RegExp("^rgba\\("+[Jt,Jt,Jt,Kt]+"\\)$"),on=new RegExp("^rgba\\("+[Qt,Qt,Qt,Kt]+"\\)$"),an=new RegExp("^hsl\\("+[Kt,Qt,Qt]+"\\)$"),un=new RegExp("^hsla\\("+[Kt,Qt,Qt,Kt]+"\\)$"),ln={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function sn(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function hn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=tn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?fn(n):3===e?new vn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?new vn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?new vn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=nn.exec(t))?new vn(n[1],n[2],n[3],1):(n=en.exec(t))?new vn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=rn.exec(t))?pn(n[1],n[2],n[3],n[4]):(n=on.exec(t))?pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=an.exec(t))?wn(n[1],n[2]/100,n[3]/100,1):(n=un.exec(t))?wn(n[1],n[2]/100,n[3]/100,n[4]):ln.hasOwnProperty(t)?fn(ln[t]):"transparent"===t?new vn(NaN,NaN,NaN,0):null}function fn(t){return new vn(t>>16&255,t>>8&255,255&t,1)}function pn(t,n,e,r){return r<=0&&(t=n=e=NaN),new vn(t,n,e,r)}function dn(t,n,e,r){return 1===arguments.length?((i=t)instanceof Zt||(i=hn(i)),i?new vn((i=i.rgb()).r,i.g,i.b,i.opacity):new vn):new vn(t,n,e,null==r?1:r);var i}function vn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function gn(){return"#"+yn(this.r)+yn(this.g)+yn(this.b)}function mn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function yn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function wn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new xn(t,n,e,r)}function _n(t){if(t instanceof xn)return new xn(t.h,t.s,t.l,t.opacity);if(t instanceof Zt||(t=hn(t)),!t)return new xn;if(t instanceof xn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,l=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=l<.5?o+i:2-o-i,a*=60):u=l>0&&l<1?0:a,new xn(a,u,l,t.opacity)}function xn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function bn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Mn(t){return function(){return t}}function Nn(t){return 1==(t=+t)?An:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Mn(isNaN(n)?e:n)}}function An(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Mn(isNaN(t)?n:t)}Wt(Zt,hn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:sn,formatHex:sn,formatHsl:function(){return _n(this).formatHsl()},formatRgb:cn,toString:cn}),Wt(vn,dn,Gt(Zt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new vn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new vn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gn,formatHex:gn,formatRgb:mn,toString:mn})),Wt(xn,(function(t,n,e,r){return 1===arguments.length?_n(t):new xn(t,n,e,null==r?1:r)}),Gt(Zt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new vn(bn(t>=240?t-240:t+120,i,r),bn(t,i,r),bn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var kn=function t(n){var e=Nn(n);function r(t,n){var r=e((t=dn(t)).r,(n=dn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=An(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function En(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(e=0;e<i;++e)o[e]=$n(t[e],n[e]);for(;e<r;++e)a[e]=n[e];return function(t){for(e=0;e<i;++e)a[e]=o[e](t);return a}}function Sn(t,n){var e=new Date;return n-=t=+t,function(r){return e.setTime(t+n*r),e}}function Tn(t,n){return n-=t=+t,function(e){return t+n*e}}function Cn(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=$n(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}var Pn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qn=new RegExp(Pn.source,"g");function Hn(t,n){var e,r,i,o=Pn.lastIndex=qn.lastIndex=0,a=-1,u=[],l=[];for(t+="",n+="";(e=Pn.exec(t))&&(r=qn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,l.push({i:a,x:Tn(e,r)})),o=qn.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?l[0]?function(t){return function(n){return t(n)+""}}(l[0].x):function(t){return function(){return t}}(n):(n=l.length,function(t){for(var e,r=0;r<n;++r)u[(e=l[r]).i]=e.x(t);return u.join("")})}function $n(t,n){var e,r=typeof n;return null==n||"boolean"===r?Mn(n):("number"===r?Tn:"string"===r?(e=hn(n))?(n=e,kn):Hn:n instanceof hn?kn:n instanceof Date?Sn:Array.isArray(n)?En:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?Cn:Tn)(t,n)}function Ln(t,n){return n-=t=+t,function(e){return Math.round(t+n*e)}}var jn,zn,On,Bn,Dn=180/Math.PI,Xn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rn(t,n,e,r,i,o){var a,u,l;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(l=t*e+n*r)&&(e-=t*l,r-=n*l),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,l/=u),t*r<n*e&&(t=-t,n=-n,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Dn,skewX:Math.atan(l)*Dn,scaleX:a,scaleY:u}}function In(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],l=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var l=a.push("translate(",null,n,null,e);u.push({i:l-4,x:Tn(t,i)},{i:l-2,x:Tn(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,u,l),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Tn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,l),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Tn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,l),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Tn(t,e)},{i:u-2,x:Tn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,l),o=a=null,function(t){for(var n,e=-1,r=l.length;++e<r;)u[(n=l[e]).i]=n.x(t);return u.join("")}}}var Vn=In((function(t){return"none"===t?Xn:(jn||(jn=document.createElement("DIV"),zn=document.documentElement,On=document.defaultView),jn.style.transform=t,t=On.getComputedStyle(zn.appendChild(jn),null).getPropertyValue("transform"),zn.removeChild(jn),Rn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Yn=In((function(t){return null==t?Xn:(Bn||(Bn=document.createElementNS("http://www.w3.org/2000/svg","g")),Bn.setAttribute("transform",t),(t=Bn.transform.baseVal.consolidate())?Rn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Xn)}),", ",")",")");function Fn(t){return+t}var Un=[0,1];function Wn(t){return t}function Gn(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:(e=isNaN(n)?NaN:.5,function(){return e});var e}function Zn(t){var n,e=t[0],r=t[t.length-1];return e>r&&(n=e,e=r,r=n),function(t){return Math.max(e,Math.min(r,t))}}function Jn(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i<r?(r=Gn(i,r),o=e(a,o)):(r=Gn(r,i),o=e(o,a)),function(t){return o(r(t))}}function Kn(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<r;)i[a]=Gn(t[a],t[a+1]),o[a]=e(n[a],n[a+1]);return function(n){var e=Et(t,n,1,r)-1;return o[e](i[e](n))}}function Qn(t,n){return function(){var t,n,e,r,i,o,a=Un,u=Un,l=$n,s=Wn;function c(){return r=Math.min(a.length,u.length)>2?Kn:Jn,i=o=null,h}function h(n){return isNaN(n=+n)?e:(i||(i=r(a.map(t),u,l)))(t(s(n)))}return h.invert=function(e){return s(n((o||(o=r(u,a.map(t),Tn)))(e)))},h.domain=function(t){return arguments.length?(a=Ft.call(t,Fn),s===Wn||(s=Zn(a)),c()):a.slice()},h.range=function(t){return arguments.length?(u=Ut.call(t),c()):u.slice()},h.rangeRound=function(t){return u=Ut.call(t),l=Ln,c()},h.clamp=function(t){return arguments.length?(s=t?Zn(a):Wn,h):s!==Wn},h.interpolate=function(t){return arguments.length?(l=t,c()):l},h.unknown=function(t){return arguments.length?(e=t,h):e},function(e,r){return t=e,n=r,c()}}()(t,n)}function te(t,n,e,r){var i,o=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=St?i*=10:o>=Tt?i*=5:o>=Ct&&(i*=2),n<t?-i:i}(t,n,e);switch((r=pt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(n));return null!=r.precision||isNaN(i=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ct(n)/3)))-ct(Math.abs(t)))}(o,a))||(r.precision=i),_t(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ct(n)-ct(t))+1}(o,Math.max(Math.abs(t),Math.abs(n))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-ct(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return wt(r)}function ne(t){var n=t.domain;return t.ticks=function(t){var e=n();return function(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)===(n=+n)&&e>0)return[t];if((r=n<t)&&(i=t,t=n,n=i),0===(a=Pt(t,n,e))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u<i;)o[u]=(t+u)*a;else for(t=Math.floor(t*a),n=Math.ceil(n*a),o=new Array(i=Math.ceil(t-n+1));++u<i;)o[u]=(t-u)/a;return r&&o.reverse(),o}(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return te(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],l=i[a];return l<u&&(r=u,u=l,l=r,r=o,o=a,a=r),(r=Pt(u,l,e))>0?r=Pt(u=Math.floor(u/r)*r,l=Math.ceil(l/r)*r,e):r<0&&(r=Pt(u=Math.ceil(u*r)/r,l=Math.floor(l*r)/r,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(l/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(l*r)/r,n(i)),t},t}function ee(){var t=Qn(Wn,Wn);return t.copy=function(){return n=t,ee().domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());var n},Dt.apply(t,arguments),ne(t)}function re(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function ie(){var t=function(){return"n"},n=function(){return[0,0]},e=function(){return" "},r=document.body,i=h(),o=null,a=null,u=null;function l(t){(o=function(t){var n=t.node();return n?"svg"===n.tagName.toLowerCase()?n:n.ownerSVGElement:null}(t))&&(a=o.createSVGPoint(),r.appendChild(i))}l.show=function(){var i=Array.prototype.slice.call(arguments);i[i.length-1]instanceof SVGElement&&(u=i.pop());var o,a=e.apply(this,i),h=n.apply(this,i),p=t.apply(this,i),d=f(),v=c.length,g=document.documentElement.scrollTop||r.scrollTop,m=document.documentElement.scrollLeft||r.scrollLeft;for(d.html(a).style("opacity",1).style("pointer-events","all");v--;)d.classed(c[v],!1);return o=s.get(p).apply(this),d.classed(p,!0).style("top",o.top+h[0]+g+"px").style("left",o.left+h[1]+m+"px"),l},l.hide=function(){return f().style("opacity",0).style("pointer-events","none"),l},l.attr=function(t,n){if(arguments.length<2&&"string"==typeof t)return f().attr(t);var e=Array.prototype.slice.call(arguments);return ut.prototype.attr.apply(f(),e),l},l.style=function(t,n){if(arguments.length<2&&"string"==typeof t)return f().style(t);var e=Array.prototype.slice.call(arguments);return ut.prototype.style.apply(f(),e),l},l.direction=function(n){return arguments.length?(t=null==n?n:d(n),l):t},l.offset=function(t){return arguments.length?(n=null==t?t:d(t),l):n},l.html=function(t){return arguments.length?(e=null==t?t:d(t),l):e},l.rootElement=function(t){return arguments.length?(r=null==t?t:d(t),l):r},l.destroy=function(){return i&&(f().remove(),i=null),l};var s=Rt({n:function(){var t=p(this);return{top:t.n.y-i.offsetHeight,left:t.n.x-i.offsetWidth/2}},s:function(){var t=p(this);return{top:t.s.y,left:t.s.x-i.offsetWidth/2}},e:function(){var t=p(this);return{top:t.e.y-i.offsetHeight/2,left:t.e.x}},w:function(){var t=p(this);return{top:t.w.y-i.offsetHeight/2,left:t.w.x-i.offsetWidth}},nw:function(){var t=p(this);return{top:t.nw.y-i.offsetHeight,left:t.nw.x-i.offsetWidth}},ne:function(){var t=p(this);return{top:t.ne.y-i.offsetHeight,left:t.ne.x}},sw:function(){var t=p(this);return{top:t.sw.y,left:t.sw.x-i.offsetWidth}},se:function(){var t=p(this);return{top:t.se.y,left:t.se.x}}}),c=s.keys();function h(){var t=lt(document.createElement("div"));return t.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function f(){return null==i&&(i=h(),r.appendChild(i)),lt(i)}function p(t){for(var n=u||t;null==n.getScreenCTM&&null!=n.parentNode;)n=n.parentNode;var e={},r=n.getScreenCTM(),i=n.getBBox(),o=i.width,l=i.height,s=i.x,c=i.y;return a.x=s,a.y=c,e.nw=a.matrixTransform(r),a.x+=o,e.ne=a.matrixTransform(r),a.y+=l,e.se=a.matrixTransform(r),a.x-=o,e.sw=a.matrixTransform(r),a.y-=l/2,e.w=a.matrixTransform(r),a.x+=o,e.e=a.matrixTransform(r),a.x-=o/2,a.y-=l/2,e.n=a.matrixTransform(r),a.y+=l,e.s=a.matrixTransform(r),e}function d(t){return"function"==typeof t?t:function(){return t}}return l}var oe={value:function(){}};function ae(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new ue(r)}function ue(t){this._=t}function le(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function se(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function ce(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=oe,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}ue.prototype=ae.prototype={constructor:ue,on:function(t,n){var e,r=this._,i=le(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=ce(r[e],t.name,n);else if(null==n)for(e in r)r[e]=ce(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=se(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new ue(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var he,fe,pe=0,de=0,ve=0,ge=1e3,me=0,ye=0,we=0,_e="object"==typeof performance&&performance.now?performance:Date,xe="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function be(){return ye||(xe(Me),ye=_e.now()+we)}function Me(){ye=0}function Ne(){this._call=this._time=this._next=null}function Ae(t,n,e){var r=new Ne;return r.restart(t,n,e),r}function ke(){ye=(me=_e.now())+we,pe=de=0;try{!function(){be(),++pe;for(var t,n=he;n;)(t=ye-n._time)>=0&&n._call.call(null,t),n=n._next;--pe}()}finally{pe=0,function(){var t,n,e=he,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:he=n);fe=t,Se(r)}(),ye=0}}function Ee(){var t=_e.now(),n=t-me;n>ge&&(we-=n,me=t)}function Se(t){pe||(de&&(de=clearTimeout(de)),t-ye>24?(t<1/0&&(de=setTimeout(ke,t-_e.now()-we)),ve&&(ve=clearInterval(ve))):(ve||(me=_e.now(),ve=setInterval(Ee,ge)),pe=1,xe(ke)))}function Te(t,n,e){var r=new Ne;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Ne.prototype=Ae.prototype={constructor:Ne,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?be():+e)+(null==n?0:+n),this._next||fe===this||(fe?fe._next=this:he=this,fe=this),this._call=t,this._time=e,Se()},stop:function(){this._call&&(this._call=null,this._time=1/0,Se())}};var Ce=ae("start","end","cancel","interrupt"),Pe=[],qe=0,He=1,$e=2,Le=3,je=4,ze=5,Oe=6;function Be(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(l){var s,c,h,f;if(e.state!==He)return u();for(s in i)if((f=i[s]).name===e.name){if(f.state===Le)return Te(o);f.state===je?(f.state=Oe,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[s]):+s<n&&(f.state=Oe,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[s])}if(Te((function(){e.state===Le&&(e.state=je,e.timer.restart(a,e.delay,e.time),a(l))})),e.state=$e,e.on.call("start",t,t.__data__,e.index,e.group),e.state===$e){for(e.state=Le,r=new Array(h=e.tween.length),s=0,c=-1;s<h;++s)(f=e.tween[s].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=f);r.length=c+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=ze,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);e.state===ze&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){for(var r in e.state=Oe,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Ae((function(t){e.state=He,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:i,on:Ce,tween:Pe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:qe})}function De(t,n){var e=Re(t,n);if(e.state>qe)throw new Error("too late; already scheduled");return e}function Xe(t,n){var e=Re(t,n);if(e.state>Le)throw new Error("too late; already running");return e}function Re(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ie(t,n){var e,r;return function(){var i=Xe(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a<u;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}i.tween=r}}function Ve(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Xe(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:n,value:e},l=0,s=i.length;l<s;++l)if(i[l].name===n){i[l]=u;break}l===s&&i.push(u)}o.tween=i}}function Ye(t,n,e){var r=t._id;return t.each((function(){var t=Xe(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Re(t,r).value[n]}}function Fe(t,n){var e;return("number"==typeof n?Tn:n instanceof hn?kn:(e=hn(n))?(n=e,kn):Hn)(t,n)}function Ue(t){return function(){this.removeAttribute(t)}}function We(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ge(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=n(r=a,e)}}function Ze(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=n(r=a,e)}}function Je(t,n,e){var r,i,o;return function(){var a,u,l=e(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,l));this.removeAttribute(t)}}function Ke(t,n,e){var r,i,o;return function(){var a,u,l=e(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,l));this.removeAttributeNS(t.space,t.local)}}function Qe(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n(e))}}(t,i)),e}return i._value=n,i}function tr(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n(e))}}(t,i)),e}return i._value=n,i}function nr(t,n){return function(){De(this,t).delay=+n.apply(this,arguments)}}function er(t,n){return n=+n,function(){De(this,t).delay=n}}function rr(t,n){return function(){Xe(this,t).duration=+n.apply(this,arguments)}}function ir(t,n){return n=+n,function(){Xe(this,t).duration=n}}var or=ut.prototype.constructor;function ar(t){return function(){this.style.removeProperty(t)}}var ur=0;function lr(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function sr(){return++ur}var cr=ut.prototype;lr.prototype=function(t){return ut().transition(t)}.prototype={constructor:lr,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=u(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var l,s,c=r[a],h=c.length,f=o[a]=new Array(h),p=0;p<h;++p)(l=c[p])&&(s=t.call(l,l.__data__,p,c))&&("__data__"in l&&(s.__data__=l.__data__),f[p]=s,Be(f[p],n,e,p,f,Re(l,e)));return new lr(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=s(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var l,c=r[u],h=c.length,f=0;f<h;++f)if(l=c[f]){for(var p,d=t.call(l,l.__data__,f,c),v=Re(l,e),g=0,m=d.length;g<m;++g)(p=d[g])&&Be(p,n,e,g,d,v);o.push(d),a.push(l)}return new lr(o,a,n,e)},filter:function(t){"function"!=typeof t&&(t=c(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new lr(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var l,s=n[u],c=e[u],h=s.length,f=a[u]=new Array(h),p=0;p<h;++p)(l=s[p]||c[p])&&(f[p]=l);for(;u<r;++u)a[u]=n[u];return new lr(a,this._parents,this._name,this._id)},selection:function(){return new or(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=sr(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)if(a=u[s]){var c=Re(a,n);Be(a,t,e,s,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new lr(r,this._parents,t,e)},call:cr.call,nodes:cr.nodes,node:cr.node,size:cr.size,empty:cr.empty,each:cr.each,on:function(t,n){var e=this._id;return arguments.length<2?Re(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?De:Xe;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var r=e(t),i="transform"===r?Yn:Fe;return this.attrTween(t,"function"==typeof n?(r.local?Ke:Je)(r,i,Ye(this,"attr."+t,n)):null==n?(r.local?We:Ue)(r):(r.local?Ze:Ge)(r,i,n))},attrTween:function(t,n){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;var i=e(t);return this.tween(r,(i.local?Qe:tr)(i,n))},style:function(t,n,e){var r="transform"==(t+="")?Vn:Fe;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=E(this,t),a=(this.style.removeProperty(t),E(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,ar(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=E(this,t),u=e(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=E(this,t)),a===l?null:a===r&&l===i?o:(i=l,o=n(r=a,u))}}(t,r,Ye(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var l=Xe(this,t),s=l.on,c=null==l.value[a]?o||(o=ar(n)):void 0;s===e&&i===c||(r=(e=s).copy()).on(u,i=c),l.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=E(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n(r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Re(this.node(),e).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Ie:Ve)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?nr:er)(n,t)):Re(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?rr:ir)(n,t)):Re(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){Xe(this,t).ease=n}}(n,t)):Re(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,a){var u={value:a},l={value:function(){0==--i&&o()}};e.each((function(){var e=Xe(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(l)),e.on=n}))}))}};var hr={time:null,delay:0,duration:250,ease:re};function fr(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return hr.time=be(),hr;return e}return ut.prototype.interrupt=function(t){return this.each((function(){!function(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>$e&&e.state<ze,e.state=Oe,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}(this,t)}))},ut.prototype.transition=function(t){var n,e;t instanceof lr?(n=t._id,t=t._name):(n=sr(),(e=hr).time=be(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)(a=u[s])&&Be(a,t,n,s,u,e||fr(a,n));return new lr(r,this._parents,t,n)},function(){var t=960,n=null,e=18,r=null,i=!0,o="",a=750,u=re,l=!1,s=!1,c=null,h=0,f=null,p=!1,d=!1,v=!1,g=0,m=0,y=0,w=!1,_=!1,x=function(t){return t.data.n||t.data.name},b=function(t){return"v"in t?t.v:t.value},M=function(t){return t.c||t.children},N=function(t){return t.data.l||t.data.libtype},A=function(t){return"d"in t.data?t.data.d:t.data.delta},k=function(){f&&L()},E=k;let S=(t,n)=>{const e=new RegExp(n),r=x(t);return void 0!==r&&r&&r.match(e)};const T=S;var C,P=function(t){f&&(t?f.innerHTML=t:g?L():f.innerHTML="")},q=P,H=function(t){return x(t)+" ("+wt(".3f")(100*(t.x1-t.x0),3)+"%, "+b(t)+" samples)"},$=ie().direction("s").offset([8,0]).attr("class","d3-flame-graph-tip").html((function(t){return H(t)}));function L(){f.innerHTML=g+" of "+m+" samples ( "+wt(".3f")(g/m*100,3)+"%)"}var j=function(t){return t.highlight?"#E600E6":function(t,n,e){var r,i,o;if(d)r=220,i=220,o=220,e||(e=0),e>0?(o=Math.round(210*(y-e)/y),i=o):e<0&&(r=Math.round(210*(y+e)/y),i=r);else{var a=v?"cold":"warm";v||void 0===n||""===n||(a="red",void 0!==t&&t&&t.match(/::/)&&(a="yellow"),"kernel"===n?a="orange":"jit"===n?a="green":"inlined"===n&&(a="aqua"));var u=0;if(t){var l=t.split("`");l.length>1&&(t=l[l.length-1]),t=t.split("(")[0],u=function(t){var n=0,e=0,r=1;if(t){for(var i=0;i<t.length&&!(i>6);i++)n+=r*(t.charCodeAt(i)%10),e+=9*r,r*=.7;e>0&&(n/=e)}return n}(t)}"red"===a?(r=200+Math.round(55*u),i=50+Math.round(80*u),o=i):"orange"===a?(r=190+Math.round(65*u),i=90+Math.round(65*u),o=0):"yellow"===a?(r=175+Math.round(55*u),i=r,o=50+Math.round(20*u)):"green"===a?(r=50+Math.round(60*u),i=200+Math.round(55*u),o=r):"aqua"===a?(r=50+Math.round(60*u),i=165+Math.round(55*u),o=i):"cold"===a?(r=0+Math.round(55*(1-u)),i=0+Math.round(230*(1-u)),o=200+Math.round(55*u)):(r=200+Math.round(55*u),i=0+Math.round(230*(1-u)),o=0+Math.round(55*(1-u)))}return"rgb("+r+","+i+","+o+")"}(x(t),N(t),A(t))},z=j;function O(t){t.data.fade=!1,t.data.hide=!1,t.children&&t.children.forEach(O)}function B(t){if($.hide(t),function(t){let n,e,r,i=t,o=i.parent;for(;o;){for(e=(n=o.children).length;e--;)(r=n[e])!==i&&(r.data.hide=!0);o=(i=o).parent}}(t),O(t),function t(n){n.parent&&(n.parent.data.fade=!0,t(n.parent))}(t),R(),_){const n=C._groups[0][0].parentNode.offsetTop,r=(window.innerHeight-n)/e,i=(t.height-r+10)*e;window.scrollTo({top:n+i,left:0,behavior:"smooth"})}"function"==typeof c&&c(t)}function D(t,n){return"function"==typeof l?l(t,n):l?Nt(x(t),x(n)):void 0}var X=Bt();function R(){r.each((function(r){var o=ee().range([0,t]),c=ee().range([0,e]);!function(t){let n,e,r,i,o,a,u,l;const s=[],c=[],h=[],f=!p;let d=t.data;d.hide?(t.value=0,(e=t.children)&&h.push(e)):(t.value=d.fade?0:b(d),s.push(t));for(;n=s.pop();)if((e=n.children)&&(o=e.length)){for(i=0;o--;)u=e[o],(d=u.data).hide?(u.value=0,(r=u.children)&&h.push(r)):(d.fade?u.value=0:(l=b(d),u.value=l,i+=l),s.push(u));f&&n.value&&(n.value-=i),c.push(e)}o=c.length;for(;o--;){for(e=c[o],i=0,a=e.length;a--;)i+=e[a].value;e[0].parent.value+=i}for(;h.length;)for(e=h.pop(),a=e.length;a--;)(u=e[a]).value=0,(r=u.children)&&h.push(r)}(r),m=r.value,l&&r.sort(D),X(r);var f=t/(r.x1-r.x0);function d(t){return(t.x1-t.x0)*f}var v=function(n){var e=n.descendants();if(h>0){var r=t/(n.x1-n.x0);e=e.filter((function(t){return(t.x1-t.x0)*r>h}))}return e}(r),g=lt(this).select("svg").selectAll("g").data(v,(function(t){return t.id}));if(!n||w){var y=Math.max.apply(null,v.map((function(t){return t.depth})));n=(y+3)*e,lt(this).select("svg").attr("height",n)}g.transition().duration(a).ease(u).attr("transform",(function(t){return"translate("+o(t.x0)+","+(s?c(t.depth):n-c(t.depth)-e)+")"})),g.select("rect").transition().duration(a).ease(u).attr("width",d);var _=g.enter().append("svg:g").attr("transform",(function(t){return"translate("+o(t.x0)+","+(s?c(t.depth):n-c(t.depth)-e)+")"}));_.append("svg:rect").transition().delay(a/2).attr("width",d),i||_.append("svg:title"),_.append("foreignObject").append("xhtml:div"),(g=lt(this).select("svg").selectAll("g").data(v,(function(t){return t.id}))).attr("width",d).attr("height",(function(t){return e})).attr("name",(function(t){return x(t)})).attr("class",(function(t){return t.data.fade?"frame fade":"frame"})),g.select("rect").attr("height",(function(t){return e})).attr("fill",(function(t){return j(t)})),i||g.select("title").text(H),g.select("foreignObject").attr("width",d).attr("height",(function(t){return e})).select("div").attr("class","d3-flame-graph-label").style("display",(function(t){return d(t)<35?"none":"block"})).transition().delay(a).text(x),g.on("click",B),g.exit().remove(),g.on("mouseover",(function(t){i&&$.show(t,this),P(H(t))})).on("mouseout",(function(t){i&&$.hide(t),P(null)}))}))}function I(t){y=0;let n=0,e=0;const r=d;!function(t,n){n(t);let e=t.children;if(e){const t=[e];let r,i,o;for(;t.length;)for(r=(e=t.pop()).length;r--;)n(i=e[r]),(o=i.children)&&t.push(o)}}(t,(function(t){t.id=n++,r&&(e=Math.abs(A(t)),y<e&&(y=e))}))}function V(i){const a=Ht(i.datum(),M);if(I(a),r=i.datum(a),!arguments.length)return V;r.each((function(r){C||(C=lt(this).append("svg:svg").attr("width",t).attr("height",n||(a.height+3)*e).attr("class","partition d3-flame-graph").call($)).append("svg:text").attr("class","title").attr("text-anchor","middle").attr("y","25").attr("x",t/2).attr("fill","#808080").text(o)})),R()}return V.height=function(t){return arguments.length?(n=t,V):n},V.width=function(n){return arguments.length?(t=n,V):t},V.cellHeight=function(t){return arguments.length?(e=t,V):e},V.tooltip=function(t){return arguments.length?("function"==typeof t&&($=t),i=!!t,V):i},V.title=function(t){return arguments.length?(o=t,V):o},V.transitionDuration=function(t){return arguments.length?(a=t,V):a},V.transitionEase=function(t){return arguments.length?(u=t,V):u},V.sort=function(t){return arguments.length?(l=t,V):l},V.inverted=function(t){return arguments.length?(s=t,V):s},V.differential=function(t){return arguments.length?(d=t,V):d},V.elided=function(t){return arguments.length?(v=t,V):v},V.setLabelHandler=function(t){return arguments.length?(H=t,V):H},V.label=V.setLabelHandler,V.search=function(t){r.each((function(n){!function(t,n){var e=[],r=0;!function t(i,o){var a=!1;S(i,n)?(i.highlight=!0,a=!0,o||(r+=b(i)),e.push(i)):i.highlight=!1,M(i)&&M(i).forEach((function(n){t(n,o||a)}))}(t,!1),g=r,k(e,r,m)}(n,t),R()}))},V.findById=function(t){if(null==t)return null;let n=null;return r.each((function(e){null===n&&(n=function t(n,e){if(n.id===e)return n;var r=M(n);if(r)for(var i=0;i<r.length;i++){var o=t(r[i],e);if(o)return o}}(e,t))})),n},V.clear=function(){g=0,P(null),r.each((function(t){!function t(n){n.highlight=!1,M(n)&&M(n).forEach((function(n){t(n)}))}(t),R()}))},V.zoomTo=function(t){B(t)},V.resetZoom=function(){r.each((function(t){B(t)}))},V.onClick=function(t){return arguments.length?(c=t,V):c},V.merge=function(t){return r?(r.each((function(e){!function t(n,e){e.forEach((function(e){var r=n.find((function(t){return t.name===e.name}));r?(r.original?r.original+=e.value:r.value+=e.value,e.children&&(r.children||(r.children=[]),t(r.children,e.children))):n.push(e)}))}([e.data],[t]),I(n=Ht(e.data,M))})),r=r.datum(n),R(),V):V;var n},V.update=function(t){return r?(r.each((function(e){e.data=t,I(n=Ht(e.data,M))})),r=r.datum(n),R(),V):V;var n},V.destroy=function(){return r?(i&&$.hide(),r.selectAll("svg").remove(),V):V},V.setColorMapper=function(t){return arguments.length?(j=n=>{const e=z(n);return t(n,e)},V):(j=z,V)},V.color=V.setColorMapper,V.minFrameSize=function(t){return arguments.length?(h=t,V):h},V.setDetailsElement=function(t){return arguments.length?(f=t,V):f},V.details=V.setDetailsElement,V.selfValue=function(t){return arguments.length?(p=t,V):p},V.resetHeightOnZoom=function(t){return arguments.length?(w=t,V):w},V.scrollOnZoom=function(t){return arguments.length?(_=t,V):_},V.getName=function(t){return arguments.length?(x=t,V):x},V.getValue=function(t){return arguments.length?(b=t,V):b},V.getChildren=function(t){return arguments.length?(M=t,V):M},V.getLibtype=function(t){return arguments.length?(N=t,V):N},V.getDelta=function(t){return arguments.length?(A=t,V):A},V.setSearchHandler=function(t){return arguments.length?(k=t,V):(k=E,V)},V.setDetailsHandler=function(t){return arguments.length?(P=t,V):(P=q,V)},V.setSearchMatch=function(t){return arguments.length?(S=t,V):(S=T,V)},V}})); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):((t=t||self).d3=t.d3||{},t.d3.flamegraph=n())}(this,(function(){"use strict";var t="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function e(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function r(n){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===t&&e.documentElement.namespaceURI===t?e.createElement(n):e.createElementNS(r,n)}}function i(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function o(t){var n=e(t);return(n.local?i:r)(n)}function a(){}function u(t){return null==t?a:function(){return this.querySelector(t)}}function l(){return[]}function s(t){return null==t?l:function(){return this.querySelectorAll(t)}}function c(t){return function(){return this.matches(t)}}function h(t){return new Array(t.length)}function f(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}f.prototype={constructor:f,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var p="$";function d(t,n,e,r,i,o){for(var a,u=0,l=n.length,s=o.length;u<s;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new f(t,o[u]);for(;u<l;++u)(a=n[u])&&(i[u]=a)}function v(t,n,e,r,i,o,a){var u,l,s,c={},h=n.length,d=o.length,v=new Array(h);for(u=0;u<h;++u)(l=n[u])&&(v[u]=s=p+a.call(l,l.__data__,u,n),s in c?i[u]=l:c[s]=l);for(u=0;u<d;++u)(l=c[s=p+a.call(t,o[u],u,o)])?(r[u]=l,l.__data__=o[u],c[s]=null):e[u]=new f(t,o[u]);for(u=0;u<h;++u)(l=n[u])&&c[v[u]]===l&&(i[u]=l)}function g(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function m(t){return function(){this.removeAttribute(t)}}function y(t){return function(){this.removeAttributeNS(t.space,t.local)}}function w(t,n){return function(){this.setAttribute(t,n)}}function _(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function b(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function x(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function M(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function N(t){return function(){this.style.removeProperty(t)}}function A(t,n,e){return function(){this.style.setProperty(t,n,e)}}function k(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function E(t,n){return t.style.getPropertyValue(n)||M(t).getComputedStyle(t,null).getPropertyValue(n)}function S(t){return function(){delete this[t]}}function C(t,n){return function(){this[t]=n}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function P(t){return t.trim().split(/^|\s+/)}function $(t){return t.classList||new T(t)}function T(t){this._node=t,this._names=P(t.getAttribute("class")||"")}function j(t,n){for(var e=$(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function H(t,n){for(var e=$(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function O(t){return function(){j(this,t)}}function z(t){return function(){H(this,t)}}function L(t,n){return function(){(n.apply(this,arguments)?j:H)(this,t)}}function X(){this.textContent=""}function D(t){return function(){this.textContent=t}}function B(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function R(){this.innerHTML=""}function I(t){return function(){this.innerHTML=t}}function V(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function Y(){this.nextSibling&&this.parentNode.appendChild(this)}function F(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U(){return null}function Z(){var t=this.parentNode;t&&t.removeChild(this)}function G(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function J(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}T.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var K={},Q=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(K={mouseenter:"mouseover",mouseleave:"mouseout"}));function W(t,n,e){return t=tt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function tt(t,n,e){return function(r){var i=Q;Q=r;try{t.call(this,this.__data__,n,e)}finally{Q=i}}}function nt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function et(t,n,e){var r=K.hasOwnProperty(t.type)?W:tt;return function(i,o,a){var u,l=this.__on,s=r(n,o,a);if(l)for(var c=0,h=l.length;c<h;++c)if((u=l[c]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=s,u.capture=e),void(u.value=n);this.addEventListener(t.type,s,e),u={type:t.type,name:t.name,value:n,listener:s,capture:e},l?l.push(u):this.__on=[u]}}function rt(t,n,e){var r=M(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function it(t,n){return function(){return rt(this,t,n)}}function ot(t,n){return function(){return rt(this,t,n.apply(this,arguments))}}var at=[null];function ut(t,n){this._groups=t,this._parents=n}function lt(){return new ut([[document.documentElement]],at)}function st(t){return"string"==typeof t?new ut([[document.querySelector(t)]],[document.documentElement]):new ut([[t]],at)}function ct(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function ht(t){return(t=ct(Math.abs(t)))?t[1]:NaN}ut.prototype=lt.prototype={constructor:ut,select:function(t){"function"!=typeof t&&(t=u(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,l=n[i],s=l.length,c=r[i]=new Array(s),h=0;h<s;++h)(o=l[h])&&(a=t.call(o,o.__data__,h,l))&&("__data__"in o&&(a.__data__=o.__data__),c[h]=a);return new ut(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=s(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],l=u.length,c=0;c<l;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new ut(r,i)},filter:function(t){"function"!=typeof t&&(t=c(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new ut(r,this._parents)},data:function(t,n){if(!t)return g=new Array(this.size()),c=-1,this.each((function(t){g[++c]=t})),g;var e,r=n?v:d,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),l=new Array(a),s=new Array(a),c=0;c<a;++c){var h=i[c],f=o[c],p=f.length,g=t.call(h,h&&h.__data__,c,i),m=g.length,y=l[c]=new Array(m),w=u[c]=new Array(m);r(h,f,y,w,s[c]=new Array(p),g,n);for(var _,b,x=0,M=0;x<m;++x)if(_=y[x]){for(x>=M&&(M=x+1);!(b=w[M])&&++M<m;);_._next=b||null}}return(u=new ut(u,i))._enter=l,u._exit=s,u},enter:function(){return new ut(this._enter||this._groups.map(h),this._parents)},exit:function(){return new ut(this._exit||this._groups.map(h),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var l,s=n[u],c=e[u],h=s.length,f=a[u]=new Array(h),p=0;p<h;++p)(l=s[p]||c[p])&&(f[p]=l);for(;u<r;++u)a[u]=n[u];return new ut(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=g);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],l=u.length,s=i[o]=new Array(l),c=0;c<l;++c)(a=u[c])&&(s[c]=a);s.sort(n)}return new ut(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var r=e(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==n?r.local?y:m:"function"==typeof n?r.local?x:b:r.local?_:w)(r,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?N:"function"==typeof n?k:A)(t,n,null==e?"":e)):E(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?S:"function"==typeof n?q:C)(t,n)):this.node()[t]},classed:function(t,n){var e=P(t+"");if(arguments.length<2){for(var r=$(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?L:n?O:z)(e,n))},text:function(t){return arguments.length?this.each(null==t?X:("function"==typeof t?B:D)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?R:("function"==typeof t?V:I)(t)):this.node().innerHTML},raise:function(){return this.each(Y)},lower:function(){return this.each(F)},append:function(t){var n="function"==typeof t?t:o(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:o(t),r=null==n?U:"function"==typeof n?n:u(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Z)},clone:function(t){return this.select(t?J:G)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?et:nt,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var l,s=0,c=u.length;s<c;++s)for(r=0,l=u[s];r<a;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,n){return this.each(("function"==typeof n?ot:it)(t,n))}};var ft,pt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dt(t){if(!(n=pt.exec(t)))throw new Error("invalid format: "+t);var n;return new vt({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function vt(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function gt(t,n){var e=ct(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}dt.prototype=vt.prototype,vt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var mt={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return gt(100*t,n)},r:gt,s:function(t,n){var e=ct(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ft=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ct(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function yt(t){return t}var wt,_t,bt,xt=Array.prototype.map,Mt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nt(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?yt:(n=xt.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),o.push(t.substring(i-=u,i+u)),!((l+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?yt:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(xt.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"-":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var n=(t=dt(t)).fill,e=t.align,h=t.sign,f=t.symbol,p=t.zero,d=t.width,v=t.comma,g=t.precision,m=t.trim,y=t.type;"n"===y?(v=!0,y="g"):mt[y]||(void 0===g&&(g=12),m=!0,y="g"),(p||"0"===n&&"="===e)&&(p=!0,n="0",e="=");var w="$"===f?i:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",_="$"===f?o:/[%p]/.test(y)?l:"",b=mt[y],x=/[defgprs%]/.test(y);function M(t){var i,o,l,f=w,M=_;if("c"===y)M=b(t)+M,t="";else{var N=(t=+t)<0;if(t=isNaN(t)?c:b(Math.abs(t),g),m&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),N&&0==+t&&(N=!1),f=(N?"("===h?h:s:"-"===h||"("===h?"":h)+f,M=("s"===y?Mt[8+ft/3]:"")+M+(N&&"("===h?")":""),x)for(i=-1,o=t.length;++i<o;)if(48>(l=t.charCodeAt(i))||l>57){M=(46===l?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}v&&!p&&(t=r(t,1/0));var A=f.length+t.length+M.length,k=A<d?new Array(d-A+1).join(n):"";switch(v&&p&&(t=r(k+t,k.length?d-M.length:1/0),k=""),e){case"<":t=f+t+M+k;break;case"=":t=f+k+t+M;break;case"^":t=k.slice(0,A=k.length>>1)+f+t+M+k.slice(A);break;default:t=k+f+t+M}return u(t)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),M.toString=function(){return t+""},M}return{format:h,formatPrefix:function(t,n){var e=h(((t=dt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ht(n)/3))),i=Math.pow(10,-r),o=Mt[8+r/3];return function(t){return e(i*t)+o}}}}function At(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}wt=Nt({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),_t=wt.format,bt=wt.formatPrefix;var kt,Et,St=(1===(kt=At).length&&(Et=kt,kt=function(t,n){return At(Et(t),n)}),{left:function(t,n,e,r){for(null==e&&(e=0),null==r&&(r=t.length);e<r;){var i=e+r>>>1;kt(t[i],n)<0?e=i+1:r=i}return e},right:function(t,n,e,r){for(null==e&&(e=0),null==r&&(r=t.length);e<r;){var i=e+r>>>1;kt(t[i],n)>0?r=i:e=i+1}return e}}).right,Ct=Math.sqrt(50),qt=Math.sqrt(10),Pt=Math.sqrt(2);function $t(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=Ct?10:o>=qt?5:o>=Pt?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Ct?10:o>=qt?5:o>=Pt?2:1)}function Tt(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function jt(t,n){var e,r,i,o,a,u=new Lt(t),l=+t.value&&(u.value=t.value),s=[u];for(null==n&&(n=Ht);e=s.pop();)if(l&&(e.value=+e.data.value),(i=n(e.data))&&(a=i.length))for(e.children=new Array(a),o=a-1;o>=0;--o)s.push(r=e.children[o]=new Lt(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(zt)}function Ht(t){return t.children}function Ot(t){t.data=t.data.data}function zt(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Lt(t){this.data=t,this.depth=this.height=0,this.parent=null}function Xt(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Dt(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&function(t,n,e,r,i){for(var o,a=t.children,u=-1,l=a.length,s=t.value&&(r-n)/t.value;++u<l;)(o=a[u]).y0=e,o.y1=i,o.x0=n,o.x1=n+=o.value*s}(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a<i&&(i=a=(i+a)/2),u<o&&(o=u=(o+u)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=u}}(n,o)),r&&i.eachBefore(Xt),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(t){return arguments.length?(e=+t,i):e},i}function Bt(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}Lt.prototype=jt.prototype={constructor:Lt,count:function(){return this.eachAfter(Tt)},each:function(t){var n,e,r,i,o=this,a=[o];do{for(n=a.reverse(),a=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r<i;++r)a.push(e[r])}while(a.length);return this},eachAfter:function(t){for(var n,e,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),n=i.children)for(e=0,r=n.length;e<r;++e)o.push(n[e]);for(;i=a.pop();)t(i);return this},eachBefore:function(t){for(var n,e,r=this,i=[r];r=i.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;t=e.pop(),n=r.pop();for(;t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return jt(this).eachBefore(Ot)}};function Rt(){}function It(t,n){var e=new Rt;if(t instanceof Rt)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var a in t)e.set(a,t[a]);return e}function Vt(){}Rt.prototype=It.prototype={constructor:Rt,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var Yt=It.prototype;Vt.prototype=function(t,n){var e=new Vt;if(t instanceof Vt)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}.prototype={constructor:Vt,has:Yt.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Yt.remove,clear:Yt.clear,values:Yt.keys,size:Yt.size,empty:Yt.empty,each:Yt.each};var Ft=Array.prototype,Ut=Ft.map,Zt=Ft.slice;function Gt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Jt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Kt(){}var Qt="\\s*([+-]?\\d+)\\s*",Wt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nn=/^#([0-9a-f]{3,8})$/,en=new RegExp("^rgb\\("+[Qt,Qt,Qt]+"\\)$"),rn=new RegExp("^rgb\\("+[tn,tn,tn]+"\\)$"),on=new RegExp("^rgba\\("+[Qt,Qt,Qt,Wt]+"\\)$"),an=new RegExp("^rgba\\("+[tn,tn,tn,Wt]+"\\)$"),un=new RegExp("^hsl\\("+[Wt,tn,tn]+"\\)$"),ln=new RegExp("^hsla\\("+[Wt,tn,tn,Wt]+"\\)$"),sn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function cn(){return this.rgb().formatHex()}function hn(){return this.rgb().formatRgb()}function fn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=nn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?pn(n):3===e?new gn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?new gn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?new gn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=en.exec(t))?new gn(n[1],n[2],n[3],1):(n=rn.exec(t))?new gn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=on.exec(t))?dn(n[1],n[2],n[3],n[4]):(n=an.exec(t))?dn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=un.exec(t))?_n(n[1],n[2]/100,n[3]/100,1):(n=ln.exec(t))?_n(n[1],n[2]/100,n[3]/100,n[4]):sn.hasOwnProperty(t)?pn(sn[t]):"transparent"===t?new gn(NaN,NaN,NaN,0):null}function pn(t){return new gn(t>>16&255,t>>8&255,255&t,1)}function dn(t,n,e,r){return r<=0&&(t=n=e=NaN),new gn(t,n,e,r)}function vn(t,n,e,r){return 1===arguments.length?((i=t)instanceof Kt||(i=fn(i)),i?new gn((i=i.rgb()).r,i.g,i.b,i.opacity):new gn):new gn(t,n,e,null==r?1:r);var i}function gn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function mn(){return"#"+wn(this.r)+wn(this.g)+wn(this.b)}function yn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function wn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function _n(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new xn(t,n,e,r)}function bn(t){if(t instanceof xn)return new xn(t.h,t.s,t.l,t.opacity);if(t instanceof Kt||(t=fn(t)),!t)return new xn;if(t instanceof xn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,l=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=l<.5?o+i:2-o-i,a*=60):u=l>0&&l<1?0:a,new xn(a,u,l,t.opacity)}function xn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Mn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Nn(t){return function(){return t}}function An(t){return 1==(t=+t)?kn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Nn(isNaN(n)?e:n)}}function kn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Nn(isNaN(t)?n:t)}Gt(Kt,fn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:cn,formatHex:cn,formatHsl:function(){return bn(this).formatHsl()},formatRgb:hn,toString:hn}),Gt(gn,vn,Jt(Kt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new gn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new gn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mn,formatHex:mn,formatRgb:yn,toString:yn})),Gt(xn,(function(t,n,e,r){return 1===arguments.length?bn(t):new xn(t,n,e,null==r?1:r)}),Jt(Kt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new gn(Mn(t>=240?t-240:t+120,i,r),Mn(t,i,r),Mn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var En=function t(n){var e=An(n);function r(t,n){var r=e((t=vn(t)).r,(n=vn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=kn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Sn(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(e=0;e<i;++e)o[e]=Hn(t[e],n[e]);for(;e<r;++e)a[e]=n[e];return function(t){for(e=0;e<i;++e)a[e]=o[e](t);return a}}function Cn(t,n){var e=new Date;return n-=t=+t,function(r){return e.setTime(t+n*r),e}}function qn(t,n){return n-=t=+t,function(e){return t+n*e}}function Pn(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=Hn(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tn=new RegExp($n.source,"g");function jn(t,n){var e,r,i,o=$n.lastIndex=Tn.lastIndex=0,a=-1,u=[],l=[];for(t+="",n+="";(e=$n.exec(t))&&(r=Tn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,l.push({i:a,x:qn(e,r)})),o=Tn.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?l[0]?function(t){return function(n){return t(n)+""}}(l[0].x):function(t){return function(){return t}}(n):(n=l.length,function(t){for(var e,r=0;r<n;++r)u[(e=l[r]).i]=e.x(t);return u.join("")})}function Hn(t,n){var e,r=typeof n;return null==n||"boolean"===r?Nn(n):("number"===r?qn:"string"===r?(e=fn(n))?(n=e,En):jn:n instanceof fn?En:n instanceof Date?Cn:Array.isArray(n)?Sn:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?Pn:qn)(t,n)}function On(t,n){return n-=t=+t,function(e){return Math.round(t+n*e)}}var zn,Ln,Xn,Dn,Bn=180/Math.PI,Rn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function In(t,n,e,r,i,o){var a,u,l;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(l=t*e+n*r)&&(e-=t*l,r-=n*l),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,l/=u),t*r<n*e&&(t=-t,n=-n,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Bn,skewX:Math.atan(l)*Bn,scaleX:a,scaleY:u}}function Vn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],l=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var l=a.push("translate(",null,n,null,e);u.push({i:l-4,x:qn(t,i)},{i:l-2,x:qn(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,u,l),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:qn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,l),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:qn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,l),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:qn(t,e)},{i:u-2,x:qn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,l),o=a=null,function(t){for(var n,e=-1,r=l.length;++e<r;)u[(n=l[e]).i]=n.x(t);return u.join("")}}}var Yn=Vn((function(t){return"none"===t?Rn:(zn||(zn=document.createElement("DIV"),Ln=document.documentElement,Xn=document.defaultView),zn.style.transform=t,t=Xn.getComputedStyle(Ln.appendChild(zn),null).getPropertyValue("transform"),Ln.removeChild(zn),In(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Fn=Vn((function(t){return null==t?Rn:(Dn||(Dn=document.createElementNS("http://www.w3.org/2000/svg","g")),Dn.setAttribute("transform",t),(t=Dn.transform.baseVal.consolidate())?In((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Rn)}),", ",")",")");function Un(t){return+t}var Zn=[0,1];function Gn(t){return t}function Jn(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:(e=isNaN(n)?NaN:.5,function(){return e});var e}function Kn(t){var n,e=t[0],r=t[t.length-1];return e>r&&(n=e,e=r,r=n),function(t){return Math.max(e,Math.min(r,t))}}function Qn(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i<r?(r=Jn(i,r),o=e(a,o)):(r=Jn(r,i),o=e(o,a)),function(t){return o(r(t))}}function Wn(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<r;)i[a]=Jn(t[a],t[a+1]),o[a]=e(n[a],n[a+1]);return function(n){var e=St(t,n,1,r)-1;return o[e](i[e](n))}}function te(t,n){return function(){var t,n,e,r,i,o,a=Zn,u=Zn,l=Hn,s=Gn;function c(){return r=Math.min(a.length,u.length)>2?Wn:Qn,i=o=null,h}function h(n){return isNaN(n=+n)?e:(i||(i=r(a.map(t),u,l)))(t(s(n)))}return h.invert=function(e){return s(n((o||(o=r(u,a.map(t),qn)))(e)))},h.domain=function(t){return arguments.length?(a=Ut.call(t,Un),s===Gn||(s=Kn(a)),c()):a.slice()},h.range=function(t){return arguments.length?(u=Zt.call(t),c()):u.slice()},h.rangeRound=function(t){return u=Zt.call(t),l=On,c()},h.clamp=function(t){return arguments.length?(s=t?Kn(a):Gn,h):s!==Gn},h.interpolate=function(t){return arguments.length?(l=t,c()):l},h.unknown=function(t){return arguments.length?(e=t,h):e},function(e,r){return t=e,n=r,c()}}()(t,n)}function ne(t,n,e,r){var i,o=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Ct?i*=10:o>=qt?i*=5:o>=Pt&&(i*=2),n<t?-i:i}(t,n,e);switch((r=dt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(n));return null!=r.precision||isNaN(i=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ht(n)/3)))-ht(Math.abs(t)))}(o,a))||(r.precision=i),bt(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ht(n)-ht(t))+1}(o,Math.max(Math.abs(t),Math.abs(n))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-ht(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return _t(r)}function ee(t){var n=t.domain;return t.ticks=function(t){var e=n();return function(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)===(n=+n)&&e>0)return[t];if((r=n<t)&&(i=t,t=n,n=i),0===(a=$t(t,n,e))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u<i;)o[u]=(t+u)*a;else for(t=Math.floor(t*a),n=Math.ceil(n*a),o=new Array(i=Math.ceil(t-n+1));++u<i;)o[u]=(t-u)/a;return r&&o.reverse(),o}(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return ne(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],l=i[a];return l<u&&(r=u,u=l,l=r,r=o,o=a,a=r),(r=$t(u,l,e))>0?r=$t(u=Math.floor(u/r)*r,l=Math.ceil(l/r)*r,e):r<0&&(r=$t(u=Math.ceil(u*r)/r,l=Math.floor(l*r)/r,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(l/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(l*r)/r,n(i)),t},t}function re(){var t=te(Gn,Gn);return t.copy=function(){return n=t,re().domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());var n},Bt.apply(t,arguments),ee(t)}function ie(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var oe={value:function(){}};function ae(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new ue(r)}function ue(t){this._=t}function le(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function se(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function ce(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=oe,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}ue.prototype=ae.prototype={constructor:ue,on:function(t,n){var e,r=this._,i=le(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=ce(r[e],t.name,n);else if(null==n)for(e in r)r[e]=ce(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=se(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new ue(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var he,fe,pe=0,de=0,ve=0,ge=1e3,me=0,ye=0,we=0,_e="object"==typeof performance&&performance.now?performance:Date,be="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function xe(){return ye||(be(Me),ye=_e.now()+we)}function Me(){ye=0}function Ne(){this._call=this._time=this._next=null}function Ae(t,n,e){var r=new Ne;return r.restart(t,n,e),r}function ke(){ye=(me=_e.now())+we,pe=de=0;try{!function(){xe(),++pe;for(var t,n=he;n;)(t=ye-n._time)>=0&&n._call.call(null,t),n=n._next;--pe}()}finally{pe=0,function(){var t,n,e=he,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:he=n);fe=t,Se(r)}(),ye=0}}function Ee(){var t=_e.now(),n=t-me;n>ge&&(we-=n,me=t)}function Se(t){pe||(de&&(de=clearTimeout(de)),t-ye>24?(t<1/0&&(de=setTimeout(ke,t-_e.now()-we)),ve&&(ve=clearInterval(ve))):(ve||(me=_e.now(),ve=setInterval(Ee,ge)),pe=1,be(ke)))}function Ce(t,n,e){var r=new Ne;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Ne.prototype=Ae.prototype={constructor:Ne,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?xe():+e)+(null==n?0:+n),this._next||fe===this||(fe?fe._next=this:he=this,fe=this),this._call=t,this._time=e,Se()},stop:function(){this._call&&(this._call=null,this._time=1/0,Se())}};var qe=ae("start","end","cancel","interrupt"),Pe=[],$e=0,Te=1,je=2,He=3,Oe=4,ze=5,Le=6;function Xe(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(l){var s,c,h,f;if(e.state!==Te)return u();for(s in i)if((f=i[s]).name===e.name){if(f.state===He)return Ce(o);f.state===Oe?(f.state=Le,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[s]):+s<n&&(f.state=Le,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[s])}if(Ce((function(){e.state===He&&(e.state=Oe,e.timer.restart(a,e.delay,e.time),a(l))})),e.state=je,e.on.call("start",t,t.__data__,e.index,e.group),e.state===je){for(e.state=He,r=new Array(h=e.tween.length),s=0,c=-1;s<h;++s)(f=e.tween[s].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=f);r.length=c+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=ze,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);e.state===ze&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){for(var r in e.state=Le,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Ae((function(t){e.state=Te,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:i,on:qe,tween:Pe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:$e})}function De(t,n){var e=Re(t,n);if(e.state>$e)throw new Error("too late; already scheduled");return e}function Be(t,n){var e=Re(t,n);if(e.state>He)throw new Error("too late; already running");return e}function Re(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ie(t,n){var e,r;return function(){var i=Be(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a<u;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}i.tween=r}}function Ve(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Be(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:n,value:e},l=0,s=i.length;l<s;++l)if(i[l].name===n){i[l]=u;break}l===s&&i.push(u)}o.tween=i}}function Ye(t,n,e){var r=t._id;return t.each((function(){var t=Be(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Re(t,r).value[n]}}function Fe(t,n){var e;return("number"==typeof n?qn:n instanceof fn?En:(e=fn(n))?(n=e,En):jn)(t,n)}function Ue(t){return function(){this.removeAttribute(t)}}function Ze(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ge(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=n(r=a,e)}}function Je(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=n(r=a,e)}}function Ke(t,n,e){var r,i,o;return function(){var a,u,l=e(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,l));this.removeAttribute(t)}}function Qe(t,n,e){var r,i,o;return function(){var a,u,l=e(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,l));this.removeAttributeNS(t.space,t.local)}}function We(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n(e))}}(t,i)),e}return i._value=n,i}function tr(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n(e))}}(t,i)),e}return i._value=n,i}function nr(t,n){return function(){De(this,t).delay=+n.apply(this,arguments)}}function er(t,n){return n=+n,function(){De(this,t).delay=n}}function rr(t,n){return function(){Be(this,t).duration=+n.apply(this,arguments)}}function ir(t,n){return n=+n,function(){Be(this,t).duration=n}}var or=lt.prototype.constructor;function ar(t){return function(){this.style.removeProperty(t)}}var ur=0;function lr(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function sr(){return++ur}var cr=lt.prototype;lr.prototype=function(t){return lt().transition(t)}.prototype={constructor:lr,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=u(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var l,s,c=r[a],h=c.length,f=o[a]=new Array(h),p=0;p<h;++p)(l=c[p])&&(s=t.call(l,l.__data__,p,c))&&("__data__"in l&&(s.__data__=l.__data__),f[p]=s,Xe(f[p],n,e,p,f,Re(l,e)));return new lr(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=s(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var l,c=r[u],h=c.length,f=0;f<h;++f)if(l=c[f]){for(var p,d=t.call(l,l.__data__,f,c),v=Re(l,e),g=0,m=d.length;g<m;++g)(p=d[g])&&Xe(p,n,e,g,d,v);o.push(d),a.push(l)}return new lr(o,a,n,e)},filter:function(t){"function"!=typeof t&&(t=c(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new lr(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var l,s=n[u],c=e[u],h=s.length,f=a[u]=new Array(h),p=0;p<h;++p)(l=s[p]||c[p])&&(f[p]=l);for(;u<r;++u)a[u]=n[u];return new lr(a,this._parents,this._name,this._id)},selection:function(){return new or(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=sr(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)if(a=u[s]){var c=Re(a,n);Xe(a,t,e,s,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new lr(r,this._parents,t,e)},call:cr.call,nodes:cr.nodes,node:cr.node,size:cr.size,empty:cr.empty,each:cr.each,on:function(t,n){var e=this._id;return arguments.length<2?Re(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?De:Be;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var r=e(t),i="transform"===r?Fn:Fe;return this.attrTween(t,"function"==typeof n?(r.local?Qe:Ke)(r,i,Ye(this,"attr."+t,n)):null==n?(r.local?Ze:Ue)(r):(r.local?Je:Ge)(r,i,n))},attrTween:function(t,n){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;var i=e(t);return this.tween(r,(i.local?We:tr)(i,n))},style:function(t,n,e){var r="transform"==(t+="")?Yn:Fe;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=E(this,t),a=(this.style.removeProperty(t),E(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,ar(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=E(this,t),u=e(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=E(this,t)),a===l?null:a===r&&l===i?o:(i=l,o=n(r=a,u))}}(t,r,Ye(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var l=Be(this,t),s=l.on,c=null==l.value[a]?o||(o=ar(n)):void 0;s===e&&i===c||(r=(e=s).copy()).on(u,i=c),l.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=E(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n(r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Re(this.node(),e).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Ie:Ve)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?nr:er)(n,t)):Re(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?rr:ir)(n,t)):Re(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){Be(this,t).ease=n}}(n,t)):Re(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,a){var u={value:a},l={value:function(){0==--i&&o()}};e.each((function(){var e=Be(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(l)),e.on=n}))}))}};var hr={time:null,delay:0,duration:250,ease:ie};function fr(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return hr.time=xe(),hr;return e}function pr(t){return t.data.name}return lt.prototype.interrupt=function(t){return this.each((function(){!function(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>je&&e.state<ze,e.state=Le,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}(this,t)}))},lt.prototype.transition=function(t){var n,e;t instanceof lr?(n=t._id,t=t._name):(n=sr(),(e=hr).time=xe(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)(a=u[s])&&Xe(a,t,n,s,u,e||fr(a,n));return new lr(r,this._parents,t,n)},function(){var t=960,n=null,e=18,r=null,i=!0,o="",a=750,u=ie,l=!1,s=!1,c=null,h=0,f=null,p=!1,d=!1,v=!1,g=0,m=0,y=0,w=!1,_=!1,b=null,x=function(t){return t.data.n||t.data.name},M=function(t){return"v"in t?t.v:t.value},N=function(t){return t.c||t.children},A=function(t){return t.data.l||t.data.libtype},k=function(t){return"d"in t.data?t.data.d:t.data.delta},E=function(){f&&O()},S=E;let C=(t,n)=>{if(!n)return!1;const e=new RegExp(n),r=x(t);return void 0!==r&&r&&r.match(e)};const q=C;var P,$=function(t){f&&(t?f.innerHTML=t:g?O():f.innerHTML="")},T=$,j=function(t){return x(t)+" ("+_t(".3f")(100*(t.x1-t.x0),3)+"%, "+M(t)+" samples)"},H=function(){var t=st("body"),n=null,e=pr;function r(){n=t.append("div").style("display","none").style("position","absolute").style("opacity",0).style("pointer-events","none").attr("class","d3-flame-graph-tip")}return r.show=function(t){return n.style("display","block").transition().duration(200).style("opacity",1).style("pointer-events","all"),n.html(e(t)).style("left",Q.pageX+"px").style("top",Q.pageY+"px"),r},r.hide=function(){return n.style("display","none").transition().duration(200).style("opacity",0).style("pointer-events","none"),r},r.html=function(t){return arguments.length?(e=t,r):e},r}().html((function(t){return j(t)}));function O(){f.innerHTML=g+" of "+m+" samples ( "+_t(".3f")(g/m*100,3)+"%)"}var z=function(t){return t.highlight?"#E600E6":function(t,n,e){var r,i,o;if(d)r=220,i=220,o=220,e||(e=0),e>0?(o=Math.round(210*(y-e)/y),i=o):e<0&&(r=Math.round(210*(y+e)/y),i=r);else{var a=v?"cold":"warm";v||void 0===n||""===n||(a="red",void 0!==t&&t&&t.match(/::/)&&(a="yellow"),"kernel"===n?a="orange":"jit"===n?a="green":"inlined"===n&&(a="aqua"));var u=0;if(t){var l=t.split("`");l.length>1&&(t=l[l.length-1]),t=t.split("(")[0],u=function(t){var n=0,e=0,r=1;if(t){for(var i=0;i<t.length&&!(i>6);i++)n+=r*(t.charCodeAt(i)%10),e+=9*r,r*=.7;e>0&&(n/=e)}return n}(t)}"red"===a?(r=200+Math.round(55*u),i=50+Math.round(80*u),o=i):"orange"===a?(r=190+Math.round(65*u),i=90+Math.round(65*u),o=0):"yellow"===a?(r=175+Math.round(55*u),i=r,o=50+Math.round(20*u)):"green"===a?(r=50+Math.round(60*u),i=200+Math.round(55*u),o=r):"aqua"===a?(r=50+Math.round(60*u),i=165+Math.round(55*u),o=i):"cold"===a?(r=0+Math.round(55*(1-u)),i=0+Math.round(230*(1-u)),o=200+Math.round(55*u)):(r=200+Math.round(55*u),i=0+Math.round(230*(1-u)),o=0+Math.round(55*(1-u)))}return"rgb("+r+","+i+","+o+")"}(x(t),A(t),k(t))},L=z;function X(t){t.data.fade=!1,t.data.hide=!1,t.children&&t.children.forEach(X)}function D(t){if(H.hide(),function(t){let n,e,r,i=t,o=i.parent;for(;o;){for(e=(n=o.children).length;e--;)(r=n[e])!==i&&(r.data.hide=!0);o=(i=o).parent}}(t),X(t),function t(n){n.parent&&(n.parent.data.fade=!0,t(n.parent))}(t),I(),_){const n=P._groups[0][0].parentNode.offsetTop,r=(window.innerHeight-n)/e,i=(t.height-r+10)*e;window.scrollTo({top:n+i,left:0,behavior:"smooth"})}"function"==typeof c&&c(t)}function B(t,n){return"function"==typeof l?l(t,n):l?At(x(t),x(n)):void 0}var R=Dt();function I(){r.each((function(r){var o=re().range([0,t]),c=re().range([0,e]);!function(t){let n,e,r,i,o,a,u,l;const s=[],c=[],h=[],f=!p;let d=t.data;d.hide?(t.value=0,(e=t.children)&&h.push(e)):(t.value=d.fade?0:M(d),s.push(t));for(;n=s.pop();)if((e=n.children)&&(o=e.length)){for(i=0;o--;)u=e[o],(d=u.data).hide?(u.value=0,(r=u.children)&&h.push(r)):(d.fade?u.value=0:(l=M(d),u.value=l,i+=l),s.push(u));f&&n.value&&(n.value-=i),c.push(e)}o=c.length;for(;o--;){for(e=c[o],i=0,a=e.length;a--;)i+=e[a].value;e[0].parent.value+=i}for(;h.length;)for(e=h.pop(),a=e.length;a--;)(u=e[a]).value=0,(r=u.children)&&h.push(r)}(r),m=r.value,l&&r.sort(B),R(r);var f=t/(r.x1-r.x0);function d(t){return(t.x1-t.x0)*f}var v=function(n){var e=n.descendants();if(h>0){var r=t/(n.x1-n.x0);e=e.filter((function(t){return(t.x1-t.x0)*r>h}))}return e}(r),g=st(this).select("svg").selectAll("g").data(v,(function(t){return t.id}));if(!n||w){var y=Math.max.apply(null,v.map((function(t){return t.depth})));(n=(y+3)*e)<b&&(n=b),st(this).select("svg").attr("height",n)}g.transition().duration(a).ease(u).attr("transform",(function(t){return"translate("+o(t.x0)+","+(s?c(t.depth):n-c(t.depth)-e)+")"})),g.select("rect").transition().duration(a).ease(u).attr("width",d);var _=g.enter().append("svg:g").attr("transform",(function(t){return"translate("+o(t.x0)+","+(s?c(t.depth):n-c(t.depth)-e)+")"}));_.append("svg:rect").transition().delay(a/2).attr("width",d),i||_.append("svg:title"),_.append("foreignObject").append("xhtml:div"),(g=st(this).select("svg").selectAll("g").data(v,(function(t){return t.id}))).attr("width",d).attr("height",(function(t){return e})).attr("name",(function(t){return x(t)})).attr("class",(function(t){return t.data.fade?"frame fade":"frame"})),g.select("rect").attr("height",(function(t){return e})).attr("fill",(function(t){return z(t)})),i||g.select("title").text(j),g.select("foreignObject").attr("width",d).attr("height",(function(t){return e})).select("div").attr("class","d3-flame-graph-label").style("display",(function(t){return d(t)<35?"none":"block"})).transition().delay(a).text(x),g.on("click",D),g.exit().remove(),g.on("mouseover",(function(t){i&&H.show(t),$(j(t))})).on("mouseout",(function(){i&&H.hide(),$(null)}))}))}function V(t){y=0;let n=0,e=0;const r=d;!function(t,n){n(t);let e=t.children;if(e){const t=[e];let r,i,o;for(;t.length;)for(r=(e=t.pop()).length;r--;)n(i=e[r]),(o=i.children)&&t.push(o)}}(t,(function(t){t.id=n++,r&&(e=Math.abs(k(t)),y<e&&(y=e))}))}function Y(e){const i=jt(e.datum(),N);if(V(i),r=e.datum(i),!arguments.length)return Y;r.each((function(e){P||(P=st(this).append("svg:svg").attr("width",t).attr("class","partition d3-flame-graph").call(H),n&&(n<b&&(n=b),P.attr("height",n)),P.append("svg:text").attr("class","title").attr("text-anchor","middle").attr("y","25").attr("x",t/2).attr("fill","#808080").text(o))})),I()}return Y.height=function(t){return arguments.length?(n=t,Y):n},Y.minHeight=function(t){return arguments.length?(b=t,Y):b},Y.width=function(n){return arguments.length?(t=n,Y):t},Y.cellHeight=function(t){return arguments.length?(e=t,Y):e},Y.tooltip=function(t){return arguments.length?("function"==typeof t&&(H=t),i=!!t,Y):i},Y.title=function(t){return arguments.length?(o=t,Y):o},Y.transitionDuration=function(t){return arguments.length?(a=t,Y):a},Y.transitionEase=function(t){return arguments.length?(u=t,Y):u},Y.sort=function(t){return arguments.length?(l=t,Y):l},Y.inverted=function(t){return arguments.length?(s=t,Y):s},Y.differential=function(t){return arguments.length?(d=t,Y):d},Y.elided=function(t){return arguments.length?(v=t,Y):v},Y.setLabelHandler=function(t){return arguments.length?(j=t,Y):j},Y.label=Y.setLabelHandler,Y.search=function(t){r.each((function(n){!function(t,n){var e=[],r=0;!function t(i,o){var a=!1;C(i,n)?(i.highlight=!0,a=!0,o||(r+=M(i)),e.push(i)):i.highlight=!1,N(i)&&N(i).forEach((function(n){t(n,o||a)}))}(t,!1),g=r,E(e,r,m)}(n,t),I()}))},Y.findById=function(t){if(null==t)return null;let n=null;return r.each((function(e){null===n&&(n=function t(n,e){if(n.id===e)return n;var r=N(n);if(r)for(var i=0;i<r.length;i++){var o=t(r[i],e);if(o)return o}}(e,t))})),n},Y.clear=function(){g=0,$(null),r.each((function(t){!function t(n){n.highlight=!1,N(n)&&N(n).forEach((function(n){t(n)}))}(t),I()}))},Y.zoomTo=function(t){D(t)},Y.resetZoom=function(){r.each((function(t){D(t)}))},Y.onClick=function(t){return arguments.length?(c=t,Y):c},Y.merge=function(t){return r?(r.each((function(e){!function t(n,e){e.forEach((function(e){var r=n.find((function(t){return t.name===e.name}));r?(r.original?r.original+=e.value:r.value+=e.value,e.children&&(r.children||(r.children=[]),t(r.children,e.children))):n.push(e)}))}([e.data],[t]),V(n=jt(e.data,N))})),r=r.datum(n),I(),Y):Y;var n},Y.update=function(t){return r?(r.each((function(e){e.data=t,V(n=jt(e.data,N))})),r=r.datum(n),I(),Y):Y;var n},Y.destroy=function(){return r?(i&&H.hide(),r.selectAll("svg").remove(),Y):Y},Y.setColorMapper=function(t){return arguments.length?(z=n=>{const e=L(n);return t(n,e)},Y):(z=L,Y)},Y.color=Y.setColorMapper,Y.minFrameSize=function(t){return arguments.length?(h=t,Y):h},Y.setDetailsElement=function(t){return arguments.length?(f=t,Y):f},Y.details=Y.setDetailsElement,Y.selfValue=function(t){return arguments.length?(p=t,Y):p},Y.resetHeightOnZoom=function(t){return arguments.length?(w=t,Y):w},Y.scrollOnZoom=function(t){return arguments.length?(_=t,Y):_},Y.getName=function(t){return arguments.length?(x=t,Y):x},Y.getValue=function(t){return arguments.length?(M=t,Y):M},Y.getChildren=function(t){return arguments.length?(N=t,Y):N},Y.getLibtype=function(t){return arguments.length?(A=t,Y):A},Y.getDelta=function(t){return arguments.length?(k=t,Y):k},Y.setSearchHandler=function(t){return arguments.length?(E=t,Y):(E=S,Y)},Y.setDetailsHandler=function(t){return arguments.length?($=t,Y):($=T,Y)},Y.setSearchMatch=function(t){return arguments.length?(C=t,Y):(C=q,Y)},Y}})); |
{ | ||
"name": "d3-flame-graph", | ||
"version": "2.1.9", | ||
"version": "2.1.10", | ||
"description": "A d3.js library to produce flame graphs.", | ||
@@ -59,5 +59,4 @@ "main": "index.js", | ||
"d3-selection": "^1.4.0", | ||
"d3-tip": "0.9.1", | ||
"d3-transition": "^1.2.0" | ||
} | ||
} |
@@ -140,4 +140,8 @@ # d3-flame-graph | ||
Graph height in px. Defaults to the number of cell rows times <a name="cellHeight" href="#cellHeight"><b>cellHeight</b></a> if not set. If <i>size</i> is specified, it will set the cell height, otherwise it will return the current graph height. | ||
Graph height in px. Defaults to the number of cell rows times <a name="cellHeight" href="#cellHeight"><b>cellHeight</b></a> if not set. If <i>size</i> is specified, it will set the cell height, otherwise it will return the current graph height. If <a name="minHeight" href="#minHeight"><b>minHeight</b></a> is specified, and higher than the provided or calculated values, it will override height. | ||
<a name="minHeight" href="#minHeight">#</a> flamegraph.<b>minHeight</b>(<i>[size]</i>) | ||
Minumum graph height in px. If <i>size</i> is specified, and higher than the provided or calculated <i>height</i>, it will override it. | ||
<a name="cellHeight" href="#cellHeight">#</a> flamegraph.<b>cellHeight</b>(<i>[size]</i>) | ||
@@ -144,0 +148,0 @@ |
@@ -7,4 +7,4 @@ import { select } from 'd3-selection' | ||
import { easeCubic } from 'd3-ease' | ||
import d3Tip from 'd3-tip' | ||
import 'd3-transition' | ||
import flamegraphTooltip from './flamegraphTooltip' | ||
@@ -33,2 +33,3 @@ export default function () { | ||
var scrollOnZoom = false | ||
var minHeight = null | ||
@@ -69,2 +70,5 @@ var getName = function (d) { | ||
let searchMatch = (d, term) => { | ||
if (!term) { | ||
return false | ||
} | ||
const re = new RegExp(term) | ||
@@ -95,6 +99,3 @@ const label = getName(d) | ||
var tip = d3Tip() | ||
.direction('s') | ||
.offset([8, 0]) | ||
.attr('class', 'd3-flame-graph-tip') | ||
var tip = flamegraphTooltip() | ||
.html(function (d) { return labelHandler(d) }) | ||
@@ -261,3 +262,3 @@ | ||
function zoom (d) { | ||
tip.hide(d) | ||
tip.hide() | ||
hideSiblings(d) | ||
@@ -380,3 +381,6 @@ show(d) | ||
var maxDepth = Math.max.apply(null, descendants.map(function (n) { return n.depth })) | ||
h = (maxDepth + 3) * c | ||
if (h < minHeight) h = minHeight | ||
select(this).select('svg').attr('height', h) | ||
@@ -443,6 +447,6 @@ } | ||
g.on('mouseover', function (d) { | ||
if (tooltip) tip.show(d, this) | ||
if (tooltip) tip.show(d) | ||
detailsHandler(labelHandler(d)) | ||
}).on('mouseout', function (d) { | ||
if (tooltip) tip.hide(d) | ||
}).on('mouseout', function () { | ||
if (tooltip) tip.hide() | ||
detailsHandler(null) | ||
@@ -607,6 +611,10 @@ }) | ||
.attr('width', w) | ||
.attr('height', h || (root.height + 3) * c) | ||
.attr('class', 'partition d3-flame-graph') | ||
.call(tip) | ||
if (h) { | ||
if (h < minHeight) h = minHeight | ||
svg.attr('height', h) | ||
} | ||
svg.append('svg:text') | ||
@@ -632,2 +640,8 @@ .attr('class', 'title') | ||
chart.minHeight = function (_) { | ||
if (!arguments.length) { return minHeight } | ||
minHeight = _ | ||
return chart | ||
} | ||
chart.width = function (_) { | ||
@@ -634,0 +648,0 @@ if (!arguments.length) { return w } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
385297
7
18
5835
357
- Removedd3-tip@0.9.1
- Removedd3-tip@0.9.1(transitive)