@antv/g6
Version:
graph visualization frame work
1 lines • 261 kB
JavaScript
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@antv/g6")):"function"==typeof define&&define.amd?define(["@antv/g6"],t):"object"==typeof exports?exports["plugin.template.maxSpanningForest"]=t(require("@antv/g6")):n["plugin.template.maxSpanningForest"]=t(n.G6)}(window,function(n){return function(n){var t={};function e(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return n[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:r})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)e.d(r,i,function(t){return n[t]}.bind(null,i));return r},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=44)}({0:function(n,t,e){"use strict";var r=function(n,t){return n<t?-1:n>t?1:n>=t?0:NaN},i=function(n){return 1===n.length&&(n=function(n){return function(t,e){return r(n(t),e)}}(n)),{left:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}};var u=i(r),o=u.right,a=u.left,c=o,f=function(n,t){null==t&&(t=s);for(var e=0,r=n.length-1,i=n[0],u=new Array(r<0?0:r);e<r;)u[e]=t(i,i=n[++e]);return u};function s(n,t){return[n,t]}var l=function(n,t,e){var r,i,u,o,a=n.length,c=t.length,f=new Array(a*c);for(null==e&&(e=s),r=u=0;r<a;++r)for(o=n[r],i=0;i<c;++i,++u)f[u]=e(o,t[i]);return f},h=function(n,t){return t<n?-1:t>n?1:t>=n?0:NaN},d=function(n){return null===n?NaN:+n},p=function(n,t){var e,r,i=n.length,u=0,o=-1,a=0,c=0;if(null==t)for(;++o<i;)isNaN(e=d(n[o]))||(c+=(r=e-a)*(e-(a+=r/++u)));else for(;++o<i;)isNaN(e=d(t(n[o],o,n)))||(c+=(r=e-a)*(e-(a+=r/++u)));if(u>1)return c/(u-1)},v=function(n,t){var e=p(n,t);return e?Math.sqrt(e):e},g=function(n,t){var e,r,i,u=n.length,o=-1;if(null==t){for(;++o<u;)if(null!=(e=n[o])&&e>=e)for(r=i=e;++o<u;)null!=(e=n[o])&&(r>e&&(r=e),i<e&&(i=e))}else for(;++o<u;)if(null!=(e=t(n[o],o,n))&&e>=e)for(r=i=e;++o<u;)null!=(e=t(n[o],o,n))&&(r>e&&(r=e),i<e&&(i=e));return[r,i]},y=Array.prototype,b=y.slice,_=y.map,m=function(n){return function(){return n}},x=function(n){return n},w=function(n,t,e){n=+n,t=+t,e=(i=arguments.length)<2?(t=n,n=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((t-n)/e)),u=new Array(i);++r<i;)u[r]=n+r*e;return u},M=Math.sqrt(50),S=Math.sqrt(10),A=Math.sqrt(2),T=function(n,t,e){var r,i,u,o,a=-1;if(e=+e,(n=+n)===(t=+t)&&e>0)return[n];if((r=t<n)&&(i=n,n=t,t=i),0===(o=k(n,t,e))||!isFinite(o))return[];if(o>0)for(n=Math.ceil(n/o),t=Math.floor(t/o),u=new Array(i=Math.ceil(t-n+1));++a<i;)u[a]=(n+a)*o;else for(n=Math.floor(n*o),t=Math.ceil(t*o),u=new Array(i=Math.ceil(n-t+1));++a<i;)u[a]=(n-a)/o;return r&&u.reverse(),u};function k(n,t,e){var r=(t-n)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),u=r/Math.pow(10,i);return i>=0?(u>=M?10:u>=S?5:u>=A?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(u>=M?10:u>=S?5:u>=A?2:1)}function N(n,t,e){var r=Math.abs(t-n)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),u=r/i;return u>=M?i*=10:u>=S?i*=5:u>=A&&(i*=2),t<n?-i:i}var E=function(n){return Math.ceil(Math.log(n.length)/Math.LN2)+1},C=function(){var n=x,t=g,e=E;function r(r){var i,u,o=r.length,a=new Array(o);for(i=0;i<o;++i)a[i]=n(r[i],i,r);var f=t(a),s=f[0],l=f[1],h=e(a,s,l);Array.isArray(h)||(h=N(s,l,h),h=w(Math.ceil(s/h)*h,Math.floor(l/h)*h,h));for(var d=h.length;h[0]<=s;)h.shift(),--d;for(;h[d-1]>l;)h.pop(),--d;var p,v=new Array(d+1);for(i=0;i<=d;++i)(p=v[i]=[]).x0=i>0?h[i-1]:s,p.x1=i<d?h[i]:l;for(i=0;i<o;++i)s<=(u=a[i])&&u<=l&&v[c(h,u,0,d)].push(r[i]);return v}return r.value=function(t){return arguments.length?(n="function"==typeof t?t:m(t),r):n},r.domain=function(n){return arguments.length?(t="function"==typeof n?n:m([n[0],n[1]]),r):t},r.thresholds=function(n){return arguments.length?(e="function"==typeof n?n:Array.isArray(n)?m(b.call(n)):m(n),r):e},r},O=function(n,t,e){if(null==e&&(e=d),r=n.length){if((t=+t)<=0||r<2)return+e(n[0],0,n);if(t>=1)return+e(n[r-1],r-1,n);var r,i=(r-1)*t,u=Math.floor(i),o=+e(n[u],u,n);return o+(+e(n[u+1],u+1,n)-o)*(i-u)}},P=function(n,t,e){return n=_.call(n,d).sort(r),Math.ceil((e-t)/(2*(O(n,.75)-O(n,.25))*Math.pow(n.length,-1/3)))},z=function(n,t,e){return Math.ceil((e-t)/(3.5*v(n)*Math.pow(n.length,-1/3)))},j=function(n,t){var e,r,i=n.length,u=-1;if(null==t){for(;++u<i;)if(null!=(e=n[u])&&e>=e)for(r=e;++u<i;)null!=(e=n[u])&&e>r&&(r=e)}else for(;++u<i;)if(null!=(e=t(n[u],u,n))&&e>=e)for(r=e;++u<i;)null!=(e=t(n[u],u,n))&&e>r&&(r=e);return r},R=function(n,t){var e,r=n.length,i=r,u=-1,o=0;if(null==t)for(;++u<r;)isNaN(e=d(n[u]))?--i:o+=e;else for(;++u<r;)isNaN(e=d(t(n[u],u,n)))?--i:o+=e;if(i)return o/i},D=function(n,t){var e,i=n.length,u=-1,o=[];if(null==t)for(;++u<i;)isNaN(e=d(n[u]))||o.push(e);else for(;++u<i;)isNaN(e=d(t(n[u],u,n)))||o.push(e);return O(o.sort(r),.5)},L=function(n){for(var t,e,r,i=n.length,u=-1,o=0;++u<i;)o+=n[u].length;for(e=new Array(o);--i>=0;)for(t=(r=n[i]).length;--t>=0;)e[--o]=r[t];return e},q=function(n,t){var e,r,i=n.length,u=-1;if(null==t){for(;++u<i;)if(null!=(e=n[u])&&e>=e)for(r=e;++u<i;)null!=(e=n[u])&&r>e&&(r=e)}else for(;++u<i;)if(null!=(e=t(n[u],u,n))&&e>=e)for(r=e;++u<i;)null!=(e=t(n[u],u,n))&&r>e&&(r=e);return r},U=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},B=function(n,t){if(e=n.length){var e,i,u=0,o=0,a=n[o];for(null==t&&(t=r);++u<e;)(t(i=n[u],a)<0||0!==t(a,a))&&(a=i,o=u);return 0===t(a,a)?o:void 0}},F=function(n,t,e){for(var r,i,u=(null==e?n.length:e)-(t=null==t?0:+t);u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},Y=function(n,t){var e,r=n.length,i=-1,u=0;if(null==t)for(;++i<r;)(e=+n[i])&&(u+=e);else for(;++i<r;)(e=+t(n[i],i,n))&&(u+=e);return u},I=function(n){if(!(i=n.length))return[];for(var t=-1,e=q(n,H),r=new Array(e);++t<e;)for(var i,u=-1,o=r[t]=new Array(i);++u<i;)o[u]=n[u][t];return r};function H(n){return n.length}var X=function(){return I(arguments)};e.d(t,"b",function(){return c}),e.d(t,"d",function(){return o}),e.d(t,"c",function(){return a}),e.d(t,"a",function(){return r}),e.d(t,"e",function(){return i}),e.d(t,"f",function(){return l}),e.d(t,"g",function(){return h}),e.d(t,"h",function(){return v}),e.d(t,"i",function(){return g}),e.d(t,"j",function(){return C}),e.d(t,"w",function(){return P}),e.d(t,"x",function(){return z}),e.d(t,"y",function(){return E}),e.d(t,"k",function(){return j}),e.d(t,"l",function(){return R}),e.d(t,"m",function(){return D}),e.d(t,"n",function(){return L}),e.d(t,"o",function(){return q}),e.d(t,"p",function(){return f}),e.d(t,"q",function(){return U}),e.d(t,"r",function(){return O}),e.d(t,"s",function(){return w}),e.d(t,"t",function(){return B}),e.d(t,"u",function(){return F}),e.d(t,"v",function(){return Y}),e.d(t,"B",function(){return T}),e.d(t,"z",function(){return k}),e.d(t,"A",function(){return N}),e.d(t,"C",function(){return I}),e.d(t,"D",function(){return p}),e.d(t,"E",function(){return X})},1:function(n,t,e){"use strict";var r=new Date,i=new Date;function u(n,t,e,o){function a(t){return n(t=new Date(+t)),t}return a.floor=a,a.ceil=function(e){return n(e=new Date(e-1)),t(e,1),n(e),e},a.round=function(n){var t=a(n),e=a.ceil(n);return n-t<e-n?t:e},a.offset=function(n,e){return t(n=new Date(+n),null==e?1:Math.floor(e)),n},a.range=function(e,r,i){var u,o=[];if(e=a.ceil(e),i=null==i?1:Math.floor(i),!(e<r&&i>0))return o;do{o.push(u=new Date(+e)),t(e,i),n(e)}while(u<e&&e<r);return o},a.filter=function(e){return u(function(t){if(t>=t)for(;n(t),!e(t);)t.setTime(t-1)},function(n,r){if(n>=n)if(r<0)for(;++r<=0;)for(;t(n,-1),!e(n););else for(;--r>=0;)for(;t(n,1),!e(n););})},e&&(a.count=function(t,u){return r.setTime(+t),i.setTime(+u),n(r),n(i),Math.floor(e(r,i))},a.every=function(n){return n=Math.floor(n),isFinite(n)&&n>0?n>1?a.filter(o?function(t){return o(t)%n==0}:function(t){return a.count(0,t)%n==0}):a:null}),a}var o=u(function(){},function(n,t){n.setTime(+n+t)},function(n,t){return t-n});o.every=function(n){return n=Math.floor(n),isFinite(n)&&n>0?n>1?u(function(t){t.setTime(Math.floor(t/n)*n)},function(t,e){t.setTime(+t+e*n)},function(t,e){return(e-t)/n}):o:null};var a=o,c=o.range,f=6e4,s=6048e5,l=u(function(n){n.setTime(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(+n+1e3*t)},function(n,t){return(t-n)/1e3},function(n){return n.getUTCSeconds()}),h=l,d=l.range,p=u(function(n){n.setTime(Math.floor(n/f)*f)},function(n,t){n.setTime(+n+t*f)},function(n,t){return(t-n)/f},function(n){return n.getMinutes()}),v=p,g=p.range,y=u(function(n){var t=n.getTimezoneOffset()*f%36e5;t<0&&(t+=36e5),n.setTime(36e5*Math.floor((+n-t)/36e5)+t)},function(n,t){n.setTime(+n+36e5*t)},function(n,t){return(t-n)/36e5},function(n){return n.getHours()}),b=y,_=y.range,m=u(function(n){n.setHours(0,0,0,0)},function(n,t){n.setDate(n.getDate()+t)},function(n,t){return(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*f)/864e5},function(n){return n.getDate()-1}),x=m,w=m.range;function M(n){return u(function(t){t.setDate(t.getDate()-(t.getDay()+7-n)%7),t.setHours(0,0,0,0)},function(n,t){n.setDate(n.getDate()+7*t)},function(n,t){return(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*f)/s})}var S=M(0),A=M(1),T=M(2),k=M(3),N=M(4),E=M(5),C=M(6),O=S.range,P=A.range,z=T.range,j=k.range,R=N.range,D=E.range,L=C.range,q=u(function(n){n.setDate(1),n.setHours(0,0,0,0)},function(n,t){n.setMonth(n.getMonth()+t)},function(n,t){return t.getMonth()-n.getMonth()+12*(t.getFullYear()-n.getFullYear())},function(n){return n.getMonth()}),U=q,B=q.range,F=u(function(n){n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n,t){return t.getFullYear()-n.getFullYear()},function(n){return n.getFullYear()});F.every=function(n){return isFinite(n=Math.floor(n))&&n>0?u(function(t){t.setFullYear(Math.floor(t.getFullYear()/n)*n),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e*n)}):null};var Y=F,I=F.range,H=u(function(n){n.setUTCSeconds(0,0)},function(n,t){n.setTime(+n+t*f)},function(n,t){return(t-n)/f},function(n){return n.getUTCMinutes()}),X=H,G=H.range,V=u(function(n){n.setUTCMinutes(0,0,0)},function(n,t){n.setTime(+n+36e5*t)},function(n,t){return(t-n)/36e5},function(n){return n.getUTCHours()}),$=V,W=V.range,Z=u(function(n){n.setUTCHours(0,0,0,0)},function(n,t){n.setUTCDate(n.getUTCDate()+t)},function(n,t){return(t-n)/864e5},function(n){return n.getUTCDate()-1}),Q=Z,J=Z.range;function K(n){return u(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-n)%7),t.setUTCHours(0,0,0,0)},function(n,t){n.setUTCDate(n.getUTCDate()+7*t)},function(n,t){return(t-n)/s})}var nn=K(0),tn=K(1),en=K(2),rn=K(3),un=K(4),on=K(5),an=K(6),cn=nn.range,fn=tn.range,sn=en.range,ln=rn.range,hn=un.range,dn=on.range,pn=an.range,vn=u(function(n){n.setUTCDate(1),n.setUTCHours(0,0,0,0)},function(n,t){n.setUTCMonth(n.getUTCMonth()+t)},function(n,t){return t.getUTCMonth()-n.getUTCMonth()+12*(t.getUTCFullYear()-n.getUTCFullYear())},function(n){return n.getUTCMonth()}),gn=vn,yn=vn.range,bn=u(function(n){n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,t){n.setUTCFullYear(n.getUTCFullYear()+t)},function(n,t){return t.getUTCFullYear()-n.getUTCFullYear()},function(n){return n.getUTCFullYear()});bn.every=function(n){return isFinite(n=Math.floor(n))&&n>0?u(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/n)*n),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e*n)}):null};var _n=bn,mn=bn.range;e.d(t,"g",function(){return u}),e.d(t,"h",function(){return a}),e.d(t,"i",function(){return c}),e.d(t,"L",function(){return a}),e.d(t,"M",function(){return c}),e.d(t,"r",function(){return h}),e.d(t,"s",function(){return d}),e.d(t,"V",function(){return h}),e.d(t,"W",function(){return d}),e.d(t,"j",function(){return v}),e.d(t,"k",function(){return g}),e.d(t,"e",function(){return b}),e.d(t,"f",function(){return _}),e.d(t,"a",function(){return x}),e.d(t,"b",function(){return w}),e.d(t,"B",function(){return S}),e.d(t,"C",function(){return O}),e.d(t,"t",function(){return S}),e.d(t,"u",function(){return O}),e.d(t,"l",function(){return A}),e.d(t,"m",function(){return P}),e.d(t,"x",function(){return T}),e.d(t,"y",function(){return z}),e.d(t,"z",function(){return k}),e.d(t,"A",function(){return j}),e.d(t,"v",function(){return N}),e.d(t,"w",function(){return R}),e.d(t,"c",function(){return E}),e.d(t,"d",function(){return D}),e.d(t,"p",function(){return C}),e.d(t,"q",function(){return L}),e.d(t,"n",function(){return U}),e.d(t,"o",function(){return B}),e.d(t,"D",function(){return Y}),e.d(t,"E",function(){return I}),e.d(t,"N",function(){return X}),e.d(t,"O",function(){return G}),e.d(t,"J",function(){return $}),e.d(t,"K",function(){return W}),e.d(t,"F",function(){return Q}),e.d(t,"G",function(){return J}),e.d(t,"Fa",function(){return nn}),e.d(t,"Ga",function(){return cn}),e.d(t,"X",function(){return nn}),e.d(t,"Y",function(){return cn}),e.d(t,"P",function(){return tn}),e.d(t,"Q",function(){return fn}),e.d(t,"Ba",function(){return en}),e.d(t,"Ca",function(){return sn}),e.d(t,"Da",function(){return rn}),e.d(t,"Ea",function(){return ln}),e.d(t,"Z",function(){return un}),e.d(t,"Aa",function(){return hn}),e.d(t,"H",function(){return on}),e.d(t,"I",function(){return dn}),e.d(t,"T",function(){return an}),e.d(t,"U",function(){return pn}),e.d(t,"R",function(){return gn}),e.d(t,"S",function(){return yn}),e.d(t,"Ha",function(){return _n}),e.d(t,"Ia",function(){return mn})},19:function(n,t,e){"use strict";e.r(t);var r=e(0),i=Array.prototype.slice,u=function(n){return n},o=1,a=2,c=3,f=4,s=1e-6;function l(n){return"translate("+(n+.5)+",0)"}function h(n){return"translate(0,"+(n+.5)+")"}function d(){return!this.__axis}function p(n,t){var e=[],r=null,p=null,v=6,g=6,y=3,b=n===o||n===f?-1:1,_=n===f||n===a?"x":"y",m=n===o||n===c?l:h;function x(i){var l=null==r?t.ticks?t.ticks.apply(t,e):t.domain():r,h=null==p?t.tickFormat?t.tickFormat.apply(t,e):u:p,x=Math.max(v,0)+y,w=t.range(),M=+w[0]+.5,S=+w[w.length-1]+.5,A=(t.bandwidth?function(n){var t=Math.max(0,n.bandwidth()-1)/2;return n.round()&&(t=Math.round(t)),function(e){return+n(e)+t}}:function(n){return function(t){return+n(t)}})(t.copy()),T=i.selection?i.selection():i,k=T.selectAll(".domain").data([null]),N=T.selectAll(".tick").data(l,t).order(),E=N.exit(),C=N.enter().append("g").attr("class","tick"),O=N.select("line"),P=N.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),N=N.merge(C),O=O.merge(C.append("line").attr("stroke","#000").attr(_+"2",b*v)),P=P.merge(C.append("text").attr("fill","#000").attr(_,b*x).attr("dy",n===o?"0em":n===c?"0.71em":"0.32em")),i!==T&&(k=k.transition(i),N=N.transition(i),O=O.transition(i),P=P.transition(i),E=E.transition(i).attr("opacity",s).attr("transform",function(n){return isFinite(n=A(n))?m(n):this.getAttribute("transform")}),C.attr("opacity",s).attr("transform",function(n){var t=this.parentNode.__axis;return m(t&&isFinite(t=t(n))?t:A(n))})),E.remove(),k.attr("d",n===f||n==a?"M"+b*g+","+M+"H0.5V"+S+"H"+b*g:"M"+M+","+b*g+"V0.5H"+S+"V"+b*g),N.attr("opacity",1).attr("transform",function(n){return m(A(n))}),O.attr(_+"2",b*v),P.attr(_,b*x).text(h),T.filter(d).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",n===a?"start":n===f?"end":"middle"),T.each(function(){this.__axis=A})}return x.scale=function(n){return arguments.length?(t=n,x):t},x.ticks=function(){return e=i.call(arguments),x},x.tickArguments=function(n){return arguments.length?(e=null==n?[]:i.call(n),x):e.slice()},x.tickValues=function(n){return arguments.length?(r=null==n?null:i.call(n),x):r&&r.slice()},x.tickFormat=function(n){return arguments.length?(p=n,x):p},x.tickSize=function(n){return arguments.length?(v=g=+n,x):v},x.tickSizeInner=function(n){return arguments.length?(v=+n,x):v},x.tickSizeOuter=function(n){return arguments.length?(g=+n,x):g},x.tickPadding=function(n){return arguments.length?(y=+n,x):y},x}function v(n){return p(o,n)}function g(n){return p(a,n)}function y(n){return p(c,n)}function b(n){return p(f,n)}var _={value:function(){}};function m(){for(var n,t=0,e=arguments.length,r={};t<e;++t){if(!(n=arguments[t]+"")||n in r)throw new Error("illegal type: "+n);r[n]=[]}return new x(r)}function x(n){this._=n}function w(n,t){for(var e,r=0,i=n.length;r<i;++r)if((e=n[r]).name===t)return e.value}function M(n,t,e){for(var r=0,i=n.length;r<i;++r)if(n[r].name===t){n[r]=_,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=e&&n.push({name:t,value:e}),n}x.prototype=m.prototype={constructor:x,on:function(n,t){var e,r=this._,i=function(n,t){return n.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");if(r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:e}})}(n+"",r),u=-1,o=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++u<o;)if(e=(n=i[u]).type)r[e]=M(r[e],n.name,t);else if(null==t)for(e in r)r[e]=M(r[e],n.name,null);return this}for(;++u<o;)if((e=(n=i[u]).type)&&(e=w(r[e],n.name)))return e},copy:function(){var n={},t=this._;for(var e in t)n[e]=t[e].slice();return new x(n)},call:function(n,t){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),u=0;u<e;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(u=0,e=(r=this._[n]).length;u<e;++u)r[u].value.apply(t,i)},apply:function(n,t,e){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],i=0,u=r.length;i<u;++i)r[i].value.apply(t,e)}};var S=m,A="http://www.w3.org/1999/xhtml",T={svg:"http://www.w3.org/2000/svg",xhtml:A,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},k=function(n){var t=n+="",e=t.indexOf(":");return e>=0&&"xmlns"!==(t=n.slice(0,e))&&(n=n.slice(e+1)),T.hasOwnProperty(t)?{space:T[t],local:n}:n};var N=function(n){var t=k(n);return(t.local?function(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}:function(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===A&&t.documentElement.namespaceURI===A?t.createElement(n):t.createElementNS(e,n)}})(t)};function E(){}var C=function(n){return null==n?E:function(){return this.querySelector(n)}};function O(){return[]}var P=function(n){return null==n?O:function(){return this.querySelectorAll(n)}},z=function(n){return function(){return this.matches(n)}};if("undefined"!=typeof document){var j=document.documentElement;if(!j.matches){var R=j.webkitMatchesSelector||j.msMatchesSelector||j.mozMatchesSelector||j.oMatchesSelector;z=function(n){return function(){return R.call(this,n)}}}}var D=z,L=function(n){return new Array(n.length)};function q(n,t){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=t}q.prototype={constructor:q,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,t){return this._parent.insertBefore(n,t)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};var U="$";function B(n,t,e,r,i,u){for(var o,a=0,c=t.length,f=u.length;a<f;++a)(o=t[a])?(o.__data__=u[a],r[a]=o):e[a]=new q(n,u[a]);for(;a<c;++a)(o=t[a])&&(i[a]=o)}function F(n,t,e,r,i,u,o){var a,c,f,s={},l=t.length,h=u.length,d=new Array(l);for(a=0;a<l;++a)(c=t[a])&&(d[a]=f=U+o.call(c,c.__data__,a,t),f in s?i[a]=c:s[f]=c);for(a=0;a<h;++a)(c=s[f=U+o.call(n,u[a],a,u)])?(r[a]=c,c.__data__=u[a],s[f]=null):e[a]=new q(n,u[a]);for(a=0;a<l;++a)(c=t[a])&&s[d[a]]===c&&(i[a]=c)}function Y(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}var I=function(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView};function H(n,t){return n.style.getPropertyValue(t)||I(n).getComputedStyle(n,null).getPropertyValue(t)}function X(n){return n.trim().split(/^|\s+/)}function G(n){return n.classList||new V(n)}function V(n){this._node=n,this._names=X(n.getAttribute("class")||"")}function $(n,t){for(var e=G(n),r=-1,i=t.length;++r<i;)e.add(t[r])}function W(n,t){for(var e=G(n),r=-1,i=t.length;++r<i;)e.remove(t[r])}V.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function Z(){this.textContent=""}function Q(){this.innerHTML=""}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nn(){return null}function tn(){var n=this.parentNode;n&&n.removeChild(this)}function en(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function rn(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var un={},on=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(un={mouseenter:"mouseover",mouseleave:"mouseout"}));function an(n,t,e){return n=cn(n,t,e),function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||n.call(this,t)}}function cn(n,t,e){return function(r){var i=on;on=r;try{n.call(this,this.__data__,t,e)}finally{on=i}}}function fn(n){return function(){var t=this.__on;if(t){for(var e,r=0,i=-1,u=t.length;r<u;++r)e=t[r],n.type&&e.type!==n.type||e.name!==n.name?t[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?t.length=i:delete this.__on}}}function sn(n,t,e){var r=un.hasOwnProperty(n.type)?an:cn;return function(i,u,o){var a,c=this.__on,f=r(t,u,o);if(c)for(var s=0,l=c.length;s<l;++s)if((a=c[s]).type===n.type&&a.name===n.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=f,a.capture=e),void(a.value=t);this.addEventListener(n.type,f,e),a={type:n.type,name:n.name,value:t,listener:f,capture:e},c?c.push(a):this.__on=[a]}}function ln(n,t,e,r){var i=on;n.sourceEvent=on,on=n;try{return t.apply(e,r)}finally{on=i}}function hn(n,t,e){var r=I(n),i=r.CustomEvent;"function"==typeof i?i=new i(t,e):(i=r.document.createEvent("Event"),e?(i.initEvent(t,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(t,!1,!1)),n.dispatchEvent(i)}var dn=[null];function pn(n,t){this._groups=n,this._parents=t}function vn(){return new pn([[document.documentElement]],dn)}pn.prototype=vn.prototype={constructor:pn,select:function(n){"function"!=typeof n&&(n=C(n));for(var t=this._groups,e=t.length,r=new Array(e),i=0;i<e;++i)for(var u,o,a=t[i],c=a.length,f=r[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(o=n.call(u,u.__data__,s,a))&&("__data__"in u&&(o.__data__=u.__data__),f[s]=o);return new pn(r,this._parents)},selectAll:function(n){"function"!=typeof n&&(n=P(n));for(var t=this._groups,e=t.length,r=[],i=[],u=0;u<e;++u)for(var o,a=t[u],c=a.length,f=0;f<c;++f)(o=a[f])&&(r.push(n.call(o,o.__data__,f,a)),i.push(o));return new pn(r,i)},filter:function(n){"function"!=typeof n&&(n=D(n));for(var t=this._groups,e=t.length,r=new Array(e),i=0;i<e;++i)for(var u,o=t[i],a=o.length,c=r[i]=[],f=0;f<a;++f)(u=o[f])&&n.call(u,u.__data__,f,o)&&c.push(u);return new pn(r,this._parents)},data:function(n,t){if(!n)return d=new Array(this.size()),f=-1,this.each(function(n){d[++f]=n}),d;var e=t?F:B,r=this._parents,i=this._groups;"function"!=typeof n&&(n=function(n){return function(){return n}}(n));for(var u=i.length,o=new Array(u),a=new Array(u),c=new Array(u),f=0;f<u;++f){var s=r[f],l=i[f],h=l.length,d=n.call(s,s&&s.__data__,f,r),p=d.length,v=a[f]=new Array(p),g=o[f]=new Array(p);e(s,l,v,g,c[f]=new Array(h),d,t);for(var y,b,_=0,m=0;_<p;++_)if(y=v[_]){for(_>=m&&(m=_+1);!(b=g[m])&&++m<p;);y._next=b||null}}return(o=new pn(o,r))._enter=a,o._exit=c,o},enter:function(){return new pn(this._enter||this._groups.map(L),this._parents)},exit:function(){return new pn(this._exit||this._groups.map(L),this._parents)},merge:function(n){for(var t=this._groups,e=n._groups,r=t.length,i=e.length,u=Math.min(r,i),o=new Array(r),a=0;a<u;++a)for(var c,f=t[a],s=e[a],l=f.length,h=o[a]=new Array(l),d=0;d<l;++d)(c=f[d]||s[d])&&(h[d]=c);for(;a<r;++a)o[a]=t[a];return new pn(o,this._parents)},order:function(){for(var n=this._groups,t=-1,e=n.length;++t<e;)for(var r,i=n[t],u=i.length-1,o=i[u];--u>=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(n){function t(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}n||(n=Y);for(var e=this._groups,r=e.length,i=new Array(r),u=0;u<r;++u){for(var o,a=e[u],c=a.length,f=i[u]=new Array(c),s=0;s<c;++s)(o=a[s])&&(f[s]=o);f.sort(t)}return new pn(i,this._parents).order()},call:function(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this},nodes:function(){var n=new Array(this.size()),t=-1;return this.each(function(){n[++t]=this}),n},node:function(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var r=n[t],i=0,u=r.length;i<u;++i){var o=r[i];if(o)return o}return null},size:function(){var n=0;return this.each(function(){++n}),n},empty:function(){return!this.node()},each:function(n){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var i,u=t[e],o=0,a=u.length;o<a;++o)(i=u[o])&&n.call(i,i.__data__,o,u);return this},attr:function(n,t){var e=k(n);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==t?e.local?function(n){return function(){this.removeAttributeNS(n.space,n.local)}}:function(n){return function(){this.removeAttribute(n)}}:"function"==typeof t?e.local?function(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}}:function(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}}:e.local?function(n,t){return function(){this.setAttributeNS(n.space,n.local,t)}}:function(n,t){return function(){this.setAttribute(n,t)}})(e,t))},style:function(n,t,e){return arguments.length>1?this.each((null==t?function(n){return function(){this.style.removeProperty(n)}}:"function"==typeof t?function(n,t,e){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}}:function(n,t,e){return function(){this.style.setProperty(n,t,e)}})(n,t,null==e?"":e)):H(this.node(),n)},property:function(n,t){return arguments.length>1?this.each((null==t?function(n){return function(){delete this[n]}}:"function"==typeof t?function(n,t){return function(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}}:function(n,t){return function(){this[n]=t}})(n,t)):this.node()[n]},classed:function(n,t){var e=X(n+"");if(arguments.length<2){for(var r=G(this.node()),i=-1,u=e.length;++i<u;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof t?function(n,t){return function(){(t.apply(this,arguments)?$:W)(this,n)}}:t?function(n){return function(){$(this,n)}}:function(n){return function(){W(this,n)}})(e,t))},text:function(n){return arguments.length?this.each(null==n?Z:("function"==typeof n?function(n){return function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}}:function(n){return function(){this.textContent=n}})(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?Q:("function"==typeof n?function(n){return function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(n){return function(){this.innerHTML=n}})(n)):this.node().innerHTML},raise:function(){return this.each(J)},lower:function(){return this.each(K)},append:function(n){var t="function"==typeof n?n:N(n);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(n,t){var e="function"==typeof n?n:N(n),r=null==t?nn:"function"==typeof t?t:C(t);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(tn)},clone:function(n){return this.select(n?rn:en)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,t,e){var r,i,u=function(n){return n.trim().split(/^|\s+/).map(function(n){var t="",e=n.indexOf(".");return e>=0&&(t=n.slice(e+1),n=n.slice(0,e)),{type:n,name:t}})}(n+""),o=u.length;if(!(arguments.length<2)){for(a=t?sn:fn,null==e&&(e=!1),r=0;r<o;++r)this.each(a(u[r],t,e));return this}var a=this.node().__on;if(a)for(var c,f=0,s=a.length;f<s;++f)for(r=0,c=a[f];r<o;++r)if((i=u[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(n,t){return this.each(("function"==typeof t?function(n,t){return function(){return hn(this,n,t.apply(this,arguments))}}:function(n,t){return function(){return hn(this,n,t)}})(n,t))}};var gn=vn,yn=function(n){return"string"==typeof n?new pn([[document.querySelector(n)]],[document.documentElement]):new pn([[n]],dn)},bn=function(n){return yn(N(n).call(document.documentElement))},_n=0;function mn(){return new xn}function xn(){this._="@"+(++_n).toString(36)}xn.prototype=mn.prototype={constructor:xn,get:function(n){for(var t=this._;!(t in n);)if(!(n=n.parentNode))return;return n[t]},set:function(n,t){return n[this._]=t},remove:function(n){return this._ in n&&delete n[this._]},toString:function(){return this._}};var wn=function(){for(var n,t=on;n=t.sourceEvent;)t=n;return t},Mn=function(n,t){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]},Sn=function(n){var t=wn();return t.changedTouches&&(t=t.changedTouches[0]),Mn(n,t)},An=function(n){return"string"==typeof n?new pn([document.querySelectorAll(n)],[document.documentElement]):new pn([null==n?[]:n],dn)},Tn=function(n,t,e){arguments.length<3&&(e=t,t=wn().changedTouches);for(var r,i=0,u=t?t.length:0;i<u;++i)if((r=t[i]).identifier===e)return Mn(n,r);return null},kn=function(n,t){null==t&&(t=wn().touches);for(var e=0,r=t?t.length:0,i=new Array(r);e<r;++e)i[e]=Mn(n,t[e]);return i};function Nn(){on.stopImmediatePropagation()}var En=function(){on.preventDefault(),on.stopImmediatePropagation()},Cn=function(n){var t=n.document.documentElement,e=yn(n).on("dragstart.drag",En,!0);"onselectstart"in t?e.on("selectstart.drag",En,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")};function On(n,t){var e=n.document.documentElement,r=yn(n).on("dragstart.drag",null);t&&(r.on("click.drag",En,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var Pn=function(n){return function(){return n}};function zn(n,t,e,r,i,u,o,a,c,f){this.target=n,this.type=t,this.subject=e,this.identifier=r,this.active=i,this.x=u,this.y=o,this.dx=a,this.dy=c,this._=f}function jn(){return!on.button}function Rn(){return this.parentNode}function Dn(n){return null==n?{x:on.x,y:on.y}:n}function Ln(){return"ontouchstart"in this}zn.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var qn,Un,Bn=function(){var n,t,e,r,i=jn,u=Rn,o=Dn,a=Ln,c={},f=S("start","drag","end"),s=0,l=0;function h(n){n.on("mousedown.drag",d).filter(a).on("touchstart.drag",g).on("touchmove.drag",y).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=_("mouse",u.apply(this,arguments),Sn,this,arguments);o&&(yn(on.view).on("mousemove.drag",p,!0).on("mouseup.drag",v,!0),Cn(on.view),Nn(),e=!1,n=on.clientX,t=on.clientY,o("start"))}}function p(){if(En(),!e){var r=on.clientX-n,i=on.clientY-t;e=r*r+i*i>l}c.mouse("drag")}function v(){yn(on.view).on("mousemove.drag mouseup.drag",null),On(on.view,e),En(),c.mouse("end")}function g(){if(i.apply(this,arguments)){var n,t,e=on.changedTouches,r=u.apply(this,arguments),o=e.length;for(n=0;n<o;++n)(t=_(e[n].identifier,r,Tn,this,arguments))&&(Nn(),t("start"))}}function y(){var n,t,e=on.changedTouches,r=e.length;for(n=0;n<r;++n)(t=c[e[n].identifier])&&(En(),t("drag"))}function b(){var n,t,e=on.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),n=0;n<i;++n)(t=c[e[n].identifier])&&(Nn(),t("end"))}function _(n,t,e,r,i){var u,a,l,d=e(t,n),p=f.copy();if(ln(new zn(h,"beforestart",u,n,s,d[0],d[1],0,0,p),function(){return null!=(on.subject=u=o.apply(r,i))&&(a=u.x-d[0]||0,l=u.y-d[1]||0,!0)}))return function o(f){var v,g=d;switch(f){case"start":c[n]=o,v=s++;break;case"end":delete c[n],--s;case"drag":d=e(t,n),v=s}ln(new zn(h,f,u,n,v,d[0]+a,d[1]+l,d[0]-g[0],d[1]-g[1],p),p.apply,p,[f,r,i])}}return h.filter=function(n){return arguments.length?(i="function"==typeof n?n:Pn(!!n),h):i},h.container=function(n){return arguments.length?(u="function"==typeof n?n:Pn(n),h):u},h.subject=function(n){return arguments.length?(o="function"==typeof n?n:Pn(n),h):o},h.touchable=function(n){return arguments.length?(a="function"==typeof n?n:Pn(!!n),h):a},h.on=function(){var n=f.on.apply(f,arguments);return n===f?h:n},h.clickDistance=function(n){return arguments.length?(l=(n=+n)*n,h):Math.sqrt(l)},h},Fn=e(3),Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},In=0,Hn=0,Xn=0,Gn=1e3,Vn=0,$n=0,Wn=0,Zn="object"===("undefined"==typeof performance?"undefined":Yn(performance))&&performance.now?performance:Date,Qn="object"===("undefined"==typeof window?"undefined":Yn(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Jn(){return $n||(Qn(Kn),$n=Zn.now()+Wn)}function Kn(){$n=0}function nt(){this._call=this._time=this._next=null}function tt(n,t,e){var r=new nt;return r.restart(n,t,e),r}function et(){Jn(),++In;for(var n,t=qn;t;)(n=$n-t._time)>=0&&t._call.call(null,n),t=t._next;--In}function rt(){$n=(Vn=Zn.now())+Wn,In=Hn=0;try{et()}finally{In=0,function(){var n,t,e=qn,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:qn=t);Un=n,ut(r)}(),$n=0}}function it(){var n=Zn.now(),t=n-Vn;t>Gn&&(Wn-=t,Vn=n)}function ut(n){In||(Hn&&(Hn=clearTimeout(Hn)),n-$n>24?(n<1/0&&(Hn=setTimeout(rt,n-Zn.now()-Wn)),Xn&&(Xn=clearInterval(Xn))):(Xn||(Vn=Zn.now(),Xn=setInterval(it,Gn)),In=1,Qn(rt)))}nt.prototype=tt.prototype={constructor:nt,restart:function(n,t,e){if("function"!=typeof n)throw new TypeError("callback is not a function");e=(null==e?Jn():+e)+(null==t?0:+t),this._next||Un===this||(Un?Un._next=this:qn=this,Un=this),this._call=n,this._time=e,ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,ut())}};var ot=function(n,t,e){var r=new nt;return t=null==t?0:+t,r.restart(function(e){r.stop(),n(e+t)},t,e),r},at=function(n,t,e){var r=new nt,i=t;return null==t?(r.restart(n,t,e),r):(t=+t,e=null==e?Jn():+e,r.restart(function u(o){o+=i,r.restart(u,i+=t,e),n(o)},t,e),r)},ct=S("start","end","interrupt"),ft=[],st=0,lt=1,ht=2,dt=3,pt=4,vt=5,gt=6,yt=function(n,t,e,r,i,u){var o=n.__transition;if(o){if(e in o)return}else n.__transition={};!function(n,t,e){var r,i=n.__transition;function u(c){var f,s,l,h;if(e.state!==lt)return a();for(f in i)if((h=i[f]).name===e.name){if(h.state===dt)return ot(u);h.state===pt?(h.state=gt,h.timer.stop(),h.on.call("interrupt",n,n.__data__,h.index,h.group),delete i[f]):+f<t&&(h.state=gt,h.timer.stop(),delete i[f])}if(ot(function(){e.state===dt&&(e.state=pt,e.timer.restart(o,e.delay,e.time),o(c))}),e.state=ht,e.on.call("start",n,n.__data__,e.index,e.group),e.state===ht){for(e.state=dt,r=new Array(l=e.tween.length),f=0,s=-1;f<l;++f)(h=e.tween[f].value.call(n,n.__data__,e.index,e.group))&&(r[++s]=h);r.length=s+1}}function o(t){for(var i=t<e.duration?e.ease.call(null,t/e.duration):(e.timer.restart(a),e.state=vt,1),u=-1,o=r.length;++u<o;)r[u].call(null,i);e.state===vt&&(e.on.call("end",n,n.__data__,e.index,e.group),a())}function a(){for(var r in e.state=gt,e.timer.stop(),delete i[t],i)return;delete n.__transition}i[t]=e,e.timer=tt(function(n){e.state=lt,e.timer.restart(u,e.delay,e.time),e.delay<=n&&u(n-e.delay)},0,e.time)}(n,e,{name:t,index:r,group:i,on:ct,tween:ft,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:st})};function bt(n,t){var e=mt(n,t);if(e.state>st)throw new Error("too late; already scheduled");return e}function _t(n,t){var e=mt(n,t);if(e.state>ht)throw new Error("too late; already started");return e}function mt(n,t){var e=n.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}var xt=function(n,t){var e,r,i,u=n.__transition,o=!0;if(u){for(i in t=null==t?null:t+"",u)(e=u[i]).name===t?(r=e.state>ht&&e.state<vt,e.state=gt,e.timer.stop(),r&&e.on.call("interrupt",n,n.__data__,e.index,e.group),delete u[i]):o=!1;o&&delete n.__transition}};function wt(n,t,e){var r=n._id;return n.each(function(){var n=_t(this,r);(n.value||(n.value={}))[t]=e.apply(this,arguments)}),function(n){return mt(n,r).value[t]}}var Mt=e(2),St=function(n,t){var e;return("number"==typeof t?Fn.m:t instanceof Mt.a?Fn.o:(e=Object(Mt.a)(t))?(t=e,Fn.o):Fn.s)(n,t)};var At=gn.prototype.constructor;var Tt=0;function kt(n,t,e,r){this._groups=n,this._parents=t,this._name=e,this._id=r}function Nt(n){return gn().transition(n)}function Et(){return++Tt}var Ct=gn.prototype;function Ot(n){return+n}function Pt(n){return n*n}function zt(n){return n*(2-n)}function jt(n){return((n*=2)<=1?n*n:--n*(2-n)+1)/2}function Rt(n){return n*n*n}function Dt(n){return--n*n*n+1}function Lt(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}kt.prototype=Nt.prototype={constructor:kt,select:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=C(n));for(var r=this._groups,i=r.length,u=new Array(i),o=0;o<i;++o)for(var a,c,f=r[o],s=f.length,l=u[o]=new Array(s),h=0;h<s;++h)(a=f[h])&&(c=n.call(a,a.__data__,h,f))&&("__data__"in a&&(c.__data__=a.__data__),l[h]=c,yt(l[h],t,e,h,l,mt(a,e)));return new kt(u,this._parents,t,e)},selectAll:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=P(n));for(var r=this._groups,i=r.length,u=[],o=[],a=0;a<i;++a)for(var c,f=r[a],s=f.length,l=0;l<s;++l)if(c=f[l]){for(var h,d=n.call(c,c.__data__,l,f),p=mt(c,e),v=0,g=d.length;v<g;++v)(h=d[v])&&yt(h,t,e,v,d,p);u.push(d),o.push(c)}return new kt(u,o,t,e)},filter:function(n){"function"!=typeof n&&(n=D(n));for(var t=this._groups,e=t.length,r=new Array(e),i=0;i<e;++i)for(var u,o=t[i],a=o.length,c=r[i]=[],f=0;f<a;++f)(u=o[f])&&n.call(u,u.__data__,f,o)&&c.push(u);return new kt(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var t=this._groups,e=n._groups,r=t.length,i=e.length,u=Math.min(r,i),o=new Array(r),a=0;a<u;++a)for(var c,f=t[a],s=e[a],l=f.length,h=o[a]=new Array(l),d=0;d<l;++d)(c=f[d]||s[d])&&(h[d]=c);for(;a<r;++a)o[a]=t[a];return new kt(o,this._parents,this._name,this._id)},selection:function(){return new At(this._groups,this._parents)},transition:function(){for(var n=this._name,t=this._id,e=Et(),r=this._groups,i=r.length,u=0;u<i;++u)for(var o,a=r[u],c=a.length,f=0;f<c;++f)if(o=a[f]){var s=mt(o,t);yt(o,n,e,f,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new kt(r,this._parents,n,e)},call:Ct.call,nodes:Ct.nodes,node:Ct.node,size:Ct.size,empty:Ct.empty,each:Ct.each,on:function(n,t){var e=this._id;return arguments.length<2?mt(this.node(),e).on.on(n):this.each(function(n,t,e){var r,i,u=function(n){return(n+"").trim().split(/^|\s+/).every(function(n){var t=n.indexOf(".");return t>=0&&(n=n.slice(0,t)),!n||"start"===n})}(t)?bt:_t;return function(){var o=u(this,n),a=o.on;a!==r&&(i=(r=a).copy()).on(t,e),o.on=i}}(e,n,t))},attr:function(n,t){var e=k(n),r="transform"===e?Fn.u:St;return this.attrTween(n,"function"==typeof t?(e.local?function(n,t,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttributeNS(n.space,n.local))===a?null:o===r&&a===i?u:u=t(r=o,i=a);this.removeAttributeNS(n.space,n.local)}}:function(n,t,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttribute(n))===a?null:o===r&&a===i?u:u=t(r=o,i=a);this.removeAttribute(n)}})(e,r,wt(this,"attr."+n,t)):null==t?(e.local?function(n){return function(){this.removeAttributeNS(n.space,n.local)}}:function(n){return function(){this.removeAttribute(n)}})(e):(e.local?function(n,t,e){var r,i;return function(){var u=this.getAttributeNS(n.space,n.local);return u===e?null:u===r?i:i=t(r=u,e)}}:function(n,t,e){var r,i;return function(){var u=this.getAttribute(n);return u===e?null:u===r?i:i=t(r=u,e)}})(e,r,t+""))},attrTween:function(n,t){var e="attr."+n;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;var r=k(n);return this.tween(e,(r.local?function(n,t){function e(){var e=this,r=t.apply(e,arguments);return r&&function(t){e.setAttributeNS(n.space,n.local,r(t))}}return e._value=t,e}:function(n,t){function e(){var e=this,r=t.apply(e,arguments);return r&&function(t){e.setAttribute(n,r(t))}}return e._value=t,e})(r,t))},style:function(n,t,e){var r="transform"==(n+="")?Fn.t:St;return null==t?this.styleTween(n,function(n,t){var e,r,i;return function(){var u=H(this,n),o=(this.style.removeProperty(n),H(this,n));return u===o?null:u===e&&o===r?i:i=t(e=u,r=o)}}(n,r)).on("end.style."+n,function(n){return function(){this.style.removeProperty(n)}}(n)):this.styleTween(n,"function"==typeof t?function(n,t,e){var r,i,u;return function(){var o=H(this,n),a=e(this);return null==a&&(this.style.removeProperty(n),a=H(this,n)),o===a?null:o===r&&a===i?u:u=t(r=o,i=a)}}(n,r,wt(this,"style."+n,t)):function(n,t,e){var r,i;return function(){var u=H(this,n);return u===e?null:u===r?i:i=t(r=u,e)}}(n,r,t+""),e)},styleTween:function(n,t,e){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(n,t,e){function r(){var r=this,i=t.apply(r,arguments);return i&&function(t){r.style.setProperty(n,i(t),e)}}return r._value=t,r}(n,t,null==e?"":e))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var t=n(this);this.textContent=null==t?"":t}}(wt(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},remove:function(){return this.on("end.remove",function(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}(this._id))},tween:function(n,t){var e=this._id;if(n+="",arguments.length<2){for(var r,i=mt(this.node(),e).tween,u=0,o=i.length;u<o;++u)if((r=i[u]).name===n)return r.value;return null}return this.each((null==t?function(n,t){var e,r;return function(){var i=_t(this,n),u=i.tween;if(u!==e)for(var o=0,a=(r=e=u).length;o<a;++o)if(r[o].name===t){(r=r.slice()).splice(o,1);break}i.tween=r}}:function(n,t,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var u=_t(this,n),o=u.tween;if(o!==r){i=(r=o).slice();for(var a={name:t,value:e},c=0,f=i.length;c<f;++c)if(i[c].name===t){i[c]=a;break}c===f&&i.push(a)}u.tween=i}})(e,n,t))},delay:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?function(n,t){return function(){bt(this,n).delay=+t.apply(this,arguments)}}:function(n,t){return t=+t,function(){bt(this,n).delay=t}})(t,n)):mt(this.node(),t).delay},duration:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?function(n,t){return function(){_t(this,n).duration=+t.apply(this,arguments)}}:function(n,t){return t=+t,function(){_t(this,n).duration=t}})(t,n)):mt(this.node(),t).duration},ease:function(n){var t=this._id;return arguments.length?this.each(function(n,t){if("function"!=typeof t)throw new Error;return function(){_t(this,n).ease=t}}(t,n)):mt(this.node(),t).ease}};var qt=function n(t){function e(n){return Math.pow(n,t)}return t=+t,e.exponent=n,e}(3),Ut=function n(t){function e(n){return 1-Math.pow(1-n,t)}return t=+t,e.exponent=n,e}(3),Bt=function n(t){function e(n){return((n*=2)<=1?Math.pow(n,t):2-Math.pow(2-n,t))/2}return t=+t,e.exponent=n,e}(3),Ft=Math.PI,Yt=Ft/2;function It(n){return 1-Math.cos(n*Yt)}function Ht(n){return Math.sin(n*Yt)}function Xt(n){return(1-Math.cos(Ft*n))/2}function Gt(n){return Math.pow(2,10*n-10)}function Vt(n){return 1-Math.pow(2,-10*n)}function $t(n){return((n*=2)<=1?Math.pow(2,10*n-10):2-Math.pow(2,10-10*n))/2}function Wt(n){return 1-Math.sqrt(1-n*n)}function Zt(n){return Math.sqrt(1- --n*n)}function Qt(n){return((n*=2)<=1?1-Math.sqrt(1-n*n):Math.sqrt(1-(n-=2)*n)+1)/2}var Jt=4/11,Kt=6/11,ne=8/11,te=.75,ee=9/11,re=10/11,ie=.9375,ue=21/22,oe=63/64,ae=1/Jt/Jt;function ce(n){return 1-fe(1-n)}function fe(n){return(n=+n)<Jt?ae*n*n:n<ne?ae*(n-=Kt)*n+te:n<re?ae*(n-=ee)*n+ie:ae*(n-=ue)*n+oe}function se(n){return((n*=2)<=1?1-fe(1-n):fe(n-1)+1)/2}var le=function n(t){function e(n){return n*n*((t+1)*n-t)}return t=+t,e.overshoot=n,e}(1.70158),he=function n(t){function e(n){return--n*n*((t+1)*n+t)+1}return t=+t,e.overshoot=n,e}(1.70158),de=function n(t){function e(n){return((n*=2)<1?n*n*((t+1)*n-t):(n-=2)*n*((t+1)*n+t)+2)/2}return t=+t,e.overshoot=n,e}(1.70158),pe=2*Math.PI,ve=function n(t,e){var r=Math.asin(1/(t=Math.max(1,t)))*(e/=pe);function i(n){return t*Math.pow(2,10*--n)*Math.sin((r-n)/e)}return i.amplitude=function(t){return n(t,e*pe)},i.period=function(e){return n(t,e)},i}(1,.3),ge=function n(t,e){var r=Math.asin(1/(t=Math.max(1,t)))*(e/=pe);function i(n){return 1-t*Math.pow(2,-10*(n=+n))*Math.sin((n+r)/e)}return i.amplitude=function(t){return n(t,e*pe)},i.period=function(e){return n(t,e)},i}(1,.3),ye=function n(t,e){var r=Math.asin(1/(t=Math.max(1,t)))*(e/=pe);function i(n){return((n=2*n-1)<0?t*Math.pow(2,10*n)*Math.sin((r-n)/e):2-t*Math.pow(2,-10*n)*Math.sin((r+n)/e))/2}return i.amplitude=function(t){return n(t,e*pe)},i.period=function(e){return n(t,e)},i}(1,.3),be={time:null,delay:0,duration:250,ease:Lt};function _e(n,t){for(var e;!(e=n.__transition)||!(e=e[t]);)if(!(n=n.parentNode))return be.time=Jn(),be;return e}gn.prototype.interrupt=function(n){return this.each(function(){xt(this,n)})},gn.prototype.transition=function(n){var t,e;n instanceof kt?(t=n._id,n=n._name):(t=Et(),(e=be).time=Jn(),n=null==n?null:n+"");for(var r=this._groups,i=r.length,u=0;u<i;++u)for(var o,a=r[u],c=a.length,f=0;f<c;++f)(o=a[f])&&yt(o,n,t,f,a,e||_e(o,t));return new kt(r,this._parents,n,t)};var me=[null],xe=function(n,t){var e,r,i=n.__transition;if(i)for(r in t=null==t?null:t+"",i)if((e=i[r]).state>lt&&e.name===t)return new kt([[n]],me,t,+r);return null},we=function(n){return function(){return n}},Me=function(n,t,e){this.target=n,this.type=t,this.selection=e};function Se(){on.stopImmediatePropagation()}var Ae=function(){on.preventDefault(),on.stopImmediatePropagation()},Te={name:"drag"},ke={name:"space"},Ne={name:"handle"},Ee={name:"center"},Ce={name:"x",handles:["e","w"].map(qe),input:function(n,t){return n&&[[n[0],t[0][1]],[n[1],t[1][1]]]},output:function(n){return n&&[n[0][0],n[1][0]]}},Oe={name:"y",handles:["n","s"].map(qe),input:function(n,t){return n&&[[t[0][0],n[0]],[t[1][0],n[1]]]},output:function(n){return n&&[n[0][1],n[1][1]]}},Pe={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(qe),input:function(n){return n},output:function(n){return n}},ze={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},je={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Re={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},De={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Le={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function qe(n){return{type:n}}function Ue(){return!on.button}function Be(){var n=this.ownerSVGElement||this;return[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]}function Fe(n){for(;!n.__brush;)if(!(n=n.parentNode))return;return n.__brush}function Ye(n){return n[0][0]===n[1][0]||n[0][1]===n[1][1]}function Ie(n){var t=n.__brush;return t?t.dim.output(t.selection):null}function He(){return Ve(Ce)}function Xe(){return Ve(Oe)}var Ge=function(){return Ve(Pe)};function Ve(n){var t,e=Be,r=Ue,i=S(o,"start","brush","end"),u=6;function o(t){var e=t.property("__brush",l).selectAll(".overlay").data([qe("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ze.overlay).merge(e).each(function(){var n=Fe(this).extent;yn(this).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1])}),t.selectAll(".selection").data([qe("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ze.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=t.selectAll(".handle").data(n.handles,function(n){return n.type});r.exit().remove(),r.enter().append("rect").attr("class",function(n){return"handle handle--"+n.type}).attr("cursor",function(n){return ze[n.type]}),t.each(a).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s