UNPKG

cl-react-graph

Version:
2 lines 31.4 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{"05pY":function(n,t,e){"use strict";e.r(t);function r(){}function i(n,t){var e=new r;if(n instanceof r)n.each((function(n,t){e.set(t,n)}));else if(Array.isArray(n)){var i,o=-1,u=n.length;if(null==t)for(;++o<u;)e.set(o,n[o]);else for(;++o<u;)e.set(t(i=n[o],o,n),i)}else if(n)for(var a in n)e.set(a,n[a]);return e}r.prototype=i.prototype={constructor:r,has:function(n){return"$"+n in this},get:function(n){return this["$"+n]},set:function(n,t){return this["$"+n]=t,this},remove:function(n){var t="$"+n;return t in this&&delete this[t]},clear:function(){for(var n in this)"$"===n[0]&&delete this[n]},keys:function(){var n=[];for(var t in this)"$"===t[0]&&n.push(t.slice(1));return n},values:function(){var n=[];for(var t in this)"$"===t[0]&&n.push(this[t]);return n},entries:function(){var n=[];for(var t in this)"$"===t[0]&&n.push({key:t.slice(1),value:this[t]});return n},size:function(){var n=0;for(var t in this)"$"===t[0]&&++n;return n},empty:function(){for(var n in this)if("$"===n[0])return!1;return!0},each:function(n){for(var t in this)"$"===t[0]&&n(this[t],t.slice(1),this)}};var o=i;function u(){}var a=o.prototype;function c(n,t){var e=new u;if(n instanceof u)n.each((function(n){e.add(n)}));else if(n){var r=-1,i=n.length;if(null==t)for(;++r<i;)e.add(n[r]);else for(;++r<i;)e.add(t(n[r],r,n))}return e}u.prototype=c.prototype={constructor:u,has:a.has,add:function(n){return this["$"+(n+="")]=n,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};var l=e("ZJVG"),f=function(n,t){var e,r,i,u,a=Object(l.a)("beforesend","progress","load","error"),c=o(),f=new XMLHttpRequest,s=null,p=null,h=0;function d(n){var t,r=f.status;if(!r&&function(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}(f)||r>=200&&r<300||304===r){if(i)try{t=i.call(e,f)}catch(o){return void a.call("error",e,o)}else t=f;a.call("load",e,t)}else a.call("error",e,n)}if("undefined"!=typeof XDomainRequest&&!("withCredentials"in f)&&/^(http(s)?:)?\/\//.test(n)&&(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=f.ontimeout=d:f.onreadystatechange=function(n){f.readyState>3&&d(n)},f.onprogress=function(n){a.call("progress",e,n)},e={header:function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?c.get(n):(null==t?c.remove(n):c.set(n,t+""),e)},mimeType:function(n){return arguments.length?(r=null==n?null:n+"",e):r},responseType:function(n){return arguments.length?(u=n,e):u},timeout:function(n){return arguments.length?(h=+n,e):h},user:function(n){return arguments.length<1?s:(s=null==n?null:n+"",e)},password:function(n){return arguments.length<1?p:(p=null==n?null:n+"",e)},response:function(n){return i=n,e},get:function(n,t){return e.send("GET",n,t)},post:function(n,t){return e.send("POST",n,t)},send:function(t,i,o){return f.open(t,n,!0,s,p),null==r||c.has("accept")||c.set("accept",r+",*/*"),f.setRequestHeader&&c.each((function(n,t){f.setRequestHeader(t,n)})),null!=r&&f.overrideMimeType&&f.overrideMimeType(r),null!=u&&(f.responseType=u),h>0&&(f.timeout=h),null==o&&"function"==typeof i&&(o=i,i=null),null!=o&&1===o.length&&(o=function(n){return function(t,e){n(null==t?e:null)}}(o)),null!=o&&e.on("error",o).on("load",(function(n){o(null,n)})),a.call("beforesend",e,f),f.send(null==i?null:i),e},abort:function(){return f.abort(),e},on:function(){var n=a.on.apply(a,arguments);return n===a?e:n}},null!=t){if("function"!=typeof t)throw new Error("invalid callback: "+t);return e.get(t)}return e};var s=function(n,t){return function(e,r){var i=f(e).mimeType(n).response(t);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},p=(s("text/html",(function(n){return document.createRange().createContextualFragment(n.responseText)})),s("application/json",(function(n){return JSON.parse(n.responseText)}))),h=(s("text/plain",(function(n){return n.responseText})),s("application/xml",(function(n){var t=n.responseXML;if(!t)throw new Error("parse error");return t})),{}),d={};function v(n){return new Function("d","return {"+n.map((function(n,t){return JSON.stringify(n)+": d["+t+"]"})).join(",")+"}")}var g=function(n){var t=new RegExp('["'+n+"\n\r]"),e=n.charCodeAt(0);function r(n,t){var r,i=[],o=n.length,u=0,a=0,c=o<=0,l=!1;function f(){if(c)return d;if(l)return l=!1,h;var t,r,i=u;if(34===n.charCodeAt(i)){for(;u++<o&&34!==n.charCodeAt(u)||34===n.charCodeAt(++u););return(t=u)>=o?c=!0:10===(r=n.charCodeAt(u++))?l=!0:13===r&&(l=!0,10===n.charCodeAt(u)&&++u),n.slice(i+1,t-1).replace(/""/g,'"')}for(;u<o;){if(10===(r=n.charCodeAt(t=u++)))l=!0;else if(13===r)l=!0,10===n.charCodeAt(u)&&++u;else if(r!==e)continue;return n.slice(i,t)}return c=!0,n.slice(i,o)}for(10===n.charCodeAt(o-1)&&--o,13===n.charCodeAt(o-1)&&--o;(r=f())!==d;){for(var s=[];r!==h&&r!==d;)s.push(r),r=f();t&&null==(s=t(s,a++))||i.push(s)}return i}function i(t){return t.map(o).join(n)}function o(n){return null==n?"":t.test(n+="")?'"'+n.replace(/"/g,'""')+'"':n}return{parse:function(n,t){var e,i,o=r(n,(function(n,r){if(e)return e(n,r-1);i=n,e=t?function(n,t){var e=v(n);return function(r,i){return t(e(r),i,n)}}(n,t):v(n)}));return o.columns=i||[],o},parseRows:r,format:function(t,e){return null==e&&(e=function(n){var t=Object.create(null),e=[];return n.forEach((function(n){for(var r in n)r in t||e.push(t[r]=r)})),e}(t)),[e.map(o).join(n)].concat(t.map((function(t){return e.map((function(n){return o(t[n])})).join(n)}))).join("\n")},formatRows:function(n){return n.map(i).join("\n")}}},m=g(","),y=m.parse,b=(m.parseRows,m.format,m.formatRows,g("\t")),E=b.parse,S=(b.parseRows,b.format,b.formatRows,function(n,t){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=f(e).mimeType(n);return o.row=function(n){return arguments.length?o.response(w(t,r=n)):r},o.row(r),i?o.get(i):o}});function w(n,t){return function(e){return n(e.responseText,t)}}S("text/csv",y),S("text/tab-separated-values",E);var M=e("q1tI"),x=e.n(M),N=e("8o2o"),_=e("9Hrx"),j=e("i8i4"),O=e.n(j),C=1e-6,R=Math.PI,T=R/2,k=R/4,A=2*R,D=180/R,F=R/180,z=Math.abs,P=Math.atan,$=Math.atan2,q=Math.cos,H=(Math.ceil,Math.exp),L=(Math.floor,Math.log),W=(Math.pow,Math.sin),B=Math.sign||function(n){return n>0?1:n<0?-1:0},J=Math.sqrt,I=Math.tan;function X(n){return n>1?T:n<-1?-T:Math.asin(n)}var V=function(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return(e=t.invert(e,r))&&n.invert(e[0],e[1])}),e};function Z(n,t){return[z(n)>R?n+Math.round(-n/A)*A:n,t]}function G(n,t,e){return(n%=A)?t||e?V(Y(n),K(t,e)):Y(n):t||e?K(t,e):Z}function U(n){return function(t,e){return[(t+=n)>R?t-A:t<-R?t+A:t,e]}}function Y(n){var t=U(n);return t.invert=U(-n),t}function K(n,t){var e=q(n),r=W(n),i=q(t),o=W(t);function u(n,t){var u=q(t),a=q(n)*u,c=W(n)*u,l=W(t),f=l*e+a*r;return[$(c*i-f*o,a*e-l*r),X(f*i+c*o)]}return u.invert=function(n,t){var u=q(t),a=q(n)*u,c=W(n)*u,l=W(t),f=l*i-c*o;return[$(c*i+l*o,a*e+f*r),X(f*e-a*r)]},u}Z.invert=Z;function Q(){}var nn=function(){var n,t=[];return{point:function(t,e,r){n.push([t,e,r])},lineStart:function(){t.push(n=[])},lineEnd:Q,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var e=t;return t=[],n=null,e}}},tn=function(n,t){return z(n[0]-t[0])<C&&z(n[1]-t[1])<C};function en(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}var rn=function(n,t,e,r,i){var o,u,a=[],c=[];if(n.forEach((function(n){if(!((t=n.length-1)<=0)){var t,e,r=n[0],u=n[t];if(tn(r,u)){if(!r[2]&&!u[2]){for(i.lineStart(),o=0;o<t;++o)i.point((r=n[o])[0],r[1]);return void i.lineEnd()}u[0]+=2*C}a.push(e=new en(r,n,null,!0)),c.push(e.o=new en(r,null,e,!1)),a.push(e=new en(u,n,null,!1)),c.push(e.o=new en(u,null,e,!0))}})),a.length){for(c.sort(t),on(a),on(c),o=0,u=c.length;o<u;++o)c[o].e=e=!e;for(var l,f,s=a[0];;){for(var p=s,h=!0;p.v;)if((p=p.n)===s)return;l=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(o=0,u=l.length;o<u;++o)i.point((f=l[o])[0],f[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(h)for(l=p.p.z,o=l.length-1;o>=0;--o)i.point((f=l[o])[0],f[1]);else r(p.x,p.p.x,-1,i);p=p.p}l=(p=p.o).z,h=!h}while(!p.v);i.lineEnd()}}};function on(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.n=e=n[r],e.p=i,i=e;i.n=e=n[0],e.p=i}}var un=function(){return new an};function an(){this.reset()}an.prototype={constructor:an,reset:function(){this.s=this.t=0},add:function(n){ln(cn,n,this.t),ln(this,cn.s,this.s),this.s?this.t+=cn.t:this.s=cn.t},valueOf:function(){return this.s}};var cn=new an;function ln(n,t,e){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}function fn(n){return[$(n[1],n[0]),X(n[2])]}function sn(n){var t=n[0],e=n[1],r=q(e);return[r*q(t),r*W(t),W(e)]}function pn(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function hn(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 dn(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function vn(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function gn(n){var t=J(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var mn=un();function yn(n){return z(n[0])<=R?n[0]:B(n[0])*((z(n[0])+R)%A-R)}var bn=function(n,t){return n<t?-1:n>t?1:n>=t?0:NaN};var En,Sn;1===(En=bn).length&&(Sn=En,En=function(n,t){return bn(Sn(n),t)});var wn=Array.prototype;wn.slice,wn.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var Mn=function(n){for(var t,e,r,i=n.length,o=-1,u=0;++o<i;)u+=n[o].length;for(e=new Array(u);--i>=0;)for(t=(r=n[i]).length;--t>=0;)e[--u]=r[t];return e};var xn=function(n,t,e,r){return function(i){var o,u,a,c=t(i),l=nn(),f=t(l),s=!1,p={point:h,lineStart:v,lineEnd:g,polygonStart:function(){p.point=m,p.lineStart=y,p.lineEnd=b,u=[],o=[]},polygonEnd:function(){p.point=h,p.lineStart=v,p.lineEnd=g,u=Mn(u);var n=function(n,t){var e=yn(t),r=t[1],i=W(r),o=[W(e),-q(e),0],u=0,a=0;mn.reset(),1===i?r=T+C:-1===i&&(r=-T-C);for(var c=0,l=n.length;c<l;++c)if(s=(f=n[c]).length)for(var f,s,p=f[s-1],h=yn(p),d=p[1]/2+k,v=W(d),g=q(d),m=0;m<s;++m,h=b,v=S,g=w,p=y){var y=f[m],b=yn(y),E=y[1]/2+k,S=W(E),w=q(E),M=b-h,x=M>=0?1:-1,N=x*M,_=N>R,j=v*S;if(mn.add($(j*x*W(N),g*w+j*q(N))),u+=_?M+x*A:M,_^h>=e^b>=e){var O=hn(sn(p),sn(y));gn(O);var D=hn(o,O);gn(D);var F=(_^M>=0?-1:1)*X(D[2]);(r>F||r===F&&(O[0]||O[1]))&&(a+=_^M>=0?1:-1)}}return(u<-C||u<C&&mn<-C)^1&a}(o,r);u.length?(s||(i.polygonStart(),s=!0),rn(u,_n,n,e,i)):n&&(s||(i.polygonStart(),s=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),s&&(i.polygonEnd(),s=!1),u=o=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(t,e){n(t,e)&&i.point(t,e)}function d(n,t){c.point(n,t)}function v(){p.point=d,c.lineStart()}function g(){p.point=h,c.lineEnd()}function m(n,t){a.push([n,t]),f.point(n,t)}function y(){f.lineStart(),a=[]}function b(){m(a[0][0],a[0][1]),f.lineEnd();var n,t,e,r,c=f.clean(),p=l.result(),h=p.length;if(a.pop(),o.push(a),a=null,h)if(1&c){if((t=(e=p[0]).length-1)>0){for(s||(i.polygonStart(),s=!0),i.lineStart(),n=0;n<t;++n)i.point((r=e[n])[0],r[1]);i.lineEnd()}}else h>1&&2&c&&p.push(p.pop().concat(p.shift())),u.push(p.filter(Nn))}return p}};function Nn(n){return n.length>1}function _n(n,t){return((n=n.x)[0]<0?n[1]-T-C:T-n[1])-((t=t.x)[0]<0?t[1]-T-C:T-t[1])}var jn=xn((function(){return!0}),(function(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(o,u){var a=o>0?R:-R,c=z(o-e);z(c-R)<C?(n.point(e,r=(r+u)/2>0?T:-T),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(o,r),t=0):i!==a&&c>=R&&(z(e-i)<C&&(e-=i*C),z(o-a)<C&&(o-=a*C),r=function(n,t,e,r){var i,o,u=W(n-e);return z(u)>C?P((W(t)*(o=q(r))*W(e)-W(r)*(i=q(t))*W(n))/(i*o*u)):(t+r)/2}(e,r,o,u),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=o,r=u),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}),(function(n,t,e,r){var i;if(null==n)i=e*T,r.point(-R,i),r.point(0,i),r.point(R,i),r.point(R,0),r.point(R,-i),r.point(0,-i),r.point(-R,-i),r.point(-R,0),r.point(-R,i);else if(z(n[0]-t[0])>C){var o=n[0]<t[0]?R:-R;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}),[-R,-T]);function On(n,t,e,r,i,o){if(e){var u=q(t),a=W(t),c=r*e;null==i?(i=t+r*A,o=t-c/2):(i=Cn(u,i),o=Cn(u,o),(r>0?i<o:i>o)&&(i+=r*A));for(var l,f=i;r>0?f>o:f<o;f-=c)l=fn([u,-a*q(f),-a*W(f)]),n.point(l[0],l[1])}}function Cn(n,t){(t=sn(t))[0]-=n,gn(t);var e,r=(e=-t[1])>1?0:e<-1?R:Math.acos(e);return((-t[2]<0?-r:r)+A-C)%A}var Rn=function(n){var t=q(n),e=6*F,r=t>0,i=z(t)>C;function o(n,e){return q(n)*q(e)>t}function u(n,e,r){var i=[1,0,0],o=hn(sn(n),sn(e)),u=pn(o,o),a=o[0],c=u-a*a;if(!c)return!r&&n;var l=t*u/c,f=-t*a/c,s=hn(i,o),p=vn(i,l);dn(p,vn(o,f));var h=s,d=pn(p,h),v=pn(h,h),g=d*d-v*(pn(p,p)-1);if(!(g<0)){var m=J(g),y=vn(h,(-d-m)/v);if(dn(y,p),y=fn(y),!r)return y;var b,E=n[0],S=e[0],w=n[1],M=e[1];S<E&&(b=E,E=S,S=b);var x=S-E,N=z(x-R)<C;if(!N&&M<w&&(b=w,w=M,M=b),N||x<C?N?w+M>0^y[1]<(z(y[0]-E)<C?w:M):w<=y[1]&&y[1]<=M:x>R^(E<=y[0]&&y[0]<=S)){var _=vn(h,(-d+m)/v);return dn(_,p),[y,fn(_)]}}}function a(t,e){var i=r?n:R-n,o=0;return t<-i?o|=1:t>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return xn(o,(function(n){var t,e,c,l,f;return{lineStart:function(){l=c=!1,f=1},point:function(s,p){var h,d=[s,p],v=o(s,p),g=r?v?0:a(s,p):v?a(s+(s<0?R:-R),p):0;if(!t&&(l=c=v)&&n.lineStart(),v!==c&&(!(h=u(t,d))||tn(t,h)||tn(d,h))&&(d[2]=1),v!==c)f=0,v?(n.lineStart(),h=u(d,t),n.point(h[0],h[1])):(h=u(t,d),n.point(h[0],h[1],2),n.lineEnd()),t=h;else if(i&&t&&r^v){var m;g&e||!(m=u(d,t,!0))||(f=0,r?(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],3)))}!v||t&&tn(t,d)||n.point(d[0],d[1]),t=d,c=v,e=g},lineEnd:function(){c&&n.lineEnd(),t=null},clean:function(){return f|(l&&c)<<1}}}),(function(t,r,i,o){On(o,n,e,i,t,r)}),r?[0,-n]:[-R,n-R])};function Tn(n,t,e,r){function i(i,o){return n<=i&&i<=e&&t<=o&&o<=r}function o(i,o,a,l){var f=0,s=0;if(null==i||(f=u(i,a))!==(s=u(o,a))||c(i,o)<0^a>0)do{l.point(0===f||3===f?n:e,f>1?r:t)}while((f=(f+a+4)%4)!==s);else l.point(o[0],o[1])}function u(r,i){return z(r[0]-n)<C?i>0?0:3:z(r[0]-e)<C?i>0?2:1:z(r[1]-t)<C?i>0?1:0:i>0?3:2}function a(n,t){return c(n.x,t.x)}function c(n,t){var e=u(n,1),r=u(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]}return function(u){var c,l,f,s,p,h,d,v,g,m,y,b=u,E=nn(),S={point:w,lineStart:function(){S.point=M,l&&l.push(f=[]);m=!0,g=!1,d=v=NaN},lineEnd:function(){c&&(M(s,p),h&&g&&E.rejoin(),c.push(E.result()));S.point=w,g&&b.lineEnd()},polygonStart:function(){b=E,c=[],l=[],y=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,i=l.length;e<i;++e)for(var o,u,a=l[e],c=1,f=a.length,s=a[0],p=s[0],h=s[1];c<f;++c)o=p,u=h,s=a[c],p=s[0],h=s[1],u<=r?h>r&&(p-o)*(r-u)>(h-u)*(n-o)&&++t:h<=r&&(p-o)*(r-u)<(h-u)*(n-o)&&--t;return t}(),e=y&&t,i=(c=Mn(c)).length;(e||i)&&(u.polygonStart(),e&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),i&&rn(c,a,t,o,u),u.polygonEnd());b=u,c=l=f=null}};function w(n,t){i(n,t)&&b.point(n,t)}function M(o,u){var a=i(o,u);if(l&&f.push([o,u]),m)s=o,p=u,h=a,m=!1,a&&(b.lineStart(),b.point(o,u));else if(a&&g)b.point(o,u);else{var c=[d=Math.max(-1e9,Math.min(1e9,d)),v=Math.max(-1e9,Math.min(1e9,v))],E=[o=Math.max(-1e9,Math.min(1e9,o)),u=Math.max(-1e9,Math.min(1e9,u))];!function(n,t,e,r,i,o){var u,a=n[0],c=n[1],l=0,f=1,s=t[0]-a,p=t[1]-c;if(u=e-a,s||!(u>0)){if(u/=s,s<0){if(u<l)return;u<f&&(f=u)}else if(s>0){if(u>f)return;u>l&&(l=u)}if(u=i-a,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>l&&(l=u)}else if(s>0){if(u<l)return;u<f&&(f=u)}if(u=r-c,p||!(u>0)){if(u/=p,p<0){if(u<l)return;u<f&&(f=u)}else if(p>0){if(u>f)return;u>l&&(l=u)}if(u=o-c,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>l&&(l=u)}else if(p>0){if(u<l)return;u<f&&(f=u)}return l>0&&(n[0]=a+l*s,n[1]=c+l*p),f<1&&(t[0]=a+f*s,t[1]=c+f*p),!0}}}}}(c,E,n,t,e,r)?a&&(b.lineStart(),b.point(o,u),y=!1):(g||(b.lineStart(),b.point(c[0],c[1])),b.point(E[0],E[1]),a||b.lineEnd(),y=!1)}d=o,v=u,g=a}return S}}var kn=function(n){return n};function An(n){return function(t){var e=new Dn;for(var r in n)e[r]=n[r];return e.stream=t,e}}function Dn(){}function Fn(n,t){n&&Pn.hasOwnProperty(n.type)&&Pn[n.type](n,t)}Dn.prototype={constructor:Dn,point:function(n,t){this.stream.point(n,t)},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 zn={Feature:function(n,t){Fn(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)Fn(e[r].geometry,t)}},Pn={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){$n(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)$n(e[r],t,0)},Polygon:function(n,t){qn(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)qn(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)Fn(e[r],t)}};function $n(n,t,e){var r,i=-1,o=n.length-e;for(t.lineStart();++i<o;)r=n[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function qn(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)$n(n[e],t,1);t.polygonEnd()}var Hn=function(n,t){n&&zn.hasOwnProperty(n.type)?zn[n.type](n,t):Fn(n,t)},Ln=1/0,Wn=Ln,Bn=-Ln,Jn=Bn;var In={point:function(n,t){n<Ln&&(Ln=n);n>Bn&&(Bn=n);t<Wn&&(Wn=t);t>Jn&&(Jn=t)},lineStart:Q,lineEnd:Q,polygonStart:Q,polygonEnd:Q,result:function(){var n=[[Ln,Wn],[Bn,Jn]];return Bn=Jn=-(Wn=Ln=1/0),n}};function Xn(n,t,e){var r=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=r&&n.clipExtent(null),Hn(e,n.stream(In)),t(In.result()),null!=r&&n.clipExtent(r),n}function Vn(n,t,e){return Xn(n,(function(e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),u=+t[0][0]+(r-o*(e[1][0]+e[0][0]))/2,a=+t[0][1]+(i-o*(e[1][1]+e[0][1]))/2;n.scale(150*o).translate([u,a])}),e)}var Zn=q(30*F),Gn=function(n,t){return+t?function(n,t){function e(r,i,o,u,a,c,l,f,s,p,h,d,v,g){var m=l-r,y=f-i,b=m*m+y*y;if(b>4*t&&v--){var E=u+p,S=a+h,w=c+d,M=J(E*E+S*S+w*w),x=X(w/=M),N=z(z(w)-1)<C||z(o-s)<C?(o+s)/2:$(S,E),_=n(N,x),j=_[0],O=_[1],R=j-r,T=O-i,k=y*R-m*T;(k*k/b>t||z((m*R+y*T)/b-.5)>.3||u*p+a*h+c*d<Zn)&&(e(r,i,o,u,a,c,j,O,N,E/=M,S/=M,w,v,g),g.point(j,O),e(j,O,N,E,S,w,l,f,s,p,h,d,v,g))}}return function(t){var r,i,o,u,a,c,l,f,s,p,h,d,v={point:g,lineStart:m,lineEnd:b,polygonStart:function(){t.polygonStart(),v.lineStart=E},polygonEnd:function(){t.polygonEnd(),v.lineStart=m}};function g(e,r){e=n(e,r),t.point(e[0],e[1])}function m(){f=NaN,v.point=y,t.lineStart()}function y(r,i){var o=sn([r,i]),u=n(r,i);e(f,s,l,p,h,d,f=u[0],s=u[1],l=r,p=o[0],h=o[1],d=o[2],16,t),t.point(f,s)}function b(){v.point=g,t.lineEnd()}function E(){m(),v.point=S,v.lineEnd=w}function S(n,t){y(r=n,t),i=f,o=s,u=p,a=h,c=d,v.point=y}function w(){e(f,s,l,p,h,d,i,o,r,u,a,c,16,t),v.lineEnd=b,b()}return v}}(n,t):function(n){return An({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}})}(n)};var Un=An({point:function(n,t){this.stream.point(n*F,t*F)}});function Yn(n,t,e,r,i){function o(o,u){return[t+n*(o*=r),e-n*(u*=i)]}return o.invert=function(o,u){return[(o-t)/n*r,(e-u)/n*i]},o}function Kn(n,t,e,r,i,o){var u=q(o),a=W(o),c=u*n,l=a*n,f=u/n,s=a/n,p=(a*e-u*t)/n,h=(a*t+u*e)/n;function d(n,o){return[c*(n*=r)-l*(o*=i)+t,e-l*n-c*o]}return d.invert=function(n,t){return[r*(f*n-s*t+p),i*(h-s*n-f*t)]},d}function Qn(n){return function(n){var t,e,r,i,o,u,a,c,l,f,s=150,p=480,h=250,d=0,v=0,g=0,m=0,y=0,b=0,E=1,S=1,w=null,M=jn,x=null,N=kn,_=.5;function j(n){return c(n[0]*F,n[1]*F)}function O(n){return(n=c.invert(n[0],n[1]))&&[n[0]*D,n[1]*D]}function C(){var n=Kn(s,0,0,E,S,b).apply(null,t(d,v)),r=(b?Kn:Yn)(s,p-n[0],h-n[1],E,S,b);return e=G(g,m,y),a=V(t,r),c=V(e,a),u=Gn(a,_),R()}function R(){return l=f=null,j}return j.stream=function(n){return l&&f===n?l:l=Un(function(n){return An({point:function(t,e){var r=n(t,e);return this.stream.point(r[0],r[1])}})}(e)(M(u(N(f=n)))))},j.preclip=function(n){return arguments.length?(M=n,w=void 0,R()):M},j.postclip=function(n){return arguments.length?(N=n,x=r=i=o=null,R()):N},j.clipAngle=function(n){return arguments.length?(M=+n?Rn(w=n*F):(w=null,jn),R()):w*D},j.clipExtent=function(n){return arguments.length?(N=null==n?(x=r=i=o=null,kn):Tn(x=+n[0][0],r=+n[0][1],i=+n[1][0],o=+n[1][1]),R()):null==x?null:[[x,r],[i,o]]},j.scale=function(n){return arguments.length?(s=+n,C()):s},j.translate=function(n){return arguments.length?(p=+n[0],h=+n[1],C()):[p,h]},j.center=function(n){return arguments.length?(d=n[0]%360*F,v=n[1]%360*F,C()):[d*D,v*D]},j.rotate=function(n){return arguments.length?(g=n[0]%360*F,m=n[1]%360*F,y=n.length>2?n[2]%360*F:0,C()):[g*D,m*D,y*D]},j.angle=function(n){return arguments.length?(b=n%360*F,C()):b*D},j.reflectX=function(n){return arguments.length?(E=n?-1:1,C()):E<0},j.reflectY=function(n){return arguments.length?(S=n?-1:1,C()):S<0},j.precision=function(n){return arguments.length?(u=Gn(a,_=n*n),R()):J(_)},j.fitExtent=function(n,t){return Vn(j,n,t)},j.fitSize=function(n,t){return function(n,t,e){return Vn(n,[[0,0],t],e)}(j,n,t)},j.fitWidth=function(n,t){return function(n,t,e){return Xn(n,(function(e){var r=+t,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,u=-i*e[0][1];n.scale(150*i).translate([o,u])}),e)}(j,n,t)},j.fitHeight=function(n,t){return function(n,t,e){return Xn(n,(function(e){var r=+t,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],u=(r-i*(e[1][1]+e[0][1]))/2;n.scale(150*i).translate([o,u])}),e)}(j,n,t)},function(){return t=n.apply(this,arguments),j.invert=t.invert&&O,C()}}((function(){return n}))()}function nt(n,t){return[n,L(I((T+t)/2))]}nt.invert=function(n,t){return[n,2*P(H(t))-T]};var tt=function(){return function(n){var t,e,r,i=Qn(n),o=i.center,u=i.scale,a=i.translate,c=i.clipExtent,l=null;function f(){var o=R*u(),a=i(function(n){function t(t){return(t=n(t[0]*F,t[1]*F))[0]*=D,t[1]*=D,t}return n=G(n[0]*F,n[1]*F,n.length>2?n[2]*F:0),t.invert=function(t){return(t=n.invert(t[0]*F,t[1]*F))[0]*=D,t[1]*=D,t},t}(i.rotate()).invert([0,0]));return c(null==l?[[a[0]-o,a[1]-o],[a[0]+o,a[1]+o]]:n===nt?[[Math.max(a[0]-o,l),t],[Math.min(a[0]+o,e),r]]:[[l,Math.max(a[1]-o,t)],[e,Math.min(a[1]+o,r)]])}return i.scale=function(n){return arguments.length?(u(n),f()):u()},i.translate=function(n){return arguments.length?(a(n),f()):a()},i.center=function(n){return arguments.length?(o(n),f()):o()},i.clipExtent=function(n){return arguments.length?(null==n?l=t=e=r=null:(l=+n[0][0],t=+n[0][1],e=+n[1][0],r=+n[1][1]),f()):null==l?null:[[l,t],[e,r]]},f()}(nt).scale(961/A)};var et,rt,it,ot,ut=un(),at=un(),ct={point:Q,lineStart:Q,lineEnd:Q,polygonStart:function(){ct.lineStart=lt,ct.lineEnd=pt},polygonEnd:function(){ct.lineStart=ct.lineEnd=ct.point=Q,ut.add(z(at)),at.reset()},result:function(){var n=ut/2;return ut.reset(),n}};function lt(){ct.point=ft}function ft(n,t){ct.point=st,et=it=n,rt=ot=t}function st(n,t){at.add(ot*n-it*t),it=n,ot=t}function pt(){st(et,rt)}var ht,dt,vt,gt,mt=ct,yt=0,bt=0,Et=0,St=0,wt=0,Mt=0,xt=0,Nt=0,_t=0,jt={point:Ot,lineStart:Ct,lineEnd:kt,polygonStart:function(){jt.lineStart=At,jt.lineEnd=Dt},polygonEnd:function(){jt.point=Ot,jt.lineStart=Ct,jt.lineEnd=kt},result:function(){var n=_t?[xt/_t,Nt/_t]:Mt?[St/Mt,wt/Mt]:Et?[yt/Et,bt/Et]:[NaN,NaN];return yt=bt=Et=St=wt=Mt=xt=Nt=_t=0,n}};function Ot(n,t){yt+=n,bt+=t,++Et}function Ct(){jt.point=Rt}function Rt(n,t){jt.point=Tt,Ot(vt=n,gt=t)}function Tt(n,t){var e=n-vt,r=t-gt,i=J(e*e+r*r);St+=i*(vt+n)/2,wt+=i*(gt+t)/2,Mt+=i,Ot(vt=n,gt=t)}function kt(){jt.point=Ot}function At(){jt.point=Ft}function Dt(){zt(ht,dt)}function Ft(n,t){jt.point=zt,Ot(ht=vt=n,dt=gt=t)}function zt(n,t){var e=n-vt,r=t-gt,i=J(e*e+r*r);St+=i*(vt+n)/2,wt+=i*(gt+t)/2,Mt+=i,xt+=(i=gt*n-vt*t)*(vt+n),Nt+=i*(gt+t),_t+=3*i,Ot(vt=n,gt=t)}var Pt=jt;function $t(n){this._context=n}$t.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,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(n,t){switch(this._point){case 0:this._context.moveTo(n,t),this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,A)}},result:Q};var qt,Ht,Lt,Wt,Bt,Jt=un(),It={point:Q,lineStart:function(){It.point=Xt},lineEnd:function(){qt&&Vt(Ht,Lt),It.point=Q},polygonStart:function(){qt=!0},polygonEnd:function(){qt=null},result:function(){var n=+Jt;return Jt.reset(),n}};function Xt(n,t){It.point=Vt,Ht=Wt=n,Lt=Bt=t}function Vt(n,t){Wt-=n,Bt-=t,Jt.add(J(Wt*Wt+Bt*Bt)),Wt=n,Bt=t}var Zt=It;function Gt(){this._string=[]}function Ut(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}Gt.prototype={_radius:4.5,_circle:Ut(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),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(n,t){switch(this._point){case 0:this._string.push("M",n,",",t),this._point=1;break;case 1:this._string.push("L",n,",",t);break;default:null==this._circle&&(this._circle=Ut(this._radius)),this._string.push("M",n,",",t,this._circle)}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}return null}};var Yt=e("PVJp"),Kt=e("HVn3"),Qt=e.n(Kt),ne=function(){var n,t,e={className:"map-d3",data:[],geojson:{features:[],type:"FeatureCollection"},height:200,width:200};return{create:function(r,i){void 0===i&&(i={}),this.mergeProps(i),this._makeSvg(r),t=n.append("g").attr("class","histogram-container"),this.update(e)},mergeProps:function(n){Qt()(e,n),e.data=n.data},_makeSvg:function(t){if(n){n.selectAll("svg > *").remove(),n.remove();var r=t.getElementsByTagName("svg");r.length>0&&t.removeChild(r[0])}var i=e.width,o=e.height,u=e.className;n=Object(Yt.a)(t).append("svg").attr("class",u).attr("width",i).attr("height",o).attr("viewBox","0 0 "+i+" "+o).append("g")},updateChart:function(n,r){var i=e.width,o=e.height,u=tt().scale(Number(i)/2/Math.PI*3).translate([Number(i)/2,o/2]),a=function(n,t){var e,r,i=4.5;function o(n){return n&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Hn(n,e(r))),r.result()}return o.area=function(n){return Hn(n,e(mt)),mt.result()},o.measure=function(n){return Hn(n,e(Zt)),Zt.result()},o.bounds=function(n){return Hn(n,e(In)),In.result()},o.centroid=function(n){return Hn(n,e(Pt)),Pt.result()},o.projection=function(t){return arguments.length?(e=null==t?(n=null,kn):(n=t).stream,o):n},o.context=function(n){return arguments.length?(r=null==n?(t=null,new Gt):new $t(t=n),"function"!=typeof i&&r.pointRadius(i),o):t},o.pointRadius=function(n){return arguments.length?(i="function"==typeof n?n:(r.pointRadius(+n),+n),o):i},o.projection(n).context(t)}().projection(u);t.selectAll("path").data(r.features).enter().append("path").attr("d",a)},update:function(n){if(e.data){this.mergeProps(n);var t=e.data,r=e.geojson;this.updateChart(t,r)}},destroy:function(){n.selectAll("svg > *").remove()}}},te=function(n){function t(t){var e;return(e=n.call(this,t)||this).ref=null,e.chart=ne(),e.state={parentWidth:300},e}Object(_.a)(t,n);var e=t.prototype;return e.handleResize=function(){var n=this,t=this.getDOMNode();if(t){var e=this.ref&&this.ref.offsetWidth?this.ref.offsetWidth:0;this.setState({parentWidth:e},(function(){return n.chart.create(t,n.getChartState())}))}},e.componentDidMount=function(){var n=this,t=this.getDOMNode();t&&(this.chart.create(t,this.getChartState()),"100%"===this.props.width&&(window.addEventListener("resize",(function(t){return n.handleResize()})),this.handleResize()))},e.componentDidUpdate=function(){this.getDOMNode()&&this.chart.update(this.getChartState())},e.getChartState=function(){var n=this.props.width,t=this.props,e=(t.children,Object(N.a)(t,["children"]));return"100%"===n&&(n=this.state.parentWidth||300),Object.assign({},e,{width:n})},e.componentWillUnmount=function(){this.getDOMNode()&&("100%"===this.props.width&&window.removeEventListener("resize",this.handleResize),this.chart.destroy())},e.getDOMNode=function(){var n=O.a.findDOMNode(this.ref);try{if(n instanceof Text)return;return n}catch(t){return n}},e.render=function(){var n=this;return x.a.createElement("div",{ref:function(t){return n.ref=t},className:"map-chart-container"})},t}(M.Component),ee=e("9Dj+"),re=e("H8eV"),ie=e("5++N");t.default=function(){var n=Object(M.useState)(!0),t=n[0],e=n[1],r=Object(M.useState)(null),i=r[0],o=r[1];return Object(M.useEffect)((function(){p("https://opendata.arcgis.com/datasets/8d3a9e6e7bd445e2bdcc26cdf007eac7_3.geojson",(function(n,t){if(n)throw n;o(t),e(!1)}))}),[]),t?x.a.createElement("div",null,"loading"):x.a.createElement(ee.a,null,x.a.createElement(re.a,{title:"Histogram",description:""}),x.a.createElement("h1",null,"Map"),x.a.createElement("div",null,x.a.createElement(te,{data:ie.b,geojson:i,height:400,width:400})))}},"5++N":function(n,t,e){"use strict";e.d(t,"d",(function(){return u})),e.d(t,"e",(function(){return a})),e.d(t,"f",(function(){return c})),e.d(t,"b",(function(){return l})),e.d(t,"a",(function(){return f})),e.d(t,"c",(function(){return s})),e.d(t,"g",(function(){return p}));var r=e("z1is"),i=e("o6j4"),o=e("Up1k"),u={x:{height:100,visible:!0,style:Object.assign({},o.a,{stroke:"#ccc","stroke-opacity":.4}),ticks:5},y:{visible:!0,style:Object.assign({},o.a,{stroke:"#ccc","stroke-opacity":.4}),ticks:6}},a={bins:["Female long label test","Male","Other"],counts:[{data:[79200,52400,13300],label:"Baseline"},{data:[6e4,34230,1e4],label:"Filtered"}]},c={bins:[[0,50],[50,150],[150,300]],counts:[{data:[500,2e3,1500],label:"Baseline"}]},l={bins:["Female","Male","Other","sdfdfg","dagdsg","sfsd","ds34fsdf","dfsfsd","sdfs34dfs","ghf34hfg","fd33gag","jg343hj","a343wes","ye343ye","fd343gjs","sdfd343fg","34","sfsd","433","45245","745"],counts:[{data:[58483,52400,13300,79200,52400,13300,79200,52400,13300,79200,52400,13300,79200,52400,13300,79200,52400,13300,79200,52400,13300],label:"Baseline"},{data:[54932,34230,1e4,6e4,34230,1e4,6e4,34230,1e4,6e4,34230,1e4,6e4,34230,1e4,6e4,34230,1e4,6e4,34230,1e4],label:"Filtered"}]},f={x:{scale:"linear",numberFormat:".2s",labelOrientation:i.a.HORIZONTAL},y:{numberFormat:".2s",labelOrientation:i.a.HORIZONTAL}},s={bins:["bin 1","bin 2","bin 3 with a long name","bin 4","bin 5","bin 6","bin 7"],counts:[{borderColors:["red"],data:[1,2,3,4,5,6,7],label:"Data 1"}],title:"Plot 1"},p=Object(r.a)(["rgba(255, 113, 1, 0.5)","#fff6ef","rgba(0, 169, 123, 0.5)","#f6fffd","#D7263D","rgba(215, 38, 61, 0.05)","#0f2629","#ededed","rgba(86, 180, 191, 0.5)","#f5fbfb","#000000","#0f2629","#D7263D","#FBD7D9","#ffebec","#963540","#22545a","#56b4bf","#56b4bf","#56b4bf","#FF7101","#449098","#77c3cb","#d4eef8","#ff7101","#FF7101","#cc5a00","#ff8d33","#fef9e5","#7d5d2e","#00a97b","#008762","#33ba95","#dbf1d6","#227839","#0f5e7b","#d4eef8","#0f5e7b","#F9C80E","#007656","#c5e5e9","#f9c80e","#a9a9a9","#dbdbdb","#cccccc","#e6e6e6","#56b4bf","#449098","#77c3cb","#22545a","#ff7101","#cdcdcd","#ffffff","#d7263d","#00a97b","#888888","#e6e6e6","#f2f2f2","#f4f4f4"])}}]); //# sourceMappingURL=component---src-pages-map-tsx-9d2aaf0df1ef46ce9158.js.map