Commit fd5ee5de authored by Mike Bostock's avatar Mike Bostock
Browse files

Shorter names to match hierarchy.

parent a2a91438
......@@ -6939,57 +6939,6 @@ d3 = function() {
return arguments.length ? d3_transitionInheritId ? selection.transition() : selection : d3_selectionRoot.transition();
};
d3.transition.prototype = d3_transitionPrototype;
function d3_transitionNode(node, i, id, inherit) {
var lock = node.__transition__ || (node.__transition__ = {
active: 0,
count: 0
}), transition = lock[id];
if (!transition) {
var time = inherit.time;
transition = lock[id] = {
tween: new d3_Map(),
event: d3.dispatch("start", "end"),
time: time,
ease: inherit.ease,
delay: inherit.delay,
duration: inherit.duration
};
++lock.count;
d3.timer(function(elapsed) {
var d = node.__data__, ease = transition.ease, event = transition.event, delay = transition.delay, duration = transition.duration, tweened = [];
return delay <= elapsed ? start(elapsed) : d3.timer(start, delay, time), 1;
function start(elapsed) {
if (lock.active > id) return stop();
lock.active = id;
event.start.call(node, d, i);
transition.tween.forEach(function(key, value) {
if (value = value.call(node, d, i)) {
tweened.push(value);
}
});
if (!tick(elapsed)) d3.timer(tick, 0, time);
return 1;
}
function tick(elapsed) {
if (lock.active !== id) return stop();
var t = (elapsed - delay) / duration, e = ease(t), n = tweened.length;
while (n > 0) {
tweened[--n].call(node, e);
}
if (t >= 1) {
stop();
event.end.call(node, d, i);
return 1;
}
}
function stop() {
if (--lock.count) delete lock[id]; else delete node.__transition__;
return 1;
}
}, 0, time);
return transition;
}
}
d3_transitionPrototype.select = function(selector) {
var id = this.id, subgroups = [], subgroup, subnode, node;
if (typeof selector !== "function") selector = d3_selection_selector(selector);
......@@ -7204,6 +7153,57 @@ d3 = function() {
}
return d3_transition(subgroups, id1);
};
function d3_transitionNode(node, i, id, inherit) {
var lock = node.__transition__ || (node.__transition__ = {
active: 0,
count: 0
}), transition = lock[id];
if (!transition) {
var time = inherit.time;
transition = lock[id] = {
tween: new d3_Map(),
event: d3.dispatch("start", "end"),
time: time,
ease: inherit.ease,
delay: inherit.delay,
duration: inherit.duration
};
++lock.count;
d3.timer(function(elapsed) {
var d = node.__data__, ease = transition.ease, event = transition.event, delay = transition.delay, duration = transition.duration, tweened = [];
return delay <= elapsed ? start(elapsed) : d3.timer(start, delay, time), 1;
function start(elapsed) {
if (lock.active > id) return stop();
lock.active = id;
event.start.call(node, d, i);
transition.tween.forEach(function(key, value) {
if (value = value.call(node, d, i)) {
tweened.push(value);
}
});
if (!tick(elapsed)) d3.timer(tick, 0, time);
return 1;
}
function tick(elapsed) {
if (lock.active !== id) return stop();
var t = (elapsed - delay) / duration, e = ease(t), n = tweened.length;
while (n > 0) {
tweened[--n].call(node, e);
}
if (t >= 1) {
stop();
event.end.call(node, d, i);
return 1;
}
}
function stop() {
if (--lock.count) delete lock[id]; else delete node.__transition__;
return 1;
}
}, 0, time);
return transition;
}
}
d3.svg.axis = function() {
var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, tickMajorSize = 6, tickMinorSize = 6, tickEndSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_, tickSubdivide = 0;
function axis(g) {
......
d3=function(){function t(t){return null!=t&&!isNaN(t)}function n(t){return t.length}function e(t){for(var n=1;t*n%1;)n*=10;return n}function r(t,n){try{for(var e in n)Object.defineProperty(t.prototype,e,{value:n[e],enumerable:!1})}catch(r){t.prototype=n}}function i(){}function u(){}function a(t,n,e){return function(){var r=e.apply(n,arguments);return r===n?t:r}}function o(){}function c(t){function n(){for(var n,r=e,i=-1,u=r.length;u>++i;)(n=r[i].on)&&n.apply(this,arguments);return t}var e=[],r=new i;return n.on=function(n,i){var u,a=r.get(n);return 2>arguments.length?a&&a.on:(a&&(a.on=null,e=e.slice(0,u=e.indexOf(a)).concat(e.slice(u+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function l(){$u.event.stopPropagation(),$u.event.preventDefault()}function f(){for(var t,n=$u.event;t=n.sourceEvent;)n=t;return n}function s(t){for(var n=new o,e=0,r=arguments.length;r>++e;)n[arguments[e]]=c(n);return n.of=function(e,r){return function(i){try{var u=i.sourceEvent=$u.event;i.target=t,$u.event=i,n[i.type].apply(e,r)}finally{$u.event=u}}},n}function h(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>ra&&(Gu.scrollX||Gu.scrollY)){e=$u.select(Ju.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=e[0][0].getScreenCTM();ra=!(i.f||i.e),e.remove()}return ra?(r.x=n.pageX,r.y=n.pageY):(r.x=n.clientX,r.y=n.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var u=t.getBoundingClientRect();return[n.clientX-u.left-t.clientLeft,n.clientY-u.top-t.clientTop]}function g(t){for(var n=-1,e=t.length,r=[];e>++n;)r.push(t[n]);return r}function p(t){return Array.prototype.slice.call(t)}function d(t){return aa(t,ga),t}function m(t){return function(){return ca(t,this)}}function v(t){return function(){return la(t,this)}}function y(t,n){function e(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,n)}function u(){this.setAttributeNS(t.space,t.local,n)}function a(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}function o(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}return t=$u.ns.qualify(t),null==n?t.local?r:e:"function"==typeof n?t.local?o:a:t.local?u:i}function M(t){return t.trim().replace(/\s+/g," ")}function x(t){return RegExp("(?:^|\\s+)"+$u.requote(t)+"(?:\\s+|$)","g")}function _(t,n){function e(){for(var e=-1;i>++e;)t[e](this,n)}function r(){for(var e=-1,r=n.apply(this,arguments);i>++e;)t[e](this,r)}t=t.trim().split(/\s+/).map(w);var i=t.length;return"function"==typeof n?r:e}function w(t){var n=x(t);return function(e,r){if(i=e.classList)return r?i.add(t):i.remove(t);var i=e.className,u=null!=i.baseVal,a=u?i.baseVal:i;r?(n.lastIndex=0,n.test(a)||(a=M(a+" "+t),u?i.baseVal=a:e.className=a)):a&&(a=M(a.replace(n," ")),u?i.baseVal=a:e.className=a)}}function S(t,n,e){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,n,e)}function u(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}return null==n?r:"function"==typeof n?u:i}function E(t,n){function e(){delete this[t]}function r(){this[t]=n}function i(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}return null==n?e:"function"==typeof n?i:r}function k(t){return{__data__:t}}function A(t){return function(){return ha(this,t)}}function N(t){return arguments.length||(t=$u.ascending),function(n,e){return!n-!e||t(n.__data__,e.__data__)}}function q(t,n,e){function r(){var n=this[a];n&&(this.removeEventListener(t,n,n.$),delete this[a])}function i(){var i=c(n,ia(arguments));r.call(this),this.addEventListener(t,this[a]=i,i.$=e),i._=n}function u(){var n,e=RegExp("^__on([^.]+)"+$u.requote(t)+"$");for(var r in this)if(n=r.match(e)){var i=this[r];this.removeEventListener(n[1],i,i.$),delete this[r]}}var a="__on"+t,o=t.indexOf("."),c=T;o>0&&(t=t.substring(0,o));var l=da.get(t);return l&&(t=l,c=C),o?n?i:r:n?vn:u}function T(t,n){return function(e){var r=$u.event;$u.event=e,n[0]=this.__data__;try{t.apply(this,n)}finally{$u.event=r}}}function C(t,n){var e=T(t,n);return function(t){var n=this,r=t.relatedTarget;r&&(r===n||8&r.compareDocumentPosition(n))||e.call(n,t)}}function z(t,n){for(var e=0,r=t.length;r>e;e++)for(var i,u=t[e],a=0,o=u.length;o>a;a++)(i=u[a])&&n(i,a,e);return t}function D(t){return aa(t,ma),t}function j(){}function L(t,n,e){return new F(t,n,e)}function F(t,n,e){this.h=t,this.s=n,this.l=e}function H(t,n,e){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?u+(a-u)*t/60:180>t?a:240>t?u+(a-u)*(240-t)/60:u}function i(t){return Math.round(255*r(t))}var u,a;return t%=360,0>t&&(t+=360),n=0>n?0:n>1?1:n,e=0>e?0:e>1?1:e,a=.5>=e?e*(1+n):e+n-e*n,u=2*e-a,tn(i(t+120),i(t),i(t-120))}function R(t){return t>0?1:0>t?-1:0}function P(t){return Math.acos(Math.max(-1,Math.min(1,t)))}function O(t){return t>1?_a/2:-1>t?-_a/2:Math.asin(t)}function Y(t){return(Math.exp(t)-Math.exp(-t))/2}function U(t){return(Math.exp(t)+Math.exp(-t))/2}function I(t){return(t=Math.sin(t/2))*t}function V(t,n,e){return new X(t,n,e)}function X(t,n,e){this.h=t,this.c=n,this.l=e}function Z(t,n,e){return B(e,Math.cos(t*=Sa)*n,Math.sin(t)*n)}function B(t,n,e){return new $(t,n,e)}function $(t,n,e){this.l=t,this.a=n,this.b=e}function J(t,n,e){var r=(t+16)/116,i=r+n/500,u=r-e/200;return i=K(i)*Na,r=K(r)*qa,u=K(u)*Ta,tn(Q(3.2404542*i-1.5371385*r-.4985314*u),Q(-.969266*i+1.8760108*r+.041556*u),Q(.0556434*i-.2040259*r+1.0572252*u))}function G(t,n,e){return V(Math.atan2(e,n)*Ea,Math.sqrt(n*n+e*e),t)}function K(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function W(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Q(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function tn(t,n,e){return new nn(t,n,e)}function nn(t,n,e){this.r=t,this.g=n,this.b=e}function en(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function rn(t,n,e){var r,i,u,a=0,o=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return n(cn(i[0]),cn(i[1]),cn(i[2]))}return(u=Da.get(t))?n(u.r,u.g,u.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(a=t.charAt(1),a+=a,o=t.charAt(2),o+=o,c=t.charAt(3),c+=c):7===t.length&&(a=t.substring(1,3),o=t.substring(3,5),c=t.substring(5,7)),a=parseInt(a,16),o=parseInt(o,16),c=parseInt(c,16)),n(a,o,c))}function un(t,n,e){var r,i,u=Math.min(t/=255,n/=255,e/=255),a=Math.max(t,n,e),o=a-u,c=(a+u)/2;return o?(i=.5>c?o/(a+u):o/(2-a-u),r=t==a?(n-e)/o+(e>n?6:0):n==a?(e-t)/o+2:(t-n)/o+4,r*=60):i=r=0,L(r,i,c)}function an(t,n,e){t=on(t),n=on(n),e=on(e);var r=W((.4124564*t+.3575761*n+.1804375*e)/Na),i=W((.2126729*t+.7151522*n+.072175*e)/qa),u=W((.0193339*t+.119192*n+.9503041*e)/Ta);return B(116*i-16,500*(r-i),200*(i-u))}function on(t){return.04045>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cn(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}function ln(t){return"function"==typeof t?t:function(){return t}}function fn(t,n){function e(t,e,u){3>arguments.length&&(u=e,e=null);var a=$u.xhr(t,n,u);return a.row=function(t){return arguments.length?a.response(null==(e=t)?r:i(t)):e},a.row(e)}function r(t){return e.parse(t.responseText)}function i(t){return function(n){return e.parse(n.responseText,t)}}function a(n){return n.map(o).join(t)}function o(t){return c.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var c=RegExp('["'+t+"\n]"),l=t.charCodeAt(0);return e.parse=function(t,n){var r;return e.parseRows(t,function(t,e){if(r)return r(t,e-1);var i=Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}");r=n?function(t,e){return n(i(t),e)}:i})},e.parseRows=function(t,n){function e(){if(f>=c)return a;if(i)return i=!1,u;var n=f;if(34===t.charCodeAt(n)){for(var e=n;c>e++;)if(34===t.charCodeAt(e)){if(34!==t.charCodeAt(e+1))break;++e}f=e+2;var r=t.charCodeAt(e+1);return 13===r?(i=!0,10===t.charCodeAt(e+2)&&++f):10===r&&(i=!0),t.substring(n+1,e).replace(/""/g,'"')}for(;c>f;){var r=t.charCodeAt(f++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(f)&&(++f,++o);else if(r!==l)continue;return t.substring(n,f-o)}return t.substring(n)}for(var r,i,u={},a={},o=[],c=t.length,f=0,s=0;(r=e())!==a;){for(var h=[];r!==u&&r!==a;)h.push(r),r=e();(!n||(h=n(h,s++)))&&o.push(h)}return o},e.format=function(n){if(Array.isArray(n[0]))return e.formatRows(n);var r=new u,i=[];return n.forEach(function(t){for(var n in t)r.has(n)||i.push(r.add(n))}),[i.map(o).join(t)].concat(n.map(function(n){return i.map(function(t){return o(n[t])}).join(t)})).join("\n")},e.formatRows=function(t){return t.map(a).join("\n")},e}function sn(){for(var t,n=Date.now(),e=Ra;e;)t=n-e.then,t>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=hn()-n;r>24?(isFinite(r)&&(clearTimeout(La),La=setTimeout(sn,r)),ja=0):(ja=1,Pa(sn))}function hn(){for(var t=null,n=Ra,e=1/0;n;)n.flush?(delete Ha[n.callback.id],n=t?t.next=n.next:Ra=n.next):(e=Math.min(e,n.then+n.delay),n=(t=n).next);return e}function gn(t){return t}function pn(t,n){var e=Math.pow(10,3*Math.abs(8-n));return{scale:n>8?function(t){return t/e}:function(t){return t*e},symbol:t}}function dn(t,n){return n-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function mn(t){return t+""}function vn(){}function yn(t,n){Ja.hasOwnProperty(t.type)&&Ja[t.type](t,n)}function Mn(t,n,e){var r,i=-1,u=t.length-e;for(n.lineStart();u>++i;)r=t[i],n.point(r[0],r[1]);n.lineEnd()}function bn(t,n){var e=-1,r=t.length;for(n.polygonStart();r>++e;)Mn(t[e],n,1);n.polygonEnd()}function xn(){function t(t,n){t*=Sa,n=n*Sa/2+_a/4;var e=t-r,a=Math.cos(n),o=Math.sin(n),c=u*o,l=Ka,f=Wa,s=i*a+c*Math.cos(e),h=c*Math.sin(e);Ka=l*s-f*h,Wa=f*s+l*h,r=t,i=a,u=o}var n,e,r,i,u;Qa.point=function(a,o){Qa.point=t,r=(n=a)*Sa,i=Math.cos(o=(e=o)*Sa/2+_a/4),u=Math.sin(o)},Qa.lineEnd=function(){t(n,e)}}function _n(t){function n(t,n){r>t&&(r=t),t>u&&(u=t),i>n&&(i=n),n>a&&(a=n)}function e(){o.point=o.lineEnd=vn}var r,i,u,a,o={point:n,lineStart:vn,lineEnd:vn,polygonStart:function(){o.lineEnd=e},polygonEnd:function(){o.point=n}};return function(n){return a=u=-(r=i=1/0),$u.geo.stream(n,t(o)),[[r,i],[u,a]]}}function wn(t,n){if(!to){++no,t*=Sa;var e=Math.cos(n*=Sa);eo+=(e*Math.cos(t)-eo)/no,ro+=(e*Math.sin(t)-ro)/no,io+=(Math.sin(n)-io)/no}}function Sn(){var t,n;to=1,En(),to=2;var e=uo.point;uo.point=function(r,i){e(t=r,n=i)},uo.lineEnd=function(){uo.point(t,n),kn(),uo.lineEnd=kn}}function En(){function t(t,i){t*=Sa;var u=Math.cos(i*=Sa),a=u*Math.cos(t),o=u*Math.sin(t),c=Math.sin(i),l=Math.atan2(Math.sqrt((l=e*c-r*o)*l+(l=r*a-n*c)*l+(l=n*o-e*a)*l),n*a+e*o+r*c);no+=l,eo+=l*(n+(n=a)),ro+=l*(e+(e=o)),io+=l*(r+(r=c))}var n,e,r;to>1||(1>to&&(to=1,no=eo=ro=io=0),uo.point=function(i,u){i*=Sa;var a=Math.cos(u*=Sa);n=a*Math.cos(i),e=a*Math.sin(i),r=Math.sin(u),uo.point=t})}function kn(){uo.point=wn}function An(t){var n=t[0],e=t[1],r=Math.cos(e);return[r*Math.cos(n),r*Math.sin(n),Math.sin(e)]}function Nn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function qn(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Tn(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Cn(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function zn(t){var n=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function Dn(t,n,e){return t?n||e?oe(Ln(t),Fn(n,e)):Ln(t):n||e?Fn(n,e):Ae}function jn(t){return function(n,e){return n+=t,[n>_a?n-2*_a:-_a>n?n+2*_a:n,e]}}function Ln(t){var n=jn(t);return n.invert=jn(-t),n}function Fn(t,n){function e(t,n){var e=Math.cos(n),o=Math.cos(t)*e,c=Math.sin(t)*e,l=Math.sin(n),f=l*r+o*i;return[Math.atan2(c*u-f*a,o*r-l*i),Math.asin(Math.max(-1,Math.min(1,f*u+c*a)))]}var r=Math.cos(t),i=Math.sin(t),u=Math.cos(n),a=Math.sin(n);return e.invert=function(t,n){var e=Math.cos(n),o=Math.cos(t)*e,c=Math.sin(t)*e,l=Math.sin(n),f=l*u-c*a;return[Math.atan2(c*u+l*a,o*r+f*i),Math.asin(Math.max(-1,Math.min(1,f*r-o*i)))]},e}function Hn(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Rn(t,n){return wa>Math.abs(t[0]-n[0])&&wa>Math.abs(t[1]-n[1])}function Pn(t,n){var e=Math.cos(t),r=Math.sin(t);return function(i,u,a,o){null!=i?(i=On(e,i),u=On(e,u),(a>0?u>i:i>u)&&(i+=2*a*_a)):(i=t+2*a*_a,u=t);for(var c,l=a*n,f=i;a>0?f>u:u>f;f-=l)o.point((c=Hn([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function On(t,n){var e=An(n);e[0]-=t,zn(e);var r=P(-e[1]);return((0>-e[2]?-r:r)+2*Math.PI-wa)%(2*Math.PI)}function Yn(t,n,e){var r=$u.range(t,n-wa,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function Un(t,n,e){var r=$u.range(t,n-wa,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function In(t){return t.source}function Vn(t){return t.target}function Xn(t,n,e,r){var i=Math.cos(n),u=Math.sin(n),a=Math.cos(r),o=Math.sin(r),c=i*Math.cos(t),l=i*Math.sin(t),f=a*Math.cos(e),s=a*Math.sin(e),h=2*Math.asin(Math.sqrt(I(r-n)+i*a*I(e-t))),g=1/Math.sin(h),p=h?function(t){var n=Math.sin(t*=h)*g,e=Math.sin(h-t)*g,r=e*c+n*f,i=e*l+n*s,a=e*u+n*o;return[Math.atan2(i,r)*Ea,Math.atan2(a,Math.sqrt(r*r+i*i))*Ea]}:function(){return[t*Ea,n*Ea]};return p.distance=h,p}function Zn(){function t(t,i){var u=Math.sin(i*=Sa),a=Math.cos(i),o=Math.abs((t*=Sa)-n),c=Math.cos(o);ao+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*u-e*a*c)*o),e*u+r*a*c),n=t,e=u,r=a}var n,e,r;oo.point=function(i,u){n=i*Sa,e=Math.sin(u*=Sa),r=Math.cos(u),oo.point=t},oo.lineEnd=function(){oo.point=oo.lineEnd=vn}}function Bn(){return!0}function $n(t,n,e,r,i){var u=[],a=[];if(t.forEach(function(t){if(!(1>=(n=t.length))){var n,e=t[0],r=t[n-1];if(Rn(e,r)){i.lineStart();for(var o=0;n>o;++o)i.point((e=t[o])[0],e[1]);return i.lineEnd(),void 0}var c={point:e,points:t,other:null,visited:!1,entry:!0,subject:!0},l={point:e,points:[e],other:c,visited:!1,entry:!1,subject:!1};c.other=l,u.push(c),a.push(l),c={point:r,points:[r],other:null,visited:!1,entry:!1,subject:!0},l={point:r,points:[r],other:c,visited:!1,entry:!0,subject:!1},c.other=l,u.push(c),a.push(l)}}),a.sort(n),Jn(u),Jn(a),u.length){if(e)for(var o=1,c=!e(a[0].point),l=a.length;l>o;++o)a[o].entry=c=!c;for(var f,s,h,g=u[0];;){for(f=g;f.visited;)if((f=f.next)===g)return;s=f.points,i.lineStart();do{if(f.visited=f.other.visited=!0,f.entry){if(f.subject)for(var o=0;s.length>o;o++)i.point((h=s[o])[0],h[1]);else r(f.point,f.next.point,1,i);f=f.next}else{if(f.subject){s=f.prev.points;for(var o=s.length;--o>=0;)i.point((h=s[o])[0],h[1])}else r(f.point,f.prev.point,-1,i);f=f.prev}f=f.other,s=f.points}while(!f.visited);i.lineEnd()}}}function Jn(t){if(n=t.length){for(var n,e,r=0,i=t[0];n>++r;)i.next=e=t[r],e.prev=i,i=e;i.next=e=t[0],e.prev=i}}function Gn(t,n,e){return function(r){function i(n,e){t(n,e)&&r.point(n,e)}function u(t,n){m.point(t,n)}function a(){v.point=u,m.lineStart()}function o(){v.point=i,m.lineEnd()}function c(t,n){M.point(t,n),d.push([t,n])}function l(){M.lineStart(),d=[]}function f(){c(d[0][0],d[0][1]),M.lineEnd();var t,n=M.clean(),e=y.buffer(),i=e.length;if(!i)return p=!0,g+=Qn(d,-1),d=null,void 0;if(d=null,1&n){t=e[0],h+=Qn(t,1);var u,i=t.length-1,a=-1;for(r.lineStart();i>++a;)r.point((u=t[a])[0],u[1]);return r.lineEnd(),void 0}i>1&&2&n&&e.push(e.pop().concat(e.shift())),s.push(e.filter(Kn))}var s,h,g,p,d,m=n(r),v={point:i,lineStart:a,lineEnd:o,polygonStart:function(){v.point=c,v.lineStart=l,v.lineEnd=f,p=!1,g=h=0,s=[],r.polygonStart()},polygonEnd:function(){v.point=i,v.lineStart=a,v.lineEnd=o,s=$u.merge(s),s.length?$n(s,te,null,e,r):(-wa>h||p&&-wa>g)&&(r.lineStart(),e(null,null,1,r),r.lineEnd()),r.polygonEnd(),s=null},sphere:function(){r.polygonStart(),r.lineStart(),e(null,null,1,r),r.lineEnd(),r.polygonEnd()}},y=Wn(),M=n(y);return v}}function Kn(t){return t.length>1}function Wn(){var t,n=[];return{lineStart:function(){n.push(t=[])},point:function(n,e){t.push([n,e])},lineEnd:vn,buffer:function(){var e=n;return n=[],t=null,e},rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))}}}function Qn(t,n){if(!(e=t.length))return 0;for(var e,r,i,u=0,a=0,o=t[0],c=o[0],l=o[1],f=Math.cos(l),s=Math.atan2(n*Math.sin(c)*f,Math.sin(l)),h=1-n*Math.cos(c)*f,g=s;e>++u;)o=t[u],f=Math.cos(l=o[1]),r=Math.atan2(n*Math.sin(c=o[0])*f,Math.sin(l)),i=1-n*Math.cos(c)*f,wa>Math.abs(h-2)&&wa>Math.abs(i-2)||(wa>Math.abs(i)||wa>Math.abs(h)||(wa>Math.abs(Math.abs(r-s)-_a)?i+h>2&&(a+=4*(r-s)):a+=wa>Math.abs(h-2)?4*(r-g):((3*_a+r-s)%(2*_a)-_a)*(h+i)),g=s,s=r,h=i);return a}function te(t,n){return(0>(t=t.point)[0]?t[1]-_a/2-wa:_a/2-t[1])-(0>(n=n.point)[0]?n[1]-_a/2-wa:_a/2-n[1])}function ne(t){var n,e=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),n=1},point:function(u,a){var o=u>0?_a:-_a,c=Math.abs(u-e);wa>Math.abs(c-_a)?(t.point(e,r=(r+a)/2>0?_a/2:-_a/2),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(u,r),n=0):i!==o&&c>=_a&&(wa>Math.abs(e-i)&&(e-=i*wa),wa>Math.abs(u-o)&&(u-=o*wa),r=ee(e,r,u,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),n=0),t.point(e=u,r=a),i=o},lineEnd:function(){t.lineEnd(),e=r=0/0},clean:function(){return 2-n}}}function ee(t,n,e,r){var i,u,a=Math.sin(t-e);return Math.abs(a)>wa?Math.atan((Math.sin(n)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(n))*Math.sin(t))/(i*u*a)):(n+r)/2}function re(t,n,e,r){var i;if(null==t)i=e*_a/2,r.point(-_a,i),r.point(0,i),r.point(_a,i),r.point(_a,0),r.point(_a,-i),r.point(0,-i),r.point(-_a,-i),r.point(-_a,0),r.point(-_a,i);else if(Math.abs(t[0]-n[0])>wa){var u=(t[0]<n[0]?1:-1)*_a;i=e*u/2,r.point(-u,i),r.point(0,i),r.point(u,i)}else r.point(n[0],n[1])}function ie(t){function n(t,n){return Math.cos(t)*Math.cos(n)>u}function e(t){var e,u,c,l,f;return{lineStart:function(){l=c=!1,f=1},point:function(s,h){var g,p=[s,h],d=n(s,h),m=a?d?0:i(s,h):d?i(s+(0>s?_a:-_a),h):0;if(!e&&(l=c=d)&&t.lineStart(),d!==c&&(g=r(e,p),(Rn(e,g)||Rn(p,g))&&(p[0]+=wa,p[1]+=wa,d=n(p[0],p[1]))),d!==c)f=0,d?(t.lineStart(),g=r(p,e),t.point(g[0],g[1])):(g=r(e,p),t.point(g[0],g[1]),t.lineEnd()),e=g;else if(o&&e&&a^d){var v;m&u||!(v=r(p,e,!0))||(f=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!d||e&&Rn(e,p)||t.point(p[0],p[1]),e=p,c=d,u=m},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return f|(l&&c)<<1}}}function r(t,n,e){var r=An(t),i=An(n),a=[1,0,0],o=qn(r,i),c=Nn(o,o),l=o[0],f=c-l*l;if(!f)return!e&&t;var s=u*c/f,h=-u*l/f,g=qn(a,o),p=Cn(a,s),d=Cn(o,h);Tn(p,d);var m=g,v=Nn(p,m),y=Nn(m,m),M=v*v-y*(Nn(p,p)-1);if(!(0>M)){var b=Math.sqrt(M),x=Cn(m,(-v-b)/y);if(Tn(x,p),x=Hn(x),!e)return x;var _,w=t[0],S=n[0],E=t[1],k=n[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=wa>Math.abs(A-_a),q=N||wa>A;if(!N&&E>k&&(_=E,E=k,k=_),q?N?E+k>0^x[1]<(wa>Math.abs(x[0]-w)?E:k):x[1]>=E&&k>=x[1]:A>_a^(x[0]>=w&&S>=x[0])){var T=Cn(m,(-v+b)/y);return Tn(T,p),[x,Hn(T)]}}}function i(n,e){var r=a?t:_a-t,i=0;return-r>n?i|=1:n>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(t),a=u>0,o=Math.abs(u)>wa,c=Pn(t,6*Sa);return Gn(n,e,c)}function ue(t,n,e,r){function i(r,i){return wa>Math.abs(r[0]-t)?i>0?0:3:wa>Math.abs(r[0]-e)?i>0?2:1:wa>Math.abs(r[1]-n)?i>0?1:0:i>0?3:2}function u(t,n){return a(t.point,n.point)}function a(t,n){var e=i(t,1),r=i(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}function o(i,u){var a=u[0]-i[0],o=u[1]-i[1],c=[0,1];return wa>Math.abs(a)&&wa>Math.abs(o)?i[0]>=t&&e>=i[0]&&i[1]>=n&&r>=i[1]:ae(t-i[0],a,c)&&ae(i[0]-e,-a,c)&&ae(n-i[1],o,c)&&ae(i[1]-r,-o,c)?(1>c[1]&&(u[0]=i[0]+c[1]*a,u[1]=i[1]+c[1]*o),c[0]>0&&(i[0]+=c[0]*a,i[1]+=c[0]*o),!0):!1}return function(c){function l(u){var a=i(u,-1),o=f([0===a||3===a?t:e,a>1?r:n]);return o}function f(t){for(var n=0,e=M.length,r=t[1],i=0;e>i;++i)for(var u=1,a=M[i],o=a.length,c=a[0];o>u;++u)b=a[u],r>=c[1]?b[1]>r&&s(c,b,t)>0&&++n:r>=b[1]&&0>s(c,b,t)&&--n,c=b;return 0!==n}function s(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(n[1]-t[1])}function h(u,o,c,l){var f=0,s=0;if(null==u||(f=i(u,c))!==(s=i(o,c))||0>a(u,o)^c>0){do l.point(0===f||3===f?t:e,f>1?r:n);while((f=(f+c+4)%4)!==s)}else l.point(o[0],o[1])}function g(i,u){return i>=t&&e>=i&&u>=n&&r>=u}function p(t,n){g(t,n)&&c.point(t,n)}function d(){C.point=v,M&&M.push(x=[]),N=!0,A=!1,E=k=0/0}function m(){y&&(v(_,w),S&&A&&T.rejoin(),y.push(T.buffer())),C.point=p,A&&c.lineEnd()}function v(t,n){var e=g(t,n);if(M&&x.push([t,n]),N)_=t,w=n,S=e,N=!1,e&&(c.lineStart(),c.point(t,n));else if(e&&A)c.point(t,n);else{var r=[E,k],i=[t,n];o(r,i)&&(A||(c.lineStart(),c.point(r[0],r[1])),c.point(i[0],i[1]),e||c.lineEnd())}E=t,k=n,A=e}var y,M,x,_,w,S,E,k,A,N,q=c,T=Wn(),C={point:p,lineStart:d,lineEnd:m,polygonStart:function(){c=T,y=[],M=[]},polygonEnd:function(){c=q,(y=$u.merge(y)).length?(c.polygonStart(),$n(y,u,l,h,c),c.polygonEnd()):f([t,n])&&(c.polygonStart(),c.lineStart(),h(null,null,1,c),c.lineEnd(),c.polygonEnd()),y=M=x=null}};return C}}function ae(t,n,e){if(wa>Math.abs(n))return 0>t;var r=t/n;if(n>0){if(r>e[1])return!1;r>e[0]&&(e[0]=r)}else{if(e[0]>r)return!1;e[1]>r&&(e[1]=r)}return!0}function oe(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return e=n.invert(e,r),e&&t.invert(e[0],e[1])}),e}function ce(t){function n(n){function r(e,r){e=t(e,r),n.point(e[0],e[1])}function u(){f=0/0,d.point=a,n.lineStart()}function a(r,u){var a=An([r,u]),o=t(r,u);e(f,s,l,h,g,p,f=o[0],s=o[1],l=r,h=a[0],g=a[1],p=a[2],i,n),n.point(f,s)}function o(){d.point=r,n.lineEnd()}function c(){var t,r,c,m,v,y,M;u(),d.point=function(n,e){a(t=n,r=e),c=f,m=s,v=h,y=g,M=p,d.point=a},d.lineEnd=function(){e(f,s,l,h,g,p,c,m,t,v,y,M,i,n),d.lineEnd=o,o()}}var l,f,s,h,g,p,d={point:r,lineStart:u,lineEnd:o,polygonStart:function(){n.polygonStart(),d.lineStart=c},polygonEnd:function(){n.polygonEnd(),d.lineStart=u}};return d}function e(n,i,u,a,o,c,l,f,s,h,g,p,d,m){var v=l-n,y=f-i,M=v*v+y*y;if(M>4*r&&d--){var b=a+h,x=o+g,_=c+p,w=Math.sqrt(b*b+x*x+_*_),S=Math.asin(_/=w),E=wa>Math.abs(Math.abs(_)-1)?(u+s)/2:Math.atan2(x,b),k=t(E,S),A=k[0],N=k[1],q=A-n,T=N-i,C=y*q-v*T;(C*C/M>r||Math.abs((v*q+y*T)/M-.5)>.3)&&(e(n,i,u,a,o,c,A,N,E,b/=w,x/=w,_,d,m),m.point(A,N),e(A,N,E,b,x,_,l,f,s,h,g,p,d,m))}}var r=.5,i=16;return n.precision=function(t){return arguments.length?(i=(r=t*t)>0&&16,n):Math.sqrt(r)},n}function le(t){return fe(function(){return t})()}function fe(t){function n(t){return t=a(t[0]*Sa,t[1]*Sa),[t[0]*f+o,c-t[1]*f]}function e(t){return t=a.invert((t[0]-o)/f,(c-t[1])/f),t&&[t[0]*Ea,t[1]*Ea]}function r(){a=oe(u=Dn(d,m,v),i);var t=i(g,p);return o=s-t[0]*f,c=h+t[1]*f,n}var i,u,a,o,c,l=ce(function(t,n){return t=i(t,n),[t[0]*f+o,c-t[1]*f]}),f=150,s=480,h=250,g=0,p=0,d=0,m=0,v=0,y=co,M=gn,b=null,x=null;return n.stream=function(t){return se(u,y(l(M(t))))},n.clipAngle=function(t){return arguments.length?(y=null==t?(b=t,co):ie((b=+t)*Sa),n):b},n.clipExtent=function(t){return arguments.length?(x=t,M=null==t?gn:ue(t[0][0],t[0][1],t[1][0],t[1][1]),n):x},n.scale=function(t){return arguments.length?(f=+t,r()):f},n.translate=function(t){return arguments.length?(s=+t[0],h=+t[1],r()):[s,h]},n.center=function(t){return arguments.length?(g=t[0]%360*Sa,p=t[1]%360*Sa,r()):[g*Ea,p*Ea]},n.rotate=function(t){return arguments.length?(d=t[0]%360*Sa,m=t[1]%360*Sa,v=t.length>2?t[2]%360*Sa:0,r()):[d*Ea,m*Ea,v*Ea]},$u.rebind(n,l,"precision"),function(){return i=t.apply(this,arguments),n.invert=i.invert&&e,r()}}function se(t,n){return{point:function(e,r){r=t(e*Sa,r*Sa),e=r[0],n.point(e>_a?e-2*_a:-_a>e?e+2*_a:e,r[1])},sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function he(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ge(t){var n=ce(function(n,e){return t([n*Ea,e*Ea])});return function(t){return t=n(t),{point:function(n,e){t.point(n*Sa,e*Sa)},sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}}function pe(){function t(t,n){fo+=i*t-r*n,r=t,i=n}var n,e,r,i;so.point=function(u,a){so.point=t,n=r=u,e=i=a},so.lineEnd=function(){t(n,e)}}function de(){function t(t,n){a.push("M",t,",",n,u)}function n(t,n){a.push("M",t,",",n),o.point=e}function e(t,n){a.push("L",t,",",n)}function r(){o.point=t}function i(){a.push("Z")}var u=he(4.5),a=[],o={point:t,lineStart:function(){o.point=n},lineEnd:r,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=r,o.point=t},pointRadius:function(t){return u=he(t),o},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return o}function me(t,n){to||(eo+=t,ro+=n,++io)}function ve(){function t(t,r){var i=t-n,u=r-e,a=Math.sqrt(i*i+u*u);eo+=a*(n+t)/2,ro+=a*(e+r)/2,io+=a,n=t,e=r}var n,e;if(1!==to){if(!(1>to))return;to=1,eo=ro=io=0}ho.point=function(r,i){ho.point=t,n=r,e=i}}function ye(){ho.point=me}function Me(){function t(t,n){var e=i*t-r*n;eo+=e*(r+t),ro+=e*(i+n),io+=3*e,r=t,i=n}var n,e,r,i;2>to&&(to=2,eo=ro=io=0),ho.point=function(u,a){ho.point=t,n=r=u,e=i=a},ho.lineEnd=function(){t(n,e)}}function be(t){function n(n,e){t.moveTo(n,e),t.arc(n,e,a,0,2*_a)}function e(n,e){t.moveTo(n,e),o.point=r}function r(n,e){t.lineTo(n,e)}function i(){o.point=n}function u(){t.closePath()}var a=4.5,o={point:n,lineStart:function(){o.point=e},lineEnd:i,polygonStart:function(){o.lineEnd=u},polygonEnd:function(){o.lineEnd=i,o.point=n},pointRadius:function(t){return a=t,o},result:vn};return o}function xe(t){var n=0,e=_a/3,r=fe(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*_a/180,e=t[1]*_a/180):[180*(n/_a),180*(e/_a)]},i}function _e(t,n){function e(t,n){var e=Math.sqrt(u-2*i*Math.sin(n))/i;return[e*Math.sin(t*=i),a-e*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(n))/2,u=1+r*(2*i-r),a=Math.sqrt(u)/i;return e.invert=function(t,n){var e=a-n;return[Math.atan2(t,e)/i,Math.asin((u-(t*t+e*e)*i*i)/(2*i))]},e}function we(t,n){var e=t(n[0]),r=t([.5*(n[0][0]+n[1][0]),n[0][1]]),i=t([n[1][0],n[0][1]]),u=t(n[1]),a=r[1]-e[1],o=r[0]-e[0],c=i[1]-r[1],l=i[0]-r[0],f=a/o,s=c/l,h=.5*(f*s*(e[1]-i[1])+s*(e[0]+r[0])-f*(r[0]+i[0]))/(s-f),g=(.5*(e[0]+r[0])-h)/f+.5*(e[1]+r[1]),p=u[0]-h,d=u[1]-g,m=e[0]-h,v=e[1]-g,y=p*p+d*d,M=m*m+v*v,b=Math.atan2(d,p),x=Math.atan2(v,m);return function(n){var e=n[0]-h,r=n[1]-g,i=e*e+r*r,u=Math.atan2(r,e);return i>y&&M>i&&u>b&&x>u?t.invert(n):void 0}}function Se(t,n){function e(n,e){var r=Math.cos(n),i=Math.cos(e),u=t(r*i);return[u*i*Math.sin(n),u*Math.sin(e)]}return e.invert=function(t,e){var r=Math.sqrt(t*t+e*e),i=n(r),u=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*u,r*a),Math.asin(r&&e*u/r)]},e}function Ee(t,n){function e(t,n){var e=wa>Math.abs(Math.abs(n)-_a/2)?0:a/Math.pow(i(n),u);return[e*Math.sin(u*t),a-e*Math.cos(u*t)]}var r=Math.cos(t),i=function(t){return Math.tan(_a/4+t/2)},u=t===n?Math.sin(t):Math.log(r/Math.cos(n))/Math.log(i(n)/i(t)),a=r*Math.pow(i(t),u)/u;return u?(e.invert=function(t,n){var e=a-n,r=R(u)*Math.sqrt(t*t+e*e);return[Math.atan2(t,e)/u,2*Math.atan(Math.pow(a/r,1/u))-_a/2]},e):Ne}function ke(t,n){function e(t,n){var e=u-n;return[e*Math.sin(i*t),u-e*Math.cos(i*t)]}var r=Math.cos(t),i=t===n?Math.sin(t):(r-Math.cos(n))/(n-t),u=r/i+t;return wa>Math.abs(i)?Ae:(e.invert=function(t,n){var e=u-n;return[Math.atan2(t,e)/i,u-R(i)*Math.sqrt(t*t+e*e)]},e)}function Ae(t,n){return[t,n]}function Ne(t,n){return[t,Math.log(Math.tan(_a/4+n/2))]}function qe(t,n){var e=Math.cos(n)*Math.sin(t);return[Math.log((1+e)/(1-e))/2,Math.atan2(Math.tan(n),Math.cos(t))]}function Te(t,n,e,r){var i,u,a,o,c,l,f;return i=r[t],u=i[0],a=i[1],i=r[n],o=i[0],c=i[1],i=r[e],l=i[0],f=i[1],(f-a)*(o-u)-(c-a)*(l-u)>0}function Ce(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function ze(t,n,e,r){var i=t[0],u=e[0],a=n[0]-i,o=r[0]-u,c=t[1],l=e[1],f=n[1]-c,s=r[1]-l,h=(o*(c-l)-s*(i-u))/(s*a-o*f);return[i+h*a,c+h*f]}function De(t,n){var e={list:t.map(function(t,n){return{index:n,x:t[0],y:t[1]}}).sort(function(t,n){return t.y<n.y?-1:t.y>n.y?1:t.x<n.x?-1:t.x>n.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(t,n){return{edge:t,side:n,vertex:null,l:null,r:null}},insert:function(t,n){n.l=t,n.r=t.r,t.r.l=n,t.r=n},leftBound:function(t){var n=r.leftEnd;do n=n.r;while(n!=r.rightEnd&&i.rightOf(n,t));return n=n.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?e.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?e.bottomSite:t.edge.region[Mo[t.side]]}},i={bisect:function(t,n){var e={region:{l:t,r:n},ep:{l:null,r:null}},r=n.x-t.x,i=n.y-t.y,u=r>0?r:-r,a=i>0?i:-i;return e.c=t.x*r+t.y*i+.5*(r*r+i*i),u>a?(e.a=1,e.b=i/r,e.c/=r):(e.b=1,e.a=r/i,e.c/=i),e},intersect:function(t,n){var e=t.edge,r=n.edge;if(!e||!r||e.region.r==r.region.r)return null;var i=e.a*r.b-e.b*r.a;if(1e-10>Math.abs(i))return null;var u,a,o=(e.c*r.b-r.c*e.b)/i,c=(r.c*e.a-e.c*r.a)/i,l=e.region.r,f=r.region.r;l.y<f.y||l.y==f.y&&l.x<f.x?(u=t,a=e):(u=n,a=r);var s=o>=a.region.r.x;return s&&"l"===u.side||!s&&"r"===u.side?null:{x:o,y:c}},rightOf:function(t,n){var e=t.edge,r=e.region.r,i=n.x>r.x;if(i&&"l"===t.side)return 1;if(!i&&"r"===t.side)return 0;if(1===e.a){var u=n.y-r.y,a=n.x-r.x,o=0,c=0;if(!i&&0>e.b||i&&e.b>=0?c=o=u>=e.b*a:(c=n.x+n.y*e.b>e.c,0>e.b&&(c=!c),c||(o=1)),!o){var l=r.x-e.region.l.x;c=e.b*(a*a-u*u)<l*u*(1+2*a/l+e.b*e.b),0>e.b&&(c=!c)}}else{var f=e.c-e.a*n.x,s=n.y-f,h=n.x-r.x,g=f-r.y;c=s*s>h*h+g*g}return"l"===t.side?c:!c},endPoint:function(t,e,r){t.ep[e]=r,t.ep[Mo[e]]&&n(t)},distance:function(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}},u={list:[],insert:function(t,n,e){t.vertex=n,t.ystar=n.y+e;for(var r=0,i=u.list,a=i.length;a>r;r++){var o=i[r];if(!(t.ystar>o.ystar||t.ystar==o.ystar&&n.x>o.vertex.x))break}i.splice(r,0,t)},del:function(t){for(var n=0,e=u.list,r=e.length;r>n&&e[n]!=t;++n);e.splice(n,1)},empty:function(){return 0===u.list.length},nextEvent:function(t){for(var n=0,e=u.list,r=e.length;r>n;++n)if(e[n]==t)return e[n+1];return null},min:function(){var t=u.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return u.list.shift()}};r.init(),e.bottomSite=e.list.shift();for(var a,o,c,l,f,s,h,g,p,d,m,v,y,M=e.list.shift();;)if(u.empty()||(a=u.min()),M&&(u.empty()||M.y<a.y||M.y==a.y&&M.x<a.x))o=r.leftBound(M),c=r.right(o),h=r.rightRegion(o),v=i.bisect(h,M),s=r.createHalfEdge(v,"l"),r.insert(o,s),d=i.intersect(o,s),d&&(u.del(o),u.insert(o,d,i.distance(d,M))),o=s,s=r.createHalfEdge(v,"r"),r.insert(o,s),d=i.intersect(s,c),d&&u.insert(s,d,i.distance(d,M)),M=e.list.shift();else{if(u.empty())break;o=u.extractMin(),l=r.left(o),c=r.right(o),f=r.right(c),h=r.leftRegion(o),g=r.rightRegion(c),m=o.vertex,i.endPoint(o.edge,o.side,m),i.endPoint(c.edge,c.side,m),r.del(o),u.del(c),r.del(c),y="l",h.y>g.y&&(p=h,h=g,g=p,y="r"),v=i.bisect(h,g),s=r.createHalfEdge(v,y),r.insert(l,s),i.endPoint(v,Mo[y],m),d=i.intersect(l,s),d&&(u.del(l),u.insert(l,d,i.distance(d,h))),d=i.intersect(s,f),d&&u.insert(s,d,i.distance(d,h))}for(o=r.right(r.leftEnd);o!=r.rightEnd;o=r.right(o))n(o.edge)}function je(){return{leaf:!0,nodes:[],point:null}}function Le(t,n,e,r,i,u){if(!t(n,e,r,i,u)){var a=.5*(e+i),o=.5*(r+u),c=n.nodes;c[0]&&Le(t,c[0],e,r,a,o),c[1]&&Le(t,c[1],a,r,i,o),c[2]&&Le(t,c[2],e,o,a,u),c[3]&&Le(t,c[3],a,o,i,u)}}function Fe(t){return function(n){return 0>=n?0:n>=1?1:t(n)}}function He(t){return function(n){return 1-t(1-n)}}function Re(t){return function(n){return.5*(.5>n?t(2*n):2-t(2-2*n))}}function Pe(t){return t*t}function Oe(t){return t*t*t}function Ye(t){if(0>=t)return 0;if(t>=1)return 1;var n=t*t,e=n*t;return 4*(.5>t?e:3*(t-n)+e-.75)}function Ue(t){return function(n){return Math.pow(n,t)}}function Ie(t){return 1-Math.cos(t*_a/2)}function Ve(t){return Math.pow(2,10*(t-1))
}function Xe(t){return 1-Math.sqrt(1-t*t)}function Ze(t,n){var e;return 2>arguments.length&&(n=.45),arguments.length?e=n/(2*_a)*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,10*-r)*Math.sin(2*(r-e)*_a/n)}}function Be(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function $e(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Je(t){var n=[t.a,t.b],e=[t.c,t.d],r=Ke(n),i=Ge(n,e),u=Ke(We(e,n,-i))||0;n[0]*e[1]<e[0]*n[1]&&(n[0]*=-1,n[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(n[1],n[0]):Math.atan2(-e[0],e[1]))*Ea,this.translate=[t.e,t.f],this.scale=[r,u],this.skew=u?Math.atan2(i,u)*Ea:0}function Ge(t,n){return t[0]*n[0]+t[1]*n[1]}function Ke(t){var n=Math.sqrt(Ge(t,t));return n&&(t[0]/=n,t[1]/=n),n}function We(t,n,e){return t[0]+=e*n[0],t[1]+=e*n[1],t}function Qe(t){return"transform"==t?$u.interpolateTransform:$u.interpolate}function tr(t){for(var n=t.source,e=t.target,r=er(n,e),i=[n];n!==r;)n=n.parent,i.push(n);for(var u=i.length;e!==r;)i.splice(u,0,e),e=e.parent;return i}function nr(t){for(var n=[],e=t.parent;null!=e;)n.push(t),t=e,e=e.parent;return n.push(t),n}function er(t,n){if(t===n)return t;for(var e=nr(t),r=nr(n),i=e.pop(),u=r.pop(),a=null;i===u;)a=i,i=e.pop(),u=r.pop();return a}function rr(t){t.fixed|=2}function ir(t){t.fixed&=-7}function ur(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ar(t){t.fixed&=-5}function or(t,n,e){var r=0,i=0;if(t.charge=0,!t.leaf)for(var u,a=t.nodes,o=a.length,c=-1;o>++c;)u=a[c],null!=u&&(or(u,n,e),t.charge+=u.charge,r+=u.charge*u.cx,i+=u.charge*u.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var l=n*e[t.point.index];t.charge+=t.pointCharge=l,r+=l*t.point.x,i+=l*t.point.y}t.cx=r/t.charge,t.cy=i/t.charge}function cr(t,n){return $u.rebind(t,n,"sort","children","value"),t.nodes=t,t.links=hr,t}function lr(t){return t.children}function fr(t){return t.value}function sr(t,n){return n.value-t.value}function hr(t){return $u.merge(t.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}function gr(t){return t.x}function pr(t){return t.y}function dr(t,n,e){t.y0=n,t.y=e}function mr(t){return $u.range(t.length)}function vr(t){for(var n=-1,e=t[0].length,r=[];e>++n;)r[n]=0;return r}function yr(t){for(var n,e=1,r=0,i=t[0][1],u=t.length;u>e;++e)(n=t[e][1])>i&&(r=e,i=n);return r}function Mr(t){return t.reduce(br,0)}function br(t,n){return t+n[1]}function xr(t,n){return _r(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function _r(t,n){for(var e=-1,r=+t[0],i=(t[1]-r)/n,u=[];n>=++e;)u[e]=i*e+r;return u}function wr(t){return[$u.min(t),$u.max(t)]}function Sr(t,n){return t.parent==n.parent?1:2}function Er(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function kr(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function Ar(t,n){var e=t.children;if(e&&(i=e.length))for(var r,i,u=-1;i>++u;)n(r=Ar(e[u],n),t)>0&&(t=r);return t}function Nr(t,n){return t.x-n.x}function qr(t,n){return n.x-t.x}function Tr(t,n){return t.depth-n.depth}function Cr(t,n){function e(t,r){var i=t.children;if(i&&(a=i.length))for(var u,a,o=null,c=-1;a>++c;)u=i[c],e(u,o),o=u;n(t,r)}e(t,null)}function zr(t){for(var n,e=0,r=0,i=t.children,u=i.length;--u>=0;)n=i[u]._tree,n.prelim+=e,n.mod+=e,e+=n.shift+(r+=n.change)}function Dr(t,n,e){t=t._tree,n=n._tree;var r=e/(n.number-t.number);t.change+=r,n.change-=r,n.shift+=e,n.prelim+=e,n.mod+=e}function jr(t,n,e){return t._tree.ancestor.parent==n.parent?t._tree.ancestor:e}function Lr(t,n){return t.value-n.value}function Fr(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function Hr(t,n){t._pack_next=n,n._pack_prev=t}function Rr(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return i*i-e*e-r*r>.001}function Pr(t){function n(t){f=Math.min(t.x-t.r,f),s=Math.max(t.x+t.r,s),h=Math.min(t.y-t.r,h),g=Math.max(t.y+t.r,g)}if((e=t.children)&&(l=e.length)){var e,r,i,u,a,o,c,l,f=1/0,s=-1/0,h=1/0,g=-1/0;if(e.forEach(Or),r=e[0],r.x=-r.r,r.y=0,n(r),l>1&&(i=e[1],i.x=i.r,i.y=0,n(i),l>2))for(u=e[2],Ir(r,i,u),n(u),Fr(r,u),r._pack_prev=u,Fr(u,i),i=r._pack_next,a=3;l>a;a++){Ir(r,i,u=e[a]);var p=0,d=1,m=1;for(o=i._pack_next;o!==i;o=o._pack_next,d++)if(Rr(o,u)){p=1;break}if(1==p)for(c=r._pack_prev;c!==o._pack_prev&&!Rr(c,u);c=c._pack_prev,m++);p?(m>d||d==m&&i.r<r.r?Hr(r,i=o):Hr(r=c,i),a--):(Fr(r,u),i=u,n(u))}var v=(f+s)/2,y=(h+g)/2,M=0;for(a=0;l>a;a++)u=e[a],u.x-=v,u.y-=y,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));t.r=M,e.forEach(Yr)}}function Or(t){t._pack_next=t._pack_prev=t}function Yr(t){delete t._pack_next,delete t._pack_prev}function Ur(t,n,e,r){var i=t.children;if(t.x=n+=r*t.x,t.y=e+=r*t.y,t.r*=r,i)for(var u=-1,a=i.length;a>++u;)Ur(i[u],n,e,r)}function Ir(t,n,e){var r=t.r+e.r,i=n.x-t.x,u=n.y-t.y;if(r&&(i||u)){var a=n.r+e.r,o=i*i+u*u;a*=a,r*=r;var c=.5+(r-a)/(2*o),l=Math.sqrt(Math.max(0,2*a*(r+o)-(r-=o)*r-a*a))/(2*o);e.x=t.x+c*i+l*u,e.y=t.y+c*u-l*i}else e.x=t.x+r,e.y=t.y}function Vr(t){return 1+$u.max(t,function(t){return t.y})}function Xr(t){return t.reduce(function(t,n){return t+n.x},0)/t.length}function Zr(t){var n=t.children;return n&&n.length?Zr(n[0]):t}function Br(t){var n,e=t.children;return e&&(n=e.length)?Br(e[n-1]):t}function $r(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Jr(t,n){var e=t.x+n[3],r=t.y+n[0],i=t.dx-n[1]-n[3],u=t.dy-n[0]-n[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Gr(t){function n(n){function a(){l.push("M",u(t(f),o))}for(var c,l=[],f=[],s=-1,h=n.length,g=ln(e),p=ln(r);h>++s;)i.call(this,c=n[s],s)?f.push([+g.call(this,c,s),+p.call(this,c,s)]):f.length&&(a(),f=[]);return f.length&&a(),l.length?l.join(""):null}var e=Kr,r=Wr,i=Bn,u=Qr,a=u.key,o=.7;return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n.defined=function(t){return arguments.length?(i=t,n):i},n.interpolate=function(t){return arguments.length?(a="function"==typeof t?u=t:(u=To.get(t)||Qr).key,n):a},n.tension=function(t){return arguments.length?(o=t,n):o},n}function Kr(t){return t[0]}function Wr(t){return t[1]}function Qr(t){return t.join("L")}function ti(t){return Qr(t)+"Z"}function ni(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];e>++n;)i.push("V",(r=t[n])[1],"H",r[0]);return i.join("")}function ei(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];e>++n;)i.push("H",(r=t[n])[0],"V",r[1]);return i.join("")}function ri(t,n){return 4>t.length?Qr(t):t[1]+ai(t.slice(1,t.length-1),oi(t,n))}function ii(t,n){return 3>t.length?Qr(t):t[0]+ai((t.push(t[0]),t),oi([t[t.length-2]].concat(t,[t[1]]),n))}function ui(t,n){return 3>t.length?Qr(t):t[0]+ai(t,oi(t,n))}function ai(t,n){if(1>n.length||t.length!=n.length&&t.length!=n.length+2)return Qr(t);var e=t.length!=n.length,r="",i=t[0],u=t[1],a=n[0],o=a,c=1;if(e&&(r+="Q"+(u[0]-2*a[0]/3)+","+(u[1]-2*a[1]/3)+","+u[0]+","+u[1],i=t[1],c=2),n.length>1){o=n[1],u=t[c],c++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(u[0]-o[0])+","+(u[1]-o[1])+","+u[0]+","+u[1];for(var l=2;n.length>l;l++,c++)u=t[c],o=n[l],r+="S"+(u[0]-o[0])+","+(u[1]-o[1])+","+u[0]+","+u[1]}if(e){var f=t[c];r+="Q"+(u[0]+2*o[0]/3)+","+(u[1]+2*o[1]/3)+","+f[0]+","+f[1]}return r}function oi(t,n){for(var e,r=[],i=(1-n)/2,u=t[0],a=t[1],o=1,c=t.length;c>++o;)e=u,u=a,a=t[o],r.push([i*(a[0]-e[0]),i*(a[1]-e[1])]);return r}function ci(t){if(3>t.length)return Qr(t);var n=1,e=t.length,r=t[0],i=r[0],u=r[1],a=[i,i,i,(r=t[1])[0]],o=[u,u,u,r[1]],c=[i,",",u];for(gi(c,a,o);e>++n;)r=t[n],a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),gi(c,a,o);for(n=-1;2>++n;)a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),gi(c,a,o);return c.join("")}function li(t){if(4>t.length)return Qr(t);for(var n,e=[],r=-1,i=t.length,u=[0],a=[0];3>++r;)n=t[r],u.push(n[0]),a.push(n[1]);for(e.push(hi(Do,u)+","+hi(Do,a)),--r;i>++r;)n=t[r],u.shift(),u.push(n[0]),a.shift(),a.push(n[1]),gi(e,u,a);return e.join("")}function fi(t){for(var n,e,r=-1,i=t.length,u=i+4,a=[],o=[];4>++r;)e=t[r%i],a.push(e[0]),o.push(e[1]);for(n=[hi(Do,a),",",hi(Do,o)],--r;u>++r;)e=t[r%i],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),gi(n,a,o);return n.join("")}function si(t,n){var e=t.length-1;if(e)for(var r,i,u=t[0][0],a=t[0][1],o=t[e][0]-u,c=t[e][1]-a,l=-1;e>=++l;)r=t[l],i=l/e,r[0]=n*r[0]+(1-n)*(u+i*o),r[1]=n*r[1]+(1-n)*(a+i*c);return ci(t)}function hi(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function gi(t,n,e){t.push("C",hi(Co,n),",",hi(Co,e),",",hi(zo,n),",",hi(zo,e),",",hi(Do,n),",",hi(Do,e))}function pi(t,n){return(n[1]-t[1])/(n[0]-t[0])}function di(t){for(var n=0,e=t.length-1,r=[],i=t[0],u=t[1],a=r[0]=pi(i,u);e>++n;)r[n]=(a+(a=pi(i=u,u=t[n+1])))/2;return r[n]=a,r}function mi(t){for(var n,e,r,i,u=[],a=di(t),o=-1,c=t.length-1;c>++o;)n=pi(t[o],t[o+1]),1e-6>Math.abs(n)?a[o]=a[o+1]=0:(e=a[o]/n,r=a[o+1]/n,i=e*e+r*r,i>9&&(i=3*n/Math.sqrt(i),a[o]=i*e,a[o+1]=i*r));for(o=-1;c>=++o;)i=(t[Math.min(c,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),u.push([i||0,a[o]*i||0]);return u}function vi(t){return 3>t.length?Qr(t):t[0]+ai(t,mi(t))}function yi(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function Mi(t){return t.rangeExtent?t.rangeExtent():yi(t.range())}function bi(t,n){return n=n-(t=+t)?1/(n-t):0,function(e){return(e-t)*n}}function xi(t,n){return n=n-(t=+t)?1/(n-t):0,function(e){return Math.max(0,Math.min(1,(e-t)*n))}}function _i(t,n,e,r){var i=e(t[0],t[1]),u=r(n[0],n[1]);return function(t){return u(i(t))}}function wi(t,n){var e,r=0,i=t.length-1,u=t[r],a=t[i];return u>a&&(e=r,r=i,i=e,e=u,u=a,a=e),(n=n(a-u))&&(t[r]=n.floor(u),t[i]=n.ceil(a)),t}function Si(t,n,e,r){var i=[],u=[],a=0,o=Math.min(t.length,n.length)-1;for(t[o]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());o>=++a;)i.push(e(t[a-1],t[a])),u.push(r(n[a-1],n[a]));return function(n){var e=$u.bisect(t,n,1,o)-1;return u[e](i[e](n))}}function Ei(t,n,e,r){function i(){var i=Math.min(t.length,n.length)>2?Si:_i,c=r?xi:bi;return a=i(t,n,c,e),o=i(n,t,c,$u.interpolate),u}function u(t){return a(t)}var a,o;return u.invert=function(t){return o(t)},u.domain=function(n){return arguments.length?(t=n.map(Number),i()):t},u.range=function(t){return arguments.length?(n=t,i()):n},u.rangeRound=function(t){return u.range(t).interpolate($u.interpolateRound)},u.clamp=function(t){return arguments.length?(r=t,i()):r},u.interpolate=function(t){return arguments.length?(e=t,i()):e},u.ticks=function(n){return qi(t,n)},u.tickFormat=function(n,e){return Ti(t,n,e)},u.nice=function(){return wi(t,Ai),i()},u.copy=function(){return Ei(t,n,e,r)},i()}function ki(t,n){return $u.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Ai(t){return t=Math.pow(10,Math.round(Math.log(t)/Math.LN10)-1),t&&{floor:function(n){return Math.floor(n/t)*t},ceil:function(n){return Math.ceil(n/t)*t}}}function Ni(t,n){var e=yi(t),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/n)/Math.LN10)),u=n/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function qi(t,n){return $u.range.apply($u,Ni(t,n))}function Ti(t,n,e){var r=-Math.floor(Math.log(Ni(t,n)[2])/Math.LN10+.01);return $u.format(e?e.replace(Va,function(t,n,e,i,u,a,o,c,l,f){return[n,e,i,u,a,o,c,l||"."+(r-2*("%"===f)),f].join("")}):",."+r+"f")}function Ci(t,n,e,r){function i(n){return t(e(n))}return i.invert=function(n){return r(t.invert(n))},i.domain=function(n){return arguments.length?(0>n[0]?(e=ji,r=Li):(e=zi,r=Di),t.domain(n.map(e)),i):t.domain().map(r)},i.base=function(t){return arguments.length?(n=+t,i):n},i.nice=function(){return t.domain(wi(t.domain(),Fi(n))),i},i.ticks=function(){var i=yi(t.domain()),u=[];if(i.every(isFinite)){var a=Math.log(n),o=Math.floor(i[0]/a),c=Math.ceil(i[1]/a),l=r(i[0]),f=r(i[1]),s=n%1?2:n;if(e===ji)for(u.push(-Math.pow(n,-o));c>o++;)for(var h=s-1;h>0;h--)u.push(-Math.pow(n,-o)*h);else{for(;c>o;o++)for(var h=1;s>h;h++)u.push(Math.pow(n,o)*h);u.push(Math.pow(n,o))}for(o=0;l>u[o];o++);for(c=u.length;u[c-1]>f;c--);u=u.slice(o,c)}return u},i.tickFormat=function(t,u){if(2>arguments.length&&(u=jo),!arguments.length)return u;var a,o=Math.log(n),c=Math.max(.1,t/i.ticks().length),l=e===ji?(a=-1e-12,Math.floor):(a=1e-12,Math.ceil);return function(t){return c>=t/r(o*l(e(t)/o+a))?u(t):""}},i.copy=function(){return Ci(t.copy(),n,e,r)},ki(i,t)}function zi(t){return Math.log(0>t?0:t)}function Di(t){return Math.exp(t)}function ji(t){return-Math.log(t>0?0:-t)}function Li(t){return-Math.exp(-t)}function Fi(t){t=Math.log(t);var n={floor:function(n){return Math.floor(n/t)*t},ceil:function(n){return Math.ceil(n/t)*t}};return function(){return n}}function Hi(t,n){function e(n){return t(r(n))}var r=Ri(n),i=Ri(1/n);return e.invert=function(n){return i(t.invert(n))},e.domain=function(n){return arguments.length?(t.domain(n.map(r)),e):t.domain().map(i)},e.ticks=function(t){return qi(e.domain(),t)},e.tickFormat=function(t,n){return Ti(e.domain(),t,n)},e.nice=function(){return e.domain(wi(e.domain(),Ai))},e.exponent=function(t){if(!arguments.length)return n;var u=e.domain();return r=Ri(n=t),i=Ri(1/n),e.domain(u)},e.copy=function(){return Hi(t.copy(),n)},ki(e,t)}function Ri(t){return function(n){return 0>n?-Math.pow(-n,t):Math.pow(n,t)}}function Pi(t,n){function e(n){return a[((u.get(n)||u.set(n,t.push(n)))-1)%a.length]}function r(n,e){return $u.range(t.length).map(function(t){return n+e*t})}var u,a,o;return e.domain=function(r){if(!arguments.length)return t;t=[],u=new i;for(var a,o=-1,c=r.length;c>++o;)u.has(a=r[o])||u.set(a,t.push(a));return e[n.t].apply(e,n.a)},e.range=function(t){return arguments.length?(a=t,o=0,n={t:"range",a:arguments},e):a},e.rangePoints=function(i,u){2>arguments.length&&(u=0);var c=i[0],l=i[1],f=(l-c)/(Math.max(1,t.length-1)+u);return a=r(2>t.length?(c+l)/2:c+f*u/2,f),o=0,n={t:"rangePoints",a:arguments},e},e.rangeBands=function(i,u,c){2>arguments.length&&(u=0),3>arguments.length&&(c=u);var l=i[1]<i[0],f=i[l-0],s=i[1-l],h=(s-f)/(t.length-u+2*c);return a=r(f+h*c,h),l&&a.reverse(),o=h*(1-u),n={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,u,c){2>arguments.length&&(u=0),3>arguments.length&&(c=u);var l=i[1]<i[0],f=i[l-0],s=i[1-l],h=Math.floor((s-f)/(t.length-u+2*c)),g=s-f-(t.length-u)*h;return a=r(f+Math.round(g/2),h),l&&a.reverse(),o=Math.round(h*(1-u)),n={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return yi(n.a[0])},e.copy=function(){return Pi(t,n)},e.domain(t)}function Oi(t,n){function e(){var e=0,u=n.length;for(i=[];u>++e;)i[e-1]=$u.quantile(t,e/u);return r}function r(t){return isNaN(t=+t)?0/0:n[$u.bisect(i,t)]}var i;return r.domain=function(n){return arguments.length?(t=n.filter(function(t){return!isNaN(t)}).sort($u.ascending),e()):t},r.range=function(t){return arguments.length?(n=t,e()):n},r.quantiles=function(){return i},r.copy=function(){return Oi(t,n)},e()}function Yi(t,n,e){function r(n){return e[Math.max(0,Math.min(a,Math.floor(u*(n-t))))]}function i(){return u=e.length/(n-t),a=e.length-1,r}var u,a;return r.domain=function(e){return arguments.length?(t=+e[0],n=+e[e.length-1],i()):[t,n]},r.range=function(t){return arguments.length?(e=t,i()):e},r.copy=function(){return Yi(t,n,e)},i()}function Ui(t,n){function e(e){return n[$u.bisect(t,e)]}return e.domain=function(n){return arguments.length?(t=n,e):t},e.range=function(t){return arguments.length?(n=t,e):n},e.copy=function(){return Ui(t,n)},e}function Ii(t){function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=e.map(n),n):t},n.ticks=function(n){return qi(t,n)},n.tickFormat=function(n,e){return Ti(t,n,e)},n.copy=function(){return Ii(t)},n}function Vi(t){return t.innerRadius}function Xi(t){return t.outerRadius}function Zi(t){return t.startAngle}function Bi(t){return t.endAngle}function $i(t){for(var n,e,r,i=-1,u=t.length;u>++i;)n=t[i],e=n[0],r=n[1]+Po,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function Ji(t){function n(n){function c(){d.push("M",o(t(v),s),f,l(t(m.reverse()),s),"Z")}for(var h,g,p,d=[],m=[],v=[],y=-1,M=n.length,b=ln(e),x=ln(i),_=e===r?function(){return g}:ln(r),w=i===u?function(){return p}:ln(u);M>++y;)a.call(this,h=n[y],y)?(m.push([g=+b.call(this,h,y),p=+x.call(this,h,y)]),v.push([+_.call(this,h,y),+w.call(this,h,y)])):m.length&&(c(),m=[],v=[]);return m.length&&c(),d.length?d.join(""):null}var e=Kr,r=Kr,i=0,u=Wr,a=Bn,o=Qr,c=o.key,l=o,f="L",s=.7;return n.x=function(t){return arguments.length?(e=r=t,n):r},n.x0=function(t){return arguments.length?(e=t,n):e},n.x1=function(t){return arguments.length?(r=t,n):r},n.y=function(t){return arguments.length?(i=u=t,n):u},n.y0=function(t){return arguments.length?(i=t,n):i},n.y1=function(t){return arguments.length?(u=t,n):u},n.defined=function(t){return arguments.length?(a=t,n):a},n.interpolate=function(t){return arguments.length?(c="function"==typeof t?o=t:(o=To.get(t)||Qr).key,l=o.reverse||o,f=o.closed?"M":"L",n):c},n.tension=function(t){return arguments.length?(s=t,n):s},n}function Gi(t){return t.radius}function Ki(t){return[t.x,t.y]}function Wi(t){return function(){var n=t.apply(this,arguments),e=n[0],r=n[1]+Po;return[e*Math.cos(r),e*Math.sin(r)]}}function Qi(){return 64}function tu(){return"circle"}function nu(t){var n=Math.sqrt(t/_a);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}function eu(t,n){return aa(t,Xo),t.id=n,t}function ru(t,n,e,r){var u=t.__transition__||(t.__transition__={active:0,count:0}),a=u[e];if(!a){var o=r.time;return a=u[e]={tween:new i,event:$u.dispatch("start","end"),time:o,ease:r.ease,delay:r.delay,duration:r.duration},++u.count,$u.timer(function(r){function i(r){return u.active>e?l():(u.active=e,h.start.call(t,f,n),a.tween.forEach(function(e,r){(r=r.call(t,f,n))&&d.push(r)}),c(r)||$u.timer(c,0,o),1)}function c(r){if(u.active!==e)return l();for(var i=(r-g)/p,a=s(i),o=d.length;o>0;)d[--o].call(t,a);return i>=1?(l(),h.end.call(t,f,n),1):void 0}function l(){return--u.count?delete u[e]:delete t.__transition__,1}var f=t.__data__,s=a.ease,h=a.event,g=a.delay,p=a.duration,d=[];return r>=g?i(r):$u.timer(i,g,o),1},0,o),a}}function iu(t,n,e,r){var i=t.id;return z(t,"function"==typeof e?function(t,u,a){t.__transition__[i].tween.set(n,r(e.call(t,t.__data__,u,a)))}:(e=r(e),function(t){t.__transition__[i].tween.set(n,e)}))}function uu(t){return null==t&&(t=""),function(){this.textContent=t}}function au(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function ou(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}function cu(t,n,e){if(r=[],e&&n.length>1){for(var r,i,u,a=yi(t.domain()),o=-1,c=n.length,l=(n[1]-n[0])/++e;c>++o;)for(i=e;--i>0;)(u=+n[o]-i*l)>=a[0]&&r.push(u);for(--o,i=0;e>++i&&(u=+n[o]+i*l)<a[1];)r.push(u)}return r}function lu(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function fu(t,n,e,r){for(var i,u,a=0,o=n.length,c=e.length;o>a;){if(r>=c)return-1;if(i=n.charCodeAt(a++),37===i){if(u=mc[n.charAt(a++)],!u||0>(r=u(t,e,r)))return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function su(t){return RegExp("^(?:"+t.map($u.requote).join("|")+")","i")}function hu(t){for(var n=new i,e=-1,r=t.length;r>++e;)n.set(t[e].toLowerCase(),e);return n}function gu(t,n,e){t+="";var r=t.length;return e>r?Array(e-r+1).join(n)+t:t}function pu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e));return r?e+=r[0].length:-1}function du(t,n,e){cc.lastIndex=0;var r=cc.exec(n.substring(e));return r?e+=r[0].length:-1}function mu(t,n,e){hc.lastIndex=0;var r=hc.exec(n.substring(e));return r?(t.m=gc.get(r[0].toLowerCase()),e+=r[0].length):-1}function vu(t,n,e){fc.lastIndex=0;var r=fc.exec(n.substring(e));return r?(t.m=sc.get(r[0].toLowerCase()),e+=r[0].length):-1}function yu(t,n,e){return fu(t,""+dc.c,n,e)}function Mu(t,n,e){return fu(t,""+dc.x,n,e)}function bu(t,n,e){return fu(t,""+dc.X,n,e)}function xu(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}function _u(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+2));return r?(t.y=wu(+r[0]),e+=r[0].length):-1}function wu(t){return t+(t>68?1900:2e3)}function Su(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1}function Eu(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function ku(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}function Au(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1}function Nu(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1}function qu(t,n,e){vc.lastIndex=0;var r=vc.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1}function Tu(t,n,e){var r=yc.get(n.substring(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)}function Cu(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+gu(r,"0",2)+gu(i,"0",2)}function zu(t){return t.toISOString()}function Du(t,n,e){function r(n){var e=t(n),r=u(e,1);return r-n>n-e?e:r}function i(e){return n(e=t(new Wo(e-1)),1),e}function u(t,e){return n(t=new Wo(+t),e),t}function a(t,r,u){var a=i(t),o=[];if(u>1)for(;r>a;)e(a)%u||o.push(new Date(+a)),n(a,1);else for(;r>a;)o.push(new Date(+a)),n(a,1);return o}function o(t,n,e){try{Wo=lu;var r=new lu;return r._=t,a(r,n,e)}finally{Wo=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=u,t.range=a;var c=t.utc=ju(t);return c.floor=c,c.round=ju(r),c.ceil=ju(i),c.offset=ju(u),c.range=o,t}function ju(t){return function(n,e){try{Wo=lu;var r=new lu;return r._=n,t(r,e)._}finally{Wo=Date}}}function Lu(t,n,e){function r(n){return t(n)}return r.invert=function(n){return Hu(t.invert(n))},r.domain=function(n){return arguments.length?(t.domain(n),r):t.domain().map(Hu)},r.nice=function(t){return r.domain(wi(r.domain(),function(){return t}))},r.ticks=function(e,i){var u=Fu(r.domain());if("function"!=typeof e){var a=u[1]-u[0],o=a/e,c=$u.bisect(bc,o);if(c==bc.length)return n.year(u,e);if(!c)return t.ticks(e).map(Hu);Math.log(o/bc[c-1])<Math.log(bc[c]/o)&&--c,e=n[c],i=e[1],e=e[0].range}return e(u[0],new Date(+u[1]+1),i)},r.tickFormat=function(){return e},r.copy=function(){return Lu(t.copy(),n,e)},$u.rebind(r,t,"range","rangeRound","interpolate","clamp")}function Fu(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function Hu(t){return new Date(t)}function Ru(t){return function(n){for(var e=t.length-1,r=t[e];!r[1](n);)r=t[--e];return r[0](n)}}function Pu(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function Ou(t){var n=t.getFullYear(),e=Pu(n),r=Pu(n+1);return n+(t-e)/(r-e)}function Yu(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function Uu(t){var n=t.getUTCFullYear(),e=Yu(n),r=Yu(n+1);return n+(t-e)/(r-e)}function Iu(t){return 1===t.length?function(n,e){t(null==n?e:null)}:t}function Vu(t){return t.responseText}function Xu(t){return JSON.parse(t.responseText)}function Zu(t){var n=Ju.createRange();return n.selectNode(Ju.body),n.createContextualFragment(t.responseText)}function Bu(t){return t.responseXML}var $u={version:"3.0.8"};Date.now||(Date.now=function(){return+new Date});var Ju=document,Gu=window;try{Ju.createElement("div").style.setProperty("opacity",0,"")}catch(Ku){var Wu=Gu.CSSStyleDeclaration.prototype,Qu=Wu.setProperty;Wu.setProperty=function(t,n,e){Qu.call(this,t,n+"",e)}}$u.ascending=function(t,n){return n>t?-1:t>n?1:t>=n?0:0/0},$u.descending=function(t,n){return t>n?-1:n>t?1:n>=t?0:0/0},$u.min=function(t,n){var e,r,i=-1,u=t.length;if(1===arguments.length){for(;u>++i&&(null==(e=t[i])||e!=e);)e=void 0;for(;u>++i;)null!=(r=t[i])&&e>r&&(e=r)}else{for(;u>++i&&(null==(e=n.call(t,t[i],i))||e!=e);)e=void 0;for(;u>++i;)null!=(r=n.call(t,t[i],i))&&e>r&&(e=r)}return e},$u.max=function(t,n){var e,r,i=-1,u=t.length;if(1===arguments.length){for(;u>++i&&(null==(e=t[i])||e!=e);)e=void 0;for(;u>++i;)null!=(r=t[i])&&r>e&&(e=r)}else{for(;u>++i&&(null==(e=n.call(t,t[i],i))||e!=e);)e=void 0;for(;u>++i;)null!=(r=n.call(t,t[i],i))&&r>e&&(e=r)}return e},$u.extent=function(t,n){var e,r,i,u=-1,a=t.length;if(1===arguments.length){for(;a>++u&&(null==(e=i=t[u])||e!=e);)e=i=void 0;for(;a>++u;)null!=(r=t[u])&&(e>r&&(e=r),r>i&&(i=r))}else{for(;a>++u&&(null==(e=i=n.call(t,t[u],u))||e!=e);)e=void 0;for(;a>++u;)null!=(r=n.call(t,t[u],u))&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},$u.sum=function(t,n){var e,r=0,i=t.length,u=-1;if(1===arguments.length)for(;i>++u;)isNaN(e=+t[u])||(r+=e);else for(;i>++u;)isNaN(e=+n.call(t,t[u],u))||(r+=e);return r},$u.mean=function(n,e){var r,i=n.length,u=0,a=-1,o=0;if(1===arguments.length)for(;i>++a;)t(r=n[a])&&(u+=(r-u)/++o);else for(;i>++a;)t(r=e.call(n,n[a],a))&&(u+=(r-u)/++o);return o?u:void 0},$u.quantile=function(t,n){var e=(t.length-1)*n+1,r=Math.floor(e),i=+t[r-1],u=e-r;return u?i+u*(t[r]-i):i},$u.median=function(n,e){return arguments.length>1&&(n=n.map(e)),n=n.filter(t),n.length?$u.quantile(n.sort($u.ascending),.5):void 0},$u.bisector=function(t){return{left:function(n,e,r,i){for(3>arguments.length&&(r=0),4>arguments.length&&(i=n.length);i>r;){var u=r+i>>>1;e>t.call(n,n[u],u)?r=u+1:i=u}return r},right:function(n,e,r,i){for(3>arguments.length&&(r=0),4>arguments.length&&(i=n.length);i>r;){var u=r+i>>>1;t.call(n,n[u],u)>e?i=u:r=u+1}return r}}};var ta=$u.bisector(function(t){return t});$u.bisectLeft=ta.left,$u.bisect=$u.bisectRight=ta.right,$u.shuffle=function(t){for(var n,e,r=t.length;r;)e=0|Math.random()*r--,n=t[r],t[r]=t[e],t[e]=n;return t},$u.