From fe09bb0cc25935ee0ecd9dbe0ab2cb438dc971be Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Thu, 7 Mar 2013 07:45:00 -0800 Subject: [PATCH] Allow objects as input to d3_dsv.format. The previous implementation of format, which only supported arrays as input, is retained as d3_dsv.formatRows; for backwards-compatibility, d3_dsv.format allows both arrays and objects as input (to be removed in 4.0). This change makes format and formatRows symmetric with parse and parseRows, respectively. To compute the set of fields from all objects, two passes are required. Fields are listed in discovery order, so that in the common case where all fields are defined on all objects, the order of columns in the generated DSV will match the property iteration order of the first object. This supersedes #1106 and fixes #509; thank you to @smcgivern and @hammer for suggesting this feature. --- d3.js | 18 +++++++++++++++++- d3.min.js | 10 +++++----- src/core/interpolate.js | 2 +- src/dsv/dsv.js | 20 ++++++++++++++++++++ test/dsv/csv-test.js | 25 +++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 7 deletions(-) diff --git a/d3.js b/d3.js index fea76284..38cb0dea 100644 --- a/d3.js +++ b/d3.js @@ -1091,7 +1091,7 @@ d3 = function() { return name == "transform" ? d3.interpolateTransform : d3.interpolate; } d3.interpolators = [ d3.interpolateObject, function(a, b) { - return b instanceof Array && d3.interpolateArray(a, b); + return Array.isArray(b) && d3.interpolateArray(a, b); }, function(a, b) { return (typeof a === "string" || typeof b === "string") && d3.interpolateString(a + "", b + ""); }, function(a, b) { @@ -5416,6 +5416,22 @@ d3 = function() { return rows; }; dsv.format = function(rows) { + if (Array.isArray(rows[0])) return dsv.formatRows(rows); + var fieldSet = new d3_Set(), fields = []; + rows.forEach(function(row) { + for (var field in row) { + if (!fieldSet.has(field)) { + fields.push(fieldSet.add(field)); + } + } + }); + return [ fields ].concat(rows.map(function(row) { + return fields.map(function(field) { + return formatValue(row[field]); + }).join(delimiter); + })).join("\n"); + }; + dsv.formatRows = function(rows) { return rows.map(formatRow).join("\n"); }; function formatRow(row) { diff --git a/d3.min.js b/d3.min.js index 3cb87e7a..fb1306f4 100644 --- a/d3.min.js +++ b/d3.min.js @@ -1,5 +1,5 @@ -d3=function(){function t(t){return t.target}function n(t){return t.source}function e(t){return Math.acos(Math.max(-1,Math.min(1,t)))}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(t){for(var n=-1,e=t.length,r=[];e>++n;)r.push(t[n]);return r}function u(t){return Array.prototype.slice.call(t)}function a(){}function o(){}function c(t){return t}function l(){return!0}function f(t){return"function"==typeof t?t:function(){return t}}function s(t,n,e){return function(){var r=e.apply(n,arguments);return r===n?t:r}}function h(t){return null!=t&&!isNaN(t)}function g(t){return t.length}function p(t){return t.trim().replace(/\s+/g," ")}function d(t){for(var n=1;t*n%1;)n*=10;return n}function m(t){return 1===t.length?function(n,e){t(null==n?e:null)}:t}function v(t){return t.responseText}function y(t){return JSON.parse(t.responseText)}function M(t){var n=Zu.createRange();return n.selectNode(Zu.body),n.createContextualFragment(t.responseText)}function x(t){return t.responseXML}function _(){}function w(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 a;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 S(t,n){return n-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function k(t){return t+""}function E(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 A(t){return function(n){return 0>=n?0:n>=1?1:t(n)}}function N(t){return function(n){return 1-t(1-n)}}function T(t){return function(n){return.5*(.5>n?t(2*n):2-t(2-2*n))}}function q(t){return t*t}function C(t){return t*t*t}function z(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 D(t){return function(n){return Math.pow(n,t)}}function L(t){return 1-Math.cos(t*Ou/2)}function j(t){return Math.pow(2,10*(t-1))}function F(t){return 1-Math.sqrt(1-t*t)}function H(t,n){var e;return 2>arguments.length&&(n=.45),arguments.length?e=n/(2*Ou)*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,10*-r)*Math.sin(2*(r-e)*Ou/n)}}function P(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function R(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 O(){Uu.event.stopPropagation(),Uu.event.preventDefault()}function Y(){for(var t,n=Uu.event;t=n.sourceEvent;)n=t;return n}function U(t){for(var n=new _,e=0,r=arguments.length;r>++e;)n[arguments[e]]=w(n);return n.of=function(e,r){return function(i){try{var u=i.sourceEvent=Uu.event;i.target=t,Uu.event=i,n[i.type].apply(e,r)}finally{Uu.event=u}}},n}function I(t){var n=[t.a,t.b],e=[t.c,t.d],r=Z(n),i=V(n,e),u=Z(X(e,n,-i))||0;n[0]*e[1]t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function tn(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(un(i[0]),un(i[1]),un(i[2]))}return(u=ya.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 nn(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,an(r,i,c)}function en(t,n,e){t=rn(t),n=rn(n),e=rn(e);var r=vn((.4124564*t+.3575761*n+.1804375*e)/_a),i=vn((.2126729*t+.7151522*n+.072175*e)/wa),u=vn((.0193339*t+.119192*n+.9503041*e)/Sa);return hn(116*i-16,500*(r-i),200*(i-u))}function rn(t){return.04045>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}function un(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}function an(t,n,e){return new on(t,n,e)}function on(t,n,e){this.h=t,this.s=n,this.l=e}function cn(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,K(i(t+120),i(t),i(t-120))}function ln(t,n,e){return new fn(t,n,e)}function fn(t,n,e){this.h=t,this.c=n,this.l=e}function sn(t,n,e){return hn(e,Math.cos(t*=Iu)*n,Math.sin(t)*n)}function hn(t,n,e){return new gn(t,n,e)}function gn(t,n,e){this.l=t,this.a=n,this.b=e}function pn(t,n,e){var r=(t+16)/116,i=r+n/500,u=r-e/200;return i=mn(i)*_a,r=mn(r)*wa,u=mn(u)*Sa,K(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function dn(t,n,e){return ln(180*(Math.atan2(e,n)/Ou),Math.sqrt(n*n+e*e),t)}function mn(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vn(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yn(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Mn(t){return na(t,Ca),t}function bn(t){return function(){return Ea(t,this)}}function xn(t){return function(){return Aa(t,this)}}function _n(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=Uu.ns.qualify(t),null==n?t.local?r:e:"function"==typeof n?t.local?o:a:t.local?u:i}function wn(t){return RegExp("(?:^|\\s+)"+Uu.requote(t)+"(?:\\s+|$)","g")}function Sn(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(kn);var i=t.length;return"function"==typeof n?r:e}function kn(t){var n=wn(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=p(a+" "+t),u?i.baseVal=a:e.className=a)):a&&(a=p(a.replace(n," ")),u?i.baseVal=a:e.className=a)}}function En(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 An(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 Nn(t){return{__data__:t}}function Tn(t){return function(){return qa(this,t)}}function qn(t){return arguments.length||(t=Uu.ascending),function(n,e){return!n-!e||t(n.__data__,e.__data__)}}function Cn(t,n,e){function r(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}function i(){var i=o(n,Qu(arguments));r.call(this),this.addEventListener(t,this[u]=i,i.$=e),i._=n}var u="__on"+t,a=t.indexOf("."),o=zn;a>0&&(t=t.substring(0,a));var c=za.get(t);return c&&(t=c,o=Dn),n?i:r}function zn(t,n){return function(e){var r=Uu.event;Uu.event=e,n[0]=this.__data__;try{t.apply(this,n)}finally{Uu.event=r}}}function Dn(t,n){var e=zn(t,n);return function(t){var n=this,r=t.relatedTarget;r&&(r===n||8&r.compareDocumentPosition(n))||e.call(n,t)}}function Ln(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 jn(t){return na(t,La),t}function Fn(t,n){return na(t,Fa),t.id=n,t}function Hn(t,n,e,r){var i=t.__transition__||(t.__transition__={active:0,count:0}),u=i[e];if(!u){var o=r.time;return u=i[e]={tween:new a,event:Uu.dispatch("start","end"),time:o,ease:r.ease,delay:r.delay,duration:r.duration},++i.count,Uu.timer(function(r){function a(r){return i.active>e?l():(i.active=e,h.start.call(t,f,n),u.tween.forEach(function(e,r){(r=r.call(t,f,n))&&d.push(r)}),c(r)||Uu.timer(c,0,o),1)}function c(r){if(i.active!==e)return l();for(var u=(r-g)/p,a=s(u),o=d.length;o>0;)d[--o].call(t,a);return u>=1?(l(),h.end.call(t,f,n),1):void 0}function l(){return--i.count?delete i[e]:delete t.__transition__,1}var f=t.__data__,s=u.ease,h=u.event,g=u.delay,p=u.duration,d=[];return r>=g?a(r):Uu.timer(a,g,o),1},0,o),u}}function Pn(t){return null==t&&(t=""),function(){this.textContent=t}}function Rn(t,n,e,r){var i=t.id;return Ln(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 On(){for(var t,n=Date.now(),e=Ia;e;)t=n-e.then,t>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=Yn()-n;r>24?(isFinite(r)&&(clearTimeout(Oa),Oa=setTimeout(On,r)),Ra=0):(Ra=1,Va(On))}function Yn(){for(var t=null,n=Ia,e=1/0;n;)n.flush?(delete Ua[n.callback.id],n=t?t.next=n.next:Ia=n.next):(e=Math.min(e,n.then+n.delay),n=(t=n).next);return e}function Un(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>Za&&(Xu.scrollX||Xu.scrollY)){e=Uu.select(Zu.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=e[0][0].getScreenCTM();Za=!(i.f||i.e),e.remove()}return Za?(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 In(){}function Vn(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function Zn(t){return t.rangeExtent?t.rangeExtent():Vn(t.range())}function Xn(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 Bn(t,n,e,r){function i(){var i=Math.min(t.length,n.length)>2?te:Qn,c=r?J:$;return a=i(t,n,c,e),o=i(n,t,c,Uu.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(Uu.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 Kn(t,n)},u.tickFormat=function(n){return Wn(t,n)},u.nice=function(){return Xn(t,Jn),i()},u.copy=function(){return Bn(t,n,e,r)},i()}function $n(t,n){return Uu.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Jn(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 Gn(t,n){var e=Vn(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 Kn(t,n){return Uu.range.apply(Uu,Gn(t,n))}function Wn(t,n){return Uu.format(",."+Math.max(0,-Math.floor(Math.log(Gn(t,n)[2])/Math.LN10+.01))+"f")}function Qn(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 te(t,n,e,r){var i=[],u=[],a=0,o=Math.min(t.length,n.length)-1;for(t[o]=++a;)i.push(e(t[a-1],t[a])),u.push(r(n[a-1],n[a]));return function(n){var e=Uu.bisect(t,n,1,o)-1;return u[e](i[e](n))}}function ne(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=ie,r=ue):(e=ee,r=re),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(Xn(t.domain(),ae(n))),i},i.ticks=function(){var i=Vn(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===ie)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=Xa),!arguments.length)return u;var a,o=Math.log(n),c=Math.max(.1,t/i.ticks().length),l=e===ie?(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 ne(t.copy(),n,e,r)},$n(i,t)}function ee(t){return Math.log(0>t?0:t)}function re(t){return Math.exp(t)}function ie(t){return-Math.log(t>0?0:-t)}function ue(t){return-Math.exp(-t)}function ae(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 oe(t,n){function e(n){return t(r(n))}var r=ce(n),i=ce(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 Kn(e.domain(),t)},e.tickFormat=function(t){return Wn(e.domain(),t)},e.nice=function(){return e.domain(Xn(e.domain(),Jn))},e.exponent=function(t){if(!arguments.length)return n;var u=e.domain();return r=ce(n=t),i=ce(1/n),e.domain(u)},e.copy=function(){return oe(t.copy(),n)},$n(e,t)}function ce(t){return function(n){return 0>n?-Math.pow(-n,t):Math.pow(n,t)}}function le(t,n){function e(n){return u[((i.get(n)||i.set(n,t.push(n)))-1)%u.length]}function r(n,e){return Uu.range(t.length).map(function(t){return n+e*t})}var i,u,o;return e.domain=function(r){if(!arguments.length)return t;t=[],i=new a;for(var u,o=-1,c=r.length;c>++o;)i.has(u=r[o])||i.set(u,t.push(u));return e[n.t].apply(e,n.a)},e.range=function(t){return arguments.length?(u=t,o=0,n={t:"range",a:arguments},e):u},e.rangePoints=function(i,a){2>arguments.length&&(a=0);var c=i[0],l=i[1],f=(l-c)/(Math.max(1,t.length-1)+a);return u=r(2>t.length?(c+l)/2:c+f*a/2,f),o=0,n={t:"rangePoints",a:arguments},e},e.rangeBands=function(i,a,c){2>arguments.length&&(a=0),3>arguments.length&&(c=a);var l=i[1]arguments.length&&(a=0),3>arguments.length&&(c=a);var l=i[1]++e;)i[e-1]=Uu.quantile(t,e/u);return r}function r(t){return isNaN(t=+t)?0/0:n[Uu.bisect(i,t)]}var i;return r.domain=function(n){return arguments.length?(t=n.filter(function(t){return!isNaN(t)}).sort(Uu.ascending),e()):t},r.range=function(t){return arguments.length?(n=t,e()):n},r.quantiles=function(){return i},r.copy=function(){return fe(t,n)},e()}function se(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 se(t,n,e)},i()}function he(t,n){function e(e){return n[Uu.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 he(t,n)},e}function ge(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 Kn(t,n)},n.tickFormat=function(n){return Wn(t,n)},n.copy=function(){return ge(t)},n}function pe(t){return t.innerRadius}function de(t){return t.outerRadius}function me(t){return t.startAngle}function ve(t){return t.endAngle}function ye(t){function n(n){function a(){l.push("M",u(t(s),o))}for(var c,l=[],s=[],h=-1,g=n.length,p=f(e),d=f(r);g>++h;)i.call(this,c=n[h],h)?s.push([+p.call(this,c,h),+d.call(this,c,h)]):s.length&&(a(),s=[]);return s.length&&a(),l.length?l.join(""):null}var e=Me,r=be,i=l,u=xe,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=Qa.get(t)||xe).key,n):a},n.tension=function(t){return arguments.length?(o=t,n):o},n}function Me(t){return t[0]}function be(t){return t[1]}function xe(t){return t.join("L")}function _e(t){return xe(t)+"Z"}function we(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 Se(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 ke(t,n){return 4>t.length?xe(t):t[1]+Ne(t.slice(1,t.length-1),Te(t,n))}function Ee(t,n){return 3>t.length?xe(t):t[0]+Ne((t.push(t[0]),t),Te([t[t.length-2]].concat(t,[t[1]]),n))}function Ae(t,n){return 3>t.length?xe(t):t[0]+Ne(t,Te(t,n))}function Ne(t,n){if(1>n.length||t.length!=n.length&&t.length!=n.length+2)return xe(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 Te(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 qe(t){if(3>t.length)return xe(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(je(c,a,o);e>++n;)r=t[n],a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),je(c,a,o);for(n=-1;2>++n;)a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),je(c,a,o);return c.join("")}function Ce(t){if(4>t.length)return xe(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(Le(eo,u)+","+Le(eo,a)),--r;i>++r;)n=t[r],u.shift(),u.push(n[0]),a.shift(),a.push(n[1]),je(e,u,a);return e.join("")}function ze(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=[Le(eo,a),",",Le(eo,o)],--r;u>++r;)e=t[r%i],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),je(n,a,o);return n.join("")}function De(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 qe(t)}function Le(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function je(t,n,e){t.push("C",Le(to,n),",",Le(to,e),",",Le(no,n),",",Le(no,e),",",Le(eo,n),",",Le(eo,e))}function Fe(t,n){return(n[1]-t[1])/(n[0]-t[0])}function He(t){for(var n=0,e=t.length-1,r=[],i=t[0],u=t[1],a=r[0]=Fe(i,u);e>++n;)r[n]=(a+(a=Fe(i=u,u=t[n+1])))/2;return r[n]=a,r}function Pe(t){for(var n,e,r,i,u=[],a=He(t),o=-1,c=t.length-1;c>++o;)n=Fe(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 Re(t){return 3>t.length?xe(t):t[0]+Ne(t,Pe(t))}function Oe(t){for(var n,e,r,i=-1,u=t.length;u>++i;)n=t[i],e=n[0],r=n[1]+Ka,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function Ye(t){function n(n){function c(){m.push("M",o(t(y),g),h,s(t(v.reverse()),g),"Z")}for(var l,p,d,m=[],v=[],y=[],M=-1,b=n.length,x=f(e),_=f(i),w=e===r?function(){return p}:f(r),S=i===u?function(){return d}:f(u);b>++M;)a.call(this,l=n[M],M)?(v.push([p=+x.call(this,l,M),d=+_.call(this,l,M)]),y.push([+w.call(this,l,M),+S.call(this,l,M)])):v.length&&(c(),v=[],y=[]);return v.length&&c(),m.length?m.join(""):null}var e=Me,r=Me,i=0,u=be,a=l,o=xe,c=o.key,s=o,h="L",g=.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=Qa.get(t)||xe).key,s=o.reverse||o,h=o.closed?"M":"L",n):c},n.tension=function(t){return arguments.length?(g=t,n):g},n}function Ue(t){return t.radius}function Ie(t){return[t.x,t.y]}function Ve(t){return function(){var n=t.apply(this,arguments),e=n[0],r=n[1]+Ka;return[e*Math.cos(r),e*Math.sin(r)]}}function Ze(){return 64}function Xe(){return"circle"}function Be(t){var n=Math.sqrt(t/Ou);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}function $e(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function Je(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}function Ge(t,n,e){if(r=[],e&&n.length>1){for(var r,i,u,a=Vn(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)++c;)u=a[c],null!=u&&(ir(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 ur(t){return t.x}function ar(t){return t.y}function or(t,n,e){t.y0=n,t.y=e}function cr(t){return Uu.range(t.length)}function lr(t){for(var n=-1,e=t[0].length,r=[];e>++n;)r[n]=0;return r}function fr(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 sr(t){return t.reduce(hr,0)}function hr(t,n){return t+n[1]}function gr(t,n){return pr(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function pr(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 dr(t){return[Uu.min(t),Uu.max(t)]}function mr(t,n){return Uu.rebind(t,n,"sort","children","value"),t.nodes=t,t.links=br,t}function vr(t){return t.children}function yr(t){return t.value}function Mr(t,n){return n.value-t.value}function br(t){return Uu.merge(t.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}function xr(t,n){return t.value-n.value}function _r(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function wr(t,n){t._pack_next=n,n._pack_prev=t}function Sr(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 kr(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(Er),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],Tr(r,i,u),n(u),_r(r,u),r._pack_prev=u,_r(u,i),i=r._pack_next,a=3;l>a;a++){Tr(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(Sr(o,u)){p=1;break}if(1==p)for(c=r._pack_prev;c!==o._pack_prev&&!Sr(c,u);c=c._pack_prev,m++);p?(m>d||d==m&&i.ra;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(Ar)}}function Er(t){t._pack_next=t._pack_prev=t}function Ar(t){delete t._pack_next,delete t._pack_prev}function Nr(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;)Nr(i[u],n,e,r)}function Tr(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 qr(t){return 1+Uu.max(t,function(t){return t.y})}function Cr(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 Dr(t){var n,e=t.children;return e&&(n=e.length)?Dr(e[n-1]):t}function Lr(t,n){return t.parent==n.parent?1:2}function jr(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function Fr(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function Hr(t,n){var e=t.children;if(e&&(i=e.length))for(var r,i,u=-1;i>++u;)n(r=Hr(e[u],n),t)>0&&(t=r);return t}function Pr(t,n){return t.x-n.x}function Rr(t,n){return n.x-t.x}function Or(t,n){return t.depth-n.depth}function Yr(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 Ur(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 Ir(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 Vr(t,n,e){return t._tree.ancestor.parent==n.parent?t._tree.ancestor:e}function Zr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Xr(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 Br(t,n){function e(t,e,u){3>arguments.length&&(u=e,e=null);var a=Uu.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 u(n){return n.map(a).join(t)}function a(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=RegExp('["'+t+"\n]"),c=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>=l)return a;if(i)return i=!1,u;var n=f;if(34===t.charCodeAt(n)){for(var e=n;l>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(;l>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!==c)continue;return t.substring(n,f-o)}return t.substring(n)}for(var r,i,u={},a={},o=[],l=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(t){return t.map(u).join("\n")},e}function $r(t,n){bo.hasOwnProperty(t.type)&&bo[t.type](t,n)}function Jr(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 Gr(t,n){var e=-1,r=t.length;for(n.polygonStart();r>++e;)Jr(t[e],n,1);n.polygonEnd()}function Kr(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Wr(t,n){return Yu>Math.abs(t[0]-n[0])&&Yu>Math.abs(t[1]-n[1])}function Qr(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 ti(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function ni(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 ei(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function ri(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function ii(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 ui(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=Qr([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),k=Yu>Math.abs(Math.abs(_)-1)?(u+s)/2:Math.atan2(x,b),E=t(k,S),A=E[0],N=E[1],T=A-n,q=N-i,C=y*T-v*q;(C*C/M>r||Math.abs((v*T+y*q)/M-.5)>.3)&&(e(n,i,u,a,o,c,A,N,k,b/=w,x/=w,_,d,m),m.point(A,N),e(A,N,k,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 ai(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 oi(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 ci(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=In}var r,i,u,a,o={point:n,lineStart:In,lineEnd:In,polygonStart:function(){o.lineEnd=e},polygonEnd:function(){o.point=n}};return function(n){return a=u=-(r=i=1/0),Uu.geo.stream(n,t(o)),[[r,i],[u,a]]}}function li(t,n){if(!wo){++So,t*=Iu;var e=Math.cos(n*=Iu);ko+=(e*Math.cos(t)-ko)/So,Eo+=(e*Math.sin(t)-Eo)/So,Ao+=(Math.sin(n)-Ao)/So}}function fi(){var t,n;wo=1,si(),wo=2;var e=No.point;No.point=function(r,i){e(t=r,n=i)},No.lineEnd=function(){No.point(t,n),hi(),No.lineEnd=hi}}function si(){function t(t,i){t*=Iu;var u=Math.cos(i*=Iu),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);So+=l,ko+=l*(n+(n=a)),Eo+=l*(e+(e=o)),Ao+=l*(r+(r=c))}var n,e,r;wo>1||(1>wo&&(wo=1,So=ko=Eo=Ao=0),No.point=function(i,u){i*=Iu;var a=Math.cos(u*=Iu);n=a*Math.cos(i),e=a*Math.sin(i),r=Math.sin(u),No.point=t})}function hi(){No.point=li}function gi(t,n){var e=Math.cos(t),r=Math.sin(t);return function(i,u,a,o){null!=i?(i=pi(e,i),u=pi(e,u),(a>0?u>i:i>u)&&(i+=2*a*Ou)):(i=t+2*a*Ou,u=t);for(var c,l=a*n,f=i;a>0?f>u:u>f;f-=l)o.point((c=Kr([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1]) -}}function pi(t,n){var r=Qr(n);r[0]-=t,ii(r);var i=e(-r[1]);return((0>-r[2]?-i:i)+2*Math.PI-Yu)%(2*Math.PI)}function di(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+=yi(d,-1),d=null,void 0;if(d=null,1&n){t=e[0],h+=yi(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(mi))}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=Uu.merge(s),s.length?Si(s,Mi,null,e,r):(-Yu>h||p&&-Yu>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=vi(),M=n(y);return v}}function mi(t){return t.length>1}function vi(){var t,n=[];return{lineStart:function(){n.push(t=[])},point:function(n,e){t.push([n,e])},lineEnd:In,buffer:function(){var e=n;return n=[],t=null,e},rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))}}}function yi(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,Yu>Math.abs(h-2)&&Yu>Math.abs(i-2)||(Yu>Math.abs(i)||Yu>Math.abs(h)||(Yu>Math.abs(Math.abs(r-s)-Ou)?i+h>2&&(a+=4*(r-s)):a+=Yu>Math.abs(h-2)?4*(r-g):((3*Ou+r-s)%(2*Ou)-Ou)*(h+i)),g=s,s=r,h=i);return a}function Mi(t,n){return(0>(t=t.point)[0]?t[1]-Ou/2-Yu:Ou/2-t[1])-(0>(n=n.point)[0]?n[1]-Ou/2-Yu:Ou/2-n[1])}function bi(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?Ou:-Ou,c=Math.abs(u-e);Yu>Math.abs(c-Ou)?(t.point(e,r=(r+a)/2>0?Ou/2:-Ou/2),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(u,r),n=0):i!==o&&c>=Ou&&(Yu>Math.abs(e-i)&&(e-=i*Yu),Yu>Math.abs(u-o)&&(u-=o*Yu),r=xi(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 xi(t,n,e,r){var i,u,a=Math.sin(t-e);return Math.abs(a)>Yu?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 _i(t,n,e,r){var i;if(null==t)i=e*Ou/2,r.point(-Ou,i),r.point(0,i),r.point(Ou,i),r.point(Ou,0),r.point(Ou,-i),r.point(0,-i),r.point(-Ou,-i),r.point(-Ou,0),r.point(-Ou,i);else if(Math.abs(t[0]-n[0])>Yu){var u=(t[0]u}function e(t){var e,i,u,a;return{lineStart:function(){u=i=!1,a=1},point:function(o,c){var l,f=[o,c],s=n(o,c);!e&&(u=i=s)&&t.lineStart(),s!==i&&(l=r(e,f),(Wr(e,l)||Wr(f,l))&&(f[0]+=Yu,f[1]+=Yu,s=n(f[0],f[1]))),s!==i&&(a=0,(i=s)?(t.lineStart(),l=r(f,e),t.point(l[0],l[1])):(l=r(e,f),t.point(l[0],l[1]),t.lineEnd()),e=l),!s||e&&Wr(e,f)||t.point(f[0],f[1]),e=f},lineEnd:function(){i&&t.lineEnd(),e=null},clean:function(){return a|(u&&i)<<1}}}function r(t,n){var e=Qr(t),r=Qr(n),i=[1,0,0],a=ni(e,r),o=ti(a,a),c=a[0],l=o-c*c;if(!l)return t;var f=u*o/l,s=-u*c/l,h=ni(i,a),g=ri(i,f),p=ri(a,s);ei(g,p);var d=h,m=ti(g,d),v=ti(d,d),y=Math.sqrt(m*m-v*(ti(g,g)-1)),M=ri(d,(-m-y)/v);return ei(M,g),Kr(M)}var i=t*Iu,u=Math.cos(i),a=gi(i,6*Iu);return di(n,e,a)}function Si(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(Wr(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),ki(u),ki(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 ki(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 Ei(t,n,e,r){function i(r,i){return Yu>Math.abs(r[0]-t)?i>0?0:3:Yu>Math.abs(r[0]-e)?i>0?2:1:Yu>Math.abs(r[1]-n)?i>0?1:0:i>0?3:2}function u(t,n){t=t.point,n=n.point;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 a(i,u){var a=u[0]-i[0],o=u[1]-i[1],c=[0,1];return Yu>Math.abs(a)&&Yu>Math.abs(o)?i[0]>=t&&e>=i[0]&&i[1]>=n&&r>=i[1]:Ai(t-i[0],a,c)&&Ai(i[0]-e,-a,c)&&Ai(n-i[1],o,c)&&Ai(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(o){function c(u){var a=i(u,-1),o=!l([0===a||3===a?t:e,a>1?r:n]);return o}function l(t){for(var n=0,e=y.length,r=t[1],i=0;e>i;++i)for(var u=1,a=y[i],o=a.length,c=a[0];o>u;++u)b=a[u],r>=c[1]?b[1]>r&&f(c,b,t)>0&&++n:r>=b[1]&&0>f(c,b,t)&&--n,c=b;return 0!==n}function f(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(n[1]-t[1])}function s(u,a,o,c){var l=i(u,o),f=i(a,o);if(l!==f){do c.point(0===l||3===l?t:e,l>1?r:n);while((l=(l+o+4)%4)!==f)}else c.point(a[0],a[1])}function h(i,u){return i>=t&&e>=i&&u>=n&&r>=u}function g(t,n){h(t,n)&&o.point(t,n)}function p(){q.point=m,y&&y.push(M=[]),A=!0,E=!1,S=k=0/0}function d(){v&&(m(x,_),w&&E&&T.rejoin(),v.push(T.buffer())),q.point=g,E&&o.lineEnd()}function m(t,n){var e=h(t,n);if(y&&M.push([t,n]),A)x=t,_=n,w=e,A=!1,e&&(o.lineStart(),o.point(t,n));else if(e&&E)o.point(t,n);else{var r=[S,k],i=[t,n];a(r,i)&&(E||(o.lineStart(),o.point(r[0],r[1])),o.point(i[0],i[1]),e||o.lineEnd())}S=t,k=n,E=e}var v,y,M,x,_,w,S,k,E,A,N=o,T=vi(),q={point:g,lineStart:p,lineEnd:d,polygonStart:function(){o=T,v=[],y=[]},polygonEnd:function(){o=N,v.length&&(o.polygonStart(),Si(Uu.merge(v),u,c,s,o),o.polygonEnd()),v=y=M=null}};return q}}function Ai(t,n,e){if(Yu>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 Ni(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 Ti(t,n){return[t,n]}function qi(t,n,e){var r=Uu.range(t,n-Yu,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function Ci(t,n,e){var r=Uu.range(t,n-Yu,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function zi(t){return(t=Math.sin(t/2))*t}function Di(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(zi(r-n)+i*a*zi(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)*Vu,Math.atan2(a,Math.sqrt(r*r+i*i))*Vu]}:function(){return[t*Vu,n*Vu]};return p.distance=h,p}function Li(t,n){return[t/(2*Ou),Math.max(-.5,Math.min(.5,Math.log(Math.tan(Ou/4+n/2))/(2*Ou)))]}function ji(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Fi(t){var n=ui(function(n,e){return t([n*Vu,e*Vu])});return function(t){return t=n(t),{point:function(n,e){t.point(n*Iu,e*Iu)},sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}}function Hi(){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=ji(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=ji(t),o},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return o}function Pi(t){function n(n,e){t.moveTo(n,e),t.arc(n,e,a,0,2*Ou)}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:In};return o}function Ri(){function t(t,n){Do+=i*t-r*n,r=t,i=n}var n,e,r,i;Lo.point=function(u,a){Lo.point=t,n=r=u,e=i=a},Lo.lineEnd=function(){t(n,e)}}function Oi(t,n){wo||(ko+=t,Eo+=n,++Ao)}function Yi(){function t(t,r){var i=t-n,u=r-e,a=Math.sqrt(i*i+u*u);ko+=a*(n+t)/2,Eo+=a*(e+r)/2,Ao+=a,n=t,e=r}var n,e;if(1!==wo){if(!(1>wo))return;wo=1,ko=Eo=Ao=0}jo.point=function(r,i){jo.point=t,n=r,e=i}}function Ui(){jo.point=Oi}function Ii(){function t(t,n){var e=i*t-r*n;ko+=e*(r+t),Eo+=e*(i+n),Ao+=3*e,r=t,i=n}var n,e,r,i;2>wo&&(wo=2,ko=Eo=Ao=0),jo.point=function(u,a){jo.point=t,n=r=u,e=i=a},jo.lineEnd=function(){t(n,e)}}function Vi(){function t(t,n){t*=Iu,n=n*Iu/2+Ou/4;var e=t-r,a=Math.cos(n),o=Math.sin(n),c=u*o,l=Ho,f=Po,s=i*a+c*Math.cos(e),h=c*Math.sin(e);Ho=l*s-f*h,Po=f*s+l*h,r=t,i=a,u=o}var n,e,r,i,u;Ro.point=function(a,o){Ro.point=t,r=(n=a)*Iu,i=Math.cos(o=(e=o)*Iu/2+Ou/4),u=Math.sin(o)},Ro.lineEnd=function(){t(n,e)}}function Zi(){function t(t,i){var u=Math.sin(i*=Iu),a=Math.cos(i),o=Math.abs((t*=Iu)-n),c=Math.cos(o);Oo+=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;Yo.point=function(i,u){n=i*Iu,e=Math.sin(u*=Iu),r=Math.cos(u),Yo.point=t},Yo.lineEnd=function(){Yo.point=Yo.lineEnd=In}}function Xi(t){return Bi(function(){return t})()}function Bi(t){function n(t){return t=a(t[0]*Iu,t[1]*Iu),[t[0]*s+o,l-t[1]*s]}function e(t){return t=a.invert((t[0]-o)/s,(l-t[1])/s),t&&[t[0]*Vu,t[1]*Vu]}function r(){a=Ni(u=Ji(m,v,y),i);var t=i(p,d);return o=h-t[0]*s,l=g+t[1]*s,n}var i,u,a,o,l,f=ui(function(t,n){return t=i(t,n),[t[0]*s+o,l-t[1]*s]}),s=150,h=480,g=250,p=0,d=0,m=0,v=0,y=0,M=To,b=c,x=null,_=null;return n.stream=function(t){return $i(u,M(f(b(t))))},n.clipAngle=function(t){return arguments.length?(M=null==t?(x=t,To):wi(x=+t),n):x},n.clipExtent=function(t){return arguments.length?(_=t,b=null==t?c:Ei(t[0][0],t[0][1],t[1][0],t[1][1]),n):_},n.scale=function(t){return arguments.length?(s=+t,r()):s},n.translate=function(t){return arguments.length?(h=+t[0],g=+t[1],r()):[h,g]},n.center=function(t){return arguments.length?(p=t[0]%360*Iu,d=t[1]%360*Iu,r()):[p*Vu,d*Vu]},n.rotate=function(t){return arguments.length?(m=t[0]%360*Iu,v=t[1]%360*Iu,y=t.length>2?t[2]%360*Iu:0,r()):[m*Vu,v*Vu,y*Vu]},Uu.rebind(n,f,"precision"),function(){return i=t.apply(this,arguments),n.invert=i.invert&&e,r()}}function $i(t,n){return{point:function(e,r){r=t(e*Iu,r*Iu),e=r[0],n.point(e>Ou?e-2*Ou:-Ou>e?e+2*Ou:e,r[1])},sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function Ji(t,n,e){return t?n||e?Ni(Ki(t),Wi(n,e)):Ki(t):n||e?Wi(n,e):Ti}function Gi(t){return function(n,e){return n+=t,[n>Ou?n-2*Ou:-Ou>n?n+2*Ou:n,e]}}function Ki(t){var n=Gi(t);return n.invert=Gi(-t),n}function Wi(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 Qi(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 tu(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 nu(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function eu(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 ru(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.yn.y?1:t.xn.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[Io[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=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)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[Io[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.yg.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,Io[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 iu(){return{leaf:!0,nodes:[],point:null}}function uu(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]&&uu(t,c[0],e,r,a,o),c[1]&&uu(t,c[1],a,r,i,o),c[2]&&uu(t,c[2],e,o,a,u),c[3]&&uu(t,c[3],a,o,i,u)}}function au(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function ou(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=cc[n.charAt(a++)],!u||0>(r=u(t,e,r)))return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function cu(t){return RegExp("^(?:"+t.map(Uu.requote).join("|")+")","i")}function lu(t){for(var n=new a,e=-1,r=t.length;r>++e;)n.set(t[e].toLowerCase(),e);return n}function fu(t,n,e){t+="";var r=t.length;return e>r?Array(e-r+1).join(n)+t:t}function su(t,n,e){nc.lastIndex=0;var r=nc.exec(n.substring(e));return r?e+=r[0].length:-1}function hu(t,n,e){tc.lastIndex=0;var r=tc.exec(n.substring(e));return r?e+=r[0].length:-1}function gu(t,n,e){ic.lastIndex=0;var r=ic.exec(n.substring(e));return r?(t.m=uc.get(r[0].toLowerCase()),e+=r[0].length):-1}function pu(t,n,e){ec.lastIndex=0;var r=ec.exec(n.substring(e));return r?(t.m=rc.get(r[0].toLowerCase()),e+=r[0].length):-1}function du(t,n,e){return ou(t,""+oc.c,n,e)}function mu(t,n,e){return ou(t,""+oc.x,n,e)}function vu(t,n,e){return ou(t,""+oc.X,n,e)}function yu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}function Mu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.y=bu(+r[0]),e+=r[0].length):-1}function bu(t){return t+(t>68?1900:2e3)}function xu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1}function _u(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function wu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}function Su(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1}function ku(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1}function Eu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1}function Au(t,n,e){var r=fc.get(n.substring(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)}function Nu(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+fu(r,"0",2)+fu(i,"0",2)}function Tu(t){return t.toISOString()}function qu(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 Vo(e-1)),1),e}function u(t,e){return n(t=new Vo(+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{Vo=au;var r=new au;return r._=t,a(r,n,e)}finally{Vo=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=u,t.range=a;var c=t.utc=Cu(t);return c.floor=c,c.round=Cu(r),c.ceil=Cu(i),c.offset=Cu(u),c.range=o,t}function Cu(t){return function(n,e){try{Vo=au;var r=new au;return r._=n,t(r,e)._}finally{Vo=Date}}}function zu(t,n,e){function r(n){return t(n)}return r.invert=function(n){return Lu(t.invert(n))},r.domain=function(n){return arguments.length?(t.domain(n),r):t.domain().map(Lu)},r.nice=function(t){return r.domain(Xn(r.domain(),function(){return t}))},r.ticks=function(e,i){var u=Du(r.domain());if("function"!=typeof e){var a=u[1]-u[0],o=a/e,c=Uu.bisect(hc,o);if(c==hc.length)return n.year(u,e);if(!c)return t.ticks(e).map(Lu);Math.log(o/hc[c-1])n?[n,e]:[e,n]}function Lu(t){return new Date(t)}function ju(t){return function(n){for(var e=t.length-1,r=t[e];!r[1](n);)r=t[--e];return r[0](n)}}function Fu(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function Hu(t){var n=t.getFullYear(),e=Fu(n),r=Fu(n+1);return n+(t-e)/(r-e)}function Pu(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function Ru(t){var n=t.getUTCFullYear(),e=Pu(n),r=Pu(n+1);return n+(t-e)/(r-e)}var Ou=Math.PI,Yu=1e-6,Uu={version:"3.0.8"},Iu=Ou/180,Vu=180/Ou,Zu=document,Xu=window,Bu=".",$u=",",Ju=[3,3];Date.now||(Date.now=function(){return+new Date});try{Zu.createElement("div").style.setProperty("opacity",0,"")}catch(Gu){var Ku=Xu.CSSStyleDeclaration.prototype,Wu=Ku.setProperty;Ku.setProperty=function(t,n,e){Wu.call(this,t,n+"",e)}}var Qu=u;try{Qu(Zu.documentElement.childNodes)[0].nodeType}catch(ta){Qu=i}var na=[].__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]};Uu.map=function(t){var n=new a;for(var e in t)n.set(e,t[e]);return n},r(a,{has:function(t){return ea+t in this},get:function(t){return this[ea+t]},set:function(t,n){return this[ea+t]=n},remove:function(t){return t=ea+t,t in this&&delete this[t]},keys:function(){var t=[];return this.forEach(function(n){t.push(n)}),t},values:function(){var t=[];return this.forEach(function(n,e){t.push(e)}),t},entries:function(){var t=[];return this.forEach(function(n,e){t.push({key:n,value:e})}),t},forEach:function(t){for(var n in this)n.charCodeAt(0)===ra&&t.call(this,n.substring(1),this[n])}});var ea="\0",ra=ea.charCodeAt(0);Uu.set=function(t){var n=new o;if(t)for(var e=0;t.length>e;e++)n.add(t[e]);return n},r(o,{has:function(t){return ea+t in this},add:function(t){return this[ea+t]=!0,t},remove:function(t){return t=ea+t,t in this&&delete this[t]},values:function(){var t=[];return this.forEach(function(n){t.push(n)}),t},forEach:function(t){for(var n in this)n.charCodeAt(0)===ra&&t.call(this,n.substring(1))}}),Uu.functor=f,Uu.rebind=function(t,n){for(var e,r=1,i=arguments.length;i>++r;)t[e=arguments[r]]=s(t,n,n[e]);return t},Uu.ascending=function(t,n){return n>t?-1:t>n?1:t>=n?0:0/0},Uu.descending=function(t,n){return t>n?-1:n>t?1:n>=t?0:0/0},Uu.mean=function(t,n){var e,r=t.length,i=0,u=-1,a=0;if(1===arguments.length)for(;r>++u;)h(e=t[u])&&(i+=(e-i)/++a);else for(;r>++u;)h(e=n.call(t,t[u],u))&&(i+=(e-i)/++a);return a?i:void 0},Uu.median=function(t,n){return arguments.length>1&&(t=t.map(n)),t=t.filter(h),t.length?Uu.quantile(t.sort(Uu.ascending),.5):void 0},Uu.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},Uu.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},Uu.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]},Uu.random={normal:function(t,n){var e=arguments.length;return 2>e&&(n=1),1>e&&(t=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Uu.random.normal.apply(Uu,arguments);return function(){return Math.exp(t())}},irwinHall:function(t){return function(){for(var n=0,e=0;t>e;e++)n+=Math.random();return n/t}}},Uu.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},Uu.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},Uu.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},Uu.transpose=function(t){return Uu.zip.apply(Uu,t)},Uu.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=Uu.min(arguments,g),e=Array(n);n>++t;)for(var r,i=-1,u=e[t]=Array(r);r>++i;)u[i]=arguments[i][t];return e},Uu.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 ia=Uu.bisector(function(t){return t});Uu.bisectLeft=ia.left,Uu.bisect=Uu.bisectRight=ia.right,Uu.nest=function(){function t(n,o,c){if(c>=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,g=-1,p=o.length,d=u[c++],m=new a;p>++g;)(h=m.get(l=d(f=o[g])))?h.push(f):m.set(l,[f]);return n?(f=n(),s=function(e,r){f.set(e,t(n,r,c))}):(f={},s=function(e,r){f[e]=t(n,r,c)}),m.forEach(s),f}function n(t,e){if(e>=u.length)return t;var r=[],i=o[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),i?r.sort(function(t,n){return i(t.key,n.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(n,e){return t(e,n,0)},i.entries=function(e){return n(t(Uu.map,e,0),0)},i.key=function(t){return u.push(t),i},i.sortKeys=function(t){return o[u.length-1]=t,i},i.sortValues=function(t){return e=t,i},i.rollup=function(t){return r=t,i},i},Uu.keys=function(t){var n=[];for(var e in t)n.push(e);return n},Uu.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},Uu.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},Uu.permute=function(t,n){for(var e=[],r=-1,i=n.length;i>++r;)e[r]=t[n[r]];return e},Uu.merge=function(t){return Array.prototype.concat.apply([],t)},Uu.range=function(t,n,e){if(3>arguments.length&&(e=1,2>arguments.length&&(n=t,t=0)),1/0===(n-t)/e)throw Error("infinite range");var r,i=[],u=d(Math.abs(e)),a=-1;if(t*=u,n*=u,e*=u,0>e)for(;(r=t+e*++a)>n;)i.push(r/u);else for(;n>(r=t+e*++a);)i.push(r/u);return i},Uu.requote=function(t){return t.replace(ua,"\\$&")};var ua=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;Uu.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)},Uu.xhr=function(t,n,e){function r(){var t=l.status;!t&&l.responseText||t>=200&&300>t||304===t?u.load.call(i,o.call(i,l)):u.error.call(i,l)}var i={},u=Uu.dispatch("progress","load","error"),a={},o=c,l=new(Xu.XDomainRequest&&/^(http(s)?:)?\/\//.test(t)?XDomainRequest:XMLHttpRequest);return"onload"in l?l.onload=l.onerror=r:l.onreadystatechange=function(){l.readyState>3&&r()},l.onprogress=function(t){var n=Uu.event;Uu.event=t;try{u.progress.call(i,l)}finally{Uu.event=n}},i.header=function(t,n){return t=(t+"").toLowerCase(),2>arguments.length?a[t]:(null==n?delete a[t]:a[t]=n+"",i)},i.mimeType=function(t){return arguments.length?(n=null==t?null:t+"",i):n},i.response=function(t){return o=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(Qu(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),l.open(e,t,!0),null==n||"accept"in a||(a.accept=n+",*/*"),l.setRequestHeader)for(var o in a)l.setRequestHeader(o,a[o]);return null!=n&&l.overrideMimeType&&l.overrideMimeType(n),null!=u&&i.on("error",u).on("load",function(t){u(null,t)}),l.send(null==r?null:r),i},i.abort=function(){return l.abort(),i},Uu.rebind(i,u,"on"),2===arguments.length&&"function"==typeof n&&(e=n,n=null),null==e?i:i.get(m(e))},Uu.text=function(){return Uu.xhr.apply(Uu,arguments).response(v)},Uu.json=function(t,n){return Uu.xhr(t,"application/json",n).response(y)},Uu.html=function(t,n){return Uu.xhr(t,"text/html",n).response(M)},Uu.xml=function(){return Uu.xhr.apply(Uu,arguments).response(x)};var aa={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/"};Uu.ns={prefix:aa,qualify:function(t){var n=t.indexOf(":"),e=t;return n>=0&&(e=t.substring(0,n),t=t.substring(n+1)),aa.hasOwnProperty(e)?{space:aa[e],local:t}:t}},Uu.dispatch=function(){for(var t=new _,n=-1,e=arguments.length;e>++n;)t[arguments[n]]=w(t);return t},_.prototype.on=function(t,n){var e=t.indexOf("."),r="";return e>0&&(r=t.substring(e+1),t=t.substring(0,e)),2>arguments.length?this[t].on(r):this[t].on(r,n)},Uu.format=function(t){var n=oa.exec(t),e=n[1]||" ",r=n[2]||">",i=n[3]||"",u=n[4]||"",a=n[5],o=+n[6],c=n[7],l=n[8],f=n[9],s=1,h="",g=!1;switch(l&&(l=+l.substring(1)),(a||"0"===e&&"="===r)&&(a=e="0",r="=",c&&(o-=Math.floor((o-1)/4))),f){case"n":c=!0,f="g";break;case"%":s=100,h="%",f="f";break;case"p":s=100,h="%",f="r";break;case"b":case"o":case"x":case"X":u&&(u="0"+f.toLowerCase());case"c":case"d":g=!0,l=0;break;case"s":s=-1,f="r"}"#"===u&&(u=""),"r"!=f||l||(f="g"),f=ca.get(f)||k;var p=a&&c;return function(t){if(g&&t%1)return"";var n=0>t||0===t&&0>1/t?(t=-t,"-"):i;if(0>s){var d=Uu.formatPrefix(t,l);t=d.scale(t),h=d.symbol}else t*=s;t=f(t,l),!a&&c&&(t=la(t));var m=u.length+t.length+(p?0:n.length),v=o>m?Array(m=o-m+1).join(e):"";return p&&(t=la(v+t)),Bu&&t.replace(".",Bu),n+=u,("<"===r?n+t+v:">"===r?v+n+t:"^"===r?v.substring(0,m>>=1)+n+t+v.substring(m):n+(p?t:v+t))+h}};var oa=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,ca=Uu.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return(t=Uu.round(t,S(t,n))).toFixed(Math.max(0,Math.min(20,S(t*(1+1e-15),n))))}}),la=c;if(Ju){var fa=Ju.length;la=function(t){for(var n=t.lastIndexOf("."),e=n>=0?"."+t.substring(n+1):(n=t.length,""),r=[],i=0,u=Ju[0];n>0&&u>0;)r.push(t.substring(n-=u,n+u)),u=Ju[i=(i+1)%fa];return r.reverse().join($u||"")+e}}var sa=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"].map(E);Uu.formatPrefix=function(t,n){var e=0;return t&&(0>t&&(t*=-1),n&&(t=Uu.round(t,S(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((0>=e?e+1:e-1)/3)))),sa[8+e/3]};var ha=function(){return c},ga=Uu.map({linear:ha,poly:D,quad:function(){return q},cubic:function(){return C},sin:function(){return L},exp:function(){return j},circle:function(){return F},elastic:H,back:P,bounce:function(){return R}}),pa=Uu.map({"in":c,out:N,"in-out":T,"out-in":function(t){return T(N(t))}});Uu.ease=function(t){var n=t.indexOf("-"),e=n>=0?t.substring(0,n):t,r=n>=0?t.substring(n+1):"in";return e=ga.get(e)||ha,r=pa.get(r)||c,A(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},Uu.event=null,Uu.transform=function(t){var n=Zu.createElementNS(Uu.ns.prefix.svg,"g");return(Uu.transform=function(t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate();return new I(e?e.matrix:da)})(t)},I.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var da={a:1,b:0,c:0,d:1,e:0,f:0};Uu.interpolate=function(t,n){for(var e,r=Uu.interpolators.length;--r>=0&&!(e=Uu.interpolators[r](t,n)););return e},Uu.interpolateNumber=function(t,n){return n-=t,function(e){return t+n*e}},Uu.interpolateRound=function(t,n){return n-=t,function(e){return Math.round(t+n*e)}},Uu.interpolateString=function(t,n){var e,r,i,u,a,o=0,c=0,l=[],f=[];for(ma.lastIndex=0,r=0;e=ma.exec(n);++r)e.index&&l.push(n.substring(o,c=e.index)),f.push({i:l.length,x:e[0]}),l.push(null),o=ma.lastIndex;for(n.length>o&&l.push(n.substring(o)),r=0,u=f.length;(e=ma.exec(t))&&u>r;++r)if(a=f[r],a.x==e[0]){if(a.i)if(null==l[a.i+1])for(l[a.i-1]+=a.x,l.splice(a.i,1),i=r+1;u>i;++i)f[i].i--; -else for(l[a.i-1]+=a.x+l[a.i+1],l.splice(a.i,2),i=r+1;u>i;++i)f[i].i-=2;else if(null==l[a.i+1])l[a.i]=a.x;else for(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1),i=r+1;u>i;++i)f[i].i--;f.splice(r,1),u--,r--}else a.x=Uu.interpolateNumber(parseFloat(e[0]),parseFloat(a.x));for(;u>r;)a=f.pop(),null==l[a.i+1]?l[a.i]=a.x:(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1)),u--;return 1===l.length?null==l[0]?f[0].x:function(){return n}:function(t){for(r=0;u>r;++r)l[(a=f[r]).i]=a.x(t);return l.join("")}},Uu.interpolateTransform=function(t,n){var e,r=[],i=[],u=Uu.transform(t),a=Uu.transform(n),o=u.translate,c=a.translate,l=u.rotate,f=a.rotate,s=u.skew,h=a.skew,g=u.scale,p=a.scale;return o[0]!=c[0]||o[1]!=c[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:Uu.interpolateNumber(o[0],c[0])},{i:3,x:Uu.interpolateNumber(o[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),l!=f?(l-f>180?f+=360:f-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:Uu.interpolateNumber(l,f)})):f&&r.push(r.pop()+"rotate("+f+")"),s!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:Uu.interpolateNumber(s,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:e-4,x:Uu.interpolateNumber(g[0],p[0])},{i:e-2,x:Uu.interpolateNumber(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=i.length,function(t){for(var n,u=-1;e>++u;)r[(n=i[u]).i]=n.x(t);return r.join("")}},Uu.interpolateRgb=function(t,n){t=Uu.rgb(t),n=Uu.rgb(n);var e=t.r,r=t.g,i=t.b,u=n.r-e,a=n.g-r,o=n.b-i;return function(t){return"#"+Q(Math.round(e+u*t))+Q(Math.round(r+a*t))+Q(Math.round(i+o*t))}},Uu.interpolateHsl=function(t,n){t=Uu.hsl(t),n=Uu.hsl(n);var e=t.h,r=t.s,i=t.l,u=n.h-e,a=n.s-r,o=n.l-i;return u>180?u-=360:-180>u&&(u+=360),function(t){return cn(e+u*t,r+a*t,i+o*t)+""}},Uu.interpolateLab=function(t,n){t=Uu.lab(t),n=Uu.lab(n);var e=t.l,r=t.a,i=t.b,u=n.l-e,a=n.a-r,o=n.b-i;return function(t){return pn(e+u*t,r+a*t,i+o*t)+""}},Uu.interpolateHcl=function(t,n){t=Uu.hcl(t),n=Uu.hcl(n);var e=t.h,r=t.c,i=t.l,u=n.h-e,a=n.c-r,o=n.l-i;return u>180?u-=360:-180>u&&(u+=360),function(t){return sn(e+u*t,r+a*t,i+o*t)+""}},Uu.interpolateArray=function(t,n){var e,r=[],i=[],u=t.length,a=n.length,o=Math.min(t.length,n.length);for(e=0;o>e;++e)r.push(Uu.interpolate(t[e],n[e]));for(;u>e;++e)i[e]=t[e];for(;a>e;++e)i[e]=n[e];return function(t){for(e=0;o>e;++e)i[e]=r[e](t);return i}},Uu.interpolateObject=function(t,n){var e,r={},i={};for(e in t)e in n?r[e]=B(e)(t[e],n[e]):i[e]=t[e];for(e in n)e in t||(i[e]=n[e]);return function(t){for(e in r)i[e]=r[e](t);return i}};var ma=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;Uu.interpolators=[Uu.interpolateObject,function(t,n){return n instanceof Array&&Uu.interpolateArray(t,n)},function(t,n){return("string"==typeof t||"string"==typeof n)&&Uu.interpolateString(t+"",n+"")},function(t,n){return("string"==typeof n?ya.has(n)||/^(#|rgb\(|hsl\()/.test(n):n instanceof G)&&Uu.interpolateRgb(t,n)},function(t,n){return!isNaN(t=+t)&&!isNaN(n=+n)&&Uu.interpolateNumber(t,n)}],G.prototype.toString=function(){return this.rgb()+""},Uu.rgb=function(t,n,e){return 1===arguments.length?t instanceof W?K(t.r,t.g,t.b):tn(""+t,K,cn):K(~~t,~~n,~~e)};var va=W.prototype=new G;va.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var n=this.r,e=this.g,r=this.b,i=30;return n||e||r?(n&&i>n&&(n=i),e&&i>e&&(e=i),r&&i>r&&(r=i),K(Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(r/t)))):K(i,i,i)},va.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),K(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},va.hsl=function(){return nn(this.r,this.g,this.b)},va.toString=function(){return"#"+Q(this.r)+Q(this.g)+Q(this.b)};var ya=Uu.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});ya.forEach(function(t,n){ya.set(t,tn(n,K,cn))}),Uu.hsl=function(t,n,e){return 1===arguments.length?t instanceof on?an(t.h,t.s,t.l):tn(""+t,nn,an):an(+t,+n,+e)};var Ma=on.prototype=new G;Ma.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),an(this.h,this.s,this.l/t)},Ma.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),an(this.h,this.s,t*this.l)},Ma.rgb=function(){return cn(this.h,this.s,this.l)},Uu.hcl=function(t,n,e){return 1===arguments.length?t instanceof fn?ln(t.h,t.c,t.l):t instanceof gn?dn(t.l,t.a,t.b):dn((t=en((t=Uu.rgb(t)).r,t.g,t.b)).l,t.a,t.b):ln(+t,+n,+e)};var ba=fn.prototype=new G;ba.brighter=function(t){return ln(this.h,this.c,Math.min(100,this.l+xa*(arguments.length?t:1)))},ba.darker=function(t){return ln(this.h,this.c,Math.max(0,this.l-xa*(arguments.length?t:1)))},ba.rgb=function(){return sn(this.h,this.c,this.l).rgb()},Uu.lab=function(t,n,e){return 1===arguments.length?t instanceof gn?hn(t.l,t.a,t.b):t instanceof fn?sn(t.l,t.c,t.h):en((t=Uu.rgb(t)).r,t.g,t.b):hn(+t,+n,+e)};var xa=18,_a=.95047,wa=1,Sa=1.08883,ka=gn.prototype=new G;ka.brighter=function(t){return hn(Math.min(100,this.l+xa*(arguments.length?t:1)),this.a,this.b)},ka.darker=function(t){return hn(Math.max(0,this.l-xa*(arguments.length?t:1)),this.a,this.b)},ka.rgb=function(){return pn(this.l,this.a,this.b)};var Ea=function(t,n){return n.querySelector(t)},Aa=function(t,n){return n.querySelectorAll(t)},Na=Zu.documentElement,Ta=Na.matchesSelector||Na.webkitMatchesSelector||Na.mozMatchesSelector||Na.msMatchesSelector||Na.oMatchesSelector,qa=function(t,n){return Ta.call(t,n)};"function"==typeof Sizzle&&(Ea=function(t,n){return Sizzle(t,n)[0]||null},Aa=function(t,n){return Sizzle.uniqueSort(Sizzle(t,n))},qa=Sizzle.matchesSelector);var Ca=[];Uu.selection=function(){return Da},Uu.selection.prototype=Ca,Ca.select=function(t){var n,e,r,i,u=[];"function"!=typeof t&&(t=bn(t));for(var a=-1,o=this.length;o>++a;){u.push(n=[]),n.parentNode=(r=this[a]).parentNode;for(var c=-1,l=r.length;l>++c;)(i=r[c])?(n.push(e=t.call(i,i.__data__,c)),e&&"__data__"in i&&(e.__data__=i.__data__)):n.push(null)}return Mn(u)},Ca.selectAll=function(t){var n,e,r=[];"function"!=typeof t&&(t=xn(t));for(var i=-1,u=this.length;u>++i;)for(var a=this[i],o=-1,c=a.length;c>++o;)(e=a[o])&&(r.push(n=Qu(t.call(e,e.__data__,o))),n.parentNode=e);return Mn(r)},Ca.attr=function(t,n){if(2>arguments.length){if("string"==typeof t){var e=this.node();return t=Uu.ns.qualify(t),t.local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(_n(n,t[n]));return this}return this.each(_n(t,n))},Ca.classed=function(t,n){if(2>arguments.length){if("string"==typeof t){var e=this.node(),r=(t=t.trim().split(/^|\s+/g)).length,i=-1;if(n=e.classList){for(;r>++i;)if(!n.contains(t[i]))return!1}else for(n=e.className,null!=n.baseVal&&(n=n.baseVal);r>++i;)if(!wn(t[i]).test(n))return!1;return!0}for(n in t)this.each(Sn(n,t[n]));return this}return this.each(Sn(t,n))},Ca.style=function(t,n,e){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(n="");for(e in t)this.each(En(e,t[e],n));return this}if(2>r)return Xu.getComputedStyle(this.node(),null).getPropertyValue(t);e=""}return this.each(En(t,n,e))},Ca.property=function(t,n){if(2>arguments.length){if("string"==typeof t)return this.node()[t];for(n in t)this.each(An(n,t[n]));return this}return this.each(An(t,n))},Ca.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Ca.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Ca.append=function(t){function n(){return this.appendChild(Zu.createElementNS(this.namespaceURI,t))}function e(){return this.appendChild(Zu.createElementNS(t.space,t.local))}return t=Uu.ns.qualify(t),this.select(t.local?e:n)},Ca.insert=function(t,n){function e(e,r){return this.insertBefore(Zu.createElementNS(this.namespaceURI,t),n.call(this,e,r))}function r(e,r){return this.insertBefore(Zu.createElementNS(t.space,t.local),n.call(this,e,r))}return t=Uu.ns.qualify(t),"function"!=typeof n&&(n=bn(n)),this.select(t.local?r:e)},Ca.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},Ca.data=function(t,n){function e(t,e){var r,i,u,o=t.length,s=e.length,h=Math.min(o,s),g=Array(s),p=Array(s),d=Array(o);if(n){var m,v=new a,y=new a,M=[];for(r=-1;o>++r;)m=n.call(i=t[r],i.__data__,r),v.has(m)?d[r]=i:v.set(m,i),M.push(m);for(r=-1;s>++r;)m=n.call(e,u=e[r],r),(i=v.get(m))?(g[r]=i,i.__data__=u):y.has(m)||(p[r]=Nn(u)),y.set(m,u),v.remove(m);for(r=-1;o>++r;)v.has(M[r])&&(d[r]=t[r])}else{for(r=-1;h>++r;)i=t[r],u=e[r],i?(i.__data__=u,g[r]=i):p[r]=Nn(u);for(;s>r;++r)p[r]=Nn(e[r]);for(;o>r;++r)d[r]=t[r]}p.update=g,p.parentNode=g.parentNode=d.parentNode=t.parentNode,c.push(p),l.push(g),f.push(d)}var r,i,u=-1,o=this.length;if(!arguments.length){for(t=Array(o=(r=this[0]).length);o>++u;)(i=r[u])&&(t[u]=i.__data__);return t}var c=jn([]),l=Mn([]),f=Mn([]);if("function"==typeof t)for(;o>++u;)e(r=this[u],t.call(r,r.parentNode.__data__,u));else for(;o>++u;)e(r=this[u],t);return l.enter=function(){return c},l.exit=function(){return f},l},Ca.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Ca.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=Tn(t));for(var u=0,a=this.length;a>u;u++){i.push(n=[]),n.parentNode=(e=this[u]).parentNode;for(var o=0,c=e.length;c>o;o++)(r=e[o])&&t.call(r,r.__data__,o)&&n.push(r)}return Mn(i)},Ca.order=function(){for(var t=-1,n=this.length;n>++t;)for(var e,r=this[t],i=r.length-1,u=r[i];--i>=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Ca.sort=function(t){t=qn.apply(this,arguments);for(var n=-1,e=this.length;e>++n;)this[n].sort(t);return this.order()},Ca.on=function(t,n,e){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(n=!1);for(e in t)this.each(Cn(e,t[e],n));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;e=!1}return this.each(Cn(t,n,e))};var za=Uu.map({mouseenter:"mouseover",mouseleave:"mouseout"});za.forEach(function(t){"on"+t in document&&za.remove(t)}),Ca.each=function(t){return Ln(this,function(n,e,r){t.call(n,n.__data__,e,r)})},Ca.call=function(t){var n=Qu(arguments);return t.apply(n[0]=this,n),this},Ca.empty=function(){return!this.node()},Ca.node=function(){for(var t=0,n=this.length;n>t;t++)for(var e=this[t],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Ca.transition=function(){var t,n,e=ja||++Ha,r=[],i=Object.create(Pa);i.time=Date.now();for(var u=-1,a=this.length;a>++u;){r.push(t=[]);for(var o=this[u],c=-1,l=o.length;l>++c;)(n=o[c])&&Hn(n,c,e,i),t.push(n)}return Fn(r,e)};var Da=Mn([[Zu]]);Da[0].parentNode=Na,Uu.select=function(t){return"string"==typeof t?Da.select(t):Mn([[t]])},Uu.selectAll=function(t){return"string"==typeof t?Da.selectAll(t):Mn([Qu(t)])};var La=[];Uu.selection.enter=jn,Uu.selection.enter.prototype=La,La.append=Ca.append,La.insert=Ca.insert,La.empty=Ca.empty,La.node=Ca.node,La.select=function(t){for(var n,e,r,i,u,a=[],o=-1,c=this.length;c>++o;){r=(i=this[o]).update,a.push(n=[]),n.parentNode=i.parentNode;for(var l=-1,f=i.length;f>++l;)(u=i[l])?(n.push(r[l]=e=t.call(i.parentNode,u.__data__,l)),e.__data__=u.__data__):n.push(null)}return Mn(a)};var ja,Fa=[],Ha=0,Pa={ease:z,delay:0,duration:250};Fa.call=Ca.call,Fa.empty=Ca.empty,Fa.node=Ca.node,Uu.transition=function(t){return arguments.length?ja?t.transition():t:Da.transition()},Uu.transition.prototype=Fa,Fa.select=function(t){var n,e,r,i=this.id,u=[];"function"!=typeof t&&(t=bn(t));for(var a=-1,o=this.length;o>++a;){u.push(n=[]);for(var c=this[a],l=-1,f=c.length;f>++l;)(r=c[l])&&(e=t.call(r,r.__data__,l))?("__data__"in r&&(e.__data__=r.__data__),Hn(e,l,i,r.__transition__[i]),n.push(e)):n.push(null)}return Fn(u,i)},Fa.selectAll=function(t){var n,e,r,i,u,a=this.id,o=[];"function"!=typeof t&&(t=xn(t));for(var c=-1,l=this.length;l>++c;)for(var f=this[c],s=-1,h=f.length;h>++s;)if(r=f[s]){u=r.__transition__[a],e=t.call(r,r.__data__,s),o.push(n=[]);for(var g=-1,p=e.length;p>++g;)Hn(i=e[g],g,a,u),n.push(i)}return Fn(o,a)},Fa.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=Tn(t));for(var u=0,a=this.length;a>u;u++){i.push(n=[]);for(var e=this[u],o=0,c=e.length;c>o;o++)(r=e[o])&&t.call(r,r.__data__,o)&&n.push(r)}return Fn(i,this.id,this.time).ease(this.ease())},Fa.attr=function(t,n){function e(){this.removeAttribute(u)}function r(){this.removeAttributeNS(u.space,u.local)}if(2>arguments.length){for(n in t)this.attr(n,t[n]);return this}var i=B(t),u=Uu.ns.qualify(t);return Rn(this,"attr."+t,n,function(t){function n(){var n,e=this.getAttribute(u);return e!==t&&(n=i(e,t),function(t){this.setAttribute(u,n(t))})}function a(){var n,e=this.getAttributeNS(u.space,u.local);return e!==t&&(n=i(e,t),function(t){this.setAttributeNS(u.space,u.local,n(t))})}return null==t?u.local?r:e:(t+="",u.local?a:n)})},Fa.attrTween=function(t,n){function e(t,e){var r=n.call(this,t,e,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,e){var r=n.call(this,t,e,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=Uu.ns.qualify(t);return this.tween("attr."+t,i.local?r:e)},Fa.style=function(t,n,e){function r(){this.style.removeProperty(t)}var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(n="");for(e in t)this.style(e,t[e],n);return this}e=""}var u=B(t);return Rn(this,"style."+t,n,function(n){function i(){var r,i=Xu.getComputedStyle(this,null).getPropertyValue(t);return i!==n&&(r=u(i,n),function(n){this.style.setProperty(t,r(n),e)})}return null==n?r:(n+="",i)})},Fa.styleTween=function(t,n,e){return 3>arguments.length&&(e=""),this.tween("style."+t,function(r,i){var u=n.call(this,r,i,Xu.getComputedStyle(this,null).getPropertyValue(t));return u&&function(n){this.style.setProperty(t,u(n),e)}})},Fa.text=function(t){return Rn(this,"text",t,Pn)},Fa.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},Fa.ease=function(t){var n=this.id;return 1>arguments.length?this.node().__transition__[n].ease:("function"!=typeof t&&(t=Uu.ease.apply(Uu,arguments)),Ln(this,function(e){e.__transition__[n].ease=t}))},Fa.delay=function(t){var n=this.id;return Ln(this,"function"==typeof t?function(e,r,i){e.__transition__[n].delay=0|t.call(e,e.__data__,r,i)}:(t|=0,function(e){e.__transition__[n].delay=t}))},Fa.duration=function(t){var n=this.id;return Ln(this,"function"==typeof t?function(e,r,i){e.__transition__[n].duration=Math.max(1,0|t.call(e,e.__data__,r,i))}:(t=Math.max(1,0|t),function(e){e.__transition__[n].duration=t}))},Fa.each=function(t,n){var e=this.id;if(2>arguments.length){var r=Pa,i=ja;ja=e,Ln(this,function(n,r,i){Pa=n.__transition__[e],t.call(n,n.__data__,r,i)}),Pa=r,ja=i}else Ln(this,function(r){r.__transition__[e].event.on(t,n)});return this},Fa.transition=function(){for(var t,n,e,r,i=this.id,u=++Ha,a=[],o=0,c=this.length;c>o;o++){a.push(t=[]);for(var n=this[o],l=0,f=n.length;f>l;l++)(e=n[l])&&(r=Object.create(e.__transition__[i]),r.delay+=r.duration,Hn(e,l,u,r)),t.push(e)}return Fn(a,u)},Fa.tween=function(t,n){var e=this.id;return 2>arguments.length?this.node().__transition__[e].tween.get(t):Ln(this,null==n?function(n){n.__transition__[e].tween.remove(t)}:function(r){r.__transition__[e].tween.set(t,n)})};var Ra,Oa,Ya=0,Ua={},Ia=null;Uu.timer=function(t,n,e){if(3>arguments.length){if(2>arguments.length)n=0;else if(!isFinite(n))return;e=Date.now()}var r=Ua[t.id];r&&r.callback===t?(r.then=e,r.delay=n):Ua[t.id=++Ya]=Ia={callback:t,then:e,delay:n,next:Ia},Ra||(Oa=clearTimeout(Oa),Ra=1,Va(On))},Uu.timer.flush=function(){for(var t,n=Date.now(),e=Ia;e;)t=n-e.then,e.delay||(e.flush=e.callback(t)),e=e.next;Yn()};var Va=Xu.requestAnimationFrame||Xu.webkitRequestAnimationFrame||Xu.mozRequestAnimationFrame||Xu.oRequestAnimationFrame||Xu.msRequestAnimationFrame||function(t){setTimeout(t,17)};Uu.mouse=function(t){return Un(t,Y())};var Za=/WebKit/.test(Xu.navigator.userAgent)?-1:0;Uu.touches=function(t,n){return 2>arguments.length&&(n=Y().touches),n?Qu(n).map(function(n){var e=Un(t,n);return e.identifier=n.identifier,e}):[]},Uu.scale={},Uu.scale.linear=function(){return Bn([0,1],[0,1],Uu.interpolate,!1)},Uu.scale.log=function(){return ne(Uu.scale.linear().domain([0,Math.LN10]),10,ee,re)};var Xa=Uu.format(".0e");Uu.scale.pow=function(){return oe(Uu.scale.linear(),1)},Uu.scale.sqrt=function(){return Uu.scale.pow().exponent(.5)},Uu.scale.ordinal=function(){return le([],{t:"range",a:[[]]})},Uu.scale.category10=function(){return Uu.scale.ordinal().range(Ba)},Uu.scale.category20=function(){return Uu.scale.ordinal().range($a)},Uu.scale.category20b=function(){return Uu.scale.ordinal().range(Ja)},Uu.scale.category20c=function(){return Uu.scale.ordinal().range(Ga)};var Ba=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],$a=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Ja=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Ga=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];Uu.scale.quantile=function(){return fe([],[])},Uu.scale.quantize=function(){return se(0,1,[0,1])},Uu.scale.threshold=function(){return he([.5],[0,1])},Uu.scale.identity=function(){return ge([0,1])},Uu.svg={},Uu.svg.arc=function(){function t(){var t=n.apply(this,arguments),u=e.apply(this,arguments),a=r.apply(this,arguments)+Ka,o=i.apply(this,arguments)+Ka,c=(a>o&&(c=a,a=o,o=c),o-a),l=Ou>c?"0":"1",f=Math.cos(a),s=Math.sin(a),h=Math.cos(o),g=Math.sin(o);return c>=Wa?t?"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"Z":t?"M"+u*f+","+u*s+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*g+"L"+t*h+","+t*g+"A"+t+","+t+" 0 "+l+",0 "+t*f+","+t*s+"Z":"M"+u*f+","+u*s+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*g+"L0,0"+"Z"}var n=pe,e=de,r=me,i=ve;return t.innerRadius=function(e){return arguments.length?(n=f(e),t):n},t.outerRadius=function(n){return arguments.length?(e=f(n),t):e},t.startAngle=function(n){return arguments.length?(r=f(n),t):r},t.endAngle=function(n){return arguments.length?(i=f(n),t):i},t.centroid=function(){var t=(n.apply(this,arguments)+e.apply(this,arguments))/2,u=(r.apply(this,arguments)+i.apply(this,arguments))/2+Ka;return[Math.cos(u)*t,Math.sin(u)*t]},t};var Ka=-Ou/2,Wa=2*Ou-1e-6;Uu.svg.line=function(){return ye(c)};var Qa=Uu.map({linear:xe,"linear-closed":_e,"step-before":we,"step-after":Se,basis:qe,"basis-open":Ce,"basis-closed":ze,bundle:De,cardinal:Ae,"cardinal-open":ke,"cardinal-closed":Ee,monotone:Re});Qa.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var to=[0,2/3,1/3,0],no=[0,1/3,2/3,0],eo=[0,1/6,2/3,1/6];Uu.svg.line.radial=function(){var t=ye(Oe);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},we.reverse=Se,Se.reverse=we,Uu.svg.area=function(){return Ye(c)},Uu.svg.area.radial=function(){var t=Ye(Oe);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},Uu.svg.chord=function(){function e(t,n){var e=r(this,o,t,n),l=r(this,c,t,n);return"M"+e.p0+u(e.r,e.p1,e.a1-e.a0)+(i(e,l)?a(e.r,e.p1,e.r,e.p0):a(e.r,e.p1,l.r,l.p0)+u(l.r,l.p1,l.a1-l.a0)+a(l.r,l.p1,e.r,e.p0))+"Z"}function r(t,n,e,r){var i=n.call(t,e,r),u=l.call(t,i,r),a=s.call(t,i,r)+Ka,o=h.call(t,i,r)+Ka;return{r:u,a0:a,a1:o,p0:[u*Math.cos(a),u*Math.sin(a)],p1:[u*Math.cos(o),u*Math.sin(o)]}}function i(t,n){return t.a0==n.a0&&t.a1==n.a1}function u(t,n,e){return"A"+t+","+t+" 0 "+ +(e>Ou)+",1 "+n}function a(t,n,e,r){return"Q 0,0 "+r}var o=n,c=t,l=Ue,s=me,h=ve;return e.radius=function(t){return arguments.length?(l=f(t),e):l},e.source=function(t){return arguments.length?(o=f(t),e):o},e.target=function(t){return arguments.length?(c=f(t),e):c},e.startAngle=function(t){return arguments.length?(s=f(t),e):s},e.endAngle=function(t){return arguments.length?(h=f(t),e):h},e},Uu.svg.diagonal=function(){function e(t,n){var e=r.call(this,t,n),a=i.call(this,t,n),o=(e.y+a.y)/2,c=[e,{x:e.x,y:o},{x:a.x,y:o},a];return c=c.map(u),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var r=n,i=t,u=Ie;return e.source=function(t){return arguments.length?(r=f(t),e):r},e.target=function(t){return arguments.length?(i=f(t),e):i},e.projection=function(t){return arguments.length?(u=t,e):u},e},Uu.svg.diagonal.radial=function(){var t=Uu.svg.diagonal(),n=Ie,e=t.projection;return t.projection=function(t){return arguments.length?e(Ve(n=t)):n},t},Uu.svg.symbol=function(){function t(t,r){return(ro.get(n.call(this,t,r))||Be)(e.call(this,t,r))}var n=Xe,e=Ze;return t.type=function(e){return arguments.length?(n=f(e),t):n},t.size=function(n){return arguments.length?(e=f(n),t):e},t};var ro=Uu.map({circle:Be,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*uo)),e=n*uo;return"M0,"+-n+"L"+e+",0"+" 0,"+n+" "+-e+",0"+"Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/io),e=n*io/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/io),e=n*io/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});Uu.svg.symbolTypes=ro.keys();var io=Math.sqrt(3),uo=Math.tan(30*Iu);Uu.svg.axis=function(){function t(t){t.each(function(){var t,s=Uu.select(this),h=null==l?e.ticks?e.ticks.apply(e,c):e.domain():l,g=null==n?e.tickFormat?e.tickFormat.apply(e,c):String:n,p=Ge(e,h,f),d=s.selectAll(".tick.minor").data(p,String),m=d.enter().insert("line",".tick").attr("class","tick minor").style("opacity",1e-6),v=Uu.transition(d.exit()).style("opacity",1e-6).remove(),y=Uu.transition(d).style("opacity",1),M=s.selectAll(".tick.major").data(h,String),b=M.enter().insert("g","path").attr("class","tick major").style("opacity",1e-6),x=Uu.transition(M.exit()).style("opacity",1e-6).remove(),_=Uu.transition(M).style("opacity",1),w=Zn(e),S=s.selectAll(".domain").data([0]),k=(S.enter().append("path").attr("class","domain"),Uu.transition(S)),E=e.copy(),A=this.__chart__||E;this.__chart__=E,b.append("line"),b.append("text");var N=b.select("line"),T=_.select("line"),q=M.select("text").text(g),C=b.select("text"),z=_.select("text");switch(r){case"bottom":t=$e,m.attr("y2",u),y.attr("x2",0).attr("y2",u),N.attr("y2",i),C.attr("y",Math.max(i,0)+o),T.attr("x2",0).attr("y2",i),z.attr("x",0).attr("y",Math.max(i,0)+o),q.attr("dy",".71em").style("text-anchor","middle"),k.attr("d","M"+w[0]+","+a+"V0H"+w[1]+"V"+a);break;case"top":t=$e,m.attr("y2",-u),y.attr("x2",0).attr("y2",-u),N.attr("y2",-i),C.attr("y",-(Math.max(i,0)+o)),T.attr("x2",0).attr("y2",-i),z.attr("x",0).attr("y",-(Math.max(i,0)+o)),q.attr("dy","0em").style("text-anchor","middle"),k.attr("d","M"+w[0]+","+-a+"V0H"+w[1]+"V"+-a);break;case"left":t=Je,m.attr("x2",-u),y.attr("x2",-u).attr("y2",0),N.attr("x2",-i),C.attr("x",-(Math.max(i,0)+o)),T.attr("x2",-i).attr("y2",0),z.attr("x",-(Math.max(i,0)+o)).attr("y",0),q.attr("dy",".32em").style("text-anchor","end"),k.attr("d","M"+-a+","+w[0]+"H0V"+w[1]+"H"+-a);break;case"right":t=Je,m.attr("x2",u),y.attr("x2",u).attr("y2",0),N.attr("x2",i),C.attr("x",Math.max(i,0)+o),T.attr("x2",i).attr("y2",0),z.attr("x",Math.max(i,0)+o).attr("y",0),q.attr("dy",".32em").style("text-anchor","start"),k.attr("d","M"+a+","+w[0]+"H0V"+w[1]+"H"+a)}if(e.ticks)b.call(t,A),_.call(t,E),x.call(t,E),m.call(t,A),y.call(t,E),v.call(t,E);else{var D=E.rangeBand()/2,L=function(t){return E(t)+D};b.call(t,L),_.call(t,L)}})}var n,e=Uu.scale.linear(),r=ao,i=6,u=6,a=6,o=3,c=[10],l=null,f=0;return t.scale=function(n){return arguments.length?(e=n,t):e},t.orient=function(n){return arguments.length?(r=n in oo?n+"":ao,t):r},t.ticks=function(){return arguments.length?(c=arguments,t):c},t.tickValues=function(n){return arguments.length?(l=n,t):l},t.tickFormat=function(e){return arguments.length?(n=e,t):n},t.tickSize=function(n,e){if(!arguments.length)return i;var r=arguments.length-1;return i=+n,u=r>1?+e:i,a=r>0?+arguments[r]:i,t},t.tickPadding=function(n){return arguments.length?(o=+n,t):o},t.tickSubdivide=function(n){return arguments.length?(f=+n,t):f},t};var ao="bottom",oo={top:1,right:1,bottom:1,left:1};Uu.svg.brush=function(){function t(u){u.each(function(){var u,a=Uu.select(this),f=a.selectAll(".background").data([0]),s=a.selectAll(".extent").data([0]),h=a.selectAll(".resize").data(l,String);a.style("pointer-events","all").on("mousedown.brush",i).on("touchstart.brush",i),f.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),s.enter().append("rect").attr("class","extent").style("cursor","move"),h.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return co[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",t.empty()?"none":null),h.exit().remove(),o&&(u=Zn(o),f.attr("x",u[0]).attr("width",u[1]-u[0]),e(a)),c&&(u=Zn(c),f.attr("y",u[0]).attr("height",u[1]-u[0]),r(a)),n(a)})}function n(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)][0]+","+f[+/^s/.test(t)][1]+")"})}function e(t){t.select(".extent").attr("x",f[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1][0]-f[0][0])}function r(t){t.select(".extent").attr("y",f[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1][1]-f[0][1])}function i(){function i(){var t=Uu.event.changedTouches;return t?Uu.touches(v,t)[0]:Uu.mouse(v)}function l(){32==Uu.event.keyCode&&(S||(d=null,k[0]-=f[1][0],k[1]-=f[1][1],S=2),O())}function s(){32==Uu.event.keyCode&&2==S&&(k[0]+=f[1][0],k[1]+=f[1][1],S=0,O())}function h(){var t=i(),u=!1;m&&(t[0]+=m[0],t[1]+=m[1]),S||(Uu.event.altKey?(d||(d=[(f[0][0]+f[1][0])/2,(f[0][1]+f[1][1])/2]),k[0]=f[+(t[0]l?(i=r,r=l):i=l),f[0][e]!==r||f[1][e]!==i?(u=null,f[0][e]=r,f[1][e]=i,!0):void 0}function p(){h(),b.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),Uu.select("body").style("cursor",null),E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),M({type:"brushend"}),O()}var d,m,v=this,y=Uu.select(Uu.event.target),M=a.of(v,arguments),b=Uu.select(v),x=y.datum(),_=!/^(n|s)$/.test(x)&&o,w=!/^(e|w)$/.test(x)&&c,S=y.classed("extent"),k=i(),E=Uu.select(Xu).on("mousemove.brush",h).on("mouseup.brush",p).on("touchmove.brush",h).on("touchend.brush",p).on("keydown.brush",l).on("keyup.brush",s);if(S)k[0]=f[0][0]-k[0],k[1]=f[0][1]-k[1];else if(x){var A=+/w$/.test(x),N=+/^n/.test(x);m=[f[1-A][0]-k[0],f[1-N][1]-k[1]],k[0]=f[A][0],k[1]=f[N][1]}else Uu.event.altKey&&(d=k.slice());b.style("pointer-events","none").selectAll(".resize").style("display",null),Uu.select("body").style("cursor",y.style("cursor")),M({type:"brushstart"}),h(),O()}var u,a=U(t,"brushstart","brush","brushend"),o=null,c=null,l=lo[0],f=[[0,0],[0,0]];return t.x=function(n){return arguments.length?(o=n,l=lo[!o<<1|!c],t):o},t.y=function(n){return arguments.length?(c=n,l=lo[!o<<1|!c],t):c},t.extent=function(n){var e,r,i,a,l;return arguments.length?(u=[[0,0],[0,0]],o&&(e=n[0],r=n[1],c&&(e=e[0],r=r[0]),u[0][0]=e,u[1][0]=r,o.invert&&(e=o(e),r=o(r)),e>r&&(l=e,e=r,r=l),f[0][0]=0|e,f[1][0]=0|r),c&&(i=n[0],a=n[1],o&&(i=i[1],a=a[1]),u[0][1]=i,u[1][1]=a,c.invert&&(i=c(i),a=c(a)),i>a&&(l=i,i=a,a=l),f[0][1]=0|i,f[1][1]=0|a),t):(n=u||f,o&&(e=n[0][0],r=n[1][0],u||(e=f[0][0],r=f[1][0],o.invert&&(e=o.invert(e),r=o.invert(r)),e>r&&(l=e,e=r,r=l))),c&&(i=n[0][1],a=n[1][1],u||(i=f[0][1],a=f[1][1],c.invert&&(i=c.invert(i),a=c.invert(a)),i>a&&(l=i,i=a,a=l))),o&&c?[[e,i],[r,a]]:o?[e,r]:c&&[i,a])},t.clear=function(){return u=null,f[0][0]=f[0][1]=f[1][0]=f[1][1]=0,t},t.empty=function(){return o&&f[0][0]===f[1][0]||c&&f[0][1]===f[1][1]},Uu.rebind(t,a,"on")};var co={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},lo=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]]; -Uu.behavior={},Uu.behavior.drag=function(){function t(){this.on("mousedown.drag",n).on("touchstart.drag",n)}function n(){function t(){var t=o.parentNode;return null!=f?Uu.touches(t).filter(function(t){return t.identifier===f})[0]:Uu.mouse(t)}function n(){if(!o.parentNode)return i();var n=t(),e=n[0]-s[0],r=n[1]-s[1];h|=e|r,s=n,O(),c({type:"drag",x:n[0]+a[0],y:n[1]+a[1],dx:e,dy:r})}function i(){c({type:"dragend"}),h&&(O(),Uu.event.target===l&&g.on("click.drag",u,!0)),g.on(null!=f?"touchmove.drag-"+f:"mousemove.drag",null).on(null!=f?"touchend.drag-"+f:"mouseup.drag",null)}function u(){O(),g.on("click.drag",null)}var a,o=this,c=e.of(o,arguments),l=Uu.event.target,f=Uu.event.touches?Uu.event.changedTouches[0].identifier:null,s=t(),h=0,g=Uu.select(Xu).on(null!=f?"touchmove.drag-"+f:"mousemove.drag",n).on(null!=f?"touchend.drag-"+f:"mouseup.drag",i,!0);r?(a=r.apply(o,arguments),a=[a.x-s[0],a.y-s[1]]):a=[0,0],null==f&&O(),c({type:"dragstart"})}var e=U(t,"drag","dragstart","dragend"),r=null;return t.origin=function(n){return arguments.length?(r=n,t):r},Uu.rebind(t,e,"on")},Uu.behavior.zoom=function(){function t(){this.on("mousedown.zoom",o).on("mousemove.zoom",l).on(ho+".zoom",c).on("dblclick.zoom",f).on("touchstart.zoom",s).on("touchmove.zoom",h).on("touchend.zoom",s)}function n(t){return[(t[0]-b[0])/x,(t[1]-b[1])/x]}function e(t){return[t[0]*x+b[0],t[1]*x+b[1]]}function r(t){x=Math.max(_[0],Math.min(_[1],t))}function i(t,n){n=e(n),b[0]+=t[0]-n[0],b[1]+=t[1]-n[1]}function u(){m&&m.domain(d.range().map(function(t){return(t-b[0])/x}).map(d.invert)),y&&y.domain(v.range().map(function(t){return(t-b[1])/x}).map(v.invert))}function a(t){u(),Uu.event.preventDefault(),t({type:"zoom",scale:x,translate:b})}function o(){function t(){l=1,i(Uu.mouse(u),s),a(o)}function e(){l&&O(),f.on("mousemove.zoom",null).on("mouseup.zoom",null),l&&Uu.event.target===c&&f.on("click.zoom",r,!0)}function r(){O(),f.on("click.zoom",null)}var u=this,o=w.of(u,arguments),c=Uu.event.target,l=0,f=Uu.select(Xu).on("mousemove.zoom",t).on("mouseup.zoom",e),s=n(Uu.mouse(u));Xu.focus(),O()}function c(){g||(g=n(Uu.mouse(this))),r(Math.pow(2,.002*fo())*x),i(Uu.mouse(this),g),a(w.of(this,arguments))}function l(){g=null}function f(){var t=Uu.mouse(this),e=n(t),u=Math.log(x)/Math.LN2;r(Math.pow(2,Uu.event.shiftKey?Math.ceil(u)-1:Math.floor(u)+1)),i(t,e),a(w.of(this,arguments))}function s(){var t=Uu.touches(this),e=Date.now();if(p=x,g={},t.forEach(function(t){g[t.identifier]=n(t)}),O(),1===t.length){if(500>e-M){var u=t[0],o=n(t[0]);r(2*x),i(u,o),a(w.of(this,arguments))}M=e}}function h(){var t=Uu.touches(this),n=t[0],e=g[n.identifier];if(u=t[1]){var u,o=g[u.identifier];n=[(n[0]+u[0])/2,(n[1]+u[1])/2],e=[(e[0]+o[0])/2,(e[1]+o[1])/2],r(Uu.event.scale*p)}i(n,e),M=null,a(w.of(this,arguments))}var g,p,d,m,v,y,M,b=[0,0],x=1,_=so,w=U(t,"zoom");return t.translate=function(n){return arguments.length?(b=n.map(Number),u(),t):b},t.scale=function(n){return arguments.length?(x=+n,u(),t):x},t.scaleExtent=function(n){return arguments.length?(_=null==n?so:n.map(Number),t):_},t.x=function(n){return arguments.length?(m=n,d=n.copy(),b=[0,0],x=1,t):m},t.y=function(n){return arguments.length?(y=n,v=n.copy(),b=[0,0],x=1,t):y},Uu.rebind(t,w,"on")};var fo,so=[0,1/0],ho="onwheel"in document?(fo=function(){return-Uu.event.deltaY*(Uu.event.deltaMode?120:1)},"wheel"):"onmousewheel"in document?(fo=function(){return Uu.event.wheelDelta},"mousewheel"):(fo=function(){return-Uu.event.detail},"MozMousePixelScroll");Uu.layout={},Uu.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;r>++e;)n.push(Ke(t[e]));return n}},Uu.layout.chord=function(){function t(){var t,l,s,h,g,p={},d=[],m=Uu.range(u),v=[];for(e=[],r=[],t=0,h=-1;u>++h;){for(l=0,g=-1;u>++g;)l+=i[h][g];d.push(l),v.push(Uu.range(u)),t+=l}for(a&&m.sort(function(t,n){return a(d[t],d[n])}),o&&v.forEach(function(t,n){t.sort(function(t,e){return o(i[n][t],i[n][e])})}),t=(2*Ou-f*u)/t,l=0,h=-1;u>++h;){for(s=l,g=-1;u>++g;){var y=m[h],M=v[y][g],b=i[y][M],x=l,_=l+=b*t;p[y+"-"+M]={index:y,subindex:M,startAngle:x,endAngle:_,value:b}}r[y]={index:y,startAngle:s,endAngle:l,value:(l-s)/t},l+=f}for(h=-1;u>++h;)for(g=h-1;u>++g;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value(i-e)*o){var c=n.charge*o*o;return t.px-=u*c,t.py-=a*c,!0}if(n.point&&isFinite(o)){var c=n.pointCharge*o*o;t.px-=u*c,t.py-=a*c}}return!n.charge}}function n(t){t.px=Uu.event.x,t.py=Uu.event.y,o.resume()}var e,r,i,u,a,o={},l=Uu.dispatch("start","tick","end"),f=[1,1],s=.9,h=go,g=po,p=-30,d=.1,m=.8,v=[],y=[];return o.tick=function(){if(.005>(r*=.99))return l.end({type:"end",alpha:r=0}),!0;var n,e,o,c,h,g,m,M,b,x=v.length,_=y.length;for(e=0;_>e;++e)o=y[e],c=o.source,h=o.target,M=h.x-c.x,b=h.y-c.y,(g=M*M+b*b)&&(g=r*u[e]*((g=Math.sqrt(g))-i[e])/g,M*=g,b*=g,h.x-=M*(m=c.weight/(h.weight+c.weight)),h.y-=b*m,c.x+=M*(m=1-m),c.y+=b*m);if((m=r*d)&&(M=f[0]/2,b=f[1]/2,e=-1,m))for(;x>++e;)o=v[e],o.x+=(M-o.x)*m,o.y+=(b-o.y)*m;if(p)for(ir(n=Uu.geom.quadtree(v),r,a),e=-1;x>++e;)(o=v[e]).fixed||n.visit(t(o));for(e=-1;x>++e;)o=v[e],o.fixed?(o.x=o.px,o.y=o.py):(o.x-=(o.px-(o.px=o.x))*s,o.y-=(o.py-(o.py=o.y))*s);l.tick({type:"tick",alpha:r})},o.nodes=function(t){return arguments.length?(v=t,o):v},o.links=function(t){return arguments.length?(y=t,o):y},o.size=function(t){return arguments.length?(f=t,o):f},o.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,o):h},o.distance=o.linkDistance,o.linkStrength=function(t){return arguments.length?(g="function"==typeof t?t:+t,o):g},o.friction=function(t){return arguments.length?(s=+t,o):s},o.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,o):p},o.gravity=function(t){return arguments.length?(d=+t,o):d},o.theta=function(t){return arguments.length?(m=+t,o):m},o.alpha=function(t){return arguments.length?(t=+t,r?r=t>0?t:0:t>0&&(l.start({type:"start",alpha:r=t}),Uu.timer(o.tick)),o):r},o.start=function(){function t(t,r){for(var i,u=n(e),a=-1,o=u.length;o>++a;)if(!isNaN(i=u[a][t]))return i;return Math.random()*r}function n(){if(!c){for(c=[],r=0;s>r;++r)c[r]=[];for(r=0;d>r;++r){var t=y[r];c[t.source.index].push(t.target),c[t.target.index].push(t.source)}}return c[e]}var e,r,c,l,s=v.length,d=y.length,m=f[0],M=f[1];for(e=0;s>e;++e)(l=v[e]).index=e,l.weight=0;for(e=0;d>e;++e)l=y[e],"number"==typeof l.source&&(l.source=v[l.source]),"number"==typeof l.target&&(l.target=v[l.target]),++l.source.weight,++l.target.weight;for(e=0;s>e;++e)l=v[e],isNaN(l.x)&&(l.x=t("x",m)),isNaN(l.y)&&(l.y=t("y",M)),isNaN(l.px)&&(l.px=l.x),isNaN(l.py)&&(l.py=l.y);if(i=[],"function"==typeof h)for(e=0;d>e;++e)i[e]=+h.call(this,y[e],e);else for(e=0;d>e;++e)i[e]=h;if(u=[],"function"==typeof g)for(e=0;d>e;++e)u[e]=+g.call(this,y[e],e);else for(e=0;d>e;++e)u[e]=g;if(a=[],"function"==typeof p)for(e=0;s>e;++e)a[e]=+p.call(this,v[e],e);else for(e=0;s>e;++e)a[e]=p;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return e||(e=Uu.behavior.drag().origin(c).on("dragstart.force",tr).on("drag.force",n).on("dragend.force",nr)),arguments.length?(this.on("mouseover.force",er).on("mouseout.force",rr).call(e),void 0):e},Uu.rebind(o,l,"on")};var go=20,po=1;Uu.layout.partition=function(){function t(n,e,r,i){var u=n.children;if(n.x=e,n.y=n.depth*i,n.dx=r,n.dy=i,u&&(a=u.length)){var a,o,c,l=-1;for(r=n.value?r/n.value:0;a>++l;)t(o=u[l],e,c=o.value*r,i),e+=c}}function n(t){var e=t.children,r=0;if(e&&(i=e.length))for(var i,u=-1;i>++u;)r=Math.max(r,n(e[u]));return 1+r}function e(e,u){var a=r.call(this,e,u);return t(a[0],0,i[0],i[1]/n(a[0])),a}var r=Uu.layout.hierarchy(),i=[1,1];return e.size=function(t){return arguments.length?(i=t,e):i},mr(e,r)},Uu.layout.pie=function(){function t(u){var a=u.map(function(e,r){return+n.call(t,e,r)}),o=+("function"==typeof r?r.apply(this,arguments):r),c=(("function"==typeof i?i.apply(this,arguments):i)-r)/Uu.sum(a),l=Uu.range(u.length);null!=e&&l.sort(e===mo?function(t,n){return a[n]-a[t]}:function(t,n){return e(u[t],u[n])});var f=[];return l.forEach(function(t){var n;f[t]={data:u[t],value:n=a[t],startAngle:o,endAngle:o+=n*c}}),f}var n=Number,e=mo,r=0,i=2*Ou;return t.value=function(e){return arguments.length?(n=e,t):n},t.sort=function(n){return arguments.length?(e=n,t):e},t.startAngle=function(n){return arguments.length?(r=n,t):r},t.endAngle=function(n){return arguments.length?(i=n,t):i},t};var mo={};Uu.layout.stack=function(){function t(o,c){var l=o.map(function(e,r){return n.call(t,e,r)}),f=l.map(function(n){return n.map(function(n,e){return[u.call(t,n,e),a.call(t,n,e)]})}),s=e.call(t,f,c);l=Uu.permute(l,s),f=Uu.permute(f,s);var h,g,p,d=r.call(t,f,c),m=l.length,v=l[0].length;for(g=0;v>g;++g)for(i.call(t,l[0][g],p=d[g],f[0][g][1]),h=1;m>h;++h)i.call(t,l[h][g],p+=f[h-1][g][1],f[h][g][1]);return o}var n=c,e=cr,r=lr,i=or,u=ur,a=ar;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(n){return arguments.length?(e="function"==typeof n?n:vo.get(n)||cr,t):e},t.offset=function(n){return arguments.length?(r="function"==typeof n?n:yo.get(n)||lr,t):r},t.x=function(n){return arguments.length?(u=n,t):u},t.y=function(n){return arguments.length?(a=n,t):a},t.out=function(n){return arguments.length?(i=n,t):i},t};var vo=Uu.map({"inside-out":function(t){var n,e,r=t.length,i=t.map(fr),u=t.map(sr),a=Uu.range(r).sort(function(t,n){return i[t]-i[n]}),o=0,c=0,l=[],f=[];for(n=0;r>n;++n)e=a[n],c>o?(o+=u[e],l.push(e)):(c+=u[e],f.push(e));return f.reverse().concat(l)},reverse:function(t){return Uu.range(t.length).reverse()},"default":cr}),yo=Uu.map({silhouette:function(t){var n,e,r,i=t.length,u=t[0].length,a=[],o=0,c=[];for(e=0;u>e;++e){for(n=0,r=0;i>n;n++)r+=t[n][e][1];r>o&&(o=r),a.push(r)}for(e=0;u>e;++e)c[e]=(o-a[e])/2;return c},wiggle:function(t){var n,e,r,i,u,a,o,c,l,f=t.length,s=t[0],h=s.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(n=0,i=0;f>n;++n)i+=t[n][e][1];for(n=0,u=0,o=s[e][0]-s[e-1][0];f>n;++n){for(r=0,a=(t[n][e][1]-t[n][e-1][1])/(2*o);n>r;++r)a+=(t[r][e][1]-t[r][e-1][1])/o;u+=a*t[n][e][1]}g[e]=c-=i?u/i*o:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(t){var n,e,r,i=t.length,u=t[0].length,a=1/i,o=[];for(e=0;u>e;++e){for(n=0,r=0;i>n;n++)r+=t[n][e][1];if(r)for(n=0;i>n;n++)t[n][e][1]/=r;else for(n=0;i>n;n++)t[n][e][1]=a}for(e=0;u>e;++e)o[e]=0;return o},zero:lr});Uu.layout.histogram=function(){function t(t,u){for(var a,o,c=[],l=t.map(e,this),f=r.call(this,l,u),s=i.call(this,f,l,u),u=-1,h=l.length,g=s.length-1,p=n?1:1/h;g>++u;)a=c[u]=[],a.dx=s[u+1]-(a.x=s[u]),a.y=0;if(g>0)for(u=-1;h>++u;)o=l[u],o>=f[0]&&f[1]>=o&&(a=c[Uu.bisect(s,o,1,g)-1],a.y+=p,a.push(t[u]));return c}var n=!0,e=Number,r=dr,i=gr;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=f(n),t):r},t.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return pr(t,n)}:f(n),t):i},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},Uu.layout.hierarchy=function(){function t(n,a,o){var c=i.call(e,n,a);if(n.depth=a,o.push(n),c&&(l=c.length)){for(var l,f,s=-1,h=n.children=[],g=0,p=a+1;l>++s;)f=t(c[s],p,o),f.parent=n,h.push(f),g+=f.value;r&&h.sort(r),u&&(n.value=g)}else u&&(n.value=+u.call(e,n,a)||0);return n}function n(t,r){var i=t.children,a=0;if(i&&(o=i.length))for(var o,c=-1,l=r+1;o>++c;)a+=n(i[c],l);else u&&(a=+u.call(e,t,r)||0);return u&&(t.value=a),a}function e(n){var e=[];return t(n,0,e),e}var r=Mr,i=vr,u=yr;return e.sort=function(t){return arguments.length?(r=t,e):r},e.children=function(t){return arguments.length?(i=t,e):i},e.value=function(t){return arguments.length?(u=t,e):u},e.revalue=function(t){return n(t,0),t},e},Uu.layout.pack=function(){function t(t,i){var u=n.call(this,t,i),a=u[0];a.x=0,a.y=0,Yr(a,function(t){t.r=Math.sqrt(t.value)}),Yr(a,kr);var o=r[0],c=r[1],l=Math.max(2*a.r/o,2*a.r/c);if(e>0){var f=e*l/2;Yr(a,function(t){t.r+=f}),Yr(a,kr),Yr(a,function(t){t.r-=f}),l=Math.max(2*a.r/o,2*a.r/c)}return Nr(a,o/2,c/2,1/l),u}var n=Uu.layout.hierarchy().sort(xr),e=0,r=[1,1];return t.size=function(n){return arguments.length?(r=n,t):r},t.padding=function(n){return arguments.length?(e=+n,t):e},mr(t,n)},Uu.layout.cluster=function(){function t(t,i){var u,a=n.call(this,t,i),o=a[0],c=0;Yr(o,function(t){var n=t.children;n&&n.length?(t.x=Cr(n),t.y=qr(n)):(t.x=u?c+=e(t,u):0,t.y=0,u=t)});var l=zr(o),f=Dr(o),s=l.x-e(l,f)/2,h=f.x+e(f,l)/2;return Yr(o,function(t){t.x=(t.x-s)/(h-s)*r[0],t.y=(1-(o.y?t.y/o.y:1))*r[1]}),a}var n=Uu.layout.hierarchy().sort(null).value(null),e=Lr,r=[1,1];return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(r=n,t):r},mr(t,n)},Uu.layout.tree=function(){function t(t,i){function u(t,n){var r=t.children,i=t._tree;if(r&&(a=r.length)){for(var a,c,l,f=r[0],s=f,h=-1;a>++h;)l=r[h],u(l,c),s=o(l,c,s),c=l;Ur(t);var g=.5*(f._tree.prelim+l._tree.prelim);n?(i.prelim=n._tree.prelim+e(t,n),i.mod=i.prelim-g):i.prelim=g}else n&&(i.prelim=n._tree.prelim+e(t,n))}function a(t,n){t.x=t._tree.prelim+n;var e=t.children;if(e&&(r=e.length)){var r,i=-1;for(n+=t._tree.mod;r>++i;)a(e[i],n)}}function o(t,n,r){if(n){for(var i,u=t,a=t,o=n,c=t.parent.children[0],l=u._tree.mod,f=a._tree.mod,s=o._tree.mod,h=c._tree.mod;o=Fr(o),u=jr(u),o&&u;)c=jr(c),a=Fr(a),a._tree.ancestor=t,i=o._tree.prelim+s-u._tree.prelim-l+e(o,u),i>0&&(Ir(Vr(o,t,r),t,i),l+=i,f+=i),s+=o._tree.mod,l+=u._tree.mod,h+=c._tree.mod,f+=a._tree.mod;o&&!Fr(a)&&(a._tree.thread=o,a._tree.mod+=s-f),u&&!jr(c)&&(c._tree.thread=u,c._tree.mod+=l-h,r=t)}return r}var c=n.call(this,t,i),l=c[0];Yr(l,function(t,n){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:n?n._tree.number+1:0}}),u(l),a(l,-l._tree.prelim);var f=Hr(l,Rr),s=Hr(l,Pr),h=Hr(l,Or),g=f.x-e(f,s)/2,p=s.x+e(s,f)/2,d=h.depth||1;return Yr(l,function(t){t.x=(t.x-g)/(p-g)*r[0],t.y=t.depth/d*r[1],delete t._tree}),c}var n=Uu.layout.hierarchy().sort(null).value(null),e=Lr,r=[1,1];return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(r=n,t):r},mr(t,n)},Uu.layout.treemap=function(){function t(t,n){for(var e,r,i=-1,u=t.length;u>++i;)r=(e=t[i]).value*(0>n?0:n),e.area=isNaN(r)||0>=r?0:r}function n(e){var u=e.children;if(u&&u.length){var a,o,c,l=s(e),f=[],h=u.slice(),p=1/0,d="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(t(h,l.dx*l.dy/e.value),f.area=0;(c=h.length)>0;)f.push(a=h[c-1]),f.area+=a.area,"squarify"!==g||p>=(o=r(f,d))?(h.pop(),p=o):(f.area-=f.pop().area,i(f,d,l,!1),d=Math.min(l.dx,l.dy),f.length=f.area=0,p=1/0);f.length&&(i(f,d,l,!0),f.length=f.area=0),u.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var u,a=s(n),o=r.slice(),c=[];for(t(o,a.dx*a.dy/n.value),c.area=0;u=o.pop();)c.push(u),c.area+=u.area,null!=u.z&&(i(c,u.z?a.dx:a.dy,a,!o.length),c.length=c.area=0);r.forEach(e)}}function r(t,n){for(var e,r=t.area,i=0,u=1/0,a=-1,o=t.length;o>++a;)(e=t[a].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,n*=n,r?Math.max(n*i*p/r,r/(n*u*p)):1/0}function i(t,n,e,r){var i,u=-1,a=t.length,o=e.x,l=e.y,f=n?c(t.area/n):0;if(n==e.dx){for((r||f>e.dy)&&(f=e.dy);a>++u;)i=t[u],i.x=o,i.y=l,i.dy=f,o+=i.dx=Math.min(e.x+e.dx-o,f?c(i.area/f):0);i.z=!0,i.dx+=e.x+e.dx-o,e.y+=f,e.dy-=f}else{for((r||f>e.dx)&&(f=e.dx);a>++u;)i=t[u],i.x=o,i.y=l,i.dx=f,l+=i.dy=Math.min(e.y+e.dy-l,f?c(i.area/f):0);i.z=!1,i.dy+=e.y+e.dy-l,e.x+=f,e.dx-=f}}function u(r){var i=a||o(r),u=i[0];return u.x=0,u.y=0,u.dx=l[0],u.dy=l[1],a&&o.revalue(u),t([u],u.dx*u.dy/u.value),(a?e:n)(u),h&&(a=i),i}var a,o=Uu.layout.hierarchy(),c=Math.round,l=[1,1],f=null,s=Zr,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return u.size=function(t){return arguments.length?(l=t,u):l},u.padding=function(t){function n(n){var e=t.call(u,n,n.depth);return null==e?Zr(n):Xr(n,"number"==typeof e?[e,e,e,e]:e)}function e(n){return Xr(n,t)}if(!arguments.length)return f;var r;return s=null==(f=t)?Zr:"function"==(r=typeof t)?n:"number"===r?(t=[t,t,t,t],e):e,u},u.round=function(t){return arguments.length?(c=t?Math.round:Number,u):c!=Number},u.sticky=function(t){return arguments.length?(h=t,a=null,u):h},u.ratio=function(t){return arguments.length?(p=t,u):p},u.mode=function(t){return arguments.length?(g=t+"",u):g},mr(u,o)},Uu.layout.voronoi=function(){function t(t){var e,u,a,o=[],c=f(r),l=f(i),s=t.length;for(a=0;s>a;++a)o.push([+c.call(this,u=t[a],a),+l.call(this,u,a)]);for(e=Uu.geom.voronoi(o),a=0;s>a;++a)e[a].data=t[a];if(n)for(a=0;s>a;++a)n(e[a]);return e}var n,e=null,r=Me,i=be;return t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=n,t):i},t.size=function(r){if(!arguments.length)return e;if(null==r)n=null;else{var i=+r[0],u=+r[1];n=Uu.geom.polygon([[0,0],[0,u],[i,u],[i,0]]).clip}return t},t},Uu.csv=Br(",","text/csv"),Uu.tsv=Br(" ","text/tab-separated-values"),Uu.geo={},Uu.geo.stream=function(t,n){Mo.hasOwnProperty(t.type)?Mo[t.type](t,n):$r(t,n)};var Mo={Feature:function(t,n){$r(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;i>++r;)$r(e[r].geometry,n)}},bo={Sphere:function(t,n){n.sphere()},Point:function(t,n){var e=t.coordinates;n.point(e[0],e[1])},MultiPoint:function(t,n){for(var e,r=t.coordinates,i=-1,u=r.length;u>++i;)e=r[i],n.point(e[0],e[1])},LineString:function(t,n){Jr(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;i>++r;)Jr(e[r],n,0)},Polygon:function(t,n){Gr(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;i>++r;)Gr(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;i>++r;)$r(e[r],n)}};Uu.geo.distance=function(t,n){var e,r=(n[0]-t[0])*Iu,i=t[1]*Iu,u=n[1]*Iu,a=Math.sin(r),o=Math.cos(r),c=Math.sin(i),l=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*a)*e+(e=l*f-c*s*o)*e),c*f+l*s*o)},Uu.geo.albersUsa=function(){function t(t){return n(t)(t)}function n(t){var n=t[0],e=t[1];return e>50?a:-140>n?o:21>e?c:u}var e,r,i,u=Uu.geo.albers(),a=Uu.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),o=Uu.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),c=Uu.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);return t.invert=function(t){return e(t)||r(t)||i(t)||u.invert(t)},t.scale=function(n){return arguments.length?(u.scale(n),a.scale(.6*n),o.scale(n),c.scale(1.5*n),t.translate(u.translate())):u.scale()},t.translate=function(n){if(!arguments.length)return u.translate();var l=u.scale(),f=n[0],s=n[1];return u.translate(n),a.translate([f-.4*l,s+.17*l]),o.translate([f-.19*l,s+.2*l]),c.translate([f+.58*l,s+.43*l]),e=ai(a,[[-180,50],[-130,72]]),r=ai(o,[[-164,18],[-154,24]]),i=ai(c,[[-67.5,17.5],[-65,19]]),t},t.scale(u.scale())},(Uu.geo.albers=function(){var t=29.5*Iu,n=45.5*Iu,e=Bi(oi),r=e(t,n);return r.parallels=function(r){return arguments.length?e(t=r[0]*Iu,n=r[1]*Iu):[t*Vu,n*Vu]},r.rotate([98,0]).center([0,38]).scale(1e3)}).raw=oi;var xo=Qi(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Uu.geo.azimuthalEqualArea=function(){return Xi(xo)}).raw=xo;var _o=Qi(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},c);(Uu.geo.azimuthalEquidistant=function(){return Xi(_o)}).raw=_o,Uu.geo.bounds=ci(c),Uu.geo.centroid=function(t){wo=So=ko=Eo=Ao=0,Uu.geo.stream(t,No);var n;return So&&Math.abs(n=Math.sqrt(ko*ko+Eo*Eo+Ao*Ao))>Yu?[Math.atan2(Eo,ko)*Vu,Math.asin(Math.max(-1,Math.min(1,Ao/n)))*Vu]:void 0};var wo,So,ko,Eo,Ao,No={sphere:function(){2>wo&&(wo=2,So=ko=Eo=Ao=0)},point:li,lineStart:si,lineEnd:hi,polygonStart:function(){2>wo&&(wo=2,So=ko=Eo=Ao=0),No.lineStart=fi},polygonEnd:function(){No.lineStart=si}};Uu.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,n=Ji(-t[0]*Iu,-t[1]*Iu,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Vu,t[1]*=Vu}}),{type:"Polygon",coordinates:[i]}}var n,e,r=[0,0],i=6;return t.origin=function(n){return arguments.length?(r=n,t):r},t.angle=function(r){return arguments.length?(e=gi((n=+r)*Iu,i*Iu),t):n},t.precision=function(r){return arguments.length?(e=gi(n*Iu,(i=+r)*Iu),t):i},t.angle(90)};var To=di(l,bi,_i);(Uu.geo.equirectangular=function(){return Xi(Ti).scale(250/Ou)}).raw=Ti.invert=Ti;var qo=Qi(function(t){return 1/t},Math.atan);(Uu.geo.gnomonic=function(){return Xi(qo)}).raw=qo,Uu.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return Uu.range(Math.ceil(u/m)*m,i,m).map(h).concat(Uu.range(Math.ceil(l/v)*v,c,v).map(g)).concat(Uu.range(Math.ceil(r/p)*p,e,p).filter(function(t){return Math.abs(t%m)>Yu}).map(f)).concat(Uu.range(Math.ceil(o/d)*d,a,d).filter(function(t){return Math.abs(t%v)>Yu}).map(s))}var e,r,i,u,a,o,c,l,f,s,h,g,p=10,d=p,m=90,v=360,y=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(g(c).slice(1),h(i).reverse().slice(1),g(l).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.majorExtent(n).minorExtent(n):t.minorExtent()},t.majorExtent=function(n){return arguments.length?(u=+n[0][0],i=+n[1][0],l=+n[0][1],c=+n[1][1],u>i&&(n=u,u=i,i=n),l>c&&(n=l,l=c,c=n),t.precision(y)):[[u,l],[i,c]]},t.minorExtent=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],o=+n[0][1],a=+n[1][1],r>e&&(n=r,r=e,e=n),o>a&&(n=o,o=a,a=n),t.precision(y)):[[r,o],[e,a]]},t.step=function(n){return arguments.length?t.majorStep(n).minorStep(n):t.minorStep()},t.majorStep=function(n){return arguments.length?(m=+n[0],v=+n[1],t):[m,v]},t.minorStep=function(n){return arguments.length?(p=+n[0],d=+n[1],t):[p,d]},t.precision=function(n){return arguments.length?(y=+n,f=qi(o,a,90),s=Ci(r,e,y),h=qi(l,c,90),g=Ci(u,i,y),t):y},t.majorExtent([[-180,-90+Yu],[180,90-Yu]]).minorExtent([[-180,-80-Yu],[180,80+Yu]])},Uu.geo.interpolate=function(t,n){return Di(t[0]*Iu,t[1]*Iu,n[0]*Iu,n[1]*Iu)},Uu.geo.greatArc=function(){function e(){return{type:"LineString",coordinates:[r||u.apply(this,arguments),i||a.apply(this,arguments)]}}var r,i,u=n,a=t;return e.distance=function(){return Uu.geo.distance(r||u.apply(this,arguments),i||a.apply(this,arguments))},e.source=function(t){return arguments.length?(u=t,r="function"==typeof t?null:t,e):u},e.target=function(t){return arguments.length?(a=t,i="function"==typeof t?null:t,e):a},e.precision=function(){return arguments.length?e:0},e},Li.invert=function(t,n){return[2*Ou*t,2*Math.atan(Math.exp(2*Ou*n))-Ou/2]},(Uu.geo.mercator=function(){return Xi(Li).scale(500)}).raw=Li;var Co=Qi(function(){return 1},Math.asin);(Uu.geo.orthographic=function(){return Xi(Co)}).raw=Co,Uu.geo.path=function(){function t(t){return t&&Uu.geo.stream(t,r(i.pointRadius("function"==typeof u?+u.apply(this,arguments):u))),i.result()}var n,e,r,i,u=4.5;return t.area=function(t){return zo=0,Uu.geo.stream(t,r(Lo)),zo},t.centroid=function(t){return wo=ko=Eo=Ao=0,Uu.geo.stream(t,r(jo)),Ao?[ko/Ao,Eo/Ao]:void 0},t.bounds=function(t){return ci(r)(t)},t.projection=function(e){return arguments.length?(r=(n=e)?e.stream||Fi(e):c,t):n},t.context=function(n){return arguments.length?(i=null==(e=n)?new Hi:new Pi(n),t):e},t.pointRadius=function(n){return arguments.length?(u="function"==typeof n?n:+n,t):u},t.projection(Uu.geo.albersUsa()).context(null)};var zo,Do,Lo={point:In,lineStart:In,lineEnd:In,polygonStart:function(){Do=0,Lo.lineStart=Ri},polygonEnd:function(){Lo.lineStart=Lo.lineEnd=Lo.point=In,zo+=Math.abs(Do/2)}},jo={point:Oi,lineStart:Yi,lineEnd:Ui,polygonStart:function(){jo.lineStart=Ii},polygonEnd:function(){jo.point=Oi,jo.lineStart=Yi,jo.lineEnd=Ui}};Uu.geo.area=function(t){return Fo=0,Uu.geo.stream(t,Ro),Fo};var Fo,Ho,Po,Ro={sphere:function(){Fo+=4*Ou},point:In,lineStart:In,lineEnd:In,polygonStart:function(){Ho=1,Po=0,Ro.lineStart=Vi},polygonEnd:function(){var t=2*Math.atan2(Po,Ho);Fo+=0>t?4*Ou+t:t,Ro.lineStart=Ro.lineEnd=Ro.point=In}};Uu.geo.length=function(t){return Oo=0,Uu.geo.stream(t,Yo),Oo};var Oo,Yo={sphere:In,point:In,lineStart:Zi,lineEnd:In,polygonStart:In,polygonEnd:In};Uu.geo.projection=Xi,Uu.geo.projectionMutator=Bi,Uu.geo.rotation=function(t){return t=Ji(t[0]%360*Iu,t[1]*Iu,t.length>2?t[2]*Iu:0),function(n){return n=t(n[0]*Iu,n[1]*Iu),n[0]*=Vu,n[1]*=Vu,n}};var Uo=Qi(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Uu.geo.stereographic=function(){return Xi(Uo)}).raw=Uo,Uu.geom={},Uu.geom.hull=function(t){if(3>t.length)return[];var n,e,r,i,u,a,o,c,l,f,s=t.length,h=s-1,g=[],p=[],d=0;for(n=1;s>n;++n)t[n][1]n;++n)n!==d&&(i=t[n][1]-t[d][1],r=t[n][0]-t[d][0],g.push({angle:Math.atan2(i,r),index:n}));for(g.sort(function(t,n){return t.angle-n.angle}),l=g[0].angle,c=g[0].index,o=0,n=1;h>n;++n)e=g[n].index,l==g[n].angle?(r=t[c][0]-t[d][0],i=t[c][1]-t[d][1],u=t[e][0]-t[d][0],a=t[e][1]-t[d][1],r*r+i*i>=u*u+a*a?g[n].index=-1:(g[o].index=-1,l=g[n].angle,o=n,c=e)):(l=g[n].angle,o=n,c=e);for(p.push(d),n=0,e=0;2>n;++e)-1!==g[e].index&&(p.push(g[e].index),n++);for(f=p.length;h>e;++e)if(-1!==g[e].index){for(;!tu(p[f-2],p[f-1],g[e].index,t);)--f;p[f++]=g[e].index}var m=[];for(n=0;f>n;++n)m.push(t[p[n]]);return m},Uu.geom.polygon=function(t){return t.area=function(){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];e>++n;)r+=t[n-1][1]*t[n][0]-t[n-1][0]*t[n][1];return.5*r},t.centroid=function(n){var e,r,i=-1,u=t.length,a=0,o=0,c=t[u-1];for(arguments.length||(n=-1/(6*t.area()));u>++i;)e=c,c=t[i],r=e[0]*c[1]-c[0]*e[1],a+=(e[0]+c[0])*r,o+=(e[1]+c[1])*r;return[a*n,o*n]},t.clip=function(n){for(var e,r,i,u,a,o,c=-1,l=t.length,f=t[l-1];l>++c;){for(e=n.slice(),n.length=0,u=t[c],a=e[(i=e.length)-1],r=-1;i>++r;)o=e[r],nu(o,f,u)?(nu(a,f,u)||n.push(eu(a,o,f,u)),n.push(o)):nu(a,f,u)&&n.push(eu(a,o,f,u)),a=o;f=u}return n},t},Uu.geom.voronoi=function(t){var n=t.map(function(){return[]}),e=1e6;return ru(t,function(t){var r,i,u,a,o,c;1===t.a&&t.b>=0?(r=t.ep.r,i=t.ep.l):(r=t.ep.l,i=t.ep.r),1===t.a?(o=r?r.y:-e,u=t.c-t.b*o,c=i?i.y:e,a=t.c-t.b*c):(u=r?r.x:-e,o=t.c-t.a*u,a=i?i.x:e,c=t.c-t.a*a);var l=[u,o],f=[a,c];n[t.region.l.index].push(l,f),n[t.region.r.index].push(l,f)}),n=n.map(function(n,e){var r=t[e][0],i=t[e][1],u=n.map(function(t){return Math.atan2(t[0]-r,t[1]-i)}),a=Uu.range(n.length).sort(function(t,n){return u[t]-u[n]});return a.filter(function(t,n){return!n||u[t]-u[a[n-1]]>Yu}).map(function(t){return n[t]})}),n.forEach(function(n,r){var i=n.length;if(!i)return n.push([-e,-e],[-e,e],[e,e],[e,-e]);if(!(i>2)){var u=t[r],a=n[0],o=n[1],c=u[0],l=u[1],f=a[0],s=a[1],h=o[0],g=o[1],p=Math.abs(h-f),d=g-s;if(Yu>Math.abs(d)){var m=s>l?-e:e;n.push([-e,m],[e,m])}else if(Yu>p){var v=f>c?-e:e;n.push([v,-e],[v,e])}else{var m=(f-c)*(g-s)>(h-f)*(s-l)?e:-e,y=Math.abs(d)-p;Yu>Math.abs(y)?n.push([0>d?m:-m,m]):(y>0&&(m*=-1),n.push([-e,m],[e,m]))}}}),n};var Io={l:"r",r:"l"};Uu.geom.delaunay=function(t){var n=t.map(function(){return[]}),e=[];return ru(t,function(e){n[e.region.l.index].push(t[e.region.r.index])}),n.forEach(function(n,r){var i=t[r],u=i[0],a=i[1];n.forEach(function(t){t.angle=Math.atan2(t[0]-u,t[1]-a)}),n.sort(function(t,n){return t.angle-n.angle});for(var o=0,c=n.length-1;c>o;o++)e.push([i,n[o],n[o+1]])}),e},Uu.geom.quadtree=function(t,n,e,r,i){function u(t,n,e,r,i,u){if(!isNaN(n.x)&&!isNaN(n.y))if(t.leaf){var o=t.point;o?.01>Math.abs(o.x-n.x)+Math.abs(o.y-n.y)?a(t,n,e,r,i,u):(t.point=null,a(t,o,e,r,i,u),a(t,n,e,r,i,u)):t.point=n}else a(t,n,e,r,i,u)}function a(t,n,e,r,i,a){var o=.5*(e+i),c=.5*(r+a),l=n.x>=o,f=n.y>=c,s=(f<<1)+l;t.leaf=!1,t=t.nodes[s]||(t.nodes[s]=iu()),l?e=o:i=o,f?r=c:a=c,u(t,n,e,r,i,a)}var o,c=-1,l=t.length;if(5>arguments.length)if(3===arguments.length)i=e,r=n,e=n=0;else for(n=e=1/0,r=i=-1/0;l>++c;)o=t[c],n>o.x&&(n=o.x),e>o.y&&(e=o.y),o.x>r&&(r=o.x),o.y>i&&(i=o.y);var f=r-n,s=i-e;f>s?i=e+f:r=n+s;var h=iu();return h.add=function(t){u(h,t,n,e,r,i)},h.visit=function(t){uu(t,h,n,e,r,i)},t.forEach(h.add),h},Uu.time={};var Vo=Date,Zo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];au.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(){Xo.setUTCDate.apply(this._,arguments)},setDay:function(){Xo.setUTCDay.apply(this._,arguments)},setFullYear:function(){Xo.setUTCFullYear.apply(this._,arguments)},setHours:function(){Xo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Xo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Xo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Xo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Xo.setUTCSeconds.apply(this._,arguments)},setTime:function(){Xo.setTime.apply(this._,arguments)}};var Xo=Date.prototype,Bo="%a %b %e %X %Y",$o="%m/%d/%Y",Jo="%H:%M:%S",Go=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ko=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Wo=["January","February","March","April","May","June","July","August","September","October","November","December"],Qo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Uu.time.format=function(t){function n(n){for(var r,i,u,a=[],o=-1,c=0;e>++o;)37===t.charCodeAt(o)&&(a.push(t.substring(c,o)),null!=(i=ac[r=t.charAt(++o)])&&(r=t.charAt(++o)),(u=oc[r])&&(r=u(n,null==i?"e"===r?" ":"0":i)),a.push(r),c=o+1);return a.push(t.substring(c,o)),a.join("")}var e=t.length;return n.parse=function(n){var e={y:1900,m:0,d:1,H:0,M:0,S:0,L:0},r=ou(e,t,n,0);if(r!=n.length)return null;"p"in e&&(e.H=e.H%12+12*e.p);var i=new Vo;return i.setFullYear(e.y,e.m,e.d),i.setHours(e.H,e.M,e.S,e.L),i},n.toString=function(){return t},n};var tc=cu(Go),nc=cu(Ko),ec=cu(Wo),rc=lu(Wo),ic=cu(Qo),uc=lu(Qo),ac={"-":"",_:" ",0:"0"},oc={a:function(t){return Ko[t.getDay()]},A:function(t){return Go[t.getDay()]},b:function(t){return Qo[t.getMonth()]},B:function(t){return Wo[t.getMonth()]},c:Uu.time.format(Bo),d:function(t,n){return fu(t.getDate(),n,2)},e:function(t,n){return fu(t.getDate(),n,2)},H:function(t,n){return fu(t.getHours(),n,2)},I:function(t,n){return fu(t.getHours()%12||12,n,2)},j:function(t,n){return fu(1+Uu.time.dayOfYear(t),n,3)},L:function(t,n){return fu(t.getMilliseconds(),n,3)},m:function(t,n){return fu(t.getMonth()+1,n,2)},M:function(t,n){return fu(t.getMinutes(),n,2)},p:function(t){return t.getHours()>=12?"PM":"AM"},S:function(t,n){return fu(t.getSeconds(),n,2)},U:function(t,n){return fu(Uu.time.sundayOfYear(t),n,2)},w:function(t){return t.getDay()},W:function(t,n){return fu(Uu.time.mondayOfYear(t),n,2)},x:Uu.time.format($o),X:Uu.time.format(Jo),y:function(t,n){return fu(t.getFullYear()%100,n,2)},Y:function(t,n){return fu(t.getFullYear()%1e4,n,4)},Z:Nu,"%":function(){return"%"}},cc={a:su,A:hu,b:gu,B:pu,c:du,d:_u,e:_u,H:wu,I:wu,L:Eu,m:xu,M:Su,p:Au,S:ku,x:mu,X:vu,y:Mu,Y:yu},lc=/^\s*\d+/,fc=Uu.map({am:0,pm:1}); -Uu.time.format.utc=function(t){function n(t){try{Vo=au;var n=new Vo;return n._=t,e(n)}finally{Vo=Date}}var e=Uu.time.format(t);return n.parse=function(t){try{Vo=au;var n=e.parse(t);return n&&n._}finally{Vo=Date}},n.toString=e.toString,n};var sc=Uu.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");Uu.time.format.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Tu:sc,Tu.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},Tu.toString=sc.toString,Uu.time.second=qu(function(t){return new Vo(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),Uu.time.seconds=Uu.time.second.range,Uu.time.seconds.utc=Uu.time.second.utc.range,Uu.time.minute=qu(function(t){return new Vo(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),Uu.time.minutes=Uu.time.minute.range,Uu.time.minutes.utc=Uu.time.minute.utc.range,Uu.time.hour=qu(function(t){var n=t.getTimezoneOffset()/60;return new Vo(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),Uu.time.hours=Uu.time.hour.range,Uu.time.hours.utc=Uu.time.hour.utc.range,Uu.time.day=qu(function(t){var n=new Vo(1970,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),Uu.time.days=Uu.time.day.range,Uu.time.days.utc=Uu.time.day.utc.range,Uu.time.dayOfYear=function(t){var n=Uu.time.year(t);return Math.floor((t-n-6e4*(t.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)},Zo.forEach(function(t,n){t=t.toLowerCase(),n=7-n;var e=Uu.time[t]=qu(function(t){return(t=Uu.time.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var e=Uu.time.year(t).getDay();return Math.floor((Uu.time.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});Uu.time[t+"s"]=e.range,Uu.time[t+"s"].utc=e.utc.range,Uu.time[t+"OfYear"]=function(t){var e=Uu.time.year(t).getDay();return Math.floor((Uu.time.dayOfYear(t)+(e+n)%7)/7)}}),Uu.time.week=Uu.time.sunday,Uu.time.weeks=Uu.time.sunday.range,Uu.time.weeks.utc=Uu.time.sunday.utc.range,Uu.time.weekOfYear=Uu.time.sundayOfYear,Uu.time.month=qu(function(t){return t=Uu.time.day(t),t.setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),Uu.time.months=Uu.time.month.range,Uu.time.months.utc=Uu.time.month.utc.range,Uu.time.year=qu(function(t){return t=Uu.time.day(t),t.setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),Uu.time.years=Uu.time.year.range,Uu.time.years.utc=Uu.time.year.utc.range;var hc=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],gc=[[Uu.time.second,1],[Uu.time.second,5],[Uu.time.second,15],[Uu.time.second,30],[Uu.time.minute,1],[Uu.time.minute,5],[Uu.time.minute,15],[Uu.time.minute,30],[Uu.time.hour,1],[Uu.time.hour,3],[Uu.time.hour,6],[Uu.time.hour,12],[Uu.time.day,1],[Uu.time.day,2],[Uu.time.week,1],[Uu.time.month,1],[Uu.time.month,3],[Uu.time.year,1]],pc=[[Uu.time.format("%Y"),l],[Uu.time.format("%B"),function(t){return t.getMonth()}],[Uu.time.format("%b %d"),function(t){return 1!=t.getDate()}],[Uu.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[Uu.time.format("%I %p"),function(t){return t.getHours()}],[Uu.time.format("%I:%M"),function(t){return t.getMinutes()}],[Uu.time.format(":%S"),function(t){return t.getSeconds()}],[Uu.time.format(".%L"),function(t){return t.getMilliseconds()}]],dc=Uu.scale.linear(),mc=ju(pc);gc.year=function(t,n){return dc.domain(t.map(Hu)).ticks(n).map(Fu)},Uu.time.scale=function(){return zu(Uu.scale.linear(),gc,mc)};var vc=gc.map(function(t){return[t[0].utc,t[1]]}),yc=[[Uu.time.format.utc("%Y"),l],[Uu.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[Uu.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[Uu.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[Uu.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[Uu.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[Uu.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[Uu.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]],Mc=ju(yc);return vc.year=function(t,n){return dc.domain(t.map(Ru)).ticks(n).map(Pu)},Uu.time.scale.utc=function(){return zu(Uu.scale.linear(),vc,Mc)},Uu}(); \ No newline at end of file +d3=function(){function t(t){return t.target}function n(t){return t.source}function e(t){return Math.acos(Math.max(-1,Math.min(1,t)))}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(t){for(var n=-1,e=t.length,r=[];e>++n;)r.push(t[n]);return r}function u(t){return Array.prototype.slice.call(t)}function a(){}function o(){}function c(t){return t}function l(){return!0}function f(t){return"function"==typeof t?t:function(){return t}}function s(t,n,e){return function(){var r=e.apply(n,arguments);return r===n?t:r}}function h(t){return null!=t&&!isNaN(t)}function g(t){return t.length}function p(t){return t.trim().replace(/\s+/g," ")}function d(t){for(var n=1;t*n%1;)n*=10;return n}function m(t){return 1===t.length?function(n,e){t(null==n?e:null)}:t}function v(t){return t.responseText}function y(t){return JSON.parse(t.responseText)}function M(t){var n=Zu.createRange();return n.selectNode(Zu.body),n.createContextualFragment(t.responseText)}function x(t){return t.responseXML}function _(){}function w(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 a;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 S(t,n){return n-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function k(t){return t+""}function E(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 A(t){return function(n){return 0>=n?0:n>=1?1:t(n)}}function N(t){return function(n){return 1-t(1-n)}}function T(t){return function(n){return.5*(.5>n?t(2*n):2-t(2-2*n))}}function q(t){return t*t}function C(t){return t*t*t}function z(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 D(t){return function(n){return Math.pow(n,t)}}function j(t){return 1-Math.cos(t*Ou/2)}function L(t){return Math.pow(2,10*(t-1))}function F(t){return 1-Math.sqrt(1-t*t)}function H(t,n){var e;return 2>arguments.length&&(n=.45),arguments.length?e=n/(2*Ou)*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,10*-r)*Math.sin(2*(r-e)*Ou/n)}}function R(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function P(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 O(){Uu.event.stopPropagation(),Uu.event.preventDefault()}function Y(){for(var t,n=Uu.event;t=n.sourceEvent;)n=t;return n}function U(t){for(var n=new _,e=0,r=arguments.length;r>++e;)n[arguments[e]]=w(n);return n.of=function(e,r){return function(i){try{var u=i.sourceEvent=Uu.event;i.target=t,Uu.event=i,n[i.type].apply(e,r)}finally{Uu.event=u}}},n}function I(t){var n=[t.a,t.b],e=[t.c,t.d],r=Z(n),i=V(n,e),u=Z(X(e,n,-i))||0;n[0]*e[1]t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function tn(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(un(i[0]),un(i[1]),un(i[2]))}return(u=ya.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 nn(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,an(r,i,c)}function en(t,n,e){t=rn(t),n=rn(n),e=rn(e);var r=vn((.4124564*t+.3575761*n+.1804375*e)/_a),i=vn((.2126729*t+.7151522*n+.072175*e)/wa),u=vn((.0193339*t+.119192*n+.9503041*e)/Sa);return hn(116*i-16,500*(r-i),200*(i-u))}function rn(t){return.04045>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}function un(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}function an(t,n,e){return new on(t,n,e)}function on(t,n,e){this.h=t,this.s=n,this.l=e}function cn(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,K(i(t+120),i(t),i(t-120))}function ln(t,n,e){return new fn(t,n,e)}function fn(t,n,e){this.h=t,this.c=n,this.l=e}function sn(t,n,e){return hn(e,Math.cos(t*=Iu)*n,Math.sin(t)*n)}function hn(t,n,e){return new gn(t,n,e)}function gn(t,n,e){this.l=t,this.a=n,this.b=e}function pn(t,n,e){var r=(t+16)/116,i=r+n/500,u=r-e/200;return i=mn(i)*_a,r=mn(r)*wa,u=mn(u)*Sa,K(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function dn(t,n,e){return ln(180*(Math.atan2(e,n)/Ou),Math.sqrt(n*n+e*e),t)}function mn(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vn(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yn(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Mn(t){return na(t,Ca),t}function bn(t){return function(){return Ea(t,this)}}function xn(t){return function(){return Aa(t,this)}}function _n(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=Uu.ns.qualify(t),null==n?t.local?r:e:"function"==typeof n?t.local?o:a:t.local?u:i}function wn(t){return RegExp("(?:^|\\s+)"+Uu.requote(t)+"(?:\\s+|$)","g")}function Sn(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(kn);var i=t.length;return"function"==typeof n?r:e}function kn(t){var n=wn(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=p(a+" "+t),u?i.baseVal=a:e.className=a)):a&&(a=p(a.replace(n," ")),u?i.baseVal=a:e.className=a)}}function En(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 An(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 Nn(t){return{__data__:t}}function Tn(t){return function(){return qa(this,t)}}function qn(t){return arguments.length||(t=Uu.ascending),function(n,e){return!n-!e||t(n.__data__,e.__data__)}}function Cn(t,n,e){function r(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}function i(){var i=o(n,Qu(arguments));r.call(this),this.addEventListener(t,this[u]=i,i.$=e),i._=n}var u="__on"+t,a=t.indexOf("."),o=zn;a>0&&(t=t.substring(0,a));var c=za.get(t);return c&&(t=c,o=Dn),n?i:r}function zn(t,n){return function(e){var r=Uu.event;Uu.event=e,n[0]=this.__data__;try{t.apply(this,n)}finally{Uu.event=r}}}function Dn(t,n){var e=zn(t,n);return function(t){var n=this,r=t.relatedTarget;r&&(r===n||8&r.compareDocumentPosition(n))||e.call(n,t)}}function jn(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 Ln(t){return na(t,ja),t}function Fn(t,n){return na(t,Fa),t.id=n,t}function Hn(t,n,e,r){var i=t.__transition__||(t.__transition__={active:0,count:0}),u=i[e];if(!u){var o=r.time;return u=i[e]={tween:new a,event:Uu.dispatch("start","end"),time:o,ease:r.ease,delay:r.delay,duration:r.duration},++i.count,Uu.timer(function(r){function a(r){return i.active>e?l():(i.active=e,h.start.call(t,f,n),u.tween.forEach(function(e,r){(r=r.call(t,f,n))&&d.push(r)}),c(r)||Uu.timer(c,0,o),1)}function c(r){if(i.active!==e)return l();for(var u=(r-g)/p,a=s(u),o=d.length;o>0;)d[--o].call(t,a);return u>=1?(l(),h.end.call(t,f,n),1):void 0}function l(){return--i.count?delete i[e]:delete t.__transition__,1}var f=t.__data__,s=u.ease,h=u.event,g=u.delay,p=u.duration,d=[];return r>=g?a(r):Uu.timer(a,g,o),1},0,o),u}}function Rn(t){return null==t&&(t=""),function(){this.textContent=t}}function Pn(t,n,e,r){var i=t.id;return jn(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 On(){for(var t,n=Date.now(),e=Ia;e;)t=n-e.then,t>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=Yn()-n;r>24?(isFinite(r)&&(clearTimeout(Oa),Oa=setTimeout(On,r)),Pa=0):(Pa=1,Va(On))}function Yn(){for(var t=null,n=Ia,e=1/0;n;)n.flush?(delete Ua[n.callback.id],n=t?t.next=n.next:Ia=n.next):(e=Math.min(e,n.then+n.delay),n=(t=n).next);return e}function Un(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>Za&&(Xu.scrollX||Xu.scrollY)){e=Uu.select(Zu.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=e[0][0].getScreenCTM();Za=!(i.f||i.e),e.remove()}return Za?(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 In(){}function Vn(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function Zn(t){return t.rangeExtent?t.rangeExtent():Vn(t.range())}function Xn(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 Bn(t,n,e,r){function i(){var i=Math.min(t.length,n.length)>2?te:Qn,c=r?J:$;return a=i(t,n,c,e),o=i(n,t,c,Uu.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(Uu.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 Kn(t,n)},u.tickFormat=function(n){return Wn(t,n)},u.nice=function(){return Xn(t,Jn),i()},u.copy=function(){return Bn(t,n,e,r)},i()}function $n(t,n){return Uu.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Jn(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 Gn(t,n){var e=Vn(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 Kn(t,n){return Uu.range.apply(Uu,Gn(t,n))}function Wn(t,n){return Uu.format(",."+Math.max(0,-Math.floor(Math.log(Gn(t,n)[2])/Math.LN10+.01))+"f")}function Qn(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 te(t,n,e,r){var i=[],u=[],a=0,o=Math.min(t.length,n.length)-1;for(t[o]=++a;)i.push(e(t[a-1],t[a])),u.push(r(n[a-1],n[a]));return function(n){var e=Uu.bisect(t,n,1,o)-1;return u[e](i[e](n))}}function ne(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=ie,r=ue):(e=ee,r=re),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(Xn(t.domain(),ae(n))),i},i.ticks=function(){var i=Vn(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===ie)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=Xa),!arguments.length)return u;var a,o=Math.log(n),c=Math.max(.1,t/i.ticks().length),l=e===ie?(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 ne(t.copy(),n,e,r)},$n(i,t)}function ee(t){return Math.log(0>t?0:t)}function re(t){return Math.exp(t)}function ie(t){return-Math.log(t>0?0:-t)}function ue(t){return-Math.exp(-t)}function ae(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 oe(t,n){function e(n){return t(r(n))}var r=ce(n),i=ce(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 Kn(e.domain(),t)},e.tickFormat=function(t){return Wn(e.domain(),t)},e.nice=function(){return e.domain(Xn(e.domain(),Jn))},e.exponent=function(t){if(!arguments.length)return n;var u=e.domain();return r=ce(n=t),i=ce(1/n),e.domain(u)},e.copy=function(){return oe(t.copy(),n)},$n(e,t)}function ce(t){return function(n){return 0>n?-Math.pow(-n,t):Math.pow(n,t)}}function le(t,n){function e(n){return u[((i.get(n)||i.set(n,t.push(n)))-1)%u.length]}function r(n,e){return Uu.range(t.length).map(function(t){return n+e*t})}var i,u,o;return e.domain=function(r){if(!arguments.length)return t;t=[],i=new a;for(var u,o=-1,c=r.length;c>++o;)i.has(u=r[o])||i.set(u,t.push(u));return e[n.t].apply(e,n.a)},e.range=function(t){return arguments.length?(u=t,o=0,n={t:"range",a:arguments},e):u},e.rangePoints=function(i,a){2>arguments.length&&(a=0);var c=i[0],l=i[1],f=(l-c)/(Math.max(1,t.length-1)+a);return u=r(2>t.length?(c+l)/2:c+f*a/2,f),o=0,n={t:"rangePoints",a:arguments},e},e.rangeBands=function(i,a,c){2>arguments.length&&(a=0),3>arguments.length&&(c=a);var l=i[1]arguments.length&&(a=0),3>arguments.length&&(c=a);var l=i[1]++e;)i[e-1]=Uu.quantile(t,e/u);return r}function r(t){return isNaN(t=+t)?0/0:n[Uu.bisect(i,t)]}var i;return r.domain=function(n){return arguments.length?(t=n.filter(function(t){return!isNaN(t)}).sort(Uu.ascending),e()):t},r.range=function(t){return arguments.length?(n=t,e()):n},r.quantiles=function(){return i},r.copy=function(){return fe(t,n)},e()}function se(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 se(t,n,e)},i()}function he(t,n){function e(e){return n[Uu.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 he(t,n)},e}function ge(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 Kn(t,n)},n.tickFormat=function(n){return Wn(t,n)},n.copy=function(){return ge(t)},n}function pe(t){return t.innerRadius}function de(t){return t.outerRadius}function me(t){return t.startAngle}function ve(t){return t.endAngle}function ye(t){function n(n){function a(){l.push("M",u(t(s),o))}for(var c,l=[],s=[],h=-1,g=n.length,p=f(e),d=f(r);g>++h;)i.call(this,c=n[h],h)?s.push([+p.call(this,c,h),+d.call(this,c,h)]):s.length&&(a(),s=[]);return s.length&&a(),l.length?l.join(""):null}var e=Me,r=be,i=l,u=xe,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=Qa.get(t)||xe).key,n):a},n.tension=function(t){return arguments.length?(o=t,n):o},n}function Me(t){return t[0]}function be(t){return t[1]}function xe(t){return t.join("L")}function _e(t){return xe(t)+"Z"}function we(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 Se(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 ke(t,n){return 4>t.length?xe(t):t[1]+Ne(t.slice(1,t.length-1),Te(t,n))}function Ee(t,n){return 3>t.length?xe(t):t[0]+Ne((t.push(t[0]),t),Te([t[t.length-2]].concat(t,[t[1]]),n))}function Ae(t,n){return 3>t.length?xe(t):t[0]+Ne(t,Te(t,n))}function Ne(t,n){if(1>n.length||t.length!=n.length&&t.length!=n.length+2)return xe(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 Te(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 qe(t){if(3>t.length)return xe(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(Le(c,a,o);e>++n;)r=t[n],a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Le(c,a,o);for(n=-1;2>++n;)a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Le(c,a,o);return c.join("")}function Ce(t){if(4>t.length)return xe(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(je(eo,u)+","+je(eo,a)),--r;i>++r;)n=t[r],u.shift(),u.push(n[0]),a.shift(),a.push(n[1]),Le(e,u,a);return e.join("")}function ze(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=[je(eo,a),",",je(eo,o)],--r;u>++r;)e=t[r%i],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Le(n,a,o);return n.join("")}function De(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 qe(t)}function je(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function Le(t,n,e){t.push("C",je(to,n),",",je(to,e),",",je(no,n),",",je(no,e),",",je(eo,n),",",je(eo,e))}function Fe(t,n){return(n[1]-t[1])/(n[0]-t[0])}function He(t){for(var n=0,e=t.length-1,r=[],i=t[0],u=t[1],a=r[0]=Fe(i,u);e>++n;)r[n]=(a+(a=Fe(i=u,u=t[n+1])))/2;return r[n]=a,r}function Re(t){for(var n,e,r,i,u=[],a=He(t),o=-1,c=t.length-1;c>++o;)n=Fe(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 Pe(t){return 3>t.length?xe(t):t[0]+Ne(t,Re(t))}function Oe(t){for(var n,e,r,i=-1,u=t.length;u>++i;)n=t[i],e=n[0],r=n[1]+Ka,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function Ye(t){function n(n){function c(){m.push("M",o(t(y),g),h,s(t(v.reverse()),g),"Z")}for(var l,p,d,m=[],v=[],y=[],M=-1,b=n.length,x=f(e),_=f(i),w=e===r?function(){return p}:f(r),S=i===u?function(){return d}:f(u);b>++M;)a.call(this,l=n[M],M)?(v.push([p=+x.call(this,l,M),d=+_.call(this,l,M)]),y.push([+w.call(this,l,M),+S.call(this,l,M)])):v.length&&(c(),v=[],y=[]);return v.length&&c(),m.length?m.join(""):null}var e=Me,r=Me,i=0,u=be,a=l,o=xe,c=o.key,s=o,h="L",g=.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=Qa.get(t)||xe).key,s=o.reverse||o,h=o.closed?"M":"L",n):c},n.tension=function(t){return arguments.length?(g=t,n):g},n}function Ue(t){return t.radius}function Ie(t){return[t.x,t.y]}function Ve(t){return function(){var n=t.apply(this,arguments),e=n[0],r=n[1]+Ka;return[e*Math.cos(r),e*Math.sin(r)]}}function Ze(){return 64}function Xe(){return"circle"}function Be(t){var n=Math.sqrt(t/Ou);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}function $e(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function Je(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}function Ge(t,n,e){if(r=[],e&&n.length>1){for(var r,i,u,a=Vn(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)++c;)u=a[c],null!=u&&(ir(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 ur(t){return t.x}function ar(t){return t.y}function or(t,n,e){t.y0=n,t.y=e}function cr(t){return Uu.range(t.length)}function lr(t){for(var n=-1,e=t[0].length,r=[];e>++n;)r[n]=0;return r}function fr(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 sr(t){return t.reduce(hr,0)}function hr(t,n){return t+n[1]}function gr(t,n){return pr(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function pr(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 dr(t){return[Uu.min(t),Uu.max(t)]}function mr(t,n){return Uu.rebind(t,n,"sort","children","value"),t.nodes=t,t.links=br,t}function vr(t){return t.children}function yr(t){return t.value}function Mr(t,n){return n.value-t.value}function br(t){return Uu.merge(t.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}function xr(t,n){return t.value-n.value}function _r(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function wr(t,n){t._pack_next=n,n._pack_prev=t}function Sr(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 kr(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(Er),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],Tr(r,i,u),n(u),_r(r,u),r._pack_prev=u,_r(u,i),i=r._pack_next,a=3;l>a;a++){Tr(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(Sr(o,u)){p=1;break}if(1==p)for(c=r._pack_prev;c!==o._pack_prev&&!Sr(c,u);c=c._pack_prev,m++);p?(m>d||d==m&&i.ra;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(Ar)}}function Er(t){t._pack_next=t._pack_prev=t}function Ar(t){delete t._pack_next,delete t._pack_prev}function Nr(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;)Nr(i[u],n,e,r)}function Tr(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 qr(t){return 1+Uu.max(t,function(t){return t.y})}function Cr(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 Dr(t){var n,e=t.children;return e&&(n=e.length)?Dr(e[n-1]):t}function jr(t,n){return t.parent==n.parent?1:2}function Lr(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function Fr(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function Hr(t,n){var e=t.children;if(e&&(i=e.length))for(var r,i,u=-1;i>++u;)n(r=Hr(e[u],n),t)>0&&(t=r);return t}function Rr(t,n){return t.x-n.x}function Pr(t,n){return n.x-t.x}function Or(t,n){return t.depth-n.depth}function Yr(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 Ur(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 Ir(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 Vr(t,n,e){return t._tree.ancestor.parent==n.parent?t._tree.ancestor:e}function Zr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Xr(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 Br(t,n){function e(t,e,u){3>arguments.length&&(u=e,e=null);var a=Uu.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 u(n){return n.map(a).join(t)}function a(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 o,i=[];return n.forEach(function(t){for(var n in t)r.has(n)||i.push(r.add(n))}),[i].concat(n.map(function(n){return i.map(function(t){return a(n[t])}).join(t)})).join("\n")},e.formatRows=function(t){return t.map(u).join("\n")},e}function $r(t,n){bo.hasOwnProperty(t.type)&&bo[t.type](t,n)}function Jr(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 Gr(t,n){var e=-1,r=t.length;for(n.polygonStart();r>++e;)Jr(t[e],n,1);n.polygonEnd()}function Kr(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Wr(t,n){return Yu>Math.abs(t[0]-n[0])&&Yu>Math.abs(t[1]-n[1])}function Qr(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 ti(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function ni(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 ei(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function ri(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function ii(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 ui(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=Qr([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),k=Yu>Math.abs(Math.abs(_)-1)?(u+s)/2:Math.atan2(x,b),E=t(k,S),A=E[0],N=E[1],T=A-n,q=N-i,C=y*T-v*q;(C*C/M>r||Math.abs((v*T+y*q)/M-.5)>.3)&&(e(n,i,u,a,o,c,A,N,k,b/=w,x/=w,_,d,m),m.point(A,N),e(A,N,k,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 ai(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 oi(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 ci(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=In}var r,i,u,a,o={point:n,lineStart:In,lineEnd:In,polygonStart:function(){o.lineEnd=e},polygonEnd:function(){o.point=n}};return function(n){return a=u=-(r=i=1/0),Uu.geo.stream(n,t(o)),[[r,i],[u,a]]}}function li(t,n){if(!wo){++So,t*=Iu;var e=Math.cos(n*=Iu);ko+=(e*Math.cos(t)-ko)/So,Eo+=(e*Math.sin(t)-Eo)/So,Ao+=(Math.sin(n)-Ao)/So}}function fi(){var t,n;wo=1,si(),wo=2;var e=No.point;No.point=function(r,i){e(t=r,n=i)},No.lineEnd=function(){No.point(t,n),hi(),No.lineEnd=hi}}function si(){function t(t,i){t*=Iu;var u=Math.cos(i*=Iu),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);So+=l,ko+=l*(n+(n=a)),Eo+=l*(e+(e=o)),Ao+=l*(r+(r=c))}var n,e,r;wo>1||(1>wo&&(wo=1,So=ko=Eo=Ao=0),No.point=function(i,u){i*=Iu;var a=Math.cos(u*=Iu);n=a*Math.cos(i),e=a*Math.sin(i),r=Math.sin(u),No.point=t})}function hi(){No.point=li +}function gi(t,n){var e=Math.cos(t),r=Math.sin(t);return function(i,u,a,o){null!=i?(i=pi(e,i),u=pi(e,u),(a>0?u>i:i>u)&&(i+=2*a*Ou)):(i=t+2*a*Ou,u=t);for(var c,l=a*n,f=i;a>0?f>u:u>f;f-=l)o.point((c=Kr([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function pi(t,n){var r=Qr(n);r[0]-=t,ii(r);var i=e(-r[1]);return((0>-r[2]?-i:i)+2*Math.PI-Yu)%(2*Math.PI)}function di(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+=yi(d,-1),d=null,void 0;if(d=null,1&n){t=e[0],h+=yi(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(mi))}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=Uu.merge(s),s.length?Si(s,Mi,null,e,r):(-Yu>h||p&&-Yu>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=vi(),M=n(y);return v}}function mi(t){return t.length>1}function vi(){var t,n=[];return{lineStart:function(){n.push(t=[])},point:function(n,e){t.push([n,e])},lineEnd:In,buffer:function(){var e=n;return n=[],t=null,e},rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))}}}function yi(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,Yu>Math.abs(h-2)&&Yu>Math.abs(i-2)||(Yu>Math.abs(i)||Yu>Math.abs(h)||(Yu>Math.abs(Math.abs(r-s)-Ou)?i+h>2&&(a+=4*(r-s)):a+=Yu>Math.abs(h-2)?4*(r-g):((3*Ou+r-s)%(2*Ou)-Ou)*(h+i)),g=s,s=r,h=i);return a}function Mi(t,n){return(0>(t=t.point)[0]?t[1]-Ou/2-Yu:Ou/2-t[1])-(0>(n=n.point)[0]?n[1]-Ou/2-Yu:Ou/2-n[1])}function bi(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?Ou:-Ou,c=Math.abs(u-e);Yu>Math.abs(c-Ou)?(t.point(e,r=(r+a)/2>0?Ou/2:-Ou/2),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(u,r),n=0):i!==o&&c>=Ou&&(Yu>Math.abs(e-i)&&(e-=i*Yu),Yu>Math.abs(u-o)&&(u-=o*Yu),r=xi(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 xi(t,n,e,r){var i,u,a=Math.sin(t-e);return Math.abs(a)>Yu?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 _i(t,n,e,r){var i;if(null==t)i=e*Ou/2,r.point(-Ou,i),r.point(0,i),r.point(Ou,i),r.point(Ou,0),r.point(Ou,-i),r.point(0,-i),r.point(-Ou,-i),r.point(-Ou,0),r.point(-Ou,i);else if(Math.abs(t[0]-n[0])>Yu){var u=(t[0]u}function e(t){var e,i,u,a;return{lineStart:function(){u=i=!1,a=1},point:function(o,c){var l,f=[o,c],s=n(o,c);!e&&(u=i=s)&&t.lineStart(),s!==i&&(l=r(e,f),(Wr(e,l)||Wr(f,l))&&(f[0]+=Yu,f[1]+=Yu,s=n(f[0],f[1]))),s!==i&&(a=0,(i=s)?(t.lineStart(),l=r(f,e),t.point(l[0],l[1])):(l=r(e,f),t.point(l[0],l[1]),t.lineEnd()),e=l),!s||e&&Wr(e,f)||t.point(f[0],f[1]),e=f},lineEnd:function(){i&&t.lineEnd(),e=null},clean:function(){return a|(u&&i)<<1}}}function r(t,n){var e=Qr(t),r=Qr(n),i=[1,0,0],a=ni(e,r),o=ti(a,a),c=a[0],l=o-c*c;if(!l)return t;var f=u*o/l,s=-u*c/l,h=ni(i,a),g=ri(i,f),p=ri(a,s);ei(g,p);var d=h,m=ti(g,d),v=ti(d,d),y=Math.sqrt(m*m-v*(ti(g,g)-1)),M=ri(d,(-m-y)/v);return ei(M,g),Kr(M)}var i=t*Iu,u=Math.cos(i),a=gi(i,6*Iu);return di(n,e,a)}function Si(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(Wr(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),ki(u),ki(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 ki(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 Ei(t,n,e,r){function i(r,i){return Yu>Math.abs(r[0]-t)?i>0?0:3:Yu>Math.abs(r[0]-e)?i>0?2:1:Yu>Math.abs(r[1]-n)?i>0?1:0:i>0?3:2}function u(t,n){t=t.point,n=n.point;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 a(i,u){var a=u[0]-i[0],o=u[1]-i[1],c=[0,1];return Yu>Math.abs(a)&&Yu>Math.abs(o)?i[0]>=t&&e>=i[0]&&i[1]>=n&&r>=i[1]:Ai(t-i[0],a,c)&&Ai(i[0]-e,-a,c)&&Ai(n-i[1],o,c)&&Ai(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(o){function c(u){var a=i(u,-1),o=!l([0===a||3===a?t:e,a>1?r:n]);return o}function l(t){for(var n=0,e=y.length,r=t[1],i=0;e>i;++i)for(var u=1,a=y[i],o=a.length,c=a[0];o>u;++u)b=a[u],r>=c[1]?b[1]>r&&f(c,b,t)>0&&++n:r>=b[1]&&0>f(c,b,t)&&--n,c=b;return 0!==n}function f(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(n[1]-t[1])}function s(u,a,o,c){var l=i(u,o),f=i(a,o);if(l!==f){do c.point(0===l||3===l?t:e,l>1?r:n);while((l=(l+o+4)%4)!==f)}else c.point(a[0],a[1])}function h(i,u){return i>=t&&e>=i&&u>=n&&r>=u}function g(t,n){h(t,n)&&o.point(t,n)}function p(){q.point=m,y&&y.push(M=[]),A=!0,E=!1,S=k=0/0}function d(){v&&(m(x,_),w&&E&&T.rejoin(),v.push(T.buffer())),q.point=g,E&&o.lineEnd()}function m(t,n){var e=h(t,n);if(y&&M.push([t,n]),A)x=t,_=n,w=e,A=!1,e&&(o.lineStart(),o.point(t,n));else if(e&&E)o.point(t,n);else{var r=[S,k],i=[t,n];a(r,i)&&(E||(o.lineStart(),o.point(r[0],r[1])),o.point(i[0],i[1]),e||o.lineEnd())}S=t,k=n,E=e}var v,y,M,x,_,w,S,k,E,A,N=o,T=vi(),q={point:g,lineStart:p,lineEnd:d,polygonStart:function(){o=T,v=[],y=[]},polygonEnd:function(){o=N,v.length&&(o.polygonStart(),Si(Uu.merge(v),u,c,s,o),o.polygonEnd()),v=y=M=null}};return q}}function Ai(t,n,e){if(Yu>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 Ni(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 Ti(t,n){return[t,n]}function qi(t,n,e){var r=Uu.range(t,n-Yu,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function Ci(t,n,e){var r=Uu.range(t,n-Yu,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function zi(t){return(t=Math.sin(t/2))*t}function Di(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(zi(r-n)+i*a*zi(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)*Vu,Math.atan2(a,Math.sqrt(r*r+i*i))*Vu]}:function(){return[t*Vu,n*Vu]};return p.distance=h,p}function ji(t,n){return[t/(2*Ou),Math.max(-.5,Math.min(.5,Math.log(Math.tan(Ou/4+n/2))/(2*Ou)))]}function Li(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Fi(t){var n=ui(function(n,e){return t([n*Vu,e*Vu])});return function(t){return t=n(t),{point:function(n,e){t.point(n*Iu,e*Iu)},sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}}function Hi(){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=Li(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=Li(t),o},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return o}function Ri(t){function n(n,e){t.moveTo(n,e),t.arc(n,e,a,0,2*Ou)}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:In};return o}function Pi(){function t(t,n){Do+=i*t-r*n,r=t,i=n}var n,e,r,i;jo.point=function(u,a){jo.point=t,n=r=u,e=i=a},jo.lineEnd=function(){t(n,e)}}function Oi(t,n){wo||(ko+=t,Eo+=n,++Ao)}function Yi(){function t(t,r){var i=t-n,u=r-e,a=Math.sqrt(i*i+u*u);ko+=a*(n+t)/2,Eo+=a*(e+r)/2,Ao+=a,n=t,e=r}var n,e;if(1!==wo){if(!(1>wo))return;wo=1,ko=Eo=Ao=0}Lo.point=function(r,i){Lo.point=t,n=r,e=i}}function Ui(){Lo.point=Oi}function Ii(){function t(t,n){var e=i*t-r*n;ko+=e*(r+t),Eo+=e*(i+n),Ao+=3*e,r=t,i=n}var n,e,r,i;2>wo&&(wo=2,ko=Eo=Ao=0),Lo.point=function(u,a){Lo.point=t,n=r=u,e=i=a},Lo.lineEnd=function(){t(n,e)}}function Vi(){function t(t,n){t*=Iu,n=n*Iu/2+Ou/4;var e=t-r,a=Math.cos(n),o=Math.sin(n),c=u*o,l=Ho,f=Ro,s=i*a+c*Math.cos(e),h=c*Math.sin(e);Ho=l*s-f*h,Ro=f*s+l*h,r=t,i=a,u=o}var n,e,r,i,u;Po.point=function(a,o){Po.point=t,r=(n=a)*Iu,i=Math.cos(o=(e=o)*Iu/2+Ou/4),u=Math.sin(o)},Po.lineEnd=function(){t(n,e)}}function Zi(){function t(t,i){var u=Math.sin(i*=Iu),a=Math.cos(i),o=Math.abs((t*=Iu)-n),c=Math.cos(o);Oo+=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;Yo.point=function(i,u){n=i*Iu,e=Math.sin(u*=Iu),r=Math.cos(u),Yo.point=t},Yo.lineEnd=function(){Yo.point=Yo.lineEnd=In}}function Xi(t){return Bi(function(){return t})()}function Bi(t){function n(t){return t=a(t[0]*Iu,t[1]*Iu),[t[0]*s+o,l-t[1]*s]}function e(t){return t=a.invert((t[0]-o)/s,(l-t[1])/s),t&&[t[0]*Vu,t[1]*Vu]}function r(){a=Ni(u=Ji(m,v,y),i);var t=i(p,d);return o=h-t[0]*s,l=g+t[1]*s,n}var i,u,a,o,l,f=ui(function(t,n){return t=i(t,n),[t[0]*s+o,l-t[1]*s]}),s=150,h=480,g=250,p=0,d=0,m=0,v=0,y=0,M=To,b=c,x=null,_=null;return n.stream=function(t){return $i(u,M(f(b(t))))},n.clipAngle=function(t){return arguments.length?(M=null==t?(x=t,To):wi(x=+t),n):x},n.clipExtent=function(t){return arguments.length?(_=t,b=null==t?c:Ei(t[0][0],t[0][1],t[1][0],t[1][1]),n):_},n.scale=function(t){return arguments.length?(s=+t,r()):s},n.translate=function(t){return arguments.length?(h=+t[0],g=+t[1],r()):[h,g]},n.center=function(t){return arguments.length?(p=t[0]%360*Iu,d=t[1]%360*Iu,r()):[p*Vu,d*Vu]},n.rotate=function(t){return arguments.length?(m=t[0]%360*Iu,v=t[1]%360*Iu,y=t.length>2?t[2]%360*Iu:0,r()):[m*Vu,v*Vu,y*Vu]},Uu.rebind(n,f,"precision"),function(){return i=t.apply(this,arguments),n.invert=i.invert&&e,r()}}function $i(t,n){return{point:function(e,r){r=t(e*Iu,r*Iu),e=r[0],n.point(e>Ou?e-2*Ou:-Ou>e?e+2*Ou:e,r[1])},sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function Ji(t,n,e){return t?n||e?Ni(Ki(t),Wi(n,e)):Ki(t):n||e?Wi(n,e):Ti}function Gi(t){return function(n,e){return n+=t,[n>Ou?n-2*Ou:-Ou>n?n+2*Ou:n,e]}}function Ki(t){var n=Gi(t);return n.invert=Gi(-t),n}function Wi(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 Qi(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 tu(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 nu(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function eu(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 ru(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.yn.y?1:t.xn.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[Io[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=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)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[Io[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.yg.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,Io[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 iu(){return{leaf:!0,nodes:[],point:null}}function uu(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]&&uu(t,c[0],e,r,a,o),c[1]&&uu(t,c[1],a,r,i,o),c[2]&&uu(t,c[2],e,o,a,u),c[3]&&uu(t,c[3],a,o,i,u)}}function au(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function ou(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=cc[n.charAt(a++)],!u||0>(r=u(t,e,r)))return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function cu(t){return RegExp("^(?:"+t.map(Uu.requote).join("|")+")","i")}function lu(t){for(var n=new a,e=-1,r=t.length;r>++e;)n.set(t[e].toLowerCase(),e);return n}function fu(t,n,e){t+="";var r=t.length;return e>r?Array(e-r+1).join(n)+t:t}function su(t,n,e){nc.lastIndex=0;var r=nc.exec(n.substring(e));return r?e+=r[0].length:-1}function hu(t,n,e){tc.lastIndex=0;var r=tc.exec(n.substring(e));return r?e+=r[0].length:-1}function gu(t,n,e){ic.lastIndex=0;var r=ic.exec(n.substring(e));return r?(t.m=uc.get(r[0].toLowerCase()),e+=r[0].length):-1}function pu(t,n,e){ec.lastIndex=0;var r=ec.exec(n.substring(e));return r?(t.m=rc.get(r[0].toLowerCase()),e+=r[0].length):-1}function du(t,n,e){return ou(t,""+oc.c,n,e)}function mu(t,n,e){return ou(t,""+oc.x,n,e)}function vu(t,n,e){return ou(t,""+oc.X,n,e)}function yu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}function Mu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.y=bu(+r[0]),e+=r[0].length):-1}function bu(t){return t+(t>68?1900:2e3)}function xu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1}function _u(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function wu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}function Su(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1}function ku(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1}function Eu(t,n,e){lc.lastIndex=0;var r=lc.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1}function Au(t,n,e){var r=fc.get(n.substring(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)}function Nu(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+fu(r,"0",2)+fu(i,"0",2)}function Tu(t){return t.toISOString()}function qu(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 Vo(e-1)),1),e}function u(t,e){return n(t=new Vo(+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{Vo=au;var r=new au;return r._=t,a(r,n,e)}finally{Vo=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=u,t.range=a;var c=t.utc=Cu(t);return c.floor=c,c.round=Cu(r),c.ceil=Cu(i),c.offset=Cu(u),c.range=o,t}function Cu(t){return function(n,e){try{Vo=au;var r=new au;return r._=n,t(r,e)._}finally{Vo=Date}}}function zu(t,n,e){function r(n){return t(n)}return r.invert=function(n){return ju(t.invert(n))},r.domain=function(n){return arguments.length?(t.domain(n),r):t.domain().map(ju)},r.nice=function(t){return r.domain(Xn(r.domain(),function(){return t}))},r.ticks=function(e,i){var u=Du(r.domain());if("function"!=typeof e){var a=u[1]-u[0],o=a/e,c=Uu.bisect(hc,o);if(c==hc.length)return n.year(u,e);if(!c)return t.ticks(e).map(ju);Math.log(o/hc[c-1])n?[n,e]:[e,n]}function ju(t){return new Date(t)}function Lu(t){return function(n){for(var e=t.length-1,r=t[e];!r[1](n);)r=t[--e];return r[0](n)}}function Fu(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function Hu(t){var n=t.getFullYear(),e=Fu(n),r=Fu(n+1);return n+(t-e)/(r-e)}function Ru(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function Pu(t){var n=t.getUTCFullYear(),e=Ru(n),r=Ru(n+1);return n+(t-e)/(r-e)}var Ou=Math.PI,Yu=1e-6,Uu={version:"3.0.8"},Iu=Ou/180,Vu=180/Ou,Zu=document,Xu=window,Bu=".",$u=",",Ju=[3,3];Date.now||(Date.now=function(){return+new Date});try{Zu.createElement("div").style.setProperty("opacity",0,"")}catch(Gu){var Ku=Xu.CSSStyleDeclaration.prototype,Wu=Ku.setProperty;Ku.setProperty=function(t,n,e){Wu.call(this,t,n+"",e)}}var Qu=u;try{Qu(Zu.documentElement.childNodes)[0].nodeType}catch(ta){Qu=i}var na=[].__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]};Uu.map=function(t){var n=new a;for(var e in t)n.set(e,t[e]);return n},r(a,{has:function(t){return ea+t in this},get:function(t){return this[ea+t]},set:function(t,n){return this[ea+t]=n},remove:function(t){return t=ea+t,t in this&&delete this[t]},keys:function(){var t=[];return this.forEach(function(n){t.push(n)}),t},values:function(){var t=[];return this.forEach(function(n,e){t.push(e)}),t},entries:function(){var t=[];return this.forEach(function(n,e){t.push({key:n,value:e})}),t},forEach:function(t){for(var n in this)n.charCodeAt(0)===ra&&t.call(this,n.substring(1),this[n])}});var ea="\0",ra=ea.charCodeAt(0);Uu.set=function(t){var n=new o;if(t)for(var e=0;t.length>e;e++)n.add(t[e]);return n},r(o,{has:function(t){return ea+t in this},add:function(t){return this[ea+t]=!0,t},remove:function(t){return t=ea+t,t in this&&delete this[t]},values:function(){var t=[];return this.forEach(function(n){t.push(n)}),t},forEach:function(t){for(var n in this)n.charCodeAt(0)===ra&&t.call(this,n.substring(1))}}),Uu.functor=f,Uu.rebind=function(t,n){for(var e,r=1,i=arguments.length;i>++r;)t[e=arguments[r]]=s(t,n,n[e]);return t},Uu.ascending=function(t,n){return n>t?-1:t>n?1:t>=n?0:0/0},Uu.descending=function(t,n){return t>n?-1:n>t?1:n>=t?0:0/0},Uu.mean=function(t,n){var e,r=t.length,i=0,u=-1,a=0;if(1===arguments.length)for(;r>++u;)h(e=t[u])&&(i+=(e-i)/++a);else for(;r>++u;)h(e=n.call(t,t[u],u))&&(i+=(e-i)/++a);return a?i:void 0},Uu.median=function(t,n){return arguments.length>1&&(t=t.map(n)),t=t.filter(h),t.length?Uu.quantile(t.sort(Uu.ascending),.5):void 0},Uu.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},Uu.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},Uu.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]},Uu.random={normal:function(t,n){var e=arguments.length;return 2>e&&(n=1),1>e&&(t=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Uu.random.normal.apply(Uu,arguments);return function(){return Math.exp(t())}},irwinHall:function(t){return function(){for(var n=0,e=0;t>e;e++)n+=Math.random();return n/t}}},Uu.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},Uu.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},Uu.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},Uu.transpose=function(t){return Uu.zip.apply(Uu,t)},Uu.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=Uu.min(arguments,g),e=Array(n);n>++t;)for(var r,i=-1,u=e[t]=Array(r);r>++i;)u[i]=arguments[i][t];return e},Uu.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 ia=Uu.bisector(function(t){return t});Uu.bisectLeft=ia.left,Uu.bisect=Uu.bisectRight=ia.right,Uu.nest=function(){function t(n,o,c){if(c>=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,g=-1,p=o.length,d=u[c++],m=new a;p>++g;)(h=m.get(l=d(f=o[g])))?h.push(f):m.set(l,[f]);return n?(f=n(),s=function(e,r){f.set(e,t(n,r,c))}):(f={},s=function(e,r){f[e]=t(n,r,c)}),m.forEach(s),f}function n(t,e){if(e>=u.length)return t;var r=[],i=o[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),i?r.sort(function(t,n){return i(t.key,n.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(n,e){return t(e,n,0)},i.entries=function(e){return n(t(Uu.map,e,0),0)},i.key=function(t){return u.push(t),i},i.sortKeys=function(t){return o[u.length-1]=t,i},i.sortValues=function(t){return e=t,i},i.rollup=function(t){return r=t,i},i},Uu.keys=function(t){var n=[];for(var e in t)n.push(e);return n},Uu.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},Uu.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},Uu.permute=function(t,n){for(var e=[],r=-1,i=n.length;i>++r;)e[r]=t[n[r]];return e},Uu.merge=function(t){return Array.prototype.concat.apply([],t)},Uu.range=function(t,n,e){if(3>arguments.length&&(e=1,2>arguments.length&&(n=t,t=0)),1/0===(n-t)/e)throw Error("infinite range");var r,i=[],u=d(Math.abs(e)),a=-1;if(t*=u,n*=u,e*=u,0>e)for(;(r=t+e*++a)>n;)i.push(r/u);else for(;n>(r=t+e*++a);)i.push(r/u);return i},Uu.requote=function(t){return t.replace(ua,"\\$&")};var ua=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;Uu.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)},Uu.xhr=function(t,n,e){function r(){var t=l.status;!t&&l.responseText||t>=200&&300>t||304===t?u.load.call(i,o.call(i,l)):u.error.call(i,l)}var i={},u=Uu.dispatch("progress","load","error"),a={},o=c,l=new(Xu.XDomainRequest&&/^(http(s)?:)?\/\//.test(t)?XDomainRequest:XMLHttpRequest);return"onload"in l?l.onload=l.onerror=r:l.onreadystatechange=function(){l.readyState>3&&r()},l.onprogress=function(t){var n=Uu.event;Uu.event=t;try{u.progress.call(i,l)}finally{Uu.event=n}},i.header=function(t,n){return t=(t+"").toLowerCase(),2>arguments.length?a[t]:(null==n?delete a[t]:a[t]=n+"",i)},i.mimeType=function(t){return arguments.length?(n=null==t?null:t+"",i):n},i.response=function(t){return o=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(Qu(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),l.open(e,t,!0),null==n||"accept"in a||(a.accept=n+",*/*"),l.setRequestHeader)for(var o in a)l.setRequestHeader(o,a[o]);return null!=n&&l.overrideMimeType&&l.overrideMimeType(n),null!=u&&i.on("error",u).on("load",function(t){u(null,t)}),l.send(null==r?null:r),i},i.abort=function(){return l.abort(),i},Uu.rebind(i,u,"on"),2===arguments.length&&"function"==typeof n&&(e=n,n=null),null==e?i:i.get(m(e))},Uu.text=function(){return Uu.xhr.apply(Uu,arguments).response(v)},Uu.json=function(t,n){return Uu.xhr(t,"application/json",n).response(y)},Uu.html=function(t,n){return Uu.xhr(t,"text/html",n).response(M)},Uu.xml=function(){return Uu.xhr.apply(Uu,arguments).response(x)};var aa={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/"};Uu.ns={prefix:aa,qualify:function(t){var n=t.indexOf(":"),e=t;return n>=0&&(e=t.substring(0,n),t=t.substring(n+1)),aa.hasOwnProperty(e)?{space:aa[e],local:t}:t}},Uu.dispatch=function(){for(var t=new _,n=-1,e=arguments.length;e>++n;)t[arguments[n]]=w(t);return t},_.prototype.on=function(t,n){var e=t.indexOf("."),r="";return e>0&&(r=t.substring(e+1),t=t.substring(0,e)),2>arguments.length?this[t].on(r):this[t].on(r,n)},Uu.format=function(t){var n=oa.exec(t),e=n[1]||" ",r=n[2]||">",i=n[3]||"",u=n[4]||"",a=n[5],o=+n[6],c=n[7],l=n[8],f=n[9],s=1,h="",g=!1;switch(l&&(l=+l.substring(1)),(a||"0"===e&&"="===r)&&(a=e="0",r="=",c&&(o-=Math.floor((o-1)/4))),f){case"n":c=!0,f="g";break;case"%":s=100,h="%",f="f";break;case"p":s=100,h="%",f="r";break;case"b":case"o":case"x":case"X":u&&(u="0"+f.toLowerCase());case"c":case"d":g=!0,l=0;break;case"s":s=-1,f="r"}"#"===u&&(u=""),"r"!=f||l||(f="g"),f=ca.get(f)||k;var p=a&&c;return function(t){if(g&&t%1)return"";var n=0>t||0===t&&0>1/t?(t=-t,"-"):i;if(0>s){var d=Uu.formatPrefix(t,l);t=d.scale(t),h=d.symbol}else t*=s;t=f(t,l),!a&&c&&(t=la(t));var m=u.length+t.length+(p?0:n.length),v=o>m?Array(m=o-m+1).join(e):"";return p&&(t=la(v+t)),Bu&&t.replace(".",Bu),n+=u,("<"===r?n+t+v:">"===r?v+n+t:"^"===r?v.substring(0,m>>=1)+n+t+v.substring(m):n+(p?t:v+t))+h}};var oa=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,ca=Uu.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return(t=Uu.round(t,S(t,n))).toFixed(Math.max(0,Math.min(20,S(t*(1+1e-15),n))))}}),la=c;if(Ju){var fa=Ju.length;la=function(t){for(var n=t.lastIndexOf("."),e=n>=0?"."+t.substring(n+1):(n=t.length,""),r=[],i=0,u=Ju[0];n>0&&u>0;)r.push(t.substring(n-=u,n+u)),u=Ju[i=(i+1)%fa];return r.reverse().join($u||"")+e}}var sa=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"].map(E);Uu.formatPrefix=function(t,n){var e=0;return t&&(0>t&&(t*=-1),n&&(t=Uu.round(t,S(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((0>=e?e+1:e-1)/3)))),sa[8+e/3]};var ha=function(){return c},ga=Uu.map({linear:ha,poly:D,quad:function(){return q},cubic:function(){return C},sin:function(){return j},exp:function(){return L},circle:function(){return F},elastic:H,back:R,bounce:function(){return P}}),pa=Uu.map({"in":c,out:N,"in-out":T,"out-in":function(t){return T(N(t))}});Uu.ease=function(t){var n=t.indexOf("-"),e=n>=0?t.substring(0,n):t,r=n>=0?t.substring(n+1):"in";return e=ga.get(e)||ha,r=pa.get(r)||c,A(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},Uu.event=null,Uu.transform=function(t){var n=Zu.createElementNS(Uu.ns.prefix.svg,"g");return(Uu.transform=function(t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate();return new I(e?e.matrix:da)})(t)},I.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var da={a:1,b:0,c:0,d:1,e:0,f:0};Uu.interpolate=function(t,n){for(var e,r=Uu.interpolators.length;--r>=0&&!(e=Uu.interpolators[r](t,n)););return e},Uu.interpolateNumber=function(t,n){return n-=t,function(e){return t+n*e}},Uu.interpolateRound=function(t,n){return n-=t,function(e){return Math.round(t+n*e)}},Uu.interpolateString=function(t,n){var e,r,i,u,a,o=0,c=0,l=[],f=[]; +for(ma.lastIndex=0,r=0;e=ma.exec(n);++r)e.index&&l.push(n.substring(o,c=e.index)),f.push({i:l.length,x:e[0]}),l.push(null),o=ma.lastIndex;for(n.length>o&&l.push(n.substring(o)),r=0,u=f.length;(e=ma.exec(t))&&u>r;++r)if(a=f[r],a.x==e[0]){if(a.i)if(null==l[a.i+1])for(l[a.i-1]+=a.x,l.splice(a.i,1),i=r+1;u>i;++i)f[i].i--;else for(l[a.i-1]+=a.x+l[a.i+1],l.splice(a.i,2),i=r+1;u>i;++i)f[i].i-=2;else if(null==l[a.i+1])l[a.i]=a.x;else for(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1),i=r+1;u>i;++i)f[i].i--;f.splice(r,1),u--,r--}else a.x=Uu.interpolateNumber(parseFloat(e[0]),parseFloat(a.x));for(;u>r;)a=f.pop(),null==l[a.i+1]?l[a.i]=a.x:(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1)),u--;return 1===l.length?null==l[0]?f[0].x:function(){return n}:function(t){for(r=0;u>r;++r)l[(a=f[r]).i]=a.x(t);return l.join("")}},Uu.interpolateTransform=function(t,n){var e,r=[],i=[],u=Uu.transform(t),a=Uu.transform(n),o=u.translate,c=a.translate,l=u.rotate,f=a.rotate,s=u.skew,h=a.skew,g=u.scale,p=a.scale;return o[0]!=c[0]||o[1]!=c[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:Uu.interpolateNumber(o[0],c[0])},{i:3,x:Uu.interpolateNumber(o[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),l!=f?(l-f>180?f+=360:f-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:Uu.interpolateNumber(l,f)})):f&&r.push(r.pop()+"rotate("+f+")"),s!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:Uu.interpolateNumber(s,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:e-4,x:Uu.interpolateNumber(g[0],p[0])},{i:e-2,x:Uu.interpolateNumber(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=i.length,function(t){for(var n,u=-1;e>++u;)r[(n=i[u]).i]=n.x(t);return r.join("")}},Uu.interpolateRgb=function(t,n){t=Uu.rgb(t),n=Uu.rgb(n);var e=t.r,r=t.g,i=t.b,u=n.r-e,a=n.g-r,o=n.b-i;return function(t){return"#"+Q(Math.round(e+u*t))+Q(Math.round(r+a*t))+Q(Math.round(i+o*t))}},Uu.interpolateHsl=function(t,n){t=Uu.hsl(t),n=Uu.hsl(n);var e=t.h,r=t.s,i=t.l,u=n.h-e,a=n.s-r,o=n.l-i;return u>180?u-=360:-180>u&&(u+=360),function(t){return cn(e+u*t,r+a*t,i+o*t)+""}},Uu.interpolateLab=function(t,n){t=Uu.lab(t),n=Uu.lab(n);var e=t.l,r=t.a,i=t.b,u=n.l-e,a=n.a-r,o=n.b-i;return function(t){return pn(e+u*t,r+a*t,i+o*t)+""}},Uu.interpolateHcl=function(t,n){t=Uu.hcl(t),n=Uu.hcl(n);var e=t.h,r=t.c,i=t.l,u=n.h-e,a=n.c-r,o=n.l-i;return u>180?u-=360:-180>u&&(u+=360),function(t){return sn(e+u*t,r+a*t,i+o*t)+""}},Uu.interpolateArray=function(t,n){var e,r=[],i=[],u=t.length,a=n.length,o=Math.min(t.length,n.length);for(e=0;o>e;++e)r.push(Uu.interpolate(t[e],n[e]));for(;u>e;++e)i[e]=t[e];for(;a>e;++e)i[e]=n[e];return function(t){for(e=0;o>e;++e)i[e]=r[e](t);return i}},Uu.interpolateObject=function(t,n){var e,r={},i={};for(e in t)e in n?r[e]=B(e)(t[e],n[e]):i[e]=t[e];for(e in n)e in t||(i[e]=n[e]);return function(t){for(e in r)i[e]=r[e](t);return i}};var ma=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;Uu.interpolators=[Uu.interpolateObject,function(t,n){return Array.isArray(n)&&Uu.interpolateArray(t,n)},function(t,n){return("string"==typeof t||"string"==typeof n)&&Uu.interpolateString(t+"",n+"")},function(t,n){return("string"==typeof n?ya.has(n)||/^(#|rgb\(|hsl\()/.test(n):n instanceof G)&&Uu.interpolateRgb(t,n)},function(t,n){return!isNaN(t=+t)&&!isNaN(n=+n)&&Uu.interpolateNumber(t,n)}],G.prototype.toString=function(){return this.rgb()+""},Uu.rgb=function(t,n,e){return 1===arguments.length?t instanceof W?K(t.r,t.g,t.b):tn(""+t,K,cn):K(~~t,~~n,~~e)};var va=W.prototype=new G;va.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var n=this.r,e=this.g,r=this.b,i=30;return n||e||r?(n&&i>n&&(n=i),e&&i>e&&(e=i),r&&i>r&&(r=i),K(Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(r/t)))):K(i,i,i)},va.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),K(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},va.hsl=function(){return nn(this.r,this.g,this.b)},va.toString=function(){return"#"+Q(this.r)+Q(this.g)+Q(this.b)};var ya=Uu.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});ya.forEach(function(t,n){ya.set(t,tn(n,K,cn))}),Uu.hsl=function(t,n,e){return 1===arguments.length?t instanceof on?an(t.h,t.s,t.l):tn(""+t,nn,an):an(+t,+n,+e)};var Ma=on.prototype=new G;Ma.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),an(this.h,this.s,this.l/t)},Ma.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),an(this.h,this.s,t*this.l)},Ma.rgb=function(){return cn(this.h,this.s,this.l)},Uu.hcl=function(t,n,e){return 1===arguments.length?t instanceof fn?ln(t.h,t.c,t.l):t instanceof gn?dn(t.l,t.a,t.b):dn((t=en((t=Uu.rgb(t)).r,t.g,t.b)).l,t.a,t.b):ln(+t,+n,+e)};var ba=fn.prototype=new G;ba.brighter=function(t){return ln(this.h,this.c,Math.min(100,this.l+xa*(arguments.length?t:1)))},ba.darker=function(t){return ln(this.h,this.c,Math.max(0,this.l-xa*(arguments.length?t:1)))},ba.rgb=function(){return sn(this.h,this.c,this.l).rgb()},Uu.lab=function(t,n,e){return 1===arguments.length?t instanceof gn?hn(t.l,t.a,t.b):t instanceof fn?sn(t.l,t.c,t.h):en((t=Uu.rgb(t)).r,t.g,t.b):hn(+t,+n,+e)};var xa=18,_a=.95047,wa=1,Sa=1.08883,ka=gn.prototype=new G;ka.brighter=function(t){return hn(Math.min(100,this.l+xa*(arguments.length?t:1)),this.a,this.b)},ka.darker=function(t){return hn(Math.max(0,this.l-xa*(arguments.length?t:1)),this.a,this.b)},ka.rgb=function(){return pn(this.l,this.a,this.b)};var Ea=function(t,n){return n.querySelector(t)},Aa=function(t,n){return n.querySelectorAll(t)},Na=Zu.documentElement,Ta=Na.matchesSelector||Na.webkitMatchesSelector||Na.mozMatchesSelector||Na.msMatchesSelector||Na.oMatchesSelector,qa=function(t,n){return Ta.call(t,n)};"function"==typeof Sizzle&&(Ea=function(t,n){return Sizzle(t,n)[0]||null},Aa=function(t,n){return Sizzle.uniqueSort(Sizzle(t,n))},qa=Sizzle.matchesSelector);var Ca=[];Uu.selection=function(){return Da},Uu.selection.prototype=Ca,Ca.select=function(t){var n,e,r,i,u=[];"function"!=typeof t&&(t=bn(t));for(var a=-1,o=this.length;o>++a;){u.push(n=[]),n.parentNode=(r=this[a]).parentNode;for(var c=-1,l=r.length;l>++c;)(i=r[c])?(n.push(e=t.call(i,i.__data__,c)),e&&"__data__"in i&&(e.__data__=i.__data__)):n.push(null)}return Mn(u)},Ca.selectAll=function(t){var n,e,r=[];"function"!=typeof t&&(t=xn(t));for(var i=-1,u=this.length;u>++i;)for(var a=this[i],o=-1,c=a.length;c>++o;)(e=a[o])&&(r.push(n=Qu(t.call(e,e.__data__,o))),n.parentNode=e);return Mn(r)},Ca.attr=function(t,n){if(2>arguments.length){if("string"==typeof t){var e=this.node();return t=Uu.ns.qualify(t),t.local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(_n(n,t[n]));return this}return this.each(_n(t,n))},Ca.classed=function(t,n){if(2>arguments.length){if("string"==typeof t){var e=this.node(),r=(t=t.trim().split(/^|\s+/g)).length,i=-1;if(n=e.classList){for(;r>++i;)if(!n.contains(t[i]))return!1}else for(n=e.className,null!=n.baseVal&&(n=n.baseVal);r>++i;)if(!wn(t[i]).test(n))return!1;return!0}for(n in t)this.each(Sn(n,t[n]));return this}return this.each(Sn(t,n))},Ca.style=function(t,n,e){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(n="");for(e in t)this.each(En(e,t[e],n));return this}if(2>r)return Xu.getComputedStyle(this.node(),null).getPropertyValue(t);e=""}return this.each(En(t,n,e))},Ca.property=function(t,n){if(2>arguments.length){if("string"==typeof t)return this.node()[t];for(n in t)this.each(An(n,t[n]));return this}return this.each(An(t,n))},Ca.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Ca.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Ca.append=function(t){function n(){return this.appendChild(Zu.createElementNS(this.namespaceURI,t))}function e(){return this.appendChild(Zu.createElementNS(t.space,t.local))}return t=Uu.ns.qualify(t),this.select(t.local?e:n)},Ca.insert=function(t,n){function e(e,r){return this.insertBefore(Zu.createElementNS(this.namespaceURI,t),n.call(this,e,r))}function r(e,r){return this.insertBefore(Zu.createElementNS(t.space,t.local),n.call(this,e,r))}return t=Uu.ns.qualify(t),"function"!=typeof n&&(n=bn(n)),this.select(t.local?r:e)},Ca.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},Ca.data=function(t,n){function e(t,e){var r,i,u,o=t.length,s=e.length,h=Math.min(o,s),g=Array(s),p=Array(s),d=Array(o);if(n){var m,v=new a,y=new a,M=[];for(r=-1;o>++r;)m=n.call(i=t[r],i.__data__,r),v.has(m)?d[r]=i:v.set(m,i),M.push(m);for(r=-1;s>++r;)m=n.call(e,u=e[r],r),(i=v.get(m))?(g[r]=i,i.__data__=u):y.has(m)||(p[r]=Nn(u)),y.set(m,u),v.remove(m);for(r=-1;o>++r;)v.has(M[r])&&(d[r]=t[r])}else{for(r=-1;h>++r;)i=t[r],u=e[r],i?(i.__data__=u,g[r]=i):p[r]=Nn(u);for(;s>r;++r)p[r]=Nn(e[r]);for(;o>r;++r)d[r]=t[r]}p.update=g,p.parentNode=g.parentNode=d.parentNode=t.parentNode,c.push(p),l.push(g),f.push(d)}var r,i,u=-1,o=this.length;if(!arguments.length){for(t=Array(o=(r=this[0]).length);o>++u;)(i=r[u])&&(t[u]=i.__data__);return t}var c=Ln([]),l=Mn([]),f=Mn([]);if("function"==typeof t)for(;o>++u;)e(r=this[u],t.call(r,r.parentNode.__data__,u));else for(;o>++u;)e(r=this[u],t);return l.enter=function(){return c},l.exit=function(){return f},l},Ca.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Ca.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=Tn(t));for(var u=0,a=this.length;a>u;u++){i.push(n=[]),n.parentNode=(e=this[u]).parentNode;for(var o=0,c=e.length;c>o;o++)(r=e[o])&&t.call(r,r.__data__,o)&&n.push(r)}return Mn(i)},Ca.order=function(){for(var t=-1,n=this.length;n>++t;)for(var e,r=this[t],i=r.length-1,u=r[i];--i>=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Ca.sort=function(t){t=qn.apply(this,arguments);for(var n=-1,e=this.length;e>++n;)this[n].sort(t);return this.order()},Ca.on=function(t,n,e){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(n=!1);for(e in t)this.each(Cn(e,t[e],n));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;e=!1}return this.each(Cn(t,n,e))};var za=Uu.map({mouseenter:"mouseover",mouseleave:"mouseout"});za.forEach(function(t){"on"+t in document&&za.remove(t)}),Ca.each=function(t){return jn(this,function(n,e,r){t.call(n,n.__data__,e,r)})},Ca.call=function(t){var n=Qu(arguments);return t.apply(n[0]=this,n),this},Ca.empty=function(){return!this.node()},Ca.node=function(){for(var t=0,n=this.length;n>t;t++)for(var e=this[t],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Ca.transition=function(){var t,n,e=La||++Ha,r=[],i=Object.create(Ra);i.time=Date.now();for(var u=-1,a=this.length;a>++u;){r.push(t=[]);for(var o=this[u],c=-1,l=o.length;l>++c;)(n=o[c])&&Hn(n,c,e,i),t.push(n)}return Fn(r,e)};var Da=Mn([[Zu]]);Da[0].parentNode=Na,Uu.select=function(t){return"string"==typeof t?Da.select(t):Mn([[t]])},Uu.selectAll=function(t){return"string"==typeof t?Da.selectAll(t):Mn([Qu(t)])};var ja=[];Uu.selection.enter=Ln,Uu.selection.enter.prototype=ja,ja.append=Ca.append,ja.insert=Ca.insert,ja.empty=Ca.empty,ja.node=Ca.node,ja.select=function(t){for(var n,e,r,i,u,a=[],o=-1,c=this.length;c>++o;){r=(i=this[o]).update,a.push(n=[]),n.parentNode=i.parentNode;for(var l=-1,f=i.length;f>++l;)(u=i[l])?(n.push(r[l]=e=t.call(i.parentNode,u.__data__,l)),e.__data__=u.__data__):n.push(null)}return Mn(a)};var La,Fa=[],Ha=0,Ra={ease:z,delay:0,duration:250};Fa.call=Ca.call,Fa.empty=Ca.empty,Fa.node=Ca.node,Uu.transition=function(t){return arguments.length?La?t.transition():t:Da.transition()},Uu.transition.prototype=Fa,Fa.select=function(t){var n,e,r,i=this.id,u=[];"function"!=typeof t&&(t=bn(t));for(var a=-1,o=this.length;o>++a;){u.push(n=[]);for(var c=this[a],l=-1,f=c.length;f>++l;)(r=c[l])&&(e=t.call(r,r.__data__,l))?("__data__"in r&&(e.__data__=r.__data__),Hn(e,l,i,r.__transition__[i]),n.push(e)):n.push(null)}return Fn(u,i)},Fa.selectAll=function(t){var n,e,r,i,u,a=this.id,o=[];"function"!=typeof t&&(t=xn(t));for(var c=-1,l=this.length;l>++c;)for(var f=this[c],s=-1,h=f.length;h>++s;)if(r=f[s]){u=r.__transition__[a],e=t.call(r,r.__data__,s),o.push(n=[]);for(var g=-1,p=e.length;p>++g;)Hn(i=e[g],g,a,u),n.push(i)}return Fn(o,a)},Fa.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=Tn(t));for(var u=0,a=this.length;a>u;u++){i.push(n=[]);for(var e=this[u],o=0,c=e.length;c>o;o++)(r=e[o])&&t.call(r,r.__data__,o)&&n.push(r)}return Fn(i,this.id,this.time).ease(this.ease())},Fa.attr=function(t,n){function e(){this.removeAttribute(u)}function r(){this.removeAttributeNS(u.space,u.local)}if(2>arguments.length){for(n in t)this.attr(n,t[n]);return this}var i=B(t),u=Uu.ns.qualify(t);return Pn(this,"attr."+t,n,function(t){function n(){var n,e=this.getAttribute(u);return e!==t&&(n=i(e,t),function(t){this.setAttribute(u,n(t))})}function a(){var n,e=this.getAttributeNS(u.space,u.local);return e!==t&&(n=i(e,t),function(t){this.setAttributeNS(u.space,u.local,n(t))})}return null==t?u.local?r:e:(t+="",u.local?a:n)})},Fa.attrTween=function(t,n){function e(t,e){var r=n.call(this,t,e,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,e){var r=n.call(this,t,e,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=Uu.ns.qualify(t);return this.tween("attr."+t,i.local?r:e)},Fa.style=function(t,n,e){function r(){this.style.removeProperty(t)}var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(n="");for(e in t)this.style(e,t[e],n);return this}e=""}var u=B(t);return Pn(this,"style."+t,n,function(n){function i(){var r,i=Xu.getComputedStyle(this,null).getPropertyValue(t);return i!==n&&(r=u(i,n),function(n){this.style.setProperty(t,r(n),e)})}return null==n?r:(n+="",i)})},Fa.styleTween=function(t,n,e){return 3>arguments.length&&(e=""),this.tween("style."+t,function(r,i){var u=n.call(this,r,i,Xu.getComputedStyle(this,null).getPropertyValue(t));return u&&function(n){this.style.setProperty(t,u(n),e)}})},Fa.text=function(t){return Pn(this,"text",t,Rn)},Fa.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},Fa.ease=function(t){var n=this.id;return 1>arguments.length?this.node().__transition__[n].ease:("function"!=typeof t&&(t=Uu.ease.apply(Uu,arguments)),jn(this,function(e){e.__transition__[n].ease=t}))},Fa.delay=function(t){var n=this.id;return jn(this,"function"==typeof t?function(e,r,i){e.__transition__[n].delay=0|t.call(e,e.__data__,r,i)}:(t|=0,function(e){e.__transition__[n].delay=t}))},Fa.duration=function(t){var n=this.id;return jn(this,"function"==typeof t?function(e,r,i){e.__transition__[n].duration=Math.max(1,0|t.call(e,e.__data__,r,i))}:(t=Math.max(1,0|t),function(e){e.__transition__[n].duration=t}))},Fa.each=function(t,n){var e=this.id;if(2>arguments.length){var r=Ra,i=La;La=e,jn(this,function(n,r,i){Ra=n.__transition__[e],t.call(n,n.__data__,r,i)}),Ra=r,La=i}else jn(this,function(r){r.__transition__[e].event.on(t,n)});return this},Fa.transition=function(){for(var t,n,e,r,i=this.id,u=++Ha,a=[],o=0,c=this.length;c>o;o++){a.push(t=[]);for(var n=this[o],l=0,f=n.length;f>l;l++)(e=n[l])&&(r=Object.create(e.__transition__[i]),r.delay+=r.duration,Hn(e,l,u,r)),t.push(e)}return Fn(a,u)},Fa.tween=function(t,n){var e=this.id;return 2>arguments.length?this.node().__transition__[e].tween.get(t):jn(this,null==n?function(n){n.__transition__[e].tween.remove(t)}:function(r){r.__transition__[e].tween.set(t,n)})};var Pa,Oa,Ya=0,Ua={},Ia=null;Uu.timer=function(t,n,e){if(3>arguments.length){if(2>arguments.length)n=0;else if(!isFinite(n))return;e=Date.now()}var r=Ua[t.id];r&&r.callback===t?(r.then=e,r.delay=n):Ua[t.id=++Ya]=Ia={callback:t,then:e,delay:n,next:Ia},Pa||(Oa=clearTimeout(Oa),Pa=1,Va(On))},Uu.timer.flush=function(){for(var t,n=Date.now(),e=Ia;e;)t=n-e.then,e.delay||(e.flush=e.callback(t)),e=e.next;Yn()};var Va=Xu.requestAnimationFrame||Xu.webkitRequestAnimationFrame||Xu.mozRequestAnimationFrame||Xu.oRequestAnimationFrame||Xu.msRequestAnimationFrame||function(t){setTimeout(t,17)};Uu.mouse=function(t){return Un(t,Y())};var Za=/WebKit/.test(Xu.navigator.userAgent)?-1:0;Uu.touches=function(t,n){return 2>arguments.length&&(n=Y().touches),n?Qu(n).map(function(n){var e=Un(t,n);return e.identifier=n.identifier,e}):[]},Uu.scale={},Uu.scale.linear=function(){return Bn([0,1],[0,1],Uu.interpolate,!1)},Uu.scale.log=function(){return ne(Uu.scale.linear().domain([0,Math.LN10]),10,ee,re)};var Xa=Uu.format(".0e");Uu.scale.pow=function(){return oe(Uu.scale.linear(),1)},Uu.scale.sqrt=function(){return Uu.scale.pow().exponent(.5)},Uu.scale.ordinal=function(){return le([],{t:"range",a:[[]]})},Uu.scale.category10=function(){return Uu.scale.ordinal().range(Ba)},Uu.scale.category20=function(){return Uu.scale.ordinal().range($a)},Uu.scale.category20b=function(){return Uu.scale.ordinal().range(Ja)},Uu.scale.category20c=function(){return Uu.scale.ordinal().range(Ga)};var Ba=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],$a=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Ja=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Ga=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];Uu.scale.quantile=function(){return fe([],[])},Uu.scale.quantize=function(){return se(0,1,[0,1])},Uu.scale.threshold=function(){return he([.5],[0,1])},Uu.scale.identity=function(){return ge([0,1])},Uu.svg={},Uu.svg.arc=function(){function t(){var t=n.apply(this,arguments),u=e.apply(this,arguments),a=r.apply(this,arguments)+Ka,o=i.apply(this,arguments)+Ka,c=(a>o&&(c=a,a=o,o=c),o-a),l=Ou>c?"0":"1",f=Math.cos(a),s=Math.sin(a),h=Math.cos(o),g=Math.sin(o);return c>=Wa?t?"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"Z":t?"M"+u*f+","+u*s+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*g+"L"+t*h+","+t*g+"A"+t+","+t+" 0 "+l+",0 "+t*f+","+t*s+"Z":"M"+u*f+","+u*s+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*g+"L0,0"+"Z"}var n=pe,e=de,r=me,i=ve;return t.innerRadius=function(e){return arguments.length?(n=f(e),t):n},t.outerRadius=function(n){return arguments.length?(e=f(n),t):e},t.startAngle=function(n){return arguments.length?(r=f(n),t):r},t.endAngle=function(n){return arguments.length?(i=f(n),t):i},t.centroid=function(){var t=(n.apply(this,arguments)+e.apply(this,arguments))/2,u=(r.apply(this,arguments)+i.apply(this,arguments))/2+Ka;return[Math.cos(u)*t,Math.sin(u)*t]},t};var Ka=-Ou/2,Wa=2*Ou-1e-6;Uu.svg.line=function(){return ye(c)};var Qa=Uu.map({linear:xe,"linear-closed":_e,"step-before":we,"step-after":Se,basis:qe,"basis-open":Ce,"basis-closed":ze,bundle:De,cardinal:Ae,"cardinal-open":ke,"cardinal-closed":Ee,monotone:Pe});Qa.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var to=[0,2/3,1/3,0],no=[0,1/3,2/3,0],eo=[0,1/6,2/3,1/6];Uu.svg.line.radial=function(){var t=ye(Oe);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},we.reverse=Se,Se.reverse=we,Uu.svg.area=function(){return Ye(c)},Uu.svg.area.radial=function(){var t=Ye(Oe);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},Uu.svg.chord=function(){function e(t,n){var e=r(this,o,t,n),l=r(this,c,t,n);return"M"+e.p0+u(e.r,e.p1,e.a1-e.a0)+(i(e,l)?a(e.r,e.p1,e.r,e.p0):a(e.r,e.p1,l.r,l.p0)+u(l.r,l.p1,l.a1-l.a0)+a(l.r,l.p1,e.r,e.p0))+"Z"}function r(t,n,e,r){var i=n.call(t,e,r),u=l.call(t,i,r),a=s.call(t,i,r)+Ka,o=h.call(t,i,r)+Ka;return{r:u,a0:a,a1:o,p0:[u*Math.cos(a),u*Math.sin(a)],p1:[u*Math.cos(o),u*Math.sin(o)]}}function i(t,n){return t.a0==n.a0&&t.a1==n.a1}function u(t,n,e){return"A"+t+","+t+" 0 "+ +(e>Ou)+",1 "+n}function a(t,n,e,r){return"Q 0,0 "+r}var o=n,c=t,l=Ue,s=me,h=ve;return e.radius=function(t){return arguments.length?(l=f(t),e):l},e.source=function(t){return arguments.length?(o=f(t),e):o},e.target=function(t){return arguments.length?(c=f(t),e):c},e.startAngle=function(t){return arguments.length?(s=f(t),e):s},e.endAngle=function(t){return arguments.length?(h=f(t),e):h},e},Uu.svg.diagonal=function(){function e(t,n){var e=r.call(this,t,n),a=i.call(this,t,n),o=(e.y+a.y)/2,c=[e,{x:e.x,y:o},{x:a.x,y:o},a];return c=c.map(u),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var r=n,i=t,u=Ie;return e.source=function(t){return arguments.length?(r=f(t),e):r},e.target=function(t){return arguments.length?(i=f(t),e):i},e.projection=function(t){return arguments.length?(u=t,e):u},e},Uu.svg.diagonal.radial=function(){var t=Uu.svg.diagonal(),n=Ie,e=t.projection;return t.projection=function(t){return arguments.length?e(Ve(n=t)):n},t},Uu.svg.symbol=function(){function t(t,r){return(ro.get(n.call(this,t,r))||Be)(e.call(this,t,r))}var n=Xe,e=Ze;return t.type=function(e){return arguments.length?(n=f(e),t):n},t.size=function(n){return arguments.length?(e=f(n),t):e},t};var ro=Uu.map({circle:Be,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*uo)),e=n*uo;return"M0,"+-n+"L"+e+",0"+" 0,"+n+" "+-e+",0"+"Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/io),e=n*io/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/io),e=n*io/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});Uu.svg.symbolTypes=ro.keys();var io=Math.sqrt(3),uo=Math.tan(30*Iu);Uu.svg.axis=function(){function t(t){t.each(function(){var t,s=Uu.select(this),h=null==l?e.ticks?e.ticks.apply(e,c):e.domain():l,g=null==n?e.tickFormat?e.tickFormat.apply(e,c):String:n,p=Ge(e,h,f),d=s.selectAll(".tick.minor").data(p,String),m=d.enter().insert("line",".tick").attr("class","tick minor").style("opacity",1e-6),v=Uu.transition(d.exit()).style("opacity",1e-6).remove(),y=Uu.transition(d).style("opacity",1),M=s.selectAll(".tick.major").data(h,String),b=M.enter().insert("g","path").attr("class","tick major").style("opacity",1e-6),x=Uu.transition(M.exit()).style("opacity",1e-6).remove(),_=Uu.transition(M).style("opacity",1),w=Zn(e),S=s.selectAll(".domain").data([0]),k=(S.enter().append("path").attr("class","domain"),Uu.transition(S)),E=e.copy(),A=this.__chart__||E;this.__chart__=E,b.append("line"),b.append("text");var N=b.select("line"),T=_.select("line"),q=M.select("text").text(g),C=b.select("text"),z=_.select("text");switch(r){case"bottom":t=$e,m.attr("y2",u),y.attr("x2",0).attr("y2",u),N.attr("y2",i),C.attr("y",Math.max(i,0)+o),T.attr("x2",0).attr("y2",i),z.attr("x",0).attr("y",Math.max(i,0)+o),q.attr("dy",".71em").style("text-anchor","middle"),k.attr("d","M"+w[0]+","+a+"V0H"+w[1]+"V"+a);break;case"top":t=$e,m.attr("y2",-u),y.attr("x2",0).attr("y2",-u),N.attr("y2",-i),C.attr("y",-(Math.max(i,0)+o)),T.attr("x2",0).attr("y2",-i),z.attr("x",0).attr("y",-(Math.max(i,0)+o)),q.attr("dy","0em").style("text-anchor","middle"),k.attr("d","M"+w[0]+","+-a+"V0H"+w[1]+"V"+-a);break;case"left":t=Je,m.attr("x2",-u),y.attr("x2",-u).attr("y2",0),N.attr("x2",-i),C.attr("x",-(Math.max(i,0)+o)),T.attr("x2",-i).attr("y2",0),z.attr("x",-(Math.max(i,0)+o)).attr("y",0),q.attr("dy",".32em").style("text-anchor","end"),k.attr("d","M"+-a+","+w[0]+"H0V"+w[1]+"H"+-a);break;case"right":t=Je,m.attr("x2",u),y.attr("x2",u).attr("y2",0),N.attr("x2",i),C.attr("x",Math.max(i,0)+o),T.attr("x2",i).attr("y2",0),z.attr("x",Math.max(i,0)+o).attr("y",0),q.attr("dy",".32em").style("text-anchor","start"),k.attr("d","M"+a+","+w[0]+"H0V"+w[1]+"H"+a)}if(e.ticks)b.call(t,A),_.call(t,E),x.call(t,E),m.call(t,A),y.call(t,E),v.call(t,E);else{var D=E.rangeBand()/2,j=function(t){return E(t)+D};b.call(t,j),_.call(t,j)}})}var n,e=Uu.scale.linear(),r=ao,i=6,u=6,a=6,o=3,c=[10],l=null,f=0;return t.scale=function(n){return arguments.length?(e=n,t):e},t.orient=function(n){return arguments.length?(r=n in oo?n+"":ao,t):r},t.ticks=function(){return arguments.length?(c=arguments,t):c},t.tickValues=function(n){return arguments.length?(l=n,t):l},t.tickFormat=function(e){return arguments.length?(n=e,t):n},t.tickSize=function(n,e){if(!arguments.length)return i;var r=arguments.length-1;return i=+n,u=r>1?+e:i,a=r>0?+arguments[r]:i,t},t.tickPadding=function(n){return arguments.length?(o=+n,t):o},t.tickSubdivide=function(n){return arguments.length?(f=+n,t):f},t};var ao="bottom",oo={top:1,right:1,bottom:1,left:1};Uu.svg.brush=function(){function t(u){u.each(function(){var u,a=Uu.select(this),f=a.selectAll(".background").data([0]),s=a.selectAll(".extent").data([0]),h=a.selectAll(".resize").data(l,String);a.style("pointer-events","all").on("mousedown.brush",i).on("touchstart.brush",i),f.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),s.enter().append("rect").attr("class","extent").style("cursor","move"),h.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return co[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",t.empty()?"none":null),h.exit().remove(),o&&(u=Zn(o),f.attr("x",u[0]).attr("width",u[1]-u[0]),e(a)),c&&(u=Zn(c),f.attr("y",u[0]).attr("height",u[1]-u[0]),r(a)),n(a)})}function n(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)][0]+","+f[+/^s/.test(t)][1]+")"})}function e(t){t.select(".extent").attr("x",f[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1][0]-f[0][0])}function r(t){t.select(".extent").attr("y",f[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1][1]-f[0][1])}function i(){function i(){var t=Uu.event.changedTouches;return t?Uu.touches(v,t)[0]:Uu.mouse(v)}function l(){32==Uu.event.keyCode&&(S||(d=null,k[0]-=f[1][0],k[1]-=f[1][1],S=2),O())}function s(){32==Uu.event.keyCode&&2==S&&(k[0]+=f[1][0],k[1]+=f[1][1],S=0,O())}function h(){var t=i(),u=!1;m&&(t[0]+=m[0],t[1]+=m[1]),S||(Uu.event.altKey?(d||(d=[(f[0][0]+f[1][0])/2,(f[0][1]+f[1][1])/2]),k[0]=f[+(t[0]l?(i=r,r=l):i=l),f[0][e]!==r||f[1][e]!==i?(u=null,f[0][e]=r,f[1][e]=i,!0):void 0}function p(){h(),b.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),Uu.select("body").style("cursor",null),E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),M({type:"brushend"}),O()}var d,m,v=this,y=Uu.select(Uu.event.target),M=a.of(v,arguments),b=Uu.select(v),x=y.datum(),_=!/^(n|s)$/.test(x)&&o,w=!/^(e|w)$/.test(x)&&c,S=y.classed("extent"),k=i(),E=Uu.select(Xu).on("mousemove.brush",h).on("mouseup.brush",p).on("touchmove.brush",h).on("touchend.brush",p).on("keydown.brush",l).on("keyup.brush",s);if(S)k[0]=f[0][0]-k[0],k[1]=f[0][1]-k[1];else if(x){var A=+/w$/.test(x),N=+/^n/.test(x);m=[f[1-A][0]-k[0],f[1-N][1]-k[1]],k[0]=f[A][0],k[1]=f[N][1]}else Uu.event.altKey&&(d=k.slice());b.style("pointer-events","none").selectAll(".resize").style("display",null),Uu.select("body").style("cursor",y.style("cursor")),M({type:"brushstart"}),h(),O()}var u,a=U(t,"brushstart","brush","brushend"),o=null,c=null,l=lo[0],f=[[0,0],[0,0]];return t.x=function(n){return arguments.length?(o=n,l=lo[!o<<1|!c],t):o},t.y=function(n){return arguments.length?(c=n,l=lo[!o<<1|!c],t):c},t.extent=function(n){var e,r,i,a,l;return arguments.length?(u=[[0,0],[0,0]],o&&(e=n[0],r=n[1],c&&(e=e[0],r=r[0]),u[0][0]=e,u[1][0]=r,o.invert&&(e=o(e),r=o(r)),e>r&&(l=e,e=r,r=l),f[0][0]=0|e,f[1][0]=0|r),c&&(i=n[0],a=n[1],o&&(i=i[1],a=a[1]),u[0][1]=i,u[1][1]=a,c.invert&&(i=c(i),a=c(a)),i>a&&(l=i,i=a,a=l),f[0][1]=0|i,f[1][1]=0|a),t):(n=u||f,o&&(e=n[0][0],r=n[1][0],u||(e=f[0][0],r=f[1][0],o.invert&&(e=o.invert(e),r=o.invert(r)),e>r&&(l=e,e=r,r=l))),c&&(i=n[0][1],a=n[1][1],u||(i=f[0][1],a=f[1][1],c.invert&&(i=c.invert(i),a=c.invert(a)),i>a&&(l=i,i=a,a=l))),o&&c?[[e,i],[r,a]]:o?[e,r]:c&&[i,a]) +},t.clear=function(){return u=null,f[0][0]=f[0][1]=f[1][0]=f[1][1]=0,t},t.empty=function(){return o&&f[0][0]===f[1][0]||c&&f[0][1]===f[1][1]},Uu.rebind(t,a,"on")};var co={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},lo=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];Uu.behavior={},Uu.behavior.drag=function(){function t(){this.on("mousedown.drag",n).on("touchstart.drag",n)}function n(){function t(){var t=o.parentNode;return null!=f?Uu.touches(t).filter(function(t){return t.identifier===f})[0]:Uu.mouse(t)}function n(){if(!o.parentNode)return i();var n=t(),e=n[0]-s[0],r=n[1]-s[1];h|=e|r,s=n,O(),c({type:"drag",x:n[0]+a[0],y:n[1]+a[1],dx:e,dy:r})}function i(){c({type:"dragend"}),h&&(O(),Uu.event.target===l&&g.on("click.drag",u,!0)),g.on(null!=f?"touchmove.drag-"+f:"mousemove.drag",null).on(null!=f?"touchend.drag-"+f:"mouseup.drag",null)}function u(){O(),g.on("click.drag",null)}var a,o=this,c=e.of(o,arguments),l=Uu.event.target,f=Uu.event.touches?Uu.event.changedTouches[0].identifier:null,s=t(),h=0,g=Uu.select(Xu).on(null!=f?"touchmove.drag-"+f:"mousemove.drag",n).on(null!=f?"touchend.drag-"+f:"mouseup.drag",i,!0);r?(a=r.apply(o,arguments),a=[a.x-s[0],a.y-s[1]]):a=[0,0],null==f&&O(),c({type:"dragstart"})}var e=U(t,"drag","dragstart","dragend"),r=null;return t.origin=function(n){return arguments.length?(r=n,t):r},Uu.rebind(t,e,"on")},Uu.behavior.zoom=function(){function t(){this.on("mousedown.zoom",o).on("mousemove.zoom",l).on(ho+".zoom",c).on("dblclick.zoom",f).on("touchstart.zoom",s).on("touchmove.zoom",h).on("touchend.zoom",s)}function n(t){return[(t[0]-b[0])/x,(t[1]-b[1])/x]}function e(t){return[t[0]*x+b[0],t[1]*x+b[1]]}function r(t){x=Math.max(_[0],Math.min(_[1],t))}function i(t,n){n=e(n),b[0]+=t[0]-n[0],b[1]+=t[1]-n[1]}function u(){m&&m.domain(d.range().map(function(t){return(t-b[0])/x}).map(d.invert)),y&&y.domain(v.range().map(function(t){return(t-b[1])/x}).map(v.invert))}function a(t){u(),Uu.event.preventDefault(),t({type:"zoom",scale:x,translate:b})}function o(){function t(){l=1,i(Uu.mouse(u),s),a(o)}function e(){l&&O(),f.on("mousemove.zoom",null).on("mouseup.zoom",null),l&&Uu.event.target===c&&f.on("click.zoom",r,!0)}function r(){O(),f.on("click.zoom",null)}var u=this,o=w.of(u,arguments),c=Uu.event.target,l=0,f=Uu.select(Xu).on("mousemove.zoom",t).on("mouseup.zoom",e),s=n(Uu.mouse(u));Xu.focus(),O()}function c(){g||(g=n(Uu.mouse(this))),r(Math.pow(2,.002*fo())*x),i(Uu.mouse(this),g),a(w.of(this,arguments))}function l(){g=null}function f(){var t=Uu.mouse(this),e=n(t),u=Math.log(x)/Math.LN2;r(Math.pow(2,Uu.event.shiftKey?Math.ceil(u)-1:Math.floor(u)+1)),i(t,e),a(w.of(this,arguments))}function s(){var t=Uu.touches(this),e=Date.now();if(p=x,g={},t.forEach(function(t){g[t.identifier]=n(t)}),O(),1===t.length){if(500>e-M){var u=t[0],o=n(t[0]);r(2*x),i(u,o),a(w.of(this,arguments))}M=e}}function h(){var t=Uu.touches(this),n=t[0],e=g[n.identifier];if(u=t[1]){var u,o=g[u.identifier];n=[(n[0]+u[0])/2,(n[1]+u[1])/2],e=[(e[0]+o[0])/2,(e[1]+o[1])/2],r(Uu.event.scale*p)}i(n,e),M=null,a(w.of(this,arguments))}var g,p,d,m,v,y,M,b=[0,0],x=1,_=so,w=U(t,"zoom");return t.translate=function(n){return arguments.length?(b=n.map(Number),u(),t):b},t.scale=function(n){return arguments.length?(x=+n,u(),t):x},t.scaleExtent=function(n){return arguments.length?(_=null==n?so:n.map(Number),t):_},t.x=function(n){return arguments.length?(m=n,d=n.copy(),b=[0,0],x=1,t):m},t.y=function(n){return arguments.length?(y=n,v=n.copy(),b=[0,0],x=1,t):y},Uu.rebind(t,w,"on")};var fo,so=[0,1/0],ho="onwheel"in document?(fo=function(){return-Uu.event.deltaY*(Uu.event.deltaMode?120:1)},"wheel"):"onmousewheel"in document?(fo=function(){return Uu.event.wheelDelta},"mousewheel"):(fo=function(){return-Uu.event.detail},"MozMousePixelScroll");Uu.layout={},Uu.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;r>++e;)n.push(Ke(t[e]));return n}},Uu.layout.chord=function(){function t(){var t,l,s,h,g,p={},d=[],m=Uu.range(u),v=[];for(e=[],r=[],t=0,h=-1;u>++h;){for(l=0,g=-1;u>++g;)l+=i[h][g];d.push(l),v.push(Uu.range(u)),t+=l}for(a&&m.sort(function(t,n){return a(d[t],d[n])}),o&&v.forEach(function(t,n){t.sort(function(t,e){return o(i[n][t],i[n][e])})}),t=(2*Ou-f*u)/t,l=0,h=-1;u>++h;){for(s=l,g=-1;u>++g;){var y=m[h],M=v[y][g],b=i[y][M],x=l,_=l+=b*t;p[y+"-"+M]={index:y,subindex:M,startAngle:x,endAngle:_,value:b}}r[y]={index:y,startAngle:s,endAngle:l,value:(l-s)/t},l+=f}for(h=-1;u>++h;)for(g=h-1;u>++g;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value(i-e)*o){var c=n.charge*o*o;return t.px-=u*c,t.py-=a*c,!0}if(n.point&&isFinite(o)){var c=n.pointCharge*o*o;t.px-=u*c,t.py-=a*c}}return!n.charge}}function n(t){t.px=Uu.event.x,t.py=Uu.event.y,o.resume()}var e,r,i,u,a,o={},l=Uu.dispatch("start","tick","end"),f=[1,1],s=.9,h=go,g=po,p=-30,d=.1,m=.8,v=[],y=[];return o.tick=function(){if(.005>(r*=.99))return l.end({type:"end",alpha:r=0}),!0;var n,e,o,c,h,g,m,M,b,x=v.length,_=y.length;for(e=0;_>e;++e)o=y[e],c=o.source,h=o.target,M=h.x-c.x,b=h.y-c.y,(g=M*M+b*b)&&(g=r*u[e]*((g=Math.sqrt(g))-i[e])/g,M*=g,b*=g,h.x-=M*(m=c.weight/(h.weight+c.weight)),h.y-=b*m,c.x+=M*(m=1-m),c.y+=b*m);if((m=r*d)&&(M=f[0]/2,b=f[1]/2,e=-1,m))for(;x>++e;)o=v[e],o.x+=(M-o.x)*m,o.y+=(b-o.y)*m;if(p)for(ir(n=Uu.geom.quadtree(v),r,a),e=-1;x>++e;)(o=v[e]).fixed||n.visit(t(o));for(e=-1;x>++e;)o=v[e],o.fixed?(o.x=o.px,o.y=o.py):(o.x-=(o.px-(o.px=o.x))*s,o.y-=(o.py-(o.py=o.y))*s);l.tick({type:"tick",alpha:r})},o.nodes=function(t){return arguments.length?(v=t,o):v},o.links=function(t){return arguments.length?(y=t,o):y},o.size=function(t){return arguments.length?(f=t,o):f},o.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,o):h},o.distance=o.linkDistance,o.linkStrength=function(t){return arguments.length?(g="function"==typeof t?t:+t,o):g},o.friction=function(t){return arguments.length?(s=+t,o):s},o.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,o):p},o.gravity=function(t){return arguments.length?(d=+t,o):d},o.theta=function(t){return arguments.length?(m=+t,o):m},o.alpha=function(t){return arguments.length?(t=+t,r?r=t>0?t:0:t>0&&(l.start({type:"start",alpha:r=t}),Uu.timer(o.tick)),o):r},o.start=function(){function t(t,r){for(var i,u=n(e),a=-1,o=u.length;o>++a;)if(!isNaN(i=u[a][t]))return i;return Math.random()*r}function n(){if(!c){for(c=[],r=0;s>r;++r)c[r]=[];for(r=0;d>r;++r){var t=y[r];c[t.source.index].push(t.target),c[t.target.index].push(t.source)}}return c[e]}var e,r,c,l,s=v.length,d=y.length,m=f[0],M=f[1];for(e=0;s>e;++e)(l=v[e]).index=e,l.weight=0;for(e=0;d>e;++e)l=y[e],"number"==typeof l.source&&(l.source=v[l.source]),"number"==typeof l.target&&(l.target=v[l.target]),++l.source.weight,++l.target.weight;for(e=0;s>e;++e)l=v[e],isNaN(l.x)&&(l.x=t("x",m)),isNaN(l.y)&&(l.y=t("y",M)),isNaN(l.px)&&(l.px=l.x),isNaN(l.py)&&(l.py=l.y);if(i=[],"function"==typeof h)for(e=0;d>e;++e)i[e]=+h.call(this,y[e],e);else for(e=0;d>e;++e)i[e]=h;if(u=[],"function"==typeof g)for(e=0;d>e;++e)u[e]=+g.call(this,y[e],e);else for(e=0;d>e;++e)u[e]=g;if(a=[],"function"==typeof p)for(e=0;s>e;++e)a[e]=+p.call(this,v[e],e);else for(e=0;s>e;++e)a[e]=p;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return e||(e=Uu.behavior.drag().origin(c).on("dragstart.force",tr).on("drag.force",n).on("dragend.force",nr)),arguments.length?(this.on("mouseover.force",er).on("mouseout.force",rr).call(e),void 0):e},Uu.rebind(o,l,"on")};var go=20,po=1;Uu.layout.partition=function(){function t(n,e,r,i){var u=n.children;if(n.x=e,n.y=n.depth*i,n.dx=r,n.dy=i,u&&(a=u.length)){var a,o,c,l=-1;for(r=n.value?r/n.value:0;a>++l;)t(o=u[l],e,c=o.value*r,i),e+=c}}function n(t){var e=t.children,r=0;if(e&&(i=e.length))for(var i,u=-1;i>++u;)r=Math.max(r,n(e[u]));return 1+r}function e(e,u){var a=r.call(this,e,u);return t(a[0],0,i[0],i[1]/n(a[0])),a}var r=Uu.layout.hierarchy(),i=[1,1];return e.size=function(t){return arguments.length?(i=t,e):i},mr(e,r)},Uu.layout.pie=function(){function t(u){var a=u.map(function(e,r){return+n.call(t,e,r)}),o=+("function"==typeof r?r.apply(this,arguments):r),c=(("function"==typeof i?i.apply(this,arguments):i)-r)/Uu.sum(a),l=Uu.range(u.length);null!=e&&l.sort(e===mo?function(t,n){return a[n]-a[t]}:function(t,n){return e(u[t],u[n])});var f=[];return l.forEach(function(t){var n;f[t]={data:u[t],value:n=a[t],startAngle:o,endAngle:o+=n*c}}),f}var n=Number,e=mo,r=0,i=2*Ou;return t.value=function(e){return arguments.length?(n=e,t):n},t.sort=function(n){return arguments.length?(e=n,t):e},t.startAngle=function(n){return arguments.length?(r=n,t):r},t.endAngle=function(n){return arguments.length?(i=n,t):i},t};var mo={};Uu.layout.stack=function(){function t(o,c){var l=o.map(function(e,r){return n.call(t,e,r)}),f=l.map(function(n){return n.map(function(n,e){return[u.call(t,n,e),a.call(t,n,e)]})}),s=e.call(t,f,c);l=Uu.permute(l,s),f=Uu.permute(f,s);var h,g,p,d=r.call(t,f,c),m=l.length,v=l[0].length;for(g=0;v>g;++g)for(i.call(t,l[0][g],p=d[g],f[0][g][1]),h=1;m>h;++h)i.call(t,l[h][g],p+=f[h-1][g][1],f[h][g][1]);return o}var n=c,e=cr,r=lr,i=or,u=ur,a=ar;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(n){return arguments.length?(e="function"==typeof n?n:vo.get(n)||cr,t):e},t.offset=function(n){return arguments.length?(r="function"==typeof n?n:yo.get(n)||lr,t):r},t.x=function(n){return arguments.length?(u=n,t):u},t.y=function(n){return arguments.length?(a=n,t):a},t.out=function(n){return arguments.length?(i=n,t):i},t};var vo=Uu.map({"inside-out":function(t){var n,e,r=t.length,i=t.map(fr),u=t.map(sr),a=Uu.range(r).sort(function(t,n){return i[t]-i[n]}),o=0,c=0,l=[],f=[];for(n=0;r>n;++n)e=a[n],c>o?(o+=u[e],l.push(e)):(c+=u[e],f.push(e));return f.reverse().concat(l)},reverse:function(t){return Uu.range(t.length).reverse()},"default":cr}),yo=Uu.map({silhouette:function(t){var n,e,r,i=t.length,u=t[0].length,a=[],o=0,c=[];for(e=0;u>e;++e){for(n=0,r=0;i>n;n++)r+=t[n][e][1];r>o&&(o=r),a.push(r)}for(e=0;u>e;++e)c[e]=(o-a[e])/2;return c},wiggle:function(t){var n,e,r,i,u,a,o,c,l,f=t.length,s=t[0],h=s.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(n=0,i=0;f>n;++n)i+=t[n][e][1];for(n=0,u=0,o=s[e][0]-s[e-1][0];f>n;++n){for(r=0,a=(t[n][e][1]-t[n][e-1][1])/(2*o);n>r;++r)a+=(t[r][e][1]-t[r][e-1][1])/o;u+=a*t[n][e][1]}g[e]=c-=i?u/i*o:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(t){var n,e,r,i=t.length,u=t[0].length,a=1/i,o=[];for(e=0;u>e;++e){for(n=0,r=0;i>n;n++)r+=t[n][e][1];if(r)for(n=0;i>n;n++)t[n][e][1]/=r;else for(n=0;i>n;n++)t[n][e][1]=a}for(e=0;u>e;++e)o[e]=0;return o},zero:lr});Uu.layout.histogram=function(){function t(t,u){for(var a,o,c=[],l=t.map(e,this),f=r.call(this,l,u),s=i.call(this,f,l,u),u=-1,h=l.length,g=s.length-1,p=n?1:1/h;g>++u;)a=c[u]=[],a.dx=s[u+1]-(a.x=s[u]),a.y=0;if(g>0)for(u=-1;h>++u;)o=l[u],o>=f[0]&&f[1]>=o&&(a=c[Uu.bisect(s,o,1,g)-1],a.y+=p,a.push(t[u]));return c}var n=!0,e=Number,r=dr,i=gr;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=f(n),t):r},t.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return pr(t,n)}:f(n),t):i},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},Uu.layout.hierarchy=function(){function t(n,a,o){var c=i.call(e,n,a);if(n.depth=a,o.push(n),c&&(l=c.length)){for(var l,f,s=-1,h=n.children=[],g=0,p=a+1;l>++s;)f=t(c[s],p,o),f.parent=n,h.push(f),g+=f.value;r&&h.sort(r),u&&(n.value=g)}else u&&(n.value=+u.call(e,n,a)||0);return n}function n(t,r){var i=t.children,a=0;if(i&&(o=i.length))for(var o,c=-1,l=r+1;o>++c;)a+=n(i[c],l);else u&&(a=+u.call(e,t,r)||0);return u&&(t.value=a),a}function e(n){var e=[];return t(n,0,e),e}var r=Mr,i=vr,u=yr;return e.sort=function(t){return arguments.length?(r=t,e):r},e.children=function(t){return arguments.length?(i=t,e):i},e.value=function(t){return arguments.length?(u=t,e):u},e.revalue=function(t){return n(t,0),t},e},Uu.layout.pack=function(){function t(t,i){var u=n.call(this,t,i),a=u[0];a.x=0,a.y=0,Yr(a,function(t){t.r=Math.sqrt(t.value)}),Yr(a,kr);var o=r[0],c=r[1],l=Math.max(2*a.r/o,2*a.r/c);if(e>0){var f=e*l/2;Yr(a,function(t){t.r+=f}),Yr(a,kr),Yr(a,function(t){t.r-=f}),l=Math.max(2*a.r/o,2*a.r/c)}return Nr(a,o/2,c/2,1/l),u}var n=Uu.layout.hierarchy().sort(xr),e=0,r=[1,1];return t.size=function(n){return arguments.length?(r=n,t):r},t.padding=function(n){return arguments.length?(e=+n,t):e},mr(t,n)},Uu.layout.cluster=function(){function t(t,i){var u,a=n.call(this,t,i),o=a[0],c=0;Yr(o,function(t){var n=t.children;n&&n.length?(t.x=Cr(n),t.y=qr(n)):(t.x=u?c+=e(t,u):0,t.y=0,u=t)});var l=zr(o),f=Dr(o),s=l.x-e(l,f)/2,h=f.x+e(f,l)/2;return Yr(o,function(t){t.x=(t.x-s)/(h-s)*r[0],t.y=(1-(o.y?t.y/o.y:1))*r[1]}),a}var n=Uu.layout.hierarchy().sort(null).value(null),e=jr,r=[1,1];return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(r=n,t):r},mr(t,n)},Uu.layout.tree=function(){function t(t,i){function u(t,n){var r=t.children,i=t._tree;if(r&&(a=r.length)){for(var a,c,l,f=r[0],s=f,h=-1;a>++h;)l=r[h],u(l,c),s=o(l,c,s),c=l;Ur(t);var g=.5*(f._tree.prelim+l._tree.prelim);n?(i.prelim=n._tree.prelim+e(t,n),i.mod=i.prelim-g):i.prelim=g}else n&&(i.prelim=n._tree.prelim+e(t,n))}function a(t,n){t.x=t._tree.prelim+n;var e=t.children;if(e&&(r=e.length)){var r,i=-1;for(n+=t._tree.mod;r>++i;)a(e[i],n)}}function o(t,n,r){if(n){for(var i,u=t,a=t,o=n,c=t.parent.children[0],l=u._tree.mod,f=a._tree.mod,s=o._tree.mod,h=c._tree.mod;o=Fr(o),u=Lr(u),o&&u;)c=Lr(c),a=Fr(a),a._tree.ancestor=t,i=o._tree.prelim+s-u._tree.prelim-l+e(o,u),i>0&&(Ir(Vr(o,t,r),t,i),l+=i,f+=i),s+=o._tree.mod,l+=u._tree.mod,h+=c._tree.mod,f+=a._tree.mod;o&&!Fr(a)&&(a._tree.thread=o,a._tree.mod+=s-f),u&&!Lr(c)&&(c._tree.thread=u,c._tree.mod+=l-h,r=t)}return r}var c=n.call(this,t,i),l=c[0];Yr(l,function(t,n){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:n?n._tree.number+1:0}}),u(l),a(l,-l._tree.prelim);var f=Hr(l,Pr),s=Hr(l,Rr),h=Hr(l,Or),g=f.x-e(f,s)/2,p=s.x+e(s,f)/2,d=h.depth||1;return Yr(l,function(t){t.x=(t.x-g)/(p-g)*r[0],t.y=t.depth/d*r[1],delete t._tree}),c}var n=Uu.layout.hierarchy().sort(null).value(null),e=jr,r=[1,1];return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(r=n,t):r},mr(t,n)},Uu.layout.treemap=function(){function t(t,n){for(var e,r,i=-1,u=t.length;u>++i;)r=(e=t[i]).value*(0>n?0:n),e.area=isNaN(r)||0>=r?0:r}function n(e){var u=e.children;if(u&&u.length){var a,o,c,l=s(e),f=[],h=u.slice(),p=1/0,d="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(t(h,l.dx*l.dy/e.value),f.area=0;(c=h.length)>0;)f.push(a=h[c-1]),f.area+=a.area,"squarify"!==g||p>=(o=r(f,d))?(h.pop(),p=o):(f.area-=f.pop().area,i(f,d,l,!1),d=Math.min(l.dx,l.dy),f.length=f.area=0,p=1/0);f.length&&(i(f,d,l,!0),f.length=f.area=0),u.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var u,a=s(n),o=r.slice(),c=[];for(t(o,a.dx*a.dy/n.value),c.area=0;u=o.pop();)c.push(u),c.area+=u.area,null!=u.z&&(i(c,u.z?a.dx:a.dy,a,!o.length),c.length=c.area=0);r.forEach(e)}}function r(t,n){for(var e,r=t.area,i=0,u=1/0,a=-1,o=t.length;o>++a;)(e=t[a].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,n*=n,r?Math.max(n*i*p/r,r/(n*u*p)):1/0}function i(t,n,e,r){var i,u=-1,a=t.length,o=e.x,l=e.y,f=n?c(t.area/n):0;if(n==e.dx){for((r||f>e.dy)&&(f=e.dy);a>++u;)i=t[u],i.x=o,i.y=l,i.dy=f,o+=i.dx=Math.min(e.x+e.dx-o,f?c(i.area/f):0);i.z=!0,i.dx+=e.x+e.dx-o,e.y+=f,e.dy-=f}else{for((r||f>e.dx)&&(f=e.dx);a>++u;)i=t[u],i.x=o,i.y=l,i.dx=f,l+=i.dy=Math.min(e.y+e.dy-l,f?c(i.area/f):0);i.z=!1,i.dy+=e.y+e.dy-l,e.x+=f,e.dx-=f}}function u(r){var i=a||o(r),u=i[0];return u.x=0,u.y=0,u.dx=l[0],u.dy=l[1],a&&o.revalue(u),t([u],u.dx*u.dy/u.value),(a?e:n)(u),h&&(a=i),i}var a,o=Uu.layout.hierarchy(),c=Math.round,l=[1,1],f=null,s=Zr,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return u.size=function(t){return arguments.length?(l=t,u):l},u.padding=function(t){function n(n){var e=t.call(u,n,n.depth);return null==e?Zr(n):Xr(n,"number"==typeof e?[e,e,e,e]:e)}function e(n){return Xr(n,t)}if(!arguments.length)return f;var r;return s=null==(f=t)?Zr:"function"==(r=typeof t)?n:"number"===r?(t=[t,t,t,t],e):e,u},u.round=function(t){return arguments.length?(c=t?Math.round:Number,u):c!=Number},u.sticky=function(t){return arguments.length?(h=t,a=null,u):h},u.ratio=function(t){return arguments.length?(p=t,u):p},u.mode=function(t){return arguments.length?(g=t+"",u):g},mr(u,o)},Uu.layout.voronoi=function(){function t(t){var e,u,a,o=[],c=f(r),l=f(i),s=t.length;for(a=0;s>a;++a)o.push([+c.call(this,u=t[a],a),+l.call(this,u,a)]);for(e=Uu.geom.voronoi(o),a=0;s>a;++a)e[a].data=t[a];if(n)for(a=0;s>a;++a)n(e[a]);return e}var n,e=null,r=Me,i=be;return t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=n,t):i},t.size=function(r){if(!arguments.length)return e;if(null==r)n=null;else{var i=+r[0],u=+r[1];n=Uu.geom.polygon([[0,0],[0,u],[i,u],[i,0]]).clip}return t},t},Uu.csv=Br(",","text/csv"),Uu.tsv=Br(" ","text/tab-separated-values"),Uu.geo={},Uu.geo.stream=function(t,n){Mo.hasOwnProperty(t.type)?Mo[t.type](t,n):$r(t,n)};var Mo={Feature:function(t,n){$r(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;i>++r;)$r(e[r].geometry,n)}},bo={Sphere:function(t,n){n.sphere()},Point:function(t,n){var e=t.coordinates;n.point(e[0],e[1])},MultiPoint:function(t,n){for(var e,r=t.coordinates,i=-1,u=r.length;u>++i;)e=r[i],n.point(e[0],e[1])},LineString:function(t,n){Jr(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;i>++r;)Jr(e[r],n,0)},Polygon:function(t,n){Gr(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;i>++r;)Gr(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;i>++r;)$r(e[r],n)}};Uu.geo.distance=function(t,n){var e,r=(n[0]-t[0])*Iu,i=t[1]*Iu,u=n[1]*Iu,a=Math.sin(r),o=Math.cos(r),c=Math.sin(i),l=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*a)*e+(e=l*f-c*s*o)*e),c*f+l*s*o)},Uu.geo.albersUsa=function(){function t(t){return n(t)(t)}function n(t){var n=t[0],e=t[1];return e>50?a:-140>n?o:21>e?c:u}var e,r,i,u=Uu.geo.albers(),a=Uu.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),o=Uu.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),c=Uu.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);return t.invert=function(t){return e(t)||r(t)||i(t)||u.invert(t)},t.scale=function(n){return arguments.length?(u.scale(n),a.scale(.6*n),o.scale(n),c.scale(1.5*n),t.translate(u.translate())):u.scale()},t.translate=function(n){if(!arguments.length)return u.translate();var l=u.scale(),f=n[0],s=n[1];return u.translate(n),a.translate([f-.4*l,s+.17*l]),o.translate([f-.19*l,s+.2*l]),c.translate([f+.58*l,s+.43*l]),e=ai(a,[[-180,50],[-130,72]]),r=ai(o,[[-164,18],[-154,24]]),i=ai(c,[[-67.5,17.5],[-65,19]]),t},t.scale(u.scale())},(Uu.geo.albers=function(){var t=29.5*Iu,n=45.5*Iu,e=Bi(oi),r=e(t,n);return r.parallels=function(r){return arguments.length?e(t=r[0]*Iu,n=r[1]*Iu):[t*Vu,n*Vu]},r.rotate([98,0]).center([0,38]).scale(1e3)}).raw=oi;var xo=Qi(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Uu.geo.azimuthalEqualArea=function(){return Xi(xo)}).raw=xo;var _o=Qi(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},c);(Uu.geo.azimuthalEquidistant=function(){return Xi(_o)}).raw=_o,Uu.geo.bounds=ci(c),Uu.geo.centroid=function(t){wo=So=ko=Eo=Ao=0,Uu.geo.stream(t,No);var n;return So&&Math.abs(n=Math.sqrt(ko*ko+Eo*Eo+Ao*Ao))>Yu?[Math.atan2(Eo,ko)*Vu,Math.asin(Math.max(-1,Math.min(1,Ao/n)))*Vu]:void 0};var wo,So,ko,Eo,Ao,No={sphere:function(){2>wo&&(wo=2,So=ko=Eo=Ao=0)},point:li,lineStart:si,lineEnd:hi,polygonStart:function(){2>wo&&(wo=2,So=ko=Eo=Ao=0),No.lineStart=fi},polygonEnd:function(){No.lineStart=si}};Uu.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,n=Ji(-t[0]*Iu,-t[1]*Iu,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Vu,t[1]*=Vu}}),{type:"Polygon",coordinates:[i]}}var n,e,r=[0,0],i=6;return t.origin=function(n){return arguments.length?(r=n,t):r},t.angle=function(r){return arguments.length?(e=gi((n=+r)*Iu,i*Iu),t):n},t.precision=function(r){return arguments.length?(e=gi(n*Iu,(i=+r)*Iu),t):i},t.angle(90)};var To=di(l,bi,_i);(Uu.geo.equirectangular=function(){return Xi(Ti).scale(250/Ou)}).raw=Ti.invert=Ti;var qo=Qi(function(t){return 1/t},Math.atan);(Uu.geo.gnomonic=function(){return Xi(qo)}).raw=qo,Uu.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return Uu.range(Math.ceil(u/m)*m,i,m).map(h).concat(Uu.range(Math.ceil(l/v)*v,c,v).map(g)).concat(Uu.range(Math.ceil(r/p)*p,e,p).filter(function(t){return Math.abs(t%m)>Yu}).map(f)).concat(Uu.range(Math.ceil(o/d)*d,a,d).filter(function(t){return Math.abs(t%v)>Yu}).map(s))}var e,r,i,u,a,o,c,l,f,s,h,g,p=10,d=p,m=90,v=360,y=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(g(c).slice(1),h(i).reverse().slice(1),g(l).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.majorExtent(n).minorExtent(n):t.minorExtent()},t.majorExtent=function(n){return arguments.length?(u=+n[0][0],i=+n[1][0],l=+n[0][1],c=+n[1][1],u>i&&(n=u,u=i,i=n),l>c&&(n=l,l=c,c=n),t.precision(y)):[[u,l],[i,c]]},t.minorExtent=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],o=+n[0][1],a=+n[1][1],r>e&&(n=r,r=e,e=n),o>a&&(n=o,o=a,a=n),t.precision(y)):[[r,o],[e,a]]},t.step=function(n){return arguments.length?t.majorStep(n).minorStep(n):t.minorStep()},t.majorStep=function(n){return arguments.length?(m=+n[0],v=+n[1],t):[m,v]},t.minorStep=function(n){return arguments.length?(p=+n[0],d=+n[1],t):[p,d]},t.precision=function(n){return arguments.length?(y=+n,f=qi(o,a,90),s=Ci(r,e,y),h=qi(l,c,90),g=Ci(u,i,y),t):y},t.majorExtent([[-180,-90+Yu],[180,90-Yu]]).minorExtent([[-180,-80-Yu],[180,80+Yu]])},Uu.geo.interpolate=function(t,n){return Di(t[0]*Iu,t[1]*Iu,n[0]*Iu,n[1]*Iu)},Uu.geo.greatArc=function(){function e(){return{type:"LineString",coordinates:[r||u.apply(this,arguments),i||a.apply(this,arguments)]}}var r,i,u=n,a=t;return e.distance=function(){return Uu.geo.distance(r||u.apply(this,arguments),i||a.apply(this,arguments))},e.source=function(t){return arguments.length?(u=t,r="function"==typeof t?null:t,e):u},e.target=function(t){return arguments.length?(a=t,i="function"==typeof t?null:t,e):a},e.precision=function(){return arguments.length?e:0},e},ji.invert=function(t,n){return[2*Ou*t,2*Math.atan(Math.exp(2*Ou*n))-Ou/2]},(Uu.geo.mercator=function(){return Xi(ji).scale(500)}).raw=ji;var Co=Qi(function(){return 1},Math.asin);(Uu.geo.orthographic=function(){return Xi(Co)}).raw=Co,Uu.geo.path=function(){function t(t){return t&&Uu.geo.stream(t,r(i.pointRadius("function"==typeof u?+u.apply(this,arguments):u))),i.result()}var n,e,r,i,u=4.5;return t.area=function(t){return zo=0,Uu.geo.stream(t,r(jo)),zo},t.centroid=function(t){return wo=ko=Eo=Ao=0,Uu.geo.stream(t,r(Lo)),Ao?[ko/Ao,Eo/Ao]:void 0},t.bounds=function(t){return ci(r)(t)},t.projection=function(e){return arguments.length?(r=(n=e)?e.stream||Fi(e):c,t):n},t.context=function(n){return arguments.length?(i=null==(e=n)?new Hi:new Ri(n),t):e},t.pointRadius=function(n){return arguments.length?(u="function"==typeof n?n:+n,t):u},t.projection(Uu.geo.albersUsa()).context(null)};var zo,Do,jo={point:In,lineStart:In,lineEnd:In,polygonStart:function(){Do=0,jo.lineStart=Pi},polygonEnd:function(){jo.lineStart=jo.lineEnd=jo.point=In,zo+=Math.abs(Do/2)}},Lo={point:Oi,lineStart:Yi,lineEnd:Ui,polygonStart:function(){Lo.lineStart=Ii},polygonEnd:function(){Lo.point=Oi,Lo.lineStart=Yi,Lo.lineEnd=Ui}};Uu.geo.area=function(t){return Fo=0,Uu.geo.stream(t,Po),Fo};var Fo,Ho,Ro,Po={sphere:function(){Fo+=4*Ou},point:In,lineStart:In,lineEnd:In,polygonStart:function(){Ho=1,Ro=0,Po.lineStart=Vi},polygonEnd:function(){var t=2*Math.atan2(Ro,Ho);Fo+=0>t?4*Ou+t:t,Po.lineStart=Po.lineEnd=Po.point=In}};Uu.geo.length=function(t){return Oo=0,Uu.geo.stream(t,Yo),Oo};var Oo,Yo={sphere:In,point:In,lineStart:Zi,lineEnd:In,polygonStart:In,polygonEnd:In};Uu.geo.projection=Xi,Uu.geo.projectionMutator=Bi,Uu.geo.rotation=function(t){return t=Ji(t[0]%360*Iu,t[1]*Iu,t.length>2?t[2]*Iu:0),function(n){return n=t(n[0]*Iu,n[1]*Iu),n[0]*=Vu,n[1]*=Vu,n}};var Uo=Qi(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Uu.geo.stereographic=function(){return Xi(Uo)}).raw=Uo,Uu.geom={},Uu.geom.hull=function(t){if(3>t.length)return[];var n,e,r,i,u,a,o,c,l,f,s=t.length,h=s-1,g=[],p=[],d=0;for(n=1;s>n;++n)t[n][1]n;++n)n!==d&&(i=t[n][1]-t[d][1],r=t[n][0]-t[d][0],g.push({angle:Math.atan2(i,r),index:n}));for(g.sort(function(t,n){return t.angle-n.angle}),l=g[0].angle,c=g[0].index,o=0,n=1;h>n;++n)e=g[n].index,l==g[n].angle?(r=t[c][0]-t[d][0],i=t[c][1]-t[d][1],u=t[e][0]-t[d][0],a=t[e][1]-t[d][1],r*r+i*i>=u*u+a*a?g[n].index=-1:(g[o].index=-1,l=g[n].angle,o=n,c=e)):(l=g[n].angle,o=n,c=e);for(p.push(d),n=0,e=0;2>n;++e)-1!==g[e].index&&(p.push(g[e].index),n++);for(f=p.length;h>e;++e)if(-1!==g[e].index){for(;!tu(p[f-2],p[f-1],g[e].index,t);)--f;p[f++]=g[e].index}var m=[];for(n=0;f>n;++n)m.push(t[p[n]]);return m},Uu.geom.polygon=function(t){return t.area=function(){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];e>++n;)r+=t[n-1][1]*t[n][0]-t[n-1][0]*t[n][1];return.5*r},t.centroid=function(n){var e,r,i=-1,u=t.length,a=0,o=0,c=t[u-1];for(arguments.length||(n=-1/(6*t.area()));u>++i;)e=c,c=t[i],r=e[0]*c[1]-c[0]*e[1],a+=(e[0]+c[0])*r,o+=(e[1]+c[1])*r;return[a*n,o*n]},t.clip=function(n){for(var e,r,i,u,a,o,c=-1,l=t.length,f=t[l-1];l>++c;){for(e=n.slice(),n.length=0,u=t[c],a=e[(i=e.length)-1],r=-1;i>++r;)o=e[r],nu(o,f,u)?(nu(a,f,u)||n.push(eu(a,o,f,u)),n.push(o)):nu(a,f,u)&&n.push(eu(a,o,f,u)),a=o;f=u}return n},t},Uu.geom.voronoi=function(t){var n=t.map(function(){return[]}),e=1e6;return ru(t,function(t){var r,i,u,a,o,c;1===t.a&&t.b>=0?(r=t.ep.r,i=t.ep.l):(r=t.ep.l,i=t.ep.r),1===t.a?(o=r?r.y:-e,u=t.c-t.b*o,c=i?i.y:e,a=t.c-t.b*c):(u=r?r.x:-e,o=t.c-t.a*u,a=i?i.x:e,c=t.c-t.a*a);var l=[u,o],f=[a,c];n[t.region.l.index].push(l,f),n[t.region.r.index].push(l,f)}),n=n.map(function(n,e){var r=t[e][0],i=t[e][1],u=n.map(function(t){return Math.atan2(t[0]-r,t[1]-i)}),a=Uu.range(n.length).sort(function(t,n){return u[t]-u[n]});return a.filter(function(t,n){return!n||u[t]-u[a[n-1]]>Yu}).map(function(t){return n[t]})}),n.forEach(function(n,r){var i=n.length;if(!i)return n.push([-e,-e],[-e,e],[e,e],[e,-e]);if(!(i>2)){var u=t[r],a=n[0],o=n[1],c=u[0],l=u[1],f=a[0],s=a[1],h=o[0],g=o[1],p=Math.abs(h-f),d=g-s;if(Yu>Math.abs(d)){var m=s>l?-e:e;n.push([-e,m],[e,m])}else if(Yu>p){var v=f>c?-e:e;n.push([v,-e],[v,e])}else{var m=(f-c)*(g-s)>(h-f)*(s-l)?e:-e,y=Math.abs(d)-p;Yu>Math.abs(y)?n.push([0>d?m:-m,m]):(y>0&&(m*=-1),n.push([-e,m],[e,m]))}}}),n};var Io={l:"r",r:"l"};Uu.geom.delaunay=function(t){var n=t.map(function(){return[]}),e=[];return ru(t,function(e){n[e.region.l.index].push(t[e.region.r.index])}),n.forEach(function(n,r){var i=t[r],u=i[0],a=i[1];n.forEach(function(t){t.angle=Math.atan2(t[0]-u,t[1]-a)}),n.sort(function(t,n){return t.angle-n.angle});for(var o=0,c=n.length-1;c>o;o++)e.push([i,n[o],n[o+1]])}),e},Uu.geom.quadtree=function(t,n,e,r,i){function u(t,n,e,r,i,u){if(!isNaN(n.x)&&!isNaN(n.y))if(t.leaf){var o=t.point;o?.01>Math.abs(o.x-n.x)+Math.abs(o.y-n.y)?a(t,n,e,r,i,u):(t.point=null,a(t,o,e,r,i,u),a(t,n,e,r,i,u)):t.point=n}else a(t,n,e,r,i,u)}function a(t,n,e,r,i,a){var o=.5*(e+i),c=.5*(r+a),l=n.x>=o,f=n.y>=c,s=(f<<1)+l;t.leaf=!1,t=t.nodes[s]||(t.nodes[s]=iu()),l?e=o:i=o,f?r=c:a=c,u(t,n,e,r,i,a)}var o,c=-1,l=t.length;if(5>arguments.length)if(3===arguments.length)i=e,r=n,e=n=0;else for(n=e=1/0,r=i=-1/0;l>++c;)o=t[c],n>o.x&&(n=o.x),e>o.y&&(e=o.y),o.x>r&&(r=o.x),o.y>i&&(i=o.y);var f=r-n,s=i-e;f>s?i=e+f:r=n+s;var h=iu();return h.add=function(t){u(h,t,n,e,r,i)},h.visit=function(t){uu(t,h,n,e,r,i)},t.forEach(h.add),h},Uu.time={};var Vo=Date,Zo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];au.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(){Xo.setUTCDate.apply(this._,arguments)},setDay:function(){Xo.setUTCDay.apply(this._,arguments)},setFullYear:function(){Xo.setUTCFullYear.apply(this._,arguments)},setHours:function(){Xo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Xo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Xo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Xo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Xo.setUTCSeconds.apply(this._,arguments)},setTime:function(){Xo.setTime.apply(this._,arguments)}};var Xo=Date.prototype,Bo="%a %b %e %X %Y",$o="%m/%d/%Y",Jo="%H:%M:%S",Go=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ko=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Wo=["January","February","March","April","May","June","July","August","September","October","November","December"],Qo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Uu.time.format=function(t){function n(n){for(var r,i,u,a=[],o=-1,c=0;e>++o;)37===t.charCodeAt(o)&&(a.push(t.substring(c,o)),null!=(i=ac[r=t.charAt(++o)])&&(r=t.charAt(++o)),(u=oc[r])&&(r=u(n,null==i?"e"===r?" ":"0":i)),a.push(r),c=o+1);return a.push(t.substring(c,o)),a.join("")}var e=t.length;return n.parse=function(n){var e={y:1900,m:0,d:1,H:0,M:0,S:0,L:0},r=ou(e,t,n,0);if(r!=n.length)return null;"p"in e&&(e.H=e.H%12+12*e.p);var i=new Vo;return i.setFullYear(e.y,e.m,e.d),i.setHours(e.H,e.M,e.S,e.L),i},n.toString=function(){return t},n};var tc=cu(Go),nc=cu(Ko),ec=cu(Wo),rc=lu(Wo),ic=cu(Qo),uc=lu(Qo),ac={"-":"",_:" ",0:"0"},oc={a:function(t){return Ko[t.getDay()]},A:function(t){return Go[t.getDay()]},b:function(t){return Qo[t.getMonth()]},B:function(t){return Wo[t.getMonth()]},c:Uu.time.format(Bo),d:function(t,n){return fu(t.getDate(),n,2)},e:function(t,n){return fu(t.getDate(),n,2)},H:function(t,n){return fu(t.getHours(),n,2)},I:function(t,n){return fu(t.getHours()%12||12,n,2)},j:function(t,n){return fu(1+Uu.time.dayOfYear(t),n,3)},L:function(t,n){return fu(t.getMilliseconds(),n,3)},m:function(t,n){return fu(t.getMonth()+1,n,2)},M:function(t,n){return fu(t.getMinutes(),n,2)},p:function(t){return t.getHours()>=12?"PM":"AM"},S:function(t,n){return fu(t.getSeconds(),n,2)},U:function(t,n){return fu(Uu.time.sundayOfYear(t),n,2)},w:function(t){return t.getDay() +},W:function(t,n){return fu(Uu.time.mondayOfYear(t),n,2)},x:Uu.time.format($o),X:Uu.time.format(Jo),y:function(t,n){return fu(t.getFullYear()%100,n,2)},Y:function(t,n){return fu(t.getFullYear()%1e4,n,4)},Z:Nu,"%":function(){return"%"}},cc={a:su,A:hu,b:gu,B:pu,c:du,d:_u,e:_u,H:wu,I:wu,L:Eu,m:xu,M:Su,p:Au,S:ku,x:mu,X:vu,y:Mu,Y:yu},lc=/^\s*\d+/,fc=Uu.map({am:0,pm:1});Uu.time.format.utc=function(t){function n(t){try{Vo=au;var n=new Vo;return n._=t,e(n)}finally{Vo=Date}}var e=Uu.time.format(t);return n.parse=function(t){try{Vo=au;var n=e.parse(t);return n&&n._}finally{Vo=Date}},n.toString=e.toString,n};var sc=Uu.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");Uu.time.format.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Tu:sc,Tu.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},Tu.toString=sc.toString,Uu.time.second=qu(function(t){return new Vo(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),Uu.time.seconds=Uu.time.second.range,Uu.time.seconds.utc=Uu.time.second.utc.range,Uu.time.minute=qu(function(t){return new Vo(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),Uu.time.minutes=Uu.time.minute.range,Uu.time.minutes.utc=Uu.time.minute.utc.range,Uu.time.hour=qu(function(t){var n=t.getTimezoneOffset()/60;return new Vo(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),Uu.time.hours=Uu.time.hour.range,Uu.time.hours.utc=Uu.time.hour.utc.range,Uu.time.day=qu(function(t){var n=new Vo(1970,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),Uu.time.days=Uu.time.day.range,Uu.time.days.utc=Uu.time.day.utc.range,Uu.time.dayOfYear=function(t){var n=Uu.time.year(t);return Math.floor((t-n-6e4*(t.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)},Zo.forEach(function(t,n){t=t.toLowerCase(),n=7-n;var e=Uu.time[t]=qu(function(t){return(t=Uu.time.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var e=Uu.time.year(t).getDay();return Math.floor((Uu.time.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});Uu.time[t+"s"]=e.range,Uu.time[t+"s"].utc=e.utc.range,Uu.time[t+"OfYear"]=function(t){var e=Uu.time.year(t).getDay();return Math.floor((Uu.time.dayOfYear(t)+(e+n)%7)/7)}}),Uu.time.week=Uu.time.sunday,Uu.time.weeks=Uu.time.sunday.range,Uu.time.weeks.utc=Uu.time.sunday.utc.range,Uu.time.weekOfYear=Uu.time.sundayOfYear,Uu.time.month=qu(function(t){return t=Uu.time.day(t),t.setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),Uu.time.months=Uu.time.month.range,Uu.time.months.utc=Uu.time.month.utc.range,Uu.time.year=qu(function(t){return t=Uu.time.day(t),t.setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),Uu.time.years=Uu.time.year.range,Uu.time.years.utc=Uu.time.year.utc.range;var hc=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],gc=[[Uu.time.second,1],[Uu.time.second,5],[Uu.time.second,15],[Uu.time.second,30],[Uu.time.minute,1],[Uu.time.minute,5],[Uu.time.minute,15],[Uu.time.minute,30],[Uu.time.hour,1],[Uu.time.hour,3],[Uu.time.hour,6],[Uu.time.hour,12],[Uu.time.day,1],[Uu.time.day,2],[Uu.time.week,1],[Uu.time.month,1],[Uu.time.month,3],[Uu.time.year,1]],pc=[[Uu.time.format("%Y"),l],[Uu.time.format("%B"),function(t){return t.getMonth()}],[Uu.time.format("%b %d"),function(t){return 1!=t.getDate()}],[Uu.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[Uu.time.format("%I %p"),function(t){return t.getHours()}],[Uu.time.format("%I:%M"),function(t){return t.getMinutes()}],[Uu.time.format(":%S"),function(t){return t.getSeconds()}],[Uu.time.format(".%L"),function(t){return t.getMilliseconds()}]],dc=Uu.scale.linear(),mc=Lu(pc);gc.year=function(t,n){return dc.domain(t.map(Hu)).ticks(n).map(Fu)},Uu.time.scale=function(){return zu(Uu.scale.linear(),gc,mc)};var vc=gc.map(function(t){return[t[0].utc,t[1]]}),yc=[[Uu.time.format.utc("%Y"),l],[Uu.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[Uu.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[Uu.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[Uu.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[Uu.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[Uu.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[Uu.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]],Mc=Lu(yc);return vc.year=function(t,n){return dc.domain(t.map(Pu)).ticks(n).map(Ru)},Uu.time.scale.utc=function(){return zu(Uu.scale.linear(),vc,Mc)},Uu}(); \ No newline at end of file diff --git a/src/core/interpolate.js b/src/core/interpolate.js index c08e845d..6ce13cf5 100644 --- a/src/core/interpolate.js +++ b/src/core/interpolate.js @@ -254,7 +254,7 @@ function d3_interpolateByName(name) { d3.interpolators = [ d3.interpolateObject, - function(a, b) { return b instanceof Array && d3.interpolateArray(a, b); }, + function(a, b) { return Array.isArray(b) && d3.interpolateArray(a, b); }, function(a, b) { return (typeof a === "string" || typeof b === "string") && d3.interpolateString(a + "", b + ""); }, function(a, b) { return (typeof b === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) : b instanceof d3_Color) && d3.interpolateRgb(a, b); }, function(a, b) { return !isNaN(a = +a) && !isNaN(b = +b) && d3.interpolateNumber(a, b); } diff --git a/src/dsv/dsv.js b/src/dsv/dsv.js index 68f17b61..b3a89545 100644 --- a/src/dsv/dsv.js +++ b/src/dsv/dsv.js @@ -98,6 +98,26 @@ function d3_dsv(delimiter, mimeType) { }; dsv.format = function(rows) { + if (Array.isArray(rows[0])) return dsv.formatRows(rows); // deprecated; use formatRows + var fieldSet = new d3_Set, fields = []; + + // Compute unique fields in order of discovery. + rows.forEach(function(row) { + for (var field in row) { + if (!fieldSet.has(field)) { + fields.push(fieldSet.add(field)); + } + } + }); + + return [fields].concat(rows.map(function(row) { + return fields.map(function(field) { + return formatValue(row[field]); + }).join(delimiter); + })).join("\n"); + }; + + dsv.formatRows = function(rows) { return rows.map(formatRow).join("\n"); }; diff --git a/test/dsv/csv-test.js b/test/dsv/csv-test.js index 4f0bf0ca..5e09be4e 100644 --- a/test/dsv/csv-test.js +++ b/test/dsv/csv-test.js @@ -160,6 +160,31 @@ suite.addBatch({ topic: function() { return d3.csv.format; }, + "takes an array of objects as input": function(format) { + assert.equal(format([{a: 1, b: 2, c: 3}]), "a,b,c\n1,2,3"); + }, + "computes the union of all fields": function(format) { + assert.equal(format([ + {a: 1}, + {a: 1, b: 2}, + {a: 1, b: 2, c: 3}, + {b: 1, c: 2}, + {c: 1} + ]), "a,b,c\n1,,\n1,2,\n1,2,3\n,1,2\n,,1"); + }, + "orders field by first-seen": function(format) { + assert.equal(format([ + {a: 1, b: 2}, + {c: 3, b: 4}, + {c: 5, a: 1, b: 2} + ]), "a,b,c\n1,2,\n,4,3\n1,2,5"); + } + }, + + "formatRows": { + topic: function() { + return d3.csv.formatRows; + }, "takes an array of arrays as input": function(format) { assert.equal(format([["a", "b", "c"], ["1", "2", "3"]]), "a,b,c\n1,2,3"); },