From dba5e341ee99abfdef70d77bcd66f457b782d54f Mon Sep 17 00:00:00 2001 From: andres-rubio-go <132520982+andres-rubio-go@users.noreply.github.com> Date: Thu, 5 Oct 2023 21:14:51 +0000 Subject: [PATCH] fix: No results message not showing (#5) * fix: No results message not showing * fix: Render using react * fix: Changed to a zero comparison --- packed_bubble.js | 2 +- src/bubble_chart/bubble_chart_container.js | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packed_bubble.js b/packed_bubble.js index b046252..08bf31e 100644 --- a/packed_bubble.js +++ b/packed_bubble.js @@ -51,4 +51,4 @@ and limitations under the License. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case d:case o:case u:case l:case p:return e;default:switch(e=e&&e.$$typeof){case s:case h:case v:case g:case c:return e;default:return t}}case a:return t}}}function C(e){return k(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=s,t.ContextProvider=c,t.Element=i,t.ForwardRef=h,t.Fragment=o,t.Lazy=v,t.Memo=g,t.Portal=a,t.Profiler=u,t.StrictMode=l,t.Suspense=p,t.isAsyncMode=function(e){return C(e)||k(e)===f},t.isConcurrentMode=C,t.isContextConsumer=function(e){return k(e)===s},t.isContextProvider=function(e){return k(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return k(e)===h},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===v},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===a},t.isProfiler=function(e){return k(e)===u},t.isStrictMode=function(e){return k(e)===l},t.isSuspense=function(e){return k(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===u||e===l||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===g||e.$$typeof===c||e.$$typeof===s||e.$$typeof===h||e.$$typeof===b||e.$$typeof===w||e.$$typeof===x||e.$$typeof===y)},t.typeOf=k},function(e,t,n){e.exports=n(55)()},function(e,t,n){"use strict";var r=n(56);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),a=n(9),o=n.n(a),l=function(e,t){return et?1:e>=t?0:NaN},u=function(e){return 1===e.length&&(e=function(e){return function(t,n){return l(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[a],n)<0?r=a+1:i=a}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}(l);u.right,u.left;var c=Array.prototype;c.slice,c.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),Array.prototype.slice;var s={value:function(){}};function f(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",r),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),a=0;at?1:e>=t?0:NaN}var E="http://www.w3.org/1999/xhtml",A={svg:"http://www.w3.org/2000/svg",xhtml:E,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},_=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),A.hasOwnProperty(t)?{space:A[t],local:e}:e},M=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};function N(e,t){return e.style.getPropertyValue(t)||M(e).getComputedStyle(e,null).getPropertyValue(t)}function O(e){return e.trim().split(/^|\s+/)}function P(e){return e.classList||new D(e)}function D(e){this._node=e,this._names=O(e.getAttribute("class")||"")}function I(e,t){for(var n=P(e),r=-1,i=t.length;++r=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var j=function(e){var t=_(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===E&&t.documentElement.namespaceURI===E?t.createElement(e):t.createElementNS(n,e)}})(t)};function H(){return null}function W(){var e=this.parentNode;e&&e.removeChild(this)}function B(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function V(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}var Y={},q=null;function G(e,t,n){return e=K(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function K(e,t,n){return function(r){var i=q;q=r;try{e.call(this,this.__data__,t,n)}finally{q=i}}}function X(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,a=t.length;r=w&&(w=b+1);!(y=g[w])&&++w=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=S);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):N(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=O(e+"");if(arguments.length<2){for(var r=P(this.node()),i=-1,a=n.length;++i=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),o=a.length;if(!(arguments.length<2)){for(l=t?Q:X,null==n&&(n=!1),r=0;r>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=se.exec(e))?new Ce(t[1],t[2],t[3],1):(t=fe.exec(e))?new Ce(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=de.exec(e))?xe(t[1],t[2],t[3],t[4]):(t=he.exec(e))?xe(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pe.exec(e))?Ae(t[1],t[2]/100,t[3]/100,1):(t=me.exec(e))?Ae(t[1],t[2]/100,t[3]/100,t[4]):ge.hasOwnProperty(e)?we(ge[e]):"transparent"===e?new Ce(NaN,NaN,NaN,0):null}function we(e){return new Ce(e>>16&255,e>>8&255,255&e,1)}function xe(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ce(e,t,n,r)}function ke(e,t,n,r){return 1===arguments.length?function(e){return e instanceof ae||(e=be(e)),e?new Ce((e=e.rgb()).r,e.g,e.b,e.opacity):new Ce}(e):new Ce(e,t,n,null==r?1:r)}function Ce(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Te(){return"#"+Ee(this.r)+Ee(this.g)+Ee(this.b)}function Se(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function Ee(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ae(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Me(e,t,n,r)}function _e(e){if(e instanceof Me)return new Me(e.h,e.s,e.l,e.opacity);if(e instanceof ae||(e=be(e)),!e)return new Me;if(e instanceof Me)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,u=(a+i)/2;return l?(o=t===a?(n-r)/l+6*(n0&&u<1?0:o,new Me(o,l,u,e.opacity)}function Me(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ne(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Oe(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}re(ae,be,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ve,formatHex:ve,formatHsl:function(){return _e(this).formatHsl()},formatRgb:ye,toString:ye}),re(Ce,ke,ie(ae,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Te,formatHex:Te,formatRgb:Se,toString:Se})),re(Me,(function(e,t,n,r){return 1===arguments.length?_e(e):new Me(e,t,n,null==r?1:r)}),ie(ae,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Me(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Me(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ce(Ne(e>=240?e-240:e+120,i,r),Ne(e,i,r),Ne(e<120?e+240:e-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},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Pe=function(e){return function(){return e}};function De(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Pe(isNaN(e)?t:e)}var Ie=function e(t){var n=function(e){return 1==(e=+e)?De:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Pe(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ke(e)).r,(t=ke(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=De(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return r.gamma=e,r}(1);function Re(e){return function(t){var n,r,i=t.length,a=new Array(i),o=new Array(i),l=new Array(i);for(n=0;n=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,l=ra&&(i=t.slice(a,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,u.push({i:o,x:Le(n,r)})),a=je.lastIndex;return a=0&&t._call.call(null,e),t=t._next;--We}()}finally{We=0,function(){for(var e,t,n=ze,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ze=t);Fe=e,nt(r)}(),qe=0}}function tt(){var e=Ke.now(),t=e-Ye;t>1e3&&(Ge-=t,Ye=e)}function nt(e){We||(Be&&(Be=clearTimeout(Be)),e-qe>24?(e<1/0&&(Be=setTimeout(et,e-Ke.now()-Ge)),Ve&&(Ve=clearInterval(Ve))):(Ve||(Ye=Ke.now(),Ve=setInterval(tt,1e3)),We=1,Xe(et)))}Je.prototype=$e.prototype={constructor:Je,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Qe():+n)+(null==t?0:+t),this._next||Fe===this||(Fe?Fe._next=this:ze=this,Fe=this),this._call=e,this._time=n,nt()},stop:function(){this._call&&(this._call=null,this._time=1/0,nt())}};var rt=function(e,t,n){var r=new Je;return t=null==t?0:+t,r.restart((function(n){r.stop(),e(n+t)}),t,n),r},it=m("start","end","cancel","interrupt"),at=[],ot=function(e,t,n,r,i,a){var o=e.__transition;if(o){if(n in o)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function a(u){var c,s,f,d;if(1!==n.state)return l();for(c in i)if((d=i[c]).name===n.name){if(3===d.state)return rt(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function ut(e,t){var n=ct(e,t);if(n.state>3)throw new Error("too late; already running");return n}function ct(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}var st,ft,dt,ht,pt=180/Math.PI,mt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},gt=function(e,t,n,r,i,a){var o,l,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Le(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(a.rotate,o.rotate,l,u),function(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Le(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(a.skewX,o.skewX,l,u),function(e,t,n,r,a,o){if(e!==n||t!==r){var l=a.push(i(a)+"scale(",null,",",null,")");o.push({i:l-4,x:Le(e,n)},{i:l-2,x:Le(t,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,l,u),a=o=null,function(e){for(var t,n=-1,r=u.length;++n=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?lt:ut;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}(n,e,t))},attr:function(e,t){var n=_(e),r="transform"===n?bt:xt;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,i,a;return function(){var o,l,u=n(this);if(null!=u)return(o=this.getAttributeNS(e.space,e.local))===(l=u+"")?null:o===r&&l===i?a:(i=l,a=t(r=o,u));this.removeAttributeNS(e.space,e.local)}}:function(e,t,n){var r,i,a;return function(){var o,l,u=n(this);if(null!=u)return(o=this.getAttribute(e))===(l=u+"")?null:o===r&&l===i?a:(i=l,a=t(r=o,u));this.removeAttribute(e)}})(n,r,wt(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}:function(e,t,n){var r,i,a=n+"";return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=_(e);return this.tween(n,(r.local?function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,i)),n}return i._value=t,i}:function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,i)),n}return i._value=t,i})(r,t))},style:function(e,t,n){var r="transform"==(e+="")?yt:xt;return null==t?this.styleTween(e,function(e,t){var n,r,i;return function(){var a=N(this,e),o=(this.style.removeProperty(e),N(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}(e,r)).on("end.style."+e,Ct(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,i,a;return function(){var o=N(this,e),l=n(this),u=l+"";return null==l&&(this.style.removeProperty(e),u=l=N(this,e)),o===u?null:o===r&&u===i?a:(i=u,a=t(r=o,l))}}(e,r,wt(this,"style."+e,t))).each(function(e,t){var n,r,i,a,o="style."+t,l="end."+o;return function(){var u=ut(this,e),c=u.on,s=null==u.value[o]?a||(a=Ct(t)):void 0;c===n&&i===s||(r=(n=c).copy()).on(l,i=s),u.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,i,a=n+"";return function(){var o=N(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(wt(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=ct(this.node(),n).tween,a=0,o=i.length;a2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete e.__transition}}(this,e)}))},te.prototype.transition=function(e){var t,n;e instanceof St?(t=e._id,e=e._name):(t=Et(),(n=_t).time=Qe(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,a=0;a1e-6)if(Math.abs(s*l-u*c)>1e-6&&i){var d=n-a,h=r-o,p=l*l+u*u,m=d*d+h*h,g=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((Ot-Math.acos((p+f-m)/(2*g*v)))/2),b=y/v,w=y/g;Math.abs(b-1)>1e-6&&(this._+="L"+(e+b*c)+","+(t+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*d>c*h)+","+(this._x1=e+w*l)+","+(this._y1=t+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,n,r,i,a){e=+e,t=+t,a=!!a;var o=(n=+n)*Math.cos(r),l=n*Math.sin(r),u=e+o,c=t+l,s=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),n&&(f<0&&(f=f%Pt+Pt),f>Dt?this._+="A"+n+","+n+",0,1,"+s+","+(e-o)+","+(t-l)+"A"+n+","+n+",0,1,"+s+","+(this._x1=u)+","+(this._y1=c):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Ot)+","+s+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},Rt.prototype=zt.prototype={constructor:Rt,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var Ft=zt;function Lt(){}var Ut=Ft.prototype;function jt(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a,o,l,u,c,s,f,d,h=e._root,p={data:r},m=e._x0,g=e._y0,v=e._x1,y=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((c=t>=(a=(m+v)/2))?m=a:v=a,(s=n>=(o=(g+y)/2))?g=o:y=o,i=h,!(h=h[f=s<<1|c]))return i[f]=p,e;if(l=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===l&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(c=t>=(a=(m+v)/2))?m=a:v=a,(s=n>=(o=(g+y)/2))?g=o:y=o}while((f=s<<1|c)==(d=(u>=o)<<1|l>=a));return i[d]=h,i[f]=p,e}Lt.prototype=function(e,t){var n=new Lt;if(e instanceof Lt)e.each((function(e){n.add(e)}));else if(e){var r=-1,i=e.length;if(null==t)for(;++r1?r[0]+r.slice(2):r,+e.slice(n+1)]}qt.copy=function(){var e,t,n=new Vt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Yt(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=Yt(t));return n},qt.add=function(e){var t=+this._x.call(null,e),n=+this._y.call(null,e);return jt(this.cover(t,n),t,n,e)},qt.addAll=function(e){var t,n,r,i,a=e.length,o=new Array(a),l=new Array(a),u=1/0,c=1/0,s=-1/0,f=-1/0;for(n=0;ns&&(s=r),if&&(f=i));if(u>s||c>f)return this;for(this.cover(u,c).cover(s,f),n=0;ne||e>=i||r>t||t>=a;)switch(l=(td||(a=u.y0)>h||(o=u.x1)=v)<<1|e>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var y=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),w=y*y+b*b;if(w=(l=(p+g)/2))?p=l:g=l,(s=o>=(u=(m+v)/2))?m=u:v=u,t=h,!(h=h[f=s<<1|c]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},qt.removeAll=function(e){for(var t=0,n=e.length;t=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xt(e){if(!(t=Kt.exec(e)))throw new Error("invalid format: "+e);var t;return new Qt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Qt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}Xt.prototype=Qt.prototype,Qt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Zt,Jt,$t,en=function(e,t){var n=Gt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},tn={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return en(100*e,t)},r:en,s:function(e,t){var n=Gt(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(Zt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Gt(e,Math.max(0,t+a-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}},nn=function(e){return e},rn=Array.prototype.map,an=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function on(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function ln(e,t){var n,r,i,a,o,l=new fn(e),u=+e.value&&(l.value=e.value),c=[l];for(null==t&&(t=un);n=c.pop();)if(u&&(n.value=+n.data.value),(i=t(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)c.push(r=n.children[a]=new fn(i[a])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(sn)}function un(e){return e.children}function cn(e){e.data=e.data.data}function sn(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function fn(e){this.data=e,this.depth=this.height=0,this.parent=null}Jt=function(e){var t=void 0===e.grouping||void 0===e.thousands?nn:function(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],u=0;i>0&&l>0&&(u+l+1>r&&(l=Math.max(1,r-u)),a.push(n.substring(i-=l,i+l)),!((u+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}(rn.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?nn:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(rn.call(e.numerals,String)),o=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"-":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function c(e){var c=(e=Xt(e)).fill,s=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,v=e.trim,y=e.type;"n"===y?(m=!0,y="g"):tn[y]||(void 0===g&&(g=12),v=!0,y="g"),(h||"0"===c&&"="===s)&&(h=!0,c="0",s="=");var b="$"===d?n:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?r:/[%p]/.test(y)?o:"",x=tn[y],k=/[defgprs%]/.test(y);function C(e){var n,r,o,d=b,C=w;if("c"===y)C=x(e)+C,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:x(Math.abs(e),g),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),T&&0==+e&&"+"!==f&&(T=!1),d=(T?"("===f?f:l:"-"===f||"("===f?"":f)+d,C=("s"===y?an[8+Zt/3]:"")+C+(T&&"("===f?")":""),k)for(n=-1,r=e.length;++n(o=e.charCodeAt(n))||o>57){C=(46===o?i+e.slice(n+1):e.slice(n))+C,e=e.slice(0,n);break}}m&&!h&&(e=t(e,1/0));var S=d.length+e.length+C.length,E=S>1)+d+e+C+E.slice(S);break;default:e=E+d+e+C}return a(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:c,formatPrefix:function(e,t){var n=c(((e=Xt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(function(e){return(e=Gt(Math.abs(e)))?e[1]:NaN}(t)/3))),i=Math.pow(10,-r),a=an[8+r/3];return function(e){return n(i*e)+a}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),$t=Jt.format,Jt.formatPrefix,fn.prototype=ln.prototype={constructor:fn,count:function(){return this.eachAfter(on)},each:function(e){var t,n,r,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),n=a.children)for(r=0,i=n.length;r=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return ln(this).eachBefore(cn)}};var dn=Array.prototype.slice;function hn(e,t){var n,r;if(gn(t,e))return[t];for(n=0;n0&&n*n>r*r+i*i}function gn(e,t){for(var n=0;n(o*=o)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=e.x-r*l-a*u,n.y=e.y-r*u+a*l):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=t.x+r*l-a*u,n.y=t.y+r*u+a*l)):(n.x=t.x+n.r,n.y=t.y)}function xn(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function kn(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Cn(e){this._=e,this.next=null,this.previous=null}function Tn(e){if(!(i=e.length))return 0;var t,n,r,i,a,o,l,u,c,s,f;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(n=e[1],t.x=-n.r,n.x=t.r,n.y=0,!(i>2))return t.r+n.r;wn(n,t,r=e[2]),t=new Cn(t),n=new Cn(n),r=new Cn(r),t.next=r.previous=n,n.next=t.previous=r,r.next=n.previous=t;e:for(l=3;l1);return e+n*a*Math.sqrt(-2*Math.log(i)/i)}}return n.source=e,n}(On)),Dn=(function e(t){function n(){var e=Pn.source(t).apply(this,arguments);return function(){return Math.exp(e())}}return n.source=e,n}(On),function e(t){function n(e){return function(){for(var n=0,r=0;r0))return l;do{l.push(o=new Date(+n)),t(n,a),e(n)}while(o=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Ln.setTime(+t),Un.setTime(+r),e(Ln),e(Un),Math.floor(n(Ln,Un))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Hn=jn((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Hn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jn((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Wn=Hn,Bn=((Hn.range,jn((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))).range,6e4),Vn=6048e5;function Yn(e){return jn((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Bn)/Vn}))}var qn=Yn(0),Gn=Yn(1),Kn=Yn(2),Xn=Yn(3),Qn=Yn(4),Zn=Yn(5),Jn=Yn(6),$n=(qn.range,Gn.range,Kn.range,Xn.range,Qn.range,Zn.range,Jn.range,jn((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Bn)/864e5}),(function(e){return e.getDate()-1}))),er=$n,tr=(((($n.range,jn((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-e.getMinutes()*Bn)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}))).range,jn((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+t*Bn)}),(function(e,t){return(t-e)/Bn}),(function(e){return e.getMinutes()}))).range,jn((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}))).range,jn((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));function nr(e){return jn((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Vn}))}tr.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?jn((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):tr:null},tr.range;var rr=nr(0),ir=nr(1),ar=nr(2),or=nr(3),lr=nr(4),ur=nr(5),cr=nr(6),sr=(rr.range,ir.range,ar.range,or.range,lr.range,ur.range,cr.range,jn((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}))),fr=sr,dr=(sr.range,jn((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));dr.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jn((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var hr=dr;function pr(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function mr(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}dr.range;var vr,yr={"-":"",_:" ",0:"0"},br=/^\s*\d+/,wr=/^%/,xr=/[\\^$*+?|[\]().{}]/g;function kr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function Dr(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ir(e,t,n){var r=br.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Rr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function zr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Fr(e,t,n){var r=br.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Lr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ur(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Hr(e,t,n){var r=br.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Wr(e,t,n){var r=br.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Br(e,t,n){var r=wr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Vr(e,t,n){var r=br.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Yr(e,t,n){var r=br.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qr(e,t){return kr(e.getDate(),t,2)}function Gr(e,t){return kr(e.getHours(),t,2)}function Kr(e,t){return kr(e.getHours()%12||12,t,2)}function Xr(e,t){return kr(1+er.count(Wn(e),e),t,3)}function Qr(e,t){return kr(e.getMilliseconds(),t,3)}function Zr(e,t){return Qr(e,t)+"000"}function Jr(e,t){return kr(e.getMonth()+1,t,2)}function $r(e,t){return kr(e.getMinutes(),t,2)}function ei(e,t){return kr(e.getSeconds(),t,2)}function ti(e){var t=e.getDay();return 0===t?7:t}function ni(e,t){return kr(qn.count(Wn(e)-1,e),t,2)}function ri(e){var t=e.getDay();return t>=4||0===t?Qn(e):Qn.ceil(e)}function ii(e,t){return e=ri(e),kr(Qn.count(Wn(e),e)+(4===Wn(e).getDay()),t,2)}function ai(e){return e.getDay()}function oi(e,t){return kr(Gn.count(Wn(e)-1,e),t,2)}function li(e,t){return kr(e.getFullYear()%100,t,2)}function ui(e,t){return kr((e=ri(e)).getFullYear()%100,t,2)}function ci(e,t){return kr(e.getFullYear()%1e4,t,4)}function si(e,t){var n=e.getDay();return kr((e=n>=4||0===n?Qn(e):Qn.ceil(e)).getFullYear()%1e4,t,4)}function fi(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+kr(t/60|0,"0",2)+kr(t%60,"0",2)}function di(e,t){return kr(e.getUTCDate(),t,2)}function hi(e,t){return kr(e.getUTCHours(),t,2)}function pi(e,t){return kr(e.getUTCHours()%12||12,t,2)}function mi(e,t){return kr(1+fr.count(hr(e),e),t,3)}function gi(e,t){return kr(e.getUTCMilliseconds(),t,3)}function vi(e,t){return gi(e,t)+"000"}function yi(e,t){return kr(e.getUTCMonth()+1,t,2)}function bi(e,t){return kr(e.getUTCMinutes(),t,2)}function wi(e,t){return kr(e.getUTCSeconds(),t,2)}function xi(e){var t=e.getUTCDay();return 0===t?7:t}function ki(e,t){return kr(rr.count(hr(e)-1,e),t,2)}function Ci(e){var t=e.getUTCDay();return t>=4||0===t?lr(e):lr.ceil(e)}function Ti(e,t){return e=Ci(e),kr(lr.count(hr(e),e)+(4===hr(e).getUTCDay()),t,2)}function Si(e){return e.getUTCDay()}function Ei(e,t){return kr(ir.count(hr(e)-1,e),t,2)}function Ai(e,t){return kr(e.getUTCFullYear()%100,t,2)}function _i(e,t){return kr((e=Ci(e)).getUTCFullYear()%100,t,2)}function Mi(e,t){return kr(e.getUTCFullYear()%1e4,t,4)}function Ni(e,t){var n=e.getUTCDay();return kr((e=n>=4||0===n?lr(e):lr.ceil(e)).getUTCFullYear()%1e4,t,4)}function Oi(){return"+0000"}function Pi(){return"%"}function Di(e){return+e}function Ii(e){return Math.floor(+e/1e3)}function Ri(){this._=null}function zi(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Fi(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Li(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Ui(e){for(;e.L;)e=e.L;return e}(vr=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,u=e.shortMonths,c=Tr(i),s=Sr(i),f=Tr(a),d=Sr(a),h=Tr(o),p=Sr(o),m=Tr(l),g=Sr(l),v=Tr(u),y=Sr(u),b={a:function(e){return o[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:qr,e:qr,f:Zr,g:ui,G:si,H:Gr,I:Kr,j:Xr,L:Qr,m:Jr,M:$r,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Di,s:Ii,S:ei,u:ti,U:ni,V:ii,w:ai,W:oi,x:null,X:null,y:li,Y:ci,Z:fi,"%":Pi},w={a:function(e){return o[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:di,e:di,f:vi,g:_i,G:Ni,H:hi,I:pi,j:mi,L:gi,m:yi,M:bi,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Di,s:Ii,S:wi,u:xi,U:ki,V:Ti,w:Si,W:Ei,x:null,X:null,y:Ai,Y:Mi,Z:Oi,"%":Pi},x={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return T(e,t,n,r)},d:zr,e:zr,f:Wr,g:Pr,G:Or,H:Lr,I:Lr,j:Fr,L:Hr,m:Rr,M:Ur,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=s[r[0].toLowerCase()],n+r[0].length):-1},q:Ir,Q:Vr,s:Yr,S:jr,u:Ar,U:_r,V:Mr,w:Er,W:Nr,x:function(e,t,r){return T(e,n,t,r)},X:function(e,t,n){return T(e,r,t,n)},y:Pr,Y:Or,Z:Dr,"%":Br};function k(e,t){return function(n){var r,i,a,o=[],l=-1,u=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++l53)return null;"w"in a||(a.w=1),"Z"in a?(r=(i=(r=mr(gr(a.y,0,1))).getUTCDay())>4||0===i?ir.ceil(r):ir(r),r=fr.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(r=(i=(r=pr(gr(a.y,0,1))).getDay())>4||0===i?Gn.ceil(r):Gn(r),r=er.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?mr(gr(a.y,0,1)).getUTCDay():pr(gr(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,mr(a)):pr(a)}}function T(e,t,n,r){for(var i,a,o=0,l=t.length,u=n.length;o=u)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=x[i in yr?t.charAt(o++):i])||(r=a(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),w.x=k(n,w),w.X=k(r,w),w.c=k(t,w),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",w);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,vr.parse,vr.utcFormat,vr.utcParse,((jn((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})).range,jn((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}))).range,jn((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Bn)}),(function(e,t){return(t-e)/Bn}),(function(e){return e.getUTCMinutes()}))).range,Ri.prototype={constructor:Ri,insert:function(e,t){var n,r,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=Ui(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(Fi(this,n),n=(e=n).U),n.C=!1,r.C=!0,Li(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(Li(this,n),n=(e=n).U),n.C=!1,r.C=!0,Fi(this,r)),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,n,r,i=e.U,a=e.L,o=e.R;if(n=a?o?Ui(o):a:o,i?i.L===e?i.L=n:i.R=n:this._=n,a&&o?(r=n.C,n.C=e.C,n.L=a,a.U=n,n!==o?(i=n.U,n.U=e.U,e=n.R,i.L=e,n.R=o,o.U=n):(n.U=i,i=n,e=n.R)):(r=e.C,e=n),e&&(e.U=i),!r)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,Fi(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Li(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,Fi(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,Li(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Fi(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,Li(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}};var ji=Ri;function Hi(e,t,n,r){var i=[null,null],a=ca.push(i)-1;return i.left=e,i.right=t,n&&Bi(i,e,t,n),r&&Bi(i,t,e,r),la[e.index].halfedges.push(a),la[t.index].halfedges.push(a),i}function Wi(e,t,n){var r=[t,n];return r.left=e,r}function Bi(e,t,n,r){e[0]||e[1]?e.left===n?e[1]=r:e[0]=r:(e[0]=r,e.left=t,e.right=n)}function Vi(e,t,n,r,i){var a,o=e[0],l=e[1],u=o[0],c=o[1],s=0,f=1,d=l[0]-u,h=l[1]-c;if(a=t-u,d||!(a>0)){if(a/=d,d<0){if(a0){if(a>f)return;a>s&&(s=a)}if(a=r-u,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>s&&(s=a)}else if(d>0){if(a0)){if(a/=h,h<0){if(a0){if(a>f)return;a>s&&(s=a)}if(a=i-c,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>s&&(s=a)}else if(h>0){if(a0||f<1)||(s>0&&(e[0]=[u+s*d,c+s*h]),f<1&&(e[1]=[u+f*d,c+f*h]),!0)}}}}}function Yi(e,t,n,r,i){var a=e[1];if(a)return!0;var o,l,u=e[0],c=e.left,s=e.right,f=c[0],d=c[1],h=s[0],p=s[1],m=(f+h)/2,g=(d+p)/2;if(p===d){if(m=r)return;if(f>h){if(u){if(u[1]>=i)return}else u=[m,n];a=[m,i]}else{if(u){if(u[1]1)if(f>h){if(u){if(u[1]>=i)return}else u=[(n-l)/o,n];a=[(i-l)/o,i]}else{if(u){if(u[1]=r)return}else u=[t,o*t+l];a=[r,o*r+l]}else{if(u){if(u[0]=-fa)){var h=u*u+c*c,p=s*s+f*f,m=(f*h-c*p)/d,g=(u*p-s*h)/d,v=Qi.pop()||new function(){zi(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=e,v.site=i,v.x=m+o,v.y=(v.cy=g+l)+Math.sqrt(m*m+g*g),e.circle=v;for(var y=null,b=ua._;b;)if(v.ysa)l=l.L;else{if(!((i=a-aa(l,o))>sa)){r>-sa?(t=l.P,n=l):i>-sa?(t=l,n=l.N):t=n=l;break}if(!l.R){t=l;break}l=l.R}!function(e){la[e.index]={site:e,halfedges:[]}}(e);var u=ea(e);if(oa.insert(t,u),t||n){if(t===n)return Ji(t),n=ea(t.site),oa.insert(u,n),u.edge=n.edge=Hi(t.site,u.site),Zi(t),void Zi(n);if(n){Ji(t),Ji(n);var c=t.site,s=c[0],f=c[1],d=e[0]-s,h=e[1]-f,p=n.site,m=p[0]-s,g=p[1]-f,v=2*(d*g-h*m),y=d*d+h*h,b=m*m+g*g,w=[(g*y-h*b)/v+s,(d*b-m*y)/v+f];Bi(n.edge,c,p,w),u.edge=Hi(c,e,null,w),n.edge=Hi(e,p,null,w),Zi(t),Zi(n)}else u.edge=Hi(t.site,u.site)}}function ia(e,t){var n=e.site,r=n[0],i=n[1],a=i-t;if(!a)return r;var o=e.P;if(!o)return-1/0;var l=(n=o.site)[0],u=n[1],c=u-t;if(!c)return l;var s=l-r,f=1/a-1/c,d=s/c;return f?(-d+Math.sqrt(d*d-2*f*(s*s/(-2*c)-u+c/2+i-a/2)))/f+r:(r+l)/2}function aa(e,t){var n=e.N;if(n)return ia(n,t);var r=e.site;return r[1]===t?r[0]:1/0}var oa,la,ua,ca,sa=1e-6,fa=1e-12;function da(e,t,n){return(e[0]-n[0])*(t[1]-e[1])-(e[0]-t[0])*(n[1]-e[1])}function ha(e,t){return t[1]-e[1]||t[0]-e[0]}function pa(e,t){var n,r,i,a=e.sort(ha).pop();for(ca=[],la=new Array(e.length),oa=new ji,ua=new ji;;)if(i=Xi,a&&(!i||a[1]sa||Math.abs(i[0][1]-i[1][1])>sa)||delete ca[a]}(o,l,u,c),function(e,t,n,r){var i,a,o,l,u,c,s,f,d,h,p,m,g=la.length,v=!0;for(i=0;isa||Math.abs(m-d)>sa)&&(u.splice(l,0,ca.push(Wi(o,h,Math.abs(p-e)sa?[e,Math.abs(f-e)sa?[Math.abs(d-r)sa?[n,Math.abs(f-n)sa?[Math.abs(d-t)=l)return null;var u=e-i.site[0],c=t-i.site[1],s=u*u+c*c;do{i=a.cells[r=o],o=null,i.halfedges.forEach((function(n){var r=a.edges[n],l=r.left;if(l!==i.site&&l||(l=r.right)){var u=e-l[0],c=t-l[1],f=u*u+c*c;f13?13:t}},{key:"drawChart",value:function(e){var t=this.props,n=t.config,r=t.data;void 0===n.toColor&&(n.font_size_value=8,n.font_size_label=10,n.toColor=["#7FCDAE","#ffed6f","#EE7772"]);var i=this.getWindowSize(),a=(this.getFontSize(),.97*i),o=($t(",d"),function e(){var t=Ft(),n=[],r=[],i=Fn;function a(e){var a=e+"",o=t.get(a);if(!o){if(i!==Fn)return i;t.set(a,o=n.push(e))}return r[(o-1)%r.length]}return a.domain=function(e){if(!arguments.length)return n.slice();n=[],t=Ft();for(var r,i,o=-1,l=e.length;++o.15?e.data.color/c:.15})).style("fill",(function(e){if("fill"==n.color_by_type)return n.toColor[0];if("cat"==n.color_by_type){var t=Math.round(e.data.color/c*n.toColor.length)-1;return n.toColor[t<0?0:t]}return n.toColor[0]})).on("mousemove",(function(e){ne(this).style("stroke-width",10).style("stroke",(function(e){if("fill"==n.color_by_type)return n.toColor[0];if("cat"==n.color_by_type){var t=Math.round(e.data.color/c*n.toColor.length)-1;return n.toColor[t<0?0:t]}return n.toColor[0]})).style("z-index",10).style("stroke-opacity",(function(e){return e.data.color/c>.5?e.data.color/2/c:2*e.data.color/c}))})).on("mouseout",(function(e){ne(this).style("z-index",1).style("stroke-width",0).style("opacity",(function(e){return"fill"==n.color_by_type||"cat"==n.color_by_type?1:e.data.color/c>.15?e.data.color/c:.15}))})),!1!==n.value_titles&&f.append("text").attr("class","label").attr("dy",!1===n.value_labels?".3em":".1em").style("text-anchor","middle").style("font-size",n.font_size_value).text((function(e){return e.data.itemName.substring(0,e.r/3)})),!1!==n.value_labels&&f.append("text").attr("class","label").attr("dy",!1===n.value_titles?".3em":"1.5em").style("font-size",n.font_size_label).style("text-anchor","middle").text((function(e){return e.data.rendered})),f.on("mousemove",(function(e){ne("#chart").append("div").attr("id","tooltip");var t="";t+="
"+e.data.itemName+"
",t+=" "+(e.data.html?ya.a.sanitize(e.data.html):e.data.rendered)+"
",t+=" "+(e.data.secondMeasureHtml?ya.a.sanitize(e.data.secondMeasureHtml):e.data.secondMeasureRendered)+"
",ne("#tooltip").html(t);var n=Math.round(Number(ne("#tooltip").style("width").slice(0,-2)))/2;ne("#tooltip").style("left",q.pageX-(n>100?30:n+5)+"px").style("top",q.pageY-60+"px").style("opacity",1).style("position","absolute").style("font-family","Roboto").style("font-size",".8rem").style("text-align","center").style("padding",".5rem").style("pointer-events","none").style("color","white").style("background-color","#313639").style("background-opacity",".85").style("border-radius","#8px"),ne("#tooltip").append("div").style("border-right","solid 4px transparent").style("border-left","solid 4px transparent").style("border-top","solid 4px #313639").style("transform","translateX(-50%)").style("content","").style("top","100%").style("left","50%").style("height",5).style("width",5).style("position","absolute")})).on("mouseout",(function(e){(function(e){return new $([document.querySelectorAll(e)],[document.documentElement])})("#tooltip").remove()})),ne(self.frameElement).style("height",a+"px")}},{key:"render",value:function(){var e=this.getFontSize();return i.a.createElement(Ta,{id:"chart",style:{fontSize:e}})}}]),n}();Sa.defaultProps={config:{},data:[]};var Ea=Sa,Aa=n(14),_a=n.n(Aa);function Ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Na={color_by_type:{type:"string",label:"Color Rule",display:"select",values:[{Gradient:"gradient"},{Fill:"fill"},{Categorical:"cat"}],default:"gradient",section:"Series",order:0},toColor:{type:"array",label:"Fill Color",section:"Series",default:["#7FCDAE","#ffed6f","#EE7772"],display:"colors",order:1},value_labels:{type:"boolean",label:"Display Labels",default:!0,section:"Series",order:2},value_titles:{type:"boolean",label:"Display Values",default:!0,section:"Series",order:3},value_format:{type:"string",label:"Value Formatting Override",placeholder:"Spreadsheet-style format code",section:"Series",order:7},font_size_value:{type:"string",label:"Lable Font Size",default:"8",section:"Style",order:4},font_size_label:{type:"string",label:"Value Font Size",default:"10",section:"Style",order:5}};looker.plugins.visualizations.add({id:"bubble_chart",label:"Bubble Chart",options:Na,create:function(e,t){this.chart=o.a.render(i.a.createElement("div",null),e)},updateAsync:function(e,t,n,r,a,l){this.clearErrors();var u=[].concat(r.fields.dimensions,r.fields.table_calculations.filter((function(e){return!1===e.measure}))),c=[].concat(r.fields.measures,r.fields.table_calculations.filter((function(e){return!0===e.measure})));if(c.length<2)this.addError({title:"Too few measures",message:"This chart requires at least 2 measures selected."});else if(u.length<1)this.addError({title:"Dimensions",message:"This chart requires at least 1 dimension."});else{if(0===e.length)return this.addError({title:"No Results"}),void l();var s=c[0],f=c[1],d=[],h=[],p=Na;p.size_by={type:"string",label:"Size by",display:"select",values:c.map((function(e){return Ma({},e.label,e.name)})),section:"Series",default:s&&s.name,order:5},p.color_by={type:"string",label:"Color by",display:"select",values:c.map((function(e){return Ma({},e.label,e.name)})),section:"Series",default:f&&f.name,order:6},this.trigger("registerOptions",p),e.forEach((function(e,t){var r=u.map((function(t){return e[t.name].rendered||e[t.name].value})).join("-"),i=s&&e[s.name].value,a=s&&e[s.name].html,o=f&&e[f.name].value,l=f&&e[f.name].html,c=void 0===n.color_by?o:e[n.color_by].value;h.push(c);var p=null!=n.value_format&&_a.a.format(n.value_format,void 0===n.size_by?i:e[n.size_by].value),m=null!=n.value_format&&_a.a.format(n.value_format,o);d.push({itemName:r,value:void 0===n.size_by?i:e[n.size_by].value,rendered:p||LookerCharts.Utils.textForCell(void 0===n.size_by?e[s.name]:e[n.size_by]),color:c,html:a,secondMeasureRendered:m||o,secondMeasureHtml:l})})),this.chart=o.a.render(i.a.createElement(Ea,{config:n,data:d,maxColor:Math.max.apply(null,h)}),t),l()}}})}])})); \ No newline at end of file + */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case d:case o:case u:case l:case p:return e;default:switch(e=e&&e.$$typeof){case s:case h:case v:case g:case c:return e;default:return t}}case a:return t}}}function C(e){return k(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=s,t.ContextProvider=c,t.Element=i,t.ForwardRef=h,t.Fragment=o,t.Lazy=v,t.Memo=g,t.Portal=a,t.Profiler=u,t.StrictMode=l,t.Suspense=p,t.isAsyncMode=function(e){return C(e)||k(e)===f},t.isConcurrentMode=C,t.isContextConsumer=function(e){return k(e)===s},t.isContextProvider=function(e){return k(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return k(e)===h},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===v},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===a},t.isProfiler=function(e){return k(e)===u},t.isStrictMode=function(e){return k(e)===l},t.isSuspense=function(e){return k(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===u||e===l||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===g||e.$$typeof===c||e.$$typeof===s||e.$$typeof===h||e.$$typeof===b||e.$$typeof===w||e.$$typeof===x||e.$$typeof===y)},t.typeOf=k},function(e,t,n){e.exports=n(55)()},function(e,t,n){"use strict";var r=n(56);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),a=n(9),o=n.n(a),l=function(e,t){return et?1:e>=t?0:NaN},u=function(e){return 1===e.length&&(e=function(e){return function(t,n){return l(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[a],n)<0?r=a+1:i=a}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}(l);u.right,u.left;var c=Array.prototype;c.slice,c.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),Array.prototype.slice;var s={value:function(){}};function f(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",r),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),a=0;at?1:e>=t?0:NaN}var E="http://www.w3.org/1999/xhtml",A={svg:"http://www.w3.org/2000/svg",xhtml:E,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},_=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),A.hasOwnProperty(t)?{space:A[t],local:e}:e},M=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};function N(e,t){return e.style.getPropertyValue(t)||M(e).getComputedStyle(e,null).getPropertyValue(t)}function O(e){return e.trim().split(/^|\s+/)}function P(e){return e.classList||new D(e)}function D(e){this._node=e,this._names=O(e.getAttribute("class")||"")}function I(e,t){for(var n=P(e),r=-1,i=t.length;++r=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var j=function(e){var t=_(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===E&&t.documentElement.namespaceURI===E?t.createElement(e):t.createElementNS(n,e)}})(t)};function H(){return null}function W(){var e=this.parentNode;e&&e.removeChild(this)}function B(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function V(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}var Y={},q=null;function G(e,t,n){return e=K(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function K(e,t,n){return function(r){var i=q;q=r;try{e.call(this,this.__data__,t,n)}finally{q=i}}}function X(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,a=t.length;r=w&&(w=b+1);!(y=g[w])&&++w=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=S);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):N(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=O(e+"");if(arguments.length<2){for(var r=P(this.node()),i=-1,a=n.length;++i=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),o=a.length;if(!(arguments.length<2)){for(l=t?Q:X,null==n&&(n=!1),r=0;r>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=se.exec(e))?new Ce(t[1],t[2],t[3],1):(t=fe.exec(e))?new Ce(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=de.exec(e))?xe(t[1],t[2],t[3],t[4]):(t=he.exec(e))?xe(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pe.exec(e))?Ae(t[1],t[2]/100,t[3]/100,1):(t=me.exec(e))?Ae(t[1],t[2]/100,t[3]/100,t[4]):ge.hasOwnProperty(e)?we(ge[e]):"transparent"===e?new Ce(NaN,NaN,NaN,0):null}function we(e){return new Ce(e>>16&255,e>>8&255,255&e,1)}function xe(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ce(e,t,n,r)}function ke(e,t,n,r){return 1===arguments.length?function(e){return e instanceof ae||(e=be(e)),e?new Ce((e=e.rgb()).r,e.g,e.b,e.opacity):new Ce}(e):new Ce(e,t,n,null==r?1:r)}function Ce(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Te(){return"#"+Ee(this.r)+Ee(this.g)+Ee(this.b)}function Se(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function Ee(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ae(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Me(e,t,n,r)}function _e(e){if(e instanceof Me)return new Me(e.h,e.s,e.l,e.opacity);if(e instanceof ae||(e=be(e)),!e)return new Me;if(e instanceof Me)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,u=(a+i)/2;return l?(o=t===a?(n-r)/l+6*(n0&&u<1?0:o,new Me(o,l,u,e.opacity)}function Me(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ne(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Oe(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}re(ae,be,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ve,formatHex:ve,formatHsl:function(){return _e(this).formatHsl()},formatRgb:ye,toString:ye}),re(Ce,ke,ie(ae,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Te,formatHex:Te,formatRgb:Se,toString:Se})),re(Me,(function(e,t,n,r){return 1===arguments.length?_e(e):new Me(e,t,n,null==r?1:r)}),ie(ae,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Me(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Me(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ce(Ne(e>=240?e-240:e+120,i,r),Ne(e,i,r),Ne(e<120?e+240:e-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},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Pe=function(e){return function(){return e}};function De(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Pe(isNaN(e)?t:e)}var Ie=function e(t){var n=function(e){return 1==(e=+e)?De:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Pe(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ke(e)).r,(t=ke(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=De(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return r.gamma=e,r}(1);function Re(e){return function(t){var n,r,i=t.length,a=new Array(i),o=new Array(i),l=new Array(i);for(n=0;n=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,l=ra&&(i=t.slice(a,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,u.push({i:o,x:Le(n,r)})),a=je.lastIndex;return a=0&&t._call.call(null,e),t=t._next;--We}()}finally{We=0,function(){for(var e,t,n=ze,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ze=t);Fe=e,nt(r)}(),qe=0}}function tt(){var e=Ke.now(),t=e-Ye;t>1e3&&(Ge-=t,Ye=e)}function nt(e){We||(Be&&(Be=clearTimeout(Be)),e-qe>24?(e<1/0&&(Be=setTimeout(et,e-Ke.now()-Ge)),Ve&&(Ve=clearInterval(Ve))):(Ve||(Ye=Ke.now(),Ve=setInterval(tt,1e3)),We=1,Xe(et)))}Je.prototype=$e.prototype={constructor:Je,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Qe():+n)+(null==t?0:+t),this._next||Fe===this||(Fe?Fe._next=this:ze=this,Fe=this),this._call=e,this._time=n,nt()},stop:function(){this._call&&(this._call=null,this._time=1/0,nt())}};var rt=function(e,t,n){var r=new Je;return t=null==t?0:+t,r.restart((function(n){r.stop(),e(n+t)}),t,n),r},it=m("start","end","cancel","interrupt"),at=[],ot=function(e,t,n,r,i,a){var o=e.__transition;if(o){if(n in o)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function a(u){var c,s,f,d;if(1!==n.state)return l();for(c in i)if((d=i[c]).name===n.name){if(3===d.state)return rt(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function ut(e,t){var n=ct(e,t);if(n.state>3)throw new Error("too late; already running");return n}function ct(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}var st,ft,dt,ht,pt=180/Math.PI,mt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},gt=function(e,t,n,r,i,a){var o,l,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Le(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(a.rotate,o.rotate,l,u),function(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Le(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(a.skewX,o.skewX,l,u),function(e,t,n,r,a,o){if(e!==n||t!==r){var l=a.push(i(a)+"scale(",null,",",null,")");o.push({i:l-4,x:Le(e,n)},{i:l-2,x:Le(t,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,l,u),a=o=null,function(e){for(var t,n=-1,r=u.length;++n=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?lt:ut;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}(n,e,t))},attr:function(e,t){var n=_(e),r="transform"===n?bt:xt;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,i,a;return function(){var o,l,u=n(this);if(null!=u)return(o=this.getAttributeNS(e.space,e.local))===(l=u+"")?null:o===r&&l===i?a:(i=l,a=t(r=o,u));this.removeAttributeNS(e.space,e.local)}}:function(e,t,n){var r,i,a;return function(){var o,l,u=n(this);if(null!=u)return(o=this.getAttribute(e))===(l=u+"")?null:o===r&&l===i?a:(i=l,a=t(r=o,u));this.removeAttribute(e)}})(n,r,wt(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}:function(e,t,n){var r,i,a=n+"";return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=_(e);return this.tween(n,(r.local?function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,i)),n}return i._value=t,i}:function(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,i)),n}return i._value=t,i})(r,t))},style:function(e,t,n){var r="transform"==(e+="")?yt:xt;return null==t?this.styleTween(e,function(e,t){var n,r,i;return function(){var a=N(this,e),o=(this.style.removeProperty(e),N(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}(e,r)).on("end.style."+e,Ct(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,i,a;return function(){var o=N(this,e),l=n(this),u=l+"";return null==l&&(this.style.removeProperty(e),u=l=N(this,e)),o===u?null:o===r&&u===i?a:(i=u,a=t(r=o,l))}}(e,r,wt(this,"style."+e,t))).each(function(e,t){var n,r,i,a,o="style."+t,l="end."+o;return function(){var u=ut(this,e),c=u.on,s=null==u.value[o]?a||(a=Ct(t)):void 0;c===n&&i===s||(r=(n=c).copy()).on(l,i=s),u.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,i,a=n+"";return function(){var o=N(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(wt(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=ct(this.node(),n).tween,a=0,o=i.length;a2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete e.__transition}}(this,e)}))},te.prototype.transition=function(e){var t,n;e instanceof St?(t=e._id,e=e._name):(t=Et(),(n=_t).time=Qe(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,a=0;a1e-6)if(Math.abs(s*l-u*c)>1e-6&&i){var d=n-a,h=r-o,p=l*l+u*u,m=d*d+h*h,g=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((Ot-Math.acos((p+f-m)/(2*g*v)))/2),b=y/v,w=y/g;Math.abs(b-1)>1e-6&&(this._+="L"+(e+b*c)+","+(t+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*d>c*h)+","+(this._x1=e+w*l)+","+(this._y1=t+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,n,r,i,a){e=+e,t=+t,a=!!a;var o=(n=+n)*Math.cos(r),l=n*Math.sin(r),u=e+o,c=t+l,s=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),n&&(f<0&&(f=f%Pt+Pt),f>Dt?this._+="A"+n+","+n+",0,1,"+s+","+(e-o)+","+(t-l)+"A"+n+","+n+",0,1,"+s+","+(this._x1=u)+","+(this._y1=c):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Ot)+","+s+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},Rt.prototype=zt.prototype={constructor:Rt,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var Ft=zt;function Lt(){}var Ut=Ft.prototype;function jt(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a,o,l,u,c,s,f,d,h=e._root,p={data:r},m=e._x0,g=e._y0,v=e._x1,y=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((c=t>=(a=(m+v)/2))?m=a:v=a,(s=n>=(o=(g+y)/2))?g=o:y=o,i=h,!(h=h[f=s<<1|c]))return i[f]=p,e;if(l=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===l&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(c=t>=(a=(m+v)/2))?m=a:v=a,(s=n>=(o=(g+y)/2))?g=o:y=o}while((f=s<<1|c)==(d=(u>=o)<<1|l>=a));return i[d]=h,i[f]=p,e}Lt.prototype=function(e,t){var n=new Lt;if(e instanceof Lt)e.each((function(e){n.add(e)}));else if(e){var r=-1,i=e.length;if(null==t)for(;++r1?r[0]+r.slice(2):r,+e.slice(n+1)]}qt.copy=function(){var e,t,n=new Vt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Yt(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=Yt(t));return n},qt.add=function(e){var t=+this._x.call(null,e),n=+this._y.call(null,e);return jt(this.cover(t,n),t,n,e)},qt.addAll=function(e){var t,n,r,i,a=e.length,o=new Array(a),l=new Array(a),u=1/0,c=1/0,s=-1/0,f=-1/0;for(n=0;ns&&(s=r),if&&(f=i));if(u>s||c>f)return this;for(this.cover(u,c).cover(s,f),n=0;ne||e>=i||r>t||t>=a;)switch(l=(td||(a=u.y0)>h||(o=u.x1)=v)<<1|e>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var y=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),w=y*y+b*b;if(w=(l=(p+g)/2))?p=l:g=l,(s=o>=(u=(m+v)/2))?m=u:v=u,t=h,!(h=h[f=s<<1|c]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},qt.removeAll=function(e){for(var t=0,n=e.length;t=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xt(e){if(!(t=Kt.exec(e)))throw new Error("invalid format: "+e);var t;return new Qt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Qt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}Xt.prototype=Qt.prototype,Qt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Zt,Jt,$t,en=function(e,t){var n=Gt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},tn={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return en(100*e,t)},r:en,s:function(e,t){var n=Gt(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(Zt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Gt(e,Math.max(0,t+a-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}},nn=function(e){return e},rn=Array.prototype.map,an=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function on(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function ln(e,t){var n,r,i,a,o,l=new fn(e),u=+e.value&&(l.value=e.value),c=[l];for(null==t&&(t=un);n=c.pop();)if(u&&(n.value=+n.data.value),(i=t(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)c.push(r=n.children[a]=new fn(i[a])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(sn)}function un(e){return e.children}function cn(e){e.data=e.data.data}function sn(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function fn(e){this.data=e,this.depth=this.height=0,this.parent=null}Jt=function(e){var t=void 0===e.grouping||void 0===e.thousands?nn:function(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],u=0;i>0&&l>0&&(u+l+1>r&&(l=Math.max(1,r-u)),a.push(n.substring(i-=l,i+l)),!((u+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}(rn.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?nn:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(rn.call(e.numerals,String)),o=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"-":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function c(e){var c=(e=Xt(e)).fill,s=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,v=e.trim,y=e.type;"n"===y?(m=!0,y="g"):tn[y]||(void 0===g&&(g=12),v=!0,y="g"),(h||"0"===c&&"="===s)&&(h=!0,c="0",s="=");var b="$"===d?n:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?r:/[%p]/.test(y)?o:"",x=tn[y],k=/[defgprs%]/.test(y);function C(e){var n,r,o,d=b,C=w;if("c"===y)C=x(e)+C,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:x(Math.abs(e),g),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),T&&0==+e&&"+"!==f&&(T=!1),d=(T?"("===f?f:l:"-"===f||"("===f?"":f)+d,C=("s"===y?an[8+Zt/3]:"")+C+(T&&"("===f?")":""),k)for(n=-1,r=e.length;++n(o=e.charCodeAt(n))||o>57){C=(46===o?i+e.slice(n+1):e.slice(n))+C,e=e.slice(0,n);break}}m&&!h&&(e=t(e,1/0));var S=d.length+e.length+C.length,E=S>1)+d+e+C+E.slice(S);break;default:e=E+d+e+C}return a(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:c,formatPrefix:function(e,t){var n=c(((e=Xt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(function(e){return(e=Gt(Math.abs(e)))?e[1]:NaN}(t)/3))),i=Math.pow(10,-r),a=an[8+r/3];return function(e){return n(i*e)+a}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),$t=Jt.format,Jt.formatPrefix,fn.prototype=ln.prototype={constructor:fn,count:function(){return this.eachAfter(on)},each:function(e){var t,n,r,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),n=a.children)for(r=0,i=n.length;r=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return ln(this).eachBefore(cn)}};var dn=Array.prototype.slice;function hn(e,t){var n,r;if(gn(t,e))return[t];for(n=0;n0&&n*n>r*r+i*i}function gn(e,t){for(var n=0;n(o*=o)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=e.x-r*l-a*u,n.y=e.y-r*u+a*l):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=t.x+r*l-a*u,n.y=t.y+r*u+a*l)):(n.x=t.x+n.r,n.y=t.y)}function xn(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function kn(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Cn(e){this._=e,this.next=null,this.previous=null}function Tn(e){if(!(i=e.length))return 0;var t,n,r,i,a,o,l,u,c,s,f;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(n=e[1],t.x=-n.r,n.x=t.r,n.y=0,!(i>2))return t.r+n.r;wn(n,t,r=e[2]),t=new Cn(t),n=new Cn(n),r=new Cn(r),t.next=r.previous=n,n.next=t.previous=r,r.next=n.previous=t;e:for(l=3;l1);return e+n*a*Math.sqrt(-2*Math.log(i)/i)}}return n.source=e,n}(On)),Dn=(function e(t){function n(){var e=Pn.source(t).apply(this,arguments);return function(){return Math.exp(e())}}return n.source=e,n}(On),function e(t){function n(e){return function(){for(var n=0,r=0;r0))return l;do{l.push(o=new Date(+n)),t(n,a),e(n)}while(o=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Ln.setTime(+t),Un.setTime(+r),e(Ln),e(Un),Math.floor(n(Ln,Un))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Hn=jn((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Hn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jn((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Wn=Hn,Bn=((Hn.range,jn((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))).range,6e4),Vn=6048e5;function Yn(e){return jn((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Bn)/Vn}))}var qn=Yn(0),Gn=Yn(1),Kn=Yn(2),Xn=Yn(3),Qn=Yn(4),Zn=Yn(5),Jn=Yn(6),$n=(qn.range,Gn.range,Kn.range,Xn.range,Qn.range,Zn.range,Jn.range,jn((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Bn)/864e5}),(function(e){return e.getDate()-1}))),er=$n,tr=(((($n.range,jn((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-e.getMinutes()*Bn)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}))).range,jn((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+t*Bn)}),(function(e,t){return(t-e)/Bn}),(function(e){return e.getMinutes()}))).range,jn((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}))).range,jn((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));function nr(e){return jn((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Vn}))}tr.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?jn((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):tr:null},tr.range;var rr=nr(0),ir=nr(1),ar=nr(2),or=nr(3),lr=nr(4),ur=nr(5),cr=nr(6),sr=(rr.range,ir.range,ar.range,or.range,lr.range,ur.range,cr.range,jn((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}))),fr=sr,dr=(sr.range,jn((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));dr.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jn((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var hr=dr;function pr(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function mr(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}dr.range;var vr,yr={"-":"",_:" ",0:"0"},br=/^\s*\d+/,wr=/^%/,xr=/[\\^$*+?|[\]().{}]/g;function kr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function Dr(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ir(e,t,n){var r=br.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Rr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function zr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Fr(e,t,n){var r=br.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Lr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ur(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jr(e,t,n){var r=br.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Hr(e,t,n){var r=br.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Wr(e,t,n){var r=br.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Br(e,t,n){var r=wr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Vr(e,t,n){var r=br.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Yr(e,t,n){var r=br.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qr(e,t){return kr(e.getDate(),t,2)}function Gr(e,t){return kr(e.getHours(),t,2)}function Kr(e,t){return kr(e.getHours()%12||12,t,2)}function Xr(e,t){return kr(1+er.count(Wn(e),e),t,3)}function Qr(e,t){return kr(e.getMilliseconds(),t,3)}function Zr(e,t){return Qr(e,t)+"000"}function Jr(e,t){return kr(e.getMonth()+1,t,2)}function $r(e,t){return kr(e.getMinutes(),t,2)}function ei(e,t){return kr(e.getSeconds(),t,2)}function ti(e){var t=e.getDay();return 0===t?7:t}function ni(e,t){return kr(qn.count(Wn(e)-1,e),t,2)}function ri(e){var t=e.getDay();return t>=4||0===t?Qn(e):Qn.ceil(e)}function ii(e,t){return e=ri(e),kr(Qn.count(Wn(e),e)+(4===Wn(e).getDay()),t,2)}function ai(e){return e.getDay()}function oi(e,t){return kr(Gn.count(Wn(e)-1,e),t,2)}function li(e,t){return kr(e.getFullYear()%100,t,2)}function ui(e,t){return kr((e=ri(e)).getFullYear()%100,t,2)}function ci(e,t){return kr(e.getFullYear()%1e4,t,4)}function si(e,t){var n=e.getDay();return kr((e=n>=4||0===n?Qn(e):Qn.ceil(e)).getFullYear()%1e4,t,4)}function fi(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+kr(t/60|0,"0",2)+kr(t%60,"0",2)}function di(e,t){return kr(e.getUTCDate(),t,2)}function hi(e,t){return kr(e.getUTCHours(),t,2)}function pi(e,t){return kr(e.getUTCHours()%12||12,t,2)}function mi(e,t){return kr(1+fr.count(hr(e),e),t,3)}function gi(e,t){return kr(e.getUTCMilliseconds(),t,3)}function vi(e,t){return gi(e,t)+"000"}function yi(e,t){return kr(e.getUTCMonth()+1,t,2)}function bi(e,t){return kr(e.getUTCMinutes(),t,2)}function wi(e,t){return kr(e.getUTCSeconds(),t,2)}function xi(e){var t=e.getUTCDay();return 0===t?7:t}function ki(e,t){return kr(rr.count(hr(e)-1,e),t,2)}function Ci(e){var t=e.getUTCDay();return t>=4||0===t?lr(e):lr.ceil(e)}function Ti(e,t){return e=Ci(e),kr(lr.count(hr(e),e)+(4===hr(e).getUTCDay()),t,2)}function Si(e){return e.getUTCDay()}function Ei(e,t){return kr(ir.count(hr(e)-1,e),t,2)}function Ai(e,t){return kr(e.getUTCFullYear()%100,t,2)}function _i(e,t){return kr((e=Ci(e)).getUTCFullYear()%100,t,2)}function Mi(e,t){return kr(e.getUTCFullYear()%1e4,t,4)}function Ni(e,t){var n=e.getUTCDay();return kr((e=n>=4||0===n?lr(e):lr.ceil(e)).getUTCFullYear()%1e4,t,4)}function Oi(){return"+0000"}function Pi(){return"%"}function Di(e){return+e}function Ii(e){return Math.floor(+e/1e3)}function Ri(){this._=null}function zi(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Fi(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Li(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Ui(e){for(;e.L;)e=e.L;return e}(vr=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,u=e.shortMonths,c=Tr(i),s=Sr(i),f=Tr(a),d=Sr(a),h=Tr(o),p=Sr(o),m=Tr(l),g=Sr(l),v=Tr(u),y=Sr(u),b={a:function(e){return o[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:qr,e:qr,f:Zr,g:ui,G:si,H:Gr,I:Kr,j:Xr,L:Qr,m:Jr,M:$r,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Di,s:Ii,S:ei,u:ti,U:ni,V:ii,w:ai,W:oi,x:null,X:null,y:li,Y:ci,Z:fi,"%":Pi},w={a:function(e){return o[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:di,e:di,f:vi,g:_i,G:Ni,H:hi,I:pi,j:mi,L:gi,m:yi,M:bi,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Di,s:Ii,S:wi,u:xi,U:ki,V:Ti,w:Si,W:Ei,x:null,X:null,y:Ai,Y:Mi,Z:Oi,"%":Pi},x={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return T(e,t,n,r)},d:zr,e:zr,f:Wr,g:Pr,G:Or,H:Lr,I:Lr,j:Fr,L:Hr,m:Rr,M:Ur,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=s[r[0].toLowerCase()],n+r[0].length):-1},q:Ir,Q:Vr,s:Yr,S:jr,u:Ar,U:_r,V:Mr,w:Er,W:Nr,x:function(e,t,r){return T(e,n,t,r)},X:function(e,t,n){return T(e,r,t,n)},y:Pr,Y:Or,Z:Dr,"%":Br};function k(e,t){return function(n){var r,i,a,o=[],l=-1,u=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++l53)return null;"w"in a||(a.w=1),"Z"in a?(r=(i=(r=mr(gr(a.y,0,1))).getUTCDay())>4||0===i?ir.ceil(r):ir(r),r=fr.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(r=(i=(r=pr(gr(a.y,0,1))).getDay())>4||0===i?Gn.ceil(r):Gn(r),r=er.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?mr(gr(a.y,0,1)).getUTCDay():pr(gr(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,mr(a)):pr(a)}}function T(e,t,n,r){for(var i,a,o=0,l=t.length,u=n.length;o=u)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=x[i in yr?t.charAt(o++):i])||(r=a(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),w.x=k(n,w),w.X=k(r,w),w.c=k(t,w),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",w);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,vr.parse,vr.utcFormat,vr.utcParse,((jn((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})).range,jn((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}))).range,jn((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Bn)}),(function(e,t){return(t-e)/Bn}),(function(e){return e.getUTCMinutes()}))).range,Ri.prototype={constructor:Ri,insert:function(e,t){var n,r,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=Ui(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(Fi(this,n),n=(e=n).U),n.C=!1,r.C=!0,Li(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(Li(this,n),n=(e=n).U),n.C=!1,r.C=!0,Fi(this,r)),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,n,r,i=e.U,a=e.L,o=e.R;if(n=a?o?Ui(o):a:o,i?i.L===e?i.L=n:i.R=n:this._=n,a&&o?(r=n.C,n.C=e.C,n.L=a,a.U=n,n!==o?(i=n.U,n.U=e.U,e=n.R,i.L=e,n.R=o,o.U=n):(n.U=i,i=n,e=n.R)):(r=e.C,e=n),e&&(e.U=i),!r)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,Fi(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Li(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,Fi(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,Li(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Fi(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,Li(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}};var ji=Ri;function Hi(e,t,n,r){var i=[null,null],a=ca.push(i)-1;return i.left=e,i.right=t,n&&Bi(i,e,t,n),r&&Bi(i,t,e,r),la[e.index].halfedges.push(a),la[t.index].halfedges.push(a),i}function Wi(e,t,n){var r=[t,n];return r.left=e,r}function Bi(e,t,n,r){e[0]||e[1]?e.left===n?e[1]=r:e[0]=r:(e[0]=r,e.left=t,e.right=n)}function Vi(e,t,n,r,i){var a,o=e[0],l=e[1],u=o[0],c=o[1],s=0,f=1,d=l[0]-u,h=l[1]-c;if(a=t-u,d||!(a>0)){if(a/=d,d<0){if(a0){if(a>f)return;a>s&&(s=a)}if(a=r-u,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>s&&(s=a)}else if(d>0){if(a0)){if(a/=h,h<0){if(a0){if(a>f)return;a>s&&(s=a)}if(a=i-c,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>s&&(s=a)}else if(h>0){if(a0||f<1)||(s>0&&(e[0]=[u+s*d,c+s*h]),f<1&&(e[1]=[u+f*d,c+f*h]),!0)}}}}}function Yi(e,t,n,r,i){var a=e[1];if(a)return!0;var o,l,u=e[0],c=e.left,s=e.right,f=c[0],d=c[1],h=s[0],p=s[1],m=(f+h)/2,g=(d+p)/2;if(p===d){if(m=r)return;if(f>h){if(u){if(u[1]>=i)return}else u=[m,n];a=[m,i]}else{if(u){if(u[1]1)if(f>h){if(u){if(u[1]>=i)return}else u=[(n-l)/o,n];a=[(i-l)/o,i]}else{if(u){if(u[1]=r)return}else u=[t,o*t+l];a=[r,o*r+l]}else{if(u){if(u[0]=-fa)){var h=u*u+c*c,p=s*s+f*f,m=(f*h-c*p)/d,g=(u*p-s*h)/d,v=Qi.pop()||new function(){zi(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=e,v.site=i,v.x=m+o,v.y=(v.cy=g+l)+Math.sqrt(m*m+g*g),e.circle=v;for(var y=null,b=ua._;b;)if(v.ysa)l=l.L;else{if(!((i=a-aa(l,o))>sa)){r>-sa?(t=l.P,n=l):i>-sa?(t=l,n=l.N):t=n=l;break}if(!l.R){t=l;break}l=l.R}!function(e){la[e.index]={site:e,halfedges:[]}}(e);var u=ea(e);if(oa.insert(t,u),t||n){if(t===n)return Ji(t),n=ea(t.site),oa.insert(u,n),u.edge=n.edge=Hi(t.site,u.site),Zi(t),void Zi(n);if(n){Ji(t),Ji(n);var c=t.site,s=c[0],f=c[1],d=e[0]-s,h=e[1]-f,p=n.site,m=p[0]-s,g=p[1]-f,v=2*(d*g-h*m),y=d*d+h*h,b=m*m+g*g,w=[(g*y-h*b)/v+s,(d*b-m*y)/v+f];Bi(n.edge,c,p,w),u.edge=Hi(c,e,null,w),n.edge=Hi(e,p,null,w),Zi(t),Zi(n)}else u.edge=Hi(t.site,u.site)}}function ia(e,t){var n=e.site,r=n[0],i=n[1],a=i-t;if(!a)return r;var o=e.P;if(!o)return-1/0;var l=(n=o.site)[0],u=n[1],c=u-t;if(!c)return l;var s=l-r,f=1/a-1/c,d=s/c;return f?(-d+Math.sqrt(d*d-2*f*(s*s/(-2*c)-u+c/2+i-a/2)))/f+r:(r+l)/2}function aa(e,t){var n=e.N;if(n)return ia(n,t);var r=e.site;return r[1]===t?r[0]:1/0}var oa,la,ua,ca,sa=1e-6,fa=1e-12;function da(e,t,n){return(e[0]-n[0])*(t[1]-e[1])-(e[0]-t[0])*(n[1]-e[1])}function ha(e,t){return t[1]-e[1]||t[0]-e[0]}function pa(e,t){var n,r,i,a=e.sort(ha).pop();for(ca=[],la=new Array(e.length),oa=new ji,ua=new ji;;)if(i=Xi,a&&(!i||a[1]sa||Math.abs(i[0][1]-i[1][1])>sa)||delete ca[a]}(o,l,u,c),function(e,t,n,r){var i,a,o,l,u,c,s,f,d,h,p,m,g=la.length,v=!0;for(i=0;isa||Math.abs(m-d)>sa)&&(u.splice(l,0,ca.push(Wi(o,h,Math.abs(p-e)sa?[e,Math.abs(f-e)sa?[Math.abs(d-r)sa?[n,Math.abs(f-n)sa?[Math.abs(d-t)=l)return null;var u=e-i.site[0],c=t-i.site[1],s=u*u+c*c;do{i=a.cells[r=o],o=null,i.halfedges.forEach((function(n){var r=a.edges[n],l=r.left;if(l!==i.site&&l||(l=r.right)){var u=e-l[0],c=t-l[1],f=u*u+c*c;f13?13:t}},{key:"drawChart",value:function(e){var t=this.props,n=t.config,r=t.data;void 0===n.toColor&&(n.font_size_value=8,n.font_size_label=10,n.toColor=["#7FCDAE","#ffed6f","#EE7772"]);var i=this.getWindowSize(),a=(this.getFontSize(),.97*i),o=($t(",d"),function e(){var t=Ft(),n=[],r=[],i=Fn;function a(e){var a=e+"",o=t.get(a);if(!o){if(i!==Fn)return i;t.set(a,o=n.push(e))}return r[(o-1)%r.length]}return a.domain=function(e){if(!arguments.length)return n.slice();n=[],t=Ft();for(var r,i,o=-1,l=e.length;++o.15?e.data.color/c:.15})).style("fill",(function(e){if("fill"==n.color_by_type)return n.toColor[0];if("cat"==n.color_by_type){var t=Math.round(e.data.color/c*n.toColor.length)-1;return n.toColor[t<0?0:t]}return n.toColor[0]})).on("mousemove",(function(e){ne(this).style("stroke-width",10).style("stroke",(function(e){if("fill"==n.color_by_type)return n.toColor[0];if("cat"==n.color_by_type){var t=Math.round(e.data.color/c*n.toColor.length)-1;return n.toColor[t<0?0:t]}return n.toColor[0]})).style("z-index",10).style("stroke-opacity",(function(e){return e.data.color/c>.5?e.data.color/2/c:2*e.data.color/c}))})).on("mouseout",(function(e){ne(this).style("z-index",1).style("stroke-width",0).style("opacity",(function(e){return"fill"==n.color_by_type||"cat"==n.color_by_type?1:e.data.color/c>.15?e.data.color/c:.15}))})),!1!==n.value_titles&&f.append("text").attr("class","label").attr("dy",!1===n.value_labels?".3em":".1em").style("text-anchor","middle").style("font-size",n.font_size_value).text((function(e){return e.data.itemName.substring(0,e.r/3)})),!1!==n.value_labels&&f.append("text").attr("class","label").attr("dy",!1===n.value_titles?".3em":"1.5em").style("font-size",n.font_size_label).style("text-anchor","middle").text((function(e){return e.data.rendered})),f.on("mousemove",(function(e){ne("#chart").append("div").attr("id","tooltip");var t="";t+="
"+e.data.itemName+"
",t+=" "+(e.data.html?ya.a.sanitize(e.data.html):e.data.rendered)+"
",t+=" "+(e.data.secondMeasureHtml?ya.a.sanitize(e.data.secondMeasureHtml):e.data.secondMeasureRendered)+"
",ne("#tooltip").html(t);var n=Math.round(Number(ne("#tooltip").style("width").slice(0,-2)))/2;ne("#tooltip").style("left",q.pageX-(n>100?30:n+5)+"px").style("top",q.pageY-60+"px").style("opacity",1).style("position","absolute").style("font-family","Roboto").style("font-size",".8rem").style("text-align","center").style("padding",".5rem").style("pointer-events","none").style("color","white").style("background-color","#313639").style("background-opacity",".85").style("border-radius","#8px"),ne("#tooltip").append("div").style("border-right","solid 4px transparent").style("border-left","solid 4px transparent").style("border-top","solid 4px #313639").style("transform","translateX(-50%)").style("content","").style("top","100%").style("left","50%").style("height",5).style("width",5).style("position","absolute")})).on("mouseout",(function(e){(function(e){return new $([document.querySelectorAll(e)],[document.documentElement])})("#tooltip").remove()})),ne(self.frameElement).style("height",a+"px")}},{key:"render",value:function(){var e=this.getFontSize();return i.a.createElement(Ta,{id:"chart",style:{fontSize:e}})}}]),n}();Sa.defaultProps={config:{},data:[]};var Ea=Sa,Aa=n(14),_a=n.n(Aa);function Ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Na={color_by_type:{type:"string",label:"Color Rule",display:"select",values:[{Gradient:"gradient"},{Fill:"fill"},{Categorical:"cat"}],default:"gradient",section:"Series",order:0},toColor:{type:"array",label:"Fill Color",section:"Series",default:["#7FCDAE","#ffed6f","#EE7772"],display:"colors",order:1},value_labels:{type:"boolean",label:"Display Labels",default:!0,section:"Series",order:2},value_titles:{type:"boolean",label:"Display Values",default:!0,section:"Series",order:3},value_format:{type:"string",label:"Value Formatting Override",placeholder:"Spreadsheet-style format code",section:"Series",order:7},font_size_value:{type:"string",label:"Lable Font Size",default:"8",section:"Style",order:4},font_size_label:{type:"string",label:"Value Font Size",default:"10",section:"Style",order:5}};looker.plugins.visualizations.add({id:"bubble_chart",label:"Bubble Chart",options:Na,create:function(e,t){this.chart=o.a.render(i.a.createElement("div",null),e)},updateAsync:function(e,t,n,r,a,l){if(this.clearErrors(),0!==e.length){var u=[].concat(r.fields.dimensions,r.fields.table_calculations.filter((function(e){return!1===e.measure}))),c=[].concat(r.fields.measures,r.fields.table_calculations.filter((function(e){return!0===e.measure})));if(c.length<2)this.addError({title:"Too few measures",message:"This chart requires at least 2 measures selected."});else if(u.length<1)this.addError({title:"Dimensions",message:"This chart requires at least 1 dimension."});else{var s=c[0],f=c[1],d=[],h=[],p=Na;p.size_by={type:"string",label:"Size by",display:"select",values:c.map((function(e){return Ma({},e.label,e.name)})),section:"Series",default:s&&s.name,order:5},p.color_by={type:"string",label:"Color by",display:"select",values:c.map((function(e){return Ma({},e.label,e.name)})),section:"Series",default:f&&f.name,order:6},this.trigger("registerOptions",p),e.forEach((function(e,t){var r=u.map((function(t){return e[t.name].rendered||e[t.name].value})).join("-"),i=s&&e[s.name].value,a=s&&e[s.name].html,o=f&&e[f.name].value,l=f&&e[f.name].html,c=void 0===n.color_by?o:e[n.color_by].value;h.push(c);var p=null!=n.value_format&&_a.a.format(n.value_format,void 0===n.size_by?i:e[n.size_by].value),m=null!=n.value_format&&_a.a.format(n.value_format,o);d.push({itemName:r,value:void 0===n.size_by?i:e[n.size_by].value,rendered:p||LookerCharts.Utils.textForCell(void 0===n.size_by?e[s.name]:e[n.size_by]),color:c,html:a,secondMeasureRendered:m||o,secondMeasureHtml:l})})),this.chart=o.a.render(i.a.createElement(Ea,{config:n,data:d,maxColor:Math.max.apply(null,h)}),t),l()}}else this.addError({title:"No Results"})}})}])})); \ No newline at end of file diff --git a/src/bubble_chart/bubble_chart_container.js b/src/bubble_chart/bubble_chart_container.js index 2898dc1..39f2f78 100755 --- a/src/bubble_chart/bubble_chart_container.js +++ b/src/bubble_chart/bubble_chart_container.js @@ -91,6 +91,17 @@ looker.plugins.visualizations.add({ // Clear any errors from previous updates this.clearErrors(); + // Issue identified where viz would not change with table calc filters + // need to supply the container with something new if we fail early and + // don't make it to the inteded render function. + // https://looker.atlassian.net/browse/DX-5779 + if (data.length === 0) { + this.addError({ + title: "No Results", + }); + return; + } + const dimensions = [].concat( queryResponse.fields.dimensions, queryResponse.fields.table_calculations.filter( @@ -120,13 +131,6 @@ looker.plugins.visualizations.add({ }); return; } - if (data.length === 0) { - this.addError({ - title: "No Results", - }); - done(); - return; - } // const secondDimension = dimensions[1] const firstMeasure = measures[0];