Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active August 5, 2020 20:39
Show Gist options
  • Save mbostock/721f6275d7471defd12d to your computer and use it in GitHub Desktop.
Save mbostock/721f6275d7471defd12d to your computer and use it in GitHub Desktop.
Back-facing Hemisphere
license: gpl-3.0

Testing a prototype new graphics pipeline for d3.geo. The red lines are the front hemisphere, while the gray lines are the back hemisphere. Back-hemisphere clipping is achieved by first clipping around the antipode of the front hemisphere, and then applying an additional rotation.

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