Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Created March 16, 2014 00:49
Show Gist options
  • Save max-mapper/9576573 to your computer and use it in GitHub Desktop.
Save max-mapper/9576573 to your computer and use it in GitHub Desktop.
requirebin sketch
var d3 = require('d3')
var grid = require('d3-grid-layout')(d3)
var layout = grid()
.width(window.innerWidth - 40)
.height(window.innerHeight - 40)
.radius(80)
.align(0)
.ease('back', 2)
var svg = d3.select('body')
.append('svg')
.style('margin', '0 auto')
.style('display', 'block')
.attr('width', window.innerWidth)
.attr('height', window.innerHeight)
var group = svg
.append('g')
.attr('transform', 'translate(20,20)')
var nodes = group
.selectAll('.node')
.data(layout.nodes())
layout.on('tick', function() {
nodes
.attr('cx', function(d) { return d.x })
.attr('cy', function(d) { return d.y })
})
setInterval(function() {
layout.push({
scale: Math.pow(Math.random(), 2) * 10 + 3
})
nodes = nodes.data(layout.nodes())
nodes.enter()
.append('circle')
.classed('node', true)
.attr('r', 0)
.style('fill', '#a88')
.style('stroke', '#544')
.style('stroke-width', '2px')
.transition()
.duration(350)
.ease('elastic')
.attr('r', function(d) { return d.scale })
}, 250)
window.onresize = function() {
layout
.width(window.innerWidth - 40)
.height(window.innerHeight - 40)
.update()
svg.attr('width', window.innerWidth)
svg.attr('height', window.innerHeight)
}
require=function e(n,t,r){function u(o,a){if(!t[o]){if(!n[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(i)return i(o,!0);throw Error("Cannot find module '"+o+"'")}var s=t[o]={exports:{}};n[o][0].call(s.exports,function(t){var r=n[o][1][t];return u(r?r:t)},s,s.exports,e,n,t,r)}return t[o].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)u(r[o]);return u}({Ub4Hh8:[function(n,t){!function(){function n(n){return null!=n&&!isNaN(n)}function r(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function u(n,t){try{for(var r in t)Object.defineProperty(n.prototype,r,{value:t[r],enumerable:!1})}catch(e){n.prototype=t}}function i(){}function o(n){return ca+n in this}function a(n){return n=ca+n,n in this&&delete this[n]}function c(){var n=[];return this.forEach(function(t){n.push(t)}),n}function s(){var n=0;for(var t in this)t.charCodeAt(0)===sa&&++n;return n}function l(){for(var n in this)if(n.charCodeAt(0)===sa)return!1;return!0}function f(){}function h(n,t,r){return function(){var e=r.apply(t,arguments);return e===t?n:e}}function g(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var r=0,e=la.length;e>r;++r){var u=la[r]+t;if(u in n)return u}}function p(){}function d(){}function v(n){function t(){for(var t,e=r,u=-1,i=e.length;i>++u;)(t=e[u].on)&&t.apply(this,arguments);return n}var r=[],e=new i;return t.on=function(t,u){var i,o=e.get(t);return 2>arguments.length?o&&o.on:(o&&(o.on=null,r=r.slice(0,i=r.indexOf(o)).concat(r.slice(i+1)),e.remove(t)),u&&r.push(e.set(t,{on:u})),n)},t}function m(){$o.event.preventDefault()}function y(){for(var n,t=$o.event;n=t.sourceEvent;)t=n;return t}function x(n){for(var t=new d,r=0,e=arguments.length;e>++r;)t[arguments[r]]=v(t);return t.of=function(r,e){return function(u){try{var i=u.sourceEvent=$o.event;u.target=n,$o.event=u,t[u.type].apply(r,e)}finally{$o.event=i}}},t}function M(n){return ha(n,ma),n}function _(n){return"function"==typeof n?n:function(){return ga(n,this)}}function b(n){return"function"==typeof n?n:function(){return pa(n,this)}}function w(n,t){function r(){this.removeAttribute(n)}function e(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var r=t.apply(this,arguments);null==r?this.removeAttribute(n):this.setAttribute(n,r)}function a(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,r)}return n=$o.ns.qualify(n),null==t?n.local?e:r:"function"==typeof t?n.local?a:o:n.local?i:u}function k(n){return n.trim().replace(/\s+/g," ")}function S(n){return RegExp("(?:^|\\s+)"+$o.requote(n)+"(?:\\s+|$)","g")}function E(n){return n.trim().split(/^|\s+/)}function A(n,t){function r(){for(var r=-1;u>++r;)n[r](this,t)}function e(){for(var r=-1,e=t.apply(this,arguments);u>++r;)n[r](this,e)}n=E(n).map(C);var u=n.length;return"function"==typeof t?e:r}function C(n){var t=S(n);return function(r,e){if(u=r.classList)return e?u.add(n):u.remove(n);var u=r.getAttribute("class")||"";e?(t.lastIndex=0,t.test(u)||r.setAttribute("class",k(u+" "+n))):r.setAttribute("class",k(u.replace(t," ")))}}function N(n,t,r){function e(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,r)}function i(){var e=t.apply(this,arguments);null==e?this.style.removeProperty(n):this.style.setProperty(n,e,r)}return null==t?e:"function"==typeof t?i:u}function q(n,t){function r(){delete this[n]}function e(){this[n]=t}function u(){var r=t.apply(this,arguments);null==r?delete this[n]:this[n]=r}return null==t?r:"function"==typeof t?u:e}function z(n){return"function"==typeof n?n:(n=$o.ns.qualify(n)).local?function(){return this.ownerDocument.createElementNS(n.space,n.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,n)}}function L(n){return{__data__:n}}function T(n){return function(){return va(this,n)}}function D(n){return arguments.length||(n=$o.ascending),function(t,r){return t&&r?n(t.__data__,r.__data__):!t-!r}}function R(n,t){for(var r=0,e=n.length;e>r;r++)for(var u,i=n[r],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,r);return n}function U(n){return ha(n,xa),n}function P(n){var t,r;return function(e,u,i){var o,a=n[i].update,c=a.length;for(i!=r&&(r=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&c>++t;);return o}}function j(){var n=this.__transition__;n&&++n.active}function H(n,t,r){function e(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,Wo(arguments));e.call(this),this.addEventListener(n,this[o]=u,u.$=r),u._=t}function i(){var t,r=RegExp("^__on([^.]+)"+$o.requote(n)+"$");for(var e in this)if(t=e.match(r)){var u=this[e];this.removeEventListener(t[1],u,u.$),delete this[e]}}var o="__on"+n,a=n.indexOf("."),c=F;a>0&&(n=n.substring(0,a));var s=_a.get(n);return s&&(n=s,c=O),a?t?u:e:t?p:i}function F(n,t){return function(r){var e=$o.event;$o.event=r,t[0]=this.__data__;try{n.apply(this,t)}finally{$o.event=e}}}function O(n,t){var r=F(n,t);return function(n){var t=this,e=n.relatedTarget;e&&(e===t||8&e.compareDocumentPosition(t))||r.call(t,n)}}function I(){var n=".dragsuppress-"+ ++wa,t="click"+n,r=$o.select(Ko).on("touchmove"+n,m).on("dragstart"+n,m).on("selectstart"+n,m);if(ba){var e=Go.style,u=e[ba];e[ba]="none"}return function(i){function o(){r.on(t,null)}r.on(n,null),ba&&(e[ba]=u),i&&(r.on(t,function(){m(),o()},!0),setTimeout(o,0))}}function Y(n,t){t.changedTouches&&(t=t.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var e=r.createSVGPoint();if(0>ka&&(Ko.scrollX||Ko.scrollY)){r=$o.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();ka=!(u.f||u.e),r.remove()}return ka?(e.x=t.pageX,e.y=t.pageY):(e.x=t.clientX,e.y=t.clientY),e=e.matrixTransform(n.getScreenCTM().inverse()),[e.x,e.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function Z(n){return n>0?1:0>n?-1:0}function V(n,t,r){return(t[0]-n[0])*(r[1]-n[1])-(t[1]-n[1])*(r[0]-n[0])}function X(n){return n>1?0:-1>n?Sa:Math.acos(n)}function $(n){return n>1?Aa:-1>n?-Aa:Math.asin(n)}function B(n){return((n=Math.exp(n))-1/n)/2}function W(n){return((n=Math.exp(n))+1/n)/2}function J(n){return((n=Math.exp(2*n))-1)/(n+1)}function G(n){return(n=Math.sin(n/2))*n}function K(){}function Q(n,t,r){return new nt(n,t,r)}function nt(n,t,r){this.h=n,this.s=t,this.l=r}function tt(n,t,r){function e(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*e(n))}var i,o;return n=isNaN(n)?0:0>(n%=360)?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,r=0>r?0:r>1?1:r,o=.5>=r?r*(1+t):r+t-r*t,i=2*r-o,pt(u(n+120),u(n),u(n-120))}function rt(n,t,r){return new et(n,t,r)}function et(n,t,r){this.h=n,this.c=t,this.l=r}function ut(n,t,r){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),it(r,Math.cos(n*=qa)*t,Math.sin(n)*t)}function it(n,t,r){return new ot(n,t,r)}function ot(n,t,r){this.l=n,this.a=t,this.b=r}function at(n,t,r){var e=(n+16)/116,u=e+t/500,i=e-r/200;return u=st(u)*Oa,e=st(e)*Ia,i=st(i)*Ya,pt(ft(3.2404542*u-1.5371385*e-.4985314*i),ft(-.969266*u+1.8760108*e+.041556*i),ft(.0556434*u-.2040259*e+1.0572252*i))}function ct(n,t,r){return n>0?rt(Math.atan2(r,t)*za,Math.sqrt(t*t+r*r),n):rt(0/0,0/0,n)}function st(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function lt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function ft(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ht(n){return pt(n>>16,255&n>>8,255&n)}function gt(n){return ht(n)+""}function pt(n,t,r){return new dt(n,t,r)}function dt(n,t,r){this.r=n,this.g=t,this.b=r}function vt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function mt(n,t,r){var e,u,i,o=0,a=0,c=0;if(e=/([a-z]+)\((.*)\)/i.exec(n))switch(u=e[2].split(","),e[1]){case"hsl":return r(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(_t(u[0]),_t(u[1]),_t(u[2]))}return(i=Xa.get(n))?t(i.r,i.g,i.b):(null!=n&&"#"===n.charAt(0)&&(4===n.length?(o=n.charAt(1),o+=o,a=n.charAt(2),a+=a,c=n.charAt(3),c+=c):7===n.length&&(o=n.substring(1,3),a=n.substring(3,5),c=n.substring(5,7)),o=parseInt(o,16),a=parseInt(a,16),c=parseInt(c,16)),t(o,a,c))}function yt(n,t,r){var e,u,i=Math.min(n/=255,t/=255,r/=255),o=Math.max(n,t,r),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),e=n==o?(t-r)/a+(r>t?6:0):t==o?(r-n)/a+2:(n-t)/a+4,e*=60):(e=0/0,u=c>0&&1>c?0:e),Q(e,u,c)}function xt(n,t,r){n=Mt(n),t=Mt(t),r=Mt(r);var e=lt((.4124564*n+.3575761*t+.1804375*r)/Oa),u=lt((.2126729*n+.7151522*t+.072175*r)/Ia),i=lt((.0193339*n+.119192*t+.9503041*r)/Ya);return it(116*u-16,500*(e-u),200*(u-i))}function Mt(n){return.04045>=(n/=255)?n/12.92:Math.pow((n+.055)/1.055,2.4)}function _t(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function bt(n){return"function"==typeof n?n:function(){return n}}function wt(n){return n}function kt(n){return function(t,r,e){return 2===arguments.length&&"function"==typeof r&&(e=r,r=null),St(t,r,n,e)}}function St(n,t,r,e){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=r.call(i,c)}catch(e){return o.error.call(i,e),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=$o.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,s=null;return!Ko.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=$o.event;$o.event=n;try{o.progress.call(i,c)}finally{$o.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),2>arguments.length?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(s=n,i):s},i.response=function(n){return r=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(Wo(arguments)))}}),i.send=function(r,e,u){if(2===arguments.length&&"function"==typeof e&&(u=e,e=null),c.open(r,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var l in a)c.setRequestHeader(l,a[l]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=s&&(c.responseType=s),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==e?null:e),i},i.abort=function(){return c.abort(),i},$o.rebind(i,o,"on"),null==e?i:i.get(Et(e))}function Et(n){return 1===n.length?function(t,r){n(null==t?r:null)}:n}function At(){var n=Ct(),t=Nt()-n;t>24?(isFinite(t)&&(clearTimeout(Ja),Ja=setTimeout(At,t)),Wa=0):(Wa=1,Ka(At))}function Ct(){var n=Date.now();for(Ga=$a;Ga;)n>=Ga.t&&(Ga.f=Ga.c(n-Ga.t)),Ga=Ga.n;return n}function Nt(){for(var n,t=$a,r=1/0;t;)t.f?t=n?n.n=t.n:$a=t.n:(r>t.t&&(r=t.t),t=(n=t).n);return Ba=n,r}function qt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function zt(n,t){var r=Math.pow(10,3*aa(8-t));return{scale:t>8?function(n){return n/r}:function(n){return n*r},symbol:n}}function Lt(n){var t=n.decimal,r=n.thousands,e=n.grouping,u=n.currency,i=e?function(n){for(var t=n.length,u=[],i=0,o=e[0];t>0&&o>0;)u.push(n.substring(t-=o,t+o)),o=e[i=(i+1)%e.length];return u.reverse().join(r)}:wt;return function(n){var r=nc.exec(n),e=r[1]||" ",o=r[2]||">",a=r[3]||"",c=r[4]||"",s=r[5],l=+r[6],f=r[7],h=r[8],g=r[9],p=1,d="",v="",m=!1;switch(h&&(h=+h.substring(1)),(s||"0"===e&&"="===o)&&(s=e="0",o="=",f&&(l-=Math.floor((l-1)/4))),g){case"n":f=!0,g="g";break;case"%":p=100,v="%",g="f";break;case"p":p=100,v="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(d="0"+g.toLowerCase());case"c":case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(d=u[0],v=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=tc.get(g)||Tt;var y=s&&f;return function(n){var r=v;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):a;if(0>p){var c=$o.formatPrefix(n,h);n=c.scale(n),r=c.symbol+v}else n*=p;n=g(n,h);var x=n.lastIndexOf("."),M=0>x?n:n.substring(0,x),_=0>x?"":t+n.substring(x+1);!s&&f&&(M=i(M));var b=d.length+M.length+_.length+(y?0:u.length),w=l>b?Array(b=l-b+1).join(e):"";return y&&(M=i(w+M)),u+=d,n=M+_,("<"===o?u+n+w:">"===o?w+u+n:"^"===o?w.substring(0,b>>=1)+u+n+w.substring(b):u+(y?n:w+n))+r}}}function Tt(n){return n+""}function Dt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Rt(n,t,r){function e(t){var r=n(t),e=i(r,1);return e-t>t-r?r:e}function u(r){return t(r=n(new ec(r-1)),1),r}function i(n,r){return t(n=new ec(+n),r),n}function o(n,e,i){var o=u(n),a=[];if(i>1)for(;e>o;)r(o)%i||a.push(new Date(+o)),t(o,1);else for(;e>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,r){try{ec=Dt;var e=new Dt;return e._=n,o(e,t,r)}finally{ec=Date}}n.floor=n,n.round=e,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ut(n);return c.floor=c,c.round=Ut(e),c.ceil=Ut(u),c.offset=Ut(i),c.range=a,n}function Ut(n){return function(t,r){try{ec=Dt;var e=new Dt;return e._=t,n(e,r)._}finally{ec=Date}}}function Pt(n){function t(n){function t(t){for(var r,u,i,o=[],a=-1,c=0;e>++a;)37===n.charCodeAt(a)&&(o.push(n.substring(c,a)),null!=(u=ic[r=n.charAt(++a)])&&(r=n.charAt(++a)),(i=C[r])&&(r=i(t,null==u?"e"===r?" ":"0":u)),o.push(r),c=a+1);return o.push(n.substring(c,a)),o.join("")}var e=n.length;return t.parse=function(t){var e={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=r(e,n,t,0);if(u!=t.length)return null;"p"in e&&(e.H=e.H%12+12*e.p);var i=null!=e.Z&&ec!==Dt,o=new(i?Dt:ec);return"j"in e?o.setFullYear(e.y,0,e.j):"w"in e&&("W"in e||"U"in e)?(o.setFullYear(e.y,0,1),o.setFullYear(e.y,0,"W"in e?(e.w+6)%7+7*e.W-(o.getDay()+5)%7:e.w+7*e.U-(o.getDay()+6)%7)):o.setFullYear(e.y,e.m,e.d),o.setHours(e.H+Math.floor(e.Z/100),e.M+e.Z%100,e.S,e.L),i?o._:o},t.toString=function(){return n},t}function r(n,t,r,e){for(var u,i,o,a=0,c=t.length,s=r.length;c>a;){if(e>=s)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=N[o in ic?t.charAt(a++):o],!i||0>(e=i(n,r,e)))return-1}else if(u!=r.charCodeAt(e++))return-1}return e}function e(n,t,r){b.lastIndex=0;var e=b.exec(t.substring(r));return e?(n.w=w.get(e[0].toLowerCase()),r+e[0].length):-1}function u(n,t,r){M.lastIndex=0;var e=M.exec(t.substring(r));return e?(n.w=_.get(e[0].toLowerCase()),r+e[0].length):-1}function i(n,t,r){E.lastIndex=0;var e=E.exec(t.substring(r));return e?(n.m=A.get(e[0].toLowerCase()),r+e[0].length):-1}function o(n,t,r){k.lastIndex=0;var e=k.exec(t.substring(r));return e?(n.m=S.get(e[0].toLowerCase()),r+e[0].length):-1}function a(n,t,e){return r(n,""+C.c,t,e)}function c(n,t,e){return r(n,""+C.x,t,e)}function s(n,t,e){return r(n,""+C.X,t,e)}function l(n,t,r){var e=x.get(t.substring(r,r+=2).toLowerCase());return null==e?-1:(n.p=e,r)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,d=n.days,v=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function r(n){try{ec=Dt;var t=new ec;return t._=n,e(t)}finally{ec=Date}}var e=t(n);return r.parse=function(n){try{ec=Dt;var t=e.parse(n);return t&&t._}finally{ec=Date}},r.toString=e.toString,r},t.multi=t.utc.multi=er;var x=$o.map(),M=Ht(d),_=Ft(d),b=Ht(v),w=Ft(v),k=Ht(m),S=Ft(m),E=Ht(y),A=Ft(y);p.forEach(function(n,t){x.set(n.toLowerCase(),t)});var C={a:function(n){return v[n.getDay()]},A:function(n){return d[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return jt(n.getDate(),t,2)},e:function(n,t){return jt(n.getDate(),t,2)},H:function(n,t){return jt(n.getHours(),t,2)},I:function(n,t){return jt(n.getHours()%12||12,t,2)},j:function(n,t){return jt(1+rc.dayOfYear(n),t,3)},L:function(n,t){return jt(n.getMilliseconds(),t,3)},m:function(n,t){return jt(n.getMonth()+1,t,2)},M:function(n,t){return jt(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return jt(n.getSeconds(),t,2)},U:function(n,t){return jt(rc.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return jt(rc.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return jt(n.getFullYear()%100,t,2)},Y:function(n,t){return jt(n.getFullYear()%1e4,t,4)},Z:tr,"%":function(){return"%"}},N={a:e,A:u,b:i,B:o,c:a,d:Wt,e:Wt,H:Gt,I:Gt,j:Jt,L:nr,m:Bt,M:Kt,p:l,S:Qt,U:It,w:Ot,W:Yt,x:c,X:s,y:Vt,Y:Zt,Z:Xt,"%":rr};return t}function jt(n,t,r){var e=0>n?"-":"",u=(e?-n:n)+"",i=u.length;return e+(r>i?Array(r-i+1).join(t)+u:u)}function Ht(n){return RegExp("^(?:"+n.map($o.requote).join("|")+")","i")}function Ft(n){for(var t=new i,r=-1,e=n.length;e>++r;)t.set(n[r].toLowerCase(),r);return t}function Ot(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+1));return e?(n.w=+e[0],r+e[0].length):-1}function It(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r));return e?(n.U=+e[0],r+e[0].length):-1}function Yt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r));return e?(n.W=+e[0],r+e[0].length):-1}function Zt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+4));return e?(n.y=+e[0],r+e[0].length):-1}function Vt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+2));return e?(n.y=$t(+e[0]),r+e[0].length):-1}function Xt(n,t,r){return/^[+-]\d{4}$/.test(t=t.substring(r,r+5))?(n.Z=+t,r+5):-1}function $t(n){return n+(n>68?1900:2e3)}function Bt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+2));return e?(n.m=e[0]-1,r+e[0].length):-1}function Wt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+2));return e?(n.d=+e[0],r+e[0].length):-1}function Jt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+3));return e?(n.j=+e[0],r+e[0].length):-1}function Gt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+2));return e?(n.H=+e[0],r+e[0].length):-1}function Kt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+2));return e?(n.M=+e[0],r+e[0].length):-1}function Qt(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+2));return e?(n.S=+e[0],r+e[0].length):-1}function nr(n,t,r){oc.lastIndex=0;var e=oc.exec(t.substring(r,r+3));return e?(n.L=+e[0],r+e[0].length):-1}function tr(n){var t=n.getTimezoneOffset(),r=t>0?"-":"+",e=~~(aa(t)/60),u=aa(t)%60;return r+jt(e,"0",2)+jt(u,"0",2)}function rr(n,t,r){ac.lastIndex=0;var e=ac.exec(t.substring(r,r+1));return e?r+e[0].length:-1}function er(n){for(var t=n.length,r=-1;t>++r;)n[r][0]=this(n[r][0]);return function(t){for(var r=0,e=n[r];!e[1](t);)e=n[++r];return e[0](t)}}function ur(){}function ir(n,t,r){var e=r.s=n+t,u=e-n,i=e-u;r.t=n-i+(t-u)}function or(n,t){n&&fc.hasOwnProperty(n.type)&&fc[n.type](n,t)}function ar(n,t,r){var e,u=-1,i=n.length-r;for(t.lineStart();i>++u;)e=n[u],t.point(e[0],e[1],e[2]);t.lineEnd()}function cr(n,t){var r=-1,e=n.length;for(t.polygonStart();e>++r;)ar(n[r],t,1);t.polygonEnd()}function sr(){function n(n,t){n*=qa,t=t*qa/2+Sa/4;var r=n-e,o=r>=0?1:-1,a=o*r,c=Math.cos(t),s=Math.sin(t),l=i*s,f=u*c+l*Math.cos(a),h=l*o*Math.sin(a);gc.add(Math.atan2(h,f)),e=n,u=c,i=s}var t,r,e,u,i;pc.point=function(o,a){pc.point=n,e=(t=o)*qa,u=Math.cos(a=(r=a)*qa/2+Sa/4),i=Math.sin(a)},pc.lineEnd=function(){n(t,r)}}function lr(n){var t=n[0],r=n[1],e=Math.cos(r);return[e*Math.cos(t),e*Math.sin(t),Math.sin(r)]}function fr(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function hr(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function gr(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function pr(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function dr(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function vr(n){return[Math.atan2(n[1],n[0]),$(n[2])]}function mr(n,t){return Ca>aa(n[0]-t[0])&&Ca>aa(n[1]-t[1])}function yr(n,t){n*=qa;var r=Math.cos(t*=qa);xr(r*Math.cos(n),r*Math.sin(n),Math.sin(t))}function xr(n,t,r){++dc,mc+=(n-mc)/dc,yc+=(t-yc)/dc,xc+=(r-xc)/dc}function Mr(){function n(n,u){n*=qa;var i=Math.cos(u*=qa),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),s=Math.atan2(Math.sqrt((s=r*c-e*a)*s+(s=e*o-t*c)*s+(s=t*a-r*o)*s),t*o+r*a+e*c);vc+=s,Mc+=s*(t+(t=o)),_c+=s*(r+(r=a)),bc+=s*(e+(e=c)),xr(t,r,e)}var t,r,e;Ec.point=function(u,i){u*=qa;var o=Math.cos(i*=qa);t=o*Math.cos(u),r=o*Math.sin(u),e=Math.sin(i),Ec.point=n,xr(t,r,e)}}function _r(){Ec.point=yr}function br(){function n(n,t){n*=qa;var r=Math.cos(t*=qa),o=r*Math.cos(n),a=r*Math.sin(n),c=Math.sin(t),s=u*c-i*a,l=i*o-e*c,f=e*a-u*o,h=Math.sqrt(s*s+l*l+f*f),g=e*o+u*a+i*c,p=h&&-X(g)/h,d=Math.atan2(h,g);wc+=p*s,kc+=p*l,Sc+=p*f,vc+=d,Mc+=d*(e+(e=o)),_c+=d*(u+(u=a)),bc+=d*(i+(i=c)),xr(e,u,i)}var t,r,e,u,i;Ec.point=function(o,a){t=o,r=a,Ec.point=n,o*=qa;var c=Math.cos(a*=qa);e=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),xr(e,u,i)},Ec.lineEnd=function(){n(t,r),Ec.lineEnd=_r,Ec.point=yr}}function wr(){return!0}function kr(n,t,r,e,u){var i=[],o=[];if(n.forEach(function(n){if(!(0>=(t=n.length-1))){var t,r=n[0],e=n[t];if(mr(r,e)){u.lineStart();for(var a=0;t>a;++a)u.point((r=n[a])[0],r[1]);return u.lineEnd(),void 0}var c=new Er(r,n,null,!0),s=new Er(r,null,c,!1);c.o=s,i.push(c),o.push(s),c=new Er(e,n,null,!1),s=new Er(e,null,c,!0),c.o=s,i.push(c),o.push(s)}}),o.sort(t),Sr(i),Sr(o),i.length){for(var a=0,c=r,s=o.length;s>a;++a)o[a].e=c=!c;for(var l,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;l=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,s=l.length;s>a;++a)u.point((f=l[a])[0],f[1]);else e(g.x,g.n.x,1,u);g=g.n}else{if(p){l=g.p.z;for(var a=l.length-1;a>=0;--a)u.point((f=l[a])[0],f[1])}else e(g.x,g.p.x,-1,u);g=g.p}g=g.o,l=g.z,p=!p}while(!g.v);u.lineEnd()}}}function Sr(n){if(t=n.length){for(var t,r,e=0,u=n[0];t>++e;)u.n=r=n[e],r.p=u,u=r;u.n=r=n[0],r.p=u}}function Er(n,t,r,e){this.x=n,this.z=t,this.o=r,this.e=e,this.v=!1,this.n=this.p=null}function Ar(n,t,r,e){return function(u,i){function o(t,r){var e=u(t,r);n(t=e[0],r=e[1])&&i.point(t,r)}function a(n,t){var r=u(n,t);v.point(r[0],r[1])}function c(){y.point=a,v.lineStart()}function s(){y.point=o,v.lineEnd()}function l(n,t){d.push([n,t]);var r=u(n,t);M.point(r[0],r[1])}function f(){M.lineStart(),d=[]}function h(){l(d[0][0],d[0][1]),M.lineEnd();var n,t=M.clean(),r=x.buffer(),e=r.length;if(d.pop(),p.push(d),d=null,e){if(1&t){n=r[0];var u,e=n.length-1,o=-1;for(i.lineStart();e>++o;)i.point((u=n[o])[0],u[1]);return i.lineEnd(),void 0}e>1&&2&t&&r.push(r.pop().concat(r.shift())),g.push(r.filter(Cr))}}var g,p,d,v=t(i),m=u.invert(e[0],e[1]),y={point:o,lineStart:c,lineEnd:s,polygonStart:function(){y.point=l,y.lineStart=f,y.lineEnd=h,g=[],p=[],i.polygonStart()},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=s,g=$o.merge(g);var n=zr(m,p);g.length?kr(g,qr,n,r,i):n&&(i.lineStart(),r(null,null,1,i),i.lineEnd()),i.polygonEnd(),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Nr(),M=t(x);return y}}function Cr(n){return n.length>1}function Nr(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,r){n.push([t,r])},lineEnd:p,buffer:function(){var r=t;return t=[],n=null,r},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function qr(n,t){return(0>(n=n.x)[0]?n[1]-Aa-Ca:Aa-n[1])-(0>(t=t.x)[0]?t[1]-Aa-Ca:Aa-t[1])}function zr(n,t){var r=n[0],e=n[1],u=[Math.sin(r),-Math.cos(r),0],i=0,o=0;gc.reset();for(var a=0,c=t.length;c>a;++a){var s=t[a],l=s.length;if(l)for(var f=s[0],h=f[0],g=f[1]/2+Sa/4,p=Math.sin(g),d=Math.cos(g),v=1;;){v===l&&(v=0),n=s[v];var m=n[0],y=n[1]/2+Sa/4,x=Math.sin(y),M=Math.cos(y),_=m-h,b=_>=0?1:-1,w=b*_,k=w>Sa,S=p*x;if(gc.add(Math.atan2(S*b*Math.sin(w),d*M+S*Math.cos(w))),i+=k?_+b*Ea:_,k^h>=r^m>=r){var E=hr(lr(f),lr(n));dr(E);var A=hr(u,E);dr(A);var C=(k^_>=0?-1:1)*$(A[2]);(e>C||e===C&&(E[0]||E[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;h=m,p=x,d=M,f=n}}return(-Ca>i||Ca>i&&0>gc)^1&o}function Lr(n){var t,r=0/0,e=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?Sa:-Sa,c=aa(i-r);Ca>aa(c-Sa)?(n.point(r,e=(e+o)/2>0?Aa:-Aa),n.point(u,e),n.lineEnd(),n.lineStart(),n.point(a,e),n.point(i,e),t=0):u!==a&&c>=Sa&&(Ca>aa(r-u)&&(r-=u*Ca),Ca>aa(i-a)&&(i-=a*Ca),e=Tr(r,e,i,o),n.point(u,e),n.lineEnd(),n.lineStart(),n.point(a,e),t=0),n.point(r=i,e=o),u=a},lineEnd:function(){n.lineEnd(),r=e=0/0},clean:function(){return 2-t}}}function Tr(n,t,r,e){var u,i,o=Math.sin(n-r);return aa(o)>Ca?Math.atan((Math.sin(t)*(i=Math.cos(e))*Math.sin(r)-Math.sin(e)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+e)/2}function Dr(n,t,r,e){var u;if(null==n)u=r*Aa,e.point(-Sa,u),e.point(0,u),e.point(Sa,u),e.point(Sa,0),e.point(Sa,-u),e.point(0,-u),e.point(-Sa,-u),e.point(-Sa,0),e.point(-Sa,u);else if(aa(n[0]-t[0])>Ca){var i=n[0]<t[0]?Sa:-Sa;u=r*i/2,e.point(-i,u),e.point(0,u),e.point(i,u)}else e.point(t[0],t[1])}function Rr(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function r(n){var r,i,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var g,p=[f,h],d=t(f,h),v=o?d?0:u(f,h):d?u(f+(0>f?Sa:-Sa),h):0;if(!r&&(s=c=d)&&n.lineStart(),d!==c&&(g=e(r,p),(mr(r,g)||mr(p,g))&&(p[0]+=Ca,p[1]+=Ca,d=t(p[0],p[1]))),d!==c)l=0,d?(n.lineStart(),g=e(p,r),n.point(g[0],g[1])):(g=e(r,p),n.point(g[0],g[1]),n.lineEnd()),r=g;else if(a&&r&&o^d){var m;v&i||!(m=e(p,r,!0))||(l=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!d||r&&mr(r,p)||n.point(p[0],p[1]),r=p,c=d,i=v},lineEnd:function(){c&&n.lineEnd(),r=null},clean:function(){return l|(s&&c)<<1}}}function e(n,t,r){var e=lr(n),u=lr(t),o=[1,0,0],a=hr(e,u),c=fr(a,a),s=a[0],l=c-s*s;if(!l)return!r&&n;var f=i*c/l,h=-i*s/l,g=hr(o,a),p=pr(o,f),d=pr(a,h);gr(p,d);var v=g,m=fr(p,v),y=fr(v,v),x=m*m-y*(fr(p,p)-1);if(!(0>x)){var M=Math.sqrt(x),_=pr(v,(-m-M)/y);if(gr(_,p),_=vr(_),!r)return _;var b,w=n[0],k=t[0],S=n[1],E=t[1];w>k&&(b=w,w=k,k=b);var A=k-w,C=Ca>aa(A-Sa),N=C||Ca>A;if(!C&&S>E&&(b=S,S=E,E=b),N?C?S+E>0^_[1]<(Ca>aa(_[0]-w)?S:E):_[1]>=S&&E>=_[1]:A>Sa^(_[0]>=w&&k>=_[0])){var q=pr(v,(-m+M)/y);return gr(q,p),[_,vr(q)]}}}function u(t,r){var e=o?n:Sa-n,u=0;return-e>t?u|=1:t>e&&(u|=2),-e>r?u|=4:r>e&&(u|=8),u}var i=Math.cos(n),o=i>0,a=aa(i)>Ca,c=se(n,6*qa);return Ar(t,r,c,o?[0,-n]:[-Sa,n-Sa])}function Ur(n,t,r,e){return function(u){var i,o=u.a,a=u.b,c=o.x,s=o.y,l=a.x,f=a.y,h=0,g=1,p=l-c,d=f-s;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=r-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-s,d||!(i>0)){if(i/=d,0>d){if(h>i)return;g>i&&(g=i)}else if(d>0){if(i>g)return;i>h&&(h=i)}if(i=e-s,d||!(0>i)){if(i/=d,0>d){if(i>g)return;i>h&&(h=i)}else if(d>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:s+h*d}),1>g&&(u.b={x:c+g*p,y:s+g*d}),u}}}}}}function Pr(n,t,r,e){function u(e,u){return Ca>aa(e[0]-n)?u>0?0:3:Ca>aa(e[0]-r)?u>0?2:1:Ca>aa(e[1]-t)?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var r=u(n,1),e=u(t,1);return r!==e?r-e:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,r=v.length,e=n[1],u=0;r>u;++u)for(var i,o=1,a=v[u],c=a.length,s=a[0];c>o;++o)i=a[o],e>=s[1]?i[1]>e&&V(s,i,n)>0&&++t:e>=i[1]&&0>V(s,i,n)&&--t,s=i;return 0!==t}function s(i,a,c,s){var l=0,f=0;if(null==i||(l=u(i,c))!==(f=u(a,c))||0>o(i,a)^c>0){do s.point(0===l||3===l?n:r,l>1?e:t);while((l=(l+c+4)%4)!==f)}else s.point(a[0],a[1])}function l(u,i){return u>=n&&r>=u&&i>=t&&e>=i}function f(n,t){l(n,t)&&a.point(n,t)}function h(){N.point=p,v&&v.push(m=[]),k=!0,w=!1,_=b=0/0}function g(){d&&(p(y,x),M&&w&&A.rejoin(),d.push(A.buffer())),N.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Cc,Math.min(Cc,n)),t=Math.max(-Cc,Math.min(Cc,t));var r=l(n,t);if(v&&m.push([n,t]),k)y=n,x=t,M=r,k=!1,r&&(a.lineStart(),a.point(n,t));else if(r&&w)a.point(n,t);else{var e={a:{x:_,y:b},b:{x:n,y:t}};C(e)?(w||(a.lineStart(),a.point(e.a.x,e.a.y)),a.point(e.b.x,e.b.y),r||a.lineEnd(),S=!1):r&&(a.lineStart(),a.point(n,t),S=!1)}_=n,b=t,w=r}var d,v,m,y,x,M,_,b,w,k,S,E=a,A=Nr(),C=Ur(n,t,r,e),N={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,d=[],v=[],S=!0},polygonEnd:function(){a=E,d=$o.merge(d);var t=c([n,e]),r=S&&t,u=d.length;(r||u)&&(a.polygonStart(),r&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),u&&kr(d,i,t,s,a),a.polygonEnd()),d=v=m=null}};return N}}function jr(n,t){function r(r,e){return r=n(r,e),t(r[0],r[1])}return n.invert&&t.invert&&(r.invert=function(r,e){return r=t.invert(r,e),r&&n.invert(r[0],r[1])}),r}function Hr(n){var t=0,r=Sa/3,e=te(n),u=e(t,r);return u.parallels=function(n){return arguments.length?e(t=n[0]*Sa/180,r=n[1]*Sa/180):[180*(t/Sa),180*(r/Sa)]},u}function Fr(n,t){function r(n,t){var r=Math.sqrt(i-2*u*Math.sin(t))/u;return[r*Math.sin(n*=u),o-r*Math.cos(n)]}var e=Math.sin(n),u=(e+Math.sin(t))/2,i=1+e*(2*u-e),o=Math.sqrt(i)/u;return r.invert=function(n,t){var r=o-t;return[Math.atan2(n,r)/u,$((i-(n*n+r*r)*u*u)/(2*u))]},r}function Or(){function n(n,t){qc+=u*n-e*t,e=n,u=t}var t,r,e,u;Rc.point=function(i,o){Rc.point=n,t=e=i,r=u=o},Rc.lineEnd=function(){n(t,r)}}function Ir(n,t){zc>n&&(zc=n),n>Tc&&(Tc=n),Lc>t&&(Lc=t),t>Dc&&(Dc=t)}function Yr(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=r}function r(n,t){o.push("L",n,",",t)}function e(){a.point=n}function u(){o.push("Z")}var i=Zr(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:e,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=e,a.point=n},pointRadius:function(n){return i=Zr(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Zr(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Vr(n,t){mc+=n,yc+=t,++xc}function Xr(){function n(n,e){var u=n-t,i=e-r,o=Math.sqrt(u*u+i*i);Mc+=o*(t+n)/2,_c+=o*(r+e)/2,bc+=o,Vr(t=n,r=e)}var t,r;Pc.point=function(e,u){Pc.point=n,Vr(t=e,r=u)}}function $r(){Pc.point=Vr}function Br(){function n(n,t){var r=n-e,i=t-u,o=Math.sqrt(r*r+i*i);Mc+=o*(e+n)/2,_c+=o*(u+t)/2,bc+=o,o=u*n-e*t,wc+=o*(e+n),kc+=o*(u+t),Sc+=3*o,Vr(e=n,u=t)}var t,r,e,u;Pc.point=function(i,o){Pc.point=n,Vr(t=e=i,r=u=o)},Pc.lineEnd=function(){n(t,r)}}function Wr(n){function t(t,r){n.moveTo(t,r),n.arc(t,r,o,0,Ea)}function r(t,r){n.moveTo(t,r),a.point=e}function e(t,r){n.lineTo(t,r)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=r},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:p};return a}function Jr(n){function t(n){return(a?e:r)(n)}function r(t){return Qr(t,function(r,e){r=n(r,e),t.point(r[0],r[1])})}function e(t){function r(r,e){r=n(r,e),t.point(r[0],r[1])}function e(){x=0/0,k.point=i,t.lineStart()}function i(r,e){var i=lr([r,e]),o=n(r,e);u(x,M,y,_,b,w,x=o[0],M=o[1],y=r,_=i[0],b=i[1],w=i[2],a,t),t.point(x,M)}function o(){k.point=r,t.lineEnd()}function c(){e(),k.point=s,k.lineEnd=l}function s(n,t){i(f=n,h=t),g=x,p=M,d=_,v=b,m=w,k.point=i}function l(){u(x,M,y,_,b,w,g,p,f,d,v,m,a,t),k.lineEnd=o,o()}var f,h,g,p,d,v,m,y,x,M,_,b,w,k={point:r,lineStart:e,lineEnd:o,polygonStart:function(){t.polygonStart(),k.lineStart=c},polygonEnd:function(){t.polygonEnd(),k.lineStart=e}};return k}function u(t,r,e,a,c,s,l,f,h,g,p,d,v,m){var y=l-t,x=f-r,M=y*y+x*x;if(M>4*i&&v--){var _=a+g,b=c+p,w=s+d,k=Math.sqrt(_*_+b*b+w*w),S=Math.asin(w/=k),E=Ca>aa(aa(w)-1)||Ca>aa(e-h)?(e+h)/2:Math.atan2(b,_),A=n(E,S),C=A[0],N=A[1],q=C-t,z=N-r,L=x*q-y*z;(L*L/M>i||aa((y*q+x*z)/M-.5)>.3||o>a*g+c*p+s*d)&&(u(t,r,e,a,c,s,C,N,E,_/=k,b/=k,w,v,m),m.point(C,N),u(C,N,E,_,b,w,l,f,h,g,p,d,v,m))}}var i=.5,o=Math.cos(30*qa),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function Gr(n){var t=Jr(function(t,r){return n([t*za,r*za])});return function(n){return re(t(n))}}function Kr(n){this.stream=n}function Qr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ne(n){return te(function(){return n})()}function te(n){function t(n){return n=a(n[0]*qa,n[1]*qa),[n[0]*h+c,s-n[1]*h]}function r(n){return n=a.invert((n[0]-c)/h,(s-n[1])/h),n&&[n[0]*za,n[1]*za]
}function e(){a=jr(o=ie(m,y,x),i);var n=i(d,v);return c=g-n[0]*h,s=p+n[1]*h,u()}function u(){return l&&(l.valid=!1,l=null),t}var i,o,a,c,s,l,f=Jr(function(n,t){return n=i(n,t),[n[0]*h+c,s-n[1]*h]}),h=150,g=480,p=250,d=0,v=0,m=0,y=0,x=0,M=Ac,_=wt,b=null,w=null;return t.stream=function(n){return l&&(l.valid=!1),l=re(M(o,f(_(n)))),l.valid=!0,l},t.clipAngle=function(n){return arguments.length?(M=null==n?(b=n,Ac):Rr((b=+n)*qa),u()):b},t.clipExtent=function(n){return arguments.length?(w=n,_=n?Pr(n[0][0],n[0][1],n[1][0],n[1][1]):wt,u()):w},t.scale=function(n){return arguments.length?(h=+n,e()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],e()):[g,p]},t.center=function(n){return arguments.length?(d=n[0]%360*qa,v=n[1]%360*qa,e()):[d*za,v*za]},t.rotate=function(n){return arguments.length?(m=n[0]%360*qa,y=n[1]%360*qa,x=n.length>2?n[2]%360*qa:0,e()):[m*za,y*za,x*za]},$o.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&r,e()}}function re(n){return Qr(n,function(t,r){n.point(t*qa,r*qa)})}function ee(n,t){return[n,t]}function ue(n,t){return[n>Sa?n-Ea:-Sa>n?n+Ea:n,t]}function ie(n,t,r){return n?t||r?jr(ae(n),ce(t,r)):ae(n):t||r?ce(t,r):ue}function oe(n){return function(t,r){return t+=n,[t>Sa?t-Ea:-Sa>t?t+Ea:t,r]}}function ae(n){var t=oe(n);return t.invert=oe(-n),t}function ce(n,t){function r(n,t){var r=Math.cos(t),a=Math.cos(n)*r,c=Math.sin(n)*r,s=Math.sin(t),l=s*e+a*u;return[Math.atan2(c*i-l*o,a*e-s*u),$(l*i+c*o)]}var e=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return r.invert=function(n,t){var r=Math.cos(t),a=Math.cos(n)*r,c=Math.sin(n)*r,s=Math.sin(t),l=s*i-c*o;return[Math.atan2(c*i+s*o,a*e+l*u),$(l*e-a*u)]},r}function se(n,t){var r=Math.cos(n),e=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=le(r,u),i=le(r,i),(o>0?i>u:u>i)&&(u+=o*Ea)):(u=n+o*Ea,i=n-.5*c);for(var s,l=u;o>0?l>i:i>l;l-=c)a.point((s=vr([r,-e*Math.cos(l),-e*Math.sin(l)]))[0],s[1])}}function le(n,t){var r=lr(t);r[0]-=n,dr(r);var e=X(-r[1]);return((0>-r[2]?-e:e)+2*Math.PI-Ca)%(2*Math.PI)}function fe(n,t,r){var e=$o.range(n,t-Ca,r).concat(t);return function(n){return e.map(function(t){return[n,t]})}}function he(n,t,r){var e=$o.range(n,t-Ca,r).concat(t);return function(n){return e.map(function(t){return[t,n]})}}function ge(n){return n.source}function pe(n){return n.target}function de(n,t,r,e){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e),c=u*Math.cos(n),s=u*Math.sin(n),l=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(G(e-t)+u*o*G(r-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,r=Math.sin(h-n)*g,e=r*c+t*l,u=r*s+t*f,o=r*i+t*a;return[Math.atan2(u,e)*za,Math.atan2(o,Math.sqrt(e*e+u*u))*za]}:function(){return[n*za,t*za]};return p.distance=h,p}function ve(){function n(n,u){var i=Math.sin(u*=qa),o=Math.cos(u),a=aa((n*=qa)-t),c=Math.cos(a);jc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=e*i-r*o*c)*a),r*i+e*o*c),t=n,r=i,e=o}var t,r,e;Hc.point=function(u,i){t=u*qa,r=Math.sin(i*=qa),e=Math.cos(i),Hc.point=n},Hc.lineEnd=function(){Hc.point=Hc.lineEnd=p}}function me(n,t){function r(t,r){var e=Math.cos(t),u=Math.cos(r),i=n(e*u);return[i*u*Math.sin(t),i*Math.sin(r)]}return r.invert=function(n,r){var e=Math.sqrt(n*n+r*r),u=t(e),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,e*o),Math.asin(e&&r*i/e)]},r}function ye(n,t){function r(n,t){var r=Ca>aa(aa(t)-Aa)?0:o/Math.pow(u(t),i);return[r*Math.sin(i*n),o-r*Math.cos(i*n)]}var e=Math.cos(n),u=function(n){return Math.tan(Sa/4+n/2)},i=n===t?Math.sin(n):Math.log(e/Math.cos(t))/Math.log(u(t)/u(n)),o=e*Math.pow(u(n),i)/i;return i?(r.invert=function(n,t){var r=o-t,e=Z(i)*Math.sqrt(n*n+r*r);return[Math.atan2(n,r)/i,2*Math.atan(Math.pow(o/e,1/i))-Aa]},r):Me}function xe(n,t){function r(n,t){var r=i-t;return[r*Math.sin(u*n),i-r*Math.cos(u*n)]}var e=Math.cos(n),u=n===t?Math.sin(n):(e-Math.cos(t))/(t-n),i=e/u+n;return Ca>aa(u)?ee:(r.invert=function(n,t){var r=i-t;return[Math.atan2(n,r)/u,i-Z(u)*Math.sqrt(n*n+r*r)]},r)}function Me(n,t){return[n,Math.log(Math.tan(Sa/4+t/2))]}function _e(n){var t,r=ne(n),e=r.scale,u=r.translate,i=r.clipExtent;return r.scale=function(){var n=e.apply(r,arguments);return n===r?t?r.clipExtent(null):r:n},r.translate=function(){var n=u.apply(r,arguments);return n===r?t?r.clipExtent(null):r:n},r.clipExtent=function(n){var o=i.apply(r,arguments);if(o===r){if(t=null==n){var a=Sa*e(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},r.clipExtent(null)}function be(n,t){return[Math.log(Math.tan(Sa/4+t/2)),-n]}function we(n){return n[0]}function ke(n){return n[1]}function Se(n){for(var t=n.length,r=[0,1],e=2,u=2;t>u;u++){for(;e>1&&0>=V(n[r[e-2]],n[r[e-1]],n[u]);)--e;r[e++]=u}return r.slice(0,e)}function Ee(n,t){return n[0]-t[0]||n[1]-t[1]}function Ae(n,t,r){return(r[0]-t[0])*(n[1]-t[1])<(r[1]-t[1])*(n[0]-t[0])}function Ce(n,t,r,e){var u=n[0],i=r[0],o=t[0]-u,a=e[0]-i,c=n[1],s=r[1],l=t[1]-c,f=e[1]-s,h=(a*(c-s)-f*(u-i))/(f*o-a*l);return[u+h*o,c+h*l]}function Ne(n){var t=n[0],r=n[n.length-1];return!(t[0]-r[0]||t[1]-r[1])}function qe(){Ge(this),this.edge=this.site=this.circle=null}function ze(n){var t=Gc.pop()||new qe;return t.site=n,t}function Le(n){Ie(n),Bc.remove(n),Gc.push(n),Ge(n)}function Te(n){var t=n.circle,r=t.x,e=t.cy,u={x:r,y:e},i=n.P,o=n.N,a=[n];Le(n);for(var c=i;c.circle&&Ca>aa(r-c.circle.x)&&Ca>aa(e-c.circle.cy);)i=c.P,a.unshift(c),Le(c),c=i;a.unshift(c),Ie(c);for(var s=o;s.circle&&Ca>aa(r-s.circle.x)&&Ca>aa(e-s.circle.cy);)o=s.N,a.push(s),Le(s),s=o;a.push(s),Ie(s);var l,f=a.length;for(l=1;f>l;++l)s=a[l],c=a[l-1],Be(s.edge,c.site,s.site,u);c=a[0],s=a[f-1],s.edge=Xe(c.site,s.site,null,u),Oe(c),Oe(s)}function De(n){for(var t,r,e,u,i=n.x,o=n.y,a=Bc._;a;)if(e=Re(a,o)-i,e>Ca)a=a.L;else{if(u=i-Ue(a,o),!(u>Ca)){e>-Ca?(t=a.P,r=a):u>-Ca?(t=a,r=a.N):t=r=a;break}if(!a.R){t=a;break}a=a.R}var c=ze(n);if(Bc.insert(t,c),t||r){if(t===r)return Ie(t),r=ze(t.site),Bc.insert(c,r),c.edge=r.edge=Xe(t.site,c.site),Oe(t),Oe(r),void 0;if(!r)return c.edge=Xe(t.site,c.site),void 0;Ie(t),Ie(r);var s=t.site,l=s.x,f=s.y,h=n.x-l,g=n.y-f,p=r.site,d=p.x-l,v=p.y-f,m=2*(h*v-g*d),y=h*h+g*g,x=d*d+v*v,M={x:(v*y-g*x)/m+l,y:(h*x-d*y)/m+f};Be(r.edge,s,p,M),c.edge=Xe(s,n,null,M),r.edge=Xe(n,p,null,M),Oe(t),Oe(r)}}function Re(n,t){var r=n.site,e=r.x,u=r.y,i=u-t;if(!i)return e;var o=n.P;if(!o)return-1/0;r=o.site;var a=r.x,c=r.y,s=c-t;if(!s)return a;var l=a-e,f=1/i-1/s,h=l/s;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*s)-c+s/2+u-i/2)))/f+e:(e+a)/2}function Ue(n,t){var r=n.N;if(r)return Re(r,t);var e=n.site;return e.y===t?e.x:1/0}function Pe(n){this.site=n,this.edges=[]}function je(n){for(var t,r,e,u,i,o,a,c,s,l,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],d=$c,v=d.length;v--;)if(i=d[v],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)l=a[o].end(),e=l.x,u=l.y,s=a[++o%c].start(),t=s.x,r=s.y,(aa(e-t)>Ca||aa(u-r)>Ca)&&(a.splice(o,0,new We($e(i.site,l,Ca>aa(e-f)&&p-u>Ca?{x:f,y:Ca>aa(t-f)?r:p}:Ca>aa(u-p)&&h-e>Ca?{x:Ca>aa(r-p)?t:h,y:p}:Ca>aa(e-h)&&u-g>Ca?{x:h,y:Ca>aa(t-h)?r:g}:Ca>aa(u-g)&&e-f>Ca?{x:Ca>aa(r-g)?t:f,y:g}:null),i.site,null)),++c)}function He(n,t){return t.angle-n.angle}function Fe(){Ge(this),this.x=this.y=this.arc=this.site=this.cy=null}function Oe(n){var t=n.P,r=n.N;if(t&&r){var e=t.site,u=n.site,i=r.site;if(e!==i){var o=u.x,a=u.y,c=e.x-o,s=e.y-a,l=i.x-o,f=i.y-a,h=2*(c*f-s*l);if(!(h>=-Na)){var g=c*c+s*s,p=l*l+f*f,d=(f*g-s*p)/h,v=(c*p-l*g)/h,f=v+a,m=Kc.pop()||new Fe;m.arc=n,m.site=u,m.x=d+o,m.y=f+Math.sqrt(d*d+v*v),m.cy=f,n.circle=m;for(var y=null,x=Jc._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}Jc.insert(y,m),y||(Wc=m)}}}}function Ie(n){var t=n.circle;t&&(t.P||(Wc=t.N),Jc.remove(t),Kc.push(t),Ge(t),n.circle=null)}function Ye(n){for(var t,r=Xc,e=Ur(n[0][0],n[0][1],n[1][0],n[1][1]),u=r.length;u--;)t=r[u],(!Ze(t,n)||!e(t)||Ca>aa(t.a.x-t.b.x)&&Ca>aa(t.a.y-t.b.y))&&(t.a=t.b=null,r.splice(u,1))}function Ze(n,t){var r=n.b;if(r)return!0;var e,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],s=t[1][1],l=n.l,f=n.r,h=l.x,g=l.y,p=f.x,d=f.y,v=(h+p)/2,m=(g+d)/2;if(d===g){if(o>v||v>=a)return;if(h>p){if(i){if(i.y>=s)return}else i={x:v,y:c};r={x:v,y:s}}else{if(i){if(c>i.y)return}else i={x:v,y:s};r={x:v,y:c}}}else if(e=(h-p)/(d-g),u=m-e*v,-1>e||e>1)if(h>p){if(i){if(i.y>=s)return}else i={x:(c-u)/e,y:c};r={x:(s-u)/e,y:s}}else{if(i){if(c>i.y)return}else i={x:(s-u)/e,y:s};r={x:(c-u)/e,y:c}}else if(d>g){if(i){if(i.x>=a)return}else i={x:o,y:e*o+u};r={x:a,y:e*a+u}}else{if(i){if(o>i.x)return}else i={x:a,y:e*a+u};r={x:o,y:e*o+u}}return n.a=i,n.b=r,!0}function Ve(n,t){this.l=n,this.r=t,this.a=this.b=null}function Xe(n,t,r,e){var u=new Ve(n,t);return Xc.push(u),r&&Be(u,n,t,r),e&&Be(u,t,n,e),$c[n.i].edges.push(new We(u,n,t)),$c[t.i].edges.push(new We(u,t,n)),u}function $e(n,t,r){var e=new Ve(n,null);return e.a=t,e.b=r,Xc.push(e),e}function Be(n,t,r,e){n.a||n.b?n.l===r?n.b=e:n.a=e:(n.a=e,n.l=t,n.r=r)}function We(n,t,r){var e=n.a,u=n.b;this.edge=n,this.site=t,this.angle=r?Math.atan2(r.y-t.y,r.x-t.x):n.l===t?Math.atan2(u.x-e.x,e.y-u.y):Math.atan2(e.x-u.x,u.y-e.y)}function Je(){this._=null}function Ge(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function Ke(n,t){var r=t,e=t.R,u=r.U;u?u.L===r?u.L=e:u.R=e:n._=e,e.U=u,r.U=e,r.R=e.L,r.R&&(r.R.U=r),e.L=r}function Qe(n,t){var r=t,e=t.L,u=r.U;u?u.L===r?u.L=e:u.R=e:n._=e,e.U=u,r.U=e,r.L=e.R,r.L&&(r.L.U=r),e.R=r}function nu(n){for(;n.L;)n=n.L;return n}function tu(n,t){var r,e,u,i=n.sort(ru).pop();for(Xc=[],$c=Array(n.length),Bc=new Je,Jc=new Je;;)if(u=Wc,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==r||i.y!==e)&&($c[i.i]=new Pe(i),De(i),r=i.x,e=i.y),i=n.pop();else{if(!u)break;Te(u.arc)}t&&(Ye(t),je(t));var o={cells:$c,edges:Xc};return Bc=Jc=Xc=$c=null,o}function ru(n,t){return t.y-n.y||t.x-n.x}function eu(n,t,r){return(n.x-r.x)*(t.y-n.y)-(n.x-t.x)*(r.y-n.y)}function uu(n){return n.x}function iu(n){return n.y}function ou(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function au(n,t,r,e,u,i){if(!n(t,r,e,u,i)){var o=.5*(r+u),a=.5*(e+i),c=t.nodes;c[0]&&au(n,c[0],r,e,o,a),c[1]&&au(n,c[1],o,e,u,a),c[2]&&au(n,c[2],r,a,o,i),c[3]&&au(n,c[3],o,a,u,i)}}function cu(n,t){n=$o.rgb(n),t=$o.rgb(t);var r=n.r,e=n.g,u=n.b,i=t.r-r,o=t.g-e,a=t.b-u;return function(n){return"#"+vt(Math.round(r+i*n))+vt(Math.round(e+o*n))+vt(Math.round(u+a*n))}}function su(n,t){var r,e={},u={};for(r in n)r in t?e[r]=hu(n[r],t[r]):u[r]=n[r];for(r in t)r in n||(u[r]=t[r]);return function(n){for(r in e)u[r]=e[r](n);return u}}function lu(n,t){return t-=n=+n,function(r){return n+t*r}}function fu(n,t){var r,e,u,i,o,a=0,c=0,s=[],l=[];for(n+="",t+="",ns.lastIndex=0,e=0;r=ns.exec(t);++e)r.index&&s.push(t.substring(a,c=r.index)),l.push({i:s.length,x:r[0]}),s.push(null),a=ns.lastIndex;for(t.length>a&&s.push(t.substring(a)),e=0,i=l.length;(r=ns.exec(n))&&i>e;++e)if(o=l[e],o.x==r[0]){if(o.i)if(null==s[o.i+1])for(s[o.i-1]+=o.x,s.splice(o.i,1),u=e+1;i>u;++u)l[u].i--;else for(s[o.i-1]+=o.x+s[o.i+1],s.splice(o.i,2),u=e+1;i>u;++u)l[u].i-=2;else if(null==s[o.i+1])s[o.i]=o.x;else for(s[o.i]=o.x+s[o.i+1],s.splice(o.i+1,1),u=e+1;i>u;++u)l[u].i--;l.splice(e,1),i--,e--}else o.x=lu(parseFloat(r[0]),parseFloat(o.x));for(;i>e;)o=l.pop(),null==s[o.i+1]?s[o.i]=o.x:(s[o.i]=o.x+s[o.i+1],s.splice(o.i+1,1)),i--;return 1===s.length?null==s[0]?(o=l[0].x,function(n){return o(n)+""}):function(){return t}:function(n){for(e=0;i>e;++e)s[(o=l[e]).i]=o.x(n);return s.join("")}}function hu(n,t){for(var r,e=$o.interpolators.length;--e>=0&&!(r=$o.interpolators[e](n,t)););return r}function gu(n,t){var r,e=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(r=0;a>r;++r)e.push(hu(n[r],t[r]));for(;i>r;++r)u[r]=n[r];for(;o>r;++r)u[r]=t[r];return function(n){for(r=0;a>r;++r)u[r]=e[r](n);return u}}function pu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function du(n){return function(t){return 1-n(1-t)}}function vu(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function mu(n){return n*n}function yu(n){return n*n*n}function xu(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,r=t*n;return 4*(.5>n?r:3*(n-t)+r-.75)}function Mu(n){return function(t){return Math.pow(t,n)}}function _u(n){return 1-Math.cos(n*Aa)}function bu(n){return Math.pow(2,10*(n-1))}function wu(n){return 1-Math.sqrt(1-n*n)}function ku(n,t){var r;return 2>arguments.length&&(t=.45),arguments.length?r=t/Ea*Math.asin(1/n):(n=1,r=t/4),function(e){return 1+n*Math.pow(2,-10*e)*Math.sin((e-r)*Ea/t)}}function Su(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Eu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Au(n,t){n=$o.hcl(n),t=$o.hcl(t);var r=n.h,e=n.c,u=n.l,i=t.h-r,o=t.c-e,a=t.l-u;return isNaN(o)&&(o=0,e=isNaN(e)?t.c:e),isNaN(i)?(i=0,r=isNaN(r)?t.h:r):i>180?i-=360:-180>i&&(i+=360),function(n){return ut(r+i*n,e+o*n,u+a*n)+""}}function Cu(n,t){n=$o.hsl(n),t=$o.hsl(t);var r=n.h,e=n.s,u=n.l,i=t.h-r,o=t.s-e,a=t.l-u;return isNaN(o)&&(o=0,e=isNaN(e)?t.s:e),isNaN(i)?(i=0,r=isNaN(r)?t.h:r):i>180?i-=360:-180>i&&(i+=360),function(n){return tt(r+i*n,e+o*n,u+a*n)+""}}function Nu(n,t){n=$o.lab(n),t=$o.lab(t);var r=n.l,e=n.a,u=n.b,i=t.l-r,o=t.a-e,a=t.b-u;return function(n){return at(r+i*n,e+o*n,u+a*n)+""}}function qu(n,t){return t-=n,function(r){return Math.round(n+t*r)}}function zu(n){var t=[n.a,n.b],r=[n.c,n.d],e=Tu(t),u=Lu(t,r),i=Tu(Du(r,t,-u))||0;t[0]*r[1]<r[0]*t[1]&&(t[0]*=-1,t[1]*=-1,e*=-1,u*=-1),this.rotate=(e?Math.atan2(t[1],t[0]):Math.atan2(-r[0],r[1]))*za,this.translate=[n.e,n.f],this.scale=[e,i],this.skew=i?Math.atan2(u,i)*za:0}function Lu(n,t){return n[0]*t[0]+n[1]*t[1]}function Tu(n){var t=Math.sqrt(Lu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Du(n,t,r){return n[0]+=r*t[0],n[1]+=r*t[1],n}function Ru(n,t){var r,e=[],u=[],i=$o.transform(n),o=$o.transform(t),a=i.translate,c=o.translate,s=i.rotate,l=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(e.push("translate(",null,",",null,")"),u.push({i:1,x:lu(a[0],c[0])},{i:3,x:lu(a[1],c[1])})):c[0]||c[1]?e.push("translate("+c+")"):e.push(""),s!=l?(s-l>180?l+=360:l-s>180&&(s+=360),u.push({i:e.push(e.pop()+"rotate(",null,")")-2,x:lu(s,l)})):l&&e.push(e.pop()+"rotate("+l+")"),f!=h?u.push({i:e.push(e.pop()+"skewX(",null,")")-2,x:lu(f,h)}):h&&e.push(e.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(r=e.push(e.pop()+"scale(",null,",",null,")"),u.push({i:r-4,x:lu(g[0],p[0])},{i:r-2,x:lu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&e.push(e.pop()+"scale("+p+")"),r=u.length,function(n){for(var t,i=-1;r>++i;)e[(t=u[i]).i]=t.x(n);return e.join("")}}function Uu(n,t){return t=t-(n=+n)?1/(t-n):0,function(r){return(r-n)*t}}function Pu(n,t){return t=t-(n=+n)?1/(t-n):0,function(r){return Math.max(0,Math.min(1,(r-n)*t))}}function ju(n){for(var t=n.source,r=n.target,e=Fu(t,r),u=[t];t!==e;)t=t.parent,u.push(t);for(var i=u.length;r!==e;)u.splice(i,0,r),r=r.parent;return u}function Hu(n){for(var t=[],r=n.parent;null!=r;)t.push(n),n=r,r=r.parent;return t.push(n),t}function Fu(n,t){if(n===t)return n;for(var r=Hu(n),e=Hu(t),u=r.pop(),i=e.pop(),o=null;u===i;)o=u,u=r.pop(),i=e.pop();return o}function Ou(n){n.fixed|=2}function Iu(n){n.fixed&=-7}function Yu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Zu(n){n.fixed&=-5}function Vu(n,t,r){var e=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;a>++c;)i=o[c],null!=i&&(Vu(i,t,r),n.charge+=i.charge,e+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var s=t*r[n.point.index];n.charge+=n.pointCharge=s,e+=s*n.point.x,u+=s*n.point.y}n.cx=e/n.charge,n.cy=u/n.charge}function Xu(n,t){return $o.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=Ju,n}function $u(n){return n.children}function Bu(n){return n.value}function Wu(n,t){return t.value-n.value}function Ju(n){return $o.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function Gu(n){return n.x}function Ku(n){return n.y}function Qu(n,t,r){n.y0=t,n.y=r}function ni(n){return $o.range(n.length)}function ti(n){for(var t=-1,r=n[0].length,e=[];r>++t;)e[t]=0;return e}function ri(n){for(var t,r=1,e=0,u=n[0][1],i=n.length;i>r;++r)(t=n[r][1])>u&&(e=r,u=t);return e}function ei(n){return n.reduce(ui,0)}function ui(n,t){return n+t[1]}function ii(n,t){return oi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function oi(n,t){for(var r=-1,e=+n[0],u=(n[1]-e)/t,i=[];t>=++r;)i[r]=u*r+e;return i}function ai(n){return[$o.min(n),$o.max(n)]}function ci(n,t){return n.parent==t.parent?1:2}function si(n){var t=n.children;return t&&t.length?t[0]:n._tree.thread}function li(n){var t,r=n.children;return r&&(t=r.length)?r[t-1]:n._tree.thread}function fi(n,t){var r=n.children;if(r&&(u=r.length))for(var e,u,i=-1;u>++i;)t(e=fi(r[i],t),n)>0&&(n=e);return n}function hi(n,t){return n.x-t.x}function gi(n,t){return t.x-n.x}function pi(n,t){return n.depth-t.depth}function di(n,t){function r(n,e){var u=n.children;if(u&&(o=u.length))for(var i,o,a=null,c=-1;o>++c;)i=u[c],r(i,a),a=i;t(n,e)}r(n,null)}function vi(n){for(var t,r=0,e=0,u=n.children,i=u.length;--i>=0;)t=u[i]._tree,t.prelim+=r,t.mod+=r,r+=t.shift+(e+=t.change)}function mi(n,t,r){n=n._tree,t=t._tree;var e=r/(t.number-n.number);n.change+=e,t.change-=e,t.shift+=r,t.prelim+=r,t.mod+=r}function yi(n,t,r){return n._tree.ancestor.parent==t.parent?n._tree.ancestor:r}function xi(n,t){return n.value-t.value}function Mi(n,t){var r=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=r,r._pack_prev=t}function _i(n,t){n._pack_next=t,t._pack_prev=n}function bi(n,t){var r=t.x-n.x,e=t.y-n.y,u=n.r+t.r;return.999*u*u>r*r+e*e}function wi(n){function t(n){l=Math.min(n.x-n.r,l),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((r=n.children)&&(s=r.length)){var r,e,u,i,o,a,c,s,l=1/0,f=-1/0,h=1/0,g=-1/0;if(r.forEach(ki),e=r[0],e.x=-e.r,e.y=0,t(e),s>1&&(u=r[1],u.x=u.r,u.y=0,t(u),s>2))for(i=r[2],Ai(e,u,i),t(i),Mi(e,i),e._pack_prev=i,Mi(i,u),u=e._pack_next,o=3;s>o;o++){Ai(e,u,i=r[o]);var p=0,d=1,v=1;for(a=u._pack_next;a!==u;a=a._pack_next,d++)if(bi(a,i)){p=1;break}if(1==p)for(c=e._pack_prev;c!==a._pack_prev&&!bi(c,i);c=c._pack_prev,v++);p?(v>d||d==v&&u.r<e.r?_i(e,u=a):_i(e=c,u),o--):(Mi(e,i),u=i,t(i))}var m=(l+f)/2,y=(h+g)/2,x=0;for(o=0;s>o;o++)i=r[o],i.x-=m,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=x,r.forEach(Si)}}function ki(n){n._pack_next=n._pack_prev=n}function Si(n){delete n._pack_next,delete n._pack_prev}function Ei(n,t,r,e){var u=n.children;if(n.x=t+=e*n.x,n.y=r+=e*n.y,n.r*=e,u)for(var i=-1,o=u.length;o>++i;)Ei(u[i],t,r,e)}function Ai(n,t,r){var e=n.r+r.r,u=t.x-n.x,i=t.y-n.y;if(e&&(u||i)){var o=t.r+r.r,a=u*u+i*i;o*=o,e*=e;var c=.5+(e-o)/(2*a),s=Math.sqrt(Math.max(0,2*o*(e+a)-(e-=a)*e-o*o))/(2*a);r.x=n.x+c*u+s*i,r.y=n.y+c*i-s*u}else r.x=n.x+e,r.y=n.y}function Ci(n){return 1+$o.max(n,function(n){return n.y})}function Ni(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function qi(n){var t=n.children;return t&&t.length?qi(t[0]):n}function zi(n){var t,r=n.children;return r&&(t=r.length)?zi(r[t-1]):n}function Li(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ti(n,t){var r=n.x+t[3],e=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(r+=u/2,u=0),0>i&&(e+=i/2,i=0),{x:r,y:e,dx:u,dy:i}}function Di(n){var t=n[0],r=n[n.length-1];return r>t?[t,r]:[r,t]}function Ri(n){return n.rangeExtent?n.rangeExtent():Di(n.range())}function Ui(n,t,r,e){var u=r(n[0],n[1]),i=e(t[0],t[1]);return function(n){return i(u(n))}}function Pi(n,t){var r,e=0,u=n.length-1,i=n[e],o=n[u];return i>o&&(r=e,e=u,u=r,r=i,i=o,o=r),n[e]=t.floor(i),n[u]=t.ceil(o),n}function ji(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:fs}function Hi(n,t,r,e){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());a>=++o;)u.push(r(n[o-1],n[o])),i.push(e(t[o-1],t[o]));return function(t){var r=$o.bisect(n,t,1,a)-1;return i[r](u[r](t))}}function Fi(n,t,r,e){function u(){var u=Math.min(n.length,t.length)>2?Hi:Ui,c=e?Pu:Uu;return o=u(n,t,c,r),a=u(t,n,c,hu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(qu)},i.clamp=function(n){return arguments.length?(e=n,u()):e},i.interpolate=function(n){return arguments.length?(r=n,u()):r},i.ticks=function(t){return Zi(n,t)},i.tickFormat=function(t,r){return Vi(n,t,r)},i.nice=function(t){return Ii(n,t),u()},i.copy=function(){return Fi(n,t,r,e)},u()}function Oi(n,t){return $o.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Ii(n,t){return Pi(n,ji(Yi(n,t)[2]))}function Yi(n,t){null==t&&(t=10);var r=Di(n),e=r[1]-r[0],u=Math.pow(10,Math.floor(Math.log(e/t)/Math.LN10)),i=t/e*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),r[0]=Math.ceil(r[0]/u)*u,r[1]=Math.floor(r[1]/u)*u+.5*u,r[2]=u,r}function Zi(n,t){return $o.range.apply($o,Yi(n,t))}function Vi(n,t,r){var e=Yi(n,t);return $o.format(r?r.replace(nc,function(n,t,r,u,i,o,a,c,s,l){return[t,r,u,i,o,a,c,s||"."+$i(l,e),l].join("")}):",."+Xi(e[2])+"f")}function Xi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function $i(n,t){var r=Xi(t[2]);return n in hs?Math.abs(r-Xi(Math.max(Math.abs(t[0]),Math.abs(t[1]))))+ +("e"!==n):r-2*("%"===n)}function Bi(n,t,r,e){function u(n){return(r?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return r?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,n.domain((e=t.map(Number)).map(u)),o):e},o.base=function(r){return arguments.length?(t=+r,n.domain(e.map(u)),o):t},o.nice=function(){var t=Pi(e.map(u),r?Math:ps);return n.domain(t),e=t.map(i),o},o.ticks=function(){var n=Di(e),o=[],a=n[0],c=n[1],s=Math.floor(u(a)),l=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(l-s)){if(r){for(;l>s;s++)for(var h=1;f>h;h++)o.push(i(s)*h);o.push(i(s))}else for(o.push(i(s));l>s++;)for(var h=f-1;h>0;h--)o.push(i(s)*h);for(s=0;a>o[s];s++);for(l=o.length;o[l-1]>c;l--);o=o.slice(s,l)}return o},o.tickFormat=function(n,t){if(!arguments.length)return gs;2>arguments.length?t=gs:"function"!=typeof t&&(t=$o.format(t));var e,a=Math.max(.1,n/o.ticks().length),c=r?(e=1e-12,Math.ceil):(e=-1e-12,Math.floor);return function(n){return a>=n/i(c(u(n)+e))?t(n):""}},o.copy=function(){return Bi(n.copy(),t,r,e)},Oi(o,n)}function Wi(n,t,r){function e(t){return n(u(t))}var u=Ji(t),i=Ji(1/t);return e.invert=function(t){return i(n.invert(t))},e.domain=function(t){return arguments.length?(n.domain((r=t.map(Number)).map(u)),e):r},e.ticks=function(n){return Zi(r,n)},e.tickFormat=function(n,t){return Vi(r,n,t)},e.nice=function(n){return e.domain(Ii(r,n))},e.exponent=function(o){return arguments.length?(u=Ji(t=o),i=Ji(1/t),n.domain(r.map(u)),e):t},e.copy=function(){return Wi(n.copy(),t,r)},Oi(e,n)}function Ji(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Gi(n,t){function r(r){return o[((u.get(r)||"range"===t.t&&u.set(r,n.push(r)))-1)%o.length]}function e(t,r){return $o.range(n.length).map(function(n){return t+r*n})}var u,o,a;return r.domain=function(e){if(!arguments.length)return n;n=[],u=new i;for(var o,a=-1,c=e.length;c>++a;)u.has(o=e[a])||u.set(o,n.push(o));return r[t.t].apply(r,t.a)},r.range=function(n){return arguments.length?(o=n,a=0,t={t:"range",a:arguments},r):o},r.rangePoints=function(u,i){2>arguments.length&&(i=0);var c=u[0],s=u[1],l=(s-c)/(Math.max(1,n.length-1)+i);return o=e(2>n.length?(c+s)/2:c+l*i/2,l),a=0,t={t:"rangePoints",a:arguments},r},r.rangeBands=function(u,i,c){2>arguments.length&&(i=0),3>arguments.length&&(c=i);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=(f-l)/(n.length-i+2*c);return o=e(l+h*c,h),s&&o.reverse(),a=h*(1-i),t={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(u,i,c){2>arguments.length&&(i=0),3>arguments.length&&(c=i);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=Math.floor((f-l)/(n.length-i+2*c)),g=f-l-(n.length-i)*h;return o=e(l+Math.round(g/2),h),s&&o.reverse(),a=Math.round(h*(1-i)),t={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return a},r.rangeExtent=function(){return Di(t.a[0])},r.copy=function(){return Gi(n,t)},r.domain(n)}function Ki(n,t){function r(){var r=0,i=t.length;for(u=[];i>++r;)u[r-1]=$o.quantile(n,r/i);return e}function e(n){return isNaN(n=+n)?void 0:t[$o.bisect(u,n)]}var u;return e.domain=function(t){return arguments.length?(n=t.filter(function(n){return!isNaN(n)}).sort($o.ascending),r()):n},e.range=function(n){return arguments.length?(t=n,r()):t},e.quantiles=function(){return u},e.invertExtent=function(r){return r=t.indexOf(r),0>r?[0/0,0/0]:[r>0?u[r-1]:n[0],u.length>r?u[r]:n[n.length-1]]},e.copy=function(){return Ki(n,t)},r()}function Qi(n,t,r){function e(t){return r[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=r.length/(t-n),o=r.length-1,e}var i,o;return e.domain=function(r){return arguments.length?(n=+r[0],t=+r[r.length-1],u()):[n,t]},e.range=function(n){return arguments.length?(r=n,u()):r},e.invertExtent=function(t){return t=r.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},e.copy=function(){return Qi(n,t,r)},u()}function no(n,t){function r(r){return r>=r?t[$o.bisect(n,r)]:void 0}return r.domain=function(t){return arguments.length?(n=t,r):n},r.range=function(n){return arguments.length?(t=n,r):t},r.invertExtent=function(r){return r=t.indexOf(r),[n[r-1],n[r]]},r.copy=function(){return no(n,t)},r}function to(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(r){return arguments.length?(n=r.map(t),t):n},t.ticks=function(t){return Zi(n,t)},t.tickFormat=function(t,r){return Vi(n,t,r)},t.copy=function(){return to(n)},t}function ro(n){return n.innerRadius}function eo(n){return n.outerRadius}function uo(n){return n.startAngle}function io(n){return n.endAngle}function oo(n){function t(t){function o(){s.push("M",i(n(l),a))}for(var c,s=[],l=[],f=-1,h=t.length,g=bt(r),p=bt(e);h>++f;)u.call(this,c=t[f],f)?l.push([+g.call(this,c,f),+p.call(this,c,f)]):l.length&&(o(),l=[]);return l.length&&o(),s.length?s.join(""):null}var r=we,e=ke,u=wr,i=ao,o=i.key,a=.7;return t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(e=n,t):e},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=_s.get(n)||ao).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function ao(n){return n.join("L")}function co(n){return ao(n)+"Z"}function so(n){for(var t=0,r=n.length,e=n[0],u=[e[0],",",e[1]];r>++t;)u.push("H",(e[0]+(e=n[t])[0])/2,"V",e[1]);return r>1&&u.push("H",e[0]),u.join("")}function lo(n){for(var t=0,r=n.length,e=n[0],u=[e[0],",",e[1]];r>++t;)u.push("V",(e=n[t])[1],"H",e[0]);return u.join("")}function fo(n){for(var t=0,r=n.length,e=n[0],u=[e[0],",",e[1]];r>++t;)u.push("H",(e=n[t])[0],"V",e[1]);return u.join("")}function ho(n,t){return 4>n.length?ao(n):n[1]+vo(n.slice(1,n.length-1),mo(n,t))}function go(n,t){return 3>n.length?ao(n):n[0]+vo((n.push(n[0]),n),mo([n[n.length-2]].concat(n,[n[1]]),t))}function po(n,t){return 3>n.length?ao(n):n[0]+vo(n,mo(n,t))}function vo(n,t){if(1>t.length||n.length!=t.length&&n.length!=t.length+2)return ao(n);var r=n.length!=t.length,e="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(r&&(e+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,e+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var s=2;t.length>s;s++,c++)i=n[c],a=t[s],e+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(r){var l=n[c];e+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+l[0]+","+l[1]}return e}function mo(n,t){for(var r,e=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;c>++a;)r=i,i=o,o=n[a],e.push([u*(o[0]-r[0]),u*(o[1]-r[1])]);return e}function yo(n){if(3>n.length)return ao(n);var t=1,r=n.length,e=n[0],u=e[0],i=e[1],o=[u,u,u,(e=n[1])[0]],a=[i,i,i,e[1]],c=[u,",",i,"L",bo(ks,o),",",bo(ks,a)];for(n.push(n[r-1]);r>=++t;)e=n[t],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),wo(c,o,a);return n.pop(),c.push("L",e),c.join("")}function xo(n){if(4>n.length)return ao(n);for(var t,r=[],e=-1,u=n.length,i=[0],o=[0];3>++e;)t=n[e],i.push(t[0]),o.push(t[1]);for(r.push(bo(ks,i)+","+bo(ks,o)),--e;u>++e;)t=n[e],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),wo(r,i,o);return r.join("")}function Mo(n){for(var t,r,e=-1,u=n.length,i=u+4,o=[],a=[];4>++e;)r=n[e%u],o.push(r[0]),a.push(r[1]);for(t=[bo(ks,o),",",bo(ks,a)],--e;i>++e;)r=n[e%u],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),wo(t,o,a);return t.join("")}function _o(n,t){var r=n.length-1;if(r)for(var e,u,i=n[0][0],o=n[0][1],a=n[r][0]-i,c=n[r][1]-o,s=-1;r>=++s;)e=n[s],u=s/r,e[0]=t*e[0]+(1-t)*(i+u*a),e[1]=t*e[1]+(1-t)*(o+u*c);return yo(n)}function bo(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function wo(n,t,r){n.push("C",bo(bs,t),",",bo(bs,r),",",bo(ws,t),",",bo(ws,r),",",bo(ks,t),",",bo(ks,r))}function ko(n,t){return(t[1]-n[1])/(t[0]-n[0])}function So(n){for(var t=0,r=n.length-1,e=[],u=n[0],i=n[1],o=e[0]=ko(u,i);r>++t;)e[t]=(o+(o=ko(u=i,i=n[t+1])))/2;return e[t]=o,e}function Eo(n){for(var t,r,e,u,i=[],o=So(n),a=-1,c=n.length-1;c>++a;)t=ko(n[a],n[a+1]),Ca>aa(t)?o[a]=o[a+1]=0:(r=o[a]/t,e=o[a+1]/t,u=r*r+e*e,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*r,o[a+1]=u*e));for(a=-1;c>=++a;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function Ao(n){return 3>n.length?ao(n):n[0]+vo(n,Eo(n))}function Co(n){for(var t,r,e,u=-1,i=n.length;i>++u;)t=n[u],r=t[0],e=t[1]+xs,t[0]=r*Math.cos(e),t[1]=r*Math.sin(e);return n}function No(n){function t(t){function c(){d.push("M",a(n(m),f),l,s(n(v.reverse()),f),"Z")}for(var h,g,p,d=[],v=[],m=[],y=-1,x=t.length,M=bt(r),_=bt(u),b=r===e?function(){return g}:bt(e),w=u===i?function(){return p}:bt(i);x>++y;)o.call(this,h=t[y],y)?(v.push([g=+M.call(this,h,y),p=+_.call(this,h,y)]),m.push([+b.call(this,h,y),+w.call(this,h,y)])):v.length&&(c(),v=[],m=[]);return v.length&&c(),d.length?d.join(""):null}var r=we,e=we,u=0,i=ke,o=wr,a=ao,c=a.key,s=a,l="L",f=.7;return t.x=function(n){return arguments.length?(r=e=n,t):e},t.x0=function(n){return arguments.length?(r=n,t):r},t.x1=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=_s.get(n)||ao).key,s=a.reverse||a,l=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function qo(n){return n.radius}function zo(n){return[n.x,n.y]}function Lo(n){return function(){var t=n.apply(this,arguments),r=t[0],e=t[1]+xs;return[r*Math.cos(e),r*Math.sin(e)]}}function To(){return 64}function Do(){return"circle"}function Ro(n){var t=Math.sqrt(n/Sa);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Uo(n,t){return ha(n,qs),n.id=t,n}function Po(n,t,r,e){var u=n.id;return R(n,"function"==typeof r?function(n,i,o){n.__transition__[u].tween.set(t,e(r.call(n,n.__data__,i,o)))}:(r=e(r),function(n){n.__transition__[u].tween.set(t,r)}))}function jo(n){return null==n&&(n=""),function(){this.textContent=n}}function Ho(n,t,r,e){var u=n.__transition__||(n.__transition__={active:0,count:0}),o=u[r];if(!o){var a=e.time;o=u[r]={tween:new i,time:a,ease:e.ease,delay:e.delay,duration:e.duration},++u.count,$o.timer(function(e){function i(e){return u.active>r?s():(u.active=r,o.event&&o.event.start.call(n,l,t),o.tween.forEach(function(r,e){(e=e.call(n,l,t))&&d.push(e)}),$o.timer(function(){return p.c=c(e||1)?wr:c,1},0,a),void 0)}function c(e){if(u.active!==r)return s();for(var i=e/g,a=f(i),c=d.length;c>0;)d[--c].call(n,a);return i>=1?(o.event&&o.event.end.call(n,l,t),s()):void 0}function s(){return--u.count?delete u[r]:delete n.__transition__,1}var l=n.__data__,f=o.ease,h=o.delay,g=o.duration,p=Ga,d=[];
return p.t=h+a,e>=h?i(e-h):(p.c=i,void 0)},0,a)}}function Fo(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function Oo(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function Io(n){return n.toISOString()}function Yo(n,t,r){function e(t){return n(t)}function u(n,r){var e=n[1]-n[0],u=e/r,i=$o.bisect(Hs,u);return i==Hs.length?[t.year,Yi(n.map(function(n){return n/31536e6}),r)[2]]:i?t[u/Hs[i-1]<Hs[i]/u?i-1:i]:[Is,Yi(n,r)[2]]}return e.invert=function(t){return Zo(n.invert(t))},e.domain=function(t){return arguments.length?(n.domain(t),e):n.domain().map(Zo)},e.nice=function(n,t){function r(r){return!isNaN(r)&&!n.range(r,Zo(+r+1),t).length}var i=e.domain(),o=Di(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),e.domain(Pi(i,t>1?{floor:function(t){for(;r(t=n.floor(t));)t=Zo(t-1);return t},ceil:function(t){for(;r(t=n.ceil(t));)t=Zo(+t+1);return t}}:n))},e.ticks=function(n,t){var r=Di(e.domain()),i=null==n?u(r,10):"number"==typeof n?u(r,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(r[0],Zo(+r[1]+1),1>t?1:t)},e.tickFormat=function(){return r},e.copy=function(){return Yo(n.copy(),t,r)},Oi(e,n)}function Zo(n){return new Date(n)}function Vo(n){return JSON.parse(n.responseText)}function Xo(n){var t=Jo.createRange();return t.selectNode(Jo.body),t.createContextualFragment(n.responseText)}var $o={version:"3.4.3"};Date.now||(Date.now=function(){return+new Date});var Bo=[].slice,Wo=function(n){return Bo.call(n)},Jo=document,Go=Jo.documentElement,Ko=window;try{Wo(Go.childNodes)[0].nodeType}catch(Qo){Wo=function(n){for(var t=n.length,r=Array(t);t--;)r[t]=n[t];return r}}try{Jo.createElement("div").style.setProperty("opacity",0,"")}catch(na){var ta=Ko.Element.prototype,ra=ta.setAttribute,ea=ta.setAttributeNS,ua=Ko.CSSStyleDeclaration.prototype,ia=ua.setProperty;ta.setAttribute=function(n,t){ra.call(this,n,t+"")},ta.setAttributeNS=function(n,t,r){ea.call(this,n,t,r+"")},ua.setProperty=function(n,t,r){ia.call(this,n,t+"",r)}}$o.ascending=function(n,t){return t>n?-1:n>t?1:n>=t?0:0/0},$o.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},$o.min=function(n,t){var r,e,u=-1,i=n.length;if(1===arguments.length){for(;i>++u&&!(null!=(r=n[u])&&r>=r);)r=void 0;for(;i>++u;)null!=(e=n[u])&&r>e&&(r=e)}else{for(;i>++u&&!(null!=(r=t.call(n,n[u],u))&&r>=r);)r=void 0;for(;i>++u;)null!=(e=t.call(n,n[u],u))&&r>e&&(r=e)}return r},$o.max=function(n,t){var r,e,u=-1,i=n.length;if(1===arguments.length){for(;i>++u&&!(null!=(r=n[u])&&r>=r);)r=void 0;for(;i>++u;)null!=(e=n[u])&&e>r&&(r=e)}else{for(;i>++u&&!(null!=(r=t.call(n,n[u],u))&&r>=r);)r=void 0;for(;i>++u;)null!=(e=t.call(n,n[u],u))&&e>r&&(r=e)}return r},$o.extent=function(n,t){var r,e,u,i=-1,o=n.length;if(1===arguments.length){for(;o>++i&&!(null!=(r=u=n[i])&&r>=r);)r=u=void 0;for(;o>++i;)null!=(e=n[i])&&(r>e&&(r=e),e>u&&(u=e))}else{for(;o>++i&&!(null!=(r=u=t.call(n,n[i],i))&&r>=r);)r=void 0;for(;o>++i;)null!=(e=t.call(n,n[i],i))&&(r>e&&(r=e),e>u&&(u=e))}return[r,u]},$o.sum=function(n,t){var r,e=0,u=n.length,i=-1;if(1===arguments.length)for(;u>++i;)isNaN(r=+n[i])||(e+=r);else for(;u>++i;)isNaN(r=+t.call(n,n[i],i))||(e+=r);return e},$o.mean=function(t,r){var e,u=t.length,i=0,o=-1,a=0;if(1===arguments.length)for(;u>++o;)n(e=t[o])&&(i+=(e-i)/++a);else for(;u>++o;)n(e=r.call(t,t[o],o))&&(i+=(e-i)/++a);return a?i:void 0},$o.quantile=function(n,t){var r=(n.length-1)*t+1,e=Math.floor(r),u=+n[e-1],i=r-e;return i?u+i*(n[e]-u):u},$o.median=function(t,r){return arguments.length>1&&(t=t.map(r)),t=t.filter(n),t.length?$o.quantile(t.sort($o.ascending),.5):void 0},$o.bisector=function(n){return{left:function(t,r,e,u){for(3>arguments.length&&(e=0),4>arguments.length&&(u=t.length);u>e;){var i=e+u>>>1;r>n.call(t,t[i],i)?e=i+1:u=i}return e},right:function(t,r,e,u){for(3>arguments.length&&(e=0),4>arguments.length&&(u=t.length);u>e;){var i=e+u>>>1;n.call(t,t[i],i)>r?u=i:e=i+1}return e}}};var oa=$o.bisector(function(n){return n});$o.bisectLeft=oa.left,$o.bisect=$o.bisectRight=oa.right,$o.shuffle=function(n){for(var t,r,e=n.length;e;)r=0|Math.random()*e--,t=n[e],n[e]=n[r],n[r]=t;return n},$o.permute=function(n,t){for(var r=t.length,e=Array(r);r--;)e[r]=n[t[r]];return e},$o.pairs=function(n){for(var t,r=0,e=n.length-1,u=n[0],i=Array(0>e?0:e);e>r;)i[r]=[t=u,u=n[++r]];return i},$o.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,t=$o.min(arguments,r),e=Array(t);t>++n;)for(var u,i=-1,o=e[n]=Array(u);u>++i;)o[i]=arguments[i][n];return e},$o.transpose=function(n){return $o.zip.apply($o,n)},$o.keys=function(n){var t=[];for(var r in n)t.push(r);return t},$o.values=function(n){var t=[];for(var r in n)t.push(n[r]);return t},$o.entries=function(n){var t=[];for(var r in n)t.push({key:r,value:n[r]});return t},$o.merge=function(n){for(var t,r,e,u=n.length,i=-1,o=0;u>++i;)o+=n[i].length;for(r=Array(o);--u>=0;)for(e=n[u],t=e.length;--t>=0;)r[--o]=e[t];return r};var aa=Math.abs;$o.range=function(n,t,r){if(3>arguments.length&&(r=1,2>arguments.length&&(t=n,n=0)),1/0===(t-n)/r)throw Error("infinite range");var u,i=[],o=e(aa(r)),a=-1;if(n*=o,t*=o,r*=o,0>r)for(;(u=n+r*++a)>t;)i.push(u/o);else for(;t>(u=n+r*++a);)i.push(u/o);return i},$o.map=function(n){var t=new i;if(n instanceof i)n.forEach(function(n,r){t.set(n,r)});else for(var r in n)t.set(r,n[r]);return t},u(i,{has:o,get:function(n){return this[ca+n]},set:function(n,t){return this[ca+n]=t},remove:a,keys:c,values:function(){var n=[];return this.forEach(function(t,r){n.push(r)}),n},entries:function(){var n=[];return this.forEach(function(t,r){n.push({key:t,value:r})}),n},size:s,empty:l,forEach:function(n){for(var t in this)t.charCodeAt(0)===sa&&n.call(this,t.substring(1),this[t])}});var ca="\0",sa=ca.charCodeAt(0);$o.nest=function(){function n(t,a,c){if(c>=o.length)return e?e.call(u,a):r?a.sort(r):a;for(var s,l,f,h,g=-1,p=a.length,d=o[c++],v=new i;p>++g;)(h=v.get(s=d(l=a[g])))?h.push(l):v.set(s,[l]);return t?(l=t(),f=function(r,e){l.set(r,n(t,e,c))}):(l={},f=function(r,e){l[r]=n(t,e,c)}),v.forEach(f),l}function t(n,r){if(r>=o.length)return n;var e=[],u=a[r++];return n.forEach(function(n,u){e.push({key:n,values:t(u,r)})}),u?e.sort(function(n,t){return u(n.key,t.key)}):e}var r,e,u={},o=[],a=[];return u.map=function(t,r){return n(r,t,0)},u.entries=function(r){return t(n($o.map,r,0),0)},u.key=function(n){return o.push(n),u},u.sortKeys=function(n){return a[o.length-1]=n,u},u.sortValues=function(n){return r=n,u},u.rollup=function(n){return e=n,u},u},$o.set=function(n){var t=new f;if(n)for(var r=0,e=n.length;e>r;++r)t.add(n[r]);return t},u(f,{has:o,add:function(n){return this[ca+n]=!0,n},remove:function(n){return n=ca+n,n in this&&delete this[n]},values:c,size:s,empty:l,forEach:function(n){for(var t in this)t.charCodeAt(0)===sa&&n.call(this,t.substring(1))}}),$o.behavior={},$o.rebind=function(n,t){for(var r,e=1,u=arguments.length;u>++e;)n[r=arguments[e]]=h(n,t,t[r]);return n};var la=["webkit","ms","moz","Moz","o","O"];$o.dispatch=function(){for(var n=new d,t=-1,r=arguments.length;r>++t;)n[arguments[t]]=v(n);return n},d.prototype.on=function(n,t){var r=n.indexOf("."),e="";if(r>=0&&(e=n.substring(r+1),n=n.substring(0,r)),n)return 2>arguments.length?this[n].on(e):this[n].on(e,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(e,null);return this}},$o.event=null,$o.requote=function(n){return n.replace(fa,"\\$&")};var fa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ha={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var r in t)n[r]=t[r]},ga=function(n,t){return t.querySelector(n)},pa=function(n,t){return t.querySelectorAll(n)},da=Go[g(Go,"matchesSelector")],va=function(n,t){return da.call(n,t)};"function"==typeof Sizzle&&(ga=function(n,t){return Sizzle(n,t)[0]||null},pa=function(n,t){return Sizzle.uniqueSort(Sizzle(n,t))},va=Sizzle.matchesSelector),$o.selection=function(){return Ma};var ma=$o.selection.prototype=[];ma.select=function(n){var t,r,e,u,i=[];n=_(n);for(var o=-1,a=this.length;a>++o;){i.push(t=[]),t.parentNode=(e=this[o]).parentNode;for(var c=-1,s=e.length;s>++c;)(u=e[c])?(t.push(r=n.call(u,u.__data__,c,o)),r&&"__data__"in u&&(r.__data__=u.__data__)):t.push(null)}return M(i)},ma.selectAll=function(n){var t,r,e=[];n=b(n);for(var u=-1,i=this.length;i>++u;)for(var o=this[u],a=-1,c=o.length;c>++a;)(r=o[a])&&(e.push(t=Wo(n.call(r,r.__data__,a,u))),t.parentNode=r);return M(e)};var ya={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};$o.ns={prefix:ya,qualify:function(n){var t=n.indexOf(":"),r=n;return t>=0&&(r=n.substring(0,t),n=n.substring(t+1)),ya.hasOwnProperty(r)?{space:ya[r],local:n}:n}},ma.attr=function(n,t){if(2>arguments.length){if("string"==typeof n){var r=this.node();return n=$o.ns.qualify(n),n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}for(t in n)this.each(w(t,n[t]));return this}return this.each(w(n,t))},ma.classed=function(n,t){if(2>arguments.length){if("string"==typeof n){var r=this.node(),e=(n=E(n)).length,u=-1;if(t=r.classList){for(;e>++u;)if(!t.contains(n[u]))return!1}else for(t=r.getAttribute("class");e>++u;)if(!S(n[u]).test(t))return!1;return!0}for(t in n)this.each(A(t,n[t]));return this}return this.each(A(n,t))},ma.style=function(n,t,r){var e=arguments.length;if(3>e){if("string"!=typeof n){2>e&&(t="");for(r in n)this.each(N(r,n[r],t));return this}if(2>e)return Ko.getComputedStyle(this.node(),null).getPropertyValue(n);r=""}return this.each(N(n,t,r))},ma.property=function(n,t){if(2>arguments.length){if("string"==typeof n)return this.node()[n];for(t in n)this.each(q(t,n[t]));return this}return this.each(q(n,t))},ma.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},ma.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},ma.append=function(n){return n=z(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},ma.insert=function(n,t){return n=z(n),t=_(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},ma.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},ma.data=function(n,t){function r(n,r){var e,u,o,a=n.length,f=r.length,h=Math.min(a,f),g=Array(f),p=Array(f),d=Array(a);if(t){var v,m=new i,y=new i,x=[];for(e=-1;a>++e;)v=t.call(u=n[e],u.__data__,e),m.has(v)?d[e]=u:m.set(v,u),x.push(v);for(e=-1;f>++e;)v=t.call(r,o=r[e],e),(u=m.get(v))?(g[e]=u,u.__data__=o):y.has(v)||(p[e]=L(o)),y.set(v,o),m.remove(v);for(e=-1;a>++e;)m.has(x[e])&&(d[e]=n[e])}else{for(e=-1;h>++e;)u=n[e],o=r[e],u?(u.__data__=o,g[e]=u):p[e]=L(o);for(;f>e;++e)p[e]=L(r[e]);for(;a>e;++e)d[e]=n[e]}p.update=g,p.parentNode=g.parentNode=d.parentNode=n.parentNode,c.push(p),s.push(g),l.push(d)}var e,u,o=-1,a=this.length;if(!arguments.length){for(n=Array(a=(e=this[0]).length);a>++o;)(u=e[o])&&(n[o]=u.__data__);return n}var c=U([]),s=M([]),l=M([]);if("function"==typeof n)for(;a>++o;)r(e=this[o],n.call(e,e.parentNode.__data__,o));else for(;a>++o;)r(e=this[o],n);return s.enter=function(){return c},s.exit=function(){return l},s},ma.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},ma.filter=function(n){var t,r,e,u=[];"function"!=typeof n&&(n=T(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(r=this[i]).parentNode;for(var a=0,c=r.length;c>a;a++)(e=r[a])&&n.call(e,e.__data__,a,i)&&t.push(e)}return M(u)},ma.order=function(){for(var n=-1,t=this.length;t>++n;)for(var r,e=this[n],u=e.length-1,i=e[u];--u>=0;)(r=e[u])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},ma.sort=function(n){n=D.apply(this,arguments);for(var t=-1,r=this.length;r>++t;)this[t].sort(n);return this.order()},ma.each=function(n){return R(this,function(t,r,e){n.call(t,t.__data__,r,e)})},ma.call=function(n){var t=Wo(arguments);return n.apply(t[0]=this,t),this},ma.empty=function(){return!this.node()},ma.node=function(){for(var n=0,t=this.length;t>n;n++)for(var r=this[n],e=0,u=r.length;u>e;e++){var i=r[e];if(i)return i}return null},ma.size=function(){var n=0;return this.each(function(){++n}),n};var xa=[];$o.selection.enter=U,$o.selection.enter.prototype=xa,xa.append=ma.append,xa.empty=ma.empty,xa.node=ma.node,xa.call=ma.call,xa.size=ma.size,xa.select=function(n){for(var t,r,e,u,i,o=[],a=-1,c=this.length;c>++a;){e=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var s=-1,l=u.length;l>++s;)(i=u[s])?(t.push(e[s]=r=n.call(u.parentNode,i.__data__,s,a)),r.__data__=i.__data__):t.push(null)}return M(o)},xa.insert=function(n,t){return 2>arguments.length&&(t=P(this)),ma.insert.call(this,n,t)},ma.transition=function(){for(var n,t,r=Es||++zs,e=[],u=As||{time:Date.now(),ease:xu,delay:0,duration:250},i=-1,o=this.length;o>++i;){e.push(n=[]);for(var a=this[i],c=-1,s=a.length;s>++c;)(t=a[c])&&Ho(t,c,r,u),n.push(t)}return Uo(e,r)},ma.interrupt=function(){return this.each(j)},$o.select=function(n){var t=["string"==typeof n?ga(n,Jo):n];return t.parentNode=Go,M([t])},$o.selectAll=function(n){var t=Wo("string"==typeof n?pa(n,Jo):n);return t.parentNode=Go,M([t])};var Ma=$o.select(Go);ma.on=function(n,t,r){var e=arguments.length;if(3>e){if("string"!=typeof n){2>e&&(t=!1);for(r in n)this.each(H(r,n[r],t));return this}if(2>e)return(e=this.node()["__on"+n])&&e._;r=!1}return this.each(H(n,t,r))};var _a=$o.map({mouseenter:"mouseover",mouseleave:"mouseout"});_a.forEach(function(n){"on"+n in Jo&&_a.remove(n)});var ba="onselectstart"in Jo?null:g(Go.style,"userSelect"),wa=0;$o.mouse=function(n){return Y(n,y())};var ka=/WebKit/.test(Ko.navigator.userAgent)?-1:0;$o.touches=function(n,t){return 2>arguments.length&&(t=y().touches),t?Wo(t).map(function(t){var r=Y(n,t);return r.identifier=t.identifier,r}):[]},$o.behavior.drag=function(){function n(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function t(){return $o.event.changedTouches[0].identifier}function r(n,t){return $o.touches(n).filter(function(n){return n.identifier===t})[0]}function e(n,t,r,e){return function(){function o(){var n=t(l,g),r=n[0]-d[0],e=n[1]-d[1];v|=r|e,d=n,f({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:r,dy:e})}function a(){m.on(r+"."+p,null).on(e+"."+p,null),y(v&&$o.event.target===h),f({type:"dragend"})}var c,s=this,l=s.parentNode,f=u.of(s,arguments),h=$o.event.target,g=n(),p=null==g?"drag":"drag-"+g,d=t(l,g),v=0,m=$o.select(Ko).on(r+"."+p,o).on(e+"."+p,a),y=I();i?(c=i.apply(s,arguments),c=[c.x-d[0],c.y-d[1]]):c=[0,0],f({type:"dragstart"})}}var u=x(n,"drag","dragstart","dragend"),i=null,o=e(p,$o.mouse,"mousemove","mouseup"),a=e(t,r,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},$o.rebind(n,u,"on")};var Sa=Math.PI,Ea=2*Sa,Aa=Sa/2,Ca=1e-6,Na=Ca*Ca,qa=Sa/180,za=180/Sa,La=Math.SQRT2,Ta=2,Da=4;$o.interpolateZoom=function(n,t){function r(n){var t=n*y;if(m){var r=W(d),o=i/(Ta*h)*(r*J(La*t+d)-B(d));return[e+o*s,u+o*l,i*r/W(La*t+d)]}return[e+n*s,u+n*l,i*Math.exp(La*t)]}var e=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],s=o-e,l=a-u,f=s*s+l*l,h=Math.sqrt(f),g=(c*c-i*i+Da*f)/(2*i*Ta*h),p=(c*c-i*i-Da*f)/(2*c*Ta*h),d=Math.log(Math.sqrt(g*g+1)-g),v=Math.log(Math.sqrt(p*p+1)-p),m=v-d,y=(m||Math.log(c/i))/La;return r.duration=1e3*y,r},$o.behavior.zoom=function(){function n(n){n.on(A,s).on(Pa+".zoom",f).on(C,h).on("dblclick.zoom",g).on(q,l)}function t(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function e(n){k.k=Math.max(E[0],Math.min(E[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function i(){_&&_.domain(M.range().map(function(n){return(n-k.x)/k.k}).map(M.invert)),w&&w.domain(b.range().map(function(n){return(n-k.y)/k.k}).map(b.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(n){n({type:"zoomend"})}function s(){function n(){l=1,u($o.mouse(e),g),a(i)}function r(){f.on(C,Ko===e?h:null).on(N,null),p(l&&$o.event.target===s),c(i)}var e=this,i=z.of(e,arguments),s=$o.event.target,l=0,f=$o.select(Ko).on(C,n).on(N,r),g=t($o.mouse(e)),p=I();j.call(e),o(i)}function l(){function n(){var n=$o.touches(g);return h=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=t(n))}),n}function r(){for(var t=$o.event.changedTouches,r=0,i=t.length;i>r;++r)d[t[r].identifier]=null;var o=n(),c=Date.now();if(1===o.length){if(500>c-y){var s=o[0],l=d[s.identifier];e(2*k.k),u(s,l),m(),a(p)}y=c}else if(o.length>1){var s=o[0],f=o[1],h=s[0]-f[0],g=s[1]-f[1];v=h*h+g*g}}function i(){for(var n,t,r,i,o=$o.touches(g),c=0,s=o.length;s>c;++c,i=null)if(r=o[c],i=d[r.identifier]){if(t)break;n=r,t=i}if(i){var l=(l=r[0]-n[0])*l+(l=r[1]-n[1])*l,f=v&&Math.sqrt(l/v);n=[(n[0]+r[0])/2,(n[1]+r[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],e(f*h)}y=null,u(n,t),a(p)}function f(){if($o.event.touches.length){for(var t=$o.event.changedTouches,r=0,e=t.length;e>r;++r)delete d[t[r].identifier];for(var u in d)return void n()}b.on(M,null).on(_,null),w.on(A,s).on(q,l),S(),c(p)}var h,g=this,p=z.of(g,arguments),d={},v=0,x=$o.event.changedTouches[0].identifier,M="touchmove.zoom-"+x,_="touchend.zoom-"+x,b=$o.select(Ko).on(M,i).on(_,f),w=$o.select(g).on(A,null).on(q,r),S=I();j.call(g),r(),o(p)}function f(){var n=z.of(this,arguments);v?clearTimeout(v):(j.call(this),o(n)),v=setTimeout(function(){v=null,c(n)},50),m();var r=d||$o.mouse(this);p||(p=t(r)),e(Math.pow(2,.002*Ra())*k.k),u(r,p),a(n)}function h(){p=null}function g(){var n=z.of(this,arguments),r=$o.mouse(this),i=t(r),s=Math.log(k.k)/Math.LN2;o(n),e(Math.pow(2,$o.event.shiftKey?Math.ceil(s)-1:Math.floor(s)+1)),u(r,i),a(n),c(n)}var p,d,v,y,M,_,b,w,k={x:0,y:0,k:1},S=[960,500],E=Ua,A="mousedown.zoom",C="mousemove.zoom",N="mouseup.zoom",q="touchstart.zoom",z=x(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=z.of(this,arguments),t=k;Es?$o.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var r=S[0],e=S[1],u=r/2,i=e/2,o=$o.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,r/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,r/t.k]);return function(t){var e=o(t),c=r/e[2];this.__chart__=k={x:u-e[0]*c,y:i-e[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=k,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},i(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},i(),n):k.k},n.scaleExtent=function(t){return arguments.length?(E=null==t?Ua:[+t[0],+t[1]],n):E},n.center=function(t){return arguments.length?(d=t&&[+t[0],+t[1]],n):d},n.size=function(t){return arguments.length?(S=t&&[+t[0],+t[1]],n):S},n.x=function(t){return arguments.length?(_=t,M=t.copy(),k={x:0,y:0,k:1},n):_},n.y=function(t){return arguments.length?(w=t,b=t.copy(),k={x:0,y:0,k:1},n):w},$o.rebind(n,z,"on")};var Ra,Ua=[0,1/0],Pa="onwheel"in Jo?(Ra=function(){return-$o.event.deltaY*($o.event.deltaMode?120:1)},"wheel"):"onmousewheel"in Jo?(Ra=function(){return $o.event.wheelDelta},"mousewheel"):(Ra=function(){return-$o.event.detail},"MozMousePixelScroll");K.prototype.toString=function(){return this.rgb()+""},$o.hsl=function(n,t,r){return 1===arguments.length?n instanceof nt?Q(n.h,n.s,n.l):mt(""+n,yt,Q):Q(+n,+t,+r)};var ja=nt.prototype=new K;ja.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),Q(this.h,this.s,this.l/n)},ja.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),Q(this.h,this.s,n*this.l)},ja.rgb=function(){return tt(this.h,this.s,this.l)},$o.hcl=function(n,t,r){return 1===arguments.length?n instanceof et?rt(n.h,n.c,n.l):n instanceof ot?ct(n.l,n.a,n.b):ct((n=xt((n=$o.rgb(n)).r,n.g,n.b)).l,n.a,n.b):rt(+n,+t,+r)};var Ha=et.prototype=new K;Ha.brighter=function(n){return rt(this.h,this.c,Math.min(100,this.l+Fa*(arguments.length?n:1)))},Ha.darker=function(n){return rt(this.h,this.c,Math.max(0,this.l-Fa*(arguments.length?n:1)))},Ha.rgb=function(){return ut(this.h,this.c,this.l).rgb()},$o.lab=function(n,t,r){return 1===arguments.length?n instanceof ot?it(n.l,n.a,n.b):n instanceof et?ut(n.l,n.c,n.h):xt((n=$o.rgb(n)).r,n.g,n.b):it(+n,+t,+r)};var Fa=18,Oa=.95047,Ia=1,Ya=1.08883,Za=ot.prototype=new K;Za.brighter=function(n){return it(Math.min(100,this.l+Fa*(arguments.length?n:1)),this.a,this.b)},Za.darker=function(n){return it(Math.max(0,this.l-Fa*(arguments.length?n:1)),this.a,this.b)},Za.rgb=function(){return at(this.l,this.a,this.b)},$o.rgb=function(n,t,r){return 1===arguments.length?n instanceof dt?pt(n.r,n.g,n.b):mt(""+n,pt,tt):pt(~~n,~~t,~~r)};var Va=dt.prototype=new K;Va.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,r=this.g,e=this.b,u=30;return t||r||e?(t&&u>t&&(t=u),r&&u>r&&(r=u),e&&u>e&&(e=u),pt(Math.min(255,~~(t/n)),Math.min(255,~~(r/n)),Math.min(255,~~(e/n)))):pt(u,u,u)},Va.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),pt(~~(n*this.r),~~(n*this.g),~~(n*this.b))},Va.hsl=function(){return yt(this.r,this.g,this.b)},Va.toString=function(){return"#"+vt(this.r)+vt(this.g)+vt(this.b)};var Xa=$o.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Xa.forEach(function(n,t){Xa.set(n,ht(t))}),$o.functor=bt,$o.xhr=kt(wt),$o.dsv=function(n,t){function r(n,r,i){3>arguments.length&&(i=r,r=null);var o=St(n,t,null==r?e:u(r),i);return o.row=function(n){return arguments.length?o.response(null==(r=n)?e:u(n)):r},o}function e(n){return r.parse(n.responseText)}function u(n){return function(t){return r.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return r.parse=function(n,t){var e;return r.parseRows(n,function(n,r){if(e)return e(n,r-1);var u=Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");e=t?function(n,r){return t(u(n),r)}:u})},r.parseRows=function(n,t){function r(){if(l>=s)return o;if(u)return u=!1,i;var t=l;if(34===n.charCodeAt(t)){for(var r=t;s>r++;)if(34===n.charCodeAt(r)){if(34!==n.charCodeAt(r+1))break;++r}l=r+2;var e=n.charCodeAt(r+1);return 13===e?(u=!0,10===n.charCodeAt(r+2)&&++l):10===e&&(u=!0),n.substring(t+1,r).replace(/""/g,'"')}for(;s>l;){var e=n.charCodeAt(l++),a=1;if(10===e)u=!0;else if(13===e)u=!0,10===n.charCodeAt(l)&&(++l,++a);else if(e!==c)continue;return n.substring(t,l-a)}return n.substring(t)}for(var e,u,i={},o={},a=[],s=n.length,l=0,f=0;(e=r())!==o;){for(var h=[];e!==i&&e!==o;)h.push(e),e=r();(!t||(h=t(h,f++)))&&a.push(h)}return a},r.format=function(t){if(Array.isArray(t[0]))return r.formatRows(t);var e=new f,u=[];return t.forEach(function(n){for(var t in n)e.has(t)||u.push(e.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},r.formatRows=function(n){return n.map(i).join("\n")},r},$o.csv=$o.dsv(",","text/csv"),$o.tsv=$o.dsv(" ","text/tab-separated-values");var $a,Ba,Wa,Ja,Ga,Ka=Ko[g(Ko,"requestAnimationFrame")]||function(n){setTimeout(n,17)};$o.timer=function(n,t,r){var e=arguments.length;2>e&&(t=0),3>e&&(r=Date.now());var u=r+t,i={c:n,t:u,f:!1,n:null};Ba?Ba.n=i:$a=i,Ba=i,Wa||(Ja=clearTimeout(Ja),Wa=1,Ka(At))},$o.timer.flush=function(){Ct(),Nt()},$o.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var Qa=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(zt);$o.formatPrefix=function(n,t){var r=0;return n&&(0>n&&(n*=-1),t&&(n=$o.round(n,qt(n,t))),r=1+Math.floor(1e-12+Math.log(n)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((0>=r?r+1:r-1)/3)))),Qa[8+r/3]};var nc=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,tc=$o.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=$o.round(n,qt(n,t))).toFixed(Math.max(0,Math.min(20,qt(n*(1+1e-15),t))))}}),rc=$o.time={},ec=Date;Dt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){uc.setUTCDate.apply(this._,arguments)},setDay:function(){uc.setUTCDay.apply(this._,arguments)},setFullYear:function(){uc.setUTCFullYear.apply(this._,arguments)},setHours:function(){uc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){uc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){uc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){uc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){uc.setUTCSeconds.apply(this._,arguments)},setTime:function(){uc.setTime.apply(this._,arguments)}};var uc=Date.prototype;rc.year=Rt(function(n){return n=rc.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),rc.years=rc.year.range,rc.years.utc=rc.year.utc.range,rc.day=Rt(function(n){var t=new ec(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),rc.days=rc.day.range,rc.days.utc=rc.day.utc.range,rc.dayOfYear=function(n){var t=rc.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var r=rc[n]=Rt(function(n){return(n=rc.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var r=rc.year(n).getDay();return Math.floor((rc.dayOfYear(n)+(r+t)%7)/7)-(r!==t)});rc[n+"s"]=r.range,rc[n+"s"].utc=r.utc.range,rc[n+"OfYear"]=function(n){var r=rc.year(n).getDay();return Math.floor((rc.dayOfYear(n)+(r+t)%7)/7)}}),rc.week=rc.sunday,rc.weeks=rc.sunday.range,rc.weeks.utc=rc.sunday.utc.range,rc.weekOfYear=rc.sundayOfYear;var ic={"-":"",_:" ",0:"0"},oc=/^\s*\d+/,ac=/^%/;$o.locale=function(n){return{numberFormat:Lt(n),timeFormat:Pt(n)}};var cc=$o.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});$o.format=cc.numberFormat,$o.geo={},ur.prototype={s:0,t:0,add:function(n){ir(n,this.t,sc),ir(sc.s,this.s,this),this.s?this.t+=sc.t:this.s=sc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var sc=new ur;$o.geo.stream=function(n,t){n&&lc.hasOwnProperty(n.type)?lc[n.type](n,t):or(n,t)};var lc={Feature:function(n,t){or(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,e=-1,u=r.length;u>++e;)or(r[e].geometry,t)}},fc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var r=n.coordinates,e=-1,u=r.length;u>++e;)n=r[e],t.point(n[0],n[1],n[2])},LineString:function(n,t){ar(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,e=-1,u=r.length;u>++e;)ar(r[e],t,0)},Polygon:function(n,t){cr(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,e=-1,u=r.length;u>++e;)cr(r[e],t)},GeometryCollection:function(n,t){for(var r=n.geometries,e=-1,u=r.length;u>++e;)or(r[e],t)}};$o.geo.area=function(n){return hc=0,$o.geo.stream(n,pc),hc};var hc,gc=new ur,pc={sphere:function(){hc+=4*Sa},point:p,lineStart:p,lineEnd:p,polygonStart:function(){gc.reset(),pc.lineStart=sr},polygonEnd:function(){var n=2*gc;hc+=0>n?4*Sa+n:n,pc.lineStart=pc.lineEnd=pc.point=p}};$o.geo.bounds=function(){function n(n,t){x.push(M=[l=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,r){var e=lr([t*qa,r*qa]);if(m){var u=hr(m,e),i=[u[1],-u[0],0],o=hr(i,u);dr(o),o=vr(o);var c=t-p,s=c>0?1:-1,d=o[0]*za*s,v=aa(c)>180;if(v^(d>s*p&&s*t>d)){var y=o[1]*za;y>g&&(g=y)}else if(d=(d+360)%360-180,v^(d>s*p&&s*t>d)){var y=-o[1]*za;f>y&&(f=y)}else f>r&&(f=r),r>g&&(g=r);v?p>t?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t):h>=l?(l>t&&(l=t),t>h&&(h=t)):t>p?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t)}else n(t,r);m=e,p=t}function r(){_.point=t}function e(){M[0]=l,M[1]=h,_.point=n,m=null}function u(n,r){if(m){var e=n-p;y+=aa(e)>180?e+(e>0?360:-360):e}else d=n,v=r;pc.point(n,r),t(n,r)}function i(){pc.lineStart()}function o(){u(d,v),pc.lineEnd(),aa(y)>Ca&&(l=-(h=180)),M[0]=l,M[1]=h,m=null
}function a(n,t){return 0>(t-=n)?t+360:t}function c(n,t){return n[0]-t[0]}function s(n,t){return t[0]<=t[1]?n>=t[0]&&t[1]>=n:t[0]>n||n>t[1]}var l,f,h,g,p,d,v,m,y,x,M,_={point:n,lineStart:r,lineEnd:e,polygonStart:function(){_.point=u,_.lineStart=i,_.lineEnd=o,y=0,pc.polygonStart()},polygonEnd:function(){pc.polygonEnd(),_.point=n,_.lineStart=r,_.lineEnd=e,0>gc?(l=-(h=180),f=-(g=90)):y>Ca?g=90:-Ca>y&&(f=-90),M[0]=l,M[1]=h}};return function(n){g=h=-(l=f=1/0),x=[],$o.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var r,e=1,u=x[0],i=[u];t>e;++e)r=x[e],s(r[0],u)||s(r[1],u)?(a(u[0],r[1])>a(u[0],u[1])&&(u[1]=r[1]),a(r[0],u[1])>a(u[0],u[1])&&(u[0]=r[0])):i.push(u=r);for(var o,r,p=-1/0,t=i.length-1,e=0,u=i[t];t>=e;u=r,++e)r=i[e],(o=a(u[1],r[0]))>p&&(p=o,l=r[0],h=u[1])}return x=M=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[h,g]]}}(),$o.geo.centroid=function(n){dc=vc=mc=yc=xc=Mc=_c=bc=wc=kc=Sc=0,$o.geo.stream(n,Ec);var t=wc,r=kc,e=Sc,u=t*t+r*r+e*e;return Na>u&&(t=Mc,r=_c,e=bc,Ca>vc&&(t=mc,r=yc,e=xc),u=t*t+r*r+e*e,Na>u)?[0/0,0/0]:[Math.atan2(r,t)*za,$(e/Math.sqrt(u))*za]};var dc,vc,mc,yc,xc,Mc,_c,bc,wc,kc,Sc,Ec={sphere:p,point:yr,lineStart:Mr,lineEnd:_r,polygonStart:function(){Ec.lineStart=br},polygonEnd:function(){Ec.lineStart=Mr}},Ac=Ar(wr,Lr,Dr,[-Sa,-Sa/2]),Cc=1e9;$o.geo.clipExtent=function(){var n,t,r,e,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Pr(n=+a[0][0],t=+a[0][1],r=+a[1][0],e=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[r,e]]}};return o.extent([[0,0],[960,500]])},($o.geo.conicEqualArea=function(){return Hr(Fr)}).raw=Fr,$o.geo.albers=function(){return $o.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},$o.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,r(i,o),t||(e(i,o),t)||u(i,o),t}var t,r,e,u,i=$o.geo.albers(),o=$o.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=$o.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,r){t=[n,r]}};return n.invert=function(n){var t=i.scale(),r=i.translate(),e=(n[0]-r[0])/t,u=(n[1]-r[1])/t;return(u>=.12&&.234>u&&e>=-.425&&-.214>e?o:u>=.166&&.234>u&&e>=-.214&&-.115>e?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),r=o.stream(n),e=a.stream(n);return{point:function(n,u){t.point(n,u),r.point(n,u),e.point(n,u)},sphere:function(){t.sphere(),r.sphere(),e.sphere()},lineStart:function(){t.lineStart(),r.lineStart(),e.lineStart()},lineEnd:function(){t.lineEnd(),r.lineEnd(),e.lineEnd()},polygonStart:function(){t.polygonStart(),r.polygonStart(),e.polygonStart()},polygonEnd:function(){t.polygonEnd(),r.polygonEnd(),e.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var s=i.scale(),l=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[l-.455*s,f-.238*s],[l+.455*s,f+.238*s]]).stream(c).point,e=o.translate([l-.307*s,f+.201*s]).clipExtent([[l-.425*s+Ca,f+.12*s+Ca],[l-.214*s-Ca,f+.234*s-Ca]]).stream(c).point,u=a.translate([l-.205*s,f+.212*s]).clipExtent([[l-.214*s+Ca,f+.166*s+Ca],[l-.115*s-Ca,f+.234*s-Ca]]).stream(c).point,n},n.scale(1070)};var Nc,qc,zc,Lc,Tc,Dc,Rc={point:p,lineStart:p,lineEnd:p,polygonStart:function(){qc=0,Rc.lineStart=Or},polygonEnd:function(){Rc.lineStart=Rc.lineEnd=Rc.point=p,Nc+=aa(qc/2)}},Uc={point:Ir,lineStart:p,lineEnd:p,polygonStart:p,polygonEnd:p},Pc={point:Vr,lineStart:Xr,lineEnd:$r,polygonStart:function(){Pc.lineStart=Br},polygonEnd:function(){Pc.point=Vr,Pc.lineStart=Xr,Pc.lineEnd=$r}};$o.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),$o.geo.stream(n,o)),i.result()}function t(){return o=null,n}var r,e,u,i,o,a=4.5;return n.area=function(n){return Nc=0,$o.geo.stream(n,u(Rc)),Nc},n.centroid=function(n){return mc=yc=xc=Mc=_c=bc=wc=kc=Sc=0,$o.geo.stream(n,u(Pc)),Sc?[wc/Sc,kc/Sc]:bc?[Mc/bc,_c/bc]:xc?[mc/xc,yc/xc]:[0/0,0/0]},n.bounds=function(n){return Tc=Dc=-(zc=Lc=1/0),$o.geo.stream(n,u(Uc)),[[zc,Lc],[Tc,Dc]]},n.projection=function(n){return arguments.length?(u=(r=n)?n.stream||Gr(n):wt,t()):r},n.context=function(n){return arguments.length?(i=null==(e=n)?new Yr:new Wr(n),"function"!=typeof a&&i.pointRadius(a),t()):e},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection($o.geo.albersUsa()).context(null)},$o.geo.transform=function(n){return{stream:function(t){var r=new Kr(t);for(var e in n)r[e]=n[e];return r}}},Kr.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},$o.geo.projection=ne,$o.geo.projectionMutator=te,($o.geo.equirectangular=function(){return ne(ee)}).raw=ee.invert=ee,$o.geo.rotation=function(n){function t(t){return t=n(t[0]*qa,t[1]*qa),t[0]*=za,t[1]*=za,t}return n=ie(n[0]%360*qa,n[1]*qa,n.length>2?n[2]*qa:0),t.invert=function(t){return t=n.invert(t[0]*qa,t[1]*qa),t[0]*=za,t[1]*=za,t},t},ue.invert=ee,$o.geo.circle=function(){function n(){var n="function"==typeof e?e.apply(this,arguments):e,t=ie(-n[0]*qa,-n[1]*qa,0).invert,u=[];return r(null,null,1,{point:function(n,r){u.push(n=t(n,r)),n[0]*=za,n[1]*=za}}),{type:"Polygon",coordinates:[u]}}var t,r,e=[0,0],u=6;return n.origin=function(t){return arguments.length?(e=t,n):e},n.angle=function(e){return arguments.length?(r=se((t=+e)*qa,u*qa),n):t},n.precision=function(e){return arguments.length?(r=se(t*qa,(u=+e)*qa),n):u},n.angle(90)},$o.geo.distance=function(n,t){var r,e=(t[0]-n[0])*qa,u=n[1]*qa,i=t[1]*qa,o=Math.sin(e),a=Math.cos(e),c=Math.sin(u),s=Math.cos(u),l=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=s*l-c*f*a)*r),c*l+s*f*a)},$o.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return $o.range(Math.ceil(i/v)*v,u,v).map(h).concat($o.range(Math.ceil(s/m)*m,c,m).map(g)).concat($o.range(Math.ceil(e/p)*p,r,p).filter(function(n){return aa(n%v)>Ca}).map(l)).concat($o.range(Math.ceil(a/d)*d,o,d).filter(function(n){return aa(n%m)>Ca}).map(f))}var r,e,u,i,o,a,c,s,l,f,h,g,p=10,d=p,v=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(s).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],s=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),s>c&&(t=s,s=c,c=t),n.precision(y)):[[i,s],[u,c]]},n.minorExtent=function(t){return arguments.length?(e=+t[0][0],r=+t[1][0],a=+t[0][1],o=+t[1][1],e>r&&(t=e,e=r,r=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[e,a],[r,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(v=+t[0],m=+t[1],n):[v,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],n):[p,d]},n.precision=function(t){return arguments.length?(y=+t,l=fe(a,o,90),f=he(e,r,y),h=fe(s,c,90),g=he(i,u,y),n):y},n.majorExtent([[-180,-90+Ca],[180,90-Ca]]).minorExtent([[-180,-80-Ca],[180,80+Ca]])},$o.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||e.apply(this,arguments),r||u.apply(this,arguments)]}}var t,r,e=ge,u=pe;return n.distance=function(){return $o.geo.distance(t||e.apply(this,arguments),r||u.apply(this,arguments))},n.source=function(r){return arguments.length?(e=r,t="function"==typeof r?null:r,n):e},n.target=function(t){return arguments.length?(u=t,r="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},$o.geo.interpolate=function(n,t){return de(n[0]*qa,n[1]*qa,t[0]*qa,t[1]*qa)},$o.geo.length=function(n){return jc=0,$o.geo.stream(n,Hc),jc};var jc,Hc={sphere:p,point:p,lineStart:ve,lineEnd:p,polygonStart:p,polygonEnd:p},Fc=me(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});($o.geo.azimuthalEqualArea=function(){return ne(Fc)}).raw=Fc;var Oc=me(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},wt);($o.geo.azimuthalEquidistant=function(){return ne(Oc)}).raw=Oc,($o.geo.conicConformal=function(){return Hr(ye)}).raw=ye,($o.geo.conicEquidistant=function(){return Hr(xe)}).raw=xe;var Ic=me(function(n){return 1/n},Math.atan);($o.geo.gnomonic=function(){return ne(Ic)}).raw=Ic,Me.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Aa]},($o.geo.mercator=function(){return _e(Me)}).raw=Me;var Yc=me(function(){return 1},Math.asin);($o.geo.orthographic=function(){return ne(Yc)}).raw=Yc;var Zc=me(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});($o.geo.stereographic=function(){return ne(Zc)}).raw=Zc,be.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Aa]},($o.geo.transverseMercator=function(){var n=_e(be),t=n.center,r=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[-n[1],n[0]])},n.rotate=function(n){return n?r([n[0],n[1],n.length>2?n[2]+90:90]):(n=r(),[n[0],n[1],n[2]-90])},n.rotate([0,0])}).raw=be,$o.geom={},$o.geom.hull=function(n){function t(n){if(3>n.length)return[];var t,u=bt(r),i=bt(e),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(Ee),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var s=Se(a),l=Se(c),f=l[0]===s[0],h=l[l.length-1]===s[s.length-1],g=[];for(t=s.length-1;t>=0;--t)g.push(n[a[s[t]][2]]);for(t=+f;l.length-h>t;++t)g.push(n[a[l[t]][2]]);return g}var r=we,e=ke;return arguments.length?t(n):(t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(e=n,t):e},t)},$o.geom.polygon=function(n){return ha(n,Vc),n};var Vc=$o.geom.polygon.prototype=[];Vc.area=function(){for(var n,t=-1,r=this.length,e=this[r-1],u=0;r>++t;)n=e,e=this[t],u+=n[1]*e[0]-n[0]*e[1];return.5*u},Vc.centroid=function(n){var t,r,e=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));u>++e;)t=a,a=this[e],r=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*r,o+=(t[1]+a[1])*r;return[i*n,o*n]},Vc.clip=function(n){for(var t,r,e,u,i,o,a=Ne(n),c=-1,s=this.length-Ne(this),l=this[s-1];s>++c;){for(t=n.slice(),n.length=0,u=this[c],i=t[(e=t.length-a)-1],r=-1;e>++r;)o=t[r],Ae(o,l,u)?(Ae(i,l,u)||n.push(Ce(i,o,l,u)),n.push(o)):Ae(i,l,u)&&n.push(Ce(i,o,l,u)),i=o;a&&n.push(n[0]),l=u}return n};var Xc,$c,Bc,Wc,Jc,Gc=[],Kc=[];Pe.prototype.prepare=function(){for(var n,t=this.edges,r=t.length;r--;)n=t[r].edge,n.b&&n.a||t.splice(r,1);return t.sort(He),t.length},We.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Je.prototype={insert:function(n,t){var r,e,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;r=n}else this._?(n=nu(this._),t.P=null,t.N=n,n.P=n.L=t,r=n):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,n=t;r&&r.C;)e=r.U,r===e.L?(u=e.R,u&&u.C?(r.C=u.C=!1,e.C=!0,n=e):(n===r.R&&(Ke(this,r),n=r,r=n.U),r.C=!1,e.C=!0,Qe(this,e))):(u=e.L,u&&u.C?(r.C=u.C=!1,e.C=!0,n=e):(n===r.L&&(Qe(this,r),n=r,r=n.U),r.C=!1,e.C=!0,Ke(this,e))),r=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,r,e,u=n.U,i=n.L,o=n.R;if(r=i?o?nu(o):i:o,u?u.L===n?u.L=r:u.R=r:this._=r,i&&o?(e=r.C,r.C=n.C,r.L=i,i.U=r,r!==o?(u=r.U,r.U=n.U,n=r.R,u.L=n,r.R=o,o.U=r):(r.U=u,u=r,n=r.R)):(e=n.C,n=r),n&&(n.U=u),!e){if(n&&n.C)return n.C=!1,void 0;do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,Ke(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Qe(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,Ke(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,Qe(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Ke(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,Qe(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},$o.geom.voronoi=function(n){function t(n){var t=Array(n.length),e=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return tu(r(n),a).cells.forEach(function(r,a){var c=r.edges,s=r.site,l=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):s.x>=e&&i>=s.x&&s.y>=u&&o>=s.y?[[e,o],[i,o],[i,u],[e,u]]:[];l.point=n[a]}),t}function r(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ca)*Ca,y:Math.round(o(n,t)/Ca)*Ca,i:t}})}var e=we,u=ke,i=e,o=u,a=Qc;return n?t(n):(t.links=function(n){return tu(r(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return tu(r(n)).cells.forEach(function(r,e){for(var u,i,o=r.site,a=r.edges.sort(He),c=-1,s=a.length,l=a[s-1].edge,f=l.l===o?l.r:l.l;s>++c;)u=l,i=f,l=a[c].edge,f=l.l===o?l.r:l.l,i.i>e&&f.i>e&&0>eu(o,i,f)&&t.push([n[e],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=bt(e=n),t):e},t.y=function(n){return arguments.length?(o=bt(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?Qc:n,t):a===Qc?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===Qc?null:a&&a[1]},t)};var Qc=[[-1e6,-1e6],[1e6,1e6]];$o.geom.delaunay=function(n){return $o.geom.voronoi().triangles(n)},$o.geom.quadtree=function(n,t,r,e,u){function i(n){function i(n,t,r,e,u,i,o,a){if(!isNaN(r)&&!isNaN(e))if(n.leaf){var c=n.x,l=n.y;if(null!=c)if(.01>aa(c-r)+aa(l-e))s(n,t,r,e,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,s(n,f,c,l,u,i,o,a),s(n,t,r,e,u,i,o,a)}else n.x=r,n.y=e,n.point=t}else s(n,t,r,e,u,i,o,a)}function s(n,t,r,e,u,o,a,c){var s=.5*(u+a),l=.5*(o+c),f=r>=s,h=e>=l,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=ou()),f?u=s:a=s,h?o=l:c=l,i(n,t,r,e,u,o,a,c)}var l,f,h,g,p,d,v,m,y,x=bt(a),M=bt(c);if(null!=t)d=t,v=r,m=e,y=u;else if(m=y=-(d=v=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)l=n[g],d>l.x&&(d=l.x),v>l.y&&(v=l.y),l.x>m&&(m=l.x),l.y>y&&(y=l.y),f.push(l.x),h.push(l.y);else for(g=0;p>g;++g){var _=+x(l=n[g],g),b=+M(l,g);d>_&&(d=_),v>b&&(v=b),_>m&&(m=_),b>y&&(y=b),f.push(_),h.push(b)}var w=m-d,k=y-v;w>k?y=v+w:m=d+k;var S=ou();if(S.add=function(n){i(S,n,+x(n,++g),+M(n,g),d,v,m,y)},S.visit=function(n){au(n,S,d,v,m,y)},g=-1,null==t){for(;p>++g;)i(S,n[g],f[g],h[g],d,v,m,y);--g}else n.forEach(S.add);return f=h=n=l=null,S}var o,a=we,c=ke;return(o=arguments.length)?(a=uu,c=iu,3===o&&(u=r,e=t,r=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=r=e=u=null:(t=+n[0][0],r=+n[0][1],e=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,r],[e,u]]},i.size=function(n){return arguments.length?(null==n?t=r=e=u=null:(t=r=0,e=+n[0],u=+n[1]),i):null==t?null:[e-t,u-r]},i)},$o.interpolateRgb=cu,$o.interpolateObject=su,$o.interpolateNumber=lu,$o.interpolateString=fu;var ns=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;$o.interpolate=hu,$o.interpolators=[function(n,t){var r=typeof t;return("string"===r?Xa.has(t)||/^(#|rgb\(|hsl\()/.test(t)?cu:fu:t instanceof K?cu:"object"===r?Array.isArray(t)?gu:su:lu)(n,t)}],$o.interpolateArray=gu;var ts=function(){return wt},rs=$o.map({linear:ts,poly:Mu,quad:function(){return mu},cubic:function(){return yu},sin:function(){return _u},exp:function(){return bu},circle:function(){return wu},elastic:ku,back:Su,bounce:function(){return Eu}}),es=$o.map({"in":wt,out:du,"in-out":vu,"out-in":function(n){return vu(du(n))}});$o.ease=function(n){var t=n.indexOf("-"),r=t>=0?n.substring(0,t):n,e=t>=0?n.substring(t+1):"in";return r=rs.get(r)||ts,e=es.get(e)||wt,pu(e(r.apply(null,Bo.call(arguments,1))))},$o.interpolateHcl=Au,$o.interpolateHsl=Cu,$o.interpolateLab=Nu,$o.interpolateRound=qu,$o.transform=function(n){var t=Jo.createElementNS($o.ns.prefix.svg,"g");return($o.transform=function(n){if(null!=n){t.setAttribute("transform",n);var r=t.transform.baseVal.consolidate()}return new zu(r?r.matrix:us)})(n)},zu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var us={a:1,b:0,c:0,d:1,e:0,f:0};$o.interpolateTransform=Ru,$o.layout={},$o.layout.bundle=function(){return function(n){for(var t=[],r=-1,e=n.length;e>++r;)t.push(ju(n[r]));return t}},$o.layout.chord=function(){function n(){var n,s,f,h,g,p={},d=[],v=$o.range(i),m=[];for(r=[],e=[],n=0,h=-1;i>++h;){for(s=0,g=-1;i>++g;)s+=u[h][g];d.push(s),m.push($o.range(i)),n+=s}for(o&&v.sort(function(n,t){return o(d[n],d[t])}),a&&m.forEach(function(n,t){n.sort(function(n,r){return a(u[t][n],u[t][r])})}),n=(Ea-l*i)/n,s=0,h=-1;i>++h;){for(f=s,g=-1;i>++g;){var y=v[h],x=m[y][g],M=u[y][x],_=s,b=s+=M*n;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:b,value:M}}e[y]={index:y,startAngle:f,endAngle:s,value:(s-f)/n},s+=l}for(h=-1;i>++h;)for(g=h-1;i>++g;){var w=p[h+"-"+g],k=p[g+"-"+h];(w.value||k.value)&&r.push(w.value<k.value?{source:k,target:w}:{source:w,target:k})}c&&t()}function t(){r.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var r,e,u,i,o,a,c,s={},l=0;return s.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,r=e=null,s):u},s.padding=function(n){return arguments.length?(l=n,r=e=null,s):l},s.sortGroups=function(n){return arguments.length?(o=n,r=e=null,s):o},s.sortSubgroups=function(n){return arguments.length?(a=n,r=null,s):a},s.sortChords=function(n){return arguments.length?(c=n,r&&t(),s):c},s.chords=function(){return r||n(),r},s.groups=function(){return e||n(),e},s},$o.layout.force=function(){function n(n){return function(t,r,e,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-r,c=i*i+o*o;if(c>a*a/v){if(p>c){var s=t.charge/c;n.px-=i*s,n.py-=o*s}return!0}if(t.point&&c&&p>c){var s=t.pointCharge/c;n.px-=i*s,n.py-=o*s}}return!t.charge}}function t(n){n.px=$o.event.x,n.py=$o.event.y,a.resume()}var r,e,u,i,o,a={},c=$o.dispatch("start","tick","end"),s=[1,1],l=.9,f=is,h=os,g=-30,p=as,d=.1,v=.64,m=[],y=[];return a.tick=function(){if(.005>(e*=.99))return c.end({type:"end",alpha:e=0}),!0;var t,r,a,f,h,p,v,x,M,_=m.length,b=y.length;for(r=0;b>r;++r)a=y[r],f=a.source,h=a.target,x=h.x-f.x,M=h.y-f.y,(p=x*x+M*M)&&(p=e*i[r]*((p=Math.sqrt(p))-u[r])/p,x*=p,M*=p,h.x-=x*(v=f.weight/(h.weight+f.weight)),h.y-=M*v,f.x+=x*(v=1-v),f.y+=M*v);if((v=e*d)&&(x=s[0]/2,M=s[1]/2,r=-1,v))for(;_>++r;)a=m[r],a.x+=(x-a.x)*v,a.y+=(M-a.y)*v;if(g)for(Vu(t=$o.geom.quadtree(m),e,o),r=-1;_>++r;)(a=m[r]).fixed||t.visit(n(a));for(r=-1;_>++r;)a=m[r],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*l,a.y-=(a.py-(a.py=a.y))*l);c.tick({type:"tick",alpha:e})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(y=n,a):y},a.size=function(n){return arguments.length?(s=n,a):s},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(l=+n,a):l},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(d=+n,a):d},a.theta=function(n){return arguments.length?(v=n*n,a):Math.sqrt(v)},a.alpha=function(n){return arguments.length?(n=+n,e?e=n>0?n:0:n>0&&(c.start({type:"start",alpha:e=n}),$o.timer(a.tick)),a):e},a.start=function(){function n(n,e){if(!r){for(r=Array(c),a=0;c>a;++a)r[a]=[];for(a=0;s>a;++a){var u=y[a];r[u.source.index].push(u.target),r[u.target.index].push(u.source)}}for(var i,o=r[t],a=-1,s=o.length;s>++a;)if(!isNaN(i=o[a][n]))return i;return Math.random()*e}var t,r,e,c=m.length,l=y.length,p=s[0],d=s[1];for(t=0;c>t;++t)(e=m[t]).index=t,e.weight=0;for(t=0;l>t;++t)e=y[t],"number"==typeof e.source&&(e.source=m[e.source]),"number"==typeof e.target&&(e.target=m[e.target]),++e.source.weight,++e.target.weight;for(t=0;c>t;++t)e=m[t],isNaN(e.x)&&(e.x=n("x",p)),isNaN(e.y)&&(e.y=n("y",d)),isNaN(e.px)&&(e.px=e.x),isNaN(e.py)&&(e.py=e.y);if(u=[],"function"==typeof f)for(t=0;l>t;++t)u[t]=+f.call(this,y[t],t);else for(t=0;l>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;l>t;++t)i[t]=+h.call(this,y[t],t);else for(t=0;l>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return r||(r=$o.behavior.drag().origin(wt).on("dragstart.force",Ou).on("drag.force",t).on("dragend.force",Iu)),arguments.length?(this.on("mouseover.force",Yu).on("mouseout.force",Zu).call(r),void 0):r},$o.rebind(a,c,"on")};var is=20,os=1,as=1/0;$o.layout.hierarchy=function(){function n(t,o,a){var c=u.call(r,t,o);if(t.depth=o,a.push(t),c&&(s=c.length)){for(var s,l,f=-1,h=t.children=Array(s),g=0,p=o+1;s>++f;)l=h[f]=n(c[f],p,a),l.parent=t,g+=l.value;e&&h.sort(e),i&&(t.value=g)}else delete t.children,i&&(t.value=+i.call(r,t,o)||0);return t}function t(n,e){var u=n.children,o=0;if(u&&(a=u.length))for(var a,c=-1,s=e+1;a>++c;)o+=t(u[c],s);else i&&(o=+i.call(r,n,e)||0);return i&&(n.value=o),o}function r(t){var r=[];return n(t,0,r),r}var e=Wu,u=$u,i=Bu;return r.sort=function(n){return arguments.length?(e=n,r):e},r.children=function(n){return arguments.length?(u=n,r):u},r.value=function(n){return arguments.length?(i=n,r):i},r.revalue=function(n){return t(n,0),n},r},$o.layout.partition=function(){function n(t,r,e,u){var i=t.children;if(t.x=r,t.y=t.depth*u,t.dx=e,t.dy=u,i&&(o=i.length)){var o,a,c,s=-1;for(e=t.value?e/t.value:0;o>++s;)n(a=i[s],r,c=a.value*e,u),r+=c}}function t(n){var r=n.children,e=0;if(r&&(u=r.length))for(var u,i=-1;u>++i;)e=Math.max(e,t(r[i]));return 1+e}function r(r,i){var o=e.call(this,r,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var e=$o.layout.hierarchy(),u=[1,1];return r.size=function(n){return arguments.length?(u=n,r):u},Xu(r,e)},$o.layout.pie=function(){function n(i){var o=i.map(function(r,e){return+t.call(n,r,e)}),a=+("function"==typeof e?e.apply(this,arguments):e),c=(("function"==typeof u?u.apply(this,arguments):u)-a)/$o.sum(o),s=$o.range(i.length);null!=r&&s.sort(r===cs?function(n,t){return o[t]-o[n]}:function(n,t){return r(i[n],i[t])});var l=[];return s.forEach(function(n){var t;l[n]={data:i[n],value:t=o[n],startAngle:a,endAngle:a+=t*c}}),l}var t=Number,r=cs,e=0,u=Ea;return n.value=function(r){return arguments.length?(t=r,n):t},n.sort=function(t){return arguments.length?(r=t,n):r},n.startAngle=function(t){return arguments.length?(e=t,n):e},n.endAngle=function(t){return arguments.length?(u=t,n):u},n};var cs={};$o.layout.stack=function(){function n(a,c){var s=a.map(function(r,e){return t.call(n,r,e)}),l=s.map(function(t){return t.map(function(t,r){return[i.call(n,t,r),o.call(n,t,r)]})}),f=r.call(n,l,c);s=$o.permute(s,f),l=$o.permute(l,f);var h,g,p,d=e.call(n,l,c),v=s.length,m=s[0].length;for(g=0;m>g;++g)for(u.call(n,s[0][g],p=d[g],l[0][g][1]),h=1;v>h;++h)u.call(n,s[h][g],p+=l[h-1][g][1],l[h][g][1]);return a}var t=wt,r=ni,e=ti,u=Qu,i=Gu,o=Ku;return n.values=function(r){return arguments.length?(t=r,n):t},n.order=function(t){return arguments.length?(r="function"==typeof t?t:ss.get(t)||ni,n):r},n.offset=function(t){return arguments.length?(e="function"==typeof t?t:ls.get(t)||ti,n):e},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var ss=$o.map({"inside-out":function(n){var t,r,e=n.length,u=n.map(ri),i=n.map(ei),o=$o.range(e).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,s=[],l=[];for(t=0;e>t;++t)r=o[t],c>a?(a+=i[r],s.push(r)):(c+=i[r],l.push(r));return l.reverse().concat(s)},reverse:function(n){return $o.range(n.length).reverse()},"default":ni}),ls=$o.map({silhouette:function(n){var t,r,e,u=n.length,i=n[0].length,o=[],a=0,c=[];for(r=0;i>r;++r){for(t=0,e=0;u>t;t++)e+=n[t][r][1];e>a&&(a=e),o.push(e)}for(r=0;i>r;++r)c[r]=(a-o[r])/2;return c},wiggle:function(n){var t,r,e,u,i,o,a,c,s,l=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=s=0,r=1;h>r;++r){for(t=0,u=0;l>t;++t)u+=n[t][r][1];for(t=0,i=0,a=f[r][0]-f[r-1][0];l>t;++t){for(e=0,o=(n[t][r][1]-n[t][r-1][1])/(2*a);t>e;++e)o+=(n[e][r][1]-n[e][r-1][1])/a;i+=o*n[t][r][1]}g[r]=c-=u?i/u*a:0,s>c&&(s=c)}for(r=0;h>r;++r)g[r]-=s;return g},expand:function(n){var t,r,e,u=n.length,i=n[0].length,o=1/u,a=[];for(r=0;i>r;++r){for(t=0,e=0;u>t;t++)e+=n[t][r][1];if(e)for(t=0;u>t;t++)n[t][r][1]/=e;else for(t=0;u>t;t++)n[t][r][1]=o}for(r=0;i>r;++r)a[r]=0;return a},zero:ti});$o.layout.histogram=function(){function n(n,i){for(var o,a,c=[],s=n.map(r,this),l=e.call(this,s,i),f=u.call(this,l,s,i),i=-1,h=s.length,g=f.length-1,p=t?1:1/h;g>++i;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;h>++i;)a=s[i],a>=l[0]&&l[1]>=a&&(o=c[$o.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,r=Number,e=ai,u=ii;return n.value=function(t){return arguments.length?(r=t,n):r},n.range=function(t){return arguments.length?(e=bt(t),n):e},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return oi(n,t)}:bt(t),n):u},n.frequency=function(r){return arguments.length?(t=!!r,n):t},n},$o.layout.tree=function(){function n(n,i){function o(n,t){var e=n.children,u=n._tree;if(e&&(i=e.length)){for(var i,a,s,l=e[0],f=l,h=-1;i>++h;)s=e[h],o(s,a),f=c(s,a,f),a=s;vi(n);var g=.5*(l._tree.prelim+s._tree.prelim);t?(u.prelim=t._tree.prelim+r(n,t),u.mod=u.prelim-g):u.prelim=g}else t&&(u.prelim=t._tree.prelim+r(n,t))}function a(n,t){n.x=n._tree.prelim+t;var r=n.children;if(r&&(e=r.length)){var e,u=-1;for(t+=n._tree.mod;e>++u;)a(r[u],t)}}function c(n,t,e){if(t){for(var u,i=n,o=n,a=t,c=n.parent.children[0],s=i._tree.mod,l=o._tree.mod,f=a._tree.mod,h=c._tree.mod;a=li(a),i=si(i),a&&i;)c=si(c),o=li(o),o._tree.ancestor=n,u=a._tree.prelim+f-i._tree.prelim-s+r(a,i),u>0&&(mi(yi(a,n,e),n,u),s+=u,l+=u),f+=a._tree.mod,s+=i._tree.mod,h+=c._tree.mod,l+=o._tree.mod;a&&!li(o)&&(o._tree.thread=a,o._tree.mod+=f-l),i&&!si(c)&&(c._tree.thread=i,c._tree.mod+=s-h,e=n)}return e}var s=t.call(this,n,i),l=s[0];di(l,function(n,t){n._tree={ancestor:n,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),o(l),a(l,-l._tree.prelim);var f=fi(l,gi),h=fi(l,hi),g=fi(l,pi),p=f.x-r(f,h)/2,d=h.x+r(h,f)/2,v=g.depth||1;return di(l,u?function(n){n.x*=e[0],n.y=n.depth*e[1],delete n._tree}:function(n){n.x=(n.x-p)/(d-p)*e[0],n.y=n.depth/v*e[1],delete n._tree}),s}var t=$o.layout.hierarchy().sort(null).value(null),r=ci,e=[1,1],u=!1;return n.separation=function(t){return arguments.length?(r=t,n):r},n.size=function(t){return arguments.length?(u=null==(e=t),n):u?null:e},n.nodeSize=function(t){return arguments.length?(u=null!=(e=t),n):u?e:null},Xu(n,t)},$o.layout.pack=function(){function n(n,i){var o=r.call(this,n,i),a=o[0],c=u[0],s=u[1],l=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,di(a,function(n){n.r=+l(n.value)}),di(a,wi),e){var f=e*(t?1:Math.max(2*a.r/c,2*a.r/s))/2;di(a,function(n){n.r+=f}),di(a,wi),di(a,function(n){n.r-=f})}return Ei(a,c/2,s/2,t?1:1/Math.max(2*a.r/c,2*a.r/s)),o}var t,r=$o.layout.hierarchy().sort(xi),e=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(r){return arguments.length?(t=null==r||"function"==typeof r?r:+r,n):t},n.padding=function(t){return arguments.length?(e=+t,n):e},Xu(n,r)},$o.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],s=0;di(c,function(n){var t=n.children;t&&t.length?(n.x=Ni(t),n.y=Ci(t)):(n.x=o?s+=r(n,o):0,n.y=0,o=n)});var l=qi(c),f=zi(c),h=l.x-r(l,f)/2,g=f.x+r(f,l)/2;return di(c,u?function(n){n.x=(n.x-c.x)*e[0],n.y=(c.y-n.y)*e[1]}:function(n){n.x=(n.x-h)/(g-h)*e[0],n.y=(1-(c.y?n.y/c.y:1))*e[1]}),a}var t=$o.layout.hierarchy().sort(null).value(null),r=ci,e=[1,1],u=!1;return n.separation=function(t){return arguments.length?(r=t,n):r},n.size=function(t){return arguments.length?(u=null==(e=t),n):u?null:e},n.nodeSize=function(t){return arguments.length?(u=null!=(e=t),n):u?e:null},Xu(n,t)},$o.layout.treemap=function(){function n(n,t){for(var r,e,u=-1,i=n.length;i>++u;)e=(r=n[u]).value*(0>t?0:t),r.area=isNaN(e)||0>=e?0:e}function t(r){var i=r.children;if(i&&i.length){var o,a,c,s=f(r),l=[],h=i.slice(),p=1/0,d="slice"===g?s.dx:"dice"===g?s.dy:"slice-dice"===g?1&r.depth?s.dy:s.dx:Math.min(s.dx,s.dy);for(n(h,s.dx*s.dy/r.value),l.area=0;(c=h.length)>0;)l.push(o=h[c-1]),l.area+=o.area,"squarify"!==g||p>=(a=e(l,d))?(h.pop(),p=a):(l.area-=l.pop().area,u(l,d,s,!1),d=Math.min(s.dx,s.dy),l.length=l.area=0,p=1/0);l.length&&(u(l,d,s,!0),l.length=l.area=0),i.forEach(t)}}function r(t){var e=t.children;if(e&&e.length){var i,o=f(t),a=e.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);e.forEach(r)}}function e(n,t){for(var r,e=n.area,u=0,i=1/0,o=-1,a=n.length;a>++o;)(r=n[o].area)&&(i>r&&(i=r),r>u&&(u=r));return e*=e,t*=t,e?Math.max(t*u*p/e,e/(t*i*p)):1/0}function u(n,t,r,e){var u,i=-1,o=n.length,a=r.x,s=r.y,l=t?c(n.area/t):0;if(t==r.dx){for((e||l>r.dy)&&(l=r.dy);o>++i;)u=n[i],u.x=a,u.y=s,u.dy=l,a+=u.dx=Math.min(r.x+r.dx-a,l?c(u.area/l):0);u.z=!0,u.dx+=r.x+r.dx-a,r.y+=l,r.dy-=l}else{for((e||l>r.dx)&&(l=r.dx);o>++i;)u=n[i],u.x=a,u.y=s,u.dx=l,s+=u.dy=Math.min(r.y+r.dy-s,l?c(u.area/l):0);u.z=!1,u.dy+=r.y+r.dy-s,r.x+=l,r.dx-=l}}function i(e){var u=o||a(e),i=u[0];return i.x=0,i.y=0,i.dx=s[0],i.dy=s[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?r:t)(i),h&&(o=u),u}var o,a=$o.layout.hierarchy(),c=Math.round,s=[1,1],l=null,f=Li,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(s=n,i):s},i.padding=function(n){function t(t){var r=n.call(i,t,t.depth);return null==r?Li(t):Ti(t,"number"==typeof r?[r,r,r,r]:r)}function r(t){return Ti(t,n)}if(!arguments.length)return l;var e;return f=null==(l=n)?Li:"function"==(e=typeof n)?t:"number"===e?(n=[n,n,n,n],r):r,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Xu(i,a)},$o.random={normal:function(n,t){var r=arguments.length;return 2>r&&(t=1),1>r&&(n=0),function(){var r,e,u;do r=2*Math.random()-1,e=2*Math.random()-1,u=r*r+e*e;while(!u||u>1);return n+t*r*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=$o.random.normal.apply($o,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=$o.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,r=0;n>r;r++)t+=Math.random();return t}}},$o.scale={};var fs={floor:wt,ceil:wt};$o.scale.linear=function(){return Fi([0,1],[0,1],hu,!1)};var hs={s:1,g:1,p:1,r:1,e:1};$o.scale.log=function(){return Bi($o.scale.linear().domain([0,1]),10,!0,[1,10])};var gs=$o.format(".0e"),ps={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};$o.scale.pow=function(){return Wi($o.scale.linear(),1,[0,1])},$o.scale.sqrt=function(){return $o.scale.pow().exponent(.5)},$o.scale.ordinal=function(){return Gi([],{t:"range",a:[[]]})},$o.scale.category10=function(){return $o.scale.ordinal().range(ds)},$o.scale.category20=function(){return $o.scale.ordinal().range(vs)},$o.scale.category20b=function(){return $o.scale.ordinal().range(ms)},$o.scale.category20c=function(){return $o.scale.ordinal().range(ys)};var ds=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(gt),vs=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(gt),ms=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(gt),ys=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(gt);
$o.scale.quantile=function(){return Ki([],[])},$o.scale.quantize=function(){return Qi(0,1,[0,1])},$o.scale.threshold=function(){return no([.5],[0,1])},$o.scale.identity=function(){return to([0,1])},$o.svg={},$o.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=r.apply(this,arguments),o=e.apply(this,arguments)+xs,a=u.apply(this,arguments)+xs,c=(o>a&&(c=o,o=a,a=c),a-o),s=Sa>c?"0":"1",l=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);return c>=Ms?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+s+",0 "+n*l+","+n*f+"Z":"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=ro,r=eo,e=uo,u=io;return n.innerRadius=function(r){return arguments.length?(t=bt(r),n):t},n.outerRadius=function(t){return arguments.length?(r=bt(t),n):r},n.startAngle=function(t){return arguments.length?(e=bt(t),n):e},n.endAngle=function(t){return arguments.length?(u=bt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+r.apply(this,arguments))/2,i=(e.apply(this,arguments)+u.apply(this,arguments))/2+xs;return[Math.cos(i)*n,Math.sin(i)*n]},n};var xs=-Aa,Ms=Ea-Ca;$o.svg.line=function(){return oo(wt)};var _s=$o.map({linear:ao,"linear-closed":co,step:so,"step-before":lo,"step-after":fo,basis:yo,"basis-open":xo,"basis-closed":Mo,bundle:_o,cardinal:po,"cardinal-open":ho,"cardinal-closed":go,monotone:Ao});_s.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var bs=[0,2/3,1/3,0],ws=[0,1/3,2/3,0],ks=[0,1/6,2/3,1/6];$o.svg.line.radial=function(){var n=oo(Co);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},lo.reverse=fo,fo.reverse=lo,$o.svg.area=function(){return No(wt)},$o.svg.area.radial=function(){var n=No(Co);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},$o.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),s=t(this,o,n,a);return"M"+c.p0+e(c.r,c.p1,c.a1-c.a0)+(r(c,s)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,s.r,s.p0)+e(s.r,s.p1,s.a1-s.a0)+u(s.r,s.p1,c.r,c.p0))+"Z"}function t(n,t,r,e){var u=t.call(n,r,e),i=a.call(n,u,e),o=c.call(n,u,e)+xs,l=s.call(n,u,e)+xs;return{r:i,a0:o,a1:l,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(l),i*Math.sin(l)]}}function r(n,t){return n.a0==t.a0&&n.a1==t.a1}function e(n,t,r){return"A"+n+","+n+" 0 "+ +(r>Sa)+",1 "+t}function u(n,t,r,e){return"Q 0,0 "+e}var i=ge,o=pe,a=qo,c=uo,s=io;return n.radius=function(t){return arguments.length?(a=bt(t),n):a},n.source=function(t){return arguments.length?(i=bt(t),n):i},n.target=function(t){return arguments.length?(o=bt(t),n):o},n.startAngle=function(t){return arguments.length?(c=bt(t),n):c},n.endAngle=function(t){return arguments.length?(s=bt(t),n):s},n},$o.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=r.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(e),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=ge,r=pe,e=zo;return n.source=function(r){return arguments.length?(t=bt(r),n):t},n.target=function(t){return arguments.length?(r=bt(t),n):r},n.projection=function(t){return arguments.length?(e=t,n):e},n},$o.svg.diagonal.radial=function(){var n=$o.svg.diagonal(),t=zo,r=n.projection;return n.projection=function(n){return arguments.length?r(Lo(t=n)):t},n},$o.svg.symbol=function(){function n(n,e){return(Ss.get(t.call(this,n,e))||Ro)(r.call(this,n,e))}var t=Do,r=To;return n.type=function(r){return arguments.length?(t=bt(r),n):t},n.size=function(t){return arguments.length?(r=bt(t),n):r},n};var Ss=$o.map({circle:Ro,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ns)),r=t*Ns;return"M0,"+-t+"L"+r+",0"+" 0,"+t+" "+-r+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Cs),r=t*Cs/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Cs),r=t*Cs/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});$o.svg.symbolTypes=Ss.keys();var Es,As,Cs=Math.sqrt(3),Ns=Math.tan(30*qa),qs=[],zs=0;qs.call=ma.call,qs.empty=ma.empty,qs.node=ma.node,qs.size=ma.size,$o.transition=function(n){return arguments.length?Es?n.transition():n:Ma.transition()},$o.transition.prototype=qs,qs.select=function(n){var t,r,e,u=this.id,i=[];n=_(n);for(var o=-1,a=this.length;a>++o;){i.push(t=[]);for(var c=this[o],s=-1,l=c.length;l>++s;)(e=c[s])&&(r=n.call(e,e.__data__,s,o))?("__data__"in e&&(r.__data__=e.__data__),Ho(r,s,u,e.__transition__[u]),t.push(r)):t.push(null)}return Uo(i,u)},qs.selectAll=function(n){var t,r,e,u,i,o=this.id,a=[];n=b(n);for(var c=-1,s=this.length;s>++c;)for(var l=this[c],f=-1,h=l.length;h>++f;)if(e=l[f]){i=e.__transition__[o],r=n.call(e,e.__data__,f,c),a.push(t=[]);for(var g=-1,p=r.length;p>++g;)(u=r[g])&&Ho(u,g,o,i),t.push(u)}return Uo(a,o)},qs.filter=function(n){var t,r,e,u=[];"function"!=typeof n&&(n=T(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var r=this[i],a=0,c=r.length;c>a;a++)(e=r[a])&&n.call(e,e.__data__,a,i)&&t.push(e)}return Uo(u,this.id)},qs.tween=function(n,t){var r=this.id;return 2>arguments.length?this.node().__transition__[r].tween.get(n):R(this,null==t?function(t){t.__transition__[r].tween.remove(n)}:function(e){e.__transition__[r].tween.set(n,t)})},qs.attr=function(n,t){function r(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?r:(n+="",function(){var t,r=this.getAttribute(a);return r!==n&&(t=o(r,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?e:(n+="",function(){var t,r=this.getAttributeNS(a.space,a.local);return r!==n&&(t=o(r,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(2>arguments.length){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Ru:hu,a=$o.ns.qualify(n);return Po(this,"attr."+n,t,a.local?i:u)},qs.attrTween=function(n,t){function r(n,r){var e=t.call(this,n,r,this.getAttribute(u));return e&&function(n){this.setAttribute(u,e(n))}}function e(n,r){var e=t.call(this,n,r,this.getAttributeNS(u.space,u.local));return e&&function(n){this.setAttributeNS(u.space,u.local,e(n))}}var u=$o.ns.qualify(n);return this.tween("attr."+n,u.local?e:r)},qs.style=function(n,t,r){function e(){this.style.removeProperty(n)}function u(t){return null==t?e:(t+="",function(){var e,u=Ko.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(e=hu(u,t),function(t){this.style.setProperty(n,e(t),r)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(r in n)this.style(r,n[r],t);return this}r=""}return Po(this,"style."+n,t,u)},qs.styleTween=function(n,t,r){function e(e,u){var i=t.call(this,e,u,Ko.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),r)}}return 3>arguments.length&&(r=""),this.tween("style."+n,e)},qs.text=function(n){return Po(this,"text",n,jo)},qs.remove=function(){return this.each("end.transition",function(){var n;2>this.__transition__.count&&(n=this.parentNode)&&n.removeChild(this)})},qs.ease=function(n){var t=this.id;return 1>arguments.length?this.node().__transition__[t].ease:("function"!=typeof n&&(n=$o.ease.apply($o,arguments)),R(this,function(r){r.__transition__[t].ease=n}))},qs.delay=function(n){var t=this.id;return R(this,"function"==typeof n?function(r,e,u){r.__transition__[t].delay=+n.call(r,r.__data__,e,u)}:(n=+n,function(r){r.__transition__[t].delay=n}))},qs.duration=function(n){var t=this.id;return R(this,"function"==typeof n?function(r,e,u){r.__transition__[t].duration=Math.max(1,n.call(r,r.__data__,e,u))}:(n=Math.max(1,n),function(r){r.__transition__[t].duration=n}))},qs.each=function(n,t){var r=this.id;if(2>arguments.length){var e=As,u=Es;Es=r,R(this,function(t,e,u){As=t.__transition__[r],n.call(t,t.__data__,e,u)}),As=e,Es=u}else R(this,function(e){var u=e.__transition__[r];(u.event||(u.event=$o.dispatch("start","end"))).on(n,t)});return this},qs.transition=function(){for(var n,t,r,e,u=this.id,i=++zs,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],s=0,l=t.length;l>s;s++)(r=t[s])&&(e=Object.create(r.__transition__[u]),e.delay+=e.duration,Ho(r,s,i,e)),n.push(r)}return Uo(o,i)},$o.svg.axis=function(){function n(n){n.each(function(){var n,s=$o.select(this),l=this.__chart__||r,f=this.__chart__=r.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):wt:t,p=s.selectAll(".tick").data(h,f),d=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ca),v=$o.transition(p.exit()).style("opacity",Ca).remove(),m=$o.transition(p).style("opacity",1),y=Ri(f),x=s.selectAll(".domain").data([0]),M=(x.enter().append("path").attr("class","domain"),$o.transition(x));d.append("line"),d.append("text");var _=d.select("line"),b=m.select("line"),w=p.select("text").text(g),k=d.select("text"),S=m.select("text");switch(e){case"bottom":n=Fo,_.attr("y2",u),k.attr("y",Math.max(u,0)+o),b.attr("x2",0).attr("y2",u),S.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+i+"V0H"+y[1]+"V"+i);break;case"top":n=Fo,_.attr("y2",-u),k.attr("y",-(Math.max(u,0)+o)),b.attr("x2",0).attr("y2",-u),S.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+-i+"V0H"+y[1]+"V"+-i);break;case"left":n=Oo,_.attr("x2",-u),k.attr("x",-(Math.max(u,0)+o)),b.attr("x2",-u).attr("y2",0),S.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),M.attr("d","M"+-i+","+y[0]+"H0V"+y[1]+"H"+-i);break;case"right":n=Oo,_.attr("x2",u),k.attr("x",Math.max(u,0)+o),b.attr("x2",u).attr("y2",0),S.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),M.attr("d","M"+i+","+y[0]+"H0V"+y[1]+"H"+i)}if(f.rangeBand){var E=f,A=E.rangeBand()/2;l=f=function(n){return E(n)+A}}else l.rangeBand?l=f:v.call(n,f);d.call(n,l),m.call(n,f)})}var t,r=$o.scale.linear(),e=Ls,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(r=t,n):r},n.orient=function(t){return arguments.length?(e=t in Ts?t+"":Ls,n):e},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(r){return arguments.length?(t=r,n):t},n.tickSize=function(t){var r=arguments.length;return r?(u=+t,i=+arguments[r-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Ls="bottom",Ts={top:1,right:1,bottom:1,left:1};$o.svg.brush=function(){function n(i){i.each(function(){var i=$o.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(p,wt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Ds[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,f=$o.transition(i),h=$o.transition(o);c&&(l=Ri(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),s&&(l=Ri(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),e(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+l[+/e$/.test(n)]+","+f[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",l[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function e(n){n.select(".extent").attr("y",f[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function u(){function u(){32==$o.event.keyCode&&(C||(x=null,q[0]-=l[1],q[1]-=f[1],C=2),m())}function p(){32==$o.event.keyCode&&2==C&&(q[0]+=l[1],q[1]+=f[1],C=0,m())}function d(){var n=$o.mouse(_),u=!1;M&&(n[0]+=M[0],n[1]+=M[1]),C||($o.event.altKey?(x||(x=[(l[0]+l[1])/2,(f[0]+f[1])/2]),q[0]=l[+(n[0]<x[0])],q[1]=f[+(n[1]<x[1])]):x=null),E&&v(n,c,0)&&(r(k),u=!0),A&&v(n,s,1)&&(e(k),u=!0),u&&(t(k),w({type:"brush",mode:C?"move":"resize"}))}function v(n,t,r){var e,u,a=Ri(t),c=a[0],s=a[1],p=q[r],d=r?f:l,v=d[1]-d[0];return C&&(c-=p,s-=v+p),e=(r?g:h)?Math.max(c,Math.min(s,n[r])):n[r],C?u=(e+=p)+v:(x&&(p=Math.max(c,Math.min(s,2*x[r]-e))),e>p?(u=e,e=p):u=p),d[0]!=e||d[1]!=u?(r?o=null:i=null,d[0]=e,d[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),$o.select("body").style("cursor",null),z.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),N(),w({type:"brushend"})}var x,M,_=this,b=$o.select($o.event.target),w=a.of(_,arguments),k=$o.select(_),S=b.datum(),E=!/^(n|s)$/.test(S)&&c,A=!/^(e|w)$/.test(S)&&s,C=b.classed("extent"),N=I(),q=$o.mouse(_),z=$o.select(Ko).on("keydown.brush",u).on("keyup.brush",p);if($o.event.changedTouches?z.on("touchmove.brush",d).on("touchend.brush",y):z.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)q[0]=l[0]-q[0],q[1]=f[0]-q[1];else if(S){var L=+/w$/.test(S),T=+/^n/.test(S);M=[l[1-L]-q[0],f[1-T]-q[1]],q[0]=l[L],q[1]=f[T]}else $o.event.altKey&&(x=q.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),$o.select("body").style("cursor",b.style("cursor")),w({type:"brushstart"}),d()}var i,o,a=x(n,"brushstart","brush","brushend"),c=null,s=null,l=[0,0],f=[0,0],h=!0,g=!0,p=Rs[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:l,y:f,i:i,j:o},r=this.__chart__||t;this.__chart__=t,Es?$o.select(this).transition().each("start.brush",function(){i=r.i,o=r.j,l=r.x,f=r.y,n({type:"brushstart"})}).tween("brush:brush",function(){var r=gu(l,t.x),e=gu(f,t.y);return i=o=null,function(u){l=t.x=r(u),f=t.y=e(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,p=Rs[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,p=Rs[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(h=!!t[0],g=!!t[1]):c?h=!!t:s&&(g=!!t),n):c&&s?[h,g]:c?h:s?g:null},n.extent=function(t){var r,e,u,a,h;return arguments.length?(c&&(r=t[0],e=t[1],s&&(r=r[0],e=e[0]),i=[r,e],c.invert&&(r=c(r),e=c(e)),r>e&&(h=r,r=e,e=h),(r!=l[0]||e!=l[1])&&(l=[r,e])),s&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],s.invert&&(u=s(u),a=s(a)),u>a&&(h=u,u=a,a=h),(u!=f[0]||a!=f[1])&&(f=[u,a])),n):(c&&(i?(r=i[0],e=i[1]):(r=l[0],e=l[1],c.invert&&(r=c.invert(r),e=c.invert(e)),r>e&&(h=r,r=e,e=h))),s&&(o?(u=o[0],a=o[1]):(u=f[0],a=f[1],s.invert&&(u=s.invert(u),a=s.invert(a)),u>a&&(h=u,u=a,a=h))),c&&s?[[r,u],[e,a]]:c?[r,e]:s&&[u,a])},n.clear=function(){return n.empty()||(l=[0,0],f=[0,0],i=o=null),n},n.empty=function(){return!!c&&l[0]==l[1]||!!s&&f[0]==f[1]},$o.rebind(n,a,"on")};var Ds={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Rs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Us=rc.format=cc.timeFormat,Ps=Us.utc,js=Ps("%Y-%m-%dT%H:%M:%S.%LZ");Us.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Io:js,Io.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Io.toString=js.toString,rc.second=Rt(function(n){return new ec(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),rc.seconds=rc.second.range,rc.seconds.utc=rc.second.utc.range,rc.minute=Rt(function(n){return new ec(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),rc.minutes=rc.minute.range,rc.minutes.utc=rc.minute.utc.range,rc.hour=Rt(function(n){var t=n.getTimezoneOffset()/60;return new ec(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),rc.hours=rc.hour.range,rc.hours.utc=rc.hour.utc.range,rc.month=Rt(function(n){return n=rc.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),rc.months=rc.month.range,rc.months.utc=rc.month.utc.range;var Hs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Fs=[[rc.second,1],[rc.second,5],[rc.second,15],[rc.second,30],[rc.minute,1],[rc.minute,5],[rc.minute,15],[rc.minute,30],[rc.hour,1],[rc.hour,3],[rc.hour,6],[rc.hour,12],[rc.day,1],[rc.day,2],[rc.week,1],[rc.month,1],[rc.month,3],[rc.year,1]],Os=Us.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",wr]]),Is={range:function(n,t,r){return $o.range(+n,+t,r).map(Zo)},floor:wt,ceil:wt};Fs.year=rc.year,rc.scale=function(){return Yo($o.scale.linear(),Fs,Os)};var Ys=Fs.map(function(n){return[n[0].utc,n[1]]}),Zs=Ps.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",wr]]);Ys.year=rc.year.utc,rc.scale.utc=function(){return Yo($o.scale.linear(),Ys,Zs)},$o.text=kt(function(n){return n.responseText}),$o.json=function(n,t){return St(n,"application/json",Vo,t)},$o.html=function(n,t){return St(n,"text/html",Xo,t)},$o.xml=kt(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define($o):"object"==typeof t&&t.exports?t.exports=$o:this.d3=$o}()},{}],d3:[function(n,t){t.exports=n("Ub4Hh8")},{}]},{},[]),require=function e(n,t,r){function u(o,a){if(!t[o]){if(!n[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(i)return i(o,!0);throw Error("Cannot find module '"+o+"'")}var s=t[o]={exports:{}};n[o][0].call(s.exports,function(t){var r=n[o][1][t];return u(r?r:t)},s,s.exports,e,n,t,r)}return t[o].exports}for(var i="function"==typeof require&&require,o=0;r.length>o;o++)u(r[o]);return u}({DhjSHW:[function(n,t){function r(n){function t(t){var r,e,u,i,o,a={},c=n.dispatch("tick"),s=0,l=[],f={},h=500,g=500,p=h/g,d=50,v=0,m=.02,y=n.ease("linear"),x=[0,0];return a.sort=function(n){return arguments.length?(u=n,a):u},a.align=function(n){return arguments.length?(x=Array.isArray(n)?n:[n,n],x[0]=.5*x[0]+.5,x[1]=.5*x[1]+.5,a):n},a.width=function(n){return arguments.length?(p=h/g,h=n,a):h},a.height=function(n){return arguments.length?(p=h/g,g=n,a):g},a.rows=function(){return i},a.cols=function(){return o},a.size=function(){return[r,e]},a.speed=function(n){return arguments.length?(m=n,a):m},a.radius=function(n){return arguments.length?(d=n/2,a):d},a.add=function(n){for(var t=0,r=n.length;r>t;t+=1)a.push(n[t],!0);return a.update()},a.push=function(n,t){return"object"!=typeof n&&(n={id:n}),n.id=(n.id||s++)+"",f[n.id]?void 0:(n.x=n.x||h/2,n.y=n.y||g/2,n.sx=n.sx||h/2,n.sy=n.sy||g/2,n.gx=n.gx||h/2,n.gy=n.gy||g/2,f[n.id]=n,l.push(n),t?a:a.update())},a.update=function(){var t=l.length;i=Math.max(Math.floor(Math.sqrt(t*g/h)),1),o=Math.ceil(t/i),r=Math.min(h,d*o),e=Math.min(g,d*i);var c,s=(h-r)*x[0],f=(g-e)*x[1],p=0;u&&l.sort(u);n:for(var m=.5;o>m;m+=1)for(var y=.5;i>y;y+=1,p+=1){if(c=l[p],!c)break n;c.gx=s+r*m/o,c.gy=f+e*y/i,c.sx=c.x,c.sy=c.y}return n.timer(a.tick),v=1,a},a.nodes=function(n){return arguments.length?(l=n,a):l},a.ease=function(t){return arguments.length?(y="function"==typeof t?t:n.ease.apply(n,Array.prototype.slice.call(arguments)),a):t},a.tick=function(){for(var n,t=l.length,r=y(v*v);t--;)n=l[t],n.x=r*(n.sx-n.gx)+n.gx,n.y=r*(n.sy-n.gy)+n.gy,1e-4>Math.abs(n.x)&&(n.x=0),1e-4>Math.abs(n.y)&&(n.y=0);return c.tick({type:"tick"}),0>v?!0:(v-=m,void 0)},a.add(t||[]),n.rebind(a,c,"on")}return t}t.exports=r},{}],"d3-grid-layout":[function(n,t){t.exports=n("DhjSHW")},{}]},{},[]);var d3=require("d3"),grid=require("d3-grid-layout")(d3),layout=grid().width(window.innerWidth-40).height(window.innerHeight-40).radius(80).align(0).ease("back",2),svg=d3.select("body").append("svg").style("margin","0 auto").style("display","block").attr("width",window.innerWidth).attr("height",window.innerHeight),group=svg.append("g").attr("transform","translate(20,20)"),nodes=group.selectAll(".node").data(layout.nodes());layout.on("tick",function(){nodes.attr("cx",function(n){return n.x}).attr("cy",function(n){return n.y})}),setInterval(function(){layout.push({scale:10*Math.pow(Math.random(),2)+3}),nodes=nodes.data(layout.nodes()),nodes.enter().append("circle").classed("node",!0).attr("r",0).style("fill","#a88").style("stroke","#544").style("stroke-width","2px").transition().duration(350).ease("elastic").attr("r",function(n){return n.scale})},250),window.onresize=function(){layout.width(window.innerWidth-40).height(window.innerHeight-40).update(),svg.attr("width",window.innerWidth),svg.attr("height",window.innerHeight)};
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"d3": "3.4.3",
"d3-grid-layout": "0.1.0"
}
}
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment