diff --git a/Makefile b/Makefile index 5d75953e..a36f8e1c 100644 --- a/Makefile +++ b/Makefile @@ -185,6 +185,7 @@ d3.geo.js: \ src/geo/type.js \ src/geo/clip.js \ src/geo/cut.js \ + src/geo/resample.js \ src/geo/albers-usa.js \ src/geo/albers.js \ src/geo/azimuthal-equal-area.js \ diff --git a/d3.js b/d3.js index 7d7760ad..d828ee44 100644 --- a/d3.js +++ b/d3.js @@ -5635,6 +5635,71 @@ } return [ to ]; } + function d3_geo_resample(projectPoint) { + var δ2 = .5, maxDepth = 16; + var resample = d3_geo_type({ + Point: function(o) { + o.coordinates = resamplePoint(o.coordinates); + }, + MultiPoint: function(o) { + o.coordinates = o.coordinates.map(resamplePoint); + }, + LineString: function(o) { + o.coordinates = resampleLine(o.coordinates); + }, + MultiLineString: function(o) { + o.coordinates = o.coordinates.map(resampleLine); + }, + Polygon: function(o) { + o.coordinates = resamplePolygon(o.coordinates); + }, + MultiPolygon: function(o) { + o.coordinates = o.coordinates.map(resamplePolygon); + } + }); + resample.precision = function(_) { + if (!arguments.length) return Math.sqrt(δ2); + maxDepth = (δ2 = _ * _) > 0 && 16; + return resample; + }; + return resample; + function resamplePoint(point) { + return projectPoint(point[0], point[1]); + } + function resampleLine(coordinates) { + if (!(n = coordinates.length)) return coordinates; + var n, i = 0, p = coordinates[0], λ, φ, λ0, line = [ p = projectPoint(λ0 = p[0], φ = p[1]) ], sinφ0 = Math.sin(φ), cosφ0 = Math.cos(φ), x0 = p[0], y0 = p[1]; + while (++i < n) { + p = coordinates[i]; + p = projectPoint(λ = p[0], φ = p[1]); + resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x0 = p[0], y0 = p[1], λ0 = λ, sinφ0 = Math.sin(φ), cosφ0 = Math.cos(φ), maxDepth, line); + line.push([ x0, y0 ]); + } + return line; + } + function resamplePolygon(coordinates) { + var n = coordinates.length, i = -1, polygon = [], ring, resampled, l, m, p; + while (++i < n) { + polygon.push(resampled = resampleLine(ring = coordinates[i])); + m = ring.length - 1; + l = resampled.length - 1; + resampleLineTo((p = ring[0])[0], p[1], (p = resampled[0])[0], Math.sin(p[1]), Math.cos(p[1]), (p = ring[m])[0], p[1], (p = resampled[l])[0], Math.sin(p[1]), Math.cos(p[1]), maxDepth, ring); + } + return polygon; + } + function resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x1, y1, λ1, sinφ1, cosφ1, depth, line) { + var dx = x1 - x0, dy = y1 - y0, distance2 = dx * dx + dy * dy; + if (distance2 > 4 * δ2 && depth--) { + var cosΩ = sinφ0 * sinφ1 + cosφ0 * cosφ1 * Math.cos(λ1 - λ0), k = 1 / (Math.SQRT2 * Math.sqrt(1 + cosΩ)), x = k * (cosφ0 * Math.cos(λ0) + cosφ1 * Math.cos(λ1)), y = k * (cosφ0 * Math.sin(λ0) + cosφ1 * Math.sin(λ1)), z = Math.max(-1, Math.min(1, k * (sinφ0 + sinφ1))), φ2 = Math.asin(z), zε = Math.abs(Math.abs(z) - 1), λ2 = zε < ε || zε < εε && (Math.abs(cosφ0) < εε || Math.abs(cosφ1) < εε) ? (λ0 + λ1) / 2 : Math.atan2(y, x), p = projectPoint(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x0 - x2, dy2 = y0 - y2, dz = dx * dy2 - dy * dx2; + if (dz * dz / distance2 > δ2) { + var cosφ2 = Math.cos(φ2); + resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x2, y2, λ2, z, cosφ2, depth, line); + line.push([ x2, y2 ]); + resampleLineTo(x2, y2, λ2, z, cosφ2, x1, y1, λ1, sinφ1, cosφ1, depth, line); + } + } + } + } d3.geo.albersUsa = function() { var lower48 = d3.geo.albers(); var alaska = d3.geo.albers().rotate([ 160, 0 ]).center([ 0, 60 ]).parallels([ 55, 65 ]); @@ -6297,7 +6362,7 @@ })(); } function d3_geo_projectionMutator(projectAt) { - var project, rotate, rotation, projectRotate, k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, δ2 = .5, maxDepth = 16, clip = d3_geo_cut, clipAngle = null; + var project, rotate, rotation, projectRotate, k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, clip = d3_geo_cut, clipAngle = null, resample = d3_geo_resample(projectPoint); function projection(coordinates) { coordinates = projectRotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); return [ coordinates[0] * k + δx, δy - coordinates[1] * k ]; @@ -6340,11 +6405,7 @@ δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0; return reset(); }; - projection.precision = function(_) { - if (!arguments.length) return Math.sqrt(δ2); - maxDepth = (δ2 = _ * _) > 0 && 16; - return projection; - }; + d3.rebind(projection, resample, "precision"); function reset() { projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); var center = project(λ, φ); @@ -6352,26 +6413,6 @@ δy = y + center[1] * k; return projection; } - var resample = d3_geo_type({ - Point: function(o) { - o.coordinates = resamplePoint(o.coordinates); - }, - MultiPoint: function(o) { - o.coordinates = o.coordinates.map(resamplePoint); - }, - LineString: function(o) { - o.coordinates = resampleLine(o.coordinates); - }, - MultiLineString: function(o) { - o.coordinates = o.coordinates.map(resampleLine); - }, - Polygon: function(o) { - o.coordinates = resamplePolygon(o.coordinates); - }, - MultiPolygon: function(o) { - o.coordinates = o.coordinates.map(resamplePolygon); - } - }); var rotation = d3_geo_type({ point: function(coordinates) { return rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); @@ -6382,42 +6423,6 @@ var point = project(λ, φ); return [ point[0] * k + δx, δy - point[1] * k ]; } - function resamplePoint(point) { - return projectPoint(point[0], point[1]); - } - function resampleLine(coordinates) { - if (!(n = coordinates.length)) return coordinates; - var n, i = 0, p = coordinates[0], λ, φ, λ0, line = [ p = projectPoint(λ0 = p[0], φ = p[1]) ], sinφ0 = Math.sin(φ), cosφ0 = Math.cos(φ), x0 = p[0], y0 = p[1]; - while (++i < n) { - p = coordinates[i]; - p = projectPoint(λ = p[0], φ = p[1]); - resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x0 = p[0], y0 = p[1], λ0 = λ, sinφ0 = Math.sin(φ), cosφ0 = Math.cos(φ), maxDepth, line); - line.push([ x0, y0 ]); - } - return line; - } - function resamplePolygon(coordinates) { - var n = coordinates.length, i = -1, polygon = [], ring, resampled, l, m, p; - while (++i < n) { - polygon.push(resampled = resampleLine(ring = coordinates[i])); - m = ring.length - 1; - l = resampled.length - 1; - resampleLineTo((p = ring[0])[0], p[1], (p = resampled[0])[0], Math.sin(p[1]), Math.cos(p[1]), (p = ring[m])[0], p[1], (p = resampled[l])[0], Math.sin(p[1]), Math.cos(p[1]), maxDepth, ring); - } - return polygon; - } - function resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x1, y1, λ1, sinφ1, cosφ1, depth, line) { - var dx = x1 - x0, dy = y1 - y0, distance2 = dx * dx + dy * dy; - if (distance2 > 4 * δ2 && depth--) { - var cosΩ = sinφ0 * sinφ1 + cosφ0 * cosφ1 * Math.cos(λ1 - λ0), k = 1 / (Math.SQRT2 * Math.sqrt(1 + cosΩ)), x = k * (cosφ0 * Math.cos(λ0) + cosφ1 * Math.cos(λ1)), y = k * (cosφ0 * Math.sin(λ0) + cosφ1 * Math.sin(λ1)), z = Math.max(-1, Math.min(1, k * (sinφ0 + sinφ1))), φ2 = Math.asin(z), zε = Math.abs(Math.abs(z) - 1), λ2 = zε < ε || zε < εε && (Math.abs(cosφ0) < εε || Math.abs(cosφ1) < εε) ? (λ0 + λ1) / 2 : Math.atan2(y, x), p = projectPoint(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x0 - x2, dy2 = y0 - y2, dz = dx * dy2 - dy * dx2; - if (dz * dz / distance2 > δ2) { - var cosφ2 = Math.cos(φ2); - resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x2, y2, λ2, z, cosφ2, depth, line); - line.push([ x2, y2 ]); - resampleLineTo(x2, y2, λ2, z, cosφ2, x1, y1, λ1, sinφ1, cosφ1, depth, line); - } - } - } return function() { project = projectAt.apply(this, arguments); projection.invert = project.invert && invert; diff --git a/d3.min.js b/d3.min.js index 3741e8c0..62dc8ded 100644 --- a/d3.min.js +++ b/d3.min.js @@ -1,4 +1,4 @@ -(function(){function t(){return 0}function n(t){return t.target}function e(t){return t.source}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){var n=-1,e=t.length,r=[];while(e>++n)r.push(t[n]);return r}function u(t){return Array.prototype.slice.call(t)}function a(){}function o(t){return t}function c(){return!0}function l(t){return typeof t=="function"?t:function(){return t}}function s(t,n,e){return function(){var r=e.apply(n,arguments);return arguments.length?t:r}}function f(t){return t!=null&&!isNaN(t)}function h(t){return t.length}function d(t){return t.trim().replace(/\s+/g," ")}function g(t){var n=1;while(t*n%1)n*=10;return n}function p(t){return t.responseText}function m(t){return JSON.parse(t.responseText)}function v(t){var n=document.createRange();return n.selectNode(document.body),n.createContextualFragment(t.responseText)}function y(t){return t.responseXML}function M(){}function b(t){function n(){var n,r=e,i=-1,u=r.length;while(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 x(t,n){return n-(t?1+Math.floor(Math.log(t+Math.pow(10,1+Math.floor(Math.log(t)/Math.LN10)-n))/Math.LN10):1)}function w(t){return t+""}function _(t,n){var e=Math.pow(10,Math.abs(8-n)*3);return{scale:n>8?function(t){return t/e}:function(t){return t*e},symbol:t}}function k(t){return function(n){return 0>=n?0:n>=1?1:t(n)}}function S(t){return function(n){return 1-t(1-n)}}function A(t){return function(n){return.5*(.5>n?t(2*n):2-t(2-2*n))}}function N(t){return t*t}function C(t){return t*t*t}function T(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 q(t){return function(n){return Math.pow(n,t)}}function P(t){return 1-Math.cos(t*Au/2)}function z(t){return Math.pow(2,10*(t-1))}function E(t){return 1-Math.sqrt(1-t*t)}function L(t,n){var e;return 2>arguments.length&&(n=.45),arguments.length?e=n/(2*Au)*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,10*-r)*Math.sin((r-e)*2*Au/n)}}function D(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function F(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 j(){d3.event.stopPropagation(),d3.event.preventDefault()}function H(){var t,n=d3.event;while(t=n.sourceEvent)n=t;return n}function O(t){var n=new M,e=0,r=arguments.length;while(r>++e)n[arguments[e]]=b(n);return n.of=function(e,r){return function(i){try{var u=i.sourceEvent=d3.event;i.target=t,d3.event=i,n[i.type].apply(e,r)}finally{d3.event=u}}},n}function R(t){var n=[t.a,t.b],e=[t.c,t.d],r=U(n),i=Y(n,e),u=U(I(e,n,-i))||0;e[0]*n[1]>n[0]*e[1]&&(n[0]*=-1,n[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(n[1],n[0]):Math.atan2(-e[0],e[1]))*Pu,this.translate=[t.e,t.f],this.scale=[r,u],this.skew=u?Math.atan2(i,u)*Pu:0}function Y(t,n){return t[0]*n[0]+t[1]*n[1]}function U(t){var n=Math.sqrt(Y(t,t));return n&&(t[0]/=n,t[1]/=n),n}function I(t,n,e){return t[0]+=e*n[0],t[1]+=e*n[1],t}function V(t){return t=="transform"?d3.interpolateTransform:d3.interpolate}function X(t,n){return n=n-(t=+t)?1/(n-t):0,function(e){return(e-t)*n}}function Z(t,n){return n=n-(t=+t)?1/(n-t):0,function(e){return Math.max(0,Math.min(1,(e-t)*n))}}function B(){}function G(t,n,e){return new $(t,n,e)}function $(t,n,e){this.r=t,this.g=n,this.b=e}function J(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function K(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(nn(i[0]),nn(i[1]),nn(i[2]))}return(u=Ku.get(t))?n(u.r,u.g,u.b):(t!=null&&t.charAt(0)==="#"&&(t.length===4?(a=t.charAt(1),a+=a,o=t.charAt(2),o+=o,c=t.charAt(3),c+=c):t.length===7&&(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 W(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,en(r,i,c)}function Q(t,n,e){t=tn(t),n=tn(n),e=tn(e);var r=gn((.4124564*t+.3575761*n+.1804375*e)/na),i=gn((.2126729*t+.7151522*n+.072175*e)/ea),u=gn((.0193339*t+.119192*n+.9503041*e)/ra);return ln(116*i-16,500*(r-i),200*(i-u))}function tn(t){return.04045>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}function nn(t){var n=parseFloat(t);return t.charAt(t.length-1)==="%"?Math.round(n*2.55):n}function en(t,n,e){return new rn(t,n,e)}function rn(t,n,e){this.h=t,this.s=n,this.l=e}function un(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(r(t)*255)}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,G(i(t+120),i(t),i(t-120))}function an(t,n,e){return new on(t,n,e)}function on(t,n,e){this.h=t,this.c=n,this.l=e}function cn(t,n,e){return ln(e,Math.cos(t*=qu)*n,Math.sin(t)*n)}function ln(t,n,e){return new sn(t,n,e)}function sn(t,n,e){this.l=t,this.a=n,this.b=e}function fn(t,n,e){var r=(t+16)/116,i=r+n/500,u=r-e/200;return i=dn(i)*na,r=dn(r)*ea,u=dn(u)*ra,G(pn(3.2404542*i-1.5371385*r-.4985314*u),pn(-.969266*i+1.8760108*r+.041556*u),pn(.0556434*i-.2040259*r+1.0572252*u))}function hn(t,n,e){return an(Math.atan2(e,n)/Au*180,Math.sqrt(n*n+e*e),t)}function dn(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gn(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function pn(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function mn(t){return Lu(t,sa),t}function vn(t){return function(){return ua(t,this)}}function yn(t){return function(){return aa(t,this)}}function Mn(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);e==null?this.removeAttribute(t):this.setAttribute(t,e)}function o(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}return t=d3.ns.qualify(t),n==null?t.local?r:e:typeof n=="function"?t.local?o:a:t.local?u:i}function bn(t){return RegExp("(?:^|\\s+)"+d3.requote(t)+"(?:\\s+|$)","g")}function xn(t,n){function e(){var e=-1;while(i>++e)t[e](this,n)}function r(){var e=-1,r=n.apply(this,arguments);while(i>++e)t[e](this,r)}t=t.trim().split(/\s+/).map(wn);var i=t.length;return typeof n=="function"?r:e}function wn(t){var n=bn(t);return function(e,r){if(i=e.classList)return r?i.add(t):i.remove(t);var i=e.className,u=i.baseVal!=null,a=u?i.baseVal:i;r?(n.lastIndex=0,n.test(a)||(a=d(a+" "+t),u?i.baseVal=a:e.className=a)):a&&(a=d(a.replace(n," ")),u?i.baseVal=a:e.className=a)}}function _n(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);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}return n==null?r:typeof n=="function"?u:i}function kn(t,n){function e(){delete this[t]}function r(){this[t]=n}function i(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}return n==null?e:typeof n=="function"?i:r}function Sn(t){return{__data__:t}}function An(t){return function(){return la(this,t)}}function Nn(t){return arguments.length||(t=d3.ascending),function(n,e){return t(n&&n.__data__,e&&e.__data__)}}function Cn(t,n,e){function r(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}function i(){function i(t){var e=d3.event;d3.event=t,o[0]=a.__data__;try{n.apply(a,o)}finally{d3.event=e}}var a=this,o=zu(arguments);r.call(this),this.addEventListener(t,this[u]=i,i.$=e),i._=n}var u="__on"+t,a=t.indexOf(".");return a>0&&(t=t.substring(0,a)),n?i:r}function Tn(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 qn(t){return Lu(t,ha),t}function Pn(t,n){return Lu(t,ga),t.id=n,t}function zn(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:d3.dispatch("start","end"),time:o,ease:r.ease,delay:r.delay,duration:r.duration},++i.count,d3.timer(function(r){function a(r){return i.active>e?l():(i.active=e,h.start.call(t,s,n),u.tween.forEach(function(e,r){(r=r.call(t,s,n))&&p.push(r)}),c(r)||d3.timer(c,0,o),1)}function c(r){if(i.active!==e)return l();var u=(r-d)/g,a=f(u),o=p.length;while(o>0)p[--o].call(t,a);return u>=1?(l(),h.end.call(t,s,n),1):void 0}function l(){return--i.count?delete i[e]:delete t.__transition__,1}var s=t.__data__,f=u.ease,h=u.event,d=u.delay,g=u.duration,p=[];return r>=d?a(r):d3.timer(a,d,o),1},0,o),u}}function En(t){return t==null&&(t=""),function(){this.textContent=t}}function Ln(t,n,e,r){var i=t.id;return Tn(t,typeof e=="function"?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 Dn(){var t,n=Date.now(),e=xa;while(e)t=n-e.then,t>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=Fn()-n;r>24?(isFinite(r)&&(clearTimeout(ya),ya=setTimeout(Dn,r)),va=0):(va=1,wa(Dn))}function Fn(){var t=null,n=xa,e=1/0;while(n)n.flush?(delete ba[n.callback.id],n=t?t.next=n.next:xa=n.next):(e=Math.min(e,n.then+n.delay),n=(t=n).next);return e}function jn(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>_a&&(window.scrollX||window.scrollY)){e=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=e[0][0].getScreenCTM();_a=!(i.f||i.e),e.remove()}return _a?(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 Hn(){}function On(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function Rn(t){return t.rangeExtent?t.rangeExtent():On(t.range())}function Yn(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 Un(){return Math}function In(t,n,e,r){function i(){var i=Math.min(t.length,n.length)>2?Jn:$n,c=r?Z:X;return a=i(t,n,c,e),o=i(n,t,c,d3.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(d3.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 Bn(t,n)},u.tickFormat=function(n){return Gn(t,n)},u.nice=function(){return Yn(t,Xn),i()},u.copy=function(){return In(t,n,e,r)},i()}function Vn(t,n){return d3.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Xn(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 Zn(t,n){var e=On(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+i*.5,e[2]=i,e}function Bn(t,n){return d3.range.apply(d3,Zn(t,n))}function Gn(t,n){return d3.format(",."+Math.max(0,-Math.floor(Math.log(Zn(t,n)[2])/Math.LN10+.01))+"f")}function $n(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 Jn(t,n,e,r){var i=[],u=[],a=0,o=Math.min(t.length,n.length)-1;t[0]>t[o]&&(t=t.slice().reverse(),n=n.slice().reverse());while(o>=++a)i.push(e(t[a-1],t[a])),u.push(r(n[a-1],n[a]));return function(n){var e=d3.bisect(t,n,1,o)-1;return u[e](i[e](n))}}function Kn(t,n){function e(e){return t(n(e))}var r=n.pow;return e.invert=function(n){return r(t.invert(n))},e.domain=function(i){return arguments.length?(n=0>i[0]?Qn:Wn,r=n.pow,t.domain(i.map(n)),e):t.domain().map(r)},e.nice=function(){return t.domain(Yn(t.domain(),Un)),e},e.ticks=function(){var e=On(t.domain()),i=[];if(e.every(isFinite)){var u=Math.floor(e[0]),a=Math.ceil(e[1]),o=r(e[0]),c=r(e[1]);if(n===Qn)for(i.push(r(u));a>u++;)for(var l=9;l>0;l--)i.push(r(u)*l);else{for(;a>u;u++)for(var l=1;10>l;l++)i.push(r(u)*l);i.push(r(u))}for(u=0;o>i[u];u++);for(a=i.length;i[a-1]>c;a--);i=i.slice(u,a)}return i},e.tickFormat=function(t,i){if(2>arguments.length&&(i=ka),!arguments.length)return i;var u,a=Math.max(.1,t/e.ticks().length),o=n===Qn?(u=-1e-12,Math.floor):(u=1e-12,Math.ceil);return function(t){return a>=t/r(o(n(t)+u))?i(t):""}},e.copy=function(){return Kn(t.copy(),n)},Vn(e,t)}function Wn(t){return Math.log(0>t?0:t)/Math.LN10}function Qn(t){return-Math.log(t>0?0:-t)/Math.LN10}function te(t,n){function e(n){return t(r(n))}var r=ne(n),i=ne(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 Bn(e.domain(),t)},e.tickFormat=function(t){return Gn(e.domain(),t)},e.nice=function(){return e.domain(Yn(e.domain(),Xn))},e.exponent=function(t){if(!arguments.length)return n;var u=e.domain();return r=ne(n=t),i=ne(1/n),e.domain(u)},e.copy=function(){return te(t.copy(),n)},Vn(e,t)}function ne(t){return function(n){return 0>n?-Math.pow(-n,t):Math.pow(n,t)}}function ee(t,n){function e(n){return u[((i.get(n)||i.set(n,t.push(n)))-1)%u.length]}function r(n,e){return d3.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;var u,o=-1,c=r.length;while(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],s=(l-c)/(Math.max(1,t.length-1)+a);return u=r(2>t.length?(c+l)/2:c+s*a/2,s),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[0]>i[1],s=i[l-0],f=i[1-l],h=(f-s)/(t.length-a+2*c);return u=r(s+h*c,h),l&&u.reverse(),o=h*(1-a),n={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,a,c){2>arguments.length&&(a=0),3>arguments.length&&(c=a);var l=i[0]>i[1],s=i[l-0],f=i[1-l],h=Math.floor((f-s)/(t.length-a+2*c)),d=f-s-(t.length-a)*h;return u=r(s+Math.round(d/2),h),l&&u.reverse(),o=Math.round(h*(1-a)),n={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return On(n.a[0])},e.copy=function(){return ee(t,n)},e.domain(t)}function re(t,n){function e(){var e=0,u=n.length;i=[];while(u>++e)i[e-1]=d3.quantile(t,e/u);return r}function r(t){return isNaN(t=+t)?0/0:n[d3.bisect(i,t)]}var i;return r.domain=function(n){return arguments.length?(t=n.filter(function(t){return!isNaN(t)}).sort(d3.ascending),e()):t},r.range=function(t){return arguments.length?(n=t,e()):n},r.quantiles=function(){return i},r.copy=function(){return re(t,n)},e()}function ie(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 ie(t,n,e)},i()}function ue(t,n){function e(e){return n[d3.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 ue(t,n)},e}function ae(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 Bn(t,n)},n.tickFormat=function(n){return Gn(t,n)},n.copy=function(){return ae(t)},n}function oe(t){return t.innerRadius}function ce(t){return t.outerRadius}function le(t){return t.startAngle}function se(t){return t.endAngle}function fe(t){function n(n){function a(){s.push("M",u(t(f),o))}var c,s=[],f=[],h=-1,d=n.length,g=l(e),p=l(r);while(d>++h)i.call(this,c=n[h],h)?f.push([+g.call(this,c,h),+p.call(this,c,h)]):f.length&&(a(),f=[]);return f.length&&a(),s.length?s.join(""):null}var e=he,r=de,i=c,u=ge,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=typeof t=="function"?u=t:(u=Pa.get(t)||ge).key,n):a},n.tension=function(t){return arguments.length?(o=t,n):o},n}function he(t){return t[0]}function de(t){return t[1]}function ge(t){return t.join("L")}function pe(t){return ge(t)+"Z"}function me(t){var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];while(e>++n)i.push("V",(r=t[n])[1],"H",r[0]);return i.join("")}function ve(t){var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];while(e>++n)i.push("H",(r=t[n])[0],"V",r[1]);return i.join("")}function ye(t,n){return 4>t.length?ge(t):t[1]+xe(t.slice(1,t.length-1),we(t,n))}function Me(t,n){return 3>t.length?ge(t):t[0]+xe((t.push(t[0]),t),we([t[t.length-2]].concat(t,[t[1]]),n))}function be(t,n){return 3>t.length?ge(t):t[0]+xe(t,we(t,n))}function xe(t,n){if(1>n.length||t.length!=n.length&&t.length!=n.length+2)return ge(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]-a[0]*2/3)+","+(u[1]-a[1]*2/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 s=t[c];r+="Q"+(u[0]+o[0]*2/3)+","+(u[1]+o[1]*2/3)+","+s[0]+","+s[1]}return r}function we(t,n){var e,r=[],i=(1-n)/2,u=t[0],a=t[1],o=1,c=t.length;while(c>++o)e=u,u=a,a=t[o],r.push([i*(a[0]-e[0]),i*(a[1]-e[1])]);return r}function _e(t){if(3>t.length)return ge(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];Ce(c,a,o);while(e>++n)r=t[n],a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Ce(c,a,o);n=-1;while(2>++n)a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Ce(c,a,o);return c.join("")}function ke(t){if(4>t.length)return ge(t);var n,e=[],r=-1,i=t.length,u=[0],a=[0];while(3>++r)n=t[r],u.push(n[0]),a.push(n[1]);e.push(Ne(La,u)+","+Ne(La,a)),--r;while(i>++r)n=t[r],u.shift(),u.push(n[0]),a.shift(),a.push(n[1]),Ce(e,u,a);return e.join("")}function Se(t){var n,e,r=-1,i=t.length,u=i+4,a=[],o=[];while(4>++r)e=t[r%i],a.push(e[0]),o.push(e[1]);n=[Ne(La,a),",",Ne(La,o)],--r;while(u>++r)e=t[r%i],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Ce(n,a,o);return n.join("")}function Ae(t,n){var e=t.length-1;if(e){var r,i,u=t[0][0],a=t[0][1],o=t[e][0]-u,c=t[e][1]-a,l=-1;while(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 _e(t)}function Ne(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function Ce(t,n,e){t.push("C",Ne(za,n),",",Ne(za,e),",",Ne(Ea,n),",",Ne(Ea,e),",",Ne(La,n),",",Ne(La,e))}function Te(t,n){return(n[1]-t[1])/(n[0]-t[0])}function qe(t){var n=0,e=t.length-1,r=[],i=t[0],u=t[1],a=r[0]=Te(i,u);while(e>++n)r[n]=(a+(a=Te(i=u,u=t[n+1])))/2;return r[n]=a,r}function Pe(t){var n,e,r,i,u=[],a=qe(t),o=-1,c=t.length-1;while(c>++o)n=Te(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=n*3/Math.sqrt(i),a[o]=i*e,a[o+1]=i*r));o=-1;while(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 ze(t){return 3>t.length?ge(t):t[0]+xe(t,Pe(t))}function Ee(t){var n,e,r,i=-1,u=t.length;while(u>++i)n=t[i],e=n[0],r=n[1]+Ta,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function Le(t){function n(n){function c(){m.push("M",o(t(y),d),h,f(t(v.reverse()),d),"Z")}var s,g,p,m=[],v=[],y=[],M=-1,b=n.length,x=l(e),w=l(i),_=e===r?function(){return g}:l(r),k=i===u?function(){return p}:l(u);while(b>++M)a.call(this,s=n[M],M)?(v.push([g=+x.call(this,s,M),p=+w.call(this,s,M)]),y.push([+_.call(this,s,M),+k.call(this,s,M)])):v.length&&(c(),v=[],y=[]);return v.length&&c(),m.length?m.join(""):null}var e=he,r=he,i=0,u=de,a=c,o=ge,s=o.key,f=o,h="L",d=.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?(s=typeof t=="function"?o=t:(o=Pa.get(t)||ge).key,f=o.reverse||o,h=o.closed?"M":"L",n):s},n.tension=function(t){return arguments.length?(d=t,n):d},n}function De(t){return t.radius}function Fe(t){return[t.x,t.y]}function je(t){return function(){var n=t.apply(this,arguments),e=n[0],r=n[1]+Ta;return[e*Math.cos(r),e*Math.sin(r)]}}function He(){return 64}function Oe(){return"circle"}function Re(t){var n=Math.sqrt(t/Au);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}function Ye(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function Ue(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}function Ie(t,n,e){if(r=[],e&&n.length>1){var r,i,u,a=On(t.domain()),o=-1,c=n.length,l=(n[1]-n[0])/++e;while(c>++o)for(i=e;--i>0;)(u=+n[o]-i*l)>=a[0]&&r.push(u);for(--o,i=0;e>++i&&a[1]>(u=+n[o]+i*l);)r.push(u)}return r}function Ve(){Ra||(Ra=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var t,n=d3.event;try{Ra.scrollTop=1e3,Ra.dispatchEvent(n),t=1e3-Ra.scrollTop}catch(e){t=n.wheelDelta||-n.detail*5}return t}function Xe(t){var n=t.source,e=t.target,r=Be(n,e),i=[n];while(n!==r)n=n.parent,i.push(n);var u=i.length;while(e!==r)i.splice(u,0,e),e=e.parent;return i}function Ze(t){var n=[],e=t.parent;while(e!=null)n.push(t),t=e,e=e.parent;return n.push(t),n}function Be(t,n){if(t===n)return t;var e=Ze(t),r=Ze(n),i=e.pop(),u=r.pop(),a=null;while(i===u)a=i,i=e.pop(),u=r.pop();return a}function Ge(t){t.fixed|=2}function $e(t){t.fixed&=1}function Je(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ke(t){t.fixed&=3}function We(t,n,e){var r=0,i=0;if(t.charge=0,!t.leaf){var u,a=t.nodes,o=a.length,c=-1;while(o>++c)u=a[c],u!=null&&(We(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 Qe(){return 20}function tr(){return 1}function nr(t){return t.x}function er(t){return t.y}function rr(t,n,e){t.y0=n,t.y=e}function ir(t){return d3.range(t.length)}function ur(t){var n=-1,e=t[0].length,r=[];while(e>++n)r[n]=0;return r}function ar(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 or(t){return t.reduce(cr,0)}function cr(t,n){return t+n[1]}function lr(t,n){return sr(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function sr(t,n){var e=-1,r=+t[0],i=(t[1]-r)/n,u=[];while(n>=++e)u[e]=i*e+r;return u}function fr(t){return[d3.min(t),d3.max(t)]}function hr(t,n){return d3.rebind(t,n,"sort","children","value"),t.links=mr,t.nodes=function(n){return Xa=!0,(t.nodes=t)(n)},t}function dr(t){return t.children}function gr(t){return t.value}function pr(t,n){return n.value-t.value}function mr(t){return d3.merge(t.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}function vr(t,n){return t.value-n.value}function yr(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function Mr(t,n){t._pack_next=n,n._pack_prev=t}function br(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 xr(t){function n(t){s=Math.min(t.x-t.r,s),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((e=t.children)&&(l=e.length)){var e,r,i,u,a,o,c,l,s=1/0,f=-1/0,h=1/0,d=-1/0;if(e.forEach(wr),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],Sr(r,i,u),n(u),yr(r,u),r._pack_prev=u,yr(u,i),i=r._pack_next,a=3;l>a;a++){Sr(r,i,u=e[a]);var g=0,p=1,m=1;for(o=i._pack_next;o!==i;o=o._pack_next,p++)if(br(o,u)){g=1;break}if(g==1)for(c=r._pack_prev;c!==o._pack_prev;c=c._pack_prev,m++)if(br(c,u))break;g?(m>p||p==m&&r.r>i.r?Mr(r,i=o):Mr(r=c,i),a--):(yr(r,u),i=u,n(u))}var v=(s+f)/2,y=(h+d)/2,M=0;for(a=0;l>a;a++)u=e[a],u.x-=v,u.y-=y,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));t.r=M,e.forEach(_r)}}function wr(t){t._pack_next=t._pack_prev=t}function _r(t){delete t._pack_next,delete t._pack_prev}function kr(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){var u=-1,a=i.length;while(a>++u)kr(i[u],n,e,r)}}function Sr(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 Ar(t){return 1+d3.max(t,function(t){return t.y})}function Nr(t){return t.reduce(function(t,n){return t+n.x},0)/t.length}function Cr(t){var n=t.children;return n&&n.length?Cr(n[0]):t}function Tr(t){var n,e=t.children;return e&&(n=e.length)?Tr(e[n-1]):t}function qr(t,n){return t.parent==n.parent?1:2}function Pr(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function zr(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function Er(t,n){var e=t.children;if(e&&(i=e.length)){var r,i,u=-1;while(i>++u)n(r=Er(e[u],n),t)>0&&(t=r)}return t}function Lr(t,n){return t.x-n.x}function Dr(t,n){return n.x-t.x}function Fr(t,n){return t.depth-n.depth}function jr(t,n){function e(t,r){var i=t.children;if(i&&(a=i.length)){var u,a,o=null,c=-1;while(a>++c)u=i[c],e(u,o),o=u}n(t,r)}e(t,null)}function Hr(t){var n,e=0,r=0,i=t.children,u=i.length;while(--u>=0)n=i[u]._tree,n.prelim+=e,n.mod+=e,e+=n.shift+(r+=n.change)}function Or(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 Rr(t,n,e){return t._tree.ancestor.parent==n.parent?t._tree.ancestor:e}function Yr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ur(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 Ir(t,n){function e(t,e){return d3.xhr(t,n,e).response(r)}function r(t){return e.parse(t.responseText)}function i(n){return n.map(u).join(t)}function u(t){return a.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var a=RegExp('["'+t+"\n]"),o=t.charCodeAt(0);return e.parse=function(t){var n;return e.parseRows(t,function(t){return n?n(t):(n=Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}"),void 0)})},e.parseRows=function(t,n){function e(){if(s>=l)return a;if(i)return i=!1,u;var n=s;if(t.charCodeAt(n)===34){var e=n;while(l>e++)if(t.charCodeAt(e)===34){if(t.charCodeAt(e+1)!==34)break;++e}s=e+2;var r=t.charCodeAt(e+1);return r===13?(i=!0,t.charCodeAt(e+2)===10&&++s):r===10&&(i=!0),t.substring(n+1,e).replace(/""/g,'"')}while(l>s){var r=t.charCodeAt(s++),c=1;if(r===10)i=!0;else if(r===13)i=!0,t.charCodeAt(s)===10&&(++s,++c);else if(r!==o)continue;return t.substring(n,s-c)}return t.substring(n)}var r,i,u={},a={},c=[],l=t.length,s=0,f=0;while((r=e())!==a){var h=[];while(r!==u&&r!==a)h.push(r),r=e();(!n||(h=n(h,f++)))&&c.push(h)}return c},e.format=function(t){return t.map(i).join("\n")},e}function Vr(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Xr(t,n){return Nu>Math.abs(t[0]-n[0])&&Nu>Math.abs(t[1]-n[1])}function Zr(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 Br(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Gr(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 $r(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Jr(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Kr(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 Wr(t){for(var n in Za)n in t||(t[n]=Za[n]);return function(n){return n&&(Ga.hasOwnProperty(n.type)?t[n.type](n):t.geometry(n))}}function Qr(t,n,e){return Wr({point:t,LineString:function(t){return{type:"MultiLineString",coordinates:n(t.coordinates)[1]}},MultiLineString:function(t){return{type:"MultiLineString",coordinates:d3.merge(t.coordinates.map(function(t){return n(t)[1]}))}},Polygon:function(t){return{type:"MultiPolygon",coordinates:ti(t.coordinates,n,e)}},MultiPolygon:function(t){return{type:"MultiPolygon",coordinates:d3.merge(t.coordinates.map(function(t){return ti(t,n,e)}))}},Sphere:function(){return{type:"Polygon",coordinates:[e(null,null,1)]}}})}function ti(t,n,e){var r=[],i=[],u=[],a=0,o=0,c=!1,l=[],s=[l],u=d3.merge(t.map(function(t){var e,r=n(t),i=r[1],u=i.length;return u?r[0]&1?(a+=Si((e=i[0]).map(ni)),l.push(e),[]):(u>1&&r[0]&2&&i.push(i.pop().concat(i.shift())),i.filter(ui)):(c=!0,o+=Si(t.map(ei)),[])}));if(!u.length&&(-Cu>a||c&&-Cu>o)&&l.push(e(null,null,1)),u.forEach(function(t){var n=t.length;if(!(1>=n)){var e=t[0],u=t[n-1],a={point:e,points:t,other:null,visited:!1,entry:!0,subject:!0},o={point:e,points:[e],other:a,visited:!1,entry:!1,subject:!1};a.other=o,r.push(a),i.push(o),a={point:u,points:[u],other:null,visited:!1,entry:!1,subject:!0},o={point:u,points:[u],other:a,visited:!1,entry:!0,subject:!1},a.other=o,r.push(a),i.push(o)}}),i.sort(ii),ri(r),ri(i),!r.length)return s;for(var f,h,d,g=r[0];;){f=g;while(f.visited)if((f=f.next)===g)return s;h=f.points,d=[[h.shift()]];do f.visited=f.other.visited=!0,f.entry?(d.push(f.subject?h:e(f.point,f.next.point,1)),f=f.next):(d.push(f.subject?(h=f.prev.points).reverse():e(f.point,f.prev.point,-1)),f=f.prev),f=f.other,h=f.points;while(!f.visited);l.push(d3.merge(d))}return s}function ni(t){var n=t[0],e=t[1],r=Math.cos(e);return[Math.atan2(Math.sin(n)*r,Math.sin(e)),Math.asin(Math.max(-1,Math.min(1,-Math.cos(n)*r)))]}function ei(t){var n=t[0]+Au,e=t[1],r=Math.cos(e);return[Math.atan2(Math.sin(n)*r,Math.sin(e)),Math.asin(Math.max(-1,Math.min(1,-Math.cos(n)*r)))]}function ri(t){if(n=t.length){var n,e,r=0,i=t[0];while(n>++r)i.next=e=t[r],e.prev=i,i=e;i.next=e=t[0],e.prev=i}}function ii(t,n){return(0>(t=t.point)[0]?t[1]-Au/2-Nu:Au/2-t[1])-(0>(n=n.point)[0]?n[1]-Au/2-Nu:Au/2-n[1])}function ui(t){return t.length>1}function ai(t){if(!(u=t.length))return[0,[]];var n,e,r,i,u,a=t[0],o=a[0],c=a[1],l=o>0?Au:-Au,s=0,f=1,h=[a],d=[h];while(u>++s)a=t[s],n=a[0],e=a[1],r=n>0?Au:-Au,i=Math.abs(n-o),Nu>Math.abs(i-Au)?(h.push([o,c=(c+e)/2>0?Au/2:-Au/2],[l,c]),d.push(h=[[r,c],[n,c]]),f=0):l!==r&&i>=Au&&(Nu>Math.abs(o-l)&&(o-=l*Nu),Nu>Math.abs(n-r)&&(n-=r*Nu),c=oi(o,c,n,e),h.push([l,c]),d.push(h=[[r,c]]),f=0),h.push([o=n,c=e]),l=r;return[2-f,d]}function oi(t,n,e,r){var i,u,a=Math.sin(t-e);return Math.abs(a)>Nu?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 ci(t,n,e){var r;if(t==null)return r=e*Au/2,[[-Au,r],[0,r],[Au,r],[Au,0],[Au,-r],[0,-r],[-Au,-r],[-Au,0],[-Au,r]];if(Math.abs(t[0]-n[0])>Nu){var i=(n[0]>t[0]?1:-1)*Au;return r=e*i/2,[[-i,r],[0,r],[i,r]]}return[n]}function li(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 si(t){var n,e,r,i,u=Wr({point:function(u){u=t(u);var a=u[0],o=u[1];n>a&&(n=a),a>r&&(r=a),e>o&&(e=o),o>i&&(i=o)},polygon:function(t){this.line(t[0])}});return function(t){return i=r=-(n=e=1/0),u(t),[[n,e],[r,i]] -}}function fi(t){if(!(n=t.length))return null;var n,e,r,i,u,a,o=t[0],c=0,l=o[0]*qu,s=Math.cos(e=o[1]*qu),f=s*Math.cos(l),h=s*Math.sin(l),d=Math.sin(e),g=0,p=0,m=0,v=0;while(n>++c)o=t[c],l=o[0]*qu,s=Math.cos(e=o[1]*qu),r=s*Math.cos(l),i=s*Math.sin(l),u=Math.sin(e),v+=a=Math.atan2(Math.sqrt((a=h*u-d*i)*a+(a=d*r-f*u)*a+(a=f*i-h*r)*a),f*r+h*i+d*u),g+=a*(f+(f=r)),p+=a*(h+(h=i)),m+=a*(d+(d=u));return[g,p,m,v]}function hi(t){function n(t){return Math.cos(t[1])*Math.cos(t[0])>u}function e(t){if(!(a=t.length))return[0,[]];var e,i,u,a,o,c=t[0],l=n(c),s=l,f=1,h=[];l&&h.push(o=[c]);for(var d=1;a>d;d++)e=t[d],u=n(e),u!==l&&(i=r(c,e),(Xr(c,i)||Xr(e,i))&&(e[0]+=Nu,e[1]+=Nu,u=n(e))),u!==l&&(f=0,(l=u)?h.push(o=[i=r(e,c)]):o.push(i=r(c,e)),c=i),u&&!Xr(c,e)&&o.push(e),c=e;return[f+((s&&u)<<1),h]}function r(t,n){var e=Zr(t,0),r=Zr(n,0),i=[1,0,0],a=Gr(e,r),o=Br(a,a),c=a[0],l=o-c*c;if(!l)return t;var s=u*o/l,f=-u*c/l,h=Gr(i,a),d=Jr(i,s),g=Jr(a,f);$r(d,g);var p=h,m=Br(d,p),v=Br(p,p),y=Math.sqrt(m*m-v*(Br(d,d)-1)),M=Jr(p,(-m-y)/v);return $r(M,d),Vr(M)}var i=t*qu,u=Math.cos(i),a=di(i,6*qu);return Qr(function(t){return n(t)&&t},e,a)}function di(t,n){var e=Math.cos(t),r=Math.sin(t);return function(i,u,a){i!=null?(i=gi(e,i),u=gi(e,u),(a>0?u>i:i>u)&&(i+=a*2*Au)):(i=t+a*2*Au,u=t);for(var o=[],c=a*n,l=i;a>0?l>u:u>l;l-=c)o.push(Vr([e,-r*Math.cos(l),-r*Math.sin(l)]));return o}}function gi(t,n){var e=Zr(n);e[0]-=t,Kr(e);var r=Math.acos(Math.max(-1,Math.min(1,-e[1])));return((0>-e[2]?-r:r)+2*Math.PI-Nu)%(2*Math.PI)}function pi(t,n){function e(e,r){var i=t(e,r);return n(i[0],i[1])}return t===mi?n:n===mi?t:(t.invert&&n.invert&&(e.invert=function(e,r){var i=n.invert(e,r);return t.invert(i[0],i[1])}),e)}function mi(t,n){return[t,n]}function vi(t,n,e){var r=d3.range(t,n-Nu,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function yi(t,n,e){var r=d3.range(t,n-Nu,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function Mi(t,n,e,r){function i(t){var n=Math.sin(t*=d)*g,e=Math.sin(d-t)*g,r=e*l+n*f,i=e*s+n*h,u=e*a+n*c;return[Math.atan2(i,r)/qu,Math.atan2(u,Math.sqrt(r*r+i*i))/qu]}var u=Math.cos(n),a=Math.sin(n),o=Math.cos(r),c=Math.sin(r),l=u*Math.cos(t),s=u*Math.sin(t),f=o*Math.cos(e),h=o*Math.sin(e),d=Math.acos(Math.max(-1,Math.min(1,a*c+u*o*Math.cos(e-t)))),g=1/Math.sin(d);return i.distance=d,i}function bi(t,n){return[t/(2*Au),Math.max(-.5,Math.min(.5,Math.log(Math.tan(Au/4+n/2))/(2*Au)))]}function xi(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function wi(t){var n=d3.sum(t,_i);return 0>n?4*Au+n:n}function _i(t){return Si(t.map(ki))}function ki(t){return[t[0]*qu,t[1]*qu]}function Si(t){if(!(n=t.length))return 0;for(var n,e,r,i,u,a,o,c,l,s=t[0],f=s[0],h=f,d=s[1],g=d,p=Math.cos(g),m=Math.sin(g),v=0,y=1;n>y;++y)s=t[y],r=s[1],Nu>Math.abs(Math.abs(g)-Au/2)&&Nu>Math.abs(Math.abs(r)-Au/2)||(e=s[0],a=Math.cos(r),o=Math.sin(r),Nu>Math.abs(g-Au/2)?v+=(e-f)*2:(u=Math.cos(i=e-h),c=Math.atan2(Math.sqrt((c=a*Math.sin(e-h))*c+(c=p*o-m*a*u)*c),m*o+p*a*u),l=(c+Au+g+r)/2,v+=(0>i&&i>-Au||i>Au?-4:4)*Math.atan(Math.sqrt(Math.abs(Math.tan(l/2)*Math.tan((l-c)/2)*Math.tan((l-Au/2-g)/2)*Math.tan((l-Au/2-r)/2))))),f=h,d=g,h=e,g=r,p=a,m=o);return v}function Ai(t){return Ni(function(){return t})()}function Ni(t){function n(t){return t=d(t[0]*qu,t[1]*qu),[t[0]*m+g,p-t[1]*m]}function e(t){return t=d.invert((t[0]-g)/m,(p-t[1])/m),[t[0]*Pu,t[1]*Pu]}function r(){d=pi(f=Ci(x,w,_),s);var t=s(M,b);return g=v-t[0]*m,p=y+t[1]*m,n}function i(t,n){var e=s(t,n);return[e[0]*m+g,p-e[1]*m]}function u(t){return i(t[0],t[1])}function a(t){if(!(n=t.length))return t;var n,e,r,u,a=0,o=t[0],c=[o=i(u=o[0],r=o[1])],s=Math.sin(r),f=Math.cos(r),h=o[0],d=o[1];while(n>++a)o=t[a],o=i(e=o[0],r=o[1]),l(h,d,u,s,f,h=o[0],d=o[1],u=e,s=Math.sin(r),f=Math.cos(r),S,c),c.push([h,d]);return c}function c(t){var n,e,r,i,u,o=t.length,c=-1,s=[];while(o>++c)s.push(e=a(n=t[c])),i=n.length-1,r=e.length-1,l((u=n[0])[0],u[1],(u=e[0])[0],Math.sin(u[1]),Math.cos(u[1]),(u=n[i])[0],u[1],(u=e[r])[0],Math.sin(u[1]),Math.cos(u[1]),S,n);return s}function l(t,n,e,r,u,a,o,c,s,f,h,d){var g=a-t,p=o-n,m=g*g+p*p;if(m>4*k&&h--){var v=r*s+u*f*Math.cos(c-e),y=1/(Math.SQRT2*Math.sqrt(1+v)),M=y*(u*Math.cos(e)+f*Math.cos(c)),b=y*(u*Math.sin(e)+f*Math.sin(c)),x=Math.max(-1,Math.min(1,y*(r+s))),w=Math.asin(x),_=Math.abs(Math.abs(x)-1),S=Nu>_||Tu>_&&(Tu>Math.abs(u)||Tu>Math.abs(f))?(e+c)/2:Math.atan2(b,M),A=i(S,w),N=A[0],C=A[1],T=t-N,q=n-C,P=g*q-p*T;if(P*P/m>k){var z=Math.cos(w);l(t,n,e,r,u,N,C,S,x,z,h,d),d.push([N,C]),l(N,C,S,x,z,a,o,c,s,f,h,d)}}}var s,f,h,d,g,p,m=150,v=480,y=250,M=0,b=0,x=0,w=0,_=0,k=.5,S=16,A=$a,N=null;n.object=function(t){return t=A(h(t)),C(t),t},n.clipAngle=function(t){return arguments.length?(A=t==null?(N=t,$a):hi(N=+t),n):N},n.scale=function(t){return arguments.length?(m=+t,r()):m},n.translate=function(t){return arguments.length?(v=+t[0],y=+t[1],r()):[v,y]},n.center=function(t){return arguments.length?(M=t[0]%360*qu,b=t[1]%360*qu,r()):[M*Pu,b*Pu]},n.rotate=function(t){return arguments.length?(x=t[0]%360*qu,w=t[1]%360*qu,_=t.length>2?t[2]%360*qu:0,r()):[x*Pu,w*Pu,_*Pu]},n.precision=function(t){return arguments.length?(S=(k=t*t)>0&&16,n):Math.sqrt(k)};var C=Wr({Point:function(t){t.coordinates=u(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(u)},LineString:function(t){t.coordinates=a(t.coordinates)},MultiLineString:function(t){t.coordinates=t.coordinates.map(a)},Polygon:function(t){t.coordinates=c(t.coordinates)},MultiPolygon:function(t){t.coordinates=t.coordinates.map(c)}}),h=Wr({point:function(t){return f(t[0]*qu,t[1]*qu)},Sphere:o});return function(){return s=t.apply(this,arguments),n.invert=s.invert&&e,r()}}function Ci(t,n,e){return t?n||e?pi(Pi(t),zi(n,e)):Pi(t):n||e?zi(n,e):Ti}function Ti(t,n){return[t>Au?t-2*Au:-Au>t?t+2*Au:t,n]}function qi(t){return function(n,e){return[(n+=t)>Au?n-2*Au:-Au>n?n+2*Au:n,e]}}function Pi(t){var n=qi(t);return n.invert=qi(-t),n}function zi(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),s=l*r+o*i;return[Math.atan2(c*u-s*a,o*r-l*i),Math.asin(Math.max(-1,Math.min(1,s*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),s=l*u-c*a;return[Math.atan2(c*u+l*a,o*r+s*i),Math.asin(Math.max(-1,Math.min(1,s*r-o*i)))]},e}function Ei(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 Li(t,n,e,r){var i,u,a,o,c,l,s;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],s=i[1],(s-a)*(o-u)-(c-a)*(l-u)>0}function Di(t,n,e){return(e[1]-n[1])*(t[0]-n[0])>(e[0]-n[0])*(t[1]-n[1])}function Fi(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],s=n[1]-c,f=r[1]-l,h=(o*(c-l)-f*(i-u))/(f*a-o*s);return[i+h*a,c+h*s]}function ji(t,n){var e={list:t.map(function(t,n){return{index:n,x:t[0],y:t[1]}}).sort(function(t,n){return n.y>t.y?-1:t.y>n.y?1:n.x>t.x?-1:t.x>n.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(t,n){return{edge:t,side:n,vertex:null,l:null,r:null}},insert:function(t,n){n.l=t,n.r=t.r,t.r.l=n,t.r=n},leftBound:function(t){var n=r.leftEnd;do n=n.r;while(n!=r.rightEnd&&i.rightOf(n,t));return n=n.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return t.edge==null?e.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return t.edge==null?e.bottomSite:t.edge.region[no[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+(r*r+i*i)*.5,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,s=r.region.r;s.y>l.y||l.y==s.y&&s.x>l.x?(u=t,a=e):(u=n,a=r);var f=o>=a.region.r.x;return f&&u.side==="l"||!f&&u.side==="r"?null:{x:o,y:c}},rightOf:function(t,n){var e=t.edge,r=e.region.r,i=n.x>r.x;if(i&&t.side==="l")return 1;if(!i&&t.side==="r")return 0;if(e.a===1){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=l*u*(1+2*a/l+e.b*e.b)>e.b*(a*a-u*u),0>e.b&&(c=!c)}}else{var s=e.c-e.a*n.x,f=n.y-s,h=n.x-r.x,d=s-r.y;c=f*f>h*h+d*d}return t.side==="l"?c:!c},endPoint:function(t,e,r){t.ep[e]=r,t.ep[no[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 u.list.length===0},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,s,f,h,d,g,p,m,v,y,M=e.list.shift();;)if(u.empty()||(a=u.min()),M&&(u.empty()||a.y>M.y||M.y==a.y&&a.x>M.x))o=r.leftBound(M),c=r.right(o),h=r.rightRegion(o),v=i.bisect(h,M),f=r.createHalfEdge(v,"l"),r.insert(o,f),p=i.intersect(o,f),p&&(u.del(o),u.insert(o,p,i.distance(p,M))),o=f,f=r.createHalfEdge(v,"r"),r.insert(o,f),p=i.intersect(f,c),p&&u.insert(f,p,i.distance(p,M)),M=e.list.shift();else{if(u.empty())break;o=u.extractMin(),l=r.left(o),c=r.right(o),s=r.right(c),h=r.leftRegion(o),d=r.rightRegion(c),m=o.vertex,i.endPoint(o.edge,o.side,m),i.endPoint(c.edge,c.side,m),r.del(o),u.del(c),r.del(c),y="l",h.y>d.y&&(g=h,h=d,d=g,y="r"),v=i.bisect(h,d),f=r.createHalfEdge(v,y),r.insert(l,f),i.endPoint(v,no[y],m),p=i.intersect(l,f),p&&(u.del(l),u.insert(l,p,i.distance(p,h))),p=i.intersect(f,s),p&&u.insert(f,p,i.distance(p,h))}for(o=r.right(r.leftEnd);o!=r.rightEnd;o=r.right(o))n(o.edge)}function Hi(){return{leaf:!0,nodes:[],point:null}}function Oi(t,n,e,r,i,u){if(!t(n,e,r,i,u)){var a=(e+i)*.5,o=(r+u)*.5,c=n.nodes;c[0]&&Oi(t,c[0],e,r,a,o),c[1]&&Oi(t,c[1],a,r,i,o),c[2]&&Oi(t,c[2],e,o,a,u),c[3]&&Oi(t,c[3],a,o,i,u)}}function Ri(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Yi(t,n,e,r){var i,u,a=0,o=n.length,c=e.length;while(o>a){if(r>=c)return-1;if(i=n.charCodeAt(a++),i===37){if(u=xo[n.charAt(a++)],!u||0>(r=u(t,e,r)))return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function Ui(t){return RegExp("^(?:"+t.map(d3.requote).join("|")+")","i")}function Ii(t){var n=new a,e=-1,r=t.length;while(r>++e)n.set(t[e].toLowerCase(),e);return n}function Vi(t,n,e){t+="";var r=t.length;return e>r?Array(e-r+1).join(n)+t:t}function Xi(t,n,e){go.lastIndex=0;var r=go.exec(n.substring(e));return r?e+=r[0].length:-1}function Zi(t,n,e){ho.lastIndex=0;var r=ho.exec(n.substring(e));return r?e+=r[0].length:-1}function Bi(t,n,e){vo.lastIndex=0;var r=vo.exec(n.substring(e));return r?(t.m=yo.get(r[0].toLowerCase()),e+=r[0].length):-1}function Gi(t,n,e){po.lastIndex=0;var r=po.exec(n.substring(e));return r?(t.m=mo.get(r[0].toLowerCase()),e+=r[0].length):-1}function $i(t,n,e){return Yi(t,bo.c+"",n,e)}function Ji(t,n,e){return Yi(t,bo.x+"",n,e)}function Ki(t,n,e){return Yi(t,bo.X+"",n,e)}function Wi(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}function Qi(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+2));return r?(t.y=tu(+r[0]),e+=r[0].length):-1}function tu(t){return t+(t>68?1900:2e3)}function nu(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1}function eu(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function ru(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}function iu(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1}function uu(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1}function au(t,n,e){wo.lastIndex=0;var r=wo.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1}function ou(t,n,e){var r=_o.get(n.substring(e,e+=2).toLowerCase());return r==null?-1:(t.p=r,e)}function cu(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+Vi(r,"0",2)+Vi(i,"0",2)}function lu(t){return t.toISOString()}function su(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 eo(e-1)),1),e}function u(t,e){return n(t=new eo(+t),e),t}function a(t,r,u){var a=i(t),o=[];if(u>1)while(r>a)e(a)%u||o.push(new Date(+a)),n(a,1);else while(r>a)o.push(new Date(+a)),n(a,1);return o}function o(t,n,e){try{eo=Ri;var r=new Ri;return r._=t,a(r,n,e)}finally{eo=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=u,t.range=a;var c=t.utc=fu(t);return c.floor=c,c.round=fu(r),c.ceil=fu(i),c.offset=fu(u),c.range=o,t}function fu(t){return function(n,e){try{eo=Ri;var r=new Ri;return r._=n,t(r,e)._}finally{eo=Date}}}function hu(t,n,e){function r(n){return t(n)}return r.invert=function(n){return gu(t.invert(n))},r.domain=function(n){return arguments.length?(t.domain(n),r):t.domain().map(gu)},r.nice=function(t){return r.domain(Yn(r.domain(),function(){return t}))},r.ticks=function(e,i){var u=du(r.domain());if(typeof e!="function"){var a=u[1]-u[0],o=a/e,c=d3.bisect(So,o);if(c==So.length)return n.year(u,e);if(!c)return t.ticks(e).map(gu);Math.log(So[c]/o)>Math.log(o/So[c-1])&&--c,e=n[c],i=e[1],e=e[0].range}return e(u[0],new Date(+u[1]+1),i)},r.tickFormat=function(){return e},r.copy=function(){return hu(t.copy(),n,e)},d3.rebind(r,t,"range","rangeRound","interpolate","clamp")}function du(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function gu(t){return new Date(t)}function pu(t){return function(n){var e=t.length-1,r=t[e];while(!r[1](n))r=t[--e];return r[0](n)}}function mu(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function vu(t){var n=t.getFullYear(),e=mu(n),r=mu(n+1);return n+(t-e)/(r-e)}function yu(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function Mu(t){var n=t.getUTCFullYear(),e=yu(n),r=yu(n+1);return n+(t-e)/(r-e)}var bu=".",xu=",",wu=[3,3];Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(_u){var ku=CSSStyleDeclaration.prototype,Su=ku.setProperty;ku.setProperty=function(t,n,e){Su.call(this,t,n+"",e)}}d3={version:"3.0.0pre"};var Au=Math.PI,Nu=1e-6,Cu=Nu*Nu,Tu=.001,qu=Au/180,Pu=180/Au,zu=u;try{zu(document.documentElement.childNodes)[0].nodeType}catch(Eu){zu=i}var Lu=[].__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]};d3.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 Du+t in this},get:function(t){return this[Du+t]},set:function(t,n){return this[Du+t]=n},remove:function(t){return t=Du+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)===Fu&&t.call(this,n.substring(1),this[n])}});var Du="\0",Fu=Du.charCodeAt(0);d3.functor=l,d3.rebind=function(t,n){var e,r=1,i=arguments.length;while(i>++r)t[e=arguments[r]]=s(t,n,n[e]);return t},d3.ascending=function(t,n){return n>t?-1:t>n?1:t>=n?0:0/0},d3.descending=function(t,n){return t>n?-1:n>t?1:n>=t?0:0/0},d3.mean=function(t,n){var e,r=t.length,i=0,u=-1,a=0;if(arguments.length===1)while(r>++u)f(e=t[u])&&(i+=(e-i)/++a);else while(r>++u)f(e=n.call(t,t[u],u))&&(i+=(e-i)/++a);return a?i:void 0},d3.median=function(t,n){return arguments.length>1&&(t=t.map(n)),t=t.filter(f),t.length?d3.quantile(t.sort(d3.ascending),.5):void 0},d3.min=function(t,n){var e,r,i=-1,u=t.length;if(arguments.length===1){while(u>++i&&((e=t[i])==null||e!=e))e=void 0;while(u>++i)(r=t[i])!=null&&e>r&&(e=r)}else{while(u>++i&&((e=n.call(t,t[i],i))==null||e!=e))e=void 0;while(u>++i)(r=n.call(t,t[i],i))!=null&&e>r&&(e=r)}return e},d3.max=function(t,n){var e,r,i=-1,u=t.length;if(arguments.length===1){while(u>++i&&((e=t[i])==null||e!=e))e=void 0;while(u>++i)(r=t[i])!=null&&r>e&&(e=r)}else{while(u>++i&&((e=n.call(t,t[i],i))==null||e!=e))e=void 0;while(u>++i)(r=n.call(t,t[i],i))!=null&&r>e&&(e=r)}return e},d3.extent=function(t,n){var e,r,i,u=-1,a=t.length;if(arguments.length===1){while(a>++u&&((e=i=t[u])==null||e!=e))e=i=void 0;while(a>++u)(r=t[u])!=null&&(e>r&&(e=r),r>i&&(i=r))}else{while(a>++u&&((e=i=n.call(t,t[u],u))==null||e!=e))e=void 0;while(a>++u)(r=n.call(t,t[u],u))!=null&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},d3.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=Math.random()*2-1,r=Math.random()*2-1,i=e*e+r*r;while(!i||i>1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(t,n){var e=arguments.length;2>e&&(n=1),1>e&&(t=0);var r=d3.random.normal();return function(){return Math.exp(t+n*r())}},irwinHall:function(t){return function(){for(var n=0,e=0;t>e;e++)n+=Math.random();return n/t}}},d3.sum=function(t,n){var e,r=0,i=t.length,u=-1;if(arguments.length===1)while(i>++u)isNaN(e=+t[u])||(r+=e);else while(i>++u)isNaN(e=+n.call(t,t[u],u))||(r+=e);return r},d3.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},d3.shuffle=function(t){var n,e,r=t.length;while(r)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t},d3.transpose=function(t){return d3.zip.apply(d3,t)},d3.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=d3.min(arguments,h),e=Array(n);n>++t;)for(var r,i=-1,u=e[t]=Array(r);r>++i;)u[i]=arguments[i][t];return e},d3.bisector=function(t){return{left:function(n,e,r,i){3>arguments.length&&(r=0),4>arguments.length&&(i=n.length);while(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){3>arguments.length&&(r=0),4>arguments.length&&(i=n.length);while(i>r){var u=r+i>>>1;t.call(n,n[u],u)>e?i=u:r=u+1}return r}}};var ju=d3.bisector(function(t){return t});d3.bisectLeft=ju.left,d3.bisect=d3.bisectRight=ju.right,d3.nest=function(){function t(n,o){if(o>=u.length)return r?r.call(i,n):e?n.sort(e):n;var c,l,s,f=-1,h=n.length,d=u[o++],g=new a,p={};while(h>++f)(s=g.get(c=d(l=n[f])))?s.push(l):g.set(c,[l]);return g.forEach(function(n,e){p[n]=t(e,o)}),p}function n(t,e){if(e>=u.length)return t;var r,i=[],a=o[e++];for(r in t)i.push({key:r,values:n(t[r],e)});return a&&i.sort(function(t,n){return a(t.key,n.key)}),i}var e,r,i={},u=[],o=[];return i.map=function(n){return t(n,0)},i.entries=function(e){return n(t(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},d3.keys=function(t){var n=[];for(var e in t)n.push(e);return n},d3.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},d3.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},d3.permute=function(t,n){var e=[],r=-1,i=n.length;while(i>++r)e[r]=t[n[r]];return e},d3.merge=function(t){return Array.prototype.concat.apply([],t)},d3.range=function(t,n,e){if(3>arguments.length&&(e=1,2>arguments.length&&(n=t,t=0)),(n-t)/e===1/0)throw Error("infinite range");var r,i=[],u=g(Math.abs(e)),a=-1;if(t*=u,n*=u,e*=u,0>e)while((r=t+e*++a)>n)i.push(r/u);else while(n>(r=t+e*++a))i.push(r/u);return i},d3.requote=function(t){return t.replace(Hu,"\\$&")};var Hu=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)},d3.xhr=function(t,n,e){function r(){var t=l.status;!t&&l.responseText||t>=200&&300>t||t===304?u.load.call(i,c.call(i,l)):u.error.call(i,l)}var i={},u=d3.dispatch("progress","load","error"),a={},c=o,l=new(window.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=d3.event;d3.event=t;try{u.progress.call(i,l)}finally{d3.event=n}},i.header=function(t,n){return t=(t+"").toLowerCase(),2>arguments.length?a[t]:(n==null?delete a[t]:a[t]=n+"",i)},i.mimeType=function(t){return arguments.length?(n=t==null?null:t+"",i):n},i.response=function(t){return c=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(zu(arguments)))}}),i.send=function(e,r,u){if(arguments.length===2&&typeof r=="function"&&(u=r,r=null),l.open(e,t,!0),n==null||"accept"in a||(a.accept=n+",*/*"),l.setRequestHeader)for(var o in a)l.setRequestHeader(o,a[o]);return n!=null&&l.overrideMimeType&&l.overrideMimeType(n),u!=null&&i.on("error",u).on("load",function(t){u(null,t)}),l.send(r==null?null:r),i},i.abort=function(){return l.abort(),i},d3.rebind(i,u,"on"),arguments.length===2&&typeof n=="function"&&(e=n,n=null),e==null?i:i.get(e)},d3.text=function(){return d3.xhr.apply(d3,arguments).response(p)},d3.json=function(t,n){return d3.xhr(t,"application/json",n).response(m)},d3.html=function(t,n){return d3.xhr(t,"text/html",n).response(v)},d3.xml=function(){return d3.xhr.apply(d3,arguments).response(y)};var Ou={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/"};d3.ns={prefix:Ou,qualify:function(t){var n=t.indexOf(":"),e=t;return n>=0&&(e=t.substring(0,n),t=t.substring(n+1)),Ou.hasOwnProperty(e)?{space:Ou[e],local:t}:t}},d3.dispatch=function(){var t=new M,n=-1,e=arguments.length;while(e>++n)t[arguments[n]]=b(t);return t},M.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)},d3.format=function(t){var n=Ru.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],s=n[9],f=1,h="",d=!1;switch(l&&(l=+l.substring(1)),(a||e==="0"&&r==="=")&&(a=e="0",r="=",c&&(o-=Math.floor((o-1)/4))),s){case"n":c=!0,s="g";break;case"%":f=100,h="%",s="f";break;case"p":f=100,h="%",s="r";break;case"b":case"o":case"x":case"X":u&&(u="0"+s.toLowerCase());case"c":case"d":d=!0,l=0;break;case"s":f=-1,s="r"}u==="#"&&(u=""),s!="r"||l||(s="g"),s=Yu.get(s)||w;var g=a&&c;return function(t){if(d&&t%1)return"";var n=0>t||t===0&&0>1/t?(t=-t,"-"):i;if(0>f){var p=d3.formatPrefix(t,l);t=p.scale(t),h=p.symbol}else t*=f;t=s(t,l),!a&&c&&(t=Uu(t));var m=u.length+t.length+(g?0:n.length),v=o>m?Array(m=o-m+1).join(e):"";return g&&(t=Uu(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+(g?t:v+t))+h}};var Ru=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Yu=d3.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 d3.round(t,n=x(t,n)).toFixed(Math.max(0,Math.min(20,n)))}}),Uu=o;if(wu){var Iu=wu.length;Uu=function(t){var n=t.lastIndexOf("."),e=n>=0?"."+t.substring(n+1):(n=t.length,""),r=[],i=0,u=wu[0];while(n>0&&u>0)r.push(t.substring(n-=u,n+u)),u=wu[i=(i+1)%Iu];return r.reverse().join(xu||"")+e}}var Vu=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(_);d3.formatPrefix=function(t,n){var e=0;return t&&(0>t&&(t*=-1),n&&(t=d3.round(t,x(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,Math.floor((0>=e?e+1:e-1)/3)*3))),Vu[8+e/3]};var Xu=function(){return o},Zu=d3.map({linear:Xu,poly:q,quad:function(){return N},cubic:function(){return C},sin:function(){return P},exp:function(){return z},circle:function(){return E},elastic:L,back:D,bounce:function(){return F}}),Bu=d3.map({"in":o,out:S,"in-out":A,"out-in":function(t){return A(S(t))}});d3.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=Zu.get(e)||Xu,r=Bu.get(r)||o,k(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.transform=function(t){var n=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate();return new R(e?e.matrix:Gu)})(t)},R.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Gu={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(t,n){var e,r=d3.interpolators.length;while(--r>=0&&!(e=d3.interpolators[r](t,n)));return e},d3.interpolateNumber=function(t,n){return n-=t,function(e){return t+n*e}},d3.interpolateRound=function(t,n){return n-=t,function(e){return Math.round(t+n*e)}},d3.interpolateString=function(t,n){var e,r,i,u,a,o=0,c=0,l=[],s=[];for($u.lastIndex=0,r=0;e=$u.exec(n);++r)e.index&&l.push(n.substring(o,c=e.index)),s.push({i:l.length,x:e[0]}),l.push(null),o=$u.lastIndex;for(n.length>o&&l.push(n.substring(o)),r=0,u=s.length;(e=$u.exec(t))&&u>r;++r)if(a=s[r],a.x==e[0]){if(a.i)if(l[a.i+1]==null)for(l[a.i-1]+=a.x,l.splice(a.i,1),i=r+1;u>i;++i)s[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)s[i].i-=2;else if(l[a.i+1]==null)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)s[i].i--;s.splice(r,1),u--,r--}else a.x=d3.interpolateNumber(parseFloat(e[0]),parseFloat(a.x));while(u>r)a=s.pop(),l[a.i+1]==null?l[a.i]=a.x:(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1)),u--;return l.length===1?l[0]==null?s[0].x:function(){return n}:function(t){for(r=0;u>r;++r)l[(a=s[r]).i]=a.x(t);return l.join("")}},d3.interpolateTransform=function(t,n){var e,r=[],i=[],u=d3.transform(t),a=d3.transform(n),o=u.translate,c=a.translate,l=u.rotate,s=a.rotate,f=u.skew,h=a.skew,d=u.scale,g=a.scale;return o[0]!=c[0]||o[1]!=c[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:d3.interpolateNumber(o[0],c[0])},{i:3,x:d3.interpolateNumber(o[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),d[0]!=g[0]||d[1]!=g[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:e-4,x:d3.interpolateNumber(d[0],g[0])},{i:e-2,x:d3.interpolateNumber(d[1],g[1])})):(g[0]!=1||g[1]!=1)&&r.push(r.pop()+"scale("+g+")"),e=i.length,function(t){var n,u=-1;while(e>++u)r[(n=i[u]).i]=n.x(t);return r.join("")}},d3.interpolateRgb=function(t,n){t=d3.rgb(t),n=d3.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"#"+J(Math.round(e+u*t))+J(Math.round(r+a*t))+J(Math.round(i+o*t))}},d3.interpolateHsl=function(t,n){t=d3.hsl(t),n=d3.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 un(e+u*t,r+a*t,i+o*t)+""}},d3.interpolateLab=function(t,n){t=d3.lab(t),n=d3.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 fn(e+u*t,r+a*t,i+o*t)+""}},d3.interpolateHcl=function(t,n){t=d3.hcl(t),n=d3.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 cn(e+u*t,r+a*t,i+o*t)+""}},d3.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(d3.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}},d3.interpolateObject=function(t,n){var e,r={},i={};for(e in t)e in n?r[e]=V(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 $u=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(t,n){return n instanceof Array&&d3.interpolateArray(t,n)},function(t,n){return(typeof t=="string"||typeof n=="string")&&d3.interpolateString(t+"",n+"")},function(t,n){return(typeof n=="string"?Ku.has(n)||/^(#|rgb\(|hsl\()/.test(n):n instanceof B)&&d3.interpolateRgb(t,n)},function(t,n){return!isNaN(t=+t)&&!isNaN(n=+n)&&d3.interpolateNumber(t,n)}],B.prototype.toString=function(){return this.rgb()+""},d3.rgb=function(t,n,e){return arguments.length===1?t instanceof $?G(t.r,t.g,t.b):K(""+t,G,un):G(~~t,~~n,~~e)};var Ju=$.prototype=new B;Ju.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),G(Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(r/t)))):G(i,i,i)},Ju.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),G(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},Ju.hsl=function(){return W(this.r,this.g,this.b)},Ju.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var Ku=d3.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"}); -Ku.forEach(function(t,n){Ku.set(t,K(n,G,un))}),d3.hsl=function(t,n,e){return arguments.length===1?t instanceof rn?en(t.h,t.s,t.l):K(""+t,W,en):en(+t,+n,+e)};var Wu=rn.prototype=new B;Wu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),en(this.h,this.s,this.l/t)},Wu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),en(this.h,this.s,t*this.l)},Wu.rgb=function(){return un(this.h,this.s,this.l)},d3.hcl=function(t,n,e){return arguments.length===1?t instanceof on?an(t.h,t.c,t.l):t instanceof sn?hn(t.l,t.a,t.b):hn((t=Q((t=d3.rgb(t)).r,t.g,t.b)).l,t.a,t.b):an(+t,+n,+e)};var Qu=on.prototype=new B;Qu.brighter=function(t){return an(this.h,this.c,Math.min(100,this.l+ta*(arguments.length?t:1)))},Qu.darker=function(t){return an(this.h,this.c,Math.max(0,this.l-ta*(arguments.length?t:1)))},Qu.rgb=function(){return cn(this.h,this.c,this.l).rgb()},d3.lab=function(t,n,e){return arguments.length===1?t instanceof sn?ln(t.l,t.a,t.b):t instanceof on?cn(t.l,t.c,t.h):Q((t=d3.rgb(t)).r,t.g,t.b):ln(+t,+n,+e)};var ta=18,na=.95047,ea=1,ra=1.08883,ia=sn.prototype=new B;ia.brighter=function(t){return ln(Math.min(100,this.l+ta*(arguments.length?t:1)),this.a,this.b)},ia.darker=function(t){return ln(Math.max(0,this.l-ta*(arguments.length?t:1)),this.a,this.b)},ia.rgb=function(){return fn(this.l,this.a,this.b)};var ua=function(t,n){return n.querySelector(t)},aa=function(t,n){return n.querySelectorAll(t)},oa=document.documentElement,ca=oa.matchesSelector||oa.webkitMatchesSelector||oa.mozMatchesSelector||oa.msMatchesSelector||oa.oMatchesSelector,la=function(t,n){return ca.call(t,n)};typeof Sizzle=="function"&&(ua=function(t,n){return Sizzle(t,n)[0]||null},aa=function(t,n){return Sizzle.uniqueSort(Sizzle(t,n))},la=Sizzle.matchesSelector);var sa=[];d3.selection=function(){return fa},d3.selection.prototype=sa,sa.select=function(t){var n,e,r,i,u=[];typeof t!="function"&&(t=vn(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)},sa.selectAll=function(t){var n,e,r=[];typeof t!="function"&&(t=yn(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=zu(t.call(e,e.__data__,o))),n.parentNode=e);return mn(r)},sa.attr=function(t,n){if(2>arguments.length){if(typeof t=="string"){var e=this.node();return t=d3.ns.qualify(t),t.local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(Mn(n,t[n]));return this}return this.each(Mn(t,n))},sa.classed=function(t,n){if(2>arguments.length){if(typeof t=="string"){var e=this.node(),r=(t=t.trim().split(/^|\s+/g)).length,i=-1;if(n=e.classList){while(r>++i)if(!n.contains(t[i]))return!1}else{n=e.className,n.baseVal!=null&&(n=n.baseVal);while(r>++i)if(!bn(t[i]).test(n))return!1}return!0}for(n in t)this.each(xn(n,t[n]));return this}return this.each(xn(t,n))},sa.style=function(t,n,e){var r=arguments.length;if(3>r){if(typeof t!="string"){2>r&&(n="");for(e in t)this.each(_n(e,t[e],n));return this}if(2>r)return getComputedStyle(this.node(),null).getPropertyValue(t);e=""}return this.each(_n(t,n,e))},sa.property=function(t,n){if(2>arguments.length){if(typeof t=="string")return this.node()[t];for(n in t)this.each(kn(n,t[n]));return this}return this.each(kn(t,n))},sa.text=function(t){return arguments.length?this.each(typeof t=="function"?function(){var n=t.apply(this,arguments);this.textContent=n==null?"":n}:t==null?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},sa.html=function(t){return arguments.length?this.each(typeof t=="function"?function(){var n=t.apply(this,arguments);this.innerHTML=n==null?"":n}:t==null?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},sa.append=function(t){function n(){return this.appendChild(document.createElementNS(this.namespaceURI,t))}function e(){return this.appendChild(document.createElementNS(t.space,t.local))}return t=d3.ns.qualify(t),this.select(t.local?e:n)},sa.insert=function(t,n){function e(){return this.insertBefore(document.createElementNS(this.namespaceURI,t),ua(n,this))}function r(){return this.insertBefore(document.createElementNS(t.space,t.local),ua(n,this))}return t=d3.ns.qualify(t),this.select(t.local?r:e)},sa.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},sa.data=function(t,n){function e(t,e){var r,i,u,o=t.length,f=e.length,h=Math.min(o,f),d=Math.max(o,f),g=[],p=[],m=[];if(n){var v,y=new a,M=[],b=e.length;for(r=-1;o>++r;)v=n.call(i=t[r],i.__data__,r),y.has(v)?m[b++]=i:y.set(v,i),M.push(v);for(r=-1;f>++r;)v=n.call(e,u=e[r],r),y.has(v)?(g[r]=i=y.get(v),i.__data__=u,p[r]=m[r]=null):(p[r]=Sn(u),g[r]=m[r]=null),y.remove(v);for(r=-1;o>++r;)y.has(M[r])&&(m[r]=t[r])}else{for(r=-1;h>++r;)i=t[r],u=e[r],i?(i.__data__=u,g[r]=i,p[r]=m[r]=null):(p[r]=Sn(u),g[r]=m[r]=null);for(;f>r;++r)p[r]=Sn(e[r]),g[r]=m[r]=null;for(;d>r;++r)m[r]=t[r],p[r]=g[r]=null}p.update=g,p.parentNode=g.parentNode=m.parentNode=t.parentNode,c.push(p),l.push(g),s.push(m)}var r,i,u=-1,o=this.length;if(!arguments.length){t=Array(o=(r=this[0]).length);while(o>++u)(i=r[u])&&(t[u]=i.__data__);return t}var c=qn([]),l=mn([]),s=mn([]);if(typeof t=="function")while(o>++u)e(r=this[u],t.call(r,r.parentNode.__data__,u));else while(o>++u)e(r=this[u],t);return l.enter=function(){return c},l.exit=function(){return s},l},sa.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},sa.filter=function(t){var n,e,r,i=[];typeof t!="function"&&(t=An(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)},sa.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},sa.sort=function(t){t=Nn.apply(this,arguments);for(var n=-1,e=this.length;e>++n;)this[n].sort(t);return this.order()},sa.on=function(t,n,e){var r=arguments.length;if(3>r){if(typeof t!="string"){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))},sa.each=function(t){return Tn(this,function(n,e,r){t.call(n,n.__data__,e,r)})},sa.call=function(t){var n=zu(arguments);return t.apply(n[0]=this,n),this},sa.empty=function(){return!this.node()},sa.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},sa.transition=function(){var t,n,e=da||++pa,r=[],i=Object.create(ma);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])&&zn(n,c,e,i),t.push(n)}return Pn(r,e)};var fa=mn([[document]]);fa[0].parentNode=oa,d3.select=function(t){return typeof t=="string"?fa.select(t):mn([[t]])},d3.selectAll=function(t){return typeof t=="string"?fa.selectAll(t):mn([zu(t)])};var ha=[];d3.selection.enter=qn,d3.selection.enter.prototype=ha,ha.append=sa.append,ha.insert=sa.insert,ha.empty=sa.empty,ha.node=sa.node,ha.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,s=i.length;s>++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 da,ga=[],pa=0,ma={ease:T,delay:0,duration:250};ga.call=sa.call,ga.empty=sa.empty,ga.node=sa.node,d3.transition=function(t){return arguments.length?da?t.transition():t:fa.transition()},d3.transition.prototype=ga,ga.select=function(t){var n,e,r,i=this.id,u=[];typeof t!="function"&&(t=vn(t));for(var a=-1,o=this.length;o>++a;){u.push(n=[]);for(var c=this[a],l=-1,s=c.length;s>++l;)(r=c[l])&&(e=t.call(r,r.__data__,l))?("__data__"in r&&(e.__data__=r.__data__),zn(e,l,i,r.__transition__[i]),n.push(e)):n.push(null)}return Pn(u,i)},ga.selectAll=function(t){var n,e,r,i,u,a=this.id,o=[];typeof t!="function"&&(t=yn(t));for(var c=-1,l=this.length;l>++c;)for(var s=this[c],f=-1,h=s.length;h>++f;)if(r=s[f]){u=r.__transition__[a],e=t.call(r,r.__data__,f),o.push(n=[]);for(var d=-1,g=e.length;g>++d;)zn(i=e[d],d,a,u),n.push(i)}return Pn(o,a)},ga.filter=function(t){var n,e,r,i=[];typeof t!="function"&&(t=An(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 Pn(i,this.id,this.time).ease(this.ease())},ga.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=V(t),u=d3.ns.qualify(t);return Ln(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 t==null?u.local?r:e:(t+="",u.local?a:n)})},ga.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=d3.ns.qualify(t);return this.tween("attr."+t,i.local?r:e)},ga.style=function(t,n,e){function r(){this.style.removeProperty(t)}var i=arguments.length;if(3>i){if(typeof t!="string"){2>i&&(n="");for(e in t)this.style(e,t[e],n);return this}e=""}var u=V(t);return Ln(this,"style."+t,n,function(n){function i(){var r,i=getComputedStyle(this,null).getPropertyValue(t);return i!==n&&(r=u(i,n),function(n){this.style.setProperty(t,r(n),e)})}return n==null?r:(n+="",i)})},ga.styleTween=function(t,n,e){return 3>arguments.length&&(e=""),this.tween("style."+t,function(r,i){var u=n.call(this,r,i,getComputedStyle(this,null).getPropertyValue(t));return u&&function(n){this.style.setProperty(t,u(n),e)}})},ga.text=function(t){return Ln(this,"text",t,En)},ga.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},ga.ease=function(t){var n=this.id;return 1>arguments.length?this.node().__transition__[n].ease:(typeof t!="function"&&(t=d3.ease.apply(d3,arguments)),Tn(this,function(e){e.__transition__[n].ease=t}))},ga.delay=function(t){var n=this.id;return Tn(this,typeof t=="function"?function(e,r,i){e.__transition__[n].delay=t.call(e,e.__data__,r,i)|0}:(t|=0,function(e){e.__transition__[n].delay=t}))},ga.duration=function(t){var n=this.id;return Tn(this,typeof t=="function"?function(e,r,i){e.__transition__[n].duration=Math.max(1,t.call(e,e.__data__,r,i)|0)}:(t=Math.max(1,t|0),function(e){e.__transition__[n].duration=t}))},ga.each=function(t,n){var e=this.id;if(2>arguments.length){var r=ma,i=da;da=e,Tn(this,function(n,r,i){ma=n.__transition__[e],t.call(n,n.__data__,r,i)}),ma=r,da=i}else Tn(this,function(r){r.__transition__[e].event.on(t,n)});return this},ga.transition=function(){for(var t,n,e,r,i=this.id,u=++pa,a=[],o=0,c=this.length;c>o;o++){a.push(t=[]);for(var n=this[o],l=0,s=n.length;s>l;l++)(e=n[l])&&(r=Object.create(e.__transition__[i]),r.delay+=r.duration,zn(e,l,u,r)),t.push(e)}return Pn(a,u)},ga.tween=function(t,n){var e=this.id;return 2>arguments.length?this.node().__transition__[e].tween.get(t):Tn(this,n==null?function(n){n.__transition__[e].tween.remove(t)}:function(r){r.__transition__[e].tween.set(t,n)})};var va,ya,Ma=0,ba={},xa=null;d3.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=ba[t.id];r&&r.callback===t?(r.then=e,r.delay=n):ba[t.id=++Ma]=xa={callback:t,then:e,delay:n,next:xa},va||(ya=clearTimeout(ya),va=1,wa(Dn))},d3.timer.flush=function(){var t,n=Date.now(),e=xa;while(e)t=n-e.then,e.delay||(e.flush=e.callback(t)),e=e.next;Fn()};var wa=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,17)};d3.mouse=function(t){return jn(t,H())};var _a=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(t,n){return 2>arguments.length&&(n=H().touches),n?zu(n).map(function(n){var e=jn(t,n);return e.identifier=n.identifier,e}):[]},d3.scale={},d3.scale.linear=function(){return In([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return Kn(d3.scale.linear(),Wn)};var ka=d3.format(".0e");Wn.pow=function(t){return Math.pow(10,t)},Qn.pow=function(t){return-Math.pow(10,-t)},d3.scale.pow=function(){return te(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ee([],{t:"range",a:[[]]})},d3.scale.category10=function(){return d3.scale.ordinal().range(Sa)},d3.scale.category20=function(){return d3.scale.ordinal().range(Aa)},d3.scale.category20b=function(){return d3.scale.ordinal().range(Na)},d3.scale.category20c=function(){return d3.scale.ordinal().range(Ca)};var Sa=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Aa=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Na=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Ca=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return re([],[])},d3.scale.quantize=function(){return ie(0,1,[0,1])},d3.scale.threshold=function(){return ue([.5],[0,1])},d3.scale.identity=function(){return ae([0,1])},d3.svg={},d3.svg.arc=function(){function t(){var t=n.apply(this,arguments),u=e.apply(this,arguments),a=r.apply(this,arguments)+Ta,o=i.apply(this,arguments)+Ta,c=(a>o&&(c=a,a=o,o=c),o-a),l=Au>c?"0":"1",s=Math.cos(a),f=Math.sin(a),h=Math.cos(o),d=Math.sin(o);return c>=qa?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*s+","+u*f+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*d+"L"+t*h+","+t*d+"A"+t+","+t+" 0 "+l+",0 "+t*s+","+t*f+"Z":"M"+u*s+","+u*f+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*d+"L0,0"+"Z"}var n=oe,e=ce,r=le,i=se;return t.innerRadius=function(e){return arguments.length?(n=l(e),t):n},t.outerRadius=function(n){return arguments.length?(e=l(n),t):e},t.startAngle=function(n){return arguments.length?(r=l(n),t):r},t.endAngle=function(n){return arguments.length?(i=l(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+Ta;return[Math.cos(u)*t,Math.sin(u)*t]},t};var Ta=-Au/2,qa=2*Au-1e-6;d3.svg.line=function(){return fe(o)};var Pa=d3.map({linear:ge,"linear-closed":pe,"step-before":me,"step-after":ve,basis:_e,"basis-open":ke,"basis-closed":Se,bundle:Ae,cardinal:be,"cardinal-open":ye,"cardinal-closed":Me,monotone:ze});Pa.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var za=[0,2/3,1/3,0],Ea=[0,1/3,2/3,0],La=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var t=fe(Ee);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},me.reverse=ve,ve.reverse=me,d3.svg.area=function(){return Le(o)},d3.svg.area.radial=function(){var t=Le(Ee);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},d3.svg.chord=function(){function t(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=s.call(t,i,r),a=f.call(t,i,r)+Ta,o=h.call(t,i,r)+Ta;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>Au)+",1 "+n}function a(t,n,e,r){return"Q 0,0 "+r}var o=e,c=n,s=De,f=le,h=se;return t.radius=function(n){return arguments.length?(s=l(n),t):s},t.source=function(n){return arguments.length?(o=l(n),t):o},t.target=function(n){return arguments.length?(c=l(n),t):c},t.startAngle=function(n){return arguments.length?(f=l(n),t):f},t.endAngle=function(n){return arguments.length?(h=l(n),t):h},t},d3.svg.diagonal=function(){function t(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=e,i=n,u=Fe;return t.source=function(n){return arguments.length?(r=l(n),t):r},t.target=function(n){return arguments.length?(i=l(n),t):i},t.projection=function(n){return arguments.length?(u=n,t):u},t},d3.svg.diagonal.radial=function(){var t=d3.svg.diagonal(),n=Fe,e=t.projection;return t.projection=function(t){return arguments.length?e(je(n=t)):n},t},d3.svg.symbol=function(){function t(t,r){return(Da.get(n.call(this,t,r))||Re)(e.call(this,t,r))}var n=Oe,e=He;return t.type=function(e){return arguments.length?(n=l(e),t):n},t.size=function(n){return arguments.length?(e=l(n),t):e},t};var Da=d3.map({circle:Re,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*ja)),e=n*ja;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/Fa),e=n*Fa/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/Fa),e=n*Fa/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});d3.svg.symbolTypes=Da.keys();var Fa=Math.sqrt(3),ja=Math.tan(30*qu);d3.svg.axis=function(){function t(t){t.each(function(){var t,f=d3.select(this),h=l==null?e.ticks?e.ticks.apply(e,c):e.domain():l,d=n==null?e.tickFormat?e.tickFormat.apply(e,c):String:n,g=Ie(e,h,s),p=f.selectAll(".minor").data(g,String),m=p.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),v=d3.transition(p.exit()).style("opacity",1e-6).remove(),y=d3.transition(p).style("opacity",1),M=f.selectAll("g").data(h,String),b=M.enter().insert("g","path").style("opacity",1e-6),x=d3.transition(M.exit()).style("opacity",1e-6).remove(),w=d3.transition(M).style("opacity",1),_=Rn(e),k=f.selectAll(".domain").data([0]),S=d3.transition(k),A=e.copy(),N=this.__chart__||A;this.__chart__=A,k.enter().append("path").attr("class","domain"),b.append("line").attr("class","tick"),b.append("text");var C=b.select("line"),T=w.select("line"),q=M.select("text").text(d),P=b.select("text"),z=w.select("text");switch(r){case"bottom":t=Ye,m.attr("y2",u),y.attr("x2",0).attr("y2",u),C.attr("y2",i),P.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"),S.attr("d","M"+_[0]+","+a+"V0H"+_[1]+"V"+a);break;case"top":t=Ye,m.attr("y2",-u),y.attr("x2",0).attr("y2",-u),C.attr("y2",-i),P.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"),S.attr("d","M"+_[0]+","+-a+"V0H"+_[1]+"V"+-a);break;case"left":t=Ue,m.attr("x2",-u),y.attr("x2",-u).attr("y2",0),C.attr("x2",-i),P.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"),S.attr("d","M"+-a+","+_[0]+"H0V"+_[1]+"H"+-a);break;case"right":t=Ue,m.attr("x2",u),y.attr("x2",u).attr("y2",0),C.attr("x2",i),P.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"),S.attr("d","M"+a+","+_[0]+"H0V"+_[1]+"H"+a)}if(e.ticks)b.call(t,N),w.call(t,A),x.call(t,A),m.call(t,N),y.call(t,A),v.call(t,A);else{var E=A.rangeBand()/2,L=function(t){return A(t)+E};b.call(t,L),w.call(t,L)}})}var n,e=d3.scale.linear(),r="bottom",i=6,u=6,a=6,o=3,c=[10],l=null,s=0;return t.scale=function(n){return arguments.length?(e=n,t):e},t.orient=function(n){return arguments.length?(r=n,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?(s=+n,t):s},t},d3.svg.brush=function(){function t(u){u.each(function(){var u,a=d3.select(this),s=a.selectAll(".background").data([0]),f=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),s.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.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 Ha[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=Rn(o),s.attr("x",u[0]).attr("width",u[1]-u[0]),e(a)),c&&(u=Rn(c),s.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("+s[+/e$/.test(t)][0]+","+s[+/^s/.test(t)][1]+")"})}function e(t){t.select(".extent").attr("x",s[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1][0]-s[0][0])}function r(t){t.select(".extent").attr("y",s[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1][1]-s[0][1])}function i(){function i(){var t=d3.event.changedTouches;return t?d3.touches(v,t)[0]:d3.mouse(v)}function l(){d3.event.keyCode==32&&(k||(p=null,S[0]-=s[1][0],S[1]-=s[1][1],k=2),j())}function f(){d3.event.keyCode==32&&k==2&&(S[0]+=s[1][0],S[1]+=s[1][1],k=0,j())}function h(){var t=i(),u=!1;m&&(t[0]+=m[0],t[1]+=m[1]),k||(d3.event.altKey?(p||(p=[(s[0][0]+s[1][0])/2,(s[0][1]+s[1][1])/2]),S[0]=s[+(p[0]>t[0])][0],S[1]=s[+(p[1]>t[1])][1]):p=null),w&&d(t,o,0)&&(e(b),u=!0),_&&d(t,c,1)&&(r(b),u=!0),u&&(n(b),M({type:"brush",mode:k?"move":"resize"}))}function d(t,n,e){var r,i,a=Rn(n),o=a[0],c=a[1],l=S[e],f=s[1][e]-s[0][e];return k&&(o-=l,c-=f+l),r=Math.max(o,Math.min(c,t[e])),k?i=(r+=l)+f:(p&&(l=Math.max(o,Math.min(c,2*p[e]-r))),r>l?(i=r,r=l):i=l),s[0][e]!==r||s[1][e]!==i?(u=null,s[0][e]=r,s[1][e]=i,!0):void 0}function g(){h(),b.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),d3.select("body").style("cursor",null),A.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"}),j()}var p,m,v=this,y=d3.select(d3.event.target),M=a.of(v,arguments),b=d3.select(v),x=y.datum(),w=!/^(n|s)$/.test(x)&&o,_=!/^(e|w)$/.test(x)&&c,k=y.classed("extent"),S=i(),A=d3.select(window).on("mousemove.brush",h).on("mouseup.brush",g).on("touchmove.brush",h).on("touchend.brush",g).on("keydown.brush",l).on("keyup.brush",f);if(k)S[0]=s[0][0]-S[0],S[1]=s[0][1]-S[1];else if(x){var N=+/w$/.test(x),C=+/^n/.test(x);m=[s[1-N][0]-S[0],s[1-C][1]-S[1]],S[0]=s[N][0],S[1]=s[C][1]}else d3.event.altKey&&(p=S.slice());b.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",y.style("cursor")),M({type:"brushstart"}),h(),j()}var u,a=O(t,"brushstart","brush","brushend"),o=null,c=null,l=Oa[0],s=[[0,0],[0,0]];return t.x=function(n){return arguments.length?(o=n,l=Oa[!o<<1|!c],t):o},t.y=function(n){return arguments.length?(c=n,l=Oa[!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),s[0][0]=e|0,s[1][0]=r|0),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),s[0][1]=i|0,s[1][1]=a|0),t):(n=u||s,o&&(e=n[0][0],r=n[1][0],u||(e=s[0][0],r=s[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=s[0][1],a=s[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,s[0][0]=s[0][1]=s[1][0]=s[1][1]=0,t},t.empty=function(){return o&&s[0][0]===s[1][0]||c&&s[0][1]===s[1][1]},d3.rebind(t,a,"on")};var Ha={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Oa=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function t(){this.on("mousedown.drag",n).on("touchstart.drag",n)}function n(){function t(){var t=o.parentNode;return s!=null?d3.touches(t).filter(function(t){return t.identifier===s})[0]:d3.mouse(t)}function n(){if(!o.parentNode)return i();var n=t(),e=n[0]-f[0],r=n[1]-f[1];h|=e|r,f=n,j(),c({type:"drag",x:n[0]+a[0],y:n[1]+a[1],dx:e,dy:r})}function i(){c({type:"dragend"}),h&&(j(),d3.event.target===l&&d.on("click.drag",u,!0)),d.on(s!=null?"touchmove.drag-"+s:"mousemove.drag",null).on(s!=null?"touchend.drag-"+s:"mouseup.drag",null)}function u(){j(),d.on("click.drag",null)}var a,o=this,c=e.of(o,arguments),l=d3.event.target,s=d3.event.touches?d3.event.changedTouches[0].identifier:null,f=t(),h=0,d=d3.select(window).on(s!=null?"touchmove.drag-"+s:"mousemove.drag",n).on(s!=null?"touchend.drag-"+s:"mouseup.drag",i,!0);r?(a=r.apply(o,arguments),a=[a.x-f[0],a.y-f[1]]):a=[0,0],s==null&&j(),c({type:"dragstart"})}var e=O(t,"drag","dragstart","dragend"),r=null;return t.origin=function(n){return arguments.length?(r=n,t):r},d3.rebind(t,e,"on")},d3.behavior.zoom=function(){function t(){this.on("mousedown.zoom",o).on("mousewheel.zoom",c).on("mousemove.zoom",l).on("DOMMouseScroll.zoom",c).on("dblclick.zoom",s).on("touchstart.zoom",f).on("touchmove.zoom",h).on("touchend.zoom",f)}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(w[0],Math.min(w[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(p.range().map(function(t){return(t-b[0])/x}).map(p.invert)),y&&y.domain(v.range().map(function(t){return(t-b[1])/x}).map(v.invert))}function a(t){u(),d3.event.preventDefault(),t({type:"zoom",scale:x,translate:b})}function o(){function t(){l=1,i(d3.mouse(u),f),a(o)}function e(){l&&j(),s.on("mousemove.zoom",null).on("mouseup.zoom",null),l&&d3.event.target===c&&s.on("click.zoom",r,!0)}function r(){j(),s.on("click.zoom",null)}var u=this,o=_.of(u,arguments),c=d3.event.target,l=0,s=d3.select(window).on("mousemove.zoom",t).on("mouseup.zoom",e),f=n(d3.mouse(u));window.focus(),j()}function c(){d||(d=n(d3.mouse(this))),r(Math.pow(2,Ve()*.002)*x),i(d3.mouse(this),d),a(_.of(this,arguments))}function l(){d=null}function s(){var t=d3.mouse(this),e=n(t),u=Math.log(x)/Math.LN2;r(Math.pow(2,d3.event.shiftKey?Math.ceil(u)-1:Math.floor(u)+1)),i(t,e),a(_.of(this,arguments))}function f(){var t=d3.touches(this),e=Date.now();if(g=x,d={},t.forEach(function(t){d[t.identifier]=n(t)}),j(),t.length===1){if(500>e-M){var u=t[0],o=n(t[0]);r(x*2),i(u,o),a(_.of(this,arguments))}M=e}}function h(){var t=d3.touches(this),n=t[0],e=d[n.identifier];if(u=t[1]){var u,o=d[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(d3.event.scale*g)}i(n,e),M=null,a(_.of(this,arguments))}var d,g,p,m,v,y,M,b=[0,0],x=1,w=Ya,_=O(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?(w=n==null?Ya:n.map(Number),t):w},t.x=function(n){return arguments.length?(m=n,p=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},d3.rebind(t,_,"on")};var Ra,Ya=[0,1/0];d3.layout={},d3.layout.bundle=function(){return function(t){var n=[],e=-1,r=t.length;while(r>++e)n.push(Xe(t[e]));return n}},d3.layout.chord=function(){function t(){var t,l,f,h,d,g={},p=[],m=d3.range(u),v=[];e=[],r=[],t=0,h=-1;while(u>++h){l=0,d=-1;while(u>++d)l+=i[h][d];p.push(l),v.push(d3.range(u)),t+=l}a&&m.sort(function(t,n){return a(p[t],p[n])}),o&&v.forEach(function(t,n){t.sort(function(t,e){return o(i[n][t],i[n][e])})}),t=(2*Au-s*u)/t,l=0,h=-1;while(u>++h){f=l,d=-1;while(u>++d){var y=m[h],M=v[y][d],b=i[y][M],x=l,w=l+=b*t;g[y+"-"+M]={index:y,subindex:M,startAngle:x,endAngle:w,value:b}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/t},l+=s}h=-1;while(u>++h){d=h-1;while(u>++d){var _=g[h+"-"+d],k=g[d+"-"+h];(_.value||k.value)&&e.push(k.value>_.value?{source:k,target:_}:{source:_,target:k})}}c&&n()}function n(){e.sort(function(t,n){return c((t.source.value+t.target.value)/2,(n.source.value+n.target.value)/2)})}var e,r,i,u,a,o,c,l={},s=0;return l.matrix=function(t){return arguments.length?(u=(i=t)&&i.length,e=r=null,l):i},l.padding=function(t){return arguments.length?(s=t,e=r=null,l):s},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(c=t,e&&n(),l):c},l.chords=function(){return e||t(),e},l.groups=function(){return r||t(),r},l},d3.layout.force=function(){function t(t){return function(n,e,r,i){if(n.point!==t){var u=n.cx-t.x,a=n.cy-t.y,o=1/Math.sqrt(u*u+a*a);if(v>(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=d3.event.x,t.py=d3.event.y,c.resume()}var e,r,i,u,a,c={},s=d3.dispatch("start","tick","end"),f=[1,1],h=.9,d=Qe,g=tr,p=-30,m=.1,v=.8,y=[],M=[];return c.tick=function(){if(.005>(r*=.99))return s.end({type:"end",alpha:r=0}),!0;var n,e,o,c,l,d,g,v,b,x=y.length,w=M.length;for(e=0;w>e;++e)o=M[e],c=o.source,l=o.target,v=l.x-c.x,b=l.y-c.y,(d=v*v+b*b)&&(d=r*u[e]*((d=Math.sqrt(d))-i[e])/d,v*=d,b*=d,l.x-=v*(g=c.weight/(l.weight+c.weight)),l.y-=b*g,c.x+=v*(g=1-g),c.y+=b*g);if((g=r*m)&&(v=f[0]/2,b=f[1]/2,e=-1,g))while(x>++e)o=y[e],o.x+=(v-o.x)*g,o.y+=(b-o.y)*g;if(p){We(n=d3.geom.quadtree(y),r,a),e=-1;while(x>++e)(o=y[e]).fixed||n.visit(t(o))}e=-1;while(x>++e)o=y[e],o.fixed?(o.x=o.px,o.y=o.py):(o.x-=(o.px-(o.px=o.x))*h,o.y-=(o.py-(o.py=o.y))*h);s.tick({type:"tick",alpha:r})},c.nodes=function(t){return arguments.length?(y=t,c):y},c.links=function(t){return arguments.length?(M=t,c):M},c.size=function(t){return arguments.length?(f=t,c):f},c.linkDistance=function(t){return arguments.length?(d=l(t),c):d},c.distance=c.linkDistance,c.linkStrength=function(t){return arguments.length?(g=l(t),c):g},c.friction=function(t){return arguments.length?(h=t,c):h},c.charge=function(t){return arguments.length?(p=typeof t=="function"?t:+t,c):p},c.gravity=function(t){return arguments.length?(m=t,c):m},c.theta=function(t){return arguments.length?(v=t,c):v},c.alpha=function(t){return arguments.length?(r?r=t>0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),d3.timer(c.tick)),c):r},c.start=function(){function t(t,r){var i,u=n(e),a=-1,o=u.length;while(o>++a)if(!isNaN(i=u[a][t]))return i;return Math.random()*r}function n(){if(!o){for(o=[],r=0;s>r;++r)o[r]=[];for(r=0;h>r;++r){var t=M[r];o[t.source.index].push(t.target),o[t.target.index].push(t.source) -}}return o[e]}var e,r,o,l,s=y.length,h=M.length,m=f[0],v=f[1];for(e=0;s>e;++e)(l=y[e]).index=e,l.weight=0;for(i=[],u=[],e=0;h>e;++e)l=M[e],typeof l.source=="number"&&(l.source=y[l.source]),typeof l.target=="number"&&(l.target=y[l.target]),i[e]=d.call(this,l,e),u[e]=g.call(this,l,e),++l.source.weight,++l.target.weight;for(e=0;s>e;++e)l=y[e],isNaN(l.x)&&(l.x=t("x",m)),isNaN(l.y)&&(l.y=t("y",v)),isNaN(l.px)&&(l.px=l.x),isNaN(l.py)&&(l.py=l.y);if(a=[],typeof p=="function")for(e=0;s>e;++e)a[e]=+p.call(this,y[e],e);else for(e=0;s>e;++e)a[e]=p;return c.resume()},c.resume=function(){return c.alpha(.1)},c.stop=function(){return c.alpha(0)},c.drag=function(){e||(e=d3.behavior.drag().origin(o).on("dragstart",Ge).on("drag",n).on("dragend",$e)),this.on("mouseover.force",Je).on("mouseout.force",Ke).call(e)},d3.rebind(c,s,"on")},d3.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;r=n.value?r/n.value:0;while(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)){var i,u=-1;while(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=d3.layout.hierarchy(),i=[1,1];return e.size=function(t){return arguments.length?(i=t,e):i},hr(e,r)},d3.layout.pie=function(){function t(u){var a=u.map(function(e,r){return+n.call(t,e,r)}),o=+(typeof r=="function"?r.apply(this,arguments):r),c=((typeof i=="function"?i.apply(this,arguments):i)-r)/d3.sum(a),l=d3.range(u.length);e!=null&&l.sort(e===Ua?function(t,n){return a[n]-a[t]}:function(t,n){return e(u[t],u[n])});var s=[];return l.forEach(function(t){var n;s[t]={data:u[t],value:n=a[t],startAngle:o,endAngle:o+=n*c}}),s}var n=Number,e=Ua,r=0,i=2*Au;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 Ua={};d3.layout.stack=function(){function t(o,c){var l=o.map(function(e,r){return n.call(t,e,r)}),s=l.map(function(n){return n.map(function(n,e){return[u.call(t,n,e),a.call(t,n,e)]})}),f=e.call(t,s,c);l=d3.permute(l,f),s=d3.permute(s,f);var h,d,g,p=r.call(t,s,c),m=l.length,v=l[0].length;for(d=0;v>d;++d)for(i.call(t,l[0][d],g=p[d],s[0][d][1]),h=1;m>h;++h)i.call(t,l[h][d],g+=s[h-1][d][1],s[h][d][1]);return o}var n=o,e=ir,r=ur,i=rr,u=nr,a=er;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(n){return arguments.length?(e=typeof n=="function"?n:Ia.get(n)||ir,t):e},t.offset=function(n){return arguments.length?(r=typeof n=="function"?n:Va.get(n)||ur,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 Ia=d3.map({"inside-out":function(t){var n,e,r=t.length,i=t.map(ar),u=t.map(or),a=d3.range(r).sort(function(t,n){return i[t]-i[n]}),o=0,c=0,l=[],s=[];for(n=0;r>n;++n)e=a[n],c>o?(o+=u[e],l.push(e)):(c+=u[e],s.push(e));return s.reverse().concat(l)},reverse:function(t){return d3.range(t.length).reverse()},"default":ir}),Va=d3.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,s=t.length,f=t[0],h=f.length,d=[];for(d[0]=c=l=0,e=1;h>e;++e){for(n=0,i=0;s>n;++n)i+=t[n][e][1];for(n=0,u=0,o=f[e][0]-f[e-1][0];s>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]}d[e]=c-=i?u/i*o:0,l>c&&(l=c)}for(e=0;h>e;++e)d[e]-=l;return d},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:ur});d3.layout.histogram=function(){function t(t,u){var a,o,c=[],l=t.map(e,this),s=r.call(this,l,u),f=i.call(this,s,l,u),u=-1,h=l.length,d=f.length-1,g=n?1:1/h;while(d>++u)a=c[u]=[],a.dx=f[u+1]-(a.x=f[u]),a.y=0;if(d>0){u=-1;while(h>++u)o=l[u],o>=s[0]&&s[1]>=o&&(a=c[d3.bisect(f,o,1,d)-1],a.y+=g,a.push(t[u]))}return c}var n=!0,e=Number,r=fr,i=lr;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=l(n),t):r},t.bins=function(n){return arguments.length?(i=typeof n=="number"?function(t){return sr(t,n)}:l(n),t):i},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},d3.layout.hierarchy=function(){function t(n,a,o){var c=i.call(e,n,a),l=Xa?n:{data:n};if(l.depth=a,o.push(l),c&&(s=c.length)){var s,f,h=-1,d=l.children=[],g=0,p=a+1;while(s>++h)f=t(c[h],p,o),f.parent=l,d.push(f),g+=f.value;r&&d.sort(r),u&&(l.value=g)}else u&&(l.value=+u.call(e,n,a)||0);return l}function n(t,r){var i=t.children,a=0;if(i&&(o=i.length)){var o,c=-1,l=r+1;while(o>++c)a+=n(i[c],l)}else u&&(a=+u.call(e,Xa?t:t.data,r)||0);return u&&(t.value=a),a}function e(n){var e=[];return t(n,0,e),e}var r=pr,i=dr,u=gr;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};var Xa=!1;d3.layout.pack=function(){function t(t,i){var u=n.call(this,t,i),a=u[0];a.x=0,a.y=0,jr(a,function(t){t.r=Math.sqrt(t.value)}),jr(a,xr);var o=r[0],c=r[1],l=Math.max(2*a.r/o,2*a.r/c);if(e>0){var s=e*l/2;jr(a,function(t){t.r+=s}),jr(a,xr),jr(a,function(t){t.r-=s}),l=Math.max(2*a.r/o,2*a.r/c)}return kr(a,o/2,c/2,1/l),u}var n=d3.layout.hierarchy().sort(vr),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},hr(t,n)},d3.layout.cluster=function(){function t(t,i){var u,a=n.call(this,t,i),o=a[0],c=0;jr(o,function(t){var n=t.children;n&&n.length?(t.x=Nr(n),t.y=Ar(n)):(t.x=u?c+=e(t,u):0,t.y=0,u=t)});var l=Cr(o),s=Tr(o),f=l.x-e(l,s)/2,h=s.x+e(s,l)/2;return jr(o,function(t){t.x=(t.x-f)/(h-f)*r[0],t.y=(1-(o.y?t.y/o.y:1))*r[1]}),a}var n=d3.layout.hierarchy().sort(null).value(null),e=qr,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},hr(t,n)},d3.layout.tree=function(){function t(t,i){function u(t,n){var r=t.children,i=t._tree;if(r&&(a=r.length)){var a,c,l,s=r[0],f=s,h=-1;while(a>++h)l=r[h],u(l,c),f=o(l,c,f),c=l;Hr(t);var d=.5*(s._tree.prelim+l._tree.prelim);n?(i.prelim=n._tree.prelim+e(t,n),i.mod=i.prelim-d):i.prelim=d}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;n+=t._tree.mod;while(r>++i)a(e[i],n)}}function o(t,n,r){if(n){var i,u=t,a=t,o=n,c=t.parent.children[0],l=u._tree.mod,s=a._tree.mod,f=o._tree.mod,h=c._tree.mod;while(o=zr(o),u=Pr(u),o&&u)c=Pr(c),a=zr(a),a._tree.ancestor=t,i=o._tree.prelim+f-u._tree.prelim-l+e(o,u),i>0&&(Or(Rr(o,t,r),t,i),l+=i,s+=i),f+=o._tree.mod,l+=u._tree.mod,h+=c._tree.mod,s+=a._tree.mod;o&&!zr(a)&&(a._tree.thread=o,a._tree.mod+=f-s),u&&!Pr(c)&&(c._tree.thread=u,c._tree.mod+=l-h,r=t)}return r}var c=n.call(this,t,i),l=c[0];jr(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 s=Er(l,Dr),f=Er(l,Lr),h=Er(l,Fr),d=s.x-e(s,f)/2,g=f.x+e(f,s)/2,p=h.depth||1;return jr(l,function(t){t.x=(t.x-d)/(g-d)*r[0],t.y=t.depth/p*r[1],delete t._tree}),c}var n=d3.layout.hierarchy().sort(null).value(null),e=qr,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},hr(t,n)},d3.layout.treemap=function(){function t(t,n){var e,r,i=-1,u=t.length;while(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=f(e),s=[],h=u.slice(),g=1/0,p=d==="slice"?l.dx:d==="dice"||d==="slice-dice"&&e.depth&1?l.dy:Math.min(l.dx,l.dy);t(h,l.dx*l.dy/e.value),s.area=0;while((c=h.length)>0)s.push(a=h[c-1]),s.area+=a.area,d!=="squarify"||g>=(o=r(s,p))?(h.pop(),g=o):(s.area-=s.pop().area,i(s,p,l,!1),p=Math.min(l.dx,l.dy),s.length=s.area=0,g=1/0);s.length&&(i(s,p,l,!0),s.length=s.area=0),u.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var u,a=f(n),o=r.slice(),c=[];t(o,a.dx*a.dy/n.value),c.area=0;while(u=o.pop())c.push(u),c.area+=u.area,u.z!=null&&(i(c,u.z?a.dx:a.dy,a,!o.length),c.length=c.area=0);r.forEach(e)}}function r(t,n){var e,r=t.area,i=0,u=1/0,a=-1,o=t.length;while(o>++a)(e=t[a].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,n*=n,r?Math.max(n*i*g/r,r/(n*u*g)):1/0}function i(t,n,e,r){var i,u=-1,a=t.length,o=e.x,l=e.y,s=n?c(t.area/n):0;if(n==e.dx){(r||s>e.dy)&&(s=e.dy);while(a>++u)i=t[u],i.x=o,i.y=l,i.dy=s,o+=i.dx=Math.min(e.x+e.dx-o,s?c(i.area/s):0);i.z=!0,i.dx+=e.x+e.dx-o,e.y+=s,e.dy-=s}else{(r||s>e.dx)&&(s=e.dx);while(a>++u)i=t[u],i.x=o,i.y=l,i.dx=s,l+=i.dy=Math.min(e.y+e.dy-l,s?c(i.area/s):0);i.z=!1,i.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}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=d3.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Yr,h=!1,d="squarify",g=.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 e==null?Yr(n):Ur(n,typeof e=="number"?[e,e,e,e]:e)}function e(n){return Ur(n,t)}if(!arguments.length)return s;var r;return f=(s=t)==null?Yr:(r=typeof t)=="function"?n:r==="number"?(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?(g=t,u):g},u.mode=function(t){return arguments.length?(d=t+"",u):d},hr(u,o)},d3.csv=Ir(",","text/csv"),d3.tsv=Ir(" ","text/tab-separated-values"),d3.geo={};var Za={Feature:function(t){var n=this.geometry(t.geometry);return n&&(t=Object.create(t),t.geometry=n,t)},FeatureCollection:function(t){var n,e,r=t.features,i=-1,u=r.length;while(u>++i)(e=this.Feature(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.features=n,t)},GeometryCollection:function(t){var n,e,r=t.geometries,i=-1,u=r.length;while(u>++i)(e=this.geometry(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.geometries=n,t)},LineString:function(t){var n=this.line(t.coordinates);return n&&(t=Object.create(t),t.coordinates=n,t)},MultiLineString:function(t){var n,e,r=t.coordinates,i=-1,u=r.length;while(u>++i)(e=this.line(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.coordinates=n,t)},MultiPoint:function(t){var n,e,r=t.coordinates,i=-1,u=r.length;while(u>++i)(e=this.point(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.coordinates=n,t)},MultiPolygon:function(t){var n,e,r=t.coordinates,i=-1,u=r.length;while(u>++i)(e=this.polygon(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.coordinates=n,t)},Point:function(t){var n=this.point(t.coordinates);return n&&(t=Object.create(t),t.coordinates=n,t)},Polygon:function(t){var n=this.polygon(t.coordinates);return n&&(t=Object.create(t),t.coordinates=n,t)},Sphere:Hn,geometry:function(t){return Ba.hasOwnProperty(t.type)?this[t.type](t):null},point:Hn,line:function(t){var n,e,r=-1,i=t.length;while(i>++r)(e=this.point(t[r]))&&(n?n.push(e):n=[e]);return n},polygon:function(t){var n,e,r=-1,i=t.length;while(i>++r)(e=this.line(t[r]))&&(n?n.push(e):n=[e]);return n}},Ba={LineString:1,MultiLineString:1,MultiPoint:1,MultiPolygon:1,Point:1,Polygon:1,Sphere:1},Ga={Feature:1,FeatureCollection:1,GeometryCollection:1},$a=Qr(o,ai,ci);d3.geo.albersUsa=function(){function t(t){return n(t)(t)}function n(t){var n=t[0],a=t[1];return a>50?r:-140>n?i:21>a?u:e}var e=d3.geo.albers(),r=d3.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),i=d3.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),u=d3.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);return t.point=function(t,e){return n(t).point(t,e)},t.line=function(t,e){return n(t[0]).line(t,e)},t.polygon=function(t,e){return n(t[0][0]).polygon(t,e)},t.scale=function(n){return arguments.length?(e.scale(n),r.scale(n*.6),i.scale(n),u.scale(n*1.5),t.translate(e.translate())):e.scale()},t.translate=function(n){if(!arguments.length)return e.translate();var a=e.scale(),o=n[0],c=n[1];return e.translate(n),r.translate([o-.4*a,c+.17*a]),i.translate([o-.19*a,c+.2*a]),u.translate([o+.58*a,c+.43*a]),t},t.scale(e.scale())},(d3.geo.albers=function(){var t=29.5*qu,n=45.5*qu,e=Ni(li),r=e(t,n);return r.parallels=function(r){return arguments.length?e(t=r[0]*qu,n=r[1]*qu):[t*Pu,n*Pu]},r.rotate([98,0]).center([0,38]).scale(1e3)}).raw=li;var Ja=Ei(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(d3.geo.azimuthalEqualArea=function(){return Ai(Ja)}).raw=Ja;var Ka=Ei(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},o);(d3.geo.azimuthalEquidistant=function(){return Ai(Ka)}).raw=Ka,d3.geo.bounds=si(o),d3.geo.centroid=Wr({FeatureCollection:Hn,GeometryCollection:Hn,Feature:function(t){return this.geometry(t.geometry)},Point:function(t){return t.coordinates},MultiPoint:function(t){var n,e,r,i,u=t.coordinates,a=u.length,o=0,c=0,l=0,s=0;while(a>o)n=u[o++],e=n[0]*qu,i=Math.cos(r=n[1]*qu),c+=(i*Math.cos(e)-c)/o,l+=(i*Math.sin(e)-l)/o,s+=(Math.sin(r)-s)/o;return a?[Math.atan2(l,c)*Pu,Math.asin(Math.max(-1,Math.min(1,s)))*Pu]:null},LineString:function(t){var n,e,r,i=fi(t.coordinates);return i&&i[3]?[Math.atan2(e=i[1],n=i[0])*Pu,Math.asin(Math.max(-1,Math.min(1,(r=i[2])/Math.sqrt(n*n+e*e+r*r))))*Pu]:null},MultiLineString:function(t){var n=t.coordinates,e=n.length,r=-1,i=0,u=0,a=0,o=0;while(e>++r)centroid=fi(n[r]),centroid&&(i+=centroid[0],u+=centroid[1],a+=centroid[2],o+=centroid[3]);return o?[Math.atan2(u,i)*Pu,Math.asin(Math.max(-1,Math.min(1,a/Math.sqrt(i*i+u*u+a*a))))*Pu]:null},Polygon:function(t){return this.MultiLineString(t)},MultiPolygon:function(t){var n,e=t.coordinates,r=e.length,i=-1,u=0,a=0,o=0,c=0;while(r>++i){n=e[i];for(var l=0,s=n.length;s>l;++l)centroid=fi(n[l]),centroid&&(u+=centroid[0],a+=centroid[1],o+=centroid[2],c+=centroid[3])}return c?[Math.atan2(a,u)*Pu,Math.asin(Math.max(-1,Math.min(1,o/Math.sqrt(u*u+a*a+o*o))))*Pu]:null}}),d3.geo.circle=function(){function t(){var t=typeof i=="function"?i.apply(this,arguments):i;e=Ci(-t[0]*qu,-t[1]*qu,0);var n=r(null,null,1).map(function(t){return t=e.invert(t[0],t[1]),t[0]*=Pu,t[1]*=Pu,t});return{type:"Polygon",coordinates:[n]}}var n,e,r,i=[0,0],u=6;return t.origin=function(n){return arguments.length?(i=n,t):i},t.angle=function(e){return arguments.length?(r=di((n=+e)*qu,u*qu),t):n},t.precision=function(e){return arguments.length?(r=di(n*qu,(u=+e)*qu),t):u},t.angle(90)},(d3.geo.equirectangular=function(){return Ai(mi).scale(250/Au)}).raw=mi.invert=mi;var Wa=Ei(function(t){return 1/t},Math.atan);(d3.geo.gnomonic=function(){return Ai(Wa)}).raw=Wa,d3.geo.graticule=function(){function t(){return{type:"GeometryCollection",geometries:t.lines()}}var n,e,r,i,u,a,o=22.5,c=o,l=2.5;return t.lines=function(){return d3.range(Math.ceil(e/o)*o,n,o).map(u).concat(d3.range(Math.ceil(i/c)*c,r,c).map(a)).map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[u(e).concat(a(r).slice(1),u(n).reverse().slice(1),a(i).reverse().slice(1))]}},t.extent=function(u){return arguments.length?(e=+u[0][0],n=+u[1][0],i=+u[0][1],r=+u[1][1],e>n&&(u=e,e=n,n=u),i>r&&(u=i,i=r,r=u),t.precision(l)):[[e,i],[n,r]]},t.step=function(n){return arguments.length?(o=+n[0],c=+n[1],t):[o,c]},t.precision=function(o){return arguments.length?(l=+o,u=vi(i,r,l),a=yi(e,n,l),t):l},t.extent([[-180+Nu,-90+Nu],[180-Nu,90-Nu]])},d3.geo.interpolate=function(t,n){return Mi(t[0]*qu,t[1]*qu,n[0]*qu,n[1]*qu)},d3.geo.greatArc=function(){function t(){var t=r||a.apply(this,arguments),n=i||o.apply(this,arguments),e=u||d3.geo.interpolate(t,n),i=0,l=c/e.distance,s=[t];while(1>(i+=l))s.push(e(i));return s.push(n),{type:"LineString",coordinates:s}}var r,i,u,a=e,o=n,c=6*qu;return t.distance=function(){return(u||d3.geo.interpolate(r||a.apply(this,arguments),i||o.apply(this,arguments))).distance},t.source=function(n){return arguments.length?(a=n,r=typeof n=="function"?null:n,u=r&&i?d3.geo.interpolate(r,i):null,t):a},t.target=function(n){return arguments.length?(o=n,i=typeof n=="function"?null:n,u=r&&i?d3.geo.interpolate(r,i):null,t):o},t.precision=function(n){return arguments.length?(c=n*qu,t):c/qu},t},bi.invert=function(t,n){return[2*Au*t,2*Math.atan(Math.exp(2*Au*n))-Au/2]},(d3.geo.mercator=function(){return Ai(bi).scale(500)}).raw=bi;var Qa=Ei(function(){return 1},Math.asin);(d3.geo.orthographic=function(){return Ai(Qa)}).raw=Qa,d3.geo.path=function(){function n(t){var n=null;return t!=n&&(typeof l=="function"&&(s=xi(l.apply(this,arguments))),t=f.object(t),t&&(c?d:g)(t),h.length&&(n=h.join(""),h=[])),n}function e(t){return t=f.object(t),t?t.type==="Polygon"?r(t.coordinates):d3.sum(t.coordinates,r):0}function r(t){return Math.abs(d3.sum(t,i))}function i(t){return d3.geom.polygon(t).area()}function u(t){var n,e,r,i=t.length,u=0,a=t[0],o=a[0],c=a[1],l=0,s=0,f=0;while(i>++u)a=t[u],n=a[0],e=a[1],r=c*n-o*e,l+=r*3,s+=r*(o+n),f+=r*(c+e),o=n,c=e;return[s,f,l]}function a(t){return function(n){var e,r=n.coordinates,i=0,u=0,a=0,o=-1,c=r.length;while(c>++o)e=t(r[o]),i+=e[0],u+=e[1],a+=e[2];return a?[i/a,u/a]:null}}var o,c,l=4.5,s=xi(l),f=d3.geo.albersUsa(),h=[],d=Wr({point:function(t){c.point(t[0],t[1])},line:function(t){if(n=t.length){var n,e=0,r=t[0];c.moveTo(r[0],r[1]);while(n>++e)c.lineTo((r=t[e])[0],r[1])}},polygon:function(t){var n,e,r,i,u=t.length,a=-1;while(u>++a)if(r=t[a],n=r.length-1){for(i=r[0],c.moveTo(i[0],i[1]),e=0;n>++e;)c.lineTo((i=r[e])[0],i[1]);c.closePath()}}}),g=Wr({point:function(t){h.push("M",t,s)},line:function(t){h.push("M",t.join("L"))},polygon:function(t){var n=-1,e=t.length;while(e>++n)this.line(t[n]),h.push("Z")}});n.area=Wr({Feature:function(t){return areaType.geometry(t.geometry)},FeatureCollection:function(t){return d3.sum(t.features,areaType.Feature)},GeometryCollection:function(t){return d3.sum(t.geometries,areaType.geometry)},LineString:t,MultiLineString:t,MultiPoint:t,MultiPolygon:e,Point:t,Polygon:e,Sphere:e}),n.bounds=function(t){return(o||(o=si(f)))(t)},n.centroid=function(t){return(t=f.object(t))?p(t):null};var p=Wr({FeatureCollection:Hn,GeometryCollection:Hn,MultiLineString:a(function(t){var n,e,r,i,u,a=t.length,o=0,c=t[0],l=c[0],s=c[1],f=0,h=0,d=0;while(a>++o)c=t[o],n=c[0],e=c[1],r=n-l,i=e-s,f+=u=Math.sqrt(r*r+i*i),h+=u*(l+n)/2,d+=u*(s+e)/2,l=n,s=e;return[h,d,f]}),Point:function(t){return t.coordinates},MultiPoint:a(function(t){return[t[0],t[1],1]}),Polygon:a(u),MultiPolygon:a(function(t){for(var n,e=0,r=0,i=0,a=0,o=t.length;o>a;++a)n=u(t[a]),e+=n[0],r+=n[1],i+=n[2];return[e,r,i]})});return n.bounds=function(t){return(o||(o=si(f)))(t)},n.projection=function(t){return arguments.length?(f=t,o=null,n):f},n.context=function(t){return arguments.length?(c=t,n):c},n.pointRadius=function(t){return arguments.length?(typeof t=="function"?l=t:s=xi(l=+t),n):l},n},d3.geo.area=Wr({Point:t,MultiPoint:t,LineString:t,MultiLineString:t,Polygon:function(t){return wi(t.coordinates)},MultiPolygon:function(t){return d3.sum(t.coordinates,wi)},Sphere:function(){return 4*Au},Feature:function(t){return this.geometry(t.geometry)},FeatureCollection:function(t){var n=this;return d3.sum(t.features,function(t){return n.Feature(t)})},GeometryCollection:function(t){var n=this;return d3.sum(t.geometries,function(t){return n.geometry(t)})}}),d3.geo.projection=Ai,d3.geo.projectionMutator=Ni,d3.geo.rotation=function(t,n,e){var r=Ci(t*qu,n*qu,e*qu);return Wr({point:function(t){return t=r(t[0]*qu,t[1]*qu),t[0]*=Pu,t[1]*=Pu,t}})},Ti.invert=function(t,n){return[t,n]};var to=Ei(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(d3.geo.stereographic=function(){return Ai(to)}).raw=to,d3.geom={},d3.geom.hull=function(t){if(3>t.length)return[];var n,e,r,i,u,a,o,c,l,s,f=t.length,h=f-1,d=[],g=[],p=0;for(n=1;f>n;++n)t[p][1]>t[n][1]?p=n:t[n][1]==t[p][1]&&(p=t[p][0]>t[n][0]?n:p);for(n=0;f>n;++n)n!==p&&(i=t[n][1]-t[p][1],r=t[n][0]-t[p][0],d.push({angle:Math.atan2(i,r),index:n}));for(d.sort(function(t,n){return t.angle-n.angle}),l=d[0].angle,c=d[0].index,o=0,n=1;h>n;++n)e=d[n].index,l==d[n].angle?(r=t[c][0]-t[p][0],i=t[c][1]-t[p][1],u=t[e][0]-t[p][0],a=t[e][1]-t[p][1],r*r+i*i>=u*u+a*a?d[n].index=-1:(d[o].index=-1,l=d[n].angle,o=n,c=e)):(l=d[n].angle,o=n,c=e);for(g.push(p),n=0,e=0;2>n;++e)d[e].index!==-1&&(g.push(d[e].index),n++);for(s=g.length;h>e;++e)if(d[e].index!==-1){while(!Li(g[s-2],g[s-1],d[e].index,t))--s;g[s++]=d[e].index}var m=[];for(n=0;s>n;++n)m.push(t[g[n]]);return m},d3.geom.polygon=function(t){return t.area=function(){var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];while(e>++n)r+=t[n-1][1]*t[n][0]-t[n-1][0]*t[n][1];return r*.5},t.centroid=function(n){var e,r,i=-1,u=t.length,a=0,o=0,c=t[u-1];arguments.length||(n=-1/(6*t.area()));while(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){var e,r,i,u,a,o,c=-1,l=t.length,s=t[l-1];while(l>++c){e=n.slice(),n.length=0,u=t[c],a=e[(i=e.length)-1],r=-1;while(i>++r)o=e[r],Di(o,s,u)?(Di(a,s,u)||n.push(Fi(a,o,s,u)),n.push(o)):Di(a,s,u)&&n.push(Fi(a,o,s,u)),a=o;s=u}return n},t},d3.geom.voronoi=function(t){var n=t.map(function(){return[]}),e=1e6;return ji(t,function(t){var r,i,u,a,o,c;t.a===1&&t.b>=0?(r=t.ep.r,i=t.ep.l):(r=t.ep.l,i=t.ep.r),t.a===1?(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],s=[a,c];n[t.region.l.index].push(l,s),n[t.region.r.index].push(l,s)}),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)});return d3.range(n.length).sort(function(t,n){return u[t]-u[n]}).filter(function(t,n,e){return!n||u[t]-u[e[n-1]]>Nu}).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],s=a[0],f=a[1],h=o[0],d=o[1],g=Math.abs(h-s),p=d-f;if(Nu>Math.abs(p)){var m=f>l?-e:e;n.push([-e,m],[e,m])}else if(Nu>g){var v=s>c?-e:e;n.push([v,-e],[v,e])}else{var m=(s-c)*(d-f)>(h-s)*(f-l)?e:-e,y=Math.abs(p)-g;Nu>Math.abs(y)?n.push([0>p?m:-m,m]):(y>0&&(m*=-1),n.push([-e,m],[e,m]))}}}),n};var no={l:"r",r:"l"};d3.geom.delaunay=function(t){var n=t.map(function(){return[]}),e=[];return ji(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},d3.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=(e+i)*.5,c=(r+a)*.5,l=n.x>=o,s=n.y>=c,f=(s<<1)+l;t.leaf=!1,t=t.nodes[f]||(t.nodes[f]=Hi()),l?e=o:i=o,s?r=c:a=c,u(t,n,e,r,i,a)}var o,c=-1,l=t.length;if(5>arguments.length)if(arguments.length===3)i=e,r=n,e=n=0;else{n=e=1/0,r=i=-1/0;while(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 s=r-n,f=i-e;s>f?i=e+s:r=n+f;var h=Hi();return h.add=function(t){u(h,t,n,e,r,i)},h.visit=function(t){Oi(t,h,n,e,r,i)},t.forEach(h.add),h},d3.time={};var eo=Date,ro=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Ri.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(){io.setUTCDate.apply(this._,arguments)},setDay:function(){io.setUTCDay.apply(this._,arguments)},setFullYear:function(){io.setUTCFullYear.apply(this._,arguments)},setHours:function(){io.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){io.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){io.setUTCMinutes.apply(this._,arguments)},setMonth:function(){io.setUTCMonth.apply(this._,arguments)},setSeconds:function(){io.setUTCSeconds.apply(this._,arguments)},setTime:function(){io.setTime.apply(this._,arguments)}};var io=Date.prototype,uo="%a %b %e %X %Y",ao="%m/%d/%Y",oo="%H:%M:%S",co=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],lo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],so=["January","February","March","April","May","June","July","August","September","October","November","December"],fo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];d3.time.format=function(t){function n(n){var r,i,u,a=[],o=-1,c=0;while(e>++o)t.charCodeAt(o)===37&&(a.push(t.substring(c,o)),(i=Mo[r=t.charAt(++o)])!=null&&(r=t.charAt(++o)),(u=bo[r])&&(r=u(n,i==null?r==="e"?" ":"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=Yi(e,t,n,0);if(r!=n.length)return null;"p"in e&&(e.H=e.H%12+e.p*12);var i=new eo;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 ho=Ui(co),go=Ui(lo),po=Ui(so),mo=Ii(so),vo=Ui(fo),yo=Ii(fo),Mo={"-":"",_:" ",0:"0"},bo={a:function(t){return lo[t.getDay()]},A:function(t){return co[t.getDay()]},b:function(t){return fo[t.getMonth()]},B:function(t){return so[t.getMonth()]},c:d3.time.format(uo),d:function(t,n){return Vi(t.getDate(),n,2)},e:function(t,n){return Vi(t.getDate(),n,2)},H:function(t,n){return Vi(t.getHours(),n,2)},I:function(t,n){return Vi(t.getHours()%12||12,n,2)},j:function(t,n){return Vi(1+d3.time.dayOfYear(t),n,3)},L:function(t,n){return Vi(t.getMilliseconds(),n,3)},m:function(t,n){return Vi(t.getMonth()+1,n,2)},M:function(t,n){return Vi(t.getMinutes(),n,2)},p:function(t){return t.getHours()>=12?"PM":"AM"},S:function(t,n){return Vi(t.getSeconds(),n,2)},U:function(t,n){return Vi(d3.time.sundayOfYear(t),n,2)},w:function(t){return t.getDay()},W:function(t,n){return Vi(d3.time.mondayOfYear(t),n,2)},x:d3.time.format(ao),X:d3.time.format(oo),y:function(t,n){return Vi(t.getFullYear()%100,n,2)},Y:function(t,n){return Vi(t.getFullYear()%1e4,n,4)},Z:cu,"%":function(){return"%"}},xo={a:Xi,A:Zi,b:Bi,B:Gi,c:$i,d:eu,e:eu,H:ru,I:ru,L:au,m:nu,M:iu,p:ou,S:uu,x:Ji,X:Ki,y:Qi,Y:Wi},wo=/^\s*\d+/,_o=d3.map({am:0,pm:1});d3.time.format.utc=function(t){function n(t){try{eo=Ri;var n=new eo;return n._=t,e(n)}finally{eo=Date}}var e=d3.time.format(t);return n.parse=function(t){try{eo=Ri;var n=e.parse(t);return n&&n._}finally{eo=Date}},n.toString=e.toString,n};var ko=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?lu:ko,lu.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},lu.toString=ko.toString,d3.time.second=su(function(t){return new eo(Math.floor(t/1e3)*1e3)},function(t,n){t.setTime(t.getTime()+Math.floor(n)*1e3)},function(t){return t.getSeconds()}),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=su(function(t){return new eo(Math.floor(t/6e4)*6e4)},function(t,n){t.setTime(t.getTime()+Math.floor(n)*6e4)},function(t){return t.getMinutes()}),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=su(function(t){var n=t.getTimezoneOffset()/60;return new eo((Math.floor(t/36e5-n)+n)*36e5)},function(t,n){t.setTime(t.getTime()+Math.floor(n)*36e5)},function(t){return t.getHours()}),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=su(function(t){var n=new eo(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}),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(t){var n=d3.time.year(t);return Math.floor((t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*6e4)/864e5)},ro.forEach(function(t,n){t=t.toLowerCase(),n=7-n;var e=d3.time[t]=su(function(t){return(t=d3.time.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+Math.floor(n)*7)},function(t){var e=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});d3.time[t+"s"]=e.range,d3.time[t+"s"].utc=e.utc.range,d3.time[t+"OfYear"]=function(t){var e=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(e+n)%7)/7)}}),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=su(function(t){return t=d3.time.day(t),t.setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=su(function(t){return t=d3.time.day(t),t.setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var So=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ao=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],No=[[d3.time.format("%Y"),c],[d3.time.format("%B"),function(t){return t.getMonth()}],[d3.time.format("%b %d"),function(t){return t.getDate()!=1}],[d3.time.format("%a %d"),function(t){return t.getDay()&&t.getDate()!=1}],[d3.time.format("%I %p"),function(t){return t.getHours()}],[d3.time.format("%I:%M"),function(t){return t.getMinutes()}],[d3.time.format(":%S"),function(t){return t.getSeconds()}],[d3.time.format(".%L"),function(t){return t.getMilliseconds()}]],Co=d3.scale.linear(),To=pu(No);Ao.year=function(t,n){return Co.domain(t.map(vu)).ticks(n).map(mu)},d3.time.scale=function(){return hu(d3.scale.linear(),Ao,To)};var qo=Ao.map(function(t){return[t[0].utc,t[1]]}),Po=[[d3.time.format.utc("%Y"),c],[d3.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(t){return t.getUTCDate()!=1}],[d3.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&t.getUTCDate()!=1}],[d3.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]],zo=pu(Po);qo.year=function(t,n){return Co.domain(t.map(Mu)).ticks(n).map(yu)},d3.time.scale.utc=function(){return hu(d3.scale.linear(),qo,zo)}})() \ No newline at end of file +(function(){function t(){return 0}function n(t){return t.target}function e(t){return t.source}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){var n=-1,e=t.length,r=[];while(e>++n)r.push(t[n]);return r}function u(t){return Array.prototype.slice.call(t)}function a(){}function o(t){return t}function c(){return!0}function l(t){return typeof t=="function"?t:function(){return t}}function s(t,n,e){return function(){var r=e.apply(n,arguments);return arguments.length?t:r}}function f(t){return t!=null&&!isNaN(t)}function h(t){return t.length}function d(t){return t.trim().replace(/\s+/g," ")}function g(t){var n=1;while(t*n%1)n*=10;return n}function p(t){return t.responseText}function m(t){return JSON.parse(t.responseText)}function v(t){var n=document.createRange();return n.selectNode(document.body),n.createContextualFragment(t.responseText)}function y(t){return t.responseXML}function M(){}function b(t){function n(){var n,r=e,i=-1,u=r.length;while(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 x(t,n){return n-(t?1+Math.floor(Math.log(t+Math.pow(10,1+Math.floor(Math.log(t)/Math.LN10)-n))/Math.LN10):1)}function w(t){return t+""}function _(t,n){var e=Math.pow(10,Math.abs(8-n)*3);return{scale:n>8?function(t){return t/e}:function(t){return t*e},symbol:t}}function k(t){return function(n){return 0>=n?0:n>=1?1:t(n)}}function S(t){return function(n){return 1-t(1-n)}}function A(t){return function(n){return.5*(.5>n?t(2*n):2-t(2-2*n))}}function N(t){return t*t}function C(t){return t*t*t}function T(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 q(t){return function(n){return Math.pow(n,t)}}function P(t){return 1-Math.cos(t*Nu/2)}function z(t){return Math.pow(2,10*(t-1))}function E(t){return 1-Math.sqrt(1-t*t)}function L(t,n){var e;return 2>arguments.length&&(n=.45),arguments.length?e=n/(2*Nu)*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,10*-r)*Math.sin((r-e)*2*Nu/n)}}function D(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function F(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 j(){d3.event.stopPropagation(),d3.event.preventDefault()}function H(){var t,n=d3.event;while(t=n.sourceEvent)n=t;return n}function O(t){var n=new M,e=0,r=arguments.length;while(r>++e)n[arguments[e]]=b(n);return n.of=function(e,r){return function(i){try{var u=i.sourceEvent=d3.event;i.target=t,d3.event=i,n[i.type].apply(e,r)}finally{d3.event=u}}},n}function R(t){var n=[t.a,t.b],e=[t.c,t.d],r=U(n),i=Y(n,e),u=U(I(e,n,-i))||0;e[0]*n[1]>n[0]*e[1]&&(n[0]*=-1,n[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(n[1],n[0]):Math.atan2(-e[0],e[1]))*zu,this.translate=[t.e,t.f],this.scale=[r,u],this.skew=u?Math.atan2(i,u)*zu:0}function Y(t,n){return t[0]*n[0]+t[1]*n[1]}function U(t){var n=Math.sqrt(Y(t,t));return n&&(t[0]/=n,t[1]/=n),n}function I(t,n,e){return t[0]+=e*n[0],t[1]+=e*n[1],t}function V(t){return t=="transform"?d3.interpolateTransform:d3.interpolate}function X(t,n){return n=n-(t=+t)?1/(n-t):0,function(e){return(e-t)*n}}function Z(t,n){return n=n-(t=+t)?1/(n-t):0,function(e){return Math.max(0,Math.min(1,(e-t)*n))}}function B(){}function G(t,n,e){return new $(t,n,e)}function $(t,n,e){this.r=t,this.g=n,this.b=e}function J(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function K(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(nn(i[0]),nn(i[1]),nn(i[2]))}return(u=Wu.get(t))?n(u.r,u.g,u.b):(t!=null&&t.charAt(0)==="#"&&(t.length===4?(a=t.charAt(1),a+=a,o=t.charAt(2),o+=o,c=t.charAt(3),c+=c):t.length===7&&(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 W(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,en(r,i,c)}function Q(t,n,e){t=tn(t),n=tn(n),e=tn(e);var r=gn((.4124564*t+.3575761*n+.1804375*e)/ea),i=gn((.2126729*t+.7151522*n+.072175*e)/ra),u=gn((.0193339*t+.119192*n+.9503041*e)/ia);return ln(116*i-16,500*(r-i),200*(i-u))}function tn(t){return.04045>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}function nn(t){var n=parseFloat(t);return t.charAt(t.length-1)==="%"?Math.round(n*2.55):n}function en(t,n,e){return new rn(t,n,e)}function rn(t,n,e){this.h=t,this.s=n,this.l=e}function un(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(r(t)*255)}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,G(i(t+120),i(t),i(t-120))}function an(t,n,e){return new on(t,n,e)}function on(t,n,e){this.h=t,this.c=n,this.l=e}function cn(t,n,e){return ln(e,Math.cos(t*=Pu)*n,Math.sin(t)*n)}function ln(t,n,e){return new sn(t,n,e)}function sn(t,n,e){this.l=t,this.a=n,this.b=e}function fn(t,n,e){var r=(t+16)/116,i=r+n/500,u=r-e/200;return i=dn(i)*ea,r=dn(r)*ra,u=dn(u)*ia,G(pn(3.2404542*i-1.5371385*r-.4985314*u),pn(-.969266*i+1.8760108*r+.041556*u),pn(.0556434*i-.2040259*r+1.0572252*u))}function hn(t,n,e){return an(Math.atan2(e,n)/Nu*180,Math.sqrt(n*n+e*e),t)}function dn(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gn(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function pn(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function mn(t){return Du(t,fa),t}function vn(t){return function(){return aa(t,this)}}function yn(t){return function(){return oa(t,this)}}function Mn(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);e==null?this.removeAttribute(t):this.setAttribute(t,e)}function o(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}return t=d3.ns.qualify(t),n==null?t.local?r:e:typeof n=="function"?t.local?o:a:t.local?u:i}function bn(t){return RegExp("(?:^|\\s+)"+d3.requote(t)+"(?:\\s+|$)","g")}function xn(t,n){function e(){var e=-1;while(i>++e)t[e](this,n)}function r(){var e=-1,r=n.apply(this,arguments);while(i>++e)t[e](this,r)}t=t.trim().split(/\s+/).map(wn);var i=t.length;return typeof n=="function"?r:e}function wn(t){var n=bn(t);return function(e,r){if(i=e.classList)return r?i.add(t):i.remove(t);var i=e.className,u=i.baseVal!=null,a=u?i.baseVal:i;r?(n.lastIndex=0,n.test(a)||(a=d(a+" "+t),u?i.baseVal=a:e.className=a)):a&&(a=d(a.replace(n," ")),u?i.baseVal=a:e.className=a)}}function _n(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);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}return n==null?r:typeof n=="function"?u:i}function kn(t,n){function e(){delete this[t]}function r(){this[t]=n}function i(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}return n==null?e:typeof n=="function"?i:r}function Sn(t){return{__data__:t}}function An(t){return function(){return sa(this,t)}}function Nn(t){return arguments.length||(t=d3.ascending),function(n,e){return t(n&&n.__data__,e&&e.__data__)}}function Cn(t,n,e){function r(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}function i(){function i(t){var e=d3.event;d3.event=t,o[0]=a.__data__;try{n.apply(a,o)}finally{d3.event=e}}var a=this,o=Eu(arguments);r.call(this),this.addEventListener(t,this[u]=i,i.$=e),i._=n}var u="__on"+t,a=t.indexOf(".");return a>0&&(t=t.substring(0,a)),n?i:r}function Tn(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 qn(t){return Du(t,da),t}function Pn(t,n){return Du(t,pa),t.id=n,t}function zn(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:d3.dispatch("start","end"),time:o,ease:r.ease,delay:r.delay,duration:r.duration},++i.count,d3.timer(function(r){function a(r){return i.active>e?l():(i.active=e,h.start.call(t,s,n),u.tween.forEach(function(e,r){(r=r.call(t,s,n))&&p.push(r)}),c(r)||d3.timer(c,0,o),1)}function c(r){if(i.active!==e)return l();var u=(r-d)/g,a=f(u),o=p.length;while(o>0)p[--o].call(t,a);return u>=1?(l(),h.end.call(t,s,n),1):void 0}function l(){return--i.count?delete i[e]:delete t.__transition__,1}var s=t.__data__,f=u.ease,h=u.event,d=u.delay,g=u.duration,p=[];return r>=d?a(r):d3.timer(a,d,o),1},0,o),u}}function En(t){return t==null&&(t=""),function(){this.textContent=t}}function Ln(t,n,e,r){var i=t.id;return Tn(t,typeof e=="function"?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 Dn(){var t,n=Date.now(),e=wa;while(e)t=n-e.then,t>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=Fn()-n;r>24?(isFinite(r)&&(clearTimeout(Ma),Ma=setTimeout(Dn,r)),ya=0):(ya=1,_a(Dn))}function Fn(){var t=null,n=wa,e=1/0;while(n)n.flush?(delete xa[n.callback.id],n=t?t.next=n.next:wa=n.next):(e=Math.min(e,n.then+n.delay),n=(t=n).next);return e}function jn(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>ka&&(window.scrollX||window.scrollY)){e=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=e[0][0].getScreenCTM();ka=!(i.f||i.e),e.remove()}return ka?(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 Hn(){}function On(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function Rn(t){return t.rangeExtent?t.rangeExtent():On(t.range())}function Yn(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 Un(){return Math}function In(t,n,e,r){function i(){var i=Math.min(t.length,n.length)>2?Jn:$n,c=r?Z:X;return a=i(t,n,c,e),o=i(n,t,c,d3.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(d3.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 Bn(t,n)},u.tickFormat=function(n){return Gn(t,n)},u.nice=function(){return Yn(t,Xn),i()},u.copy=function(){return In(t,n,e,r)},i()}function Vn(t,n){return d3.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Xn(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 Zn(t,n){var e=On(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+i*.5,e[2]=i,e}function Bn(t,n){return d3.range.apply(d3,Zn(t,n))}function Gn(t,n){return d3.format(",."+Math.max(0,-Math.floor(Math.log(Zn(t,n)[2])/Math.LN10+.01))+"f")}function $n(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 Jn(t,n,e,r){var i=[],u=[],a=0,o=Math.min(t.length,n.length)-1;t[0]>t[o]&&(t=t.slice().reverse(),n=n.slice().reverse());while(o>=++a)i.push(e(t[a-1],t[a])),u.push(r(n[a-1],n[a]));return function(n){var e=d3.bisect(t,n,1,o)-1;return u[e](i[e](n))}}function Kn(t,n){function e(e){return t(n(e))}var r=n.pow;return e.invert=function(n){return r(t.invert(n))},e.domain=function(i){return arguments.length?(n=0>i[0]?Qn:Wn,r=n.pow,t.domain(i.map(n)),e):t.domain().map(r)},e.nice=function(){return t.domain(Yn(t.domain(),Un)),e},e.ticks=function(){var e=On(t.domain()),i=[];if(e.every(isFinite)){var u=Math.floor(e[0]),a=Math.ceil(e[1]),o=r(e[0]),c=r(e[1]);if(n===Qn)for(i.push(r(u));a>u++;)for(var l=9;l>0;l--)i.push(r(u)*l);else{for(;a>u;u++)for(var l=1;10>l;l++)i.push(r(u)*l);i.push(r(u))}for(u=0;o>i[u];u++);for(a=i.length;i[a-1]>c;a--);i=i.slice(u,a)}return i},e.tickFormat=function(t,i){if(2>arguments.length&&(i=Sa),!arguments.length)return i;var u,a=Math.max(.1,t/e.ticks().length),o=n===Qn?(u=-1e-12,Math.floor):(u=1e-12,Math.ceil);return function(t){return a>=t/r(o(n(t)+u))?i(t):""}},e.copy=function(){return Kn(t.copy(),n)},Vn(e,t)}function Wn(t){return Math.log(0>t?0:t)/Math.LN10}function Qn(t){return-Math.log(t>0?0:-t)/Math.LN10}function te(t,n){function e(n){return t(r(n))}var r=ne(n),i=ne(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 Bn(e.domain(),t)},e.tickFormat=function(t){return Gn(e.domain(),t)},e.nice=function(){return e.domain(Yn(e.domain(),Xn))},e.exponent=function(t){if(!arguments.length)return n;var u=e.domain();return r=ne(n=t),i=ne(1/n),e.domain(u)},e.copy=function(){return te(t.copy(),n)},Vn(e,t)}function ne(t){return function(n){return 0>n?-Math.pow(-n,t):Math.pow(n,t)}}function ee(t,n){function e(n){return u[((i.get(n)||i.set(n,t.push(n)))-1)%u.length]}function r(n,e){return d3.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;var u,o=-1,c=r.length;while(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],s=(l-c)/(Math.max(1,t.length-1)+a);return u=r(2>t.length?(c+l)/2:c+s*a/2,s),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[0]>i[1],s=i[l-0],f=i[1-l],h=(f-s)/(t.length-a+2*c);return u=r(s+h*c,h),l&&u.reverse(),o=h*(1-a),n={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,a,c){2>arguments.length&&(a=0),3>arguments.length&&(c=a);var l=i[0]>i[1],s=i[l-0],f=i[1-l],h=Math.floor((f-s)/(t.length-a+2*c)),d=f-s-(t.length-a)*h;return u=r(s+Math.round(d/2),h),l&&u.reverse(),o=Math.round(h*(1-a)),n={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return On(n.a[0])},e.copy=function(){return ee(t,n)},e.domain(t)}function re(t,n){function e(){var e=0,u=n.length;i=[];while(u>++e)i[e-1]=d3.quantile(t,e/u);return r}function r(t){return isNaN(t=+t)?0/0:n[d3.bisect(i,t)]}var i;return r.domain=function(n){return arguments.length?(t=n.filter(function(t){return!isNaN(t)}).sort(d3.ascending),e()):t},r.range=function(t){return arguments.length?(n=t,e()):n},r.quantiles=function(){return i},r.copy=function(){return re(t,n)},e()}function ie(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 ie(t,n,e)},i()}function ue(t,n){function e(e){return n[d3.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 ue(t,n)},e}function ae(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 Bn(t,n)},n.tickFormat=function(n){return Gn(t,n)},n.copy=function(){return ae(t)},n}function oe(t){return t.innerRadius}function ce(t){return t.outerRadius}function le(t){return t.startAngle}function se(t){return t.endAngle}function fe(t){function n(n){function a(){s.push("M",u(t(f),o))}var c,s=[],f=[],h=-1,d=n.length,g=l(e),p=l(r);while(d>++h)i.call(this,c=n[h],h)?f.push([+g.call(this,c,h),+p.call(this,c,h)]):f.length&&(a(),f=[]);return f.length&&a(),s.length?s.join(""):null}var e=he,r=de,i=c,u=ge,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=typeof t=="function"?u=t:(u=za.get(t)||ge).key,n):a},n.tension=function(t){return arguments.length?(o=t,n):o},n}function he(t){return t[0]}function de(t){return t[1]}function ge(t){return t.join("L")}function pe(t){return ge(t)+"Z"}function me(t){var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];while(e>++n)i.push("V",(r=t[n])[1],"H",r[0]);return i.join("")}function ve(t){var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];while(e>++n)i.push("H",(r=t[n])[0],"V",r[1]);return i.join("")}function ye(t,n){return 4>t.length?ge(t):t[1]+xe(t.slice(1,t.length-1),we(t,n))}function Me(t,n){return 3>t.length?ge(t):t[0]+xe((t.push(t[0]),t),we([t[t.length-2]].concat(t,[t[1]]),n))}function be(t,n){return 3>t.length?ge(t):t[0]+xe(t,we(t,n))}function xe(t,n){if(1>n.length||t.length!=n.length&&t.length!=n.length+2)return ge(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]-a[0]*2/3)+","+(u[1]-a[1]*2/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 s=t[c];r+="Q"+(u[0]+o[0]*2/3)+","+(u[1]+o[1]*2/3)+","+s[0]+","+s[1]}return r}function we(t,n){var e,r=[],i=(1-n)/2,u=t[0],a=t[1],o=1,c=t.length;while(c>++o)e=u,u=a,a=t[o],r.push([i*(a[0]-e[0]),i*(a[1]-e[1])]);return r}function _e(t){if(3>t.length)return ge(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];Ce(c,a,o);while(e>++n)r=t[n],a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Ce(c,a,o);n=-1;while(2>++n)a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Ce(c,a,o);return c.join("")}function ke(t){if(4>t.length)return ge(t);var n,e=[],r=-1,i=t.length,u=[0],a=[0];while(3>++r)n=t[r],u.push(n[0]),a.push(n[1]);e.push(Ne(Da,u)+","+Ne(Da,a)),--r;while(i>++r)n=t[r],u.shift(),u.push(n[0]),a.shift(),a.push(n[1]),Ce(e,u,a);return e.join("")}function Se(t){var n,e,r=-1,i=t.length,u=i+4,a=[],o=[];while(4>++r)e=t[r%i],a.push(e[0]),o.push(e[1]);n=[Ne(Da,a),",",Ne(Da,o)],--r;while(u>++r)e=t[r%i],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Ce(n,a,o);return n.join("")}function Ae(t,n){var e=t.length-1;if(e){var r,i,u=t[0][0],a=t[0][1],o=t[e][0]-u,c=t[e][1]-a,l=-1;while(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 _e(t)}function Ne(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function Ce(t,n,e){t.push("C",Ne(Ea,n),",",Ne(Ea,e),",",Ne(La,n),",",Ne(La,e),",",Ne(Da,n),",",Ne(Da,e))}function Te(t,n){return(n[1]-t[1])/(n[0]-t[0])}function qe(t){var n=0,e=t.length-1,r=[],i=t[0],u=t[1],a=r[0]=Te(i,u);while(e>++n)r[n]=(a+(a=Te(i=u,u=t[n+1])))/2;return r[n]=a,r}function Pe(t){var n,e,r,i,u=[],a=qe(t),o=-1,c=t.length-1;while(c>++o)n=Te(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=n*3/Math.sqrt(i),a[o]=i*e,a[o+1]=i*r));o=-1;while(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 ze(t){return 3>t.length?ge(t):t[0]+xe(t,Pe(t))}function Ee(t){var n,e,r,i=-1,u=t.length;while(u>++i)n=t[i],e=n[0],r=n[1]+qa,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function Le(t){function n(n){function c(){m.push("M",o(t(y),d),h,f(t(v.reverse()),d),"Z")}var s,g,p,m=[],v=[],y=[],M=-1,b=n.length,x=l(e),w=l(i),_=e===r?function(){return g}:l(r),k=i===u?function(){return p}:l(u);while(b>++M)a.call(this,s=n[M],M)?(v.push([g=+x.call(this,s,M),p=+w.call(this,s,M)]),y.push([+_.call(this,s,M),+k.call(this,s,M)])):v.length&&(c(),v=[],y=[]);return v.length&&c(),m.length?m.join(""):null}var e=he,r=he,i=0,u=de,a=c,o=ge,s=o.key,f=o,h="L",d=.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?(s=typeof t=="function"?o=t:(o=za.get(t)||ge).key,f=o.reverse||o,h=o.closed?"M":"L",n):s},n.tension=function(t){return arguments.length?(d=t,n):d},n}function De(t){return t.radius}function Fe(t){return[t.x,t.y]}function je(t){return function(){var n=t.apply(this,arguments),e=n[0],r=n[1]+qa;return[e*Math.cos(r),e*Math.sin(r)]}}function He(){return 64}function Oe(){return"circle"}function Re(t){var n=Math.sqrt(t/Nu);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}function Ye(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function Ue(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}function Ie(t,n,e){if(r=[],e&&n.length>1){var r,i,u,a=On(t.domain()),o=-1,c=n.length,l=(n[1]-n[0])/++e;while(c>++o)for(i=e;--i>0;)(u=+n[o]-i*l)>=a[0]&&r.push(u);for(--o,i=0;e>++i&&a[1]>(u=+n[o]+i*l);)r.push(u)}return r}function Ve(){Ya||(Ya=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var t,n=d3.event;try{Ya.scrollTop=1e3,Ya.dispatchEvent(n),t=1e3-Ya.scrollTop}catch(e){t=n.wheelDelta||-n.detail*5}return t}function Xe(t){var n=t.source,e=t.target,r=Be(n,e),i=[n];while(n!==r)n=n.parent,i.push(n);var u=i.length;while(e!==r)i.splice(u,0,e),e=e.parent;return i}function Ze(t){var n=[],e=t.parent;while(e!=null)n.push(t),t=e,e=e.parent;return n.push(t),n}function Be(t,n){if(t===n)return t;var e=Ze(t),r=Ze(n),i=e.pop(),u=r.pop(),a=null;while(i===u)a=i,i=e.pop(),u=r.pop();return a}function Ge(t){t.fixed|=2}function $e(t){t.fixed&=1}function Je(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ke(t){t.fixed&=3}function We(t,n,e){var r=0,i=0;if(t.charge=0,!t.leaf){var u,a=t.nodes,o=a.length,c=-1;while(o>++c)u=a[c],u!=null&&(We(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 Qe(){return 20}function tr(){return 1}function nr(t){return t.x}function er(t){return t.y}function rr(t,n,e){t.y0=n,t.y=e}function ir(t){return d3.range(t.length)}function ur(t){var n=-1,e=t[0].length,r=[];while(e>++n)r[n]=0;return r}function ar(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 or(t){return t.reduce(cr,0)}function cr(t,n){return t+n[1]}function lr(t,n){return sr(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function sr(t,n){var e=-1,r=+t[0],i=(t[1]-r)/n,u=[];while(n>=++e)u[e]=i*e+r;return u}function fr(t){return[d3.min(t),d3.max(t)]}function hr(t,n){return d3.rebind(t,n,"sort","children","value"),t.links=mr,t.nodes=function(n){return Za=!0,(t.nodes=t)(n)},t}function dr(t){return t.children}function gr(t){return t.value}function pr(t,n){return n.value-t.value}function mr(t){return d3.merge(t.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}function vr(t,n){return t.value-n.value}function yr(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function Mr(t,n){t._pack_next=n,n._pack_prev=t}function br(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 xr(t){function n(t){s=Math.min(t.x-t.r,s),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((e=t.children)&&(l=e.length)){var e,r,i,u,a,o,c,l,s=1/0,f=-1/0,h=1/0,d=-1/0;if(e.forEach(wr),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],Sr(r,i,u),n(u),yr(r,u),r._pack_prev=u,yr(u,i),i=r._pack_next,a=3;l>a;a++){Sr(r,i,u=e[a]);var g=0,p=1,m=1;for(o=i._pack_next;o!==i;o=o._pack_next,p++)if(br(o,u)){g=1;break}if(g==1)for(c=r._pack_prev;c!==o._pack_prev;c=c._pack_prev,m++)if(br(c,u))break;g?(m>p||p==m&&r.r>i.r?Mr(r,i=o):Mr(r=c,i),a--):(yr(r,u),i=u,n(u))}var v=(s+f)/2,y=(h+d)/2,M=0;for(a=0;l>a;a++)u=e[a],u.x-=v,u.y-=y,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));t.r=M,e.forEach(_r)}}function wr(t){t._pack_next=t._pack_prev=t}function _r(t){delete t._pack_next,delete t._pack_prev}function kr(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){var u=-1,a=i.length;while(a>++u)kr(i[u],n,e,r)}}function Sr(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 Ar(t){return 1+d3.max(t,function(t){return t.y})}function Nr(t){return t.reduce(function(t,n){return t+n.x},0)/t.length}function Cr(t){var n=t.children;return n&&n.length?Cr(n[0]):t}function Tr(t){var n,e=t.children;return e&&(n=e.length)?Tr(e[n-1]):t}function qr(t,n){return t.parent==n.parent?1:2}function Pr(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function zr(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function Er(t,n){var e=t.children;if(e&&(i=e.length)){var r,i,u=-1;while(i>++u)n(r=Er(e[u],n),t)>0&&(t=r)}return t}function Lr(t,n){return t.x-n.x}function Dr(t,n){return n.x-t.x}function Fr(t,n){return t.depth-n.depth}function jr(t,n){function e(t,r){var i=t.children;if(i&&(a=i.length)){var u,a,o=null,c=-1;while(a>++c)u=i[c],e(u,o),o=u}n(t,r)}e(t,null)}function Hr(t){var n,e=0,r=0,i=t.children,u=i.length;while(--u>=0)n=i[u]._tree,n.prelim+=e,n.mod+=e,e+=n.shift+(r+=n.change)}function Or(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 Rr(t,n,e){return t._tree.ancestor.parent==n.parent?t._tree.ancestor:e}function Yr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ur(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 Ir(t,n){function e(t,e){return d3.xhr(t,n,e).response(r)}function r(t){return e.parse(t.responseText)}function i(n){return n.map(u).join(t)}function u(t){return a.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var a=RegExp('["'+t+"\n]"),o=t.charCodeAt(0);return e.parse=function(t){var n;return e.parseRows(t,function(t){return n?n(t):(n=Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}"),void 0)})},e.parseRows=function(t,n){function e(){if(s>=l)return a;if(i)return i=!1,u;var n=s;if(t.charCodeAt(n)===34){var e=n;while(l>e++)if(t.charCodeAt(e)===34){if(t.charCodeAt(e+1)!==34)break;++e}s=e+2;var r=t.charCodeAt(e+1);return r===13?(i=!0,t.charCodeAt(e+2)===10&&++s):r===10&&(i=!0),t.substring(n+1,e).replace(/""/g,'"')}while(l>s){var r=t.charCodeAt(s++),c=1;if(r===10)i=!0;else if(r===13)i=!0,t.charCodeAt(s)===10&&(++s,++c);else if(r!==o)continue;return t.substring(n,s-c)}return t.substring(n)}var r,i,u={},a={},c=[],l=t.length,s=0,f=0;while((r=e())!==a){var h=[];while(r!==u&&r!==a)h.push(r),r=e();(!n||(h=n(h,f++)))&&c.push(h)}return c},e.format=function(t){return t.map(i).join("\n")},e}function Vr(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Xr(t,n){return Cu>Math.abs(t[0]-n[0])&&Cu>Math.abs(t[1]-n[1])}function Zr(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 Br(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Gr(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 $r(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Jr(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Kr(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 Wr(t){for(var n in Ba)n in t||(t[n]=Ba[n]);return function(n){return n&&($a.hasOwnProperty(n.type)?t[n.type](n):t.geometry(n))}}function Qr(t,n,e){return Wr({point:t,LineString:function(t){return{type:"MultiLineString",coordinates:n(t.coordinates)[1]}},MultiLineString:function(t){return{type:"MultiLineString",coordinates:d3.merge(t.coordinates.map(function(t){return n(t)[1]}))}},Polygon:function(t){return{type:"MultiPolygon",coordinates:ti(t.coordinates,n,e)}},MultiPolygon:function(t){return{type:"MultiPolygon",coordinates:d3.merge(t.coordinates.map(function(t){return ti(t,n,e)}))}},Sphere:function(){return{type:"Polygon",coordinates:[e(null,null,1)]}}})}function ti(t,n,e){var r=[],i=[],u=[],a=0,o=0,c=!1,l=[],s=[l],u=d3.merge(t.map(function(t){var e,r=n(t),i=r[1],u=i.length;return u?r[0]&1?(a+=Ai((e=i[0]).map(ni)),l.push(e),[]):(u>1&&r[0]&2&&i.push(i.pop().concat(i.shift())),i.filter(ui)):(c=!0,o+=Ai(t.map(ei)),[])}));if(!u.length&&(-Tu>a||c&&-Tu>o)&&l.push(e(null,null,1)),u.forEach(function(t){var n=t.length;if(!(1>=n)){var e=t[0],u=t[n-1],a={point:e,points:t,other:null,visited:!1,entry:!0,subject:!0},o={point:e,points:[e],other:a,visited:!1,entry:!1,subject:!1};a.other=o,r.push(a),i.push(o),a={point:u,points:[u],other:null,visited:!1,entry:!1,subject:!0},o={point:u,points:[u],other:a,visited:!1,entry:!0,subject:!1},a.other=o,r.push(a),i.push(o)}}),i.sort(ii),ri(r),ri(i),!r.length)return s;for(var f,h,d,g=r[0];;){f=g;while(f.visited)if((f=f.next)===g)return s;h=f.points,d=[[h.shift()]];do f.visited=f.other.visited=!0,f.entry?(d.push(f.subject?h:e(f.point,f.next.point,1)),f=f.next):(d.push(f.subject?(h=f.prev.points).reverse():e(f.point,f.prev.point,-1)),f=f.prev),f=f.other,h=f.points;while(!f.visited);l.push(d3.merge(d))}return s}function ni(t){var n=t[0],e=t[1],r=Math.cos(e);return[Math.atan2(Math.sin(n)*r,Math.sin(e)),Math.asin(Math.max(-1,Math.min(1,-Math.cos(n)*r)))]}function ei(t){var n=t[0]+Nu,e=t[1],r=Math.cos(e);return[Math.atan2(Math.sin(n)*r,Math.sin(e)),Math.asin(Math.max(-1,Math.min(1,-Math.cos(n)*r)))]}function ri(t){if(n=t.length){var n,e,r=0,i=t[0];while(n>++r)i.next=e=t[r],e.prev=i,i=e;i.next=e=t[0],e.prev=i}}function ii(t,n){return(0>(t=t.point)[0]?t[1]-Nu/2-Cu:Nu/2-t[1])-(0>(n=n.point)[0]?n[1]-Nu/2-Cu:Nu/2-n[1])}function ui(t){return t.length>1}function ai(t){if(!(u=t.length))return[0,[]];var n,e,r,i,u,a=t[0],o=a[0],c=a[1],l=o>0?Nu:-Nu,s=0,f=1,h=[a],d=[h];while(u>++s)a=t[s],n=a[0],e=a[1],r=n>0?Nu:-Nu,i=Math.abs(n-o),Cu>Math.abs(i-Nu)?(h.push([o,c=(c+e)/2>0?Nu/2:-Nu/2],[l,c]),d.push(h=[[r,c],[n,c]]),f=0):l!==r&&i>=Nu&&(Cu>Math.abs(o-l)&&(o-=l*Cu),Cu>Math.abs(n-r)&&(n-=r*Cu),c=oi(o,c,n,e),h.push([l,c]),d.push(h=[[r,c]]),f=0),h.push([o=n,c=e]),l=r;return[2-f,d]}function oi(t,n,e,r){var i,u,a=Math.sin(t-e);return Math.abs(a)>Cu?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 ci(t,n,e){var r;if(t==null)return r=e*Nu/2,[[-Nu,r],[0,r],[Nu,r],[Nu,0],[Nu,-r],[0,-r],[-Nu,-r],[-Nu,0],[-Nu,r]];if(Math.abs(t[0]-n[0])>Cu){var i=(n[0]>t[0]?1:-1)*Nu;return r=e*i/2,[[-i,r],[0,r],[i,r]]}return[n]}function li(t){function n(n){return t(n[0],n[1])}function e(n){if(!(e=n.length))return n;var e,r,u,o,c=0,l=n[0],s=[l=t(o=l[0],u=l[1])],f=Math.sin(u),h=Math.cos(u),d=l[0],g=l[1];while(e>++c)l=n[c],l=t(r=l[0],u=l[1]),i(d,g,o,f,h,d=l[0],g=l[1],o=r,f=Math.sin(u),h=Math.cos(u),a,s),s.push([d,g]);return s}function r(t){var n,r,u,o,c,l=t.length,s=-1,f=[];while(l>++s)f.push(r=e(n=t[s])),o=n.length-1,u=r.length-1,i((c=n[0])[0],c[1],(c=r[0])[0],Math.sin(c[1]),Math.cos(c[1]),(c=n[o])[0],c[1],(c=r[u])[0],Math.sin(c[1]),Math.cos(c[1]),a,n); +return f}function i(n,e,r,a,o,c,l,s,f,h,d,g){var p=c-n,m=l-e,v=p*p+m*m;if(v>4*u&&d--){var y=a*f+o*h*Math.cos(s-r),M=1/(Math.SQRT2*Math.sqrt(1+y)),b=M*(o*Math.cos(r)+h*Math.cos(s)),x=M*(o*Math.sin(r)+h*Math.sin(s)),w=Math.max(-1,Math.min(1,M*(a+f))),_=Math.asin(w),k=Math.abs(Math.abs(w)-1),S=Cu>k||qu>k&&(qu>Math.abs(o)||qu>Math.abs(h))?(r+s)/2:Math.atan2(x,b),A=t(S,_),N=A[0],C=A[1],T=n-N,q=e-C,P=p*q-m*T;if(P*P/v>u){var z=Math.cos(_);i(n,e,r,a,o,N,C,S,w,z,d,g),g.push([N,C]),i(N,C,S,w,z,c,l,s,f,h,d,g)}}}var u=.5,a=16,o=Wr({Point:function(t){t.coordinates=n(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(n)},LineString:function(t){t.coordinates=e(t.coordinates)},MultiLineString:function(t){t.coordinates=t.coordinates.map(e)},Polygon:function(t){t.coordinates=r(t.coordinates)},MultiPolygon:function(t){t.coordinates=t.coordinates.map(r)}});return o.precision=function(t){return arguments.length?(a=(u=t*t)>0&&16,o):Math.sqrt(u)},o}function si(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 fi(t){var n,e,r,i,u=Wr({point:function(u){u=t(u);var a=u[0],o=u[1];n>a&&(n=a),a>r&&(r=a),e>o&&(e=o),o>i&&(i=o)},polygon:function(t){this.line(t[0])}});return function(t){return i=r=-(n=e=1/0),u(t),[[n,e],[r,i]]}}function hi(t){if(!(n=t.length))return null;var n,e,r,i,u,a,o=t[0],c=0,l=o[0]*Pu,s=Math.cos(e=o[1]*Pu),f=s*Math.cos(l),h=s*Math.sin(l),d=Math.sin(e),g=0,p=0,m=0,v=0;while(n>++c)o=t[c],l=o[0]*Pu,s=Math.cos(e=o[1]*Pu),r=s*Math.cos(l),i=s*Math.sin(l),u=Math.sin(e),v+=a=Math.atan2(Math.sqrt((a=h*u-d*i)*a+(a=d*r-f*u)*a+(a=f*i-h*r)*a),f*r+h*i+d*u),g+=a*(f+(f=r)),p+=a*(h+(h=i)),m+=a*(d+(d=u));return[g,p,m,v]}function di(t){function n(t){return Math.cos(t[1])*Math.cos(t[0])>u}function e(t){if(!(a=t.length))return[0,[]];var e,i,u,a,o,c=t[0],l=n(c),s=l,f=1,h=[];l&&h.push(o=[c]);for(var d=1;a>d;d++)e=t[d],u=n(e),u!==l&&(i=r(c,e),(Xr(c,i)||Xr(e,i))&&(e[0]+=Cu,e[1]+=Cu,u=n(e))),u!==l&&(f=0,(l=u)?h.push(o=[i=r(e,c)]):o.push(i=r(c,e)),c=i),u&&!Xr(c,e)&&o.push(e),c=e;return[f+((s&&u)<<1),h]}function r(t,n){var e=Zr(t,0),r=Zr(n,0),i=[1,0,0],a=Gr(e,r),o=Br(a,a),c=a[0],l=o-c*c;if(!l)return t;var s=u*o/l,f=-u*c/l,h=Gr(i,a),d=Jr(i,s),g=Jr(a,f);$r(d,g);var p=h,m=Br(d,p),v=Br(p,p),y=Math.sqrt(m*m-v*(Br(d,d)-1)),M=Jr(p,(-m-y)/v);return $r(M,d),Vr(M)}var i=t*Pu,u=Math.cos(i),a=gi(i,6*Pu);return Qr(function(t){return n(t)&&t},e,a)}function gi(t,n){var e=Math.cos(t),r=Math.sin(t);return function(i,u,a){i!=null?(i=pi(e,i),u=pi(e,u),(a>0?u>i:i>u)&&(i+=a*2*Nu)):(i=t+a*2*Nu,u=t);for(var o=[],c=a*n,l=i;a>0?l>u:u>l;l-=c)o.push(Vr([e,-r*Math.cos(l),-r*Math.sin(l)]));return o}}function pi(t,n){var e=Zr(n);e[0]-=t,Kr(e);var r=Math.acos(Math.max(-1,Math.min(1,-e[1])));return((0>-e[2]?-r:r)+2*Math.PI-Cu)%(2*Math.PI)}function mi(t,n){function e(e,r){var i=t(e,r);return n(i[0],i[1])}return t===vi?n:n===vi?t:(t.invert&&n.invert&&(e.invert=function(e,r){var i=n.invert(e,r);return t.invert(i[0],i[1])}),e)}function vi(t,n){return[t,n]}function yi(t,n,e){var r=d3.range(t,n-Cu,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function Mi(t,n,e){var r=d3.range(t,n-Cu,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function bi(t,n,e,r){function i(t){var n=Math.sin(t*=d)*g,e=Math.sin(d-t)*g,r=e*l+n*f,i=e*s+n*h,u=e*a+n*c;return[Math.atan2(i,r)/Pu,Math.atan2(u,Math.sqrt(r*r+i*i))/Pu]}var u=Math.cos(n),a=Math.sin(n),o=Math.cos(r),c=Math.sin(r),l=u*Math.cos(t),s=u*Math.sin(t),f=o*Math.cos(e),h=o*Math.sin(e),d=Math.acos(Math.max(-1,Math.min(1,a*c+u*o*Math.cos(e-t)))),g=1/Math.sin(d);return i.distance=d,i}function xi(t,n){return[t/(2*Nu),Math.max(-.5,Math.min(.5,Math.log(Math.tan(Nu/4+n/2))/(2*Nu)))]}function wi(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function _i(t){var n=d3.sum(t,ki);return 0>n?4*Nu+n:n}function ki(t){return Ai(t.map(Si))}function Si(t){return[t[0]*Pu,t[1]*Pu]}function Ai(t){if(!(n=t.length))return 0;for(var n,e,r,i,u,a,o,c,l,s=t[0],f=s[0],h=f,d=s[1],g=d,p=Math.cos(g),m=Math.sin(g),v=0,y=1;n>y;++y)s=t[y],r=s[1],Cu>Math.abs(Math.abs(g)-Nu/2)&&Cu>Math.abs(Math.abs(r)-Nu/2)||(e=s[0],a=Math.cos(r),o=Math.sin(r),Cu>Math.abs(g-Nu/2)?v+=(e-f)*2:(u=Math.cos(i=e-h),c=Math.atan2(Math.sqrt((c=a*Math.sin(e-h))*c+(c=p*o-m*a*u)*c),m*o+p*a*u),l=(c+Nu+g+r)/2,v+=(0>i&&i>-Nu||i>Nu?-4:4)*Math.atan(Math.sqrt(Math.abs(Math.tan(l/2)*Math.tan((l-c)/2)*Math.tan((l-Nu/2-g)/2)*Math.tan((l-Nu/2-r)/2))))),f=h,d=g,h=e,g=r,p=a,m=o);return v}function Ni(t){return Ci(function(){return t})()}function Ci(t){function n(t){return t=l(t[0]*Pu,t[1]*Pu),[t[0]*h+s,f-t[1]*h]}function e(t){return t=l.invert((t[0]-s)/h,(f-t[1])/h),[t[0]*zu,t[1]*zu]}function r(){l=mi(a=Ti(v,y,M),u);var t=u(p,m);return s=d-t[0]*h,f=g+t[1]*h,n}function i(t,n){var e=u(t,n);return[e[0]*h+s,f-e[1]*h]}var u,a,c,l,s,f,h=150,d=480,g=250,p=0,m=0,v=0,y=0,M=0,b=Ja,x=null,w=li(i);n.object=function(t){return t=b(c(t)),w(t),t},n.clipAngle=function(t){return arguments.length?(b=t==null?(x=t,Ja):di(x=+t),n):x},n.scale=function(t){return arguments.length?(h=+t,r()):h},n.translate=function(t){return arguments.length?(d=+t[0],g=+t[1],r()):[d,g]},n.center=function(t){return arguments.length?(p=t[0]%360*Pu,m=t[1]%360*Pu,r()):[p*zu,m*zu]},n.rotate=function(t){return arguments.length?(v=t[0]%360*Pu,y=t[1]%360*Pu,M=t.length>2?t[2]%360*Pu:0,r()):[v*zu,y*zu,M*zu]},d3.rebind(n,w,"precision");var c=Wr({point:function(t){return a(t[0]*Pu,t[1]*Pu)},Sphere:o});return function(){return u=t.apply(this,arguments),n.invert=u.invert&&e,r()}}function Ti(t,n,e){return t?n||e?mi(zi(t),Ei(n,e)):zi(t):n||e?Ei(n,e):qi}function qi(t,n){return[t>Nu?t-2*Nu:-Nu>t?t+2*Nu:t,n]}function Pi(t){return function(n,e){return[(n+=t)>Nu?n-2*Nu:-Nu>n?n+2*Nu:n,e]}}function zi(t){var n=Pi(t);return n.invert=Pi(-t),n}function Ei(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),s=l*r+o*i;return[Math.atan2(c*u-s*a,o*r-l*i),Math.asin(Math.max(-1,Math.min(1,s*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),s=l*u-c*a;return[Math.atan2(c*u+l*a,o*r+s*i),Math.asin(Math.max(-1,Math.min(1,s*r-o*i)))]},e}function Li(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 Di(t,n,e,r){var i,u,a,o,c,l,s;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],s=i[1],(s-a)*(o-u)-(c-a)*(l-u)>0}function Fi(t,n,e){return(e[1]-n[1])*(t[0]-n[0])>(e[0]-n[0])*(t[1]-n[1])}function ji(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],s=n[1]-c,f=r[1]-l,h=(o*(c-l)-f*(i-u))/(f*a-o*s);return[i+h*a,c+h*s]}function Hi(t,n){var e={list:t.map(function(t,n){return{index:n,x:t[0],y:t[1]}}).sort(function(t,n){return n.y>t.y?-1:t.y>n.y?1:n.x>t.x?-1:t.x>n.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(t,n){return{edge:t,side:n,vertex:null,l:null,r:null}},insert:function(t,n){n.l=t,n.r=t.r,t.r.l=n,t.r=n},leftBound:function(t){var n=r.leftEnd;do n=n.r;while(n!=r.rightEnd&&i.rightOf(n,t));return n=n.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return t.edge==null?e.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return t.edge==null?e.bottomSite:t.edge.region[eo[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+(r*r+i*i)*.5,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,s=r.region.r;s.y>l.y||l.y==s.y&&s.x>l.x?(u=t,a=e):(u=n,a=r);var f=o>=a.region.r.x;return f&&u.side==="l"||!f&&u.side==="r"?null:{x:o,y:c}},rightOf:function(t,n){var e=t.edge,r=e.region.r,i=n.x>r.x;if(i&&t.side==="l")return 1;if(!i&&t.side==="r")return 0;if(e.a===1){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=l*u*(1+2*a/l+e.b*e.b)>e.b*(a*a-u*u),0>e.b&&(c=!c)}}else{var s=e.c-e.a*n.x,f=n.y-s,h=n.x-r.x,d=s-r.y;c=f*f>h*h+d*d}return t.side==="l"?c:!c},endPoint:function(t,e,r){t.ep[e]=r,t.ep[eo[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 u.list.length===0},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,s,f,h,d,g,p,m,v,y,M=e.list.shift();;)if(u.empty()||(a=u.min()),M&&(u.empty()||a.y>M.y||M.y==a.y&&a.x>M.x))o=r.leftBound(M),c=r.right(o),h=r.rightRegion(o),v=i.bisect(h,M),f=r.createHalfEdge(v,"l"),r.insert(o,f),p=i.intersect(o,f),p&&(u.del(o),u.insert(o,p,i.distance(p,M))),o=f,f=r.createHalfEdge(v,"r"),r.insert(o,f),p=i.intersect(f,c),p&&u.insert(f,p,i.distance(p,M)),M=e.list.shift();else{if(u.empty())break;o=u.extractMin(),l=r.left(o),c=r.right(o),s=r.right(c),h=r.leftRegion(o),d=r.rightRegion(c),m=o.vertex,i.endPoint(o.edge,o.side,m),i.endPoint(c.edge,c.side,m),r.del(o),u.del(c),r.del(c),y="l",h.y>d.y&&(g=h,h=d,d=g,y="r"),v=i.bisect(h,d),f=r.createHalfEdge(v,y),r.insert(l,f),i.endPoint(v,eo[y],m),p=i.intersect(l,f),p&&(u.del(l),u.insert(l,p,i.distance(p,h))),p=i.intersect(f,s),p&&u.insert(f,p,i.distance(p,h))}for(o=r.right(r.leftEnd);o!=r.rightEnd;o=r.right(o))n(o.edge)}function Oi(){return{leaf:!0,nodes:[],point:null}}function Ri(t,n,e,r,i,u){if(!t(n,e,r,i,u)){var a=(e+i)*.5,o=(r+u)*.5,c=n.nodes;c[0]&&Ri(t,c[0],e,r,a,o),c[1]&&Ri(t,c[1],a,r,i,o),c[2]&&Ri(t,c[2],e,o,a,u),c[3]&&Ri(t,c[3],a,o,i,u)}}function Yi(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ui(t,n,e,r){var i,u,a=0,o=n.length,c=e.length;while(o>a){if(r>=c)return-1;if(i=n.charCodeAt(a++),i===37){if(u=wo[n.charAt(a++)],!u||0>(r=u(t,e,r)))return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function Ii(t){return RegExp("^(?:"+t.map(d3.requote).join("|")+")","i")}function Vi(t){var n=new a,e=-1,r=t.length;while(r>++e)n.set(t[e].toLowerCase(),e);return n}function Xi(t,n,e){t+="";var r=t.length;return e>r?Array(e-r+1).join(n)+t:t}function Zi(t,n,e){po.lastIndex=0;var r=po.exec(n.substring(e));return r?e+=r[0].length:-1}function Bi(t,n,e){go.lastIndex=0;var r=go.exec(n.substring(e));return r?e+=r[0].length:-1}function Gi(t,n,e){yo.lastIndex=0;var r=yo.exec(n.substring(e));return r?(t.m=Mo.get(r[0].toLowerCase()),e+=r[0].length):-1}function $i(t,n,e){mo.lastIndex=0;var r=mo.exec(n.substring(e));return r?(t.m=vo.get(r[0].toLowerCase()),e+=r[0].length):-1}function Ji(t,n,e){return Ui(t,xo.c+"",n,e)}function Ki(t,n,e){return Ui(t,xo.x+"",n,e)}function Wi(t,n,e){return Ui(t,xo.X+"",n,e)}function Qi(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}function tu(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+2));return r?(t.y=nu(+r[0]),e+=r[0].length):-1}function nu(t){return t+(t>68?1900:2e3)}function eu(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1}function ru(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function iu(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}function uu(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1}function au(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1}function ou(t,n,e){_o.lastIndex=0;var r=_o.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1}function cu(t,n,e){var r=ko.get(n.substring(e,e+=2).toLowerCase());return r==null?-1:(t.p=r,e)}function lu(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+Xi(r,"0",2)+Xi(i,"0",2)}function su(t){return t.toISOString()}function fu(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 ro(e-1)),1),e}function u(t,e){return n(t=new ro(+t),e),t}function a(t,r,u){var a=i(t),o=[];if(u>1)while(r>a)e(a)%u||o.push(new Date(+a)),n(a,1);else while(r>a)o.push(new Date(+a)),n(a,1);return o}function o(t,n,e){try{ro=Yi;var r=new Yi;return r._=t,a(r,n,e)}finally{ro=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=u,t.range=a;var c=t.utc=hu(t);return c.floor=c,c.round=hu(r),c.ceil=hu(i),c.offset=hu(u),c.range=o,t}function hu(t){return function(n,e){try{ro=Yi;var r=new Yi;return r._=n,t(r,e)._}finally{ro=Date}}}function du(t,n,e){function r(n){return t(n)}return r.invert=function(n){return pu(t.invert(n))},r.domain=function(n){return arguments.length?(t.domain(n),r):t.domain().map(pu)},r.nice=function(t){return r.domain(Yn(r.domain(),function(){return t}))},r.ticks=function(e,i){var u=gu(r.domain());if(typeof e!="function"){var a=u[1]-u[0],o=a/e,c=d3.bisect(Ao,o);if(c==Ao.length)return n.year(u,e);if(!c)return t.ticks(e).map(pu);Math.log(Ao[c]/o)>Math.log(o/Ao[c-1])&&--c,e=n[c],i=e[1],e=e[0].range}return e(u[0],new Date(+u[1]+1),i)},r.tickFormat=function(){return e},r.copy=function(){return du(t.copy(),n,e)},d3.rebind(r,t,"range","rangeRound","interpolate","clamp")}function gu(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function pu(t){return new Date(t)}function mu(t){return function(n){var e=t.length-1,r=t[e];while(!r[1](n))r=t[--e];return r[0](n)}}function vu(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function yu(t){var n=t.getFullYear(),e=vu(n),r=vu(n+1);return n+(t-e)/(r-e)}function Mu(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function bu(t){var n=t.getUTCFullYear(),e=Mu(n),r=Mu(n+1);return n+(t-e)/(r-e)}var xu=".",wu=",",_u=[3,3];Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(ku){var Su=CSSStyleDeclaration.prototype,Au=Su.setProperty;Su.setProperty=function(t,n,e){Au.call(this,t,n+"",e)}}d3={version:"3.0.0pre"};var Nu=Math.PI,Cu=1e-6,Tu=Cu*Cu,qu=.001,Pu=Nu/180,zu=180/Nu,Eu=u;try{Eu(document.documentElement.childNodes)[0].nodeType}catch(Lu){Eu=i}var Du=[].__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]};d3.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 Fu+t in this},get:function(t){return this[Fu+t]},set:function(t,n){return this[Fu+t]=n},remove:function(t){return t=Fu+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)===ju&&t.call(this,n.substring(1),this[n])}});var Fu="\0",ju=Fu.charCodeAt(0);d3.functor=l,d3.rebind=function(t,n){var e,r=1,i=arguments.length;while(i>++r)t[e=arguments[r]]=s(t,n,n[e]);return t},d3.ascending=function(t,n){return n>t?-1:t>n?1:t>=n?0:0/0},d3.descending=function(t,n){return t>n?-1:n>t?1:n>=t?0:0/0},d3.mean=function(t,n){var e,r=t.length,i=0,u=-1,a=0;if(arguments.length===1)while(r>++u)f(e=t[u])&&(i+=(e-i)/++a);else while(r>++u)f(e=n.call(t,t[u],u))&&(i+=(e-i)/++a);return a?i:void 0},d3.median=function(t,n){return arguments.length>1&&(t=t.map(n)),t=t.filter(f),t.length?d3.quantile(t.sort(d3.ascending),.5):void 0},d3.min=function(t,n){var e,r,i=-1,u=t.length;if(arguments.length===1){while(u>++i&&((e=t[i])==null||e!=e))e=void 0;while(u>++i)(r=t[i])!=null&&e>r&&(e=r)}else{while(u>++i&&((e=n.call(t,t[i],i))==null||e!=e))e=void 0;while(u>++i)(r=n.call(t,t[i],i))!=null&&e>r&&(e=r)}return e},d3.max=function(t,n){var e,r,i=-1,u=t.length;if(arguments.length===1){while(u>++i&&((e=t[i])==null||e!=e))e=void 0;while(u>++i)(r=t[i])!=null&&r>e&&(e=r)}else{while(u>++i&&((e=n.call(t,t[i],i))==null||e!=e))e=void 0;while(u>++i)(r=n.call(t,t[i],i))!=null&&r>e&&(e=r)}return e},d3.extent=function(t,n){var e,r,i,u=-1,a=t.length;if(arguments.length===1){while(a>++u&&((e=i=t[u])==null||e!=e))e=i=void 0;while(a>++u)(r=t[u])!=null&&(e>r&&(e=r),r>i&&(i=r))}else{while(a>++u&&((e=i=n.call(t,t[u],u))==null||e!=e))e=void 0;while(a>++u)(r=n.call(t,t[u],u))!=null&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},d3.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=Math.random()*2-1,r=Math.random()*2-1,i=e*e+r*r;while(!i||i>1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(t,n){var e=arguments.length;2>e&&(n=1),1>e&&(t=0);var r=d3.random.normal();return function(){return Math.exp(t+n*r())}},irwinHall:function(t){return function(){for(var n=0,e=0;t>e;e++)n+=Math.random();return n/t}}},d3.sum=function(t,n){var e,r=0,i=t.length,u=-1;if(arguments.length===1)while(i>++u)isNaN(e=+t[u])||(r+=e);else while(i>++u)isNaN(e=+n.call(t,t[u],u))||(r+=e);return r},d3.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},d3.shuffle=function(t){var n,e,r=t.length;while(r)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t},d3.transpose=function(t){return d3.zip.apply(d3,t)},d3.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=d3.min(arguments,h),e=Array(n);n>++t;)for(var r,i=-1,u=e[t]=Array(r);r>++i;)u[i]=arguments[i][t];return e},d3.bisector=function(t){return{left:function(n,e,r,i){3>arguments.length&&(r=0),4>arguments.length&&(i=n.length);while(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){3>arguments.length&&(r=0),4>arguments.length&&(i=n.length);while(i>r){var u=r+i>>>1;t.call(n,n[u],u)>e?i=u:r=u+1}return r}}};var Hu=d3.bisector(function(t){return t});d3.bisectLeft=Hu.left,d3.bisect=d3.bisectRight=Hu.right,d3.nest=function(){function t(n,o){if(o>=u.length)return r?r.call(i,n):e?n.sort(e):n;var c,l,s,f=-1,h=n.length,d=u[o++],g=new a,p={};while(h>++f)(s=g.get(c=d(l=n[f])))?s.push(l):g.set(c,[l]);return g.forEach(function(n,e){p[n]=t(e,o)}),p}function n(t,e){if(e>=u.length)return t;var r,i=[],a=o[e++];for(r in t)i.push({key:r,values:n(t[r],e)});return a&&i.sort(function(t,n){return a(t.key,n.key)}),i}var e,r,i={},u=[],o=[];return i.map=function(n){return t(n,0)},i.entries=function(e){return n(t(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},d3.keys=function(t){var n=[];for(var e in t)n.push(e);return n},d3.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},d3.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},d3.permute=function(t,n){var e=[],r=-1,i=n.length;while(i>++r)e[r]=t[n[r]];return e},d3.merge=function(t){return Array.prototype.concat.apply([],t)},d3.range=function(t,n,e){if(3>arguments.length&&(e=1,2>arguments.length&&(n=t,t=0)),(n-t)/e===1/0)throw Error("infinite range");var r,i=[],u=g(Math.abs(e)),a=-1;if(t*=u,n*=u,e*=u,0>e)while((r=t+e*++a)>n)i.push(r/u);else while(n>(r=t+e*++a))i.push(r/u);return i},d3.requote=function(t){return t.replace(Ou,"\\$&")};var Ou=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)},d3.xhr=function(t,n,e){function r(){var t=l.status;!t&&l.responseText||t>=200&&300>t||t===304?u.load.call(i,c.call(i,l)):u.error.call(i,l)}var i={},u=d3.dispatch("progress","load","error"),a={},c=o,l=new(window.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=d3.event;d3.event=t;try{u.progress.call(i,l)}finally{d3.event=n}},i.header=function(t,n){return t=(t+"").toLowerCase(),2>arguments.length?a[t]:(n==null?delete a[t]:a[t]=n+"",i)},i.mimeType=function(t){return arguments.length?(n=t==null?null:t+"",i):n},i.response=function(t){return c=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(Eu(arguments)))}}),i.send=function(e,r,u){if(arguments.length===2&&typeof r=="function"&&(u=r,r=null),l.open(e,t,!0),n==null||"accept"in a||(a.accept=n+",*/*"),l.setRequestHeader)for(var o in a)l.setRequestHeader(o,a[o]);return n!=null&&l.overrideMimeType&&l.overrideMimeType(n),u!=null&&i.on("error",u).on("load",function(t){u(null,t)}),l.send(r==null?null:r),i},i.abort=function(){return l.abort(),i},d3.rebind(i,u,"on"),arguments.length===2&&typeof n=="function"&&(e=n,n=null),e==null?i:i.get(e)},d3.text=function(){return d3.xhr.apply(d3,arguments).response(p)},d3.json=function(t,n){return d3.xhr(t,"application/json",n).response(m)},d3.html=function(t,n){return d3.xhr(t,"text/html",n).response(v)},d3.xml=function(){return d3.xhr.apply(d3,arguments).response(y)};var Ru={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/"};d3.ns={prefix:Ru,qualify:function(t){var n=t.indexOf(":"),e=t;return n>=0&&(e=t.substring(0,n),t=t.substring(n+1)),Ru.hasOwnProperty(e)?{space:Ru[e],local:t}:t}},d3.dispatch=function(){var t=new M,n=-1,e=arguments.length;while(e>++n)t[arguments[n]]=b(t);return t},M.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)},d3.format=function(t){var n=Yu.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],s=n[9],f=1,h="",d=!1;switch(l&&(l=+l.substring(1)),(a||e==="0"&&r==="=")&&(a=e="0",r="=",c&&(o-=Math.floor((o-1)/4))),s){case"n":c=!0,s="g";break;case"%":f=100,h="%",s="f";break;case"p":f=100,h="%",s="r";break;case"b":case"o":case"x":case"X":u&&(u="0"+s.toLowerCase());case"c":case"d":d=!0,l=0;break;case"s":f=-1,s="r"}u==="#"&&(u=""),s!="r"||l||(s="g"),s=Uu.get(s)||w;var g=a&&c;return function(t){if(d&&t%1)return"";var n=0>t||t===0&&0>1/t?(t=-t,"-"):i;if(0>f){var p=d3.formatPrefix(t,l);t=p.scale(t),h=p.symbol}else t*=f;t=s(t,l),!a&&c&&(t=Iu(t));var m=u.length+t.length+(g?0:n.length),v=o>m?Array(m=o-m+1).join(e):"";return g&&(t=Iu(v+t)),xu&&t.replace(".",xu),n+=u,(r==="<"?n+t+v:r===">"?v+n+t:r==="^"?v.substring(0,m>>=1)+n+t+v.substring(m):n+(g?t:v+t))+h}};var Yu=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Uu=d3.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 d3.round(t,n=x(t,n)).toFixed(Math.max(0,Math.min(20,n)))}}),Iu=o;if(_u){var Vu=_u.length;Iu=function(t){var n=t.lastIndexOf("."),e=n>=0?"."+t.substring(n+1):(n=t.length,""),r=[],i=0,u=_u[0];while(n>0&&u>0)r.push(t.substring(n-=u,n+u)),u=_u[i=(i+1)%Vu];return r.reverse().join(wu||"")+e}}var Xu=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(_);d3.formatPrefix=function(t,n){var e=0;return t&&(0>t&&(t*=-1),n&&(t=d3.round(t,x(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,Math.floor((0>=e?e+1:e-1)/3)*3))),Xu[8+e/3]};var Zu=function(){return o},Bu=d3.map({linear:Zu,poly:q,quad:function(){return N},cubic:function(){return C},sin:function(){return P},exp:function(){return z},circle:function(){return E},elastic:L,back:D,bounce:function(){return F}}),Gu=d3.map({"in":o,out:S,"in-out":A,"out-in":function(t){return A(S(t))}});d3.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=Bu.get(e)||Zu,r=Gu.get(r)||o,k(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.transform=function(t){var n=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate();return new R(e?e.matrix:$u)})(t)},R.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var $u={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(t,n){var e,r=d3.interpolators.length;while(--r>=0&&!(e=d3.interpolators[r](t,n)));return e},d3.interpolateNumber=function(t,n){return n-=t,function(e){return t+n*e}},d3.interpolateRound=function(t,n){return n-=t,function(e){return Math.round(t+n*e)}},d3.interpolateString=function(t,n){var e,r,i,u,a,o=0,c=0,l=[],s=[];for(Ju.lastIndex=0,r=0;e=Ju.exec(n);++r)e.index&&l.push(n.substring(o,c=e.index)),s.push({i:l.length,x:e[0]}),l.push(null),o=Ju.lastIndex;for(n.length>o&&l.push(n.substring(o)),r=0,u=s.length;(e=Ju.exec(t))&&u>r;++r)if(a=s[r],a.x==e[0]){if(a.i)if(l[a.i+1]==null)for(l[a.i-1]+=a.x,l.splice(a.i,1),i=r+1;u>i;++i)s[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)s[i].i-=2;else if(l[a.i+1]==null)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)s[i].i--;s.splice(r,1),u--,r--}else a.x=d3.interpolateNumber(parseFloat(e[0]),parseFloat(a.x));while(u>r)a=s.pop(),l[a.i+1]==null?l[a.i]=a.x:(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1)),u--;return l.length===1?l[0]==null?s[0].x:function(){return n}:function(t){for(r=0;u>r;++r)l[(a=s[r]).i]=a.x(t);return l.join("")}},d3.interpolateTransform=function(t,n){var e,r=[],i=[],u=d3.transform(t),a=d3.transform(n),o=u.translate,c=a.translate,l=u.rotate,s=a.rotate,f=u.skew,h=a.skew,d=u.scale,g=a.scale;return o[0]!=c[0]||o[1]!=c[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:d3.interpolateNumber(o[0],c[0])},{i:3,x:d3.interpolateNumber(o[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),d[0]!=g[0]||d[1]!=g[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:e-4,x:d3.interpolateNumber(d[0],g[0])},{i:e-2,x:d3.interpolateNumber(d[1],g[1])})):(g[0]!=1||g[1]!=1)&&r.push(r.pop()+"scale("+g+")"),e=i.length,function(t){var n,u=-1;while(e>++u)r[(n=i[u]).i]=n.x(t);return r.join("")}},d3.interpolateRgb=function(t,n){t=d3.rgb(t),n=d3.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"#"+J(Math.round(e+u*t))+J(Math.round(r+a*t))+J(Math.round(i+o*t))}},d3.interpolateHsl=function(t,n){t=d3.hsl(t),n=d3.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 un(e+u*t,r+a*t,i+o*t)+""}},d3.interpolateLab=function(t,n){t=d3.lab(t),n=d3.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 fn(e+u*t,r+a*t,i+o*t)+""}},d3.interpolateHcl=function(t,n){t=d3.hcl(t),n=d3.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 cn(e+u*t,r+a*t,i+o*t)+""}},d3.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(d3.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}},d3.interpolateObject=function(t,n){var e,r={},i={};for(e in t)e in n?r[e]=V(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 Ju=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(t,n){return n instanceof Array&&d3.interpolateArray(t,n)},function(t,n){return(typeof t=="string"||typeof n=="string")&&d3.interpolateString(t+"",n+"")},function(t,n){return(typeof n=="string"?Wu.has(n)||/^(#|rgb\(|hsl\()/.test(n):n instanceof B)&&d3.interpolateRgb(t,n)},function(t,n){return!isNaN(t=+t)&&!isNaN(n=+n)&&d3.interpolateNumber(t,n)}],B.prototype.toString=function(){return this.rgb()+""},d3.rgb=function(t,n,e){return arguments.length===1?t instanceof $?G(t.r,t.g,t.b):K(""+t,G,un):G(~~t,~~n,~~e)};var Ku=$.prototype=new B;Ku.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),G(Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(r/t)))):G(i,i,i)},Ku.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),G(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},Ku.hsl=function(){return W(this.r,this.g,this.b)},Ku.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var Wu=d3.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"}); +Wu.forEach(function(t,n){Wu.set(t,K(n,G,un))}),d3.hsl=function(t,n,e){return arguments.length===1?t instanceof rn?en(t.h,t.s,t.l):K(""+t,W,en):en(+t,+n,+e)};var Qu=rn.prototype=new B;Qu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),en(this.h,this.s,this.l/t)},Qu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),en(this.h,this.s,t*this.l)},Qu.rgb=function(){return un(this.h,this.s,this.l)},d3.hcl=function(t,n,e){return arguments.length===1?t instanceof on?an(t.h,t.c,t.l):t instanceof sn?hn(t.l,t.a,t.b):hn((t=Q((t=d3.rgb(t)).r,t.g,t.b)).l,t.a,t.b):an(+t,+n,+e)};var ta=on.prototype=new B;ta.brighter=function(t){return an(this.h,this.c,Math.min(100,this.l+na*(arguments.length?t:1)))},ta.darker=function(t){return an(this.h,this.c,Math.max(0,this.l-na*(arguments.length?t:1)))},ta.rgb=function(){return cn(this.h,this.c,this.l).rgb()},d3.lab=function(t,n,e){return arguments.length===1?t instanceof sn?ln(t.l,t.a,t.b):t instanceof on?cn(t.l,t.c,t.h):Q((t=d3.rgb(t)).r,t.g,t.b):ln(+t,+n,+e)};var na=18,ea=.95047,ra=1,ia=1.08883,ua=sn.prototype=new B;ua.brighter=function(t){return ln(Math.min(100,this.l+na*(arguments.length?t:1)),this.a,this.b)},ua.darker=function(t){return ln(Math.max(0,this.l-na*(arguments.length?t:1)),this.a,this.b)},ua.rgb=function(){return fn(this.l,this.a,this.b)};var aa=function(t,n){return n.querySelector(t)},oa=function(t,n){return n.querySelectorAll(t)},ca=document.documentElement,la=ca.matchesSelector||ca.webkitMatchesSelector||ca.mozMatchesSelector||ca.msMatchesSelector||ca.oMatchesSelector,sa=function(t,n){return la.call(t,n)};typeof Sizzle=="function"&&(aa=function(t,n){return Sizzle(t,n)[0]||null},oa=function(t,n){return Sizzle.uniqueSort(Sizzle(t,n))},sa=Sizzle.matchesSelector);var fa=[];d3.selection=function(){return ha},d3.selection.prototype=fa,fa.select=function(t){var n,e,r,i,u=[];typeof t!="function"&&(t=vn(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)},fa.selectAll=function(t){var n,e,r=[];typeof t!="function"&&(t=yn(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=Eu(t.call(e,e.__data__,o))),n.parentNode=e);return mn(r)},fa.attr=function(t,n){if(2>arguments.length){if(typeof t=="string"){var e=this.node();return t=d3.ns.qualify(t),t.local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(Mn(n,t[n]));return this}return this.each(Mn(t,n))},fa.classed=function(t,n){if(2>arguments.length){if(typeof t=="string"){var e=this.node(),r=(t=t.trim().split(/^|\s+/g)).length,i=-1;if(n=e.classList){while(r>++i)if(!n.contains(t[i]))return!1}else{n=e.className,n.baseVal!=null&&(n=n.baseVal);while(r>++i)if(!bn(t[i]).test(n))return!1}return!0}for(n in t)this.each(xn(n,t[n]));return this}return this.each(xn(t,n))},fa.style=function(t,n,e){var r=arguments.length;if(3>r){if(typeof t!="string"){2>r&&(n="");for(e in t)this.each(_n(e,t[e],n));return this}if(2>r)return getComputedStyle(this.node(),null).getPropertyValue(t);e=""}return this.each(_n(t,n,e))},fa.property=function(t,n){if(2>arguments.length){if(typeof t=="string")return this.node()[t];for(n in t)this.each(kn(n,t[n]));return this}return this.each(kn(t,n))},fa.text=function(t){return arguments.length?this.each(typeof t=="function"?function(){var n=t.apply(this,arguments);this.textContent=n==null?"":n}:t==null?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},fa.html=function(t){return arguments.length?this.each(typeof t=="function"?function(){var n=t.apply(this,arguments);this.innerHTML=n==null?"":n}:t==null?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},fa.append=function(t){function n(){return this.appendChild(document.createElementNS(this.namespaceURI,t))}function e(){return this.appendChild(document.createElementNS(t.space,t.local))}return t=d3.ns.qualify(t),this.select(t.local?e:n)},fa.insert=function(t,n){function e(){return this.insertBefore(document.createElementNS(this.namespaceURI,t),aa(n,this))}function r(){return this.insertBefore(document.createElementNS(t.space,t.local),aa(n,this))}return t=d3.ns.qualify(t),this.select(t.local?r:e)},fa.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},fa.data=function(t,n){function e(t,e){var r,i,u,o=t.length,f=e.length,h=Math.min(o,f),d=Math.max(o,f),g=[],p=[],m=[];if(n){var v,y=new a,M=[],b=e.length;for(r=-1;o>++r;)v=n.call(i=t[r],i.__data__,r),y.has(v)?m[b++]=i:y.set(v,i),M.push(v);for(r=-1;f>++r;)v=n.call(e,u=e[r],r),y.has(v)?(g[r]=i=y.get(v),i.__data__=u,p[r]=m[r]=null):(p[r]=Sn(u),g[r]=m[r]=null),y.remove(v);for(r=-1;o>++r;)y.has(M[r])&&(m[r]=t[r])}else{for(r=-1;h>++r;)i=t[r],u=e[r],i?(i.__data__=u,g[r]=i,p[r]=m[r]=null):(p[r]=Sn(u),g[r]=m[r]=null);for(;f>r;++r)p[r]=Sn(e[r]),g[r]=m[r]=null;for(;d>r;++r)m[r]=t[r],p[r]=g[r]=null}p.update=g,p.parentNode=g.parentNode=m.parentNode=t.parentNode,c.push(p),l.push(g),s.push(m)}var r,i,u=-1,o=this.length;if(!arguments.length){t=Array(o=(r=this[0]).length);while(o>++u)(i=r[u])&&(t[u]=i.__data__);return t}var c=qn([]),l=mn([]),s=mn([]);if(typeof t=="function")while(o>++u)e(r=this[u],t.call(r,r.parentNode.__data__,u));else while(o>++u)e(r=this[u],t);return l.enter=function(){return c},l.exit=function(){return s},l},fa.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},fa.filter=function(t){var n,e,r,i=[];typeof t!="function"&&(t=An(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)},fa.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},fa.sort=function(t){t=Nn.apply(this,arguments);for(var n=-1,e=this.length;e>++n;)this[n].sort(t);return this.order()},fa.on=function(t,n,e){var r=arguments.length;if(3>r){if(typeof t!="string"){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))},fa.each=function(t){return Tn(this,function(n,e,r){t.call(n,n.__data__,e,r)})},fa.call=function(t){var n=Eu(arguments);return t.apply(n[0]=this,n),this},fa.empty=function(){return!this.node()},fa.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},fa.transition=function(){var t,n,e=ga||++ma,r=[],i=Object.create(va);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])&&zn(n,c,e,i),t.push(n)}return Pn(r,e)};var ha=mn([[document]]);ha[0].parentNode=ca,d3.select=function(t){return typeof t=="string"?ha.select(t):mn([[t]])},d3.selectAll=function(t){return typeof t=="string"?ha.selectAll(t):mn([Eu(t)])};var da=[];d3.selection.enter=qn,d3.selection.enter.prototype=da,da.append=fa.append,da.insert=fa.insert,da.empty=fa.empty,da.node=fa.node,da.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,s=i.length;s>++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 ga,pa=[],ma=0,va={ease:T,delay:0,duration:250};pa.call=fa.call,pa.empty=fa.empty,pa.node=fa.node,d3.transition=function(t){return arguments.length?ga?t.transition():t:ha.transition()},d3.transition.prototype=pa,pa.select=function(t){var n,e,r,i=this.id,u=[];typeof t!="function"&&(t=vn(t));for(var a=-1,o=this.length;o>++a;){u.push(n=[]);for(var c=this[a],l=-1,s=c.length;s>++l;)(r=c[l])&&(e=t.call(r,r.__data__,l))?("__data__"in r&&(e.__data__=r.__data__),zn(e,l,i,r.__transition__[i]),n.push(e)):n.push(null)}return Pn(u,i)},pa.selectAll=function(t){var n,e,r,i,u,a=this.id,o=[];typeof t!="function"&&(t=yn(t));for(var c=-1,l=this.length;l>++c;)for(var s=this[c],f=-1,h=s.length;h>++f;)if(r=s[f]){u=r.__transition__[a],e=t.call(r,r.__data__,f),o.push(n=[]);for(var d=-1,g=e.length;g>++d;)zn(i=e[d],d,a,u),n.push(i)}return Pn(o,a)},pa.filter=function(t){var n,e,r,i=[];typeof t!="function"&&(t=An(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 Pn(i,this.id,this.time).ease(this.ease())},pa.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=V(t),u=d3.ns.qualify(t);return Ln(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 t==null?u.local?r:e:(t+="",u.local?a:n)})},pa.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=d3.ns.qualify(t);return this.tween("attr."+t,i.local?r:e)},pa.style=function(t,n,e){function r(){this.style.removeProperty(t)}var i=arguments.length;if(3>i){if(typeof t!="string"){2>i&&(n="");for(e in t)this.style(e,t[e],n);return this}e=""}var u=V(t);return Ln(this,"style."+t,n,function(n){function i(){var r,i=getComputedStyle(this,null).getPropertyValue(t);return i!==n&&(r=u(i,n),function(n){this.style.setProperty(t,r(n),e)})}return n==null?r:(n+="",i)})},pa.styleTween=function(t,n,e){return 3>arguments.length&&(e=""),this.tween("style."+t,function(r,i){var u=n.call(this,r,i,getComputedStyle(this,null).getPropertyValue(t));return u&&function(n){this.style.setProperty(t,u(n),e)}})},pa.text=function(t){return Ln(this,"text",t,En)},pa.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},pa.ease=function(t){var n=this.id;return 1>arguments.length?this.node().__transition__[n].ease:(typeof t!="function"&&(t=d3.ease.apply(d3,arguments)),Tn(this,function(e){e.__transition__[n].ease=t}))},pa.delay=function(t){var n=this.id;return Tn(this,typeof t=="function"?function(e,r,i){e.__transition__[n].delay=t.call(e,e.__data__,r,i)|0}:(t|=0,function(e){e.__transition__[n].delay=t}))},pa.duration=function(t){var n=this.id;return Tn(this,typeof t=="function"?function(e,r,i){e.__transition__[n].duration=Math.max(1,t.call(e,e.__data__,r,i)|0)}:(t=Math.max(1,t|0),function(e){e.__transition__[n].duration=t}))},pa.each=function(t,n){var e=this.id;if(2>arguments.length){var r=va,i=ga;ga=e,Tn(this,function(n,r,i){va=n.__transition__[e],t.call(n,n.__data__,r,i)}),va=r,ga=i}else Tn(this,function(r){r.__transition__[e].event.on(t,n)});return this},pa.transition=function(){for(var t,n,e,r,i=this.id,u=++ma,a=[],o=0,c=this.length;c>o;o++){a.push(t=[]);for(var n=this[o],l=0,s=n.length;s>l;l++)(e=n[l])&&(r=Object.create(e.__transition__[i]),r.delay+=r.duration,zn(e,l,u,r)),t.push(e)}return Pn(a,u)},pa.tween=function(t,n){var e=this.id;return 2>arguments.length?this.node().__transition__[e].tween.get(t):Tn(this,n==null?function(n){n.__transition__[e].tween.remove(t)}:function(r){r.__transition__[e].tween.set(t,n)})};var ya,Ma,ba=0,xa={},wa=null;d3.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=xa[t.id];r&&r.callback===t?(r.then=e,r.delay=n):xa[t.id=++ba]=wa={callback:t,then:e,delay:n,next:wa},ya||(Ma=clearTimeout(Ma),ya=1,_a(Dn))},d3.timer.flush=function(){var t,n=Date.now(),e=wa;while(e)t=n-e.then,e.delay||(e.flush=e.callback(t)),e=e.next;Fn()};var _a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,17)};d3.mouse=function(t){return jn(t,H())};var ka=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(t,n){return 2>arguments.length&&(n=H().touches),n?Eu(n).map(function(n){var e=jn(t,n);return e.identifier=n.identifier,e}):[]},d3.scale={},d3.scale.linear=function(){return In([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return Kn(d3.scale.linear(),Wn)};var Sa=d3.format(".0e");Wn.pow=function(t){return Math.pow(10,t)},Qn.pow=function(t){return-Math.pow(10,-t)},d3.scale.pow=function(){return te(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ee([],{t:"range",a:[[]]})},d3.scale.category10=function(){return d3.scale.ordinal().range(Aa)},d3.scale.category20=function(){return d3.scale.ordinal().range(Na)},d3.scale.category20b=function(){return d3.scale.ordinal().range(Ca)},d3.scale.category20c=function(){return d3.scale.ordinal().range(Ta)};var Aa=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Na=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Ca=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Ta=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return re([],[])},d3.scale.quantize=function(){return ie(0,1,[0,1])},d3.scale.threshold=function(){return ue([.5],[0,1])},d3.scale.identity=function(){return ae([0,1])},d3.svg={},d3.svg.arc=function(){function t(){var t=n.apply(this,arguments),u=e.apply(this,arguments),a=r.apply(this,arguments)+qa,o=i.apply(this,arguments)+qa,c=(a>o&&(c=a,a=o,o=c),o-a),l=Nu>c?"0":"1",s=Math.cos(a),f=Math.sin(a),h=Math.cos(o),d=Math.sin(o);return c>=Pa?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*s+","+u*f+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*d+"L"+t*h+","+t*d+"A"+t+","+t+" 0 "+l+",0 "+t*s+","+t*f+"Z":"M"+u*s+","+u*f+"A"+u+","+u+" 0 "+l+",1 "+u*h+","+u*d+"L0,0"+"Z"}var n=oe,e=ce,r=le,i=se;return t.innerRadius=function(e){return arguments.length?(n=l(e),t):n},t.outerRadius=function(n){return arguments.length?(e=l(n),t):e},t.startAngle=function(n){return arguments.length?(r=l(n),t):r},t.endAngle=function(n){return arguments.length?(i=l(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+qa;return[Math.cos(u)*t,Math.sin(u)*t]},t};var qa=-Nu/2,Pa=2*Nu-1e-6;d3.svg.line=function(){return fe(o)};var za=d3.map({linear:ge,"linear-closed":pe,"step-before":me,"step-after":ve,basis:_e,"basis-open":ke,"basis-closed":Se,bundle:Ae,cardinal:be,"cardinal-open":ye,"cardinal-closed":Me,monotone:ze});za.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var Ea=[0,2/3,1/3,0],La=[0,1/3,2/3,0],Da=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var t=fe(Ee);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},me.reverse=ve,ve.reverse=me,d3.svg.area=function(){return Le(o)},d3.svg.area.radial=function(){var t=Le(Ee);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},d3.svg.chord=function(){function t(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=s.call(t,i,r),a=f.call(t,i,r)+qa,o=h.call(t,i,r)+qa;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>Nu)+",1 "+n}function a(t,n,e,r){return"Q 0,0 "+r}var o=e,c=n,s=De,f=le,h=se;return t.radius=function(n){return arguments.length?(s=l(n),t):s},t.source=function(n){return arguments.length?(o=l(n),t):o},t.target=function(n){return arguments.length?(c=l(n),t):c},t.startAngle=function(n){return arguments.length?(f=l(n),t):f},t.endAngle=function(n){return arguments.length?(h=l(n),t):h},t},d3.svg.diagonal=function(){function t(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=e,i=n,u=Fe;return t.source=function(n){return arguments.length?(r=l(n),t):r},t.target=function(n){return arguments.length?(i=l(n),t):i},t.projection=function(n){return arguments.length?(u=n,t):u},t},d3.svg.diagonal.radial=function(){var t=d3.svg.diagonal(),n=Fe,e=t.projection;return t.projection=function(t){return arguments.length?e(je(n=t)):n},t},d3.svg.symbol=function(){function t(t,r){return(Fa.get(n.call(this,t,r))||Re)(e.call(this,t,r))}var n=Oe,e=He;return t.type=function(e){return arguments.length?(n=l(e),t):n},t.size=function(n){return arguments.length?(e=l(n),t):e},t};var Fa=d3.map({circle:Re,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*Ha)),e=n*Ha;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/ja),e=n*ja/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/ja),e=n*ja/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});d3.svg.symbolTypes=Fa.keys();var ja=Math.sqrt(3),Ha=Math.tan(30*Pu);d3.svg.axis=function(){function t(t){t.each(function(){var t,f=d3.select(this),h=l==null?e.ticks?e.ticks.apply(e,c):e.domain():l,d=n==null?e.tickFormat?e.tickFormat.apply(e,c):String:n,g=Ie(e,h,s),p=f.selectAll(".minor").data(g,String),m=p.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),v=d3.transition(p.exit()).style("opacity",1e-6).remove(),y=d3.transition(p).style("opacity",1),M=f.selectAll("g").data(h,String),b=M.enter().insert("g","path").style("opacity",1e-6),x=d3.transition(M.exit()).style("opacity",1e-6).remove(),w=d3.transition(M).style("opacity",1),_=Rn(e),k=f.selectAll(".domain").data([0]),S=d3.transition(k),A=e.copy(),N=this.__chart__||A;this.__chart__=A,k.enter().append("path").attr("class","domain"),b.append("line").attr("class","tick"),b.append("text");var C=b.select("line"),T=w.select("line"),q=M.select("text").text(d),P=b.select("text"),z=w.select("text");switch(r){case"bottom":t=Ye,m.attr("y2",u),y.attr("x2",0).attr("y2",u),C.attr("y2",i),P.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"),S.attr("d","M"+_[0]+","+a+"V0H"+_[1]+"V"+a);break;case"top":t=Ye,m.attr("y2",-u),y.attr("x2",0).attr("y2",-u),C.attr("y2",-i),P.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"),S.attr("d","M"+_[0]+","+-a+"V0H"+_[1]+"V"+-a);break;case"left":t=Ue,m.attr("x2",-u),y.attr("x2",-u).attr("y2",0),C.attr("x2",-i),P.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"),S.attr("d","M"+-a+","+_[0]+"H0V"+_[1]+"H"+-a);break;case"right":t=Ue,m.attr("x2",u),y.attr("x2",u).attr("y2",0),C.attr("x2",i),P.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"),S.attr("d","M"+a+","+_[0]+"H0V"+_[1]+"H"+a)}if(e.ticks)b.call(t,N),w.call(t,A),x.call(t,A),m.call(t,N),y.call(t,A),v.call(t,A);else{var E=A.rangeBand()/2,L=function(t){return A(t)+E};b.call(t,L),w.call(t,L)}})}var n,e=d3.scale.linear(),r="bottom",i=6,u=6,a=6,o=3,c=[10],l=null,s=0;return t.scale=function(n){return arguments.length?(e=n,t):e},t.orient=function(n){return arguments.length?(r=n,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?(s=+n,t):s},t},d3.svg.brush=function(){function t(u){u.each(function(){var u,a=d3.select(this),s=a.selectAll(".background").data([0]),f=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),s.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.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 Oa[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=Rn(o),s.attr("x",u[0]).attr("width",u[1]-u[0]),e(a)),c&&(u=Rn(c),s.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("+s[+/e$/.test(t)][0]+","+s[+/^s/.test(t)][1]+")"})}function e(t){t.select(".extent").attr("x",s[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1][0]-s[0][0])}function r(t){t.select(".extent").attr("y",s[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1][1]-s[0][1])}function i(){function i(){var t=d3.event.changedTouches;return t?d3.touches(v,t)[0]:d3.mouse(v)}function l(){d3.event.keyCode==32&&(k||(p=null,S[0]-=s[1][0],S[1]-=s[1][1],k=2),j())}function f(){d3.event.keyCode==32&&k==2&&(S[0]+=s[1][0],S[1]+=s[1][1],k=0,j())}function h(){var t=i(),u=!1;m&&(t[0]+=m[0],t[1]+=m[1]),k||(d3.event.altKey?(p||(p=[(s[0][0]+s[1][0])/2,(s[0][1]+s[1][1])/2]),S[0]=s[+(p[0]>t[0])][0],S[1]=s[+(p[1]>t[1])][1]):p=null),w&&d(t,o,0)&&(e(b),u=!0),_&&d(t,c,1)&&(r(b),u=!0),u&&(n(b),M({type:"brush",mode:k?"move":"resize"}))}function d(t,n,e){var r,i,a=Rn(n),o=a[0],c=a[1],l=S[e],f=s[1][e]-s[0][e];return k&&(o-=l,c-=f+l),r=Math.max(o,Math.min(c,t[e])),k?i=(r+=l)+f:(p&&(l=Math.max(o,Math.min(c,2*p[e]-r))),r>l?(i=r,r=l):i=l),s[0][e]!==r||s[1][e]!==i?(u=null,s[0][e]=r,s[1][e]=i,!0):void 0}function g(){h(),b.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),d3.select("body").style("cursor",null),A.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"}),j()}var p,m,v=this,y=d3.select(d3.event.target),M=a.of(v,arguments),b=d3.select(v),x=y.datum(),w=!/^(n|s)$/.test(x)&&o,_=!/^(e|w)$/.test(x)&&c,k=y.classed("extent"),S=i(),A=d3.select(window).on("mousemove.brush",h).on("mouseup.brush",g).on("touchmove.brush",h).on("touchend.brush",g).on("keydown.brush",l).on("keyup.brush",f);if(k)S[0]=s[0][0]-S[0],S[1]=s[0][1]-S[1];else if(x){var N=+/w$/.test(x),C=+/^n/.test(x);m=[s[1-N][0]-S[0],s[1-C][1]-S[1]],S[0]=s[N][0],S[1]=s[C][1]}else d3.event.altKey&&(p=S.slice());b.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",y.style("cursor")),M({type:"brushstart"}),h(),j()}var u,a=O(t,"brushstart","brush","brushend"),o=null,c=null,l=Ra[0],s=[[0,0],[0,0]];return t.x=function(n){return arguments.length?(o=n,l=Ra[!o<<1|!c],t):o},t.y=function(n){return arguments.length?(c=n,l=Ra[!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),s[0][0]=e|0,s[1][0]=r|0),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),s[0][1]=i|0,s[1][1]=a|0),t):(n=u||s,o&&(e=n[0][0],r=n[1][0],u||(e=s[0][0],r=s[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=s[0][1],a=s[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,s[0][0]=s[0][1]=s[1][0]=s[1][1]=0,t},t.empty=function(){return o&&s[0][0]===s[1][0]||c&&s[0][1]===s[1][1]},d3.rebind(t,a,"on")};var Oa={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ra=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function t(){this.on("mousedown.drag",n).on("touchstart.drag",n)}function n(){function t(){var t=o.parentNode;return s!=null?d3.touches(t).filter(function(t){return t.identifier===s})[0]:d3.mouse(t)}function n(){if(!o.parentNode)return i();var n=t(),e=n[0]-f[0],r=n[1]-f[1];h|=e|r,f=n,j(),c({type:"drag",x:n[0]+a[0],y:n[1]+a[1],dx:e,dy:r})}function i(){c({type:"dragend"}),h&&(j(),d3.event.target===l&&d.on("click.drag",u,!0)),d.on(s!=null?"touchmove.drag-"+s:"mousemove.drag",null).on(s!=null?"touchend.drag-"+s:"mouseup.drag",null)}function u(){j(),d.on("click.drag",null)}var a,o=this,c=e.of(o,arguments),l=d3.event.target,s=d3.event.touches?d3.event.changedTouches[0].identifier:null,f=t(),h=0,d=d3.select(window).on(s!=null?"touchmove.drag-"+s:"mousemove.drag",n).on(s!=null?"touchend.drag-"+s:"mouseup.drag",i,!0);r?(a=r.apply(o,arguments),a=[a.x-f[0],a.y-f[1]]):a=[0,0],s==null&&j(),c({type:"dragstart"})}var e=O(t,"drag","dragstart","dragend"),r=null;return t.origin=function(n){return arguments.length?(r=n,t):r},d3.rebind(t,e,"on")},d3.behavior.zoom=function(){function t(){this.on("mousedown.zoom",o).on("mousewheel.zoom",c).on("mousemove.zoom",l).on("DOMMouseScroll.zoom",c).on("dblclick.zoom",s).on("touchstart.zoom",f).on("touchmove.zoom",h).on("touchend.zoom",f)}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(w[0],Math.min(w[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(p.range().map(function(t){return(t-b[0])/x}).map(p.invert)),y&&y.domain(v.range().map(function(t){return(t-b[1])/x}).map(v.invert))}function a(t){u(),d3.event.preventDefault(),t({type:"zoom",scale:x,translate:b})}function o(){function t(){l=1,i(d3.mouse(u),f),a(o)}function e(){l&&j(),s.on("mousemove.zoom",null).on("mouseup.zoom",null),l&&d3.event.target===c&&s.on("click.zoom",r,!0)}function r(){j(),s.on("click.zoom",null)}var u=this,o=_.of(u,arguments),c=d3.event.target,l=0,s=d3.select(window).on("mousemove.zoom",t).on("mouseup.zoom",e),f=n(d3.mouse(u));window.focus(),j()}function c(){d||(d=n(d3.mouse(this))),r(Math.pow(2,Ve()*.002)*x),i(d3.mouse(this),d),a(_.of(this,arguments))}function l(){d=null}function s(){var t=d3.mouse(this),e=n(t),u=Math.log(x)/Math.LN2;r(Math.pow(2,d3.event.shiftKey?Math.ceil(u)-1:Math.floor(u)+1)),i(t,e),a(_.of(this,arguments))}function f(){var t=d3.touches(this),e=Date.now();if(g=x,d={},t.forEach(function(t){d[t.identifier]=n(t)}),j(),t.length===1){if(500>e-M){var u=t[0],o=n(t[0]);r(x*2),i(u,o),a(_.of(this,arguments))}M=e}}function h(){var t=d3.touches(this),n=t[0],e=d[n.identifier];if(u=t[1]){var u,o=d[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(d3.event.scale*g)}i(n,e),M=null,a(_.of(this,arguments))}var d,g,p,m,v,y,M,b=[0,0],x=1,w=Ua,_=O(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?(w=n==null?Ua:n.map(Number),t):w},t.x=function(n){return arguments.length?(m=n,p=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},d3.rebind(t,_,"on")};var Ya,Ua=[0,1/0];d3.layout={},d3.layout.bundle=function(){return function(t){var n=[],e=-1,r=t.length;while(r>++e)n.push(Xe(t[e]));return n}},d3.layout.chord=function(){function t(){var t,l,f,h,d,g={},p=[],m=d3.range(u),v=[];e=[],r=[],t=0,h=-1;while(u>++h){l=0,d=-1;while(u>++d)l+=i[h][d];p.push(l),v.push(d3.range(u)),t+=l}a&&m.sort(function(t,n){return a(p[t],p[n])}),o&&v.forEach(function(t,n){t.sort(function(t,e){return o(i[n][t],i[n][e])})}),t=(2*Nu-s*u)/t,l=0,h=-1;while(u>++h){f=l,d=-1;while(u>++d){var y=m[h],M=v[y][d],b=i[y][M],x=l,w=l+=b*t;g[y+"-"+M]={index:y,subindex:M,startAngle:x,endAngle:w,value:b}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/t},l+=s}h=-1;while(u>++h){d=h-1;while(u>++d){var _=g[h+"-"+d],k=g[d+"-"+h];(_.value||k.value)&&e.push(k.value>_.value?{source:k,target:_}:{source:_,target:k})}}c&&n()}function n(){e.sort(function(t,n){return c((t.source.value+t.target.value)/2,(n.source.value+n.target.value)/2)})}var e,r,i,u,a,o,c,l={},s=0;return l.matrix=function(t){return arguments.length?(u=(i=t)&&i.length,e=r=null,l):i},l.padding=function(t){return arguments.length?(s=t,e=r=null,l):s},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(c=t,e&&n(),l):c},l.chords=function(){return e||t(),e},l.groups=function(){return r||t(),r},l},d3.layout.force=function(){function t(t){return function(n,e,r,i){if(n.point!==t){var u=n.cx-t.x,a=n.cy-t.y,o=1/Math.sqrt(u*u+a*a);if(v>(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=d3.event.x,t.py=d3.event.y,c.resume()}var e,r,i,u,a,c={},s=d3.dispatch("start","tick","end"),f=[1,1],h=.9,d=Qe,g=tr,p=-30,m=.1,v=.8,y=[],M=[];return c.tick=function(){if(.005>(r*=.99))return s.end({type:"end",alpha:r=0}),!0;var n,e,o,c,l,d,g,v,b,x=y.length,w=M.length;for(e=0;w>e;++e)o=M[e],c=o.source,l=o.target,v=l.x-c.x,b=l.y-c.y,(d=v*v+b*b)&&(d=r*u[e]*((d=Math.sqrt(d))-i[e])/d,v*=d,b*=d,l.x-=v*(g=c.weight/(l.weight+c.weight)),l.y-=b*g,c.x+=v*(g=1-g),c.y+=b*g);if((g=r*m)&&(v=f[0]/2,b=f[1]/2,e=-1,g))while(x>++e)o=y[e],o.x+=(v-o.x)*g,o.y+=(b-o.y)*g;if(p){We(n=d3.geom.quadtree(y),r,a),e=-1;while(x>++e)(o=y[e]).fixed||n.visit(t(o))}e=-1;while(x>++e)o=y[e],o.fixed?(o.x=o.px,o.y=o.py):(o.x-=(o.px-(o.px=o.x))*h,o.y-=(o.py-(o.py=o.y))*h);s.tick({type:"tick",alpha:r})},c.nodes=function(t){return arguments.length?(y=t,c):y},c.links=function(t){return arguments.length?(M=t,c):M},c.size=function(t){return arguments.length?(f=t,c):f},c.linkDistance=function(t){return arguments.length?(d=l(t),c):d},c.distance=c.linkDistance,c.linkStrength=function(t){return arguments.length?(g=l(t),c):g},c.friction=function(t){return arguments.length?(h=t,c):h},c.charge=function(t){return arguments.length?(p=typeof t=="function"?t:+t,c):p},c.gravity=function(t){return arguments.length?(m=t,c):m},c.theta=function(t){return arguments.length?(v=t,c):v},c.alpha=function(t){return arguments.length?(r?r=t>0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),d3.timer(c.tick)),c):r},c.start=function(){function t(t,r){var i,u=n(e),a=-1,o=u.length;while(o>++a)if(!isNaN(i=u[a][t]))return i;return Math.random()*r}function n(){if(!o){for(o=[],r=0;s>r;++r)o[r]=[];for(r=0;h>r;++r){var t=M[r];o[t.source.index].push(t.target),o[t.target.index].push(t.source) +}}return o[e]}var e,r,o,l,s=y.length,h=M.length,m=f[0],v=f[1];for(e=0;s>e;++e)(l=y[e]).index=e,l.weight=0;for(i=[],u=[],e=0;h>e;++e)l=M[e],typeof l.source=="number"&&(l.source=y[l.source]),typeof l.target=="number"&&(l.target=y[l.target]),i[e]=d.call(this,l,e),u[e]=g.call(this,l,e),++l.source.weight,++l.target.weight;for(e=0;s>e;++e)l=y[e],isNaN(l.x)&&(l.x=t("x",m)),isNaN(l.y)&&(l.y=t("y",v)),isNaN(l.px)&&(l.px=l.x),isNaN(l.py)&&(l.py=l.y);if(a=[],typeof p=="function")for(e=0;s>e;++e)a[e]=+p.call(this,y[e],e);else for(e=0;s>e;++e)a[e]=p;return c.resume()},c.resume=function(){return c.alpha(.1)},c.stop=function(){return c.alpha(0)},c.drag=function(){e||(e=d3.behavior.drag().origin(o).on("dragstart",Ge).on("drag",n).on("dragend",$e)),this.on("mouseover.force",Je).on("mouseout.force",Ke).call(e)},d3.rebind(c,s,"on")},d3.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;r=n.value?r/n.value:0;while(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)){var i,u=-1;while(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=d3.layout.hierarchy(),i=[1,1];return e.size=function(t){return arguments.length?(i=t,e):i},hr(e,r)},d3.layout.pie=function(){function t(u){var a=u.map(function(e,r){return+n.call(t,e,r)}),o=+(typeof r=="function"?r.apply(this,arguments):r),c=((typeof i=="function"?i.apply(this,arguments):i)-r)/d3.sum(a),l=d3.range(u.length);e!=null&&l.sort(e===Ia?function(t,n){return a[n]-a[t]}:function(t,n){return e(u[t],u[n])});var s=[];return l.forEach(function(t){var n;s[t]={data:u[t],value:n=a[t],startAngle:o,endAngle:o+=n*c}}),s}var n=Number,e=Ia,r=0,i=2*Nu;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 Ia={};d3.layout.stack=function(){function t(o,c){var l=o.map(function(e,r){return n.call(t,e,r)}),s=l.map(function(n){return n.map(function(n,e){return[u.call(t,n,e),a.call(t,n,e)]})}),f=e.call(t,s,c);l=d3.permute(l,f),s=d3.permute(s,f);var h,d,g,p=r.call(t,s,c),m=l.length,v=l[0].length;for(d=0;v>d;++d)for(i.call(t,l[0][d],g=p[d],s[0][d][1]),h=1;m>h;++h)i.call(t,l[h][d],g+=s[h-1][d][1],s[h][d][1]);return o}var n=o,e=ir,r=ur,i=rr,u=nr,a=er;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(n){return arguments.length?(e=typeof n=="function"?n:Va.get(n)||ir,t):e},t.offset=function(n){return arguments.length?(r=typeof n=="function"?n:Xa.get(n)||ur,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 Va=d3.map({"inside-out":function(t){var n,e,r=t.length,i=t.map(ar),u=t.map(or),a=d3.range(r).sort(function(t,n){return i[t]-i[n]}),o=0,c=0,l=[],s=[];for(n=0;r>n;++n)e=a[n],c>o?(o+=u[e],l.push(e)):(c+=u[e],s.push(e));return s.reverse().concat(l)},reverse:function(t){return d3.range(t.length).reverse()},"default":ir}),Xa=d3.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,s=t.length,f=t[0],h=f.length,d=[];for(d[0]=c=l=0,e=1;h>e;++e){for(n=0,i=0;s>n;++n)i+=t[n][e][1];for(n=0,u=0,o=f[e][0]-f[e-1][0];s>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]}d[e]=c-=i?u/i*o:0,l>c&&(l=c)}for(e=0;h>e;++e)d[e]-=l;return d},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:ur});d3.layout.histogram=function(){function t(t,u){var a,o,c=[],l=t.map(e,this),s=r.call(this,l,u),f=i.call(this,s,l,u),u=-1,h=l.length,d=f.length-1,g=n?1:1/h;while(d>++u)a=c[u]=[],a.dx=f[u+1]-(a.x=f[u]),a.y=0;if(d>0){u=-1;while(h>++u)o=l[u],o>=s[0]&&s[1]>=o&&(a=c[d3.bisect(f,o,1,d)-1],a.y+=g,a.push(t[u]))}return c}var n=!0,e=Number,r=fr,i=lr;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=l(n),t):r},t.bins=function(n){return arguments.length?(i=typeof n=="number"?function(t){return sr(t,n)}:l(n),t):i},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},d3.layout.hierarchy=function(){function t(n,a,o){var c=i.call(e,n,a),l=Za?n:{data:n};if(l.depth=a,o.push(l),c&&(s=c.length)){var s,f,h=-1,d=l.children=[],g=0,p=a+1;while(s>++h)f=t(c[h],p,o),f.parent=l,d.push(f),g+=f.value;r&&d.sort(r),u&&(l.value=g)}else u&&(l.value=+u.call(e,n,a)||0);return l}function n(t,r){var i=t.children,a=0;if(i&&(o=i.length)){var o,c=-1,l=r+1;while(o>++c)a+=n(i[c],l)}else u&&(a=+u.call(e,Za?t:t.data,r)||0);return u&&(t.value=a),a}function e(n){var e=[];return t(n,0,e),e}var r=pr,i=dr,u=gr;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};var Za=!1;d3.layout.pack=function(){function t(t,i){var u=n.call(this,t,i),a=u[0];a.x=0,a.y=0,jr(a,function(t){t.r=Math.sqrt(t.value)}),jr(a,xr);var o=r[0],c=r[1],l=Math.max(2*a.r/o,2*a.r/c);if(e>0){var s=e*l/2;jr(a,function(t){t.r+=s}),jr(a,xr),jr(a,function(t){t.r-=s}),l=Math.max(2*a.r/o,2*a.r/c)}return kr(a,o/2,c/2,1/l),u}var n=d3.layout.hierarchy().sort(vr),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},hr(t,n)},d3.layout.cluster=function(){function t(t,i){var u,a=n.call(this,t,i),o=a[0],c=0;jr(o,function(t){var n=t.children;n&&n.length?(t.x=Nr(n),t.y=Ar(n)):(t.x=u?c+=e(t,u):0,t.y=0,u=t)});var l=Cr(o),s=Tr(o),f=l.x-e(l,s)/2,h=s.x+e(s,l)/2;return jr(o,function(t){t.x=(t.x-f)/(h-f)*r[0],t.y=(1-(o.y?t.y/o.y:1))*r[1]}),a}var n=d3.layout.hierarchy().sort(null).value(null),e=qr,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},hr(t,n)},d3.layout.tree=function(){function t(t,i){function u(t,n){var r=t.children,i=t._tree;if(r&&(a=r.length)){var a,c,l,s=r[0],f=s,h=-1;while(a>++h)l=r[h],u(l,c),f=o(l,c,f),c=l;Hr(t);var d=.5*(s._tree.prelim+l._tree.prelim);n?(i.prelim=n._tree.prelim+e(t,n),i.mod=i.prelim-d):i.prelim=d}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;n+=t._tree.mod;while(r>++i)a(e[i],n)}}function o(t,n,r){if(n){var i,u=t,a=t,o=n,c=t.parent.children[0],l=u._tree.mod,s=a._tree.mod,f=o._tree.mod,h=c._tree.mod;while(o=zr(o),u=Pr(u),o&&u)c=Pr(c),a=zr(a),a._tree.ancestor=t,i=o._tree.prelim+f-u._tree.prelim-l+e(o,u),i>0&&(Or(Rr(o,t,r),t,i),l+=i,s+=i),f+=o._tree.mod,l+=u._tree.mod,h+=c._tree.mod,s+=a._tree.mod;o&&!zr(a)&&(a._tree.thread=o,a._tree.mod+=f-s),u&&!Pr(c)&&(c._tree.thread=u,c._tree.mod+=l-h,r=t)}return r}var c=n.call(this,t,i),l=c[0];jr(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 s=Er(l,Dr),f=Er(l,Lr),h=Er(l,Fr),d=s.x-e(s,f)/2,g=f.x+e(f,s)/2,p=h.depth||1;return jr(l,function(t){t.x=(t.x-d)/(g-d)*r[0],t.y=t.depth/p*r[1],delete t._tree}),c}var n=d3.layout.hierarchy().sort(null).value(null),e=qr,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},hr(t,n)},d3.layout.treemap=function(){function t(t,n){var e,r,i=-1,u=t.length;while(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=f(e),s=[],h=u.slice(),g=1/0,p=d==="slice"?l.dx:d==="dice"||d==="slice-dice"&&e.depth&1?l.dy:Math.min(l.dx,l.dy);t(h,l.dx*l.dy/e.value),s.area=0;while((c=h.length)>0)s.push(a=h[c-1]),s.area+=a.area,d!=="squarify"||g>=(o=r(s,p))?(h.pop(),g=o):(s.area-=s.pop().area,i(s,p,l,!1),p=Math.min(l.dx,l.dy),s.length=s.area=0,g=1/0);s.length&&(i(s,p,l,!0),s.length=s.area=0),u.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var u,a=f(n),o=r.slice(),c=[];t(o,a.dx*a.dy/n.value),c.area=0;while(u=o.pop())c.push(u),c.area+=u.area,u.z!=null&&(i(c,u.z?a.dx:a.dy,a,!o.length),c.length=c.area=0);r.forEach(e)}}function r(t,n){var e,r=t.area,i=0,u=1/0,a=-1,o=t.length;while(o>++a)(e=t[a].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,n*=n,r?Math.max(n*i*g/r,r/(n*u*g)):1/0}function i(t,n,e,r){var i,u=-1,a=t.length,o=e.x,l=e.y,s=n?c(t.area/n):0;if(n==e.dx){(r||s>e.dy)&&(s=e.dy);while(a>++u)i=t[u],i.x=o,i.y=l,i.dy=s,o+=i.dx=Math.min(e.x+e.dx-o,s?c(i.area/s):0);i.z=!0,i.dx+=e.x+e.dx-o,e.y+=s,e.dy-=s}else{(r||s>e.dx)&&(s=e.dx);while(a>++u)i=t[u],i.x=o,i.y=l,i.dx=s,l+=i.dy=Math.min(e.y+e.dy-l,s?c(i.area/s):0);i.z=!1,i.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}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=d3.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Yr,h=!1,d="squarify",g=.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 e==null?Yr(n):Ur(n,typeof e=="number"?[e,e,e,e]:e)}function e(n){return Ur(n,t)}if(!arguments.length)return s;var r;return f=(s=t)==null?Yr:(r=typeof t)=="function"?n:r==="number"?(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?(g=t,u):g},u.mode=function(t){return arguments.length?(d=t+"",u):d},hr(u,o)},d3.csv=Ir(",","text/csv"),d3.tsv=Ir(" ","text/tab-separated-values"),d3.geo={};var Ba={Feature:function(t){var n=this.geometry(t.geometry);return n&&(t=Object.create(t),t.geometry=n,t)},FeatureCollection:function(t){var n,e,r=t.features,i=-1,u=r.length;while(u>++i)(e=this.Feature(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.features=n,t)},GeometryCollection:function(t){var n,e,r=t.geometries,i=-1,u=r.length;while(u>++i)(e=this.geometry(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.geometries=n,t)},LineString:function(t){var n=this.line(t.coordinates);return n&&(t=Object.create(t),t.coordinates=n,t)},MultiLineString:function(t){var n,e,r=t.coordinates,i=-1,u=r.length;while(u>++i)(e=this.line(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.coordinates=n,t)},MultiPoint:function(t){var n,e,r=t.coordinates,i=-1,u=r.length;while(u>++i)(e=this.point(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.coordinates=n,t)},MultiPolygon:function(t){var n,e,r=t.coordinates,i=-1,u=r.length;while(u>++i)(e=this.polygon(r[i]))&&(n?n.push(e):n=[e]);return n&&(t=Object.create(t),t.coordinates=n,t)},Point:function(t){var n=this.point(t.coordinates);return n&&(t=Object.create(t),t.coordinates=n,t)},Polygon:function(t){var n=this.polygon(t.coordinates);return n&&(t=Object.create(t),t.coordinates=n,t)},Sphere:Hn,geometry:function(t){return Ga.hasOwnProperty(t.type)?this[t.type](t):null},point:Hn,line:function(t){var n,e,r=-1,i=t.length;while(i>++r)(e=this.point(t[r]))&&(n?n.push(e):n=[e]);return n},polygon:function(t){var n,e,r=-1,i=t.length;while(i>++r)(e=this.line(t[r]))&&(n?n.push(e):n=[e]);return n}},Ga={LineString:1,MultiLineString:1,MultiPoint:1,MultiPolygon:1,Point:1,Polygon:1,Sphere:1},$a={Feature:1,FeatureCollection:1,GeometryCollection:1},Ja=Qr(o,ai,ci);d3.geo.albersUsa=function(){function t(t){return n(t)(t)}function n(t){var n=t[0],a=t[1];return a>50?r:-140>n?i:21>a?u:e}var e=d3.geo.albers(),r=d3.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),i=d3.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),u=d3.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);return t.point=function(t,e){return n(t).point(t,e)},t.line=function(t,e){return n(t[0]).line(t,e)},t.polygon=function(t,e){return n(t[0][0]).polygon(t,e)},t.scale=function(n){return arguments.length?(e.scale(n),r.scale(n*.6),i.scale(n),u.scale(n*1.5),t.translate(e.translate())):e.scale()},t.translate=function(n){if(!arguments.length)return e.translate();var a=e.scale(),o=n[0],c=n[1];return e.translate(n),r.translate([o-.4*a,c+.17*a]),i.translate([o-.19*a,c+.2*a]),u.translate([o+.58*a,c+.43*a]),t},t.scale(e.scale())},(d3.geo.albers=function(){var t=29.5*Pu,n=45.5*Pu,e=Ci(si),r=e(t,n);return r.parallels=function(r){return arguments.length?e(t=r[0]*Pu,n=r[1]*Pu):[t*zu,n*zu]},r.rotate([98,0]).center([0,38]).scale(1e3)}).raw=si;var Ka=Li(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(d3.geo.azimuthalEqualArea=function(){return Ni(Ka)}).raw=Ka;var Wa=Li(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},o);(d3.geo.azimuthalEquidistant=function(){return Ni(Wa)}).raw=Wa,d3.geo.bounds=fi(o),d3.geo.centroid=Wr({FeatureCollection:Hn,GeometryCollection:Hn,Feature:function(t){return this.geometry(t.geometry)},Point:function(t){return t.coordinates},MultiPoint:function(t){var n,e,r,i,u=t.coordinates,a=u.length,o=0,c=0,l=0,s=0;while(a>o)n=u[o++],e=n[0]*Pu,i=Math.cos(r=n[1]*Pu),c+=(i*Math.cos(e)-c)/o,l+=(i*Math.sin(e)-l)/o,s+=(Math.sin(r)-s)/o;return a?[Math.atan2(l,c)*zu,Math.asin(Math.max(-1,Math.min(1,s)))*zu]:null},LineString:function(t){var n,e,r,i=hi(t.coordinates);return i&&i[3]?[Math.atan2(e=i[1],n=i[0])*zu,Math.asin(Math.max(-1,Math.min(1,(r=i[2])/Math.sqrt(n*n+e*e+r*r))))*zu]:null},MultiLineString:function(t){var n=t.coordinates,e=n.length,r=-1,i=0,u=0,a=0,o=0;while(e>++r)centroid=hi(n[r]),centroid&&(i+=centroid[0],u+=centroid[1],a+=centroid[2],o+=centroid[3]);return o?[Math.atan2(u,i)*zu,Math.asin(Math.max(-1,Math.min(1,a/Math.sqrt(i*i+u*u+a*a))))*zu]:null},Polygon:function(t){return this.MultiLineString(t)},MultiPolygon:function(t){var n,e=t.coordinates,r=e.length,i=-1,u=0,a=0,o=0,c=0;while(r>++i){n=e[i];for(var l=0,s=n.length;s>l;++l)centroid=hi(n[l]),centroid&&(u+=centroid[0],a+=centroid[1],o+=centroid[2],c+=centroid[3])}return c?[Math.atan2(a,u)*zu,Math.asin(Math.max(-1,Math.min(1,o/Math.sqrt(u*u+a*a+o*o))))*zu]:null}}),d3.geo.circle=function(){function t(){var t=typeof i=="function"?i.apply(this,arguments):i;e=Ti(-t[0]*Pu,-t[1]*Pu,0);var n=r(null,null,1).map(function(t){return t=e.invert(t[0],t[1]),t[0]*=zu,t[1]*=zu,t});return{type:"Polygon",coordinates:[n]}}var n,e,r,i=[0,0],u=6;return t.origin=function(n){return arguments.length?(i=n,t):i},t.angle=function(e){return arguments.length?(r=gi((n=+e)*Pu,u*Pu),t):n},t.precision=function(e){return arguments.length?(r=gi(n*Pu,(u=+e)*Pu),t):u},t.angle(90)},(d3.geo.equirectangular=function(){return Ni(vi).scale(250/Nu)}).raw=vi.invert=vi;var Qa=Li(function(t){return 1/t},Math.atan);(d3.geo.gnomonic=function(){return Ni(Qa)}).raw=Qa,d3.geo.graticule=function(){function t(){return{type:"GeometryCollection",geometries:t.lines()}}var n,e,r,i,u,a,o=22.5,c=o,l=2.5;return t.lines=function(){return d3.range(Math.ceil(e/o)*o,n,o).map(u).concat(d3.range(Math.ceil(i/c)*c,r,c).map(a)).map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[u(e).concat(a(r).slice(1),u(n).reverse().slice(1),a(i).reverse().slice(1))]}},t.extent=function(u){return arguments.length?(e=+u[0][0],n=+u[1][0],i=+u[0][1],r=+u[1][1],e>n&&(u=e,e=n,n=u),i>r&&(u=i,i=r,r=u),t.precision(l)):[[e,i],[n,r]]},t.step=function(n){return arguments.length?(o=+n[0],c=+n[1],t):[o,c]},t.precision=function(o){return arguments.length?(l=+o,u=yi(i,r,l),a=Mi(e,n,l),t):l},t.extent([[-180+Cu,-90+Cu],[180-Cu,90-Cu]])},d3.geo.interpolate=function(t,n){return bi(t[0]*Pu,t[1]*Pu,n[0]*Pu,n[1]*Pu)},d3.geo.greatArc=function(){function t(){var t=r||a.apply(this,arguments),n=i||o.apply(this,arguments),e=u||d3.geo.interpolate(t,n),i=0,l=c/e.distance,s=[t];while(1>(i+=l))s.push(e(i));return s.push(n),{type:"LineString",coordinates:s}}var r,i,u,a=e,o=n,c=6*Pu;return t.distance=function(){return(u||d3.geo.interpolate(r||a.apply(this,arguments),i||o.apply(this,arguments))).distance},t.source=function(n){return arguments.length?(a=n,r=typeof n=="function"?null:n,u=r&&i?d3.geo.interpolate(r,i):null,t):a},t.target=function(n){return arguments.length?(o=n,i=typeof n=="function"?null:n,u=r&&i?d3.geo.interpolate(r,i):null,t):o},t.precision=function(n){return arguments.length?(c=n*Pu,t):c/Pu},t},xi.invert=function(t,n){return[2*Nu*t,2*Math.atan(Math.exp(2*Nu*n))-Nu/2]},(d3.geo.mercator=function(){return Ni(xi).scale(500)}).raw=xi;var to=Li(function(){return 1},Math.asin);(d3.geo.orthographic=function(){return Ni(to)}).raw=to,d3.geo.path=function(){function n(t){var n=null;return t!=n&&(typeof l=="function"&&(s=wi(l.apply(this,arguments))),t=f.object(t),t&&(c?d:g)(t),h.length&&(n=h.join(""),h=[])),n}function e(t){return t=f.object(t),t?t.type==="Polygon"?r(t.coordinates):d3.sum(t.coordinates,r):0}function r(t){return Math.abs(d3.sum(t,i))}function i(t){return d3.geom.polygon(t).area()}function u(t){var n,e,r,i=t.length,u=0,a=t[0],o=a[0],c=a[1],l=0,s=0,f=0;while(i>++u)a=t[u],n=a[0],e=a[1],r=c*n-o*e,l+=r*3,s+=r*(o+n),f+=r*(c+e),o=n,c=e;return[s,f,l]}function a(t){return function(n){var e,r=n.coordinates,i=0,u=0,a=0,o=-1,c=r.length;while(c>++o)e=t(r[o]),i+=e[0],u+=e[1],a+=e[2];return a?[i/a,u/a]:null}}var o,c,l=4.5,s=wi(l),f=d3.geo.albersUsa(),h=[],d=Wr({point:function(t){c.point(t[0],t[1])},line:function(t){if(n=t.length){var n,e=0,r=t[0];c.moveTo(r[0],r[1]);while(n>++e)c.lineTo((r=t[e])[0],r[1])}},polygon:function(t){var n,e,r,i,u=t.length,a=-1;while(u>++a)if(r=t[a],n=r.length-1){for(i=r[0],c.moveTo(i[0],i[1]),e=0;n>++e;)c.lineTo((i=r[e])[0],i[1]);c.closePath()}}}),g=Wr({point:function(t){h.push("M",t,s)},line:function(t){h.push("M",t.join("L"))},polygon:function(t){var n=-1,e=t.length;while(e>++n)this.line(t[n]),h.push("Z")}});n.area=Wr({Feature:function(t){return areaType.geometry(t.geometry)},FeatureCollection:function(t){return d3.sum(t.features,areaType.Feature)},GeometryCollection:function(t){return d3.sum(t.geometries,areaType.geometry)},LineString:t,MultiLineString:t,MultiPoint:t,MultiPolygon:e,Point:t,Polygon:e,Sphere:e}),n.bounds=function(t){return(o||(o=fi(f)))(t)},n.centroid=function(t){return(t=f.object(t))?p(t):null};var p=Wr({FeatureCollection:Hn,GeometryCollection:Hn,MultiLineString:a(function(t){var n,e,r,i,u,a=t.length,o=0,c=t[0],l=c[0],s=c[1],f=0,h=0,d=0;while(a>++o)c=t[o],n=c[0],e=c[1],r=n-l,i=e-s,f+=u=Math.sqrt(r*r+i*i),h+=u*(l+n)/2,d+=u*(s+e)/2,l=n,s=e;return[h,d,f]}),Point:function(t){return t.coordinates},MultiPoint:a(function(t){return[t[0],t[1],1]}),Polygon:a(u),MultiPolygon:a(function(t){for(var n,e=0,r=0,i=0,a=0,o=t.length;o>a;++a)n=u(t[a]),e+=n[0],r+=n[1],i+=n[2];return[e,r,i]})});return n.bounds=function(t){return(o||(o=fi(f)))(t)},n.projection=function(t){return arguments.length?(f=t,o=null,n):f},n.context=function(t){return arguments.length?(c=t,n):c},n.pointRadius=function(t){return arguments.length?(typeof t=="function"?l=t:s=wi(l=+t),n):l},n},d3.geo.area=Wr({Point:t,MultiPoint:t,LineString:t,MultiLineString:t,Polygon:function(t){return _i(t.coordinates)},MultiPolygon:function(t){return d3.sum(t.coordinates,_i)},Sphere:function(){return 4*Nu},Feature:function(t){return this.geometry(t.geometry)},FeatureCollection:function(t){var n=this;return d3.sum(t.features,function(t){return n.Feature(t)})},GeometryCollection:function(t){var n=this;return d3.sum(t.geometries,function(t){return n.geometry(t)})}}),d3.geo.projection=Ni,d3.geo.projectionMutator=Ci,d3.geo.rotation=function(t,n,e){var r=Ti(t*Pu,n*Pu,e*Pu);return Wr({point:function(t){return t=r(t[0]*Pu,t[1]*Pu),t[0]*=zu,t[1]*=zu,t}})},qi.invert=function(t,n){return[t,n]};var no=Li(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(d3.geo.stereographic=function(){return Ni(no)}).raw=no,d3.geom={},d3.geom.hull=function(t){if(3>t.length)return[];var n,e,r,i,u,a,o,c,l,s,f=t.length,h=f-1,d=[],g=[],p=0;for(n=1;f>n;++n)t[p][1]>t[n][1]?p=n:t[n][1]==t[p][1]&&(p=t[p][0]>t[n][0]?n:p);for(n=0;f>n;++n)n!==p&&(i=t[n][1]-t[p][1],r=t[n][0]-t[p][0],d.push({angle:Math.atan2(i,r),index:n}));for(d.sort(function(t,n){return t.angle-n.angle}),l=d[0].angle,c=d[0].index,o=0,n=1;h>n;++n)e=d[n].index,l==d[n].angle?(r=t[c][0]-t[p][0],i=t[c][1]-t[p][1],u=t[e][0]-t[p][0],a=t[e][1]-t[p][1],r*r+i*i>=u*u+a*a?d[n].index=-1:(d[o].index=-1,l=d[n].angle,o=n,c=e)):(l=d[n].angle,o=n,c=e);for(g.push(p),n=0,e=0;2>n;++e)d[e].index!==-1&&(g.push(d[e].index),n++);for(s=g.length;h>e;++e)if(d[e].index!==-1){while(!Di(g[s-2],g[s-1],d[e].index,t))--s;g[s++]=d[e].index}var m=[];for(n=0;s>n;++n)m.push(t[g[n]]);return m},d3.geom.polygon=function(t){return t.area=function(){var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];while(e>++n)r+=t[n-1][1]*t[n][0]-t[n-1][0]*t[n][1];return r*.5},t.centroid=function(n){var e,r,i=-1,u=t.length,a=0,o=0,c=t[u-1];arguments.length||(n=-1/(6*t.area()));while(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){var e,r,i,u,a,o,c=-1,l=t.length,s=t[l-1];while(l>++c){e=n.slice(),n.length=0,u=t[c],a=e[(i=e.length)-1],r=-1;while(i>++r)o=e[r],Fi(o,s,u)?(Fi(a,s,u)||n.push(ji(a,o,s,u)),n.push(o)):Fi(a,s,u)&&n.push(ji(a,o,s,u)),a=o;s=u}return n},t},d3.geom.voronoi=function(t){var n=t.map(function(){return[]}),e=1e6;return Hi(t,function(t){var r,i,u,a,o,c;t.a===1&&t.b>=0?(r=t.ep.r,i=t.ep.l):(r=t.ep.l,i=t.ep.r),t.a===1?(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],s=[a,c];n[t.region.l.index].push(l,s),n[t.region.r.index].push(l,s)}),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)});return d3.range(n.length).sort(function(t,n){return u[t]-u[n]}).filter(function(t,n,e){return!n||u[t]-u[e[n-1]]>Cu}).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],s=a[0],f=a[1],h=o[0],d=o[1],g=Math.abs(h-s),p=d-f;if(Cu>Math.abs(p)){var m=f>l?-e:e;n.push([-e,m],[e,m])}else if(Cu>g){var v=s>c?-e:e;n.push([v,-e],[v,e])}else{var m=(s-c)*(d-f)>(h-s)*(f-l)?e:-e,y=Math.abs(p)-g;Cu>Math.abs(y)?n.push([0>p?m:-m,m]):(y>0&&(m*=-1),n.push([-e,m],[e,m]))}}}),n};var eo={l:"r",r:"l"};d3.geom.delaunay=function(t){var n=t.map(function(){return[]}),e=[];return Hi(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},d3.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=(e+i)*.5,c=(r+a)*.5,l=n.x>=o,s=n.y>=c,f=(s<<1)+l;t.leaf=!1,t=t.nodes[f]||(t.nodes[f]=Oi()),l?e=o:i=o,s?r=c:a=c,u(t,n,e,r,i,a)}var o,c=-1,l=t.length;if(5>arguments.length)if(arguments.length===3)i=e,r=n,e=n=0;else{n=e=1/0,r=i=-1/0;while(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 s=r-n,f=i-e;s>f?i=e+s:r=n+f;var h=Oi();return h.add=function(t){u(h,t,n,e,r,i)},h.visit=function(t){Ri(t,h,n,e,r,i)},t.forEach(h.add),h},d3.time={};var ro=Date,io=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Yi.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(){uo.setUTCDate.apply(this._,arguments)},setDay:function(){uo.setUTCDay.apply(this._,arguments)},setFullYear:function(){uo.setUTCFullYear.apply(this._,arguments)},setHours:function(){uo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){uo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){uo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){uo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){uo.setUTCSeconds.apply(this._,arguments)},setTime:function(){uo.setTime.apply(this._,arguments)}};var uo=Date.prototype,ao="%a %b %e %X %Y",oo="%m/%d/%Y",co="%H:%M:%S",lo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],so=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fo=["January","February","March","April","May","June","July","August","September","October","November","December"],ho=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];d3.time.format=function(t){function n(n){var r,i,u,a=[],o=-1,c=0;while(e>++o)t.charCodeAt(o)===37&&(a.push(t.substring(c,o)),(i=bo[r=t.charAt(++o)])!=null&&(r=t.charAt(++o)),(u=xo[r])&&(r=u(n,i==null?r==="e"?" ":"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=Ui(e,t,n,0);if(r!=n.length)return null;"p"in e&&(e.H=e.H%12+e.p*12);var i=new ro;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 go=Ii(lo),po=Ii(so),mo=Ii(fo),vo=Vi(fo),yo=Ii(ho),Mo=Vi(ho),bo={"-":"",_:" ",0:"0"},xo={a:function(t){return so[t.getDay()]},A:function(t){return lo[t.getDay()]},b:function(t){return ho[t.getMonth()]},B:function(t){return fo[t.getMonth()]},c:d3.time.format(ao),d:function(t,n){return Xi(t.getDate(),n,2)},e:function(t,n){return Xi(t.getDate(),n,2)},H:function(t,n){return Xi(t.getHours(),n,2)},I:function(t,n){return Xi(t.getHours()%12||12,n,2)},j:function(t,n){return Xi(1+d3.time.dayOfYear(t),n,3)},L:function(t,n){return Xi(t.getMilliseconds(),n,3)},m:function(t,n){return Xi(t.getMonth()+1,n,2)},M:function(t,n){return Xi(t.getMinutes(),n,2)},p:function(t){return t.getHours()>=12?"PM":"AM"},S:function(t,n){return Xi(t.getSeconds(),n,2)},U:function(t,n){return Xi(d3.time.sundayOfYear(t),n,2)},w:function(t){return t.getDay()},W:function(t,n){return Xi(d3.time.mondayOfYear(t),n,2)},x:d3.time.format(oo),X:d3.time.format(co),y:function(t,n){return Xi(t.getFullYear()%100,n,2)},Y:function(t,n){return Xi(t.getFullYear()%1e4,n,4)},Z:lu,"%":function(){return"%"}},wo={a:Zi,A:Bi,b:Gi,B:$i,c:Ji,d:ru,e:ru,H:iu,I:iu,L:ou,m:eu,M:uu,p:cu,S:au,x:Ki,X:Wi,y:tu,Y:Qi},_o=/^\s*\d+/,ko=d3.map({am:0,pm:1});d3.time.format.utc=function(t){function n(t){try{ro=Yi;var n=new ro;return n._=t,e(n)}finally{ro=Date}}var e=d3.time.format(t);return n.parse=function(t){try{ro=Yi;var n=e.parse(t);return n&&n._}finally{ro=Date}},n.toString=e.toString,n};var So=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?su:So,su.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},su.toString=So.toString,d3.time.second=fu(function(t){return new ro(Math.floor(t/1e3)*1e3)},function(t,n){t.setTime(t.getTime()+Math.floor(n)*1e3)},function(t){return t.getSeconds()}),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=fu(function(t){return new ro(Math.floor(t/6e4)*6e4)},function(t,n){t.setTime(t.getTime()+Math.floor(n)*6e4)},function(t){return t.getMinutes()}),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=fu(function(t){var n=t.getTimezoneOffset()/60;return new ro((Math.floor(t/36e5-n)+n)*36e5)},function(t,n){t.setTime(t.getTime()+Math.floor(n)*36e5)},function(t){return t.getHours()}),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=fu(function(t){var n=new ro(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}),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(t){var n=d3.time.year(t);return Math.floor((t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*6e4)/864e5)},io.forEach(function(t,n){t=t.toLowerCase(),n=7-n;var e=d3.time[t]=fu(function(t){return(t=d3.time.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+Math.floor(n)*7)},function(t){var e=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});d3.time[t+"s"]=e.range,d3.time[t+"s"].utc=e.utc.range,d3.time[t+"OfYear"]=function(t){var e=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(e+n)%7)/7)}}),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=fu(function(t){return t=d3.time.day(t),t.setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=fu(function(t){return t=d3.time.day(t),t.setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var Ao=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],No=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],Co=[[d3.time.format("%Y"),c],[d3.time.format("%B"),function(t){return t.getMonth()}],[d3.time.format("%b %d"),function(t){return t.getDate()!=1}],[d3.time.format("%a %d"),function(t){return t.getDay()&&t.getDate()!=1}],[d3.time.format("%I %p"),function(t){return t.getHours()}],[d3.time.format("%I:%M"),function(t){return t.getMinutes()}],[d3.time.format(":%S"),function(t){return t.getSeconds()}],[d3.time.format(".%L"),function(t){return t.getMilliseconds()}]],To=d3.scale.linear(),qo=mu(Co);No.year=function(t,n){return To.domain(t.map(yu)).ticks(n).map(vu)},d3.time.scale=function(){return du(d3.scale.linear(),No,qo)};var Po=No.map(function(t){return[t[0].utc,t[1]]}),zo=[[d3.time.format.utc("%Y"),c],[d3.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(t){return t.getUTCDate()!=1}],[d3.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&t.getUTCDate()!=1}],[d3.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]],Eo=mu(zo);Po.year=function(t,n){return To.domain(t.map(bu)).ticks(n).map(Mu)},d3.time.scale.utc=function(){return du(d3.scale.linear(),Po,Eo)}})() \ No newline at end of file diff --git a/src/geo/projection.js b/src/geo/projection.js index 60c8bbaa..e1a405e4 100644 --- a/src/geo/projection.js +++ b/src/geo/projection.js @@ -20,10 +20,9 @@ function d3_geo_projectionMutator(projectAt) { δγ = 0, δx, // center δy, - δ2 = .5, // precision, px² - maxDepth = 16, clip = d3_geo_cut, // TODO rename: it's often cutting, not clipping! - clipAngle = null; + clipAngle = null, + resample = d3_geo_resample(projectPoint); function projection(coordinates) { coordinates = projectRotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); @@ -77,11 +76,7 @@ function d3_geo_projectionMutator(projectAt) { return reset(); }; - projection.precision = function(_) { - if (!arguments.length) return Math.sqrt(δ2); - maxDepth = (δ2 = _ * _) > 0 && 16; - return projection; - }; + d3.rebind(projection, resample, "precision"); function reset() { projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); @@ -91,29 +86,6 @@ function d3_geo_projectionMutator(projectAt) { return projection; } - // TODO extract resampling from projection (say, d3_geo_resample?) - // TODO rename: this is not just resampling, it also projects and transforms! - var resample = d3_geo_type({ - Point: function(o) { - o.coordinates = resamplePoint(o.coordinates); - }, - MultiPoint: function(o) { - o.coordinates = o.coordinates.map(resamplePoint); - }, - LineString: function(o) { - o.coordinates = resampleLine(o.coordinates); - }, - MultiLineString: function(o) { - o.coordinates = o.coordinates.map(resampleLine); - }, - Polygon: function(o) { - o.coordinates = resamplePolygon(o.coordinates); - }, - MultiPolygon: function(o) { - o.coordinates = o.coordinates.map(resamplePolygon); - } - }); - // TODO rename: this is not just rotation, it also converts to radians! // TODO don't create new objects for rotation? (since clipping does the same?) // TODO don't call rotate when rotate is a no-op @@ -132,88 +104,6 @@ function d3_geo_projectionMutator(projectAt) { return [point[0] * k + δx, δy - point[1] * k]; } - // TODO rename: this is not just resampling, it also projects and transforms! - function resamplePoint(point) { - return projectPoint(point[0], point[1]); - } - - // TODO rename: this is not just resampling, it also projects and transforms! - function resampleLine(coordinates) { - if (!(n = coordinates.length)) return coordinates; - var n, - i = 0, - p = coordinates[0], - λ, - φ, - λ0, - line = [p = projectPoint(λ0 = p[0], φ = p[1])], - sinφ0 = Math.sin(φ), - cosφ0 = Math.cos(φ), - x0 = p[0], - y0 = p[1]; - while (++i < n) { - p = coordinates[i]; - p = projectPoint(λ = p[0], φ = p[1]); - resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, - x0 = p[0], y0 = p[1], λ0 = λ, sinφ0 = Math.sin(φ), cosφ0 = Math.cos(φ), - maxDepth, line); - line.push([x0, y0]); - } - return line; - } - - // TODO rename: this is not just resampling, it also projects and transforms! - function resamplePolygon(coordinates) { - var n = coordinates.length, - i = -1, - polygon = [], - ring, - resampled, - l, - m, - p; - while (++i < n) { - polygon.push(resampled = resampleLine(ring = coordinates[i])); - m = ring.length - 1; - l = resampled.length - 1; - resampleLineTo( - (p = ring[0])[0], p[1], (p = resampled[0])[0], Math.sin(p[1]), Math.cos(p[1]), - (p = ring[m])[0], p[1], (p = resampled[l])[0], Math.sin(p[1]), Math.cos(p[1]), - maxDepth, ring); - } - return polygon; - } - - // TODO rename: this is not just resampling, it also projects and transforms! - function resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x1, y1, λ1, sinφ1, cosφ1, depth, line) { - var dx = x1 - x0, - dy = y1 - y0, - distance2 = dx * dx + dy * dy; - if (distance2 > 4 * δ2 && depth--) { - var cosΩ = sinφ0 * sinφ1 + cosφ0 * cosφ1 * Math.cos(λ1 - λ0), - k = 1 / (Math.SQRT2 * Math.sqrt(1 + cosΩ)), - x = k * (cosφ0 * Math.cos(λ0) + cosφ1 * Math.cos(λ1)), - y = k * (cosφ0 * Math.sin(λ0) + cosφ1 * Math.sin(λ1)), - z = Math.max(-1, Math.min(1, k * (sinφ0 + sinφ1))), - φ2 = Math.asin(z), - zε = Math.abs(Math.abs(z) - 1), - λ2 = zε < ε || zε < εε && (Math.abs(cosφ0) < εε || Math.abs(cosφ1) < εε) - ? (λ0 + λ1) / 2 : Math.atan2(y, x), - p = projectPoint(λ2, φ2), - x2 = p[0], - y2 = p[1], - dx2 = x0 - x2, - dy2 = y0 - y2, - dz = dx * dy2 - dy * dx2; - if (dz * dz / distance2 > δ2) { - var cosφ2 = Math.cos(φ2); - resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x2, y2, λ2, z, cosφ2, depth, line); - line.push([x2, y2]); - resampleLineTo(x2, y2, λ2, z, cosφ2, x1, y1, λ1, sinφ1, cosφ1, depth, line); - } - } - } - return function() { project = projectAt.apply(this, arguments); projection.invert = project.invert && invert; diff --git a/src/geo/resample.js b/src/geo/resample.js new file mode 100644 index 00000000..21d113ff --- /dev/null +++ b/src/geo/resample.js @@ -0,0 +1,116 @@ +function d3_geo_resample(projectPoint) { + var δ2 = .5, // precision, px² + maxDepth = 16; + + // TODO rename: this is not just resampling, it also projects and transforms! + var resample = d3_geo_type({ + Point: function(o) { + o.coordinates = resamplePoint(o.coordinates); + }, + MultiPoint: function(o) { + o.coordinates = o.coordinates.map(resamplePoint); + }, + LineString: function(o) { + o.coordinates = resampleLine(o.coordinates); + }, + MultiLineString: function(o) { + o.coordinates = o.coordinates.map(resampleLine); + }, + Polygon: function(o) { + o.coordinates = resamplePolygon(o.coordinates); + }, + MultiPolygon: function(o) { + o.coordinates = o.coordinates.map(resamplePolygon); + } + }); + + resample.precision = function(_) { + if (!arguments.length) return Math.sqrt(δ2); + maxDepth = (δ2 = _ * _) > 0 && 16; + return resample; + }; + + return resample; + + // TODO rename: this is not just resampling, it also projects and transforms! + function resamplePoint(point) { + return projectPoint(point[0], point[1]); + } + + // TODO rename: this is not just resampling, it also projects and transforms! + function resampleLine(coordinates) { + if (!(n = coordinates.length)) return coordinates; + var n, + i = 0, + p = coordinates[0], + λ, + φ, + λ0, + line = [p = projectPoint(λ0 = p[0], φ = p[1])], + sinφ0 = Math.sin(φ), + cosφ0 = Math.cos(φ), + x0 = p[0], + y0 = p[1]; + while (++i < n) { + p = coordinates[i]; + p = projectPoint(λ = p[0], φ = p[1]); + resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, + x0 = p[0], y0 = p[1], λ0 = λ, sinφ0 = Math.sin(φ), cosφ0 = Math.cos(φ), + maxDepth, line); + line.push([x0, y0]); + } + return line; + } + + // TODO rename: this is not just resampling, it also projects and transforms! + function resamplePolygon(coordinates) { + var n = coordinates.length, + i = -1, + polygon = [], + ring, + resampled, + l, + m, + p; + while (++i < n) { + polygon.push(resampled = resampleLine(ring = coordinates[i])); + m = ring.length - 1; + l = resampled.length - 1; + resampleLineTo( + (p = ring[0])[0], p[1], (p = resampled[0])[0], Math.sin(p[1]), Math.cos(p[1]), + (p = ring[m])[0], p[1], (p = resampled[l])[0], Math.sin(p[1]), Math.cos(p[1]), + maxDepth, ring); + } + return polygon; + } + + // TODO rename: this is not just resampling, it also projects and transforms! + function resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x1, y1, λ1, sinφ1, cosφ1, depth, line) { + var dx = x1 - x0, + dy = y1 - y0, + distance2 = dx * dx + dy * dy; + if (distance2 > 4 * δ2 && depth--) { + var cosΩ = sinφ0 * sinφ1 + cosφ0 * cosφ1 * Math.cos(λ1 - λ0), + k = 1 / (Math.SQRT2 * Math.sqrt(1 + cosΩ)), + x = k * (cosφ0 * Math.cos(λ0) + cosφ1 * Math.cos(λ1)), + y = k * (cosφ0 * Math.sin(λ0) + cosφ1 * Math.sin(λ1)), + z = Math.max(-1, Math.min(1, k * (sinφ0 + sinφ1))), + φ2 = Math.asin(z), + zε = Math.abs(Math.abs(z) - 1), + λ2 = zε < ε || zε < εε && (Math.abs(cosφ0) < εε || Math.abs(cosφ1) < εε) + ? (λ0 + λ1) / 2 : Math.atan2(y, x), + p = projectPoint(λ2, φ2), + x2 = p[0], + y2 = p[1], + dx2 = x0 - x2, + dy2 = y0 - y2, + dz = dx * dy2 - dy * dx2; + if (dz * dz / distance2 > δ2) { + var cosφ2 = Math.cos(φ2); + resampleLineTo(x0, y0, λ0, sinφ0, cosφ0, x2, y2, λ2, z, cosφ2, depth, line); + line.push([x2, y2]); + resampleLineTo(x2, y2, λ2, z, cosφ2, x1, y1, λ1, sinφ1, cosφ1, depth, line); + } + } + } +}