text: var vega=function(e,n,r){"use strict";function t(e,n,r){const t={};return e.each(e=>{const i=e.data;r(i)&&(t[n(i)]=e)}),e.lookup=t,e}function i(e,n){return e.parent===n.parent?1:2}function a(e,n){return e+n.x}function o(e,n){return Math.max(e,n.y)}function u(e){var n=0,r=e.children,t=r&&r.length;if(t)for(;--t>=0;)n+=r[t].value;else n=1;e.value=n}function f(e,n){e instanceof Map?(e=[void 0,e],void 0===n&&(n=l)):void 0===n&&(n=c);for(var r,t,i,a,o,u=new d(e),f=[u];r=f.pop();)if((i=n(r.data))&&(o=(i=Array.from(i)).length))for(r.children=i,a=o-1;a>=0;--a)f.push(t=i[a]=new d(i[a])),t.parent=r,t.depth=r.depth+1;return u.eachBefore(s)}function c(e){return e.children}function l(e){return Array.isArray(e)?e[1]:null}function h(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function s(e){var n=0;do{e.height=n}while((e=e.parent)&&e.height<++n)}function d(e){this.data=e,this.depth=this.height=0,this.parent=null}function p(e){for(var n,r,t=0,i=(e=function(e){for(var n,r,t=e.length;t;)r=Math.random()*t--|0,n=e[t],e[t]=e[r],e[r]=n;return e}(Array.from(e))).length,a=[];t<i;)n=e[t],r&&g(r,n)?++t:(r=x(a=y(a,n)),t=0);return r}function y(e,n){var r,t;if(v(n,e))return[n];for(r=0;r<e.length;++r)if(m(n,e[r])&&v(w(e[r],n),e))return[e[r],n];for(r=0;r<e.length-1;++r)for(t=r+1;t<e.length;++t)if(m(w(e[r],e[t]),n)&&m(w(e[r],n),e[t])&&m(w(e[t],n),e[r])&&v(z(e[r],e[t],n),e))return[e[r],e[t],n];throw new Error}function m(e,n){var r=e.r-n.r,t=n.x-e.x,i=n.y-e.y;return r<0||r*r<t*t+i*i}function g(e,n){var r=e.r-n.r+1e-9*Math.max(e.r,n.r,1),t=n.x-e.x,i=n.y-e.y;return r>0&&r*r>t*t+i*i}function v(e,n){for(var r=0;r<n.length;++r)if(!g(e,n[r]))return!1;return!0}function x(e){switch(e.length){case 1:return{x:(n=e[0]).x,y:n.y,r:n.r};case 2:return w(e[0],e[1]);case 3:return z(e[0],e[1],e[2])}var n}function w(e,n){var r=e.x,t=e.y,i=e.r,a=n.x,o=n.y,u=n.r,f=a-r,c=o-t,l=u-i,h=Math.sqrt(f*f+c*c);return{x:(r+a+f/h*l)/2,y:(t+o+c/h*l)/2,r:(h+i+u)/2}}function z(e,n,r){var t=e.x,i=e.y,a=e.r,o=n.x,u=n.y,f=n.r,c=r.x,l=r.y,h=r.r,s=t-o,d=t-c,p=i-u,y=i-l,m=f-a,g=h-a,v=t*t+i*i-a*a,x=v-o*o-u*u+f*f,w=v-c*c-l*l+h*h,z=d*p-s*y,_=(p*w-y*x)/(2*z)-t,b=(y*m-p*g)/z,M=(d*x-s*w)/(2*z)-i,A=(s*g-d*m)/z,B=b*b+A*A-1,k=2*(a+_*b+M*A),T=_*_+M*M-a*a,q=-(B?(k+Math.sqrt(k*k-4*B*T))/(2*B):T/k);return{x:t+_+b*q,y:i+M+A*q,r:q}}function _(e,n,r){var t,i,a,o,u=e.x-n.x,f=e.y-n.y,c=u*u+f*f;c?(i=n.r+r.r,i*=i,o=e.r+r.r,i>(o*=o)?(t=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-t*t)),r.x=e.x-t*u-a*f,r.y=e.y-t*f+a*u):(t=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-t*t)),r.x=n.x+t*u-a*f,r.y=n.y+t*f+a*u)):(r.x=n.x+r.r,r.y=n.y)}function b(e,n){var r=e.r+n.r-1e-6,t=n.x-e.x,i=n.y-e.y;return r>0&&r*r>t*t+i*i}function M(e){var n=e._,r=e.next._,t=n.r+r.r,i=(n.x*r.r+r.x*n.r)/t,a=(n.y*r.r+r.y*n.r)/t;return i*i+a*a}function A(e){this._=e,this.next=null,this.previous=null}function B(e){if(!(a=(n=e,e="object"==typeof n&&"length"in n?n:Array.from(n)).length))return 0;var n,r,t,i,a,o,u,f,c,l,h,s;if((r=e[0]).x=0,r.y=0,!(a>1))return r.r;if(t=e[1],r.x=-t.r,t.x=r.r,t.y=0,!(a>2))return r.r+t.r;_(t,r,i=e[2]),r=new A(r),t=new A(t),i=new A(i),r.next=i.previous=t,t.next=r.previous=i,i.next=t.previous=r;e:for(f=3;f<a;++f){_(r._,t._,i=e[f]),i=new A(i),c=t.next,l=r.previous,h=t._.r,s=r._.r;do{if(h<=s){if(b(c._,i._)){t=c,r.next=t,t.previous=r,--f;continue e}h+=c._.r,c=c.next}else{if(b(l._,i._)){(r=l).next=t,t.previous=r,--f;continue e}s+=l._.r,l=l.previous}}while(c!==l.next);for(i.previous=r,i.next=t,r.next=t.previous=t=i,o=M(r);(i=i.next)!==t;)(u=M(i))<o&&(r=i,o=u);t=r.next}for(r=[t._],i=t;(i=i.next)!==t;)r.push(i._);for(i=p(r),f=0;f<a;++f)(r=e[f]).x-=i.x,r.y-=i.y;return i.r}function k(e){return null==e?null:T(e)}function T(e){if("function"!=typeof e)throw new Error;return e}function q(){return 0}function D(e){return function(){return e}}function E(e){return Math.sqrt(e.value)}function O(e){return function(n){n.children||(n.r=Math.max(0,+e(n)||0))}}function S(e,n){return function(r){if(t=r.children){var t,i,a,o=t.length,u=e(r)*n||0;if(u)for(i=0;i<o;++i)t[i].r+=u;if(a=B(t),u)for(i=0;i<o;++i)t[i].r-=u;r.r=a+u}}}function R(e){return function(n){var r=n.parent;n.r*=e,r&&(n.x=r.x+e*n.x,n.y=r.y+e*n.y)}}function I(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function L(e,n,r,t,i){for(var a,o=e.children,u=-1,f=o.length,c=e.value&&(t-n)/e.value;++u<f;)(a=o[u]).y0=r,a.y1=i,a.x0=n,a.x1=n+=a.value*c}d.prototype=f.prototype={constructor:d,count:function(){return this.eachAfter(u)},each:function(e,n){let r=-1;for(const t of this)e.call(n,t,++r,this);return this},eachAfter:function(e,n){for(var r,t,i,a=this,o=[a],u=[],f=-1;a=o.pop();)if(u.push(a),r=a.children)for(t=0,i=r.length;t<i;++t)o.push(r[t]);for(;a=u.pop();)e.call(n,a,++f,this);return this},eachBefore:function(e,n){for(var r,t,i=this,a=[i],o=-1;i=a.pop();)if(e.call(n,i,++o,this),r=i.children)for(t=r.length-1;t>=0;--t)a.push(r[t]);return this},find:function(e,n){let r=-1;for(const t of this)if(e.call(n,t,++r,this))return t},sum:function(e){return this.eachAfter((function(n){for(var r=+e(n.data)||0,t=n.children,i=t&&t.length;--i>=0;)r+=t[i].value;n.value=r}))},sort:function(e){return this.eachBefore((function(n){n.children&&n.children.sort(e)}))},path:function(e){for(var n=this,r=function(e,n){if(e===n)return e;var r=e.ancestors(),t=n.ancestors(),i=null;e=r.pop(),n=t.pop();for(;e===n;)i=e,e=r.pop(),n=t.pop();return i}(n,e),t=[n];n!==r;)n=n.parent,t.push(n);for(var i=t.length;e!==r;)t.splice(i,0,e),e=e.parent;return t},ancestors:function(){for(var e=this,n=[e];e=e.parent;)n.push(e);return n},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(n){n.children||e.push(n)})),e},links:function(){var e=this,n=[];return e.each((function(r){r!==e&&n.push({source:r.parent,target:r})})),n},copy:function(){return f(this).eachBefore(h)},[Symbol.iterator]:function*(){var e,n,r,t,i=this,a=[i];do{for(e=a.reverse(),a=[];i=e.pop();)if(yield i,n=i.children)for(r=0,t=n.length;r<t;++r)a.push(n[r])}while(a.length)}};var U={depth:-1},C={};function P(e){return e.id}function K(e){return e.parentId}function N(){var e=P,n=K;function r(r){var t,i,a,o,u,f,c,l=Array.from(r),h=l.length,p=new Map;for(i=0;i<h;++i)t=l[i],u=l[i]=new d(t),null!=(f=e(t,i,r))&&(f+="")&&(c=u.id=f,p.set(c,p.has(c)?C:u)),null!=(f=n(t,i,r))&&(f+="")&&(u.parent=f);for(i=0;i<h;++i)if(f=(u=l[i]).parent){if(!(o=p.get(f)))throw new Error("missing: "+f);if(o===C)throw new Error("ambiguous: "+f);o.children?o.children.push(u):o.children=[u],u.parent=o}else{if(a)throw new Error("multiple roots");a=u}if(!a)throw new Error("no root");if(a.parent=U,a.eachBefore((function(e){e.depth=e.parent.depth+1,--h})).eachBefore(s),a.parent=null,h>0)throw new Error("cycle");return a}return r.id=function(n){return arguments.length?(e=T(n),r):e},r.parentId=function(e){return arguments.length?(n=T(e),r):n},r}function j(e,n){return e.parent===n.parent?1:2}function F(e){var n=e.children;return n?n[0]:e.t}function G(e){var n=e.children;return n?n[n.length-1]:e.t}function H(e,n,r){var t=r/(n.i-e.i);n.c-=t,n.s+=r,e.c+=t,n.z+=r,n.m+=r}function J(e,n,r){return e.a.parent===n.parent?e.a:r}function Q(e,n){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function V(e,n,r,t,i){for(var a,o=e.children,u=-1,f=o.length,c=e.value&&(i-r)/e.value;++u<f;)(a=o[u]).x0=n,a.x1=t,a.y0=r,a.y1=r+=a.value*c}Q.prototype=Object.create(d.prototype);var W=(1+Math.sqrt(5))/2;function X(e,n,r,t,i,a){for(var o,u,f,c,l,h,s,d,p,y,m,g=[],v=n.children,x=0,w=0,z=v.length,_=n.value;x<z;){f=i-r,c=a-t;do{l=v[w++].value}while(!l&&w<z);for(h=s=l,m=l*l*(y=Math.max(c/f,f/c)/(_*e)),p=Math.max(s/m,m/h);w<z;++w){if(l+=u=v[w].value,u<h&&(h=u),u>s&&(s=u),m=l*l*y,(d=Math.max(s/m,m/h))>p){l-=u;break}p=d}g.push(o={value:l,dice:f<c,children:v.slice(x,w)}),o.dice?L(o,r,t,i,_?t+=c*l/_:a):V(o,r,t,_?r+=f*l/_:i,a),_-=l,x=w}return g}var Y=function e(n){function r(e,r,t,i,a){X(n,e,r,t,i,a)}return r.ratio=function(n){return e((n=+n)>1?n:1)},r}(W);var Z=function e(n){function r(e,r,t,i,a){if((o=e._squarify)&&o.ratio===n)for(var o,u,f,c,l,h=-1,s=o.length,d=e.value;++h<s;){for(f=(u=o[h]).children,c=u.value=0,l=f.length;c<l;++c)u.value+=f[c].value;u.dice?L(u,r,t,i,d?t+=(a-t)*u.value/d:a):V(u,r,t,d?r+=(i-r)*u.value/d:i,a),d-=u.value}else e._squarify=o=X(n,e,r,t,i,a),o.ratio=n}return r.ratio=function(n){return e((n=+n)>1?n:1)},r}(W);function $(e){n.Transform.call(this,null,e)}$.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const ee=e=>e.values;function ne(){const e=[],n={entries:e=>t(r(e,0),0),key:r=>(e.push(r),n)};function r(n,t){if(t>=e.length)return n;const i=n.length,a=e[t++],o={},u={};let f,c,l,h=-1;for(;++h<i;)f=a(c=n[h])+"",(l=o[f])?l.push(c):o[f]=[c];for(f in o)u[f]=r(o[f],t);return u}function t(n,r){if(++r>e.length)return n;const i=[];for(const e in n)i.push({key:e,values:t(n[e],r)});return i}return n}function re(e){n.Transform.call(this,null,e)}r.inherits($,n.Transform,{transform(e,i){i.source||r.error("Nest transform requires an upstream data source.");var a=e.generate,o=e.modified(),u=i.clone(),c=this.value;return(!c||o||i.changed())&&(c&&c.each(e=>{e.children&&n.isTuple(e.data)&&u.rem.push(e.data)}),this.value=c=f({values:r.array(e.keys).reduce((e,n)=>(e.key(n),e),ne()).entries(u.source)},ee),a&&c.each(e=>{e.children&&(e=n.ingest(e.data),u.add.push(e),u.source.push(e))}),t(c,n.tupleid,n.tupleid)),u.source.root=c,u}});const te=(e,n)=>e.parent===n.parent?1:2;r.inherits(re,n.Transform,{transform(e,t){t.source&&t.source.root||r.error(this.constructor.name+" transform requires a backing tree data source.");const i=this.layout(e.method),a=this.fields,o=t.source.root,u=e.as||a;e.field?o.sum(e.field):o.count(),e.sort&&o.sort(n.stableCompare(e.sort,e=>e.data)),function(e,n,r){for(let t,i=0,a=n.length;i<a;++i)t=n[i],t in r&&e[t](r[t])}(i,this.params,e),i.separation&&i.separation(!1!==e.separation?te:r.one);try{this.value=i(o)}catch(e){r.error(e)}return o.each(e=>function(e,n,r){const t=e.data,i=n.length-1;for(let a=0;a<i;++a)t[r[a]]=e[n[a]];t[r[i]]=e.children?e.children.length:0}(e,a,u)),t.reflow(e.modified()).modifies(u).modifies("leaf")}});const ie=["x","y","r","depth","children"];function ae(e){re.call(this,e)}ae.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ie.length,default:ie}]},r.inherits(ae,re,{layout:function(){var e=null,n=1,r=1,t=q;function i(i){return i.x=n/2,i.y=r/2,e?i.eachBefore(O(e)).eachAfter(S(t,.5)).eachBefore(R(1)):i.eachBefore(O(E)).eachAfter(S(q,1)).eachAfter(S(t,i.r/Math.min(n,r))).eachBefore(R(Math.min(n,r)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(e=k(n),i):e},i.size=function(e){return arguments.length?(n=+e[0],r=+e[1],i):[n,r]},i.padding=function(e){return arguments.length?(t="function"==typeof e?e:D(+e),i):t},i},params:["radius","size","padding"],fields:ie});const oe=["x0","y0","x1","y1","depth","children"];function ue(e){re.call(this,e)}function fe(e){n.Transform.call(this,null,e)}ue.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:oe.length,default:oe}]},r.inherits(ue,re,{layout:function(){var e=1,n=1,r=0,t=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=e,i.y1=n/a,i.eachBefore(function(e,n){return function(t){t.children&&L(t,t.x0,e*(t.depth+1)/n,t.x1,e*(t.depth+2)/n);var i=t.x0,a=t.y0,o=t.x1-r,u=t.y1-r;o<i&&(i=o=(i+o)/2),u<a&&(a=u=(a+u)/2),t.x0=i,t.y0=a,t.x1=o,t.y1=u}}(n,a)),t&&i.eachBefore(I),i}return i.round=function(e){return arguments.length?(t=!!e,i):t},i.size=function(r){return arguments.length?(e=+r[0],n=+r[1],i):[e,n]},i.padding=function(e){return arguments.length?(r=+e,i):r},i},params:["size","round","padding"],fields:oe}),fe.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},r.inherits(fe,n.Transform,{transform(e,n){n.source||r.error("Stratify transform requires an upstream data source.");let i=this.value;const a=e.modified(),o=n.fork(n.ALL).materialize(n.SOURCE),u=!i||a||n.changed(n.ADD_REM)||n.modified(e.key.fields)||n.modified(e.parentKey.fields);return o.source=o.source.slice(),u&&(i=o.source.length?t(N().id(e.key).parentId(e.parentKey)(o.source),e.key,r.truthy):t(N()([{}]),e.key,e.key)),o.source.root=this.value=i,o}});const ce={tidy:function(){var e=j,n=1,r=1,t=null;function i(i){var f=function(e){for(var n,r,t,i,a,o=new Q(e,0),u=[o];n=u.pop();)if(t=n._.children)for(n.children=new Array(a=t.length),i=a-1;i>=0;--i)u.push(r=n.children[i]=new Q(t[i],i)),r.parent=n;return(o.parent=new Q(null,0)).children=[o],o}(i);if(f.eachAfter(a),f.parent.m=-f.z,f.eachBefore(o),t)i.eachBefore(u);else{var c=i,l=i,h=i;i.eachBefore((function(e){e.x<c.x&&(c=e),e.x>l.x&&(l=e),e.depth>h.depth&&(h=e)}));var s=c===l?1:e(c,l)/2,d=s-c.x,p=n/(l.x+s+d),y=r/(h.depth||1);i.eachBefore((function(e){e.x=(e.x+d)*p,e.y=e.depth*y}))}return i}function a(n){var r=n.children,t=n.parent.children,i=n.i?t[n.i-1]:null;if(r){!function(e){for(var n,r=0,t=0,i=e.children,a=i.length;--a>=0;)(n=i[a]).z+=r,n.m+=r,r+=n.s+(t+=n.c)}(n);var a=(r[0].z+r[r.length-1].z)/2;i?(n.z=i.z+e(n._,i._),n.m=n.z-a):n.z=a}else i&&(n.z=i.z+e(n._,i._));n.parent.A=function(n,r,t){if(r){for(var i,a=n,o=n,u=r,f=a.parent.children[0],c=a.m,l=o.m,h=u.m,s=f.m;u=G(u),a=F(a),u&&a;)f=F(f),(o=G(o)).a=n,(i=u.z+h-a.z-c+e(u._,a._))>0&&(H(J(u,n,t),n,i),c+=i,l+=i),h+=u.m,c+=a.m,s+=f.m,l+=o.m;u&&!G(o)&&(o.t=u,o.m+=h-l),a&&!F(f)&&(f.t=a,f.m+=c-s,t=n)}return t}(n,i,n.parent.A||t[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function u(e){e.x*=n,e.y=e.depth*r}return i.separation=function(n){return arguments.length?(e=n,i):e},i.size=function(e){return arguments.length?(t=!1,n=+e[0],r=+e[1],i):t?null:[n,r]},i.nodeSize=function(e){return arguments.length?(t=!0,n=+e[0],r=+e[1],i):t?[n,r]:null},i},cluster:function(){var e=i,n=1,r=1,t=!1;function u(i){var u,f=0;i.eachAfter((function(n){var r=n.children;r?(n.x=function(e){return e.reduce(a,0)/e.length}(r),n.y=function(e){return 1+e.reduce(o,0)}(r)):(n.x=u?f+=e(n,u):0,n.y=0,u=n)}));var c=function(e){for(var n;n=e.children;)e=n[0];return e}(i),l=function(e){for(var n;n=e.children;)e=n[n.length-1];return e}(i),h=c.x-e(c,l)/2,s=l.x+e(l,c)/2;return i.eachAfter(t?function(e){e.x=(e.x-i.x)*n,e.y=(i.y-e.y)*r}:function(e){e.x=(e.x-h)/(s-h)*n,e.y=(1-(i.y?e.y/i.y:1))*r})}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(e){return arguments.length?(t=!1,n=+e[0],r=+e[1],u):t?null:[n,r]},u.nodeSize=function(e){return arguments.length?(t=!0,n=+e[0],r=+e[1],u):t?[n,r]:null},u}},le=["x","y","depth","children"];function he(e){re.call(this,e)}function se(e){n.Transform.call(this,[],e)}he.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:le.length,default:le}]},r.inherits(he,re,{layout(e){const n=e||"tidy";if(r.hasOwnProperty(ce,n))return ce[n]();r.error("Unrecognized Tree layout method: "+n)},params:["size","nodeSize"],fields:le}),se.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},r.inherits(se,n.Transform,{transform(e,t){const i=this.value,a=t.source&&t.source.root,o=t.fork(t.NO_SOURCE),u={};return a||r.error("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(o.rem=i,t.visit(t.SOURCE,e=>u[n.tupleid(e)]=1),a.each(e=>{const r=e.data,t=e.parent&&e.parent.data;t&&u[n.tupleid(r)]&&u[n.tupleid(t)]&&o.add.push(n.ingest({source:t,target:r}))}),this.value=o.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>u[n.tupleid(e)]=1),i.forEach(e=>{(u[n.tupleid(e.source)]||u[n.tupleid(e.target)])&&o.mod.push(e)})),o}});const de={binary:function(e,n,r,t,i){var a,o,u=e.children,f=u.length,c=new Array(f+1);for(c[0]=o=a=0;a<f;++a)c[a+1]=o+=u[a].value;!function e(n,r,t,i,a,o,f){if(n>=r-1){var l=u[n];return l.x0=i,l.y0=a,l.x1=o,void(l.y1=f)}var h=c[n],s=t/2+h,d=n+1,p=r-1;for(;d<p;){var y=d+p>>>1;c[y]<s?d=y+1:p=y}s-c[d-1]<c[d]-s&&n+1<d&&--d;var m=c[d]-h,g=t-m;if(o-i>f-a){var v=t?(i*g+o*m)/t:o;e(n,d,m,i,a,v,f),e(d,r,g,v,a,o,f)}else{var x=t?(a*g+f*m)/t:f;e(n,d,m,i,a,o,x),e(d,r,g,i,x,o,f)}}(0,f,e.value,n,r,t,i)},dice:L,slice:V,slicedice:function(e,n,r,t,i){(1&e.depth?V:L)(e,n,r,t,i)},squarify:Y,resquarify:Z},pe=["x0","y0","x1","y1","depth","children"];function ye(e){re.call(this,e)}return ye.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:pe.length,default:pe}]},r.inherits(ye,re,{layout(){const e=function(){var e=Y,n=!1,r=1,t=1,i=[0],a=q,o=q,u=q,f=q,c=q;function l(e){return e.x0=e.y0=0,e.x1=r,e.y1=t,e.eachBefore(h),i=[0],n&&e.eachBefore(I),e}function h(n){var r=i[n.depth],t=n.x0+r,l=n.y0+r,h=n.x1-r,s=n.y1-r;h<t&&(t=h=(t+h)/2),s<l&&(l=s=(l+s)/2),n.x0=t,n.y0=l,n.x1=h,n.y1=s,n.children&&(r=i[n.depth+1]=a(n)/2,t+=c(n)-r,l+=o(n)-r,(h-=u(n)-r)<t&&(t=h=(t+h)/2),(s-=f(n)-r)<l&&(l=s=(l+s)/2),e(n,t,l,h,s))}return l.round=function(e){return arguments.length?(n=!!e,l):n},l.size=function(e){return arguments.length?(r=+e[0],t=+e[1],l):[r,t]},l.tile=function(n){return arguments.length?(e=T(n),l):e},l.padding=function(e){return arguments.length?l.paddingInner(e).paddingOuter(e):l.paddingInner()},l.paddingInner=function(e){return arguments.length?(a="function"==typeof e?e:D(+e),l):a},l.paddingOuter=function(e){return arguments.length?l.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):l.paddingTop()},l.paddingTop=function(e){return arguments.length?(o="function"==typeof e?e:D(+e),l):o},l.paddingRight=function(e){return arguments.length?(u="function"==typeof e?e:D(+e),l):u},l.paddingBottom=function(e){return arguments.length?(f="function"==typeof e?e:D(+e),l):f},l.paddingLeft=function(e){return arguments.length?(c="function"==typeof e?e:D(+e),l):c},l}();return e.ratio=n=>{const r=e.tile();r.ratio&&e.tile(r.ratio(n))},e.method=n=>{r.hasOwnProperty(de,n)?e.tile(de[n]):r.error("Unrecognized Treemap layout method: "+n)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:pe}),e.nest=$,e.pack=ae,e.partition=ue,e.stratify=fe,e.tree=he,e.treelinks=se,e.treemap=ye,e}({},vega,vega);
  //# sourceMappingURL=vega-hierarchy.min.js.map
  