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