Skip to content

Instantly share code, notes, and snippets.

@rveciana
Last active October 18, 2016 15:25
Show Gist options
  • Save rveciana/0e73c92391def44331d2069755edc199 to your computer and use it in GitHub Desktop.
Save rveciana/0e73c92391def44331d2069755edc199 to your computer and use it in GitHub Desktop.
Using rollup with d3-composite-projections

This example is part of this blog entry and shows how to use rollup to create a custom bundle with the library d3-composite-projections.

To use this example, just download the files from the gist

git clone https://gist.github.com/0e73c92391def44331d2069755edc199.git

and then:

npm install
npm run build

I took the information from this post by Richa Vyas.

import { geoConicConformalSpain } from "d3-composite-projections";
import { geoPath } from "d3-geo";
import { json } from "d3-request";
import { select } from "d3-selection";
import { transition } from "d3-transition";
import { feature } from "topojson";
export default {
geoConicConformalSpain: geoConicConformalSpain,
geoPath: geoPath,
json: json,
select: select,
transition: transition,
feature: feature
};
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define("d3",n):t.d3=n()}(this,function(){"use strict";function t(){return new n}function n(){this.reset()}function e(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}function r(t){return t>1?0:t<-1?no:Math.acos(t)}function i(t){return t>1?eo:t<-1?-eo:Math.asin(t)}function o(){}function u(t,n){t&&wo.hasOwnProperty(t.type)&&wo[t.type](t,n)}function a(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function s(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)a(t[e],n,1);n.polygonEnd()}function l(t,n){t&&mo.hasOwnProperty(t.type)?mo[t.type](t,n):u(t,n)}function c(t){return[lo(t[1],t[0]),i(t[2])]}function f(t){var n=t[0],e=t[1],r=co(e);return[r*co(n),r*vo(n),vo(e)]}function h(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function p(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function d(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function v(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function g(t){var n=yo(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function y(t,n){Qi.push(Ki=[Yi=t,Gi=t]),n<Hi&&(Hi=n),n>Ui&&(Ui=n)}function _(t,n){return(n-=t)<0?n+360:n}function m(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return e=n.invert(e,r),e&&t.invert(e[0],e[1])}),e}function w(t,n){return[t>no?t-io:t<-no?t+io:t,n]}function b(t,n,e){return(t%=io)?n||e?m(M(t),E(n,e)):M(t):n||e?E(n,e):w}function x(t){return function(n,e){return n+=t,[n>no?n-io:n<-no?n+io:n,e]}}function M(t){var n=x(t);return n.invert=x(-t),n}function E(t,n){function e(t,n){var e=co(n),s=co(t)*e,l=vo(t)*e,c=vo(n),f=c*r+s*o;return[lo(l*u-f*a,s*r-c*o),i(f*u+l*a)]}var r=co(t),o=vo(t),u=co(n),a=vo(n);return e.invert=function(t,n){var e=co(n),s=co(t)*e,l=vo(t)*e,c=vo(n),f=c*u-l*a;return[lo(l*u+c*a,s*r+f*o),i(f*r-s*o)]},e}function S(t,n,e,r,i,o){if(e){var u=co(n),a=vo(n),s=r*e;null==i?(i=n+r*io,o=n-s/2):(i=N(u,i),o=N(u,o),(r>0?i<o:i>o)&&(i+=r*io));for(var l,f=i;r>0?f>o:f<o;f-=s)l=c([u,-a*co(f),-a*vo(f)]),t.point(l[0],l[1])}}function N(t,n){n=f(n),n[0]-=t,g(n);var e=r(-n[1]);return((-n[2]<0?-e:e)+io-to)%io}function A(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:o,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function k(t,n,e,r,i,o){var u,a=t[0],s=t[1],l=n[0],c=n[1],f=0,h=1,p=l-a,d=c-s;if(u=e-a,p||!(u>0)){if(u/=p,p<0){if(u<f)return;u<h&&(h=u)}else if(p>0){if(u>h)return;u>f&&(f=u)}if(u=i-a,p||!(u<0)){if(u/=p,p<0){if(u>h)return;u>f&&(f=u)}else if(p>0){if(u<f)return;u<h&&(h=u)}if(u=r-s,d||!(u>0)){if(u/=d,d<0){if(u<f)return;u<h&&(h=u)}else if(d>0){if(u>h)return;u>f&&(f=u)}if(u=o-s,d||!(u<0)){if(u/=d,d<0){if(u>h)return;u>f&&(f=u)}else if(d>0){if(u<f)return;u<h&&(h=u)}return f>0&&(t[0]=a+f*p,t[1]=s+f*d),h<1&&(n[0]=a+h*p,n[1]=s+h*d),!0}}}}}function P(t,n){return ao(t[0]-n[0])<to&&ao(t[1]-n[1])<to}function C(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function T(t,n,e,r,i){var o,u,a=[],s=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],u=t[n];if(P(r,u)){for(i.lineStart(),o=0;o<n;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a.push(e=new C(r,t,null,!0)),s.push(e.o=new C(r,null,e,!1)),a.push(e=new C(u,t,null,!1)),s.push(e.o=new C(u,null,e,!0))}}),a.length){for(s.sort(n),q(a),q(s),o=0,u=s.length;o<u;++o)s[o].e=e=!e;for(var l,c,f=a[0];;){for(var h=f,p=!0;h.v;)if((h=h.n)===f)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,u=l.length;o<u;++o)i.point((c=l[o])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(l=h.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,l=h.z,p=!p}while(!h.v);i.lineEnd()}}}function q(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.n=e=t[r],e.p=i,i=e;i.n=e=t[0],e.p=i}}function O(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function j(t){return 1===t.length&&(t=L(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}function L(t){return function(n,e){return O(t(n),e)}}function I(t){for(var n,e,r,i=t.length,o=-1,u=0;++o<i;)u+=t[o].length;for(e=new Array(u);--i>=0;)for(r=t[i],n=r.length;--n>=0;)e[--u]=r[n];return e}function R(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,a,l){var c=0,f=0;if(null==i||(c=u(i,a))!==(f=u(o,a))||s(i,o)<0^a>0){do l.point(0===c||3===c?t:e,c>1?r:n);while((c=(c+a+4)%4)!==f)}else l.point(o[0],o[1])}function u(r,i){return ao(r[0]-t)<to?i>0?0:3:ao(r[0]-e)<to?i>0?2:1:ao(r[1]-n)<to?i>0?1:0:i>0?3:2}function a(t,n){return s(t.x,n.x)}function s(t,n){var e=u(t,1),r=u(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(u){function s(t,n){i(t,n)&&N.point(t,n)}function l(){for(var n=0,e=0,i=g.length;e<i;++e)for(var o,u,a=g[e],s=1,l=a.length,c=a[0],f=c[0],h=c[1];s<l;++s)o=f,u=h,c=a[s],f=c[0],h=c[1],u<=r?h>r&&(f-o)*(r-u)>(h-u)*(t-o)&&++n:h<=r&&(f-o)*(r-u)<(h-u)*(t-o)&&--n;return n}function c(){N=P,v=[],g=[],S=!0}function f(){var t=l(),n=S&&t,e=(v=I(v)).length;(n||e)&&(u.polygonStart(),n&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),e&&T(v,a,t,o,u),u.polygonEnd()),N=u,v=g=y=null}function h(){C.point=d,g&&g.push(y=[]),E=!0,M=!1,b=x=NaN}function p(){v&&(d(_,m),w&&M&&P.rejoin(),v.push(P.result())),C.point=s,M&&N.lineEnd()}function d(o,u){var a=i(o,u);if(g&&y.push([o,u]),E)_=o,m=u,w=a,E=!1,a&&(N.lineStart(),N.point(o,u));else if(a&&M)N.point(o,u);else{var s=[b=Math.max(xo,Math.min(bo,b)),x=Math.max(xo,Math.min(bo,x))],l=[o=Math.max(xo,Math.min(bo,o)),u=Math.max(xo,Math.min(bo,u))];k(s,l,t,n,e,r)?(M||(N.lineStart(),N.point(s[0],s[1])),N.point(l[0],l[1]),a||N.lineEnd(),S=!1):a&&(N.lineStart(),N.point(o,u),S=!1)}b=o,x=u,M=a}var v,g,y,_,m,w,b,x,M,E,S,N=u,P=A(),C={point:s,lineStart:h,lineEnd:p,polygonStart:c,polygonEnd:f};return C}}function X(t){return t}function z(t,n){t<Mo&&(Mo=t),t>So&&(So=t),n<Eo&&(Eo=n),n>No&&(No=n)}function V(t,n){var e=n[0],r=n[1],o=[vo(e),-co(e),0],u=0,a=0;ko.reset();for(var s=0,l=t.length;s<l;++s)if(h=(c=t[s]).length)for(var c,h,d=c[h-1],v=d[0],y=d[1]/2+ro,_=vo(y),m=co(y),w=0;w<h;++w,v=x,_=E,m=S,d=b){var b=c[w],x=b[0],M=b[1]/2+ro,E=vo(M),S=co(M),N=x-v,A=N>=0?1:-1,k=A*N,P=k>no,C=_*E;if(ko.add(lo(C*A*vo(k),m*S+C*co(k))),u+=P?N+A*io:N,P^v>=e^x>=e){var T=p(f(d),f(b));g(T);var q=p(o,T);g(q);var O=(P^N>=0?-1:1)*i(q[2]);(r>O||r===O&&(T[0]||T[1]))&&(a+=P^N>=0?1:-1)}}return(u<-to||u<to&&ko<-to)^1&a}function D(t,n,e,r){return function(i,o){function u(n,e){var r=i(n,e);t(n=r[0],e=r[1])&&o.point(n,e)}function a(t,n){var e=i(t,n);g.point(e[0],e[1])}function s(){b.point=a,g.lineStart()}function l(){b.point=u,g.lineEnd()}function c(t,n){v.push([t,n]);var e=i(t,n);m.point(e[0],e[1])}function f(){m.lineStart(),v=[]}function h(){c(v[0][0],v[0][1]),m.lineEnd();var t,n,e,r,i=m.clean(),u=_.result(),a=u.length;if(v.pop(),p.push(v),v=null,a)if(1&i){if(e=u[0],(n=e.length-1)>0){for(w||(o.polygonStart(),w=!0),o.lineStart(),t=0;t<n;++t)o.point((r=e[t])[0],r[1]);o.lineEnd()}}else a>1&&2&i&&u.push(u.pop().concat(u.shift())),d.push(u.filter($))}var p,d,v,g=n(o),y=i.invert(r[0],r[1]),_=A(),m=n(_),w=!1,b={point:u,lineStart:s,lineEnd:l,polygonStart:function(){b.point=c,b.lineStart=f,b.lineEnd=h,d=[],p=[]},polygonEnd:function(){b.point=u,b.lineStart=s,b.lineEnd=l,d=I(d);var t=V(p,y);d.length?(w||(o.polygonStart(),w=!0),T(d,B,t,e,o)):t&&(w||(o.polygonStart(),w=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),w&&(o.polygonEnd(),w=!1),d=p=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return b}}function $(t){return t.length>1}function B(t,n){return((t=t.x)[0]<0?t[1]-eo-to:eo-t[1])-((n=n.x)[0]<0?n[1]-eo-to:eo-n[1])}function F(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,u){var a=o>0?no:-no,s=ao(o-e);ao(s-no)<to?(t.point(e,r=(r+u)/2>0?eo:-eo),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),n=0):i!==a&&s>=no&&(ao(e-i)<to&&(e-=i*to),ao(o-a)<to&&(o-=a*to),r=Y(e,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=o,r=u),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}function Y(t,n,e,r){var i,o,u=vo(t-e);return ao(u)>to?so((vo(n)*(o=co(r))*vo(e)-vo(r)*(i=co(n))*vo(t))/(i*o*u)):(n+r)/2}function H(t,n,e,r){var i;if(null==t)i=e*eo,r.point(-no,i),r.point(0,i),r.point(no,i),r.point(no,0),r.point(no,-i),r.point(0,-i),r.point(-no,-i),r.point(-no,0),r.point(-no,i);else if(ao(t[0]-n[0])>to){var o=t[0]<n[0]?no:-no;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])}function G(t,n){function e(e,r,i,o){S(o,t,n,i,e,r)}function r(t,n){return co(t)*co(n)>a}function i(t){var n,e,i,a,c;return{lineStart:function(){a=i=!1,c=1},point:function(f,h){var p,d=[f,h],v=r(f,h),g=s?v?0:u(f,h):v?u(f+(f<0?no:-no),h):0;if(!n&&(a=i=v)&&t.lineStart(),v!==i&&(p=o(n,d),(P(n,p)||P(d,p))&&(d[0]+=to,d[1]+=to,v=r(d[0],d[1]))),v!==i)c=0,v?(t.lineStart(),p=o(d,n),t.point(p[0],p[1])):(p=o(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(l&&n&&s^v){var y;g&e||!(y=o(d,n,!0))||(c=0,s?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&P(n,d)||t.point(d[0],d[1]),n=d,i=v,e=g},lineEnd:function(){i&&t.lineEnd(),n=null},clean:function(){return c|(a&&i)<<1}}}function o(t,n,e){var r=f(t),i=f(n),o=[1,0,0],u=p(r,i),s=h(u,u),l=u[0],g=s-l*l;if(!g)return!e&&t;var y=a*s/g,_=-a*l/g,m=p(o,u),w=v(o,y),b=v(u,_);d(w,b);var x=m,M=h(w,x),E=h(x,x),S=M*M-E*(h(w,w)-1);if(!(S<0)){var N=yo(S),A=v(x,(-M-N)/E);if(d(A,w),A=c(A),!e)return A;var k,P=t[0],C=n[0],T=t[1],q=n[1];C<P&&(k=P,P=C,C=k);var O=C-P,j=ao(O-no)<to,L=j||O<to;if(!j&&q<T&&(k=T,T=q,q=k),L?j?T+q>0^A[1]<(ao(A[0]-P)<to?T:q):T<=A[1]&&A[1]<=q:O>no^(P<=A[0]&&A[0]<=C)){var I=v(x,(-M+N)/E);return d(I,w),[A,c(I)]}}}function u(n,e){var r=s?t:no-t,i=0;return n<-r?i|=1:n>r&&(i|=2),e<-r?i|=4:e>r&&(i|=8),i}var a=co(t),s=a>0,l=ao(a)>to;return D(r,i,e,s?[0,-t]:[-no,t-no])}function U(t){function n(){}var e=n.prototype=Object.create(Z.prototype);for(var r in t)e[r]=t[r];return function(t){var e=new n;return e.stream=t,e}}function Z(){}function J(t,n,e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),l(e,t.stream(Ao));var u=Ao.result(),a=Math.min(r/(u[1][0]-u[0][0]),i/(u[1][1]-u[0][1])),s=+n[0][0]+(r-a*(u[1][0]+u[0][0]))/2,c=+n[0][1]+(i-a*(u[1][1]+u[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([s,c])}function Q(t){return function(n,e){return J(t,[[0,0],n],e)}}function K(t){return function(n,e){return J(t,n,e)}}function W(t,n){return+n?nt(t,n):tt(t)}function tt(t){return U({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function nt(t,n){function e(r,o,u,a,s,l,c,f,h,p,d,v,g,y){var _=c-r,m=f-o,w=_*_+m*m;if(w>4*n&&g--){var b=a+p,x=s+d,M=l+v,E=yo(b*b+x*x+M*M),S=i(M/=E),N=ao(ao(M)-1)<to||ao(u-h)<to?(u+h)/2:lo(x,b),A=t(N,S),k=A[0],P=A[1],C=k-r,T=P-o,q=m*C-_*T;(q*q/w>n||ao((_*C+m*T)/w-.5)>.3||a*p+s*d+l*v<To)&&(e(r,o,u,a,s,l,k,P,N,b/=E,x/=E,M,g,y),y.point(k,P),e(k,P,N,b,x,M,c,f,h,p,d,v,g,y))}}return function(n){function r(e,r){e=t(e,r),n.point(e[0],e[1])}function i(){_=NaN,M.point=o,n.lineStart()}function o(r,i){var o=f([r,i]),u=t(r,i);e(_,m,y,w,b,x,_=u[0],m=u[1],y=r,w=o[0],b=o[1],x=o[2],Co,n),n.point(_,m)}function u(){M.point=r,n.lineEnd()}function a(){i(),M.point=s,M.lineEnd=l}function s(t,n){o(c=t,n),h=_,p=m,d=w,v=b,g=x,M.point=o}function l(){e(_,m,y,w,b,x,h,p,c,d,v,g,Co,n),M.lineEnd=u,u()}var c,h,p,d,v,g,y,_,m,w,b,x,M={point:r,lineStart:i,lineEnd:u,polygonStart:function(){n.polygonStart(),M.lineStart=a},polygonEnd:function(){n.polygonEnd(),M.lineStart=i}};return M}}function et(t){function n(t){return t=c(t[0]*uo,t[1]*uo),[t[0]*g+a,s-t[1]*g]}function e(t){return t=c.invert((t[0]-a)/g,(s-t[1])/g),t&&[t[0]*oo,t[1]*oo]}function r(t,n){return t=u(t,n),[t[0]*g+a,s-t[1]*g]}function i(){c=m(l=b(M,E,S),u);var t=u(w,x);return a=y-t[0]*g,s=_+t[1]*g,o()}function o(){return d=v=null,n}var u,a,s,l,c,f,h,p,d,v,g=150,y=480,_=250,w=0,x=0,M=0,E=0,S=0,N=null,A=Po,k=null,P=X,C=.5,T=W(r,C);return n.stream=function(t){return d&&v===t?d:d=qo(A(l,T(P(v=t))))},n.clipAngle=function(t){return arguments.length?(A=+t?G(N=t*uo,6*uo):(N=null,Po),o()):N*oo},n.clipExtent=function(t){return arguments.length?(P=null==t?(k=f=h=p=null,X):R(k=+t[0][0],f=+t[0][1],h=+t[1][0],p=+t[1][1]),o()):null==k?null:[[k,f],[h,p]]},n.scale=function(t){return arguments.length?(g=+t,i()):g},n.translate=function(t){return arguments.length?(y=+t[0],_=+t[1],i()):[y,_]},n.center=function(t){return arguments.length?(w=t[0]%360*uo,x=t[1]%360*uo,i()):[w*oo,x*oo]},n.rotate=function(t){return arguments.length?(M=t[0]%360*uo,E=t[1]%360*uo,S=t.length>2?t[2]%360*uo:0,i()):[M*oo,E*oo,S*oo]},n.precision=function(t){return arguments.length?(T=W(r,C=t*t),o()):yo(C)},n.fitExtent=K(n),n.fitSize=Q(n),function(){return u=t.apply(this,arguments),n.invert=u.invert&&e,i()}}function rt(t){var n=0,e=no/3,r=et(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*uo,e=t[1]*uo):[n*oo,e*oo]},i}function it(t,n){return[t,ho(_o((eo+n)/2))]}function ot(t){return _o((eo+t)/2)}function ut(t,n){function e(t,n){o>0?n<-eo+to&&(n=-eo+to):n>eo-to&&(n=eo-to);var e=o/po(ot(n),i);return[e*vo(i*t),o-e*co(i*t)]}var r=co(t),i=t===n?vo(t):ho(r/co(n))/ho(ot(n)/ot(t)),o=r*po(ot(t),i)/i;return i?(e.invert=function(t,n){var e=o-n,r=go(i)*yo(t*t+e*e);return[lo(t,e)/i,2*so(po(o/r,1/i))-eo]},e):it}function at(){return rt(ut).scale(109.5).parallels([30,30])}function st(){this._x0=this._y0=this._x1=this._y1=null,this._=[]}function lt(){return new st}function ct(t){var n=t.length;return{point:function(e,r){for(var i=-1;++i<n;)t[i].point(e,r)},sphere:function(){for(var e=-1;++e<n;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<n;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<n;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<n;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<n;)t[e].polygonEnd()}}}function ft(){function t(t){var n=t[0],e=t[1];return o=null,r.point(n,e),o||(i.point(n,e),o)}var n,e,r,i,o,u=at().rotate([5,-38.6]).parallels([0,60]),a=at().rotate([5,-38.6]).parallels([0,60]),s={point:function(t,n){o=[t,n]}};return t.invert=function(t){var n=u.scale(),e=u.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.05346&&i<.0897&&r>=-.13388&&r<-.0322?a:u).invert(t)},t.stream=function(t){return n&&e===t?n:n=ct([u.stream(e=t),a.stream(t)])},t.precision=function(n){return arguments.length?(u.precision(n),a.precision(n),t):u.precision()},t.scale=function(n){return arguments.length?(u.scale(n),a.scale(n),t.translate(u.translate())):u.scale()},t.translate=function(n){if(!arguments.length)return u.translate();var e=u.scale(),o=+n[0],l=+n[1];return r=u.translate(n).clipExtent([[o-.06857*e,l-.1288*e],[o+.13249*e,l+.05292*e]]).stream(s),i=a.translate([o+.1*e,l-.094*e]).clipExtent([[o-.1331*e+Fi,l+.053457*e+Fi],[o-.0354*e-Fi,l+.08969*e-Fi]]).stream(s),t},t.drawCompositionBorders=function(t){var n=u([-14.0346750522884,34.96500729877966]),e=u([-7.4208899681602025,35.53698899616862]),r=u([-7.314827535125545,33.54359498636456]);t.moveTo(n[0],n[1]),t.lineTo(e[0],e[1]),t.lineTo(r[0],r[1])},t.getCompositionBorders=function(){var t=lt();return this.drawCompositionBorders(t),t.toString()},t.scale(2700)}function ht(){return new pt}function pt(){this.reset()}function dt(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}function vt(){}function gt(t,n){t&&Wo.hasOwnProperty(t.type)&&Wo[t.type](t,n)}function yt(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function _t(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)yt(t[e],n,1);n.polygonEnd()}function mt(t,n){t&&Ko.hasOwnProperty(t.type)?Ko[t.type](t,n):gt(t,n)}function wt(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function bt(t){return 1===t.length&&(t=xt(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}function xt(t){return function(n,e){return wt(t(n),e)}}function Mt(t){return t}function Et(){eu.point=St}function St(t,n){eu.point=Nt,Ro=zo=t,Xo=Vo=n}function Nt(t,n){nu.add(Vo*t-zo*n),zo=t,Vo=n}function At(){Nt(Ro,Xo)}function kt(t,n){t<ru&&(ru=t),t>ou&&(ou=t),n<iu&&(iu=n),n>uu&&(uu=n)}function Pt(t,n){su+=t,lu+=n,++cu}function Ct(){yu.point=Tt}function Tt(t,n){yu.point=qt,Pt(Bo=t,Fo=n)}function qt(t,n){var e=t-Bo,r=n-Fo,i=Qo(e*e+r*r);fu+=i*(Bo+t)/2,hu+=i*(Fo+n)/2,pu+=i,Pt(Bo=t,Fo=n)}function Ot(){yu.point=Pt}function jt(){yu.point=It}function Lt(){Rt(Do,$o)}function It(t,n){yu.point=Rt,Pt(Do=Bo=t,$o=Fo=n)}function Rt(t,n){var e=t-Bo,r=n-Fo,i=Qo(e*e+r*r);fu+=i*(Bo+t)/2,hu+=i*(Fo+n)/2,pu+=i,i=Fo*t-Bo*n,du+=i*(Bo+t),vu+=i*(Fo+n),gu+=3*i,Pt(Bo=t,Fo=n)}function Xt(t){this._context=t}function zt(){this._string=[]}function Vt(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Dt(){function t(t){return t&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),mt(t,e(i))),i.result()}var n,e,r,i,o=4.5;return t.area=function(t){return mt(t,e(eu)),eu.result()},t.bounds=function(t){return mt(t,e(au)),au.result()},t.centroid=function(t){return mt(t,e(yu)),yu.result()},t.projection=function(r){return arguments.length?(e=null==(n=r)?Mt:r.stream,t):n},t.context=function(n){return arguments.length?(i=null==(r=n)?new zt:new Xt(n),"function"!=typeof o&&i.pointRadius(o),t):r},t.pointRadius=function(n){return arguments.length?(o="function"==typeof n?n:(i.pointRadius(+n),+n),t):o},t.projection(null).context(null)}function $t(t){function n(){}var e=n.prototype=Object.create(Bt.prototype);for(var r in t)e[r]=t[r];return function(t){var e=new n;return e.stream=t,e}}function Bt(){}function Ft(){}function Yt(t,n){var e=new Ft;if(t instanceof Ft)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var u in t)e.set(u,t[u]);return e}function Ht(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new Gt(r)}function Gt(t){this._=t}function Ut(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function Zt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function Jt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=mu,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function Qt(t,n){function e(t){var n,e=l.status;if(!e&&Wt(l)||e>=200&&e<300||304===e){if(o)try{n=o.call(r,l)}catch(t){return void a.call("error",r,t)}else n=l;a.call("load",r,n)}else a.call("error",r,t)}var r,i,o,u,a=Ht("beforesend","progress","load","error"),s=Yt(),l=new XMLHttpRequest,c=null,f=null,h=0;if("undefined"==typeof XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=l.ontimeout=e:l.onreadystatechange=function(t){l.readyState>3&&e(t)},l.onprogress=function(t){a.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?s.get(t):(null==n?s.remove(t):s.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(u=t,r):u},timeout:function(t){return arguments.length?(h=+t,r):h},user:function(t){return arguments.length<1?c:(c=null==t?null:t+"",r)},password:function(t){return arguments.length<1?f:(f=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return l.open(n,t,!0,c,f),null==i||s.has("accept")||s.set("accept",i+",*/*"),l.setRequestHeader&&s.each(function(t,n){l.setRequestHeader(n,t)}),null!=i&&l.overrideMimeType&&l.overrideMimeType(i),null!=u&&(l.responseType=u),h>0&&(l.timeout=h),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=Kt(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),a.call("beforesend",r,l),l.send(null==e?null:e),r},abort:function(){return l.abort(),r},on:function(){var t=a.on.apply(a,arguments);return t===a?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r}function Kt(t){return function(n,e){t(null==n?e:null)}}function Wt(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function tn(t,n){return function(e,r){var i=Qt(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}}function nn(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")}function en(t,n){var e=nn(t);return function(r,i){return n(e(r),i,t)}}function rn(t){var n=Object.create(null),e=[];return t.forEach(function(t){for(var r in t)r in n||e.push(n[r]=r)}),e}function on(t){function n(t,n){var r,i,o=e(t,function(t,e){return r?r(t,e-1):(i=t,void(r=n?en(t,n):nn(t)))});return o.columns=i,o}function e(t,n){function e(){if(c>=l)return u;if(i)return i=!1,o;var n,e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,n=t.charCodeAt(r+1),13===n?(i=!0,10===t.charCodeAt(r+2)&&++c):10===n&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<l;){var a=1;if(n=t.charCodeAt(c++),10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++a);else if(n!==s)continue;return t.slice(e,c-a)}return t.slice(e)}for(var r,i,o={},u={},a=[],l=t.length,c=0,f=0;(r=e())!==u;){for(var h=[];r!==o&&r!==u;)h.push(r),r=e();n&&null==(h=n(h,f++))||a.push(h)}return a}function r(n,e){return null==e&&(e=rn(n)),[e.map(u).join(t)].concat(n.map(function(n){return e.map(function(t){return u(n[t])}).join(t)})).join("\n")}function i(t){return t.map(o).join("\n")}function o(n){return n.map(u).join(t)}function u(t){return null==t?"":a.test(t+="")?'"'+t.replace(/\"/g,'""')+'"':t}var a=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return{parse:n,parseRows:e,format:r,formatRows:i}}function un(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),xu.hasOwnProperty(n)?{space:xu[n],local:t}:t}function an(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===bu&&n.documentElement.namespaceURI===bu?n.createElement(t):n.createElementNS(e,t)}}function sn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ln(t){var n=un(t);return(n.local?sn:an)(n)}function cn(t,n,e){return t=fn(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function fn(t,n,e){return function(r){var i=ku;ku=r;try{t.call(this,this.__data__,n,e)}finally{ku=i}}}function hn(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function pn(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function dn(t,n,e){var r=Au.hasOwnProperty(t.type)?cn:fn;return function(i,o,u){var a,s=this.__on,l=r(n,o,u);if(s)for(var c=0,f=s.length;c<f;++c)if((a=s[c]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=l,a.capture=e),void(a.value=n);this.addEventListener(t.type,l,e),a={type:t.type,name:t.name,value:n,listener:l,capture:e},s?s.push(a):this.__on=[a]}}function vn(t,n,e){var r,i,o=hn(t+""),u=o.length;{if(!(arguments.length<2)){for(a=n?dn:pn,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,l=0,c=a.length;l<c;++l)for(r=0,s=a[l];r<u;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value}}function gn(){}function yn(t){return null==t?gn:function(){return this.querySelector(t)}}function _n(t){"function"!=typeof t&&(t=yn(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new je(r,this._parents)}function mn(){return[]}function wn(t){return null==t?mn:function(){return this.querySelectorAll(t)}}function bn(t){"function"!=typeof t&&(t=wn(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new je(r,i)}function xn(t){"function"!=typeof t&&(t=Nu(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new je(r,this._parents)}function Mn(t){return new Array(t.length)}function En(){return new je(this._enter||this._groups.map(Mn),this._parents)}function Sn(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function Nn(t){return function(){return t}}function An(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new Sn(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function kn(t,n,e,r,i,o,u){var a,s,l,c={},f=n.length,h=o.length,p=new Array(f);for(a=0;a<f;++a)(s=n[a])&&(p[a]=l=Cu+u.call(s,s.__data__,a,n),l in c?i[a]=s:c[l]=s);for(a=0;a<h;++a)l=Cu+u.call(t,o[a],a,o),(s=c[l])?(r[a]=s,s.__data__=o[a],c[l]=null):e[a]=new Sn(t,o[a]);for(a=0;a<f;++a)(s=n[a])&&c[p[a]]===s&&(i[a]=s)}function Pn(t,n){if(!t)return p=new Array(this.size()),l=-1,this.each(function(t){p[++l]=t}),p;var e=n?kn:An,r=this._parents,i=this._groups;"function"!=typeof t&&(t=Nn(t));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=t.call(c,c&&c.__data__,l,r),d=p.length,v=a[l]=new Array(d),g=u[l]=new Array(d),y=s[l]=new Array(h);e(c,f,v,g,y,p,n);for(var _,m,w=0,b=0;w<d;++w)if(_=v[w]){for(w>=b&&(b=w+1);!(m=g[b])&&++b<d;);_._next=m||null}}return u=new je(u,r),u._enter=a,u._exit=s,u}function Cn(){return new je(this._exit||this._groups.map(Mn),this._parents)}function Tn(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],f=l.length,h=u[a]=new Array(f),p=0;p<f;++p)(s=l[p]||c[p])&&(h[p]=s);for(;a<r;++a)u[a]=n[a];return new je(u,this._parents)}function qn(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this}function On(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=jn);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new je(i,this._parents).order()}function jn(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Ln(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function In(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function Rn(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null}function Xn(){var t=0;return this.each(function(){++t}),t}function zn(){return!this.node()}function Vn(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this}function Dn(t){return function(){this.removeAttribute(t)}}function $n(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bn(t,n){return function(){this.setAttribute(t,n)}}function Fn(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Yn(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Hn(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Gn(t,n){var e=un(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?$n:Dn:"function"==typeof n?e.local?Hn:Yn:e.local?Fn:Bn)(e,n))}function Un(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Zn(t){return function(){this.style.removeProperty(t)}}function Jn(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Qn(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Kn(t,n,e){var r;return arguments.length>1?this.each((null==n?Zn:"function"==typeof n?Qn:Jn)(t,n,null==e?"":e)):Un(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function Wn(t){return function(){delete this[t]}}function te(t,n){return function(){this[t]=n}}function ne(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function ee(t,n){return arguments.length>1?this.each((null==n?Wn:"function"==typeof n?ne:te)(t,n)):this.node()[t]}function re(t){return t.trim().split(/^|\s+/)}function ie(t){return t.classList||new oe(t)}function oe(t){this._node=t,this._names=re(t.getAttribute("class")||"")}function ue(t,n){for(var e=ie(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function ae(t,n){for(var e=ie(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function se(t){return function(){ue(this,t)}}function le(t){return function(){ae(this,t)}}function ce(t,n){return function(){(n.apply(this,arguments)?ue:ae)(this,t)}}function fe(t,n){var e=re(t+"");if(arguments.length<2){for(var r=ie(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?ce:n?se:le)(e,n))}function he(){this.textContent=""}function pe(t){return function(){this.textContent=t}}function de(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function ve(t){return arguments.length?this.each(null==t?he:("function"==typeof t?de:pe)(t)):this.node().textContent}function ge(){this.innerHTML=""}function ye(t){return function(){this.innerHTML=t}}function _e(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function me(t){return arguments.length?this.each(null==t?ge:("function"==typeof t?_e:ye)(t)):this.node().innerHTML}function we(){this.nextSibling&&this.parentNode.appendChild(this)}function be(){return this.each(we)}function xe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Me(){return this.each(xe)}function Ee(t){var n="function"==typeof t?t:ln(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Se(){return null}function Ne(t,n){var e="function"==typeof t?t:ln(t),r=null==n?Se:"function"==typeof n?n:yn(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Ae(){var t=this.parentNode;t&&t.removeChild(this)}function ke(){return this.each(Ae)}function Pe(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ce(t,n,e){var r=Un(t),i=r.CustomEvent;i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function Te(t,n){
return function(){return Ce(this,t,n)}}function qe(t,n){return function(){return Ce(this,t,n.apply(this,arguments))}}function Oe(t,n){return this.each(("function"==typeof n?qe:Te)(t,n))}function je(t,n){this._groups=t,this._parents=n}function Le(){return new je([[document.documentElement]],Tu)}function Ie(t){return"string"==typeof t?new je([[document.querySelector(t)]],[document.documentElement]):new je([[t]],Tu)}function Re(){return zu||($u(Xe),zu=Du.now()+Vu)}function Xe(){zu=0}function ze(){this._call=this._time=this._next=null}function Ve(t,n,e){var r=new ze;return r.restart(t,n,e),r}function De(){Re(),++ju;for(var t,n=qu;n;)(t=zu-n._time)>=0&&n._call.call(null,t),n=n._next;--ju}function $e(){zu=(Xu=Du.now())+Vu,ju=Lu=0;try{De()}finally{ju=0,Fe(),zu=0}}function Be(){var t=Du.now(),n=t-Xu;n>Ru&&(Vu-=n,Xu=t)}function Fe(){for(var t,n,e=qu,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:qu=n);Ou=t,Ye(r)}function Ye(t){if(!ju){Lu&&(Lu=clearTimeout(Lu));var n=t-zu;n>24?(t<1/0&&(Lu=setTimeout($e,n)),Iu&&(Iu=clearInterval(Iu))):(Iu||(Iu=setInterval(Be,Ru)),ju=1,$u($e))}}function He(t,n,e){var r=new ze;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}function Ge(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};Qe(t,e,{name:n,index:r,group:i,on:Bu,tween:Fu,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Yu})}function Ue(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Yu)throw new Error("too late");return e}function Ze(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Gu)throw new Error("too late");return e}function Je(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function Qe(t,n,e){function r(t){e.state=Hu,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var l,c,f,h;if(e.state!==Hu)return u();for(l in s)if(h=s[l],h.name===e.name){if(h.state===Uu)return He(i);h.state===Zu?(h.state=Qu,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete s[l]):+l<n&&(h.state=Qu,h.timer.stop(),delete s[l])}if(He(function(){e.state===Uu&&(e.state=Zu,e.timer.restart(o,e.delay,e.time),o(r))}),e.state=Gu,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Gu){for(e.state=Uu,a=new Array(f=e.tween.length),l=0,c=-1;l<f;++l)(h=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(a[++c]=h);a.length=c+1}}function o(n){for(var r=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=Ju,1),i=-1,o=a.length;++i<o;)a[i].call(null,r);e.state===Ju&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){e.state=Qu,e.timer.stop(),delete s[n];for(var r in s)return;delete t.__transition}var a,s=t.__transition;s[n]=e,e.timer=Ve(r,0,e.time)}function Ke(t,n){var e,r,i,o=t.__transition,u=!0;if(o){n=null==n?null:n+"";for(i in o)(e=o[i]).name===n?(r=e.state===Uu,e.state=Qu,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function We(t){return this.each(function(){Ke(this,t)})}function tr(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function nr(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function er(){}function rr(t){var n;return t=(t+"").trim().toLowerCase(),(n=ta.exec(t))?(n=parseInt(n[1],16),new sr(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=na.exec(t))?ir(parseInt(n[1],16)):(n=ea.exec(t))?new sr(n[1],n[2],n[3],1):(n=ra.exec(t))?new sr(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ia.exec(t))?or(n[1],n[2],n[3],n[4]):(n=oa.exec(t))?or(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=ua.exec(t))?lr(n[1],n[2]/100,n[3]/100,1):(n=aa.exec(t))?lr(n[1],n[2]/100,n[3]/100,n[4]):sa.hasOwnProperty(t)?ir(sa[t]):"transparent"===t?new sr(NaN,NaN,NaN,0):null}function ir(t){return new sr(t>>16&255,t>>8&255,255&t,1)}function or(t,n,e,r){return r<=0&&(t=n=e=NaN),new sr(t,n,e,r)}function ur(t){return t instanceof er||(t=rr(t)),t?(t=t.rgb(),new sr(t.r,t.g,t.b,t.opacity)):new sr}function ar(t,n,e,r){return 1===arguments.length?ur(t):new sr(t,n,e,null==r?1:r)}function sr(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function lr(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new hr(t,n,e,r)}function cr(t){if(t instanceof hr)return new hr(t.h,t.s,t.l,t.opacity);if(t instanceof er||(t=rr(t)),!t)return new hr;if(t instanceof hr)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new hr(u,a,s,t.opacity)}function fr(t,n,e,r){return 1===arguments.length?cr(t):new hr(t,n,e,null==r?1:r)}function hr(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function pr(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function dr(t){if(t instanceof gr)return new gr(t.l,t.a,t.b,t.opacity);if(t instanceof Mr){var n=t.h*la;return new gr(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof sr||(t=ur(t));var e=wr(t.r),r=wr(t.g),i=wr(t.b),o=yr((.4124564*e+.3575761*r+.1804375*i)/ha),u=yr((.2126729*e+.7151522*r+.072175*i)/pa),a=yr((.0193339*e+.119192*r+.9503041*i)/da);return new gr(116*u-16,500*(o-u),200*(u-a),t.opacity)}function vr(t,n,e,r){return 1===arguments.length?dr(t):new gr(t,n,e,null==r?1:r)}function gr(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function yr(t){return t>_a?Math.pow(t,1/3):t/ya+va}function _r(t){return t>ga?t*t*t:ya*(t-va)}function mr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function wr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function br(t){if(t instanceof Mr)return new Mr(t.h,t.c,t.l,t.opacity);t instanceof gr||(t=dr(t));var n=Math.atan2(t.b,t.a)*ca;return new Mr(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function xr(t,n,e,r){return 1===arguments.length?br(t):new Mr(t,n,e,null==r?1:r)}function Mr(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Er(t){if(t instanceof Nr)return new Nr(t.h,t.s,t.l,t.opacity);t instanceof sr||(t=ur(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Na*r+Ea*n-Sa*e)/(Na+Ea-Sa),o=r-i,u=(Ma*(e-i)-ba*o)/xa,a=Math.sqrt(u*u+o*o)/(Ma*i*(1-i)),s=a?Math.atan2(u,o)*ca-120:NaN;return new Nr(s<0?s+360:s,a,i,t.opacity)}function Sr(t,n,e,r){return 1===arguments.length?Er(t):new Nr(t,n,e,null==r?1:r)}function Nr(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Ar(t){return function(){return t}}function kr(t,n){return function(e){return t+e*n}}function Pr(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Cr(t,n){var e=n-t;return e?kr(t,e>180||e<-180?e-360*Math.round(e/360):e):Ar(isNaN(t)?n:t)}function Tr(t){return 1===(t=+t)?qr:function(n,e){return e-n?Pr(n,e,t):Ar(isNaN(n)?e:n)}}function qr(t,n){var e=n-t;return e?kr(t,e):Ar(isNaN(t)?n:t)}function Or(t,n){return t=+t,n-=t,function(e){return t+n*e}}function jr(t){return function(){return t}}function Lr(t){return function(n){return t(n)+""}}function Ir(t,n){var e,r,i,o=qa.lastIndex=Oa.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=qa.exec(t))&&(r=Oa.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:Or(e,r)})),o=Oa.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?Lr(s[0].x):jr(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}function Rr(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*ja,skewX:Math.atan(s)*ja,scaleX:u,scaleY:a}}function Xr(t){return"none"===t?La:(Aa||(Aa=document.createElement("DIV"),ka=document.documentElement,Pa=document.defaultView),Aa.style.transform=t,t=Pa.getComputedStyle(ka.appendChild(Aa),null).getPropertyValue("transform"),ka.removeChild(Aa),t=t.slice(7,-1).split(","),Rr(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function zr(t){return null==t?La:(Ca||(Ca=document.createElementNS("http://www.w3.org/2000/svg","g")),Ca.setAttribute("transform",t),(t=Ca.transform.baseVal.consolidate())?(t=t.matrix,Rr(t.a,t.b,t.c,t.d,t.e,t.f)):La)}function Vr(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:Or(t,i)},{i:s-2,x:Or(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}function u(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Or(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function a(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Or(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function s(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Or(t,e)},{i:a-2,x:Or(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),u(n.rotate,e.rotate,r,i),a(n.skewX,e.skewX,r,i),s(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e<o;)r[(n=i[e]).i]=n.x(t);return r.join("")}}}function Dr(t){return function n(e){function r(n,r){var i=t((n=Sr(n)).h,(r=Sr(r)).h),o=qr(n.s,r.s),u=qr(n.l,r.l),a=qr(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=o(t),n.l=u(Math.pow(t,e)),n.opacity=a(t),n+""}}return e=+e,r.gamma=n,r}(1)}function $r(t,n){var e,r;return function(){var i=Ze(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;u<a;++u)if(r[u].name===n){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function Br(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Ze(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Fr(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Je(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?$r:Br)(e,t,n))}function Yr(t,n,e){var r=t._id;return t.each(function(){var t=Ze(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Je(t,r).value[n]}}function Hr(t,n){var e;return("number"==typeof n?Or:n instanceof rr?Ta:(e=rr(n))?(n=e,Ta):Ir)(t,n)}function Gr(t){return function(){this.removeAttribute(t)}}function Ur(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zr(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}}function Jr(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}function Qr(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttribute(t):(u=this.getAttribute(t),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function Kr(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function Wr(t,n){var e=un(t),r="transform"===e?Ra:Hr;return this.attrTween(t,"function"==typeof n?(e.local?Kr:Qr)(e,r,Yr(this,"attr."+t,n)):null==n?(e.local?Ur:Gr)(e):(e.local?Jr:Zr)(e,r,n))}function ti(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function ni(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function ei(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=un(t);return this.tween(e,(r.local?ti:ni)(r,n))}function ri(t,n){return function(){Ue(this,t).delay=+n.apply(this,arguments)}}function ii(t,n){return n=+n,function(){Ue(this,t).delay=n}}function oi(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ri:ii)(n,t)):Je(this.node(),n).delay}function ui(t,n){return function(){Ze(this,t).duration=+n.apply(this,arguments)}}function ai(t,n){return n=+n,function(){Ze(this,t).duration=n}}function si(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ui:ai)(n,t)):Je(this.node(),n).duration}function li(t,n){if("function"!=typeof n)throw new Error;return function(){Ze(this,t).ease=n}}function ci(t){var n=this._id;return arguments.length?this.each(li(n,t)):Je(this.node(),n).ease}function fi(t){"function"!=typeof t&&(t=Nu(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new qi(r,this._parents,this._name,this._id)}function hi(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],f=l.length,h=u[a]=new Array(f),p=0;p<f;++p)(s=l[p]||c[p])&&(h[p]=s);for(;a<r;++a)u[a]=n[a];return new qi(u,this._parents,this._name,this._id)}function pi(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function di(t,n,e){var r,i,o=pi(n)?Ue:Ze;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function vi(t,n){var e=this._id;return arguments.length<2?Je(this.node(),e).on.on(t):this.each(di(e,t,n))}function gi(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function yi(){return this.on("end.remove",gi(this._id))}function _i(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=yn(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,f=o[u]=new Array(c),h=0;h<c;++h)(a=l[h])&&(s=t.call(a,a.__data__,h,l))&&("__data__"in a&&(s.__data__=a.__data__),f[h]=s,Ge(f[h],n,e,h,f,Je(a,e)));return new qi(o,this._parents,n,e)}function mi(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=wn(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,f=0;f<c;++f)if(s=l[f]){for(var h,p=t.call(s,s.__data__,f,l),d=Je(s,e),v=0,g=p.length;v<g;++v)(h=p[v])&&Ge(h,n,e,v,p,d);o.push(p),u.push(s)}return new qi(o,u,n,e)}function wi(){return new Xa(this._groups,this._parents)}function bi(t,n){var e,r,i;return function(){var o=Un(this).getComputedStyle(this,null),u=o.getPropertyValue(t),a=(this.style.removeProperty(t),o.getPropertyValue(t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}function xi(t){return function(){this.style.removeProperty(t)}}function Mi(t,n,e){var r,i;return function(){var o=Un(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function Ei(t,n,e){var r,i,o;return function(){var u=Un(this).getComputedStyle(this,null),a=u.getPropertyValue(t),s=e(this);return null==s&&(this.style.removeProperty(t),s=u.getPropertyValue(t)),a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function Si(t,n,e){var r="transform"==(t+="")?Ia:Hr;return null==n?this.styleTween(t,bi(t,r)).on("end.style."+t,xi(t)):this.styleTween(t,"function"==typeof n?Ei(t,r,Yr(this,"style."+t,n)):Mi(t,r,n),e)}function Ni(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function Ai(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,Ni(t,n,null==e?"":e))}function ki(t){return function(){this.textContent=t}}function Pi(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function Ci(t){return this.tween("text","function"==typeof t?Pi(Yr(this,"text",t)):ki(null==t?"":t+""))}function Ti(){for(var t=this._name,n=this._id,e=ji(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=Je(u,n);Ge(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new qi(r,this._parents,t,e)}function qi(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Oi(t){return Le().transition(t)}function ji(){return++za}function Li(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function Ii(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return Ha.time=Re(),Ha;return e}function Ri(t){var n,e;t instanceof qi?(n=t._id,t=t._name):(n=ji(),(e=Ha).time=Re(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&Ge(u,t,n,l,a,e||Ii(u,n));return new qi(r,this._parents,t,n)}function Xi(){}function zi(t){if(!t)return Xi;var n,e,r=t.scale[0],i=t.scale[1],o=t.translate[0],u=t.translate[1];return function(t,a){a||(n=e=0),t[0]=(n+=t[0])*r+o,t[1]=(e+=t[1])*i+u}}function Vi(t,n){for(var e,r=t.length,i=r-n;i<--r;)e=t[i],t[i++]=t[r],t[r]=e}function Di(t,n){return"GeometryCollection"===n.type?{type:"FeatureCollection",features:n.geometries.map(function(n){return $i(t,n)})}:$i(t,n)}function $i(t,n){var e={type:"Feature",id:n.id,properties:n.properties||{},geometry:Bi(t,n)};return null==n.id&&delete e.id,e}function Bi(t,n){function e(t,n){n.length&&n.pop();for(var e,r=l[t<0?~t:t],i=0,o=r.length;i<o;++i)n.push(e=r[i].slice()),s(e,i);t<0&&Vi(n,o)}function r(t){return t=t.slice(),s(t,0),t}function i(t){for(var n=[],r=0,i=t.length;r<i;++r)e(t[r],n);return n.length<2&&n.push(n[0].slice()),n}function o(t){for(var n=i(t);n.length<4;)n.push(n[0].slice());return n}function u(t){return t.map(o)}function a(t){var n=t.type;return"GeometryCollection"===n?{type:n,geometries:t.geometries.map(a)}:n in c?{type:n,coordinates:c[n](t)}:null}var s=zi(t.transform),l=t.arcs,c={Point:function(t){return r(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(r)},LineString:function(t){return i(t.arcs)},MultiLineString:function(t){return t.arcs.map(i)},Polygon:function(t){return u(t.arcs)},MultiPolygon:function(t){return t.arcs.map(u)}};return a(n)}var Fi=1e-6;n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){e(Wi,t,this.t),e(this,Wi.s,this.s),this.s?this.t+=Wi.t:this.s=Wi.t},valueOf:function(){return this.s}};var Yi,Hi,Gi,Ui,Zi,Ji,Qi,Ki,Wi=new n,to=1e-6,no=Math.PI,eo=no/2,ro=no/4,io=2*no,oo=180/no,uo=no/180,ao=Math.abs,so=Math.atan,lo=Math.atan2,co=Math.cos,fo=Math.exp,ho=Math.log,po=Math.pow,vo=Math.sin,go=Math.sign||function(t){return t>0?1:t<0?-1:0},yo=Math.sqrt,_o=Math.tan,mo={Feature:function(t,n){u(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)u(e[r].geometry,n)}},wo={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){a(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)a(e[r],n,0)},Polygon:function(t,n){s(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)s(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)u(e[r],n)}};t(),t(),t();w.invert=w;var bo=(j(O),1e9),xo=-bo,Mo=(t(),t(),t(),1/0),Eo=Mo,So=-Mo,No=So,Ao={point:z,lineStart:o,lineEnd:o,polygonStart:o,polygonEnd:o,result:function(){var t=[[Mo,Eo],[So,No]];return So=No=-(Eo=Mo=1/0),t}},ko=t(),Po=D(function(){return!0},F,H,[-no,-eo]);Z.prototype={point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Co=16,To=co(30*uo),qo=U({point:function(t,n){this.stream.point(t*uo,n*uo)}});it.invert=function(t,n){return[t,2*so(fo(n))-eo]};var Oo=Math.PI,jo=2*Oo,Lo=1e-6,Io=jo-Lo;st.prototype=lt.prototype={constructor:st,moveTo:function(t,n){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._.push("Z"))},lineTo:function(t,n){this._.push("L",this._x1=+t,",",this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._.push("Q",+t,",",+n,",",this._x1=+e,",",this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._.push("C",+t,",",+n,",",+e,",",+r,",",this._x1=+i,",",this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,u=this._y1,a=e-t,s=r-n,l=o-t,c=u-n,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._.push("M",this._x1=t,",",this._y1=n);else if(f>Lo)if(Math.abs(c*a-s*l)>Lo&&i){var h=e-o,p=r-u,d=a*a+s*s,v=h*h+p*p,g=Math.sqrt(d),y=Math.sqrt(f),_=i*Math.tan((Oo-Math.acos((d+f-v)/(2*g*y)))/2),m=_/y,w=_/g;Math.abs(m-1)>Lo&&this._.push("L",t+m*l,",",n+m*c),this._.push("A",i,",",i,",0,0,",+(c*h>l*p),",",this._x1=t+w*a,",",this._y1=n+w*s)}else this._.push("L",this._x1=t,",",this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var u=e*Math.cos(r),a=e*Math.sin(r),s=t+u,l=n+a,c=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._.push("M",s,",",l):(Math.abs(this._x1-s)>Lo||Math.abs(this._y1-l)>Lo)&&this._.push("L",s,",",l),e&&(f>Io?this._.push("A",e,",",e,",0,1,",c,",",t-u,",",n-a,"A",e,",",e,",0,1,",c,",",this._x1=s,",",this._y1=l):(f<0&&(f=f%jo+jo),this._.push("A",e,",",e,",0,",+(f>=Oo),",",c,",",this._x1=t+e*Math.cos(i),",",this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+n,"h",+e,"v",+r,"h",-e,"Z")},toString:function(){return this._.join("")}},pt.prototype={constructor:pt,reset:function(){this.s=this.t=0},add:function(t){dt(Yo,t,this.t),dt(this,Yo.s,this.s),this.s?this.t+=Yo.t:this.s=Yo.t},valueOf:function(){return this.s}};var Ro,Xo,zo,Vo,Do,$o,Bo,Fo,Yo=new pt,Ho=Math.PI,Go=2*Ho,Uo=Ho/180,Zo=Math.abs,Jo=(Math.atan2,Math.cos),Qo=(Math.sin,Math.sqrt),Ko={Feature:function(t,n){gt(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)gt(e[r].geometry,n)}},Wo={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){yt(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)yt(e[r],n,0)},Polygon:function(t,n){_t(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)_t(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)gt(e[r],n)}},tu=(ht(),ht(),ht(),bt(wt),ht(),ht()),nu=ht(),eu={point:vt,lineStart:vt,lineEnd:vt,polygonStart:function(){eu.lineStart=Et,eu.lineEnd=At},polygonEnd:function(){eu.lineStart=eu.lineEnd=eu.point=vt,tu.add(Zo(nu)),nu.reset()},result:function(){var t=tu/2;return tu.reset(),t}},ru=1/0,iu=ru,ou=-ru,uu=ou,au={point:kt,lineStart:vt,lineEnd:vt,polygonStart:vt,polygonEnd:vt,result:function(){var t=[[ru,iu],[ou,uu]];return ou=uu=-(iu=ru=1/0),t}},su=0,lu=0,cu=0,fu=0,hu=0,pu=0,du=0,vu=0,gu=0,yu={point:Pt,lineStart:Ct,lineEnd:Ot,polygonStart:function(){yu.lineStart=jt,yu.lineEnd=Lt},polygonEnd:function(){yu.point=Pt,yu.lineStart=Ct,yu.lineEnd=Ot},result:function(){var t=gu?[du/gu,vu/gu]:pu?[fu/pu,hu/pu]:cu?[su/cu,lu/cu]:[NaN,NaN];return su=lu=cu=fu=hu=pu=du=vu=gu=0,t}};Xt.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Go)}},result:vt},zt.prototype={_circle:Vt(4.5),pointRadius:function(t){return this._circle=Vt(t),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}}};ht();Bt.prototype={point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var _u=(Jo(30*Uo),$t({point:function(t,n){this.stream.point(t*Uo,n*Uo)}}),"$");Ft.prototype=Yt.prototype={constructor:Ft,has:function(t){return _u+t in this},get:function(t){return this[_u+t]},set:function(t,n){return this[_u+t]=n,this},remove:function(t){var n=_u+t;return n in this&&delete this[n]},clear:function(){for(var t in this)t[0]===_u&&delete this[t]},keys:function(){var t=[];for(var n in this)n[0]===_u&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)n[0]===_u&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)n[0]===_u&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)n[0]===_u&&++t;return t},empty:function(){for(var t in this)if(t[0]===_u)return!1;return!0},each:function(t){for(var n in this)n[0]===_u&&t(this[n],n.slice(1),this)}};var mu=(Yt.prototype,{value:function(){}});Gt.prototype=Ht.prototype={constructor:Gt,on:function(t,n){var e,r=this._,i=Ut(t+"",r),o=-1,u=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=Jt(r[e],t.name,n);else if(null==n)for(e in r)r[e]=Jt(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=Zt(r[e],t.name)))return e}},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Gt(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,e=r.length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var wu=tn("application/json",function(t){return JSON.parse(t.responseText)}),bu=(on(","),on("\t"),"http://www.w3.org/1999/xhtml"),xu={svg:"http://www.w3.org/2000/svg",xhtml:bu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Mu=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Eu=document.documentElement;if(!Eu.matches){var Su=Eu.webkitMatchesSelector||Eu.msMatchesSelector||Eu.mozMatchesSelector||Eu.oMatchesSelector;Mu=function(t){return function(){return Su.call(this,t)}}}}var Nu=Mu,Au={},ku=null;if("undefined"!=typeof document){var Pu=document.documentElement;"onmouseenter"in Pu||(Au={mouseenter:"mouseover",mouseleave:"mouseout"})}Sn.prototype={constructor:Sn,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Cu="$";oe.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Tu=[null];je.prototype=Le.prototype={constructor:je,select:_n,selectAll:bn,filter:xn,data:Pn,enter:En,exit:Cn,merge:Tn,order:qn,sort:On,call:Ln,nodes:In,node:Rn,size:Xn,empty:zn,each:Vn,attr:Gn,style:Kn,property:ee,classed:fe,text:ve,html:me,raise:be,lower:Me,append:Ee,insert:Ne,remove:ke,datum:Pe,on:vn,dispatch:Oe};var qu,Ou,ju=0,Lu=0,Iu=0,Ru=1e3,Xu=0,zu=0,Vu=0,Du="object"==typeof performance&&performance.now?performance:Date,$u="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};ze.prototype=Ve.prototype={constructor:ze,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Re():+e)+(null==n?0:+n),this._next||Ou===this||(Ou?Ou._next=this:qu=this,Ou=this),this._call=t,this._time=e,Ye()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ye())}};var Bu=Ht("start","end","interrupt"),Fu=[],Yu=0,Hu=1,Gu=2,Uu=3,Zu=4,Ju=5,Qu=6,Ku=.7,Wu=1/Ku,ta=/^#([0-9a-f]{3})$/,na=/^#([0-9a-f]{6})$/,ea=/^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,ra=/^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,ia=/^rgba\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,oa=/^rgba\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,ua=/^hsl\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,aa=/^hsla\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,sa={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,rebeccapurple:6697881,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};tr(er,rr,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),tr(sr,ar,nr(er,{brighter:function(t){return t=null==t?Wu:Math.pow(Wu,t),new sr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Ku:Math.pow(Ku,t),new sr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),tr(hr,fr,nr(er,{brighter:function(t){return t=null==t?Wu:Math.pow(Wu,t),new hr(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Ku:Math.pow(Ku,t),new hr(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new sr(pr(t>=240?t-240:t+120,i,r),pr(t,i,r),pr(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var la=Math.PI/180,ca=180/Math.PI,fa=18,ha=.95047,pa=1,da=1.08883,va=4/29,ga=6/29,ya=3*ga*ga,_a=ga*ga*ga;tr(gr,vr,nr(er,{brighter:function(t){return new gr(this.l+fa*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new gr(this.l-fa*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=pa*_r(t),n=ha*_r(n),e=da*_r(e),new sr(mr(3.2404542*n-1.5371385*t-.4985314*e),mr(-.969266*n+1.8760108*t+.041556*e),mr(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),tr(Mr,xr,nr(er,{brighter:function(t){return new Mr(this.h,this.c,this.l+fa*(null==t?1:t),this.opacity)},darker:function(t){return new Mr(this.h,this.c,this.l-fa*(null==t?1:t),this.opacity)},rgb:function(){return dr(this).rgb()}}));var ma=-.14861,wa=1.78277,ba=-.29227,xa=-.90649,Ma=1.97294,Ea=Ma*xa,Sa=Ma*wa,Na=wa*ba-xa*ma;tr(Nr,Sr,nr(er,{brighter:function(t){return t=null==t?Wu:Math.pow(Wu,t),new Nr(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Ku:Math.pow(Ku,t),new Nr(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*la,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new sr(255*(n+e*(ma*r+wa*i)),255*(n+e*(ba*r+xa*i)),255*(n+e*(Ma*r)),this.opacity)}}));var Aa,ka,Pa,Ca,Ta=function t(n){function e(t,n){var e=r((t=ar(t)).r,(n=ar(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),u=r(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}var r=Tr(n);return e.gamma=t,e}(1),qa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Oa=new RegExp(qa.source,"g"),ja=180/Math.PI,La={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Ia=Vr(Xr,"px, ","px)","deg)"),Ra=Vr(zr,", ",")",")");Dr(Cr);var Xa=(Dr(qr),Le.prototype.constructor),za=0,Va=Le.prototype;qi.prototype=Oi.prototype={constructor:qi,select:_i,selectAll:mi,filter:fi,merge:hi,selection:wi,transition:Ti,call:Va.call,nodes:Va.nodes,node:Va.node,size:Va.size,empty:Va.empty,each:Va.each,on:vi,attr:Wr,attrTween:ei,style:Si,styleTween:Ai,text:Ci,remove:yi,tween:Fr,delay:oi,duration:si,ease:ci};var Da=3,$a=(function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(Da),function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(Da),function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(Da),1.70158),Ba=(function t(n){function e(t){return t*t*((n+1)*t-n)}return n=+n,e.overshoot=t,e}($a),function t(n){function e(t){return--t*t*((n+1)*t+n)+1}return n=+n,e.overshoot=t,e}($a),function t(n){function e(t){return((t*=2)<1?t*t*((n+1)*t-n):(t-=2)*t*((n+1)*t+n)+2)/2}return n=+n,e.overshoot=t,e}($a),2*Math.PI),Fa=1,Ya=.3,Ha=(function t(n,e){function r(t){return n*Math.pow(2,10*--t)*Math.sin((i-t)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=Ba);return r.amplitude=function(n){return t(n,e*Ba)},r.period=function(e){return t(n,e)},r}(Fa,Ya),function t(n,e){function r(t){return 1-n*Math.pow(2,-10*(t=+t))*Math.sin((t+i)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=Ba);return r.amplitude=function(n){return t(n,e*Ba)},r.period=function(e){return t(n,e)},r}(Fa,Ya),function t(n,e){function r(t){return((t=2*t-1)<0?n*Math.pow(2,10*t)*Math.sin((i-t)/e):2-n*Math.pow(2,-10*t)*Math.sin((i+t)/e))/2}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=Ba);return r.amplitude=function(n){return t(n,e*Ba)},r.period=function(e){return t(n,e)},r}(Fa,Ya),{time:null,delay:0,duration:250,ease:Li});Le.prototype.interrupt=We,Le.prototype.transition=Ri;var Ga={geoConicConformalSpain:ft,geoPath:Dt,json:wu,select:Ie,transition:Oi,feature:Di};return Ga});
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.states {
fill: #ccc;
stroke: #fff;
}
</style>
<body>
<script src="d3.min.js"></script>
<script>
var width = 960,
height = 500;
var projection = d3.geoConicConformalSpain();
var path = d3.geoPath()
.projection(projection);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
var t = d3.transition();
d3.json("provincias.json", function(error, spain) {
var spain = d3.feature(spain, spain.objects.provincias);
svg.selectAll(".region")
.data(spain.features)
.enter()
.append("path")
.attr("class", "region")
.attr("d", path)
.style("fill", "#aca")
.style("stroke", "#000")
.style("stroke-width", "0.5px")
.on("mouseover", function(d,i) {
d3.select(this).interrupt();
d3.select(this)
.transition(t)
.style("fill", "red");
})
.on("mouseout", function(d,i) {
d3.select(this).interrupt();
d3.select(this)
.transition(t)
.style("fill", "#aca");
});;
svg
.append("path")
.style("fill","none")
.style("stroke","#f00")
.attr("d", projection.getCompositionBorders());
});
</script>
{
"private": true,
"scripts": {
"build": "rollup -c | uglifyjs -c -m> d3.min.js"
},
"dependencies": {
"d3-array": "1.0.0",
"d3-axis": "1.0.1",
"d3-composite-projections": "^1.0.1",
"d3-geo": "^1.2.5",
"d3-request": "^1.0.1",
"d3-scale": "1.0.2",
"d3-selection": "^1.0.1",
"d3-shape": "1.0.1",
"d3-time-format": "2.0.1",
"d3-transition": "^1.0.2",
"rollup": "^0.34.3",
"rollup-plugin-node-resolve": "^2.0.0",
"topojson": "^1.6.27",
"uglify-js": "^2.7.3"
}
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import npm from "rollup-plugin-node-resolve";
export default {
entry: "d3.js",
plugins: [npm({jsnext: true})],
moduleId: "d3",
moduleName: "d3",
format: "umd"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment