@hpcc-js/chart 3.7.8 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6739 -10
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -2
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +7 -7
- package/types/Radar.d.ts +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/api"),require("@hpcc-js/common"),require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/api","@hpcc-js/common","@hpcc-js/util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/chart"]={},t["@hpcc-js/api"],t["@hpcc-js/common"],t["@hpcc-js/util"])}(this,function(t,e,i,n){"use strict";var o=Object.defineProperty,a=(t,e)=>o(t,"name",{value:e,configurable:!0}),s=(t,e,i)=>((t,e,i)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);var r=Math.PI,l=2*r,h=1e-6,c=l-h;function u(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function p(){return new u}function d(t){return a(function(){return t},"constant")}a(u,"Path"),a(p,"path"),u.prototype=p.prototype={constructor:u,moveTo:a(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:a(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:a(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:a(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:a(function(t,e,i,n,o,a){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+a)},"bezierCurveTo"),arcTo:a(function(t,e,i,n,o){t=+t,e=+e,i=+i,n=+n,o=+o;var a=this._x1,s=this._y1,l=i-t,c=n-e,u=a-t,p=s-e,d=u*u+p*p;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>h)if(Math.abs(p*l-c*u)>h&&o){var f=i-a,y=n-s,_=l*l+c*c,x=f*f+y*y,m=Math.sqrt(_),g=Math.sqrt(d),b=o*Math.tan((r-Math.acos((_+d-x)/(2*m*g)))/2),v=b/g,w=b/m;Math.abs(v-1)>h&&(this._+="L"+(t+v*u)+","+(e+v*p)),this._+="A"+o+","+o+",0,0,"+ +(p*f>u*y)+","+(this._x1=t+w*l)+","+(this._y1=e+w*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},"arcTo"),arc:a(function(t,e,i,n,o,a){t=+t,e=+e,a=!!a;var s=(i=+i)*Math.cos(n),u=i*Math.sin(n),p=t+s,d=e+u,f=1^a,y=a?n-o:o-n;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+p+","+d:(Math.abs(this._x1-p)>h||Math.abs(this._y1-d)>h)&&(this._+="L"+p+","+d),i&&(y<0&&(y=y%l+l),y>c?this._+="A"+i+","+i+",0,1,"+f+","+(t-s)+","+(e-u)+"A"+i+","+i+",0,1,"+f+","+(this._x1=p)+","+(this._y1=d):y>h&&(this._+="A"+i+","+i+",0,"+ +(y>=r)+","+f+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:a(function(t,e,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},"rect"),toString:a(function(){return this._},"toString")},a(d,"constant$3");var f=Math.abs,y=Math.atan2,_=Math.cos,x=Math.max,m=Math.min,g=Math.sin,b=Math.sqrt,v=1e-12,w=Math.PI,S=w/2,A=2*w;function k(t){return t>1?0:t<-1?w:Math.acos(t)}function M(t){return t>=1?S:t<=-1?-S:Math.asin(t)}function T(t){return t.innerRadius}function P(t){return t.outerRadius}function C(t){return t.startAngle}function I(t){return t.endAngle}function z(t){return t&&t.padAngle}function F(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=u*l-c*h;if(!(p*p<v))return[t+(p=(c*(e-a)-u*(t-o))/p)*l,e+p*h]}function D(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/b(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,m=(d+y)/2,g=f-p,v=y-d,w=g*g+v*v,S=o-a,A=p*y-f*d,k=(v<0?-1:1)*b(x(0,S*S*w-A*A)),M=(A*v-g*k)/w,T=(-A*g-v*k)/w,P=(A*v+g*k)/w,C=(-A*g+v*k)/w,I=M-_,z=T-m,F=P-_,D=C-m;return I*I+z*z>F*F+D*D&&(M=P,T=C),{cx:M,cy:T,x01:-c,y01:-u,x11:M*(o/S-1),y11:T*(o/S-1)}}function E(){var t=T,e=P,i=d(0),n=null,o=C,s=I,r=z,l=null;function h(){var a,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),d=o.apply(this,arguments)-S,x=s.apply(this,arguments)-S,T=f(x-d),P=x>d;if(l||(l=a=p()),u<c&&(h=u,u=c,c=h),u>v)if(T>A-v)l.moveTo(u*_(d),u*g(d)),l.arc(0,0,u,d,x,!P),c>v&&(l.moveTo(c*_(x),c*g(x)),l.arc(0,0,c,x,d,P));else{var C,I,z=d,E=x,R=d,O=x,N=T,j=T,L=r.apply(this,arguments)/2,B=L>v&&(n?+n.apply(this,arguments):b(c*c+u*u)),$=m(f(u-c)/2,+i.apply(this,arguments)),H=$,V=$;if(B>v){var q=M(B/c*g(L)),W=M(B/u*g(L));(N-=2*q)>v?(R+=q*=P?1:-1,O-=q):(N=0,R=O=(d+x)/2),(j-=2*W)>v?(z+=W*=P?1:-1,E-=W):(j=0,z=E=(d+x)/2)}var G=u*_(z),X=u*g(z),Y=c*_(O),U=c*g(O);if($>v){var Q,Z=u*_(E),J=u*g(E),K=c*_(R),tt=c*g(R);if(T<w&&(Q=F(G,X,K,tt,Z,J,Y,U))){var et=G-Q[0],it=X-Q[1],nt=Z-Q[0],ot=J-Q[1],at=1/g(k((et*nt+it*ot)/(b(et*et+it*it)*b(nt*nt+ot*ot)))/2),st=b(Q[0]*Q[0]+Q[1]*Q[1]);H=m($,(c-st)/(at-1)),V=m($,(u-st)/(at+1))}}j>v?V>v?(C=D(K,tt,G,X,u,V,P),I=D(Z,J,Y,U,u,V,P),l.moveTo(C.cx+C.x01,C.cy+C.y01),V<$?l.arc(C.cx,C.cy,V,y(C.y01,C.x01),y(I.y01,I.x01),!P):(l.arc(C.cx,C.cy,V,y(C.y01,C.x01),y(C.y11,C.x11),!P),l.arc(0,0,u,y(C.cy+C.y11,C.cx+C.x11),y(I.cy+I.y11,I.cx+I.x11),!P),l.arc(I.cx,I.cy,V,y(I.y11,I.x11),y(I.y01,I.x01),!P))):(l.moveTo(G,X),l.arc(0,0,u,z,E,!P)):l.moveTo(G,X),c>v&&N>v?H>v?(C=D(Y,U,Z,J,c,-H,P),I=D(G,X,K,tt,c,-H,P),l.lineTo(C.cx+C.x01,C.cy+C.y01),H<$?l.arc(C.cx,C.cy,H,y(C.y01,C.x01),y(I.y01,I.x01),!P):(l.arc(C.cx,C.cy,H,y(C.y01,C.x01),y(C.y11,C.x11),!P),l.arc(0,0,c,y(C.cy+C.y11,C.cx+C.x11),y(I.cy+I.y11,I.cx+I.x11),P),l.arc(I.cx,I.cy,H,y(I.y11,I.x11),y(I.y01,I.x01),!P))):l.arc(0,0,c,O,R,P):l.lineTo(Y,U)}else l.moveTo(0,0);if(l.closePath(),a)return l=null,a+""||null}return a(h,"arc"),h.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-w/2;return[_(n)*i,g(n)*i]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:d(+e),h):t},h.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:d(+t),h):e},h.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:d(+t),h):i},h.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:d(+t),h):n},h.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:d(+t),h):o},h.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:d(+t),h):s},h.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:d(+t),h):r},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function R(t){this._context=t}function O(t){return new R(t)}function N(t){return t[0]}function j(t){return t[1]}function L(){var t=N,e=j,i=d(!0),n=null,o=O,s=null;function r(a){var r,l,h,c=a.length,u=!1;for(null==n&&(s=o(h=p())),r=0;r<=c;++r)!(r<c&&i(l=a[r],r,a))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,a),+e(l,r,a));if(h)return s=null,h+""||null}return a(r,"line"),r.x=function(e){return arguments.length?(t="function"==typeof e?e:d(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:d(+t),r):e},r.defined=function(t){return arguments.length?(i="function"==typeof t?t:d(!!t),r):i},r.curve=function(t){return arguments.length?(o=t,null!=n&&(s=o(n)),r):o},r.context=function(t){return arguments.length?(null==t?n=s=null:s=o(n=t),r):n},r}function B(){var t=N,e=null,i=d(0),n=j,o=d(!0),s=null,r=O,l=null;function h(a){var h,c,u,d,f,y=a.length,_=!1,x=new Array(y),m=new Array(y);for(null==s&&(l=r(f=p())),h=0;h<=y;++h){if(!(h<y&&o(d=a[h],h,a))===_)if(_=!_)c=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),u=h-1;u>=c;--u)l.point(x[u],m[u]);l.lineEnd(),l.areaEnd()}_&&(x[h]=+t(d,h,a),m[h]=+i(d,h,a),l.point(e?+e(d,h,a):x[h],n?+n(d,h,a):m[h]))}if(f)return l=null,f+""||null}function c(){return L().defined(o).curve(r).context(s)}return a(h,"area"),a(c,"arealine"),h.x=function(i){return arguments.length?(t="function"==typeof i?i:d(+i),e=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:d(+e),h):t},h.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:d(+t),h):e},h.y=function(t){return arguments.length?(i="function"==typeof t?t:d(+t),n=null,h):i},h.y0=function(t){return arguments.length?(i="function"==typeof t?t:d(+t),h):i},h.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:d(+t),h):n},h.lineX0=h.lineY0=function(){return c().x(t).y(i)},h.lineY1=function(){return c().x(t).y(n)},h.lineX1=function(){return c().x(e).y(i)},h.defined=function(t){return arguments.length?(o="function"==typeof t?t:d(!!t),h):o},h.curve=function(t){return arguments.length?(r=t,null!=s&&(l=r(s)),h):r},h.context=function(t){return arguments.length?(null==t?s=l=null:l=r(s=t),h):s},h}function $(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function H(t){return t}function V(){var t=H,e=$,i=null,n=d(0),o=d(A),s=d(0);function r(a){var r,l,h,c,u,p=a.length,d=0,f=new Array(p),y=new Array(p),_=+n.apply(this,arguments),x=Math.min(A,Math.max(-A,o.apply(this,arguments)-_)),m=Math.min(Math.abs(x)/p,s.apply(this,arguments)),g=m*(x<0?-1:1);for(r=0;r<p;++r)(u=y[f[r]=r]=+t(a[r],r,a))>0&&(d+=u);for(null!=e?f.sort(function(t,i){return e(y[t],y[i])}):null!=i&&f.sort(function(t,e){return i(a[t],a[e])}),r=0,h=d?(x-p*g)/d:0;r<p;++r,_=c)l=f[r],c=_+((u=y[l])>0?u*h:0)+g,y[l]={data:a[l],index:r,value:u,startAngle:_,endAngle:c,padAngle:m};return y}return a(r,"pie"),r.value=function(e){return arguments.length?(t="function"==typeof e?e:d(+e),r):t},r.sortValues=function(t){return arguments.length?(e=t,i=null,r):e},r.sort=function(t){return arguments.length?(i=t,e=null,r):i},r.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:d(+t),r):n},r.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:d(+t),r):o},r.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:d(+t),r):s},r}function q(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function W(t){this._context=t}function G(t){return new W(t)}function X(t,e){this._basis=new W(t),this._beta=e}a(k,"acos"),a(M,"asin$1"),a(T,"arcInnerRadius$1"),a(P,"arcOuterRadius$1"),a(C,"arcStartAngle$1"),a(I,"arcEndAngle$1"),a(z,"arcPadAngle$1"),a(F,"intersect$1"),a(D,"cornerTangents$1"),a(E,"d3Arc"),a(R,"Linear$1"),R.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._point=0},"lineStart"),lineEnd:a(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},a(O,"d3CurveLinear"),a(N,"x$1"),a(j,"y$1"),a(L,"d3Line"),a(B,"d3Area"),a($,"descending"),a(H,"identity$2"),a(V,"d3Pie"),a(q,"point$7"),a(W,"Basis$1"),W.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 3:q(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:q(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},a(G,"d3CurveBasis"),a(X,"Bundle$1"),X.prototype={lineStart:a(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:a(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:a(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const Y=a(function t(e){function i(t){return 1===e?new W(t):new X(t,e)}return a(i,"bundle"),i.beta=function(e){return t(+e)},i},"custom")(.85);function U(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Q(t,e){this._context=t,this._k=(1-e)/6}a(U,"point$6"),a(Q,"Cardinal$1"),Q.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:U(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:U(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Z=a(function t(e){function i(t){return new Q(t,e)}return a(i,"cardinal"),i.tension=function(e){return t(+e)},i},"custom")(0);function J(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>v){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>v){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function K(t,e){this._context=t,this._alpha=e}a(J,"point$5"),a(K,"CatmullRom$1"),K.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:J(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const tt=a(function t(e){function i(t){return e?new K(t,e):new Q(t,0)}return a(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"custom")(.5);function et(t){return t<0?-1:1}function it(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(et(a)+et(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function nt(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function ot(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function at(t){this._context=t}function st(t){return new at(t)}function rt(t){this._context=t}function lt(t){var e,i,n=t.length-1,o=new Array(n),a=new Array(n),s=new Array(n);for(o[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,a[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=o[e]/a[e-1],a[e]-=i,s[e]-=i*s[e-1];for(o[n-1]=s[n-1]/a[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/a[e];for(a[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-o[e+1];return[o,a]}function ht(t){return new rt(t)}function ct(t,e){this._context=t,this._t=e}function ut(t){return new ct(t,.5)}function pt(t){return new ct(t,0)}function dt(t){return new ct(t,1)}a(et,"sign$1"),a(it,"slope3$1"),a(nt,"slope2$1"),a(ot,"point$4"),a(at,"MonotoneX$1"),at.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ot(this,this._t0,nt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,ot(this,nt(this,i=it(this,t,e)),i);break;default:ot(this,this._t0,i=it(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(at.prototype).point=function(t,e){at.prototype.point.call(this,e,t)},a(st,"monotoneX"),a(rt,"Natural"),rt.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:a(function(){var t=this._x,e=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===i)this._context.lineTo(t[1],e[1]);else for(var n=lt(t),o=lt(e),a=0,s=1;s<i;++a,++s)this._context.bezierCurveTo(n[0][a],o[0][a],n[1][a],o[1][a],t[s],e[s]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},"lineEnd"),point:a(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},a(lt,"controlPoints"),a(ht,"d3CurveNatural"),a(ct,"Step$1"),ct.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:a(function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,e)}}this._x=t,this._y=e},"point")},a(ut,"d3CurveStep"),a(pt,"stepBefore"),a(dt,"stepAfter");var ft=Array.prototype.slice;function yt(t){return t}a(yt,"identity$1");var _t=1e-6;function xt(t){return"translate("+(t+.5)+",0)"}function mt(t){return"translate(0,"+(t+.5)+")"}function gt(t){return function(e){return+t(e)}}function bt(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function vt(){return!this.__axis}function wt(t,e){var i=[],n=null,o=null,s=6,r=6,l=3,h=1===t||4===t?-1:1,c=4===t||2===t?"x":"y",u=1===t||3===t?xt:mt;function p(a){var p=null==n?e.ticks?e.ticks.apply(e,i):e.domain():n,d=null==o?e.tickFormat?e.tickFormat.apply(e,i):yt:o,f=Math.max(s,0)+l,y=e.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(e.bandwidth?bt:gt)(e.copy()),g=a.selection?a.selection():a,b=g.selectAll(".domain").data([null]),v=g.selectAll(".tick").data(p,e).order(),w=v.exit(),S=v.enter().append("g").attr("class","tick"),A=v.select("line"),k=v.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),A=A.merge(S.append("line").attr("stroke","currentColor").attr(c+"2",h*s)),k=k.merge(S.append("text").attr("fill","currentColor").attr(c,h*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),a!==g&&(b=b.transition(a),v=v.transition(a),A=A.transition(a),k=k.transition(a),w=w.transition(a).attr("opacity",_t).attr("transform",function(t){return isFinite(t=m(t))?u(t):this.getAttribute("transform")}),S.attr("opacity",_t).attr("transform",function(t){var e=this.parentNode.__axis;return u(e&&isFinite(e=e(t))?e:m(t))})),w.remove(),b.attr("d",4===t||2==t?r?"M"+h*r+","+_+"H0.5V"+x+"H"+h*r:"M0.5,"+_+"V"+x:r?"M"+_+","+h*r+"V0.5H"+x+"V"+h*r:"M"+_+",0.5H"+x),v.attr("opacity",1).attr("transform",function(t){return u(m(t))}),A.attr(c+"2",h*s),k.attr(c,h*f).text(d),g.filter(vt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),g.each(function(){this.__axis=m})}return a(p,"axis"),p.scale=function(t){return arguments.length?(e=t,p):e},p.ticks=function(){return i=ft.call(arguments),p},p.tickArguments=function(t){return arguments.length?(i=null==t?[]:ft.call(t),p):i.slice()},p.tickValues=function(t){return arguments.length?(n=null==t?null:ft.call(t),p):n&&n.slice()},p.tickFormat=function(t){return arguments.length?(o=t,p):o},p.tickSize=function(t){return arguments.length?(s=r=+t,p):s},p.tickSizeInner=function(t){return arguments.length?(s=+t,p):s},p.tickSizeOuter=function(t){return arguments.length?(r=+t,p):r},p.tickPadding=function(t){return arguments.length?(l=+t,p):l},p}function St(t){return wt(1,t)}function At(t){return wt(2,t)}function kt(t){return wt(3,t)}function Mt(t){return wt(4,t)}a(xt,"translateX"),a(mt,"translateY"),a(gt,"number"),a(bt,"center"),a(vt,"entering"),a(wt,"axis"),a(St,"axisTop"),a(At,"axisRight"),a(kt,"axisBottom"),a(Mt,"axisLeft");const Tt=class _Axis extends i.SVGWidget{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(t="origin"){super(),this._drawStartPos=t,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(t,e){if(t instanceof Array)return t.map(function(t){return this.parse(t)},this);if(null!=t){if(this.parser)return this.parser("number"==typeof t?t.toString():t);if(e&&"string"==typeof t)return+t}return t}parseInvert(t){return t instanceof Array?t.map(function(t){return this.parseInvert(t)},this):this.parserInvert&&t?this.parserInvert(t):t}format(t){return t instanceof Array?t.map(function(t){return this.format(t)},this):null!=t&&this.formatter?this.formatter(t):t}parseFormat(t){return this.format(this.parse(t))}tickFormatFunc(t){return arguments.length?(this._tickFormatFunc=t,this.updateScale(),this):this._tickFormatFunc}scalePos(t){let e=this.d3Scale(this.parse(t));return"ordinal"===this.type()&&(e+=this.bandwidth()/2),e}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case"left":case"right":return!1}return!0}domain(t){return arguments.length?(this.d3Scale.domain(t),this):this.d3Scale.domain()}range(t){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(t,.1):this.d3Scale.rangeRound&&this.d3Scale.range(t),this}invert(t){return this.d3Scale.invert(t)}guideTarget(t){return this._guideElement=i.select(t).attr("class",this._class),this}enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgAxis=this.svg.append("g").attr("class","axis"),this.svgGuides=(this._guideElement||e).append("g").attr("class","guide")}_prevOrientation;updateScale(){switch(this.type()){case"ordinal":if(this.d3Scale=i.scaleBand().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){const t=this.ordinalMappings();this.formatter=e=>t[e]||e}else this.formatter=null;break;case"linear":this.d3Scale=i.scaleLinear(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?i.format(this.tickFormat()):null;break;case"pow":this.d3Scale=i.scalePow().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?i.format(this.tickFormat()):null;break;case"log":this.d3Scale=i.scaleLog().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?i.format(this.tickFormat()):null;break;case"time":this.d3Scale=i.scaleTime(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?i.timeParse(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?i.timeFormat(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?i.timeFormat(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=Mt(this.d3Scale),this.d3Guides=Mt(this.d3Scale);break;case"top":this.d3Axis=St(this.d3Scale),this.d3Guides=St(this.d3Scale);break;case"right":this.d3Axis=At(this.d3Scale),this.d3Guides=At(this.d3Scale);break;default:this.d3Axis=kt(this.d3Scale),this.d3Guides=kt(this.d3Scale)}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(""),this.svgGuides&&this.svgGuides.html("")}if(this.extend())if("ordinal"===this.type());else{let t,e,i,n,o,a;this.isHorizontal()?(t=this.width(),this.d3Scale.range([0,t]),e=t*this.extend()/100,i=this.d3Scale.invert(0),o=this.d3Scale.invert(-e),n=this.d3Scale.invert(t),a=this.d3Scale.invert(t+e)):(t=this.height(),this.d3Scale.range([t,0]),e=t*this.extend()/100,i=this.d3Scale.invert(t),o=this.d3Scale.invert(t+e),n=this.d3Scale.invert(0),a=this.d3Scale.invert(-e)),o===i&&(o=i-i*this.extend()/100),a===n&&(a=n+n*this.extend()/100),Math.sign(i)!==Math.sign(o)&&(o=0),Math.sign(n)!==Math.sign(a)&&(a=0),this.d3Scale.domain([o,a])}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat("").ticks(this.tickCount());const t=this.ticks();return t.length&&(this.d3Axis.tickValues(t.map(t=>this.parse(t.value))).tickFormat((e,i)=>t[i].label),this.d3Guides.tickValues(t.map(t=>this.parse(t.value)))),this}adjustText(t,e){const n=this.isHorizontal(),o="left"===this.orientation(),a="bottom"===this.orientation(),s=this,r=t.selectAll(".tick > text").style("font-family",this.fontFamily()).style("font-size",this.fontSize_exists()?this.fontSize()+"px":null);if("linebreak"===this.overlapMode())"ordinal"===this.type()&&r.call(function(){return s.linebreak.apply(s,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&r.call(function(){return s.wrap.apply(s,arguments)},this.bandwidth());else switch(n?this.overlapMode():"none"){case"stagger":r.style("text-anchor","middle").attr("dy",function(t,i){return(a?1:-1)*((a?.71:0)+i%e)+"em"}).attr("dx",0).attr("visibility",null).attr("transform","rotate(0)");break;case"hide":r.style("text-anchor","middle").attr("dy",(a?.71:0)+"em").attr("dx",0).attr("visibility",function(t,i){return i%e?"hidden":null}).attr("transform","rotate(0)");break;case"rotate":const t=-this.labelRotation()||0;if(0!==t&&e>1){r.each(function(){const e=i.select(this),n=e.node().getBBox(),o=(a?1:-1)*Math.sin(Math.PI*(-Math.abs(t)/180));e.style("text-anchor",t>0?a?"start":"end":a?"end":"start").attr("dy",n.height/2*o+"px").attr("dx",t>0?a?"0.71em":"-0.71em":a?"-0.71em":"0.71em").attr("transform","rotate("+t+")").attr("visibility",null)});break}default:r.style("text-anchor",n?"middle":o?"end":"start").attr("dy",n?(a?.71:0)+"em":"0.32em").attr("dx",0).attr("visibility",null).attr("transform","rotate(0)")}}calcTickOverlapModulus(t){let e=1;switch(this.overlapMode()){case"rotate":case"stagger":case"hide":const i=[];t.selectAll(".tick > text").each(function(){const t=this.getBoundingClientRect();for(let n=i.length-1;n>=0&&!(i[n].right<t.left);--n)i.length+1-n>e&&(e=i.length+1-n);i.push(t)})}return e}calcOverflow(t,e){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};const i=this.isHorizontal();this.range(i?[0,this.width()]:[this.height(),0]);const n=t.append("g").attr("class",this.classID()),o=n.append("g");o.attr("class",i?"x":"y").call(this.d3Axis),e&&t.selectAll(".tick > text").remove();const a={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(o)};this.adjustText(o,a.tickOverlapModulus);const s=o.node().getBBox();switch(a.depth=i?s.height:s.width,this.shrinkToFit()){case"low":case"both":a.left=i?-s.x:0,a.bottom=i?0:-(this.height()-(s.height+s.y))}switch(this.shrinkToFit()){case"high":case"both":a.top=i?0:-s.y,a.right=i?-(this.width()-s.x-s.width):0}return n.remove(),a}wrap(t,e,n){n=n||/\s+/;const o=this;t.each(function(){const t=i.select(this),a=t.text().split(n).reverse();let s=[],r=0;const l=t.attr("x"),h=t.attr("y"),c=parseFloat(t.style("font-size"))||10,u=Math.floor(e/(1.1*c))-1,p=o.isHorizontal()?1:Math.ceil(a.length/u),d=parseFloat(t.attr("dy"));let f=t.text(null).append("tspan").attr("x",l).attr("y",h).attr("dy",d+"em"),y=0,_=a.pop();for(;_;)s.push(_),f.text(s.join(" ")),y++,f.node().getComputedTextLength()>e&&y>=p&&(s.pop(),f.text(s.join(" ")),s=[_],f=t.append("tspan").attr("x",l).attr("y",h).attr("dy",1.1*++r+d+"em").text(_),y=0),_=a.pop();o.isHorizontal()||t.selectAll("tspan").attr("y",-r/2+"em")})}linebreak(t,e){this.wrap(t,e,"\n")}update(t,e){super.update(t,e),this.svg.style("display",this.hidden()?"none":null);const i=this.calcOverflow(e),n=this.isHorizontal()?i.left:this.height()-i.top-i.bottom,o=this.isHorizontal()?this.width()-i.right-this.padding():0+this.padding();this.range(this.reverse()?[o,n]:[n,o]);const s=this;function r(t){t.attr("transform",function(){switch(s.orientation()){case"left":return"translate("+i.depth+", "+i.top+")";case"top":return"translate(0,"+i.depth+")";case"right":return"translate("+(s.width()-i.depth)+", "+i.top+")";case"bottom":return"translate(0,"+(s.height()-i.depth)+")"}return"translate(0,0)"})}a(r,"doPosition"),this.svg.style("visibility","none"===this.type()?"hidden":null).transition().call(r),this._guideElement&&this.svgGuides.transition().call(r),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,i.tickOverlapModulus);this.pos().x;const l=this.width(),h=this.svgAxis.selectAll(".axisTitle").data(this.title()?[this.title()]:[]),c=h.enter().append("text").attr("class","axisTitle").merge(h).transition().attr("dx",null).style("text-anchor","end");switch(this.orientation()){case"left":c.attr("transform","rotate(-90)").attr("x",-2).attr("y",2).attr("dy",".71em");break;case"right":c.attr("transform","rotate(-90)").attr("x",-2).attr("y",4).attr("dx",null).attr("dy","-.71em");break;case"top":c.attr("transform","rotate(0)").attr("x",l-2).attr("y",2).attr("dx",null).attr("dy",".71em");break;case"bottom":c.attr("transform","rotate(0)").attr("x",l-2).attr("y",-2).attr("dy",null)}c.text(this.title_exists()?this.title():""),h.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(".tick").classed("guide-0",t=>0===t&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(t,e){super.postUpdate(t,e),this._guideElement&&this._guideElement.attr("transform",this._element.attr("transform"))}};a(Tt,"Axis");let Pt=Tt;Pt.prototype._class+=" chart_Axis",Pt.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),Pt.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:a(t=>"time"!==t.type(),"disable")}),Pt.prototype.publish("reverse",!1,"boolean","Reverse"),Pt.prototype.publish("title",null,"string","Title"),Pt.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),Pt.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:a(t=>"pow"!==t.type(),"disable")}),Pt.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:a(t=>"log"!==t.type(),"disable")}),Pt.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:a(t=>"ordinal"!==t.type(),"disable")}),Pt.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),Pt.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),Pt.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:a(t=>"ordinal"===t.type(),"disable")}),Pt.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:a(t=>"ordinal"===t.type(),"disable")}),Pt.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),Pt.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),Pt.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:a(t=>"ordinal"===t.type(),"disable")}),Pt.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:a(t=>"ordinal"===t.type(),"disable")}),Pt.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),Pt.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:a(t=>"rotate"!==t.overlapMode(),"disable")}),Pt.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),Pt.prototype.publish("extend",5,"number","Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')",null,{optional:!0,disable:a(t=>"ordinal"===t.type(),"disable")}),Pt.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),Pt.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:a(t=>"ordinal"!==t.type(),"disable")}),Pt.prototype.publish("ordinalPaddingOuter",.1,"number","Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)",null,{disable:a(t=>"ordinal"!==t.type(),"disable")}),Pt.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),Pt.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),Pt.prototype._origType=Pt.prototype.type,Pt.prototype.type=function(t){const e=Pt.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},Pt.prototype._origTimePattern=Pt.prototype.timePattern,Pt.prototype.timePattern=function(t){const e=Pt.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const Ct=class _XYAxis extends i.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),i.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new Pt).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new Pt).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=i.brush().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=i.brushX().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=i.brushY().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(t){return this.domainAxis.parse(t)}parseValue(t){return this.valueAxis.parse(t,!0)}formatData(t){return this.domainAxis.format(t)}formatValue(t){return this.valueAxis.format(t)}parsedData(){return this.data().map(function(t){let e=0;return t.map(function(t,i){if(0===i)return this.parseData(t);if(i>=this.columns().length)return t;const n=this.yAxisStacked()?[e,e+this.parseValue(t)]:this.parseValue(t);return e+=this.parseValue(t),n},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgRegions=e.append("g"),this.svgDomainGuide=this.svg.append("g"),this.svgValueGuide=this.svg.append("g"),this.svgData=this.svg.append("g"),this.svgDataClipRect=this.svg.append("clipPath").attr("id",this.id()+"_clippath").append("rect").attr("x",0).attr("y",0),this.svgData=this.svg.append("g").attr("clip-path","url(#"+this.id()+"_clippath)"),this._selection.widgetElement(this.svgData),this.svgFocus=e.append("g"),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=e.append("g").attr("class","brush"),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(t,e,i){let n,o,a;return"e"===t.type||"w"===t.type?(n=+("e"===t.type),o=n?1:-1,a=i/3,"M"+.5*o+","+a+"A6,6 0 0 "+n+" "+6.5*o+","+(a+6)+"V"+(2*a-6)+"A6,6 0 0 "+n+" "+.5*o+","+2*a+"ZM"+2.5*o+","+(a+8)+"V"+(2*a-8)+"M"+4.5*o+","+(a+8)+"V"+(2*a-8)):(n=+("s"===t.type),a=n?1:-1,o=e/3,"M"+o+", "+.5*a+"A6,6 0 0 "+(n+1)%2+" "+(o+6)+","+6.5*a+"H"+(2*o-6)+"A6,6 0 0 "+(n+1)%2+" "+2*o+","+.5*a+"ZM"+(o+8)+","+2.5*a+"H"+(2*o-8)+"M"+(o+8)+","+4.5*a+"H"+(2*o-8))}_skipSelection=!1;skipSelection(t){return arguments.length?(this._skipSelection=t,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let t=[];const e=this,n=i.brushSelection(this.svgBrush.node());n&&(t=this.data().filter(function(t){const i=e.dataPos(t[0]);if(e.use2dSelection()){const o=e.valuePos(t[1])+e.valueAxis.bandwidth()/2;return i>=n[0][0]&&i<=n[1][0]&&o>=n[0][1]&&o<=n[1][1]}return i>=n[0]&&i<=n[1]})),this.selection(t)}brushMoved2(){const t="horizontal"===this.orientation(),e=this.use2dSelection()?[]:t?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],n=this.svgBrush.selectAll(".handle--custom").data(e),o=i.d3Event()?.selection;null==o?n.attr("display","none"):t?n.attr("display",null).attr("transform",(t,e)=>"translate("+o[e]+",0)"):n.attr("display",null).attr("transform",(t,e)=>"translate(0, "+o[e]+")")}dataPos(t){return this.domainAxis.scalePos(t)}valuePos(t){return this.valueAxis.scalePos(t)}getAxisSize(t){return{width:this.xAxis?this.xAxis.width():t.xAxis.width(),height:this.yAxis?this.yAxis.height():t.yAxis.width()}}calcMargin(t,e,i){const n={top:!i&&this.selectionMode()?10:2,right:i&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},o=this.width()-n.left-n.right,a=this.height()-n.top-n.bottom;let s=0,r=30,l=0,h=30;for(let c=0;c<10;++c){this.xAxis.width(o-h).height(0);const t=this.xAxis.calcOverflow(e),i=t.depth;this.yAxis.width(0).height(a-r);const n=this.yAxis.calcOverflow(e),c=n.depth;if(s=t.right,l=n.top,i===r&&c===h)break;r=i,h=c}return this.xAxis.x(o/2+h/2+n.left).y(a+n.top).width(o-h),this.yAxis.x(n.left).y(a/2-r/2+n.top).height(a-r),n.left+=h,n.top+=l,n.right+=s,n.bottom+=r,n}updateRegions(t,e,n){const o=this,a=this.svgRegions.selectAll(".region").data(this.regions());a.enter().append("rect").attr("class","region"),n?a.attr("x",function(t){return o.dataPos(t.x0)}).attr("y",0).attr("width",function(t){return o.dataPos(t.x1)-o.dataPos(t.x0)}).attr("height",this.height()).style("stroke",function(t){return o._palette(t.colorID)}).style("fill",function(t){return i.hsl(o._palette(t.colorID)).brighter()}):a.attr("x",0).attr("y",function(t){return o.dataPos(t.x0)}).attr("width",this.width()).attr("height",function(t){return o.dataPos(t.x0)-o.dataPos(t.x1)}).style("stroke",function(t){return o._palette(t.colorID)}).style("fill",function(t){return i.hsl(o._palette(t.colorID)).brighter()}),a.exit().remove()}_prevXAxisType;update(t,e){this.selectionGlow(!this.tabNavigation()),super.update(t,e);const n=this,o="horizontal"===this.orientation();if(this.updateRegions(t,e,o),this.domainAxis.orientation(o?"bottom":"left").title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(o?"left":"bottom"),this.xAxis=o?this.domainAxis:this.valueAxis,this.yAxis=o?this.valueAxis:this.domainAxis,"ordinal"===this.xAxisType()){const t=this.columns().length,e={};this.domainAxis.ordinals(this.data().map(function(i){return e[i[0]]=n.xAxisOrdinalMapping(i,i[t]),i[0]})).ordinalMappings(e)}else{const t=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert(i.min(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(i.max(this.parsedData(),function(t){return t[0]}));void 0!==t&&void 0!==e&&this.domainAxis.low(t).high(e)}const a=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert(i.min(this.parsedData(),function(t){return i.min(t.filter(function(t,e){return e>0&&n.columns()[e]&&0!==n.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[0]:t})})),s=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert(i.max(this.parsedData(),function(t){return i.max(t.filter(function(t,e){return e>0&&n.columns()[e]&&0!==n.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[1]:t})}));this.valueAxis.low(a).high(s),this.margin=this.calcMargin(t,e,o);let r=this.width()-this.margin.left-this.margin.right;r<0&&(r=0);let l=this.height()-this.margin.top-this.margin.bottom;l<0&&(l=0);const h=o?r:l,c=o?l:r;if(this.domainAxis.tickLength(this.xAxisGuideLines()?c:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?h:0).render(),this.svgDataClipRect.attr("width",r).attr("height",l),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(r,l,h,o),this.updateFocusChart(t,e,this.margin,r,l,o),this.chartsUpdate(r,l,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,n,o){const a=this.use2dSelection()?this.xyBrush:o?this.xBrush:this.yBrush,s=i.brushSelection(this.svgBrush.node());a.extent([[0,0],[t,e]]),this.svgBrush.attr("transform","translate("+this.margin.left+", "+this.margin.top+")").style("display",this.selectionMode()?null:"none").call(a);const r=this.use2dSelection()?[]:o?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],l=this.svgBrush.selectAll(".handle--custom").data(r);if(l.enter().append("path").attr("class","handle--custom").merge(l).attr("cursor",o?"ew-resize":"ns-resize").attr("d",i=>this.resizeBrushHandle(i,t,e)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(s){if(this._prevBrush.orientation!==this.orientation()){const t=s[0];s[0]=this._prevBrush.maxCurrExtent-s[1],s[1]=this._prevBrush.maxCurrExtent-t}const t=n/this._prevBrush.maxCurrExtent;1!==t&&this.svgBrush.transition().on("start",function(){a.on("end",null)}).call(a.move,[s[0]*t,s[1]*t]).on("end",()=>{a.on("end",()=>this.brushMoved())})}}else this.svgBrush.call(a.move,[0,n]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:n}}}updateFocusChart(t,e,i,n,o,a){const s=this,r=this.svgFocus.selectAll("#"+this.id()+"_focusChart").data(this.xAxisFocus()?[!0]:[]);r.enter().append("g").attr("id",this.id()+"_focusChart").attr("class","focus").each(function(){s.focusChart=(new s.constructor).target(this),s.focusChart.xBrush.on("brush.focus",function(){s.syncAxis(n),s.chartsUpdate(n,o,0)}),s.focusChart.layers(s.layers().map(t=>new t.constructor))}).merge(r).each(function(){s.copyPropsTo(s.focusChart,["layers"]);let t=0;for(const e of s.layers())e.copyPropsTo(s.focusChart.layers()[t]),t++;s.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation("horizontal").xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(s.width()/2).y(s.height()-s.xAxisFocusHeight()/2).width(s.width()).height(s.xAxisFocusHeight()).columns(s.columns()).data(s.data()).render(),s.syncAxis(n)}),r.exit().each(function(){s.focusChart&&(s.focusChart.target(null),delete s.focusChart)}).remove()}syncAxis(t){const e=i.brushSelection(this.focusChart.svgBrush.node());if(e){if("ordinal"!==this.focusChart.xAxisType())this.xAxis.domain([this.focusChart.xAxis.invert(e[0]),this.focusChart.xAxis.invert(e[1])]);else{const i=(e[1]-e[0])/t;this.xAxis.range([-e[0]/i,(t-e[0])/i])}this.xAxis.rerender()}}layerColumns(t){const e=t.columns(),i=super.columns().filter(t=>t!==e[0]);return i.length?[e[0],...i]:e}layerColumnIndices(t){const e=t.columns();return this.layerColumns(t).map(t=>e.indexOf(t))}layerColumnIndex(t,e){return t.columns().indexOf(e)}layerData(t){if(1===arguments.length){const e=this.layerColumnIndices(t);return t.data().map(t=>{const i=e.map(e=>t[e]);return i.__hpcc_origRow=t,i})}throw new Error("Setting data on XYAxisLayer is not supported.")}layerEnter(t,e,i=250){}layerUpdate(t,e,i=250){}layerExit(t,e,i=250){}chartsEnter(t,e,i=250){this.layerEnter(this,e,i);for(const n of this.layers())n.__xyAxisElement=e.append("g").attr("class",n.class()),n.target(n.__xyAxisElement.node()).layerEnter(this,e,i)}chartsUpdate(t,e,i){this.layerUpdate(this,this.svgData,i);for(const n of this.layers())n.resize({width:t,height:e}).layerUpdate(this,n.__xyAxisElement,i)}exit(t,e){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(t,e)}selection(t){const e=this;this._selection.widgetElement().selectAll(".selected,.deselected").each(function(n){const o=t.indexOf(n.origRow)>=0;i.select(this).classed("selected",o).classed("deselected",!o).attr("filter",e._selection.svgGlowID()&&o?`url(#${e._selection.svgGlowID()})`:null)});const n=t.map(t=>this.rowToObj(t));setTimeout(()=>{this.click(n,"",!0)},0)}xAxisOrdinalMapping(t,e){return t[0]}click(t,e,i){}_selection};a(Ct,"XYAxis");let It=Ct;It.prototype._class+=" chart_XYAxis",It.prototype.mixin(i.Utility.SimpleSelectionMixin),It.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),It.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),It.prototype.publish("minPointSize",6,"number","minPointSize"),It.prototype.publish("maxPointSize",26,"number","maxPointSize"),It.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),It.prototype.publish("selectionMode",!1,"boolean","Range Selector"),It.prototype.publishProxy("xAxisTitle","domainAxis","title"),It.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),It.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),It.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),It.prototype.publishProxy("xAxisType","domainAxis","type"),It.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),It.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:a(t=>"ordinal"===t.xAxisType(),"disable")}),It.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:a(t=>"ordinal"===t.xAxisType(),"disable")}),It.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),It.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),It.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),It.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),It.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),It.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),It.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),It.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),It.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:a(t=>"horizontal"!==t.orientation(),"disable")}),It.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:a(t=>!t.xAxisFocus(),"disable")}),It.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),It.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),It.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),It.prototype.publishProxy("yAxisTitle","valueAxis","title"),It.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),It.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),It.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),It.prototype.publishProxy("yAxisType","valueAxis","type"),It.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),It.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),It.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),It.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:a(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),It.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:a(t=>"ordinal"===t.yAxisType(),"disable")}),It.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:a(t=>"ordinal"===t.yAxisType(),"disable")}),It.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),It.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),It.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),It.prototype.publish("regions",[],"array","Regions"),It.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),It.prototype.publishProxy("xAxisPadding","domainAxis","padding"),It.prototype.publishProxy("yAxisPadding","valueAxis","padding"),It.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const zt=class _Scatter extends It{constructor(){super(),e.INDChart.call(this),e.ITooltip.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}curve(){switch(this.interpolate()){case"linear":return O;case"step":return ut;case"step-before":return pt;case"step-after":return dt;case"basis":return G;case"bundle":return Y;case"cardinal":return Z;case"catmullRom":return tt;case"natural":return ht;default:return st}}getScale(){switch(this.pointSizeScale()){case"linear":return i.scaleLinear();case"pow":return i.scalePow().exponent(2);case"log":return i.scaleLog();case"sqrt":return i.scaleSqrt()}}pointColor(t,e,i,n){return this.interpolate()&&this.pointDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}lineColor(t,e,i,n){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}areaColor(t,e,i,n){return this.fillColor(t,e,i,n)}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(t){return"series-table"===n.tooltipStyle()?n.tooltipFormat({label:t.label,arr:n.columns().slice(1).map(function(e,i){return{label:e,color:n._palette(e),value:n.data()[t.rowIdx][i+1]}})}):n.tooltipFormat({label:t.label,series:t.column,value:t.value})})}_prevPointShape;layerUpdate(t,e,n=250){super.layerUpdate(t,e);const o="horizontal"===t.orientation(),s=o?this.height():this.width(),r=this;function l(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._prevPointShape!==this.pointShape()&&(e.selectAll(".data").remove(),this._prevPointShape=this.pointShape()),a(l,"mapShape");let h,c,u;this.pointSizeColumn_exists()&&(h=this.columns().indexOf(this.pointSizeColumn()),c=i.extent(this.data(),t=>t[h]),u=this.getScale().domain(c));const p=this.layerColumns(t),d=this.layerData(t),f=this.flattenData(p,d).map(function(t){return t.shape=l(r.pointShape()),t.column=p[t.colIdx],t.row=d[t.rowIdx],t.origRow=d[t.rowIdx].__hpcc_origRow,c?(t.size=u(t.row[h])*(r.maxPointSize()-r.minPointSize())+r.minPointSize(),t.column!==r.pointSizeColumn()&&t):(t.size=r.pointSize(),t)}).filter(t=>t),y=e.selectAll(".area").data(p.filter(function(t,e){return r.interpolate()&&r.interpolateFill()&&e>0})),_=y.enter().append("path"),x=B().curve(this.curve());o?x.x(function(e){return r.xPos(t,e)}).y0(Math.min(s,this.yPos(t,{value:0}))).y1(function(e){return r.yPos(t,e)}):x.y(function(e){return r.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return r.xPos(t,e)}),_.merge(y).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){i.select(this).attr("d",x(f.filter(function(t){return t.colIdx===e+1}))).style("opacity",r.interpolateFillOpacity()).style("stroke","none").style("fill",r.areaColor([],t,void 0,[]))}),y.exit().remove();const m=e.selectAll(".line").data(p.filter(function(t,e){return r.interpolate()&&e>0})),g=m.enter().append("path"),b=L().x(function(e){return r.xPos(t,e)}).y(function(e){return r.yPos(t,e)}).curve(this.curve());g.merge(m).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const n=i.select(this),o=f.filter(function(t){return t.colIdx===e+1});n.attr("d",b(o)).style("stroke",r.lineColor([],t,void 0,[])).style("fill","none")}),m.exit().remove();const v=e.selectAll(".point").data(f,function(t,e){return t.shape+"_"+e});v.enter().append("g").each(function(e){const n=i.select(this);n.append(e.shape).attr("class","pointShape"),n.append("text").attr("class","pointValue").style("display","none").attr("text-anchor",r.valueAnchor()).attr("alignment-baseline",r.valueBaseline()).attr("fill",function(t,e){return"middle"===r.valueBaseline()||"central"===r.valueBaseline()?r.textColor(t.row,t.column,t.value,t.origRow):null}),n.append("circle").attr("class","pointSelection").on("mouseout.tooltip",r.tooltip.hide).on("mousemove.tooltip",r.tooltip.show).call(t._selection.enter.bind(t._selection)).on("click",function(e,i){r.click(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("dblclick",function(e,i){r.dblclick(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("keydown",function(e,n){if(r.tabNavigation()){const e=i.d3Event();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}})}).merge(v).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){i.select(this).select(".pointValue").attr("x",function(e){return r.xPos(t,e)}).attr("y",function(e){return r.yPos(t,e)}).style("display",r.showValue()?"block":"none").attr("text-anchor",r.valueAnchor()).attr("alignment-baseline",r.valueBaseline()).text(function(t){return t.value});i.select(this).select(".pointSelection").attr("cx",function(e){return r.xPos(t,e)}).attr("cy",function(e){return r.yPos(t,e)}).attr("r",e.size).attr("tabindex",r.tabNavigation()?0:null).attr("role",r.tabNavigation()?"button":null).attr("aria-label",r.tabNavigation()?t=>`${t.column||"Value"}: ${t.value} @ ${t.label}`:null);const n=i.select(this).select(".pointShape");switch(e.shape){case"rect":n.attr("x",function(i){return r.xPos(t,i)-e.size/2}).attr("y",function(i){return r.yPos(t,i)-e.size/2}).attr("width",e.size).attr("height",e.size).style("fill",r.pointColor(e.row,e.column,e.value,e.origRow));break;case"circle":n.attr("cx",function(e){return r.xPos(t,e)}).attr("cy",function(e){return r.yPos(t,e)}).attr("r",.9*e.size).style("fill",r.pointColor(e.row,e.column,e.value,e.origRow));break;case"path":n.attr("d",function(i){return"M"+(r.xPos(t,i)-e.size/2)+" "+(r.yPos(t,i)-e.size/2)+" L"+(r.xPos(t,i)+e.size/2)+" "+(r.yPos(t,i)+e.size/2)+" M"+(r.xPos(t,i)-e.size/2)+" "+(r.yPos(t,i)+e.size/2)+" L"+(r.xPos(t,i)+e.size/2)+" "+(r.yPos(t,i)-e.size/2)}).style("stroke",r.pointColor(e.row,e.column,e.value,e.origRow))}}),v.exit().remove()}exit(t,e){super.exit(t,e)}};a(zt,"Scatter"),s(zt,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let Ft=zt;Ft.prototype._class+=" chart_Scatter",Ft.prototype.implements(e.INDChart.prototype),Ft.prototype.implements(e.ITooltip.prototype),Ft.prototype.publish("paletteID","default","set","Color palette for this widget",Ft.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ft.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),Ft.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),Ft.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),Ft.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),Ft.prototype.publish("pointDarken",!0,"boolean","If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color",null,{disable:a(t=>!t.interpolate(),"disable")}),Ft.prototype.publish("interpolateDarken",!0,"boolean","If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color",null,{disable:a(t=>!t.interpolateFill(),"disable")}),Ft.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),Ft.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),Ft.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ft.prototype.publish("showValue",!1,"boolean"),Ft.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Ft.prototype.publish("valueBaseline","ideographic","set","alignment-baseline for shown value text",["auto","baseline","before-edge","text-before-edge","middle","central","after-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","inherit"]);const Dt=class _Area extends Ft{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}};a(Dt,"Area");let Et=Dt;Et.prototype._class+=" chart_Area";const Rt=class _Column extends It{_linearGap;textLocal=i.local();stackedTextLocal=i.local();isHorizontal;constructor(){super(),e.INDChart.call(this),e.ITooltip.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(e){if("series-table"===n.tooltipStyle())return n.tooltipFormat({label:e.row[0],arr:n.columns().slice(1).map(function(t,i){return{label:t,color:n._palette(t),value:e.row[i+1]}})});{let i=e.row[e.idx];return i instanceof Array&&(i=i[1]-i[0]),n.tooltipFormat({label:e.row[0],series:n.layerColumns(t)[e.idx],value:i})}})}adjustedData(t){return this.layerData(t).map(e=>{let i=0;return e.map((e,n)=>{if(0===n)return e;if(n>=this.layerColumns(t).length)return e;const o=t.yAxisStacked()?[i,i+e]:e;return i+=e,o},this)},this)}layerUpdate(t,e,n=250){super.layerUpdate(t,e,n);const o="horizontal"===t.orientation();this.isHorizontal=o;const a=this;this.tabNavigation()&&t.parentRelativeDiv?t.parentRelativeDiv.attr("tabindex","0").attr("role","group").attr("aria-label",`${this.columns()[0]||"Chart"} data`):t.parentRelativeDiv&&t.parentRelativeDiv.attr("tabindex",null).attr("role",null).attr("aria-label",null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const s=i.format(a.showValueAsPercentFormat());let r=10,l=0;switch(t.xAxisType()){case"ordinal":r=t.bandwidth(),l=-r/2;break;case"linear":case"time":r=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,r),l=-r/2}this.tooltip.direction(o?"n":"e");const h=i.scaleBand().domain(a.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(o?[0,r]:[r,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0);let c=[];const u=[],p=this.columns().length,d=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&d.forEach(t=>{t.filter((t,e)=>e>0&&e<p).forEach((t,e)=>{void 0===u[e+1]&&(u[e+1]=0),u[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(c=d.map(t=>t.filter((t,e)=>e>0&&e<p).reduce((t,e)=>t+e,0)));const f=e.selectAll(".dataRow").data(this.adjustedData(t)),y=t.data(),_=this.getAxisSize(t);f.enter().append("g").attr("class","dataRow").merge(f).each(function(e,d){const f=i.select(this),x=f.selectAll(".dataCell").data(e.filter(function(e,i){return i<a.layerColumns(t).length}).map(function(i,n){return{column:a.layerColumns(t)[n],row:e,origRow:y[d],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),m=x.enter().append("g").attr("class","dataCell").on("mouseout.tooltip",function(t){(!a.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&a.tooltip.hide.apply(a,arguments)}).on("mousemove.tooltip",function(t){(!a.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&a.tooltip.show.apply(a,arguments)}).call(t._selection.enter.bind(t._selection)).on("click",function(e){a.click(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("dblclick",function(e){a.dblclick(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("keydown",function(e,n){if(a.tabNavigation()){const e=i.d3Event();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}}).style("opacity",0).each(function(t){const e=i.select(this);e.append("rect").attr("class","columnRect series series-"+a.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});m.transition().duration(n).style("opacity",1);const g=t.yAxisStacked()?r:h.bandwidth();m.merge(x).attr("tabindex",a.tabNavigation()?0:null).attr("role",a.tabNavigation()?"button":null).attr("aria-label",a.tabNavigation()?t=>`${t.origRow[0]} - ${t.column}: ${t.value instanceof Array?t.value[1]-t.value[0]:t.value}`:null).each(function(r){const f=i.select(this),y=t.dataPos(e[0])+(t.yAxisStacked()?0:h(r.column))+l,x=r.value instanceof Array?r.value[1]:r.value;let m=r.origRow[r.idx];if(a.showValue()){const t=a.dataMeta();switch(a.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:u[r.idx];m=s(m/e);break;case"domain":const n=void 0!==t.sum?t.sum:c[d];m=s(m/n);break;default:m=i.format(a.showValueFormat())(m)}}const b=t.valuePos(x),v=t.valuePos(r.value instanceof Array?r.value[0]:0),w=Math.min(v,b),S=Math.abs(b-v),A=a.innerTextFontSize(),k=a.innerTextPadding_exists()?a.innerTextPadding():A/2.5,M=a.intersectRectRect({x:o?y:w,y:o?w:y,width:o?g:S,height:o?S:g},{x:0,y:0,width:_.width,height:_.height}),T=f.select("rect").transition().duration(n).style("fill",t=>a.fillColor(t.row,t.column,t.value,t.origRow));o?T.attr("x",y).attr("y",w).attr("width",g).attr("height",S):T.attr("y",y).attr("x",w).attr("height",g).attr("width",S);const P=f.select("text").transition().duration(n).style("font-size",A+"px").style("fill",t=>a.textColor(t.row,t.column,t.value,t.origRow));P.style("font-family",a.innerTextFontFamily_exists()?a.innerTextFontFamily():null);const C=a.innerTextPadding_exists()?a.innerTextPadding():8,I=A/2.7;if(o){const t=M.y+M.height-k;P.attr("x",y+g/2).attr("y",t+I).attr("transform",`rotate(-90, ${y+g/2}, ${t})`)}else P.attr("x",M.x+C).attr("y",y+g/2+I);P.attr("height",g).attr("width",S),a.showInnerText()&&P.text(t=>{const e=a.innerText(t.origRow,t.origRow[p],t.idx);if(e){const i=o?M.height:M.width,n=a.calcInnerText(i,e,m);return t.innerTextObj=n,n.text}return""});const z=f.selectAll(".dataText").data(a.showValue()?[`${x}`]:[]);z.enter().append("g").attr("class","dataText").each(function(t){a.textLocal.set(this,(new i.Text).target(this).colorStroke_default("transparent"))}).merge(z).each(function(){const t={x:0,y:0},e=a.valueFontFamily(),i=a.valueFontSize(),n=a.textSize(m,e,i),s=parseFloat(m)>=0;let l=a.valueAnchor()?a.valueAnchor():o?"middle":"start";const h=M.x,c=_.width-(M.x+M.width),u=M.y,p=_.height-(M.y+M.height);let d,f,x;if(r.innerTextObj){const{padding:e,valueTextWidth:n}=r.innerTextObj;f=!1,o?(l="middle",t.x=y+g/2,4===r.innerTextObj.category?(f=!0,t.y=w-e-i/2):t.y=w+e+i/2):(l="start",4===r.innerTextObj.category?(f=!0,t.x=S+w+e):t.x=S+w-n-e,t.y=y+g/2)}else o?(d=M.height<n.height,f=!a.valueCentered()||d,t.x=M.x+M.width/2,f?s?(x=u<n.height+C,x?d?t.y=M.y+M.height+n.height:(f=!1,t.y=M.y+M.height/2):t.y=M.y-n.height/2-C):(x=p<n.height,x?d?t.y=M.y-n.height/2-C:(f=!1,t.y=M.y+M.height/2):t.y=M.y+n.height+C):t.y=M.y+M.height/2):(d=M.width<n.width,f=!a.valueCentered()||d,t.y=M.y+M.height/2,f?s?(x=c<n.width+C,x?a.showInnerText()||!d?(f=!1,t.x=M.x+M.width/2):t.x=M.x-(n.width-C):t.x=M.x+M.width+n.width/2+C):(x=h<n.width,x?a.showInnerText()||!d?(f=!1,t.x=M.x+M.width/2):t.x=M.x+M.width+(n.width-C):t.x=M.x-(n.width-C)):t.x=M.x+M.width/2);const b=f?null:a.textColor(r.row,r.column,r.value,r.origRow),v=a.columns(),A=a.yAxisStacked()&&d||f&&a.yAxisStacked()&&v.indexOf(r.column)!==v.length-1;a.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${m}`).colorFill(b).visible(a.showValue()&&!A).render()}),z.exit().each(function(t){a.textLocal.get(this).target(null)}).remove()}),x.exit().transition().duration(n).style("opacity",0).remove();const b=t.yAxisStacked()?c[d]:Math.max(...e.filter((t,e)=>e>0&&e<p)),v=f.selectAll(".stackedTotalText").data(a.showDomainTotal()?[c[d]]:[]);v.enter().append("g").attr("class","stackedTotalText").each(function(t){a.stackedTextLocal.set(this,(new i.Text).target(this).colorStroke_default("transparent"))}).merge(v).each(function(i){const n={x:0,y:0},s=t.dataPos(e[0]),r=t.valuePos(b),l=a.valueFontFamily(),h=a.valueFontSize(),c=a.textSize(i,l,h),u=parseFloat(i)>=0;let p="middle";o?(n.x=s,n.y=u?r-c.height/2:r+c.height/2):(p="start",n.y=s,n.x=u?r+c.width/2:r-c.width/2),a.stackedTextLocal.get(this).pos(n).anchor(p).fontFamily(l).fontSize(h).text(i).render()}),v.exit().each(function(t){a.textLocal.get(this).target(null)}).remove()}),f.exit().transition().duration(n).remove()}calcInnerText(t,e,i){const n=this.innerTextFontFamily_exists()?this.innerTextFontFamily():"Verdana",o=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():"Verdana",s=this.valueFontSize(),r=this.innerTextPadding_exists()?this.innerTextPadding():o/2.5,l=this.isHorizontal?s:this.textSize(i,a,s).width,h=e,c=3*r+this.textSize("...",n,o).width+l,u=1*r+l;let p=4;if(3*r+this.textSize(e,n,o).width+l<t)p=1;else if(c<t){const i=t-c;let a="";for(const t of e){if(this.textSize(a+t,n,o).width>i){e=a+"...";break}a+=t}p=2}else u<t?(e="",p=3):e="";return{text:e,isTruncated:h!==e,padding:r,category:p,valueTextWidth:l}}innerText(t,e,i){return t[0]}};a(Rt,"Column"),s(Rt,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let Ot=Rt;Ot.prototype._class+=" chart_Column",Ot.prototype.implements(e.INDChart.prototype),Ot.prototype.implements(e.ITooltip.prototype),Ot.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),Ot.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),Ot.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),Ot.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),Ot.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),Ot.prototype.publish("paletteID","default","set","Color palette for this widget",()=>Ot.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ot.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ot.prototype.publish("showValue",!1,"boolean","Show Value in column"),Ot.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),Ot.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:a(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),Ot.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:a(t=>!t.showValue(),"disable"),optional:!0}),Ot.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:a(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),Ot.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),Ot.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),Ot.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Ot.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),Ot.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const Nt=class _Bar extends Ot{constructor(){super(),this.orientation_default("vertical")}};a(Nt,"Bar");let jt=Nt;function Lt(t){var e=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)e+=i[n].value;else e=1;t.value=e}function Bt(){return this.eachAfter(Lt)}function $t(t){var e,i,n,o,a=this,s=[a];do{for(e=s.reverse(),s=[];a=e.pop();)if(t(a),i=a.children)for(n=0,o=i.length;n<o;++n)s.push(i[n])}while(s.length);return this}function Ht(t){for(var e,i,n=this,o=[n];n=o.pop();)if(t(n),e=n.children)for(i=e.length-1;i>=0;--i)o.push(e[i]);return this}function Vt(t){for(var e,i,n,o=this,a=[o],s=[];o=a.pop();)if(s.push(o),e=o.children)for(i=0,n=e.length;i<n;++i)a.push(e[i]);for(;o=s.pop();)t(o);return this}function qt(t){return this.eachAfter(function(e){for(var i=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)i+=n[o].value;e.value=i})}function Wt(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Gt(t){for(var e=this,i=Xt(e,t),n=[e];e!==i;)e=e.parent,n.push(e);for(var o=n.length;t!==i;)n.splice(o,0,t),t=t.parent;return n}function Xt(t,e){if(t===e)return t;var i=t.ancestors(),n=e.ancestors(),o=null;for(t=i.pop(),e=n.pop();t===e;)o=t,t=i.pop(),e=n.pop();return o}function Yt(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Ut(){var t=[];return this.each(function(e){t.push(e)}),t}function Qt(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Zt(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function Jt(t,e){var i,n,o,a,s,r=new ne(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=te);i=h.pop();)if(l&&(i.value=+i.data.value),(o=e(i.data))&&(s=o.length))for(i.children=new Array(s),a=s-1;a>=0;--a)h.push(n=i.children[a]=new ne(o[a])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(ie)}function Kt(){return Jt(this).eachBefore(ee)}function te(t){return t.children}function ee(t){t.data=t.data.data}function ie(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function ne(t){this.data=t,this.depth=this.height=0,this.parent=null}jt.prototype._class+=" chart_Bar",a(Lt,"count"),a(Bt,"node_count"),a($t,"node_each"),a(Ht,"node_eachBefore"),a(Vt,"node_eachAfter"),a(qt,"node_sum"),a(Wt,"node_sort"),a(Gt,"node_path"),a(Xt,"leastCommonAncestor"),a(Yt,"node_ancestors"),a(Ut,"node_descendants"),a(Qt,"node_leaves"),a(Zt,"node_links"),a(Jt,"hierarchy"),a(Kt,"node_copy"),a(te,"defaultChildren"),a(ee,"copyData"),a(ie,"computeHeight"),a(ne,"Node$1"),ne.prototype=Jt.prototype={constructor:ne,count:Bt,each:$t,eachAfter:Vt,eachBefore:Ht,sum:qt,sort:Wt,path:Gt,ancestors:Yt,descendants:Ut,leaves:Qt,links:Zt,copy:Kt};var oe=Array.prototype.slice;function ae(t){for(var e,i,n=t.length;n;)i=Math.random()*n--|0,e=t[n],t[n]=t[i],t[i]=e;return t}function se(t){for(var e,i,n=0,o=(t=ae(oe.call(t))).length,a=[];n<o;)e=t[n],i&&he(i,e)?++n:(i=ue(a=re(a,e)),n=0);return i}function re(t,e){var i,n;if(ce(e,t))return[e];for(i=0;i<t.length;++i)if(le(e,t[i])&&ce(de(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(n=i+1;n<t.length;++n)if(le(de(t[i],t[n]),e)&&le(de(t[i],e),t[n])&&le(de(t[n],e),t[i])&&ce(fe(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function le(t,e){var i=t.r-e.r,n=e.x-t.x,o=e.y-t.y;return i<0||i*i<n*n+o*o}function he(t,e){var i=t.r-e.r+1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function ce(t,e){for(var i=0;i<e.length;++i)if(!he(t,e[i]))return!1;return!0}function ue(t){switch(t.length){case 1:return pe(t[0]);case 2:return de(t[0],t[1]);case 3:return fe(t[0],t[1],t[2])}}function pe(t){return{x:t.x,y:t.y,r:t.r}}function de(t,e){var i=t.x,n=t.y,o=t.r,a=e.x,s=e.y,r=e.r,l=a-i,h=s-n,c=r-o,u=Math.sqrt(l*l+h*h);return{x:(i+a+l/u*c)/2,y:(n+s+h/u*c)/2,r:(u+o+r)/2}}function fe(t,e,i){var n=t.x,o=t.y,a=t.r,s=e.x,r=e.y,l=e.r,h=i.x,c=i.y,u=i.r,p=n-s,d=n-h,f=o-r,y=o-c,_=l-a,x=u-a,m=n*n+o*o-a*a,g=m-s*s-r*r+l*l,b=m-h*h-c*c+u*u,v=d*f-p*y,w=(f*b-y*g)/(2*v)-n,S=(y*_-f*x)/v,A=(d*g-p*b)/(2*v)-o,k=(p*x-d*_)/v,M=S*S+k*k-1,T=2*(a+w*S+A*k),P=w*w+A*A-a*a,C=-(M?(T+Math.sqrt(T*T-4*M*P))/(2*M):P/T);return{x:n+w+S*C,y:o+A+k*C,r:C}}function ye(t,e,i){var n,o,a,s,r=t.x-e.x,l=t.y-e.y,h=r*r+l*l;h?(o=e.r+i.r,o*=o,s=t.r+i.r,o>(s*=s)?(n=(h+s-o)/(2*h),a=Math.sqrt(Math.max(0,s/h-n*n)),i.x=t.x-n*r-a*l,i.y=t.y-n*l+a*r):(n=(h+o-s)/(2*h),a=Math.sqrt(Math.max(0,o/h-n*n)),i.x=e.x+n*r-a*l,i.y=e.y+n*l+a*r)):(i.x=e.x+i.r,i.y=e.y)}function _e(t,e){var i=t.r+e.r-1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function xe(t){var e=t._,i=t.next._,n=e.r+i.r,o=(e.x*i.r+i.x*e.r)/n,a=(e.y*i.r+i.y*e.r)/n;return o*o+a*a}function me(t){this._=t,this.next=null,this.previous=null}function ge(t){if(!(o=t.length))return 0;var e,i,n,o,a,s,r,l,h,c,u;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(i=t[1],e.x=-i.r,i.x=e.r,i.y=0,!(o>2))return e.r+i.r;ye(i,e,n=t[2]),e=new me(e),i=new me(i),n=new me(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){ye(e._,i._,n=t[r]),n=new me(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if(_e(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if(_e(h._,n._)){(e=h).next=i,i.previous=e,--r;continue t}u+=h._.r,h=h.previous}}while(l!==h.next);for(n.previous=e,n.next=i,e.next=i.previous=i=n,a=xe(e);(n=n.next)!==i;)(s=xe(n))<a&&(e=n,a=s);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=se(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function be(t){return null==t?null:ve(t)}function ve(t){if("function"!=typeof t)throw new Error;return t}function we(){return 0}function Se(t){return function(){return t}}function Ae(t){return Math.sqrt(t.value)}function ke(){var t=null,e=1,i=1,n=we;function o(o){return o.x=e/2,o.y=i/2,t?o.eachBefore(Me(t)).eachAfter(Te(n,.5)).eachBefore(Pe(1)):o.eachBefore(Me(Ae)).eachAfter(Te(we,1)).eachAfter(Te(n,o.r/Math.min(e,i))).eachBefore(Pe(Math.min(e,i)/(2*o.r))),o}return a(o,"pack"),o.radius=function(e){return arguments.length?(t=be(e),o):t},o.size=function(t){return arguments.length?(e=+t[0],i=+t[1],o):[e,i]},o.padding=function(t){return arguments.length?(n="function"==typeof t?t:Se(+t),o):n},o}function Me(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Te(t,e){return function(i){if(n=i.children){var n,o,a,s=n.length,r=t(i)*e||0;if(r)for(o=0;o<s;++o)n[o].r+=r;if(a=ge(n),r)for(o=0;o<s;++o)n[o].r-=r;i.r=a+r}}}function Pe(t){return function(e){var i=e.parent;e.r*=t,i&&(e.x=i.x+t*e.x,e.y=i.y+t*e.y)}}a(ae,"shuffle"),a(se,"enclose"),a(re,"extendBasis"),a(le,"enclosesNot"),a(he,"enclosesWeak"),a(ce,"enclosesWeakAll"),a(ue,"encloseBasis"),a(pe,"encloseBasis1"),a(de,"encloseBasis2"),a(fe,"encloseBasis3"),a(ye,"place"),a(_e,"intersects"),a(xe,"score"),a(me,"Node"),a(ge,"packEnclose"),a(be,"optional"),a(ve,"required"),a(we,"constantZero"),a(Se,"constant$2"),a(Ae,"defaultRadius"),a(ke,"d3Pack"),a(Me,"radiusLeaf"),a(Te,"packChildren"),a(Pe,"translateChild");const Ce=class _Bubble extends i.SVGWidget{labelWidgets;d3Pack;constructor(){super(),e.I2DChart.call(this),e.ITooltip.call(this),i.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=ke().size([this.width(),this.height()]).padding(1.5)}size(t){const e=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),e}enter(t,e){super.enter(t,e),this._selection.widgetElement(e);const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t[0]),value:t[1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const o=Jt({children:this.cloneData()}).sum(function(t){return t[1]}).sort(function(t,e){return e[1]<t[1]?-1:e[1]>t[1]?1:0});this.d3Pack(o);const a=e.selectAll(".node").data(o.children||[],t=>t.data[0]);a.enter().append("g").attr("class",(t,e)=>"node series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){n.click(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).each(function(t){const e=i.select(this),o=t.x,a=t.y;e.append("circle").attr("transform","translate("+o+","+a+")").attr("r",0).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show),t.__viz_faChar?n.labelWidgets[t.data[0]]=(new i.FAChar).char(t.__viz_faChar).target(this).render():n.labelWidgets[t.data[0]]=(new i.Text).text(t.data[0]).target(this).render()}).merge(a).transition().attr("opacity",1).each(function(t){const e=i.select(this),o={x:t.x,y:t.y};e.select("circle").transition().attr("transform","translate("+o.x+","+o.y+")").style("fill",n.fillColor(t.data,n.columns()[1],t.data[1])).attr("r",t.r).select("title").text(t.data[0]+" ("+t.data[1]+")"),t.__viz_faChar?n.labelWidgets[t.data[0]].pos(o).render():n.labelWidgets[t.data[0]].pos(o).colorFill_default(n.textColor(t.data,n.columns()[1],t.data[1])).width(2*t.r).text(t.data[0]).render()}),a.exit().transition().style("opacity",0).remove()}exit(t,e){super.exit(t,e)}};a(Ce,"Bubble"),s(Ce,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Ie=Ce;Ie.prototype._class+=" chart_Bubble",Ie.prototype.implements(e.I2DChart.prototype),Ie.prototype.implements(e.ITooltip.prototype),Ie.prototype.mixin(i.Utility.SimpleSelectionMixin),Ie.prototype.publish("paletteID","default","set","Color palette for this widget",Ie.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ie.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const ze=class _BubbleXY extends Ft{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}};a(ze,"BubbleXY");let Fe=ze;Fe.prototype._class+=" chart_BubbleXY";var De,Ee,Re=0,Oe=0,Ne=0,je=0,Le=0,Be=0,$e="object"==typeof performance&&performance.now?performance:Date,He="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ve(){return Le||(He(qe),Le=$e.now()+Be)}function qe(){Le=0}function We(){this._call=this._time=this._next=null}function Ge(){Ve(),++Re;for(var t,e=De;e;)(t=Le-e._time)>=0&&e._call.call(null,t),e=e._next;--Re}function Xe(){Le=(je=$e.now())+Be,Re=Oe=0;try{Ge()}finally{Re=0,Ue(),Le=0}}function Ye(){var t=$e.now(),e=t-je;e>1e3&&(Be-=e,je=t)}function Ue(){for(var t,e,i=De,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:De=e);Ee=t,Qe(n)}function Qe(t){Re||(Oe&&(Oe=clearTimeout(Oe)),t-Le>24?(t<1/0&&(Oe=setTimeout(Xe,t-$e.now()-Be)),Ne&&(Ne=clearInterval(Ne))):(Ne||(je=$e.now(),Ne=setInterval(Ye,1e3)),Re=1,He(Xe)))}function Ze(){var t="left",e=!1,n=!1,o=Je,s=Ke,r=ti,l=380,h=30,c=Mt();function u(t){t.each(function(t,a){var u,p,d=o.call(this,t,a).slice().sort(i.descending),f=s.call(this,t,a).slice().sort(i.descending),y=r.call(this,t,a).slice().sort(i.descending),_=i.select(this),x=_.select("g.wrap");x.empty()&&(x=_.append("g").attr("class","wrap")),n?(u=h,p=l,x.attr("transform","rotate(90)translate(0,"+-l+")")):(u=l,p=h,x.attr("transform",null));var m=i.scaleLinear().domain([0,Math.max(d[0],f[0],y[0])]).range(e?[u,0]:[0,u]),g=this.__chart__||i.scaleLinear().domain([0,1/0]).range(m.range());this.__chart__=m;var b=ei(g),v=ei(m),w=x.selectAll("rect.range").data(d);w.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",b).attr("height",p).attr("x",e?g:0).merge(w).transition(w).attr("x",e?m:0).attr("width",v).attr("height",p);var S=x.selectAll("rect.measure").data(y);S.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",b).attr("height",p/3).attr("x",e?g:0).attr("y",p/3).merge(S).transition(S).attr("width",v).attr("height",p/3).attr("x",e?m:0).attr("y",p/3);var A=x.selectAll("line.marker").data(f);A.enter().append("line").attr("class","marker").attr("x1",g).attr("x2",g).attr("y1",p/6).attr("y2",5*p/6).merge(A).transition(A).attr("x1",m).attr("x2",m).attr("y1",p/6).attr("y2",5*p/6);var k=_.selectAll("g.axis").data([0]);k.enter().append("g").attr("class","axis"),k.attr("transform",n?null:"translate(0,"+p+")").call(c.scale(m))}),Ge()}return a(u,"bulvar"),u.orient=function(i){return arguments.length?(e="right"===(t=i+"")||"bottom"===t,c.orient((n="top"===t||"bottom"===t)?"left":"bottom"),u):t},u.ranges=function(t){return arguments.length?(o=t,u):o},u.markers=function(t){return arguments.length?(s=t,u):s},u.measures=function(t){return arguments.length?(r=t,u):r},u.width=function(t){return arguments.length?(l=+t,u):l},u.height=function(t){return arguments.length?(h=+t,u):h},u.tickFormat=function(t){return arguments.length?(c.tickFormat(t),u):c.tickFormat()},u}function Je(t){return t.ranges}function Ke(t){return t.markers}function ti(t){return t.measures}function ei(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}a(Ve,"now"),a(qe,"clearNow"),a(We,"Timer"),We.prototype={constructor:We,restart:a(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?Ve():+i)+(null==e?0:+e),this._next||Ee===this||(Ee?Ee._next=this:De=this,Ee=this),this._call=t,this._time=i,Qe()},"restart"),stop:a(function(){this._call&&(this._call=null,this._time=1/0,Qe())},"stop")},a(Ge,"timerFlush"),a(Xe,"wake"),a(Ye,"poke"),a(Ue,"nap"),a(Qe,"sleep"),a(Ze,"d3Bullet"),a(Je,"bulvarRanges"),a(Ke,"bulvarMarkers"),a(ti,"bulvarMeasures"),a(ei,"bulvarWidth");const ii=class _Bullet extends i.HTMLWidget{_hiddenColumns={};constructor(){super(),i.Utility.SimpleSelectionMixin.call(this,!0)}bulletData(){const t=this;this._hiddenColumns={};const e=this.columns();return this.data().map(function(t){return{title:i(t,this.titleColumn()),subtitle:i(t,this.subtitleColumn()),ranges:i(t,this.rangesColumn(),"range"),measures:i(t,this.measuresColumn(),"measure"),markers:i(t,this.markersColumn(),"marker"),origRow:t}},this);function i(i,n,o){const a=e.indexOf(n);return a>=0?i[a]instanceof Array?i[a]:[i[a]]:(o&&(t._hiddenColumns[o]=!0),[0])}}enter(t,e){super.enter(t,e),i.select(t.parentNode).style("overflow","auto"),this._selection.widgetElement(e)}update(t,e){super.update(t,e);const n=this;e.selectAll(".axis").style("display","none"),e.selectAll(".range,.measure,.marker").style("display",null);const o=2,a=8,s=2,r=8,l=this.width()-o-s,h=40-a-r,c=e.selectAll("svg").data(this.bulletData()),u=c.enter().append("svg").attr("class","bullet").call(this._selection.enter.bind(this._selection)).on("click",function(t){n.click(n.rowToObj(t.origRow),n.titleColumn(),n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.origRow),n.titleColumn(),n._selection.selected(this))}).each(function(){const t=i.select(this).append("g").attr("class",(t,e)=>"bulletBar series series-"+n.cssTag(n.titleColumn())).append("g").attr("class","bulletTitle");t.append("text").attr("class","title"),t.append("text").attr("class","subtitle").attr("dy","1em")}).merge(c),p=u.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,"+h/2+")");p.select(".title").text(function(t){return t.title}),p.select(".subtitle").text(function(t){return t.subtitle});let d=0;p.each(function(){const t=this.getBBox();t.width>d&&(d=t.width)});const f=Ze().width(l-d-6).height(h);u.attr("width",l).attr("height",h+a+r).style("margin-left",`${o}px`),u.select(".bulletBar").attr("transform","translate("+(d+6)+","+a+")").call(f),c.exit().remove(),Object.keys(this._hiddenColumns).length>0&&e.selectAll(`.${Object.keys(this._hiddenColumns).join(",.")}`).style("display","none")}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}_selection};a(ii,"Bullet");let ni=ii;ni.prototype._class+=" chart_Bullet",ni.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),ni.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),ni.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),ni.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),ni.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var oi=Array.prototype.slice;function ai(t,e){return t-e}function si(t){for(var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return n}function ri(t){return function(){return t}}function li(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=hi(t,e[n]))return i;return 0}function hi(t,e){for(var i=e[0],n=e[1],o=-1,a=0,s=t.length,r=s-1;a<s;r=a++){var l=t[a],h=l[0],c=l[1],u=t[r],p=u[0],d=u[1];if(ci(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function ci(t,e,i){var n;return ui(t,e,i)&&pi(t[n=+(t[0]===e[0])],i[n],e[n])}function ui(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function pi(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function di(){}a(ai,"ascending"),a(si,"area"),a(ri,"constant$1"),a(li,"contains"),a(hi,"ringContains"),a(ci,"segmentContains"),a(ui,"collinear"),a(pi,"within"),a(di,"noop$2");var fi=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function yi(){var t=1,e=1,n=i.thresholdSturges,o=c;function s(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(ai);else{var o=i.extent(t),a=o[0],s=o[1];e=i.tickStep(a,s,e),e=i.range(Math.floor(a/e)*e,Math.floor(s/e)*e,e)}return e.map(function(e){return r(t,e)})}function r(t,e){var i=[],n=[];return l(t,e,function(a){o(a,t,e),si(a)>0?i.push([a]):n.push(a)}),n.forEach(function(t){for(var e,n=0,o=i.length;n<o;++n)if(-1!==li((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function l(i,n,o){var s,r,l,c,u,p,d=new Array,f=new Array;for(s=r=-1,c=i[0]>=n,fi[c<<1].forEach(y);++s<t-1;)l=c,c=i[s+1]>=n,fi[l|c<<1].forEach(y);for(fi[c|0].forEach(y);++r<e-1;){for(s=-1,c=i[r*t+t]>=n,u=i[r*t]>=n,fi[c<<1|u<<2].forEach(y);++s<t-1;)l=c,c=i[r*t+t+s+1]>=n,p=u,u=i[r*t+s+1]>=n,fi[l|c<<1|u<<2|p<<3].forEach(y);fi[c|u<<3].forEach(y)}for(s=-1,u=i[r*t]>=n,fi[u<<2].forEach(y);++s<t-1;)p=u,u=i[r*t+s+1]>=n,fi[u<<2|p<<3].forEach(y);function y(t){var e,i,n=[t[0][0]+s,t[0][1]+r],a=[t[1][0]+s,t[1][1]+r],l=h(n),c=h(a);(e=f[l])?(i=d[c])?(delete f[e.end],delete d[i.start],e===i?(e.ring.push(a),o(e.ring)):d[e.start]=f[i.end]={start:e.start,end:i.end,ring:e.ring.concat(i.ring)}):(delete f[e.end],e.ring.push(a),f[e.end=c]=e):(e=d[c])?(i=f[l])?(delete d[e.start],delete f[i.end],e===i?(e.ring.push(a),o(e.ring)):d[i.start]=f[e.end]={start:i.start,end:e.end,ring:i.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(n),d[e.start=l]=e):d[l]=f[c]={start:l,end:c,ring:[n,a]}}fi[u<<3].forEach(y),a(y,"stitch")}function h(e){return 2*e[0]+e[1]*(t+1)*4}function c(i,n,o){i.forEach(function(i){var a,s=i[0],r=i[1],l=0|s,h=0|r,c=n[h*t+l];s>0&&s<t&&l===s&&(a=n[h*t+l-1],i[0]=s+(o-a)/(c-a)-.5),r>0&&r<e&&h===r&&(a=n[(h-1)*t+l],i[1]=r+(o-a)/(c-a)-.5)})}return a(s,"contours"),a(r,"contour"),a(l,"isorings"),a(h,"index"),a(c,"smoothLinear"),s.contour=r,s.size=function(i){if(!arguments.length)return[t,e];var n=Math.ceil(i[0]),o=Math.ceil(i[1]);if(!(n>0&&o>0))throw new Error("invalid size");return t=n,e=o,s},s.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?ri(oi.call(t)):ri(t),s):n},s.smooth=function(t){return arguments.length?(o=t?c:di,s):o===c},s}function _i(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<o;++s)for(var r=0,l=0;r<n+i;++r)r<n&&(l+=t.data[r+s*n]),r>=i&&(r>=a&&(l-=t.data[r-a+s*n]),e.data[r-i+s*n]=l/Math.min(r+1,n-1+a-r,a))}function xi(t,e,i){for(var n=t.width,o=t.height,a=1+(i<<1),s=0;s<n;++s)for(var r=0,l=0;r<o+i;++r)r<o&&(l+=t.data[s+r*n]),r>=i&&(r>=a&&(l-=t.data[s+(r-a)*n]),e.data[s+(r-i)*n]=l/Math.min(r+1,o-1+a-r,a))}function mi(t){return t[0]}function gi(t){return t[1]}function bi(){return 1}function vi(){var t=mi,e=gi,n=bi,o=960,s=500,r=20,l=2,h=3*r,c=o+2*h>>l,u=s+2*h>>l,p=ri(20);function d(o){var a=new Float32Array(c*u),s=new Float32Array(c*u);o.forEach(function(i,o,s){var r=+t(i,o,s)+h>>l,p=+e(i,o,s)+h>>l,d=+n(i,o,s);r>=0&&r<c&&p>=0&&p<u&&(a[r+p*c]+=d)}),_i({width:c,height:u,data:a},{data:s},r>>l),xi({width:c,height:u,data:s},{data:a},r>>l),_i({width:c,height:u,data:a},{data:s},r>>l),xi({width:c,height:u,data:s},{data:a},r>>l),_i({width:c,height:u,data:a},{data:s},r>>l),xi({width:c,height:u,data:s},{data:a},r>>l);var d=p(a);if(!Array.isArray(d)){var y=i.max(a);d=i.tickStep(0,y,d),(d=i.range(0,Math.floor(y/d)*d,d)).shift()}return yi().thresholds(d).size([c,u])(a).map(f)}function f(t){return t.value*=Math.pow(2,-2*l),t.coordinates.forEach(y),t}function y(t){t.forEach(_)}function _(t){t.forEach(x)}function x(t){t[0]=t[0]*Math.pow(2,l)-h,t[1]=t[1]*Math.pow(2,l)-h}function m(){return c=o+2*(h=3*r)>>l,u=s+2*h>>l,d}return a(d,"density"),a(f,"transform"),a(y,"transformPolygon"),a(_,"transformRing"),a(x,"transformPoint"),a(m,"resize"),d.x=function(e){return arguments.length?(t="function"==typeof e?e:ri(+e),d):t},d.y=function(t){return arguments.length?(e="function"==typeof t?t:ri(+t),d):e},d.weight=function(t){return arguments.length?(n="function"==typeof t?t:ri(+t),d):n},d.size=function(t){if(!arguments.length)return[o,s];var e=Math.ceil(t[0]),i=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return o=e,s=i,m()},d.cellSize=function(t){if(!arguments.length)return 1<<l;if(!((t=+t)>=1))throw new Error("invalid cell size");return l=Math.floor(Math.log(t)/Math.LN2),m()},d.thresholds=function(t){return arguments.length?(p="function"==typeof t?t:Array.isArray(t)?ri(oi.call(t)):ri(t),d):p},d.bandwidth=function(t){if(!arguments.length)return Math.sqrt(r*(r+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return r=Math.round((Math.sqrt(4*t*t+1)-1)/2),m()},d}function wi(){return new Si}function Si(){this.reset()}a(yi,"contours"),a(_i,"blurX"),a(xi,"blurY"),a(mi,"defaultX"),a(gi,"defaultY"),a(bi,"defaultWeight"),a(vi,"d3ContourDensity"),a(wi,"adder"),a(Si,"Adder"),Si.prototype={constructor:Si,reset:a(function(){this.s=this.t=0},"reset"),add:a(function(t){ki(Ai,t,this.t),ki(this,Ai.s,this.s),this.s?this.t+=Ai.t:this.s=Ai.t},"add"),valueOf:a(function(){return this.s},"valueOf")};var Ai=new Si;function ki(t,e,i){var n=t.s=e+i,o=n-e,a=n-o;t.t=e-a+(i-o)}a(ki,"add");var Mi=2*Math.PI,Ti=Math.abs,Pi=Math.sqrt;function Ci(){}function Ii(t,e){t&&Fi.hasOwnProperty(t.type)&&Fi[t.type](t,e)}a(Ci,"noop$1"),a(Ii,"streamGeometry");var zi={Feature:a(function(t,e){Ii(t.geometry,e)},"Feature"),FeatureCollection:a(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)Ii(i[n].geometry,e)},"FeatureCollection")},Fi={Sphere:a(function(t,e){e.sphere()},"Sphere"),Point:a(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:a(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)t=i[n],e.point(t[0],t[1],t[2])},"MultiPoint"),LineString:a(function(t,e){Di(t.coordinates,e,0)},"LineString"),MultiLineString:a(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Di(i[n],e,0)},"MultiLineString"),Polygon:a(function(t,e){Ei(t.coordinates,e)},"Polygon"),MultiPolygon:a(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Ei(i[n],e)},"MultiPolygon"),GeometryCollection:a(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)Ii(i[n],e)},"GeometryCollection")};function Di(t,e,i){var n,o=-1,a=t.length-i;for(e.lineStart();++o<a;)n=t[o],e.point(n[0],n[1],n[2]);e.lineEnd()}function Ei(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)Di(t[i],e,1);e.polygonEnd()}function Ri(t,e){t&&zi.hasOwnProperty(t.type)?zi[t.type](t,e):Ii(t,e)}function Oi(t){return t}a(Di,"streamLine"),a(Ei,"streamPolygon"),a(Ri,"geoStream"),a(Oi,"identity");var Ni,ji,Li,Bi,$i=wi(),Hi=wi(),Vi={point:Ci,lineStart:Ci,lineEnd:Ci,polygonStart:a(function(){Vi.lineStart=qi,Vi.lineEnd=Xi},"polygonStart"),polygonEnd:a(function(){Vi.lineStart=Vi.lineEnd=Vi.point=Ci,$i.add(Ti(Hi)),Hi.reset()},"polygonEnd"),result:a(function(){var t=$i/2;return $i.reset(),t},"result")};function qi(){Vi.point=Wi}function Wi(t,e){Vi.point=Gi,Ni=Li=t,ji=Bi=e}function Gi(t,e){Hi.add(Bi*t-Li*e),Li=t,Bi=e}function Xi(){Gi(Ni,ji)}a(qi,"areaRingStart"),a(Wi,"areaPointFirst"),a(Gi,"areaPoint"),a(Xi,"areaRingEnd");var Yi=1/0,Ui=Yi,Qi=-Yi,Zi=Qi,Ji={point:Ki,lineStart:Ci,lineEnd:Ci,polygonStart:Ci,polygonEnd:Ci,result:a(function(){var t=[[Yi,Ui],[Qi,Zi]];return Qi=Zi=-(Ui=Yi=1/0),t},"result")};function Ki(t,e){t<Yi&&(Yi=t),t>Qi&&(Qi=t),e<Ui&&(Ui=e),e>Zi&&(Zi=e)}a(Ki,"boundsPoint");var tn,en,nn,on,an=0,sn=0,rn=0,ln=0,hn=0,cn=0,un=0,pn=0,dn=0,fn={point:yn,lineStart:_n,lineEnd:gn,polygonStart:a(function(){fn.lineStart=bn,fn.lineEnd=vn},"polygonStart"),polygonEnd:a(function(){fn.point=yn,fn.lineStart=_n,fn.lineEnd=gn},"polygonEnd"),result:a(function(){var t=dn?[un/dn,pn/dn]:cn?[ln/cn,hn/cn]:rn?[an/rn,sn/rn]:[NaN,NaN];return an=sn=rn=ln=hn=cn=un=pn=dn=0,t},"result")};function yn(t,e){an+=t,sn+=e,++rn}function _n(){fn.point=xn}function xn(t,e){fn.point=mn,yn(nn=t,on=e)}function mn(t,e){var i=t-nn,n=e-on,o=Pi(i*i+n*n);ln+=o*(nn+t)/2,hn+=o*(on+e)/2,cn+=o,yn(nn=t,on=e)}function gn(){fn.point=yn}function bn(){fn.point=wn}function vn(){Sn(tn,en)}function wn(t,e){fn.point=Sn,yn(tn=nn=t,en=on=e)}function Sn(t,e){var i=t-nn,n=e-on,o=Pi(i*i+n*n);ln+=o*(nn+t)/2,hn+=o*(on+e)/2,cn+=o,un+=(o=on*t-nn*e)*(nn+t),pn+=o*(on+e),dn+=3*o,yn(nn=t,on=e)}function An(t){this._context=t}a(yn,"centroidPoint"),a(_n,"centroidLineStart"),a(xn,"centroidPointFirstLine"),a(mn,"centroidPointLine"),a(gn,"centroidLineEnd"),a(bn,"centroidRingStart"),a(vn,"centroidRingEnd"),a(wn,"centroidPointFirstRing"),a(Sn,"centroidPointRing"),a(An,"PathContext"),An.prototype={_radius:4.5,pointRadius:a(function(t){return this._radius=t,this},"pointRadius"),polygonStart:a(function(){this._line=0},"polygonStart"),polygonEnd:a(function(){this._line=NaN},"polygonEnd"),lineStart:a(function(){this._point=0},"lineStart"),lineEnd:a(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:a(function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Mi)}},"point"),result:Ci};var kn,Mn,Tn,Pn,Cn,In=wi(),zn={point:Ci,lineStart:a(function(){zn.point=Fn},"lineStart"),lineEnd:a(function(){kn&&Dn(Mn,Tn),zn.point=Ci},"lineEnd"),polygonStart:a(function(){kn=!0},"polygonStart"),polygonEnd:a(function(){kn=null},"polygonEnd"),result:a(function(){var t=+In;return In.reset(),t},"result")};function Fn(t,e){zn.point=Dn,Mn=Pn=t,Tn=Cn=e}function Dn(t,e){Pn-=t,Cn-=e,In.add(Pi(Pn*Pn+Cn*Cn)),Pn=t,Cn=e}function En(){this._string=[]}function Rn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function On(t,e){var i,n,o=4.5;function s(t){return t&&("function"==typeof o&&n.pointRadius(+o.apply(this,arguments)),Ri(t,i(n))),n.result()}return a(s,"path"),s.area=function(t){return Ri(t,i(Vi)),Vi.result()},s.measure=function(t){return Ri(t,i(zn)),zn.result()},s.bounds=function(t){return Ri(t,i(Ji)),Ji.result()},s.centroid=function(t){return Ri(t,i(fn)),fn.result()},s.projection=function(e){return arguments.length?(i=null==e?(t=null,Oi):(t=e).stream,s):t},s.context=function(t){return arguments.length?(n=null==t?(e=null,new En):new An(e=t),"function"!=typeof o&&n.pointRadius(o),s):e},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(n.pointRadius(+t),+t),s):o},s.projection(t).context(e)}a(Fn,"lengthPointFirst"),a(Dn,"lengthPoint"),a(En,"PathString"),En.prototype={_radius:4.5,_circle:Rn(4.5),pointRadius:a(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:a(function(){this._line=0},"polygonStart"),polygonEnd:a(function(){this._line=NaN},"polygonEnd"),lineStart:a(function(){this._point=0},"lineStart"),lineEnd:a(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:a(function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Rn(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:a(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},a(Rn,"circle"),a(On,"geoPath");const Nn=class _Contour extends It{_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerEnter(t,e,i=250){super.layerEnter(t,e,i)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i),this._palette=this._palette.switch(this.paletteID());const n=this.flattenData(this.layerColumns(t),this.layerData(t)),o=vi().x(e=>this.xPos(t,e)).y(e=>this.yPos(t,e)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(n),a=o.map(t=>t.value),s=Math.min.apply(this,a),r=Math.max.apply(this,a);this._dataMinWeight=s,this._dataMaxWeight=r;const l=e.selectAll("path").data(o);l.enter().append("path").merge(l).attr("d",On()).attr("fill",t=>this.showContourFill()?this._palette(t.value,s,r):"none").attr("stroke",this.contourStrokeColor()).attr("stroke-linejoin","round").attr("stroke-width",this.contourStrokeWidth()),l.exit().remove()}exit(t,e){super.exit(t,e)}};a(Nn,"Contour"),s(Nn,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let jn=Nn;jn.prototype._class+=" chart_Contour",jn.prototype.implements(e.I1DChart.prototype),jn.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),jn.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),jn.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),jn.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),jn.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),jn.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),jn.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const Ln=class _Gantt extends jt{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}};a(Ln,"Gantt");let Bn=Ln;function $n(t){return a(function(){return t},"constant")}Bn.prototype._class+=" chart_Gantt",a($n,"constant");var Hn=1e-12,Vn=Math.PI,qn=Vn/2,Wn=2*Vn;function Gn(t){return t.innerRadius}function Xn(t){return t.outerRadius}function Yn(t){return t.startAngle}function Un(t){return t.endAngle}function Qn(t){return t&&t.padAngle}function Zn(t){return t>=1?qn:t<=-1?-qn:Math.asin(t)}function Jn(t,e,i,n,o,a,s,r){var l=i-t,h=n-e,c=s-o,u=r-a,p=(c*(e-a)-u*(t-o))/(u*l-c*h);return[t+p*l,e+p*h]}function Kn(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/Math.sqrt(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-a,w=p*y-f*d,S=(g<0?-1:1)*Math.sqrt(Math.max(0,v*v*b-w*w)),A=(w*g-m*S)/b,k=(-w*m-g*S)/b,M=(w*g+m*S)/b,T=(-w*m+g*S)/b,P=A-_,C=k-x,I=M-_,z=T-x;return P*P+C*C>I*I+z*z&&(A=M,k=T),{cx:A,cy:k,x01:-c,y01:-u,x11:A*(o/v-1),y11:k*(o/v-1)}}function to(){var t=Gn,e=Xn,i=$n(0),n=null,o=Yn,s=Un,r=Qn,l=null;function h(){var a,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),d=o.apply(this,arguments)-qn,f=s.apply(this,arguments)-qn,y=Math.abs(f-d),_=f>d;if(l||(l=a=p()),u<c&&(h=u,u=c,c=h),u>Hn)if(y>Wn-Hn)l.moveTo(u*Math.cos(d),u*Math.sin(d)),l.arc(0,0,u,d,f,!_),c>Hn&&(l.moveTo(c*Math.cos(f),c*Math.sin(f)),l.arc(0,0,c,f,d,_));else{var x,m,g=d,b=f,v=d,w=f,S=y,A=y,k=r.apply(this,arguments)/2,M=k>Hn&&(n?+n.apply(this,arguments):Math.sqrt(c*c+u*u)),T=Math.min(Math.abs(u-c)/2,+i.apply(this,arguments)),P=T,C=T;if(M>Hn){var I=Zn(M/c*Math.sin(k)),z=Zn(M/u*Math.sin(k));(S-=2*I)>Hn?(v+=I*=_?1:-1,w-=I):(S=0,v=w=(d+f)/2),(A-=2*z)>Hn?(g+=z*=_?1:-1,b-=z):(A=0,g=b=(d+f)/2)}var F=u*Math.cos(g),D=u*Math.sin(g),E=c*Math.cos(w),R=c*Math.sin(w);if(T>Hn){var O=u*Math.cos(b),N=u*Math.sin(b),j=c*Math.cos(v),L=c*Math.sin(v);if(y<Vn){var B=S>Hn?Jn(F,D,j,L,O,N,E,R):[E,R],$=F-B[0],H=D-B[1],V=O-B[0],q=N-B[1],W=1/Math.sin(Math.acos(($*V+H*q)/(Math.sqrt($*$+H*H)*Math.sqrt(V*V+q*q)))/2),G=Math.sqrt(B[0]*B[0]+B[1]*B[1]);P=Math.min(T,(c-G)/(W-1)),C=Math.min(T,(u-G)/(W+1))}}A>Hn?C>Hn?(x=Kn(j,L,F,D,u,C,_),m=Kn(O,N,E,R,u,C,_),l.moveTo(x.cx+x.x01,x.cy+x.y01),C<T?l.arc(x.cx,x.cy,C,Math.atan2(x.y01,x.x01),Math.atan2(m.y01,m.x01),!_):(l.arc(x.cx,x.cy,C,Math.atan2(x.y01,x.x01),Math.atan2(x.y11,x.x11),!_),l.arc(0,0,u,Math.atan2(x.cy+x.y11,x.cx+x.x11),Math.atan2(m.cy+m.y11,m.cx+m.x11),!_),l.arc(m.cx,m.cy,C,Math.atan2(m.y11,m.x11),Math.atan2(m.y01,m.x01),!_))):(l.moveTo(F,D),l.arc(0,0,u,g,b,!_)):l.moveTo(F,D),c>Hn&&S>Hn?P>Hn?(x=Kn(E,R,O,N,c,-P,_),m=Kn(F,D,j,L,c,-P,_),l.lineTo(x.cx+x.x01,x.cy+x.y01),P<T?l.arc(x.cx,x.cy,P,Math.atan2(x.y01,x.x01),Math.atan2(m.y01,m.x01),!_):(l.arc(x.cx,x.cy,P,Math.atan2(x.y01,x.x01),Math.atan2(x.y11,x.x11),!_),l.arc(0,0,c,Math.atan2(x.cy+x.y11,x.cx+x.x11),Math.atan2(m.cy+m.y11,m.cx+m.x11),_),l.arc(m.cx,m.cy,P,Math.atan2(m.y11,m.x11),Math.atan2(m.y01,m.x01),!_))):l.arc(0,0,c,w,v,_):l.lineTo(E,R)}else l.moveTo(0,0);if(l.closePath(),a)return l=null,a+""||null}return a(h,"arc"),h.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Vn/2;return[Math.cos(n)*i,Math.sin(n)*i]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:$n(+e),h):t},h.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:$n(+t),h):e},h.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:$n(+t),h):i},h.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:$n(+t),h):n},h.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:$n(+t),h):o},h.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:$n(+t),h):s},h.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:$n(+t),h):r},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function eo(t){this._context=t}function io(t){return new eo(t)}function no(t){return t[0]}function oo(t){return t[1]}function ao(){var t=no,e=oo,i=$n(!0),n=null,o=io,s=null;function r(a){var r,l,h,c=a.length,u=!1;for(null==n&&(s=o(h=p())),r=0;r<=c;++r)!(r<c&&i(l=a[r],r,a))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,a),+e(l,r,a));if(h)return s=null,h+""||null}return a(r,"line"),r.x=function(e){return arguments.length?(t="function"==typeof e?e:$n(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:$n(+t),r):e},r.defined=function(t){return arguments.length?(i="function"==typeof t?t:$n(!!t),r):i},r.curve=function(t){return arguments.length?(o=t,null!=n&&(s=o(n)),r):o},r.context=function(t){return arguments.length?(null==t?n=s=null:s=o(n=t),r):n},r}function so(){}function ro(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function lo(t){this._context=t}function ho(t,e){this._basis=new lo(t),this._beta=e}function co(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function uo(t,e){this._context=t,this._k=(1-e)/6}function po(t,e){this._context=t,this._k=(1-e)/6}function fo(t,e){this._context=t,this._k=(1-e)/6}function yo(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Hn){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Hn){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,a,s,t._x2,t._y2)}function _o(t,e){this._context=t,this._alpha=e}a(Gn,"arcInnerRadius"),a(Xn,"arcOuterRadius"),a(Yn,"arcStartAngle"),a(Un,"arcEndAngle"),a(Qn,"arcPadAngle"),a(Zn,"asin"),a(Jn,"intersect"),a(Kn,"cornerTangents"),a(to,"arc"),a(eo,"Linear"),eo.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._point=0},"lineStart"),lineEnd:a(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},a(io,"curveLinear"),a(no,"x"),a(oo,"y"),a(ao,"line"),a(so,"noop"),a(ro,"point$3"),a(lo,"Basis"),lo.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 3:ro(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ro(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},a(ho,"Bundle"),ho.prototype={lineStart:a(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:a(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],a=e[0],s=t[i]-o,r=e[i]-a,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*s),this._beta*e[l]+(1-this._beta)*(a+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:a(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},a(function t(e){function i(t){return 1===e?new lo(t):new ho(t,e)}return a(i,"bundle"),i.beta=function(e){return t(+e)},i},"custom")(.85),a(co,"point$2"),a(uo,"Cardinal"),uo.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:co(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:co(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},a(function t(e){function i(t){return new uo(t,e)}return a(i,"cardinal"),i.tension=function(e){return t(+e)},i},"custom")(0),a(po,"CardinalClosed"),po.prototype={areaStart:so,areaEnd:so,lineStart:a(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:co(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},a(function t(e){function i(t){return new po(t,e)}return a(i,"cardinal"),i.tension=function(e){return t(+e)},i},"custom")(0),a(fo,"CardinalOpen"),fo.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:a(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:co(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},a(function t(e){function i(t){return new fo(t,e)}return a(i,"cardinal"),i.tension=function(e){return t(+e)},i},"custom")(0),a(yo,"point$1"),a(_o,"CatmullRom"),_o.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:yo(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const xo=a(function t(e){function i(t){return e?new _o(t,e):new uo(t,0)}return a(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"custom")(.5);function mo(t,e){this._context=t,this._alpha=e}function go(t,e){this._context=t,this._alpha=e}function bo(t){return t<0?-1:1}function vo(t,e,i){var n=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(n||o<0&&-0),s=(i-t._y1)/(o||n<0&&-0),r=(a*o+s*n)/(n+o);return(bo(a)+bo(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function wo(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function So(t,e,i){var n=t._x0,o=t._y0,a=t._x1,s=t._y1,r=(a-n)/3;t._context.bezierCurveTo(n+r,o+r*e,a-r,s-r*i,a,s)}function Ao(t){this._context=t}a(mo,"CatmullRomClosed"),mo.prototype={areaStart:so,areaEnd:so,lineStart:a(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:a(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:yo(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},a(function t(e){function i(t){return e?new mo(t,e):new po(t,0)}return a(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"custom")(.5),a(go,"CatmullRomOpen"),go.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:a(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:yo(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},a(function t(e){function i(t){return e?new go(t,e):new fo(t,0)}return a(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"custom")(.5),a(bo,"sign"),a(vo,"slope3"),a(wo,"slope2"),a(So,"point"),a(Ao,"MonotoneX"),Ao.prototype={areaStart:a(function(){this._line=0},"areaStart"),areaEnd:a(function(){this._line=NaN},"areaEnd"),lineStart:a(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:a(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:So(this,this._t0,wo(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:a(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,So(this,wo(this,i=vo(this,t,e)),i);break;default:So(this,this._t0,i=vo(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Ao.prototype).point=function(t,e){Ao.prototype.point.call(this,e,t)};var ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mo=a(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),To=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return a(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Po=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Co=a(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in o)return o.value;var s=o.get;return void 0!==s?s.call(n):void 0},"get"),Io=a(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},"inherits"),zo=a(function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},"possibleConstructorReturn"),Fo=a(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},"toConsumableArray"),Do=function(){function t(e){var i=e.x,n=void 0===i?0:i,o=e.y,a=void 0===o?0:o,s=e.nx,r=e.ny,l=e.dy,h=void 0===l?0:l,c=e.dx,u=void 0===c?0:c,p=e.color,d=void 0===p?"grey":p,f=e.data,y=e.type,_=e.subject,x=e.connector,m=e.note,g=e.disable,b=e.id,v=e.className;Mo(this,t),this._dx=void 0!==s?s-n:u,this._dy=void 0!==r?r-a:h,this._x=n,this._y=a,this._color=d,this.id=b,this._className=v||"",this._type=y||"",this.data=f,this.note=m||{},this.connector=x||{},this.subject=_||{},this.disable=g||[]}return a(t,"Annotation"),To(t,[{key:"updatePosition",value:a(function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())},"updatePosition")},{key:"clearComponents",value:a(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:a(function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())},"updateOffset")},{key:"className",get:a(function(){return this._className},"get$$1"),set:a(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:a(function(){return this._type},"get$$1"),set:a(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:a(function(){return this._x},"get$$1"),set:a(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:a(function(){return this._y},"get$$1"),set:a(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:a(function(){return this._color},"get$$1"),set:a(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:a(function(){return this._dx},"get$$1"),set:a(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:a(function(){return this._dy},"get$$1"),set:a(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:a(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:a(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:a(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:a(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:a(function(){return{x:this._x,y:this._y}},"get$$1"),set:a(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:a(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:a(function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t},"get$$1")}]),t}(),Eo=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;Mo(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return a(t,"AnnotationCollection"),To(t,[{key:"clearTypes",value:a(function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})},"clearTypes")},{key:"setPositionWithAccessors",value:a(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:a(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:a(function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})},"updateDisable")},{key:"updateTextWrap",value:a(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:a(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:a(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:a(function(){var t=this;return this.annotations.map(function(e){var i=e.json;return t.accessorsInverse&&e.data&&(i.data={},Object.keys(t.accessorsInverse).forEach(function(n){i.data[n]=t.accessorsInverse[n]({x:e.x,y:e.y})})),i})},"get$$1")},{key:"noteNodes",get:a(function(){return this.annotations.map(function(t){return Po({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),Ro=a(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy;return{move:{x:i,y:void 0===n?0:n}}},"pointHandle"),Oo=a(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy,o=void 0===n?0:n,a=t.r1,s=t.r2,r=t.padding,l={move:{x:i,y:o}};return void 0!==a&&(l.r1={x:i+a/Math.sqrt(2),y:o+a/Math.sqrt(2)}),void 0!==s&&(l.r2={x:i+s/Math.sqrt(2),y:o+s/Math.sqrt(2)}),void 0!==r&&(l.padding={x:i+a+r,y:o}),l},"circleHandles"),No=a(function(t){var e=t.group,n=t.handles,o=t.r,a=void 0===o?10:o,s=e.selectAll("circle.handle").data(n);s.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(i.drag().container(i.select("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||a}).attr("class",function(t){return"handle "+(t.className||"")}),s.exit().remove()},"addHandles"),jo=a(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),Lo=a(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),Bo=["topBottom","top","bottom"],$o=["leftRight","left","right"],Ho=a(function(t){var e=t.padding,i=void 0===e?0:e,n=t.bbox,o=void 0===n?{x:0,width:0,height:0}:n,a=t.align,s=t.orientation,r=t.offset,l=void 0===r?{x:0,y:0}:r,h=-o.x,c=0;return-1!==Bo.indexOf(s)?(a=Lo(a,l.x),l.y<0&&"topBottom"===s||"top"===s?c-=o.height+i:c+=i,"middle"===a?h-=o.width/2:"right"===a&&(h-=o.width)):-1!==$o.indexOf(s)&&(a=jo(a,l.y),l.x<0&&"leftRight"===s||"left"===s?h-=o.width+i:h+=i,"middle"===a?c-=o.height/2:"top"===a&&(c-=o.height)),{x:h,y:c}},"noteAlignment"),Vo=a(function(t){var e=t.data,i=t.curve,n=void 0===i?io:i,o=t.canvasContext,a=t.className,s=t.classID,r=ao().curve(n),l={type:"path",className:a,classID:s,data:e};return o?(r.context(o),l.pathMethods=r):l.attrs={d:r(e)},l},"lineBuilder"),qo=a(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=to().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return i?(o.context(i),n.pathMethods=lineGen):n.attrs={d:o()},n},"arcBuilder"),Wo=a(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.bbox,r=t.offset;"top"===(e=jo(e,r.y))?a-=s.height:"middle"===e&&(a-=s.height/2);var l=[[n,a],[n,a+s.height]];return{components:[Vo({data:l,className:"note-line"})]}},"noteVertical"),Go=a(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,a=void 0===o?0:o,s=t.offset,r=t.bbox;"right"===(e=Lo(e,s.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,a],[n+r.width,a]];return{components:[Vo({data:l,className:"note-line"})]}},"noteHorizontal"),Xo=a(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("circle"===i&&(h.outerRadius||h.radius)){var c=Math.sqrt((a-s)*(a-s)+(r-l)*(r-l)),u=Math.asin(-l/c),p=h.outerRadius||h.radius+(h.radiusPadding||0);a=Math.abs(Math.cos(u)*p)*(s<0?-1:1),r=Math.abs(Math.sin(u)*p)*(l<0?-1:1)}if("rect"===i){var d=h.width,f=h.height;(d>0&&n.dx>0||d<0&&n.dx<0)&&(a=Math.abs(d)>Math.abs(n.dx)?d/2:d),(f>0&&n.dy>0||f<0&&n.dy<0)&&(r=Math.abs(f)>Math.abs(n.dy)?f/2:f),a===d/2&&r===f/2&&(a=s,r=l)}return[[a,r],[s,l]]},"lineSetup"),Yo=a(function(t){var e=Xo(t);return{components:[Vo({data:e,className:"connector"})]}},"connectorLine"),Uo=a(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,a=n.x-o.x,s=a+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("rect"===i){var c=h.width,u=h.height;(c>0&&n.dx>0||c<0&&n.dx<0)&&(a=Math.abs(c)>Math.abs(n.dx)?c/2:c),(u>0&&n.dy>0||u<0&&n.dy<0)&&(r=Math.abs(u)>Math.abs(n.dy)?u/2:u),a===c/2&&r===u/2&&(a=s,r=l)}var p=[[a,r],[s,l]],d=l-r,f=s-a,y=s,_=l,x=l<r&&s>a||s<a&&l>r?-1:1;if(Math.abs(f)<Math.abs(d)?(y=s,_=r+f*x):(_=l,y=a+d*x),"circle"===i&&(h.outerRadius||h.radius)){var m=(h.outerRadius||h.radius)+(h.radiusPadding||0),g=m/Math.sqrt(2);if(Math.abs(f)>g&&Math.abs(d)>g)p=[[a=g*(s<0?-1:1),r=g*(l<0?-1:1)],[y,_],[s,l]];else if(Math.abs(f)>Math.abs(d)){var b=Math.asin(-l/m);p=[[a=Math.abs(Math.cos(b)*m)*(s<0?-1:1),l],[s,l]]}else{var v=Math.acos(s/m);p=[[s,r=Math.abs(Math.sin(v)*m)*(l<0?-1:1)],[s,l]]}}else p=[[a,r],[y,_],[s,l]];return{components:[Vo({data:p,className:"connector"})]}},"connectorElbow"),Qo=a(function(t){var e=t.type,n=t.connectorData,o=t.subjectType;n||(n={}),n.points&&"number"!=typeof n.points||(n.points=Zo(e.annotation.offset,n.points)),n.curve||(n.curve=xo);var s=[];if(e.editMode){var r=n.points.map(function(t,e){return Po({},Ro({cx:t[0],cy:t[1]}),{index:e})}),l=a(function(t){n.points[t][0]+=i.event.dx,n.points[t][1]+=i.event.dy,e.redrawConnector()},"updatePoint");s=e.mapHandles(r.map(function(t){return Po({},t.move,{drag:l.bind(e,t.index)})}))}var h=Xo({type:e,subjectType:o});return h=[h[0]].concat(Fo(n.points),[h[1]]),{components:[Vo({data:h,curve:n.curve,className:"connector"})],handles:s}},"connectorCurve"),Zo=a(function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.x/(e+1),n=t.y/(e+1),o=[],a=1;a<=e;a++)o.push([i*a+a%2*20,n*a-a%2*20]);return o},"createPoints"),Jo=a(function(t){var e=t.annotation,i=t.start,n=t.end,o=t.scale,a=void 0===o?1:o,s=e.position;i=i?[-n[0]+i[0],-n[1]+i[1]]:[e.dx,e.dy],n||(n=[e.x-s.x,e.y-s.y]);var r=n[0],l=n[1],h=i[0],c=i[1],u=10*a,p=16/180*Math.PI,d=Math.atan(c/h);h<0&&(d+=Math.PI);var f=[[r,l],[Math.cos(d+p)*u+r,Math.sin(d+p)*u+l],[Math.cos(d-p)*u+r,Math.sin(d-p)*u+l],[r,l]];return{components:[Vo({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),Ko=a(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=qo({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(n)}});return o.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[o]}},"connectorDot"),ta=a(function(t){var e=t.subjectData,n=t.type;e.radius||e.outerRadius||(e.radius=20);var o=[],s=qo({data:e,className:"subject"});if(n.editMode){var r=Oo({r1:s.data.outerRadius||s.data.radius,r2:s.data.innerRadius,padding:e.radiusPadding}),l=a(function(t){var o=e[t]+i.event.dx*Math.sqrt(2);e[t]=o,n.redrawSubject(),n.redrawConnector()},"updateRadius"),h=[Po({},r.r1,{drag:l.bind(n,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&h.push(Po({},r.r2,{drag:l.bind(n,"innerRadius")})),o=n.mapHandles(h)}return s.attrs["fill-opacity"]=0,{components:[s],handles:o}},"subjectCircle"),ea=a(function(t){var e=t.subjectData,n=t.type;e.width||(e.width=100),e.height||(e.height=100);var o=[],s=e.width,r=e.height,l=Vo({data:[[0,0],[s,0],[s,r],[0,r],[0,0]],className:"subject"});if(n.editMode){var h=a(function(){e.width=i.event.x,n.redrawSubject(),n.redrawConnector()},"updateWidth"),c=a(function(){e.height=i.event.y,n.redrawSubject(),n.redrawConnector()},"updateHeight"),u=[{x:s,y:r/2,drag:h.bind(n)},{x:s/2,y:r,drag:c.bind(n)}];o=n.mapHandles(u)}return l.attrs["fill-opacity"]=.1,{components:[l],handles:o}},"subjectRect"),ia=a(function(t){var e=t.subjectData,i=t.type.annotation.position,n=(void 0!==e.x1?e.x1:i.x)-i.x,o=(void 0!==e.x2?e.x2:i.x)-i.x,a=(void 0!==e.y1?e.y1:i.y)-i.y,s=(void 0!==e.y2?e.y2:i.y)-i.y;return{components:[Vo({data:[[n,a],[o,s]],className:"subject"})]}},"subjectThreshold"),na=a(function(t){var e=t.subjectData,n=void 0===e?{}:e,o=t.type,s=void 0===o?{}:o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=s.typeSettings&&s.typeSettings.subject;n.radius||(l&&l.radius?n.radius=l.radius:n.radius=14),n.x||l&&l.x&&(n.x=l.x),n.y||l&&l.y&&(n.y=l.y);var h=[],c=[],u=n.radius,p=.7*u,d=0,f=0,y=Math.sqrt(2)*u,_={xleftcorner:-u,xrightcorner:u,ytopcorner:-u,ybottomcorner:u,xleft:-y,xright:y,ytop:-y,ybottom:y};n.x&&!n.y?d=_["x"+n.x]:n.y&&!n.x?f=_["y"+n.y]:n.x&&n.y&&(d=_["x"+n.x+"corner"],f=_["y"+n.y+"corner"]);var x="translate("+d+", "+f+")",m=qo({className:"subject",data:{radius:u}});m.attrs.transform=x,m.attrs.fill=r.color,m.attrs["stroke-linecap"]="round",m.attrs["stroke-width"]="3px";var g=qo({className:"subject-ring",data:{outerRadius:u,innerRadius:p}});g.attrs.transform=x,g.attrs["stroke-width"]="3px",g.attrs.fill="white";var b=void 0;if(d&&f||!d&&!f)b=Vo({className:"subject-pointer",data:[[0,0],[d||0,0],[0,f||0],[0,0]]});else if(d||f){var v=a(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*u/Math.sqrt(2)},"notCornerPointerXY");b=Vo({className:"subject-pointer",data:[[0,0],[v(d),v(f)],[v(d,-1),v(f,-1)],[0,0]]})}if(b&&(b.attrs.fill=r.color,b.attrs["stroke-linecap"]="round",b.attrs["stroke-width"]="3px",c.push(b)),s.editMode){var w={x:2*d,y:2*f,drag:a(function(){n.x=i.event.x<2*-u?"left":i.event.x>2*u?"right":void 0,n.y=i.event.y<2*-u?"top":i.event.y>2*u?"bottom":void 0,s.redrawSubject()},"dragBadge").bind(s)};w.x||w.y||(w.y=-u),h=s.mapHandles([w])}var S=void 0;return n.text&&(S={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:n.text,"text-anchor":"middle",dy:".25em",x:d,y:f}}),c.push(m),c.push(g),c.push(S),{components:c,handles:h}},"subjectBadge"),oa=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,a=e.dispatcher,s=e.notePadding,r=e.accessors;if(Mo(this,t),this.a=i,this.note=-1===n.disable.indexOf("note")&&i.select("g.annotation-note"),this.noteContent=this.note&&i.select("g.annotation-note-content"),this.connector=-1===n.disable.indexOf("connector")&&i.select("g.annotation-connector"),this.subject=-1===n.disable.indexOf("subject")&&i.select("g.annotation-subject"),this.dispatcher=a,a){var l=ua.bind(null,a,n);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=n,this.editMode=n.editMode||o,this.notePadding=void 0!==s?s:3,this.offsetCornerX=0,this.offsetCornerY=0,r&&n.data&&this.init(r)}return a(t,"Type"),To(t,[{key:"init",value:a(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:a(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:a(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:a(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:a(function(t,e){var i=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var n=e.type,o=e.className,a=e.attrs,s=e.handles,r=e.classID;if("handle"===n)No({group:t,r:a&&a.r,handles:s});else{ca(t,[i.annotation],n,o,r);for(var l=t.select(n+"."+(r||o)),h=Object.keys(a),c=[],u=l.node().attributes,p=u.length-1;p>=0;p--){var d=u[p].name;-1===h.indexOf(d)&&"class"!==d&&c.push(d)}h.forEach(function(t){"text"===t?l.text(a[t]):l.attr(t,a[t])}),c.forEach(function(t){return l.attr(t,null)})}})},"drawOnSVG")},{key:"getNoteBBox",value:a(function(){return da(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:a(function(){var t=da(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t},"getNoteBBoxOffset")},{key:"drawSubject",value:a(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.subject,n=e.type,o={type:this,subjectData:i},a={};"circle"===n?a=ta(o):"rect"===n?a=ea(o):"threshold"===n?a=ia(o):"badge"===n&&(a=na(o,this.annotation));var s=a,r=s.components,l=void 0===r?[]:r,h=s.handles,c=void 0===h?[]:h;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(c=c.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:c})),l},"drawSubject")},{key:"drawConnector",value:a(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.connector,n=i.type||e.type,o={type:this,connectorData:i};o.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a="curve"===n?Qo(o):"elbow"===n?Uo(o):Yo(o),s=a.components,r=void 0===s?[]:s,l=a.handles,h=void 0===l?[]:l,c=r[0];c&&(c.attrs.stroke=this.annotation.color,c.attrs.fill="none");var u=i.end||e.end,p={};if("arrow"===u){var d=c.data[1],f=c.data[0];Math.sqrt(Math.pow(d[0]-f[0],2)+Math.pow(d[1]-f[1],2))<5&&c.data[2]&&(d=c.data[2]),p=Jo({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=Ko({line:c,scale:i.endScale}):u&&"none"!==u||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),r=r.concat(p.components)),this.editMode&&0!==h.length&&r.push({type:"handle",handles:h}),r},"drawConnector")},{key:"drawNote",value:a(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.note,o=n.align||e.align||"dynamic",a={bbox:e.bbox,align:o,offset:this.annotation.offset},s=n.lineType||e.lineType,r={};"vertical"===s?r=Wo(a):"horizontal"===s&&(r=Go(a));var l=r,h=l.components,c=void 0===h?[]:h,u=l.handles,p=void 0===u?[]:u;if(c.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){p=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:p});var d=this.dragNote.bind(this),f=this.dragstarted.bind(this),y=this.dragended.bind(this);this.note.call(i.drag().container(i.select("g.annotations").node()).on("start",function(t){return f(t)}).on("drag",function(t){return d(t)}).on("end",function(t){return y(t)}))}else this.note.on("mousedown.drag",null);return c},"drawNote")},{key:"drawNoteContent",value:a(function(t){var e=this.annotation.note,i=void 0!==e.padding?e.padding:this.notePadding,n=e.orientation||t.orientation||"topBottom",o=e.lineType||t.lineType,a=e.align||t.align||"dynamic";"vertical"===o?n="leftRight":"horizontal"===o&&(n="topBottom");var s={padding:i,bbox:t.bbox,offset:this.annotation.offset,orientation:n,align:a},r=Ho(s),l=r.x,h=r.y;return this.offsetCornerX=l+this.annotation.dx,this.offsetCornerY=h+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+l+", "+h+")"),[]},"drawNoteContent")},{key:"drawOnScreen",value:a(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:a(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:a(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:a(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))},"redrawNote")},{key:"setPosition",value:a(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:a(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:a(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:a(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:a(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:a(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:a(function(){i.event.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")},"dragstarted")},{key:"dragended",value:a(function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")},"dragended")},{key:"dragSubject",value:a(function(){var t=this.annotation.position;t.x+=i.event.dx,t.y+=i.event.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:a(function(){var t=this.annotation.offset;t.x+=i.event.dx,t.y+=i.event.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:a(function(t){var e=this;return t.map(function(t){return Po({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),aa=a(function(t,e,i){return function(t){function n(t){Mo(this,n);var i=zo(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return i.typeSettings=e,e.disable&&e.disable.forEach(function(t){i[t]&&i[t].remove(),i[t]=void 0,"note"===t&&(i.noteContent=void 0)}),i}return Io(n,t),a(n,"customType"),To(n,[{key:"className",value:a(function(){return""+(e.className||Co(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this)&&Co(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:a(function(t){return this.typeSettings.subject=Po({},e.subject,this.typeSettings.subject),Co(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawSubject",this).call(this,Po({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:a(function(t){return this.typeSettings.connector=Po({},e.connector,this.typeSettings.connector),Co(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawConnector",this).call(this,Po({},t,e.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:a(function(t){return this.typeSettings.note=Po({},e.note,this.typeSettings.note),Co(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNote",this).call(this,Po({},t,e.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:a(function(t){return Co(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNoteContent",this).call(this,Po({},t,e.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:a(function(t,e){return Co(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,t,e),i&&(t=i(t,e)),t},"init")}]),n}(t)},"customType"),sa=function(t){function e(t){Mo(this,e);var i=zo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.textWrap=t.textWrap||120,i.drawText(),i}return Io(e,t),a(e,"d3NoteText"),To(e,[{key:"updateTextWrap",value:a(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:a(function(){if(this.note){ca(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");ca(t,[this.annotation],"rect","annotation-note-bg"),ca(t,[this.annotation],"text","annotation-note-label"),ca(t,[this.annotation],"text","annotation-note-title");var e={height:0},i=this.a.select("text.annotation-note-label"),n=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,o=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,s={top:0,bottom:0,left:0,right:0};if("number"==typeof a?s={top:a,bottom:a,left:a,right:a}:a&&"object"===(void 0===a?"undefined":ko(a))&&(s=Po(s,a)),this.annotation.note.title){var r=this.a.select("text.annotation-note-title");r.text(this.annotation.note.title),r.attr("fill",this.annotation.color),r.attr("font-weight","bold"),r.call(pa,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(pa,n,o),i.attr("y",1.1*e.height||0),i.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+s.left+s.right).attr("height",l.height+s.top+s.bottom).attr("x",l.x-s.left).attr("y",-s.top).attr("fill","white").attr("fill-opacity",0)}},"drawText")}]),e}(oa);aa(sa,{className:"label",note:{align:"middle"}});var ra=aa(sa,{className:"callout",note:{lineType:"horizontal"}}),la=aa(ra,{className:"callout elbow",connector:{type:"elbow"}});aa(ra,{className:"callout curve",connector:{type:"curve"}}),aa(oa,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),aa(sa,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),aa(sa,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}});var ha=function(t){function e(){return Mo(this,e),zo(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return Io(e,t),a(e,"ThresholdMap"),To(e,[{key:"mapY",value:a(function(t){Co(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapY",this).call(this,t);var i=this.annotation;(i.subject.x1||i.subject.x2)&&i.data&&t.y&&(i.y=t.y(i.data)),!i.subject.x1&&!i.subject.x2||i.x||(i.x=i.subject.x1||i.subject.x2)},"mapY")},{key:"mapX",value:a(function(t){Co(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapX",this).call(this,t);var i=this.annotation;(i.subject.y1||i.subject.y2)&&i.data&&t.x&&(i.x=t.x(i.data)),!i.subject.y1&&!i.subject.y2||i.y||(i.y=i.subject.y1||i.subject.y2)},"mapX")}]),e}(ra);aa(ha,{className:"callout xythreshold",subject:{type:"threshold"}});var ca=a(function(t,e,i,n,o){var a=t.selectAll(i+"."+(o||n)).data(e);return a.enter().append(i).merge(a).attr("class",n),a.exit().remove(),t},"newWithClass"),ua=a(function(t,e,i){var n=i.component,o=i.name;n&&n.on("mouseover.annotations",function(){t.call(o+"over",n,e)}).on("mouseout.annotations",function(){return t.call(o+"out",n,e)}).on("click.annotations",function(){return t.call(o+"click",n,e)})},"addHandlers"),pa=a(function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=i.select(this),a=t.text().split(n||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),s=void 0,r=[],l=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");s=a.pop();)r.push(s),l.text(r.join(" ")),l.node().getComputedTextLength()>e&&r.length>1&&(r.pop(),l.text(r.join(" ")),r=[s],l=t.append("tspan").attr("x",0).attr("dy",o+"em").text(s))})},"wrap"),da=a(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var i=e.getBBox();t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.width=Math.max(t.width,i.width);var n=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(n&&parseFloat(n.value)||0)+i.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}},"bboxWithoutHandles");function fa(){var t=[],e=void 0,n=void 0,o=[],s={},r={},l=!1,h=void 0,c=ra,u=void 0,p=void 0,d=i.dispatch("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),f=void 0,y=a(function(n){f=n,l||n.selectAll("circle.handle").remove();var a=t.map(function(t){return t.type||(t.type=c),t.disable||(t.disable=o),new Do(t)});e=e||new Eo({annotations:a,accessors:s,accessorsInverse:r,ids:h}),n.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var y=n.select("g.annotations");ca(y,e.annotations,"g","annotation"),y.selectAll("g.annotation").each(function(t){var e=i.select(this);e.attr("class","annotation"),ca(e,[t],"g","annotation-connector"),ca(e,[t],"g","annotation-subject"),ca(e,[t],"g","annotation-note"),ca(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:u,notePadding:p,editMode:l,dispatcher:d,accessors:s}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return y.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",e.json),window.copy(JSON.stringify(e.json.map(function(t){return delete t.type,t}))),y},y.update=function(){return t&&e&&(t=e.annotations.map(function(t){return t.type.draw(),t})),y},y.updateText=function(){return e&&(e.updateText(u),t=e.annotations),y},y.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,y},y.disable=function(i){return arguments.length?(o=i,e&&(e.updateDisable(o),t=e.annotations),y):o},y.textWrap=function(i){return arguments.length?(u=i,e&&(e.updateTextWrap(u),t=e.annotations),y):u},y.notePadding=function(i){return arguments.length?(p=i,e&&(e.updateNotePadding(p),t=e.annotations),y):p},y.type=function(i,n){return arguments.length?(c=i,e&&(e.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=c,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=e.annotations),y):c},y.annotations=function(i){if(!arguments.length)return e&&e.annotations||t;(t=i,e&&e.annotations)&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(e=null,y(f)):e.annotations=t);return y},y.context=function(t){return arguments.length?(n=t,y):n},y.accessors=function(t){return arguments.length?(s=t,y):s},y.accessorsInverse=function(t){return arguments.length?(r=t,y):r},y.ids=function(t){return arguments.length?(h=t,y):h},y.editMode=function(i){return arguments.length?(l=i,f&&f.selectAll("g.annotation").classed("editable",l),e&&(e.editMode(l),t=e.annotations),y):l},y.collection=function(t){return arguments.length?(e=t,y):e},y.on=function(){var t=d.on.apply(d,arguments);return t===d?y:t},y}function ya(t){return.65*(t-.5)*2*Math.PI}function _a(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function xa(t,e,i=!1){const n=_a(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function ma(t,e,n=!1){return function(o){const a=i.interpolate(o.angle,t);return o.angle=t,function(t){return xa(a(t),e,n)}}}function ga(t,e,n){return function(o){const a=i.interpolate(o.startAngle,t),s=i.interpolate(o.endAngle,e);return function(t){return o.startAngle=a(t),o.endAngle=s(t),n(o)}}}a(fa,"annotation"),a(ya,"value2Angle"),a(_a,"pointOnArc"),a(xa,"indicatorTranslate"),a(ma,"indicatorTween"),a(ga,"arcTween");const ba=class _Gauge extends i.SVGWidget{_d3Arc=E().innerRadius(85).outerRadius(100);_colorScale=i.scaleLinear().interpolate(i.interpolateHcl);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(t){if(null===t||""===t.label)this._tooltipG.transition().style("opacity",0).on("interrupt end",()=>{this._tooltipG.selectAll("g").remove()});else{this._tooltipG.interrupt().style("opacity",1),t.w=this._centerText.datum().w+10;let e="horizontal",i=0,n=5,o=5;t.y>=5&&t.y<=25?(i=t.x<0?-t.w/2:t.w/2,n=12.5,o=void 0,e="vertical"):t.y>25&&(n=25,o=0);const s=fa().type(la).annotations([{data:t,dx:-t.x+i,dy:-t.y+n,color:"black",note:{label:t.label,lineType:e,padding:o,align:"middle"}}]).accessors({x:a(t=>t.x,"x"),y:a(t=>t.y,"y")});this._tooltipG.call(s)}}calcSize(t,e,i){const n=t.node().getBBox(),o=e/n.width,a=i/n.height,s=o<a?o:a;return{width:n.width,height:n.height,scale:s}}updateText(t,e,i,n,o){t.datum({x:e,y:i,w:n,h:o}).attr("transform",null);const a=this.calcSize(t,n,o),s=e+n/2-a.width/2*a.scale,r=i+o/2-a.height/2*a.scale;t.attr("transform",`translate(${s}, ${r}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(t,e){super.enter(t,e),e.on("click",t=>{this.click(t)}),this._usageArc=e.append("path").datum({startAngle:ya(0),endAngle:ya(0)}).style("fill","green").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._freeArc=e.append("path").datum({startAngle:ya(0),endAngle:ya(1)}).style("fill","lightGrey"),this._meanArc=e.append("path").datum({startAngle:ya(0),endAngle:ya(0)}).style("fill","black").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.tickValueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._mainTooltip=e.append("title");const i=this;function n(){return e.append("path").datum({angle:ya(0)}).style("fill","black").style("stroke","black").attr("d","M 0 0 l -3 -3 l 6 0 z").on("mousemove",t=>{const[e,n]=i._d3Arc.centroid(i._meanArc.datum());i.tip({x:e,y:n,label:i.tickValueDescription()})}).on("mouseout",t=>{i.tip(null)})}a(n,"appendIndicator"),this._indInner=n(),this._indOuter=n(),this._centerText=e.append("text").attr("dy",".66em").style("fill","green").on("mousemove",t=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._bottomText=e.append("text").attr("dy",".66em").on("mousemove",t=>{this.tip({x:0,y:t.y,label:this.titleDescription()})}).on("mouseout",t=>{this.tip(null)}),this._tooltipG=e.append("g").attr("class","annotation-tip")}update(t,e){super.update(t,e),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),e.attr("title",this.tooltip()).style("cursor",this.click!==_Gauge.prototype.click?"pointer":null);const n=this.calcWidth()/3,o=this.calcWidth()/2-5;this._d3Arc.innerRadius(n).outerRadius(o);const a=this.value(),s=this.tickValue();this._usageArc.style("fill",this._colorScale(a)).transition().duration(750).attrTween("d",ga(ya(0),ya(a),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",ga(ya(a),ya(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",ga(ya(s-.001),ya(s+.001),this._d3Arc)),this._indInner.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",ma(ya(s),n,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",ma(ya(s),o)),this._centerText.style("fill",this._colorScale(a)).text(i.format(".0%")(a)),this._bottomText.style("fill",this.click!==_Gauge.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==_Gauge.prototype.click?"underline":null).text(this.title());const r=_a(ya(1),n-8);this.updateText(this._centerText,-r.x,-r.y,2*r.x,2*r.y);const l=_a(ya(1),o);l.y+=5;const h=this.calcWidth()-20,c=this.calcWidth()/2-l.y-5;this.updateText(this._bottomText,-h/2,l.y,h,c),this._mainTooltip.text(this.tooltip())}click(t){}};a(ba,"Gauge");let va=ba;va.prototype._class+=" chart_Gauge",va.prototype.publish("title","","string","Title"),va.prototype.publish("titleDescription","","string","Title Description"),va.prototype.publish("titleColor","black","html-color","Color of the title text"),va.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),va.prototype.publish("maxDiameter",128,"number","Max Diameter"),va.prototype.publish("value",0,"number","Value"),va.prototype.publish("valueDescription","","string","Value Description"),va.prototype.publish("showTick",!1,"boolean","Show Tick"),va.prototype.publish("tickValue",0,"number","Tick Value"),va.prototype.publish("tickValueDescription","","string","Tick Value Description"),va.prototype.publish("tooltip","","string","Tooltip"),va.prototype.publish("colorRange",["green","green","green","green","green","green","green","green","orange","red","red"],"array","Array of colors for the filled gauge portion. The fill color will be relative to the gauge value."),va.prototype.publish("colorDomain",[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],"array","This array augments the mapping of the value to the fill colorRange."),va.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),va.prototype.publish("tickColor","black","html-color","Color of the tick");const wa=a((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),Sa=a((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),Aa=class _Pie extends i.SVGWidget{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),e.I2DChart.call(this),e.ITooltip.call(this),i.Utility.SimpleSelectionMixin.call(this),this.d3Pie=V(),this.d3Arc=E(),this.d3LabelArc=E(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(t,e){return this.intersectCircle(this.calcOuterRadius(),t,e)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t},!1)),"Verdana",12).width,e=this._size.width-(this.showLabels()?2*t:0)-20,i=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),n=Math.min(e,i)/2-2;return e/2-2<this.minOuterRadius()?this._labelWidthLimit=t-(this.minOuterRadius()-(e/2-2)):this._labelWidthLimit=t,n<this.minOuterRadius()?this.minOuterRadius():n}calcSmallValueLabelHeight(){const t=this.data().reduce((t,e)=>t+e[1],0);let e=0;return this.data().forEach(i=>{i[1]/t<.1&&e++}),this.labelHeight()*e}calcTotalValue(){return this.data().reduce((t,e)=>t+e[1],0)}calcPadAngleRadians(){const t=this.slicePadding();return t>0?Math.min(t,.05):0}getLabelText(t,e){let i,n=t.data[0];if(void 0!==this._labelWidthLimit&&e){const t=this.textSize(n,"Verdana",this.labelHeight()).width;this._labelWidthLimit<t&&(i=n.length*(this._labelWidthLimit/t)-3,n=i<n.length?n.slice(0,i)+"...":n)}if(this.showSeriesValue()&&(n+=` : ${this._seriesValueFormatter(t.data[1])}`),this.showSeriesPercentage()){let e=this._totalValue;const i=this.dataMeta();void 0!==i.sum&&(e=i.sum);const o=t.data[1]/e*100;n+=` : ${this._seriesPercentageFormatter(o)}%`}return n}selection(t){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch(i){return}const e=JSON.stringify(t);this._selection.selection2(t=>e===JSON.stringify(t.data))}selectByLabel(t){const e=this.data().filter(e=>e[0]===t)[0];e&&this.selection(e)}_slices;_labels;enter(t,e){super.enter(t,e),this._selection.widgetElement(e).skipBringToTop(!0),this._slices=e.append("g"),this._labels=e.append("g");const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t.data[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t.data[0]),value:t.data[n+1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){this.selectionGlow(!this.tabNavigation()),super.update(t,e);const n=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=i.format(this.seriesValueFormat()),this._seriesPercentageFormatter=i.format(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();const o=this.calcOuterRadius(),s=Math.max(this.calcInnerRadius(),Math.min(o/30,6)),r=o+12;this.d3Arc.innerRadius(s).padRadius(o).outerRadius(o).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];const l=[...this.data()];switch(this.sortDataByValue()){case"ascending":l.sort(wa);break;case"descending":l.sort(Sa)}const h=this._slices.selectAll(".arc").data(this.d3Pie(l),t=>t.data[0]);this._labelPositions=[],h.enter().append("g").attr("class",(t,e)=>"arc series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){n.click(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))}).on("keydown",function(t,e){const o=i.d3Event();!n.tabNavigation()||"Space"!==o.code&&"Enter"!==o.key||(o.preventDefault(),n._selection.click(this))}).each(function(t,e){i.select(this).append("path").on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).on("mouseover",f(0,0)).on("mouseout",f(-5,150))}).merge(h).transition().attr("opacity",1).attr("tabindex",n.tabNavigation()?"0":null).attr("role",n.tabNavigation()?"button":null).attr("aria-label",n.tabNavigation()?t=>`${t.data[0]}: ${t.data[1]}`:null).each(function(t,e){const a=n.getQuadrant(d(t));n._quadIdxArr[a].push(e),t.outerRadius=o-5;i.select(this).select("path").transition().attr("d",n.d3Arc).style("fill",n.fillColor(t.data,n.columns()[1],t.data[1]))}),h.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(r).outerRadius(r);const c=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(l):[],t=>t.data[0]),u=c.enter().append("text").on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("dy",".5em").on("click",function(t){n._slices.selectAll("g").filter(function(e){t.data===e.data&&(n._selection.click(this),n.click(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this)))})}).on("dblclick",function(t){n._slices.selectAll("g").filter(function(e){t.data===e.data&&n.dblclick(n.rowToObj(t.data),n.columns()[1],n._selection.selected(this))})}).merge(c).text(t=>this.getLabelText(t,!0)).each(function(t,e){const i=n.d3LabelArc.centroid(t),o=d(t);i[0]=r*(n.isLeftSide(o)?1:-1),n._labelPositions.push({top:i[1],bottom:i[1]+n.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),u.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const i=n.d3LabelArc.centroid(t);return i[0]=r*(n.isLeftSide(d(t))?1:-1),i[1]=n._labelPositions[e].top,"translate("+i+")"}).style("text-anchor",t=>this.isLeftSide(d(t))?"start":"end")),c.exit().remove();const p=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(l):[],t=>this.getLabelText(t,!0));function d(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function f(t,e){return function(){i.select(this).transition().delay(e).attrTween("d",function(e){const a=i.interpolate(e.outerRadius,o+t);return function(t){return e.outerRadius=a(t),n.d3Arc(e)}})}}p.enter().append("polyline").merge(p).transition().attr("points",function(t,e){const i=n.d3LabelArc.centroid(t),o=n.d3Arc.centroid(t),a=[...i];return i[0]=r*(n.isLeftSide(d(t))?1:-1),i[1]=n._labelPositions[e].top,[o,a,i]}),p.exit().remove(),this.showLabels()&&this.centerOnLabels(),a(d,"midAngle"),a(f,"arcTween")}isLeftSide(t){return(t=n.normalizeRadians(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=n.normalizeRadians(t);return e=i<=1*Math.PI&&i>=.5*Math.PI?3:e,e=i<=.5*Math.PI&&i>=0*Math.PI?2:e,e=i<=0*Math.PI&&i>=-.5*Math.PI?1:e,e}centerOnLabels(){const t=this.pos().y,e=2*t,i=this.calcOuterRadius(),n=Math.min(this._minLabelTop,-i),o=Math.max(this._maxLabelBottom,i),a=e-(o-n),s=Math.abs(this._minLabelTop);let r=0;o>t?(r=t-o+this.labelHeight()/2,r-=a/2):n<0&&s>t&&(r=s-t+this.labelHeight()/2,r+=a/2);const l=this.pos();this.pos({y:l.y+r,x:l.x})}adjustForOverlap(){const t=this.labelHeight();this._quadIdxArr.forEach((e,i)=>{let n;this._quadIdxArr[i].sort((t,e)=>1===i||2===i?this._labelPositions[t].top>this._labelPositions[e].top?-1:1:0===i||3===i?this._labelPositions[t].top>this._labelPositions[e].top?1:-1:void 0),this._quadIdxArr[i].forEach((e,o)=>{if(o>0)if(1===i||2===i){if(n<this._labelPositions[e].bottom){const t=this._labelPositions[e].bottom-n;this._labelPositions[e].top-=t,this._labelPositions[e].bottom-=t}}else if((0===i||3===i)&&n+t>this._labelPositions[e].top){const i=Math.abs(this._labelPositions[e].top)-Math.abs(n+t);this._labelPositions[e].top-=i,this._labelPositions[e].bottom-=i}n=this._labelPositions[e].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((t,e)=>{this._quadIdxArr[e].forEach((t,e)=>{this._minLabelTop>this._labelPositions[t].top&&(this._minLabelTop=this._labelPositions[t].top),this._maxLabelBottom<this._labelPositions[t].bottom&&(this._maxLabelBottom=this._labelPositions[t].bottom)})})}exit(t,e){super.exit(t,e)}updateD3Pie(){const t=n.normalizeRadians(n.degreesToRadians(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(wa);break;case"descending":this.d3Pie.sort(Sa);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}};a(Aa,"Pie"),s(Aa,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let ka=Aa;ka.prototype._class+=" chart_Pie",ka.prototype.implements(e.I2DChart.prototype),ka.prototype.implements(e.ITooltip.prototype),ka.prototype.mixin(i.Utility.SimpleSelectionMixin),ka.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),ka.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:a(t=>!t.showLabels(),"disable")}),ka.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:a(t=>!t.showSeriesValue(),"disable")}),ka.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:a(t=>!t.showLabels(),"disable")}),ka.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:a(t=>!t.showSeriesPercentage(),"disable")}),ka.prototype.publish("paletteID","default","set","Color palette for this widget",ka.prototype._palette.switch(),{tags:["Basic","Shared"]}),ka.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),ka.prototype.publish("innerRadius",0,"number","Sets inner pie hole radius as a percentage of the radius of the pie chart",null,{tags:["Basic"],range:{min:0,step:1,max:100}}),ka.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),ka.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),ka.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:a(t=>!t.showLabels(),"disable")}),ka.prototype.publish("slicePadding",.01,"number","Padding between pie slices (converted to pixels)",null,{tags:["Basic"],range:{min:0,step:.01,max:.2}}),ka.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]),ka.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const Ma=class _HalfPie extends ka{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i=this._pos.x,n=this._pos.y;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),n+=this._size.height/4,this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}};a(Ma,"HalfPie");let Ta=Ma;Ta.prototype._class+=" chart_HalfPie";const Pa=class _Heat extends It{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(t){return this.radiusX(t),this.radiusY(t),this}layerEnter(t,e,i=250){super.layerEnter(t,e,i),this._domForeignObject=this.svg.insert("foreignObject","#"+(this.id()+"_clippath")),this._domCanvas=this._domForeignObject.append("xhtml:body").style("margin","0px").style("padding","0px").style("background-color","transparent").append("canvas"),this._heat=Ia(this._domCanvas.node())}layerUpdate(t,e,n=250){super.layerUpdate(t,e),this._palette=this._palette.switch(this.paletteID());let o=this.width()-this.margin.left-this.margin.right;o<0&&(o=0);let a=this.height()-this.margin.top-this.margin.bottom;a<0&&(a=0),this._domForeignObject.attr("x",this.margin.left).attr("y",this.margin.top).attr("width",o).attr("height",a),this._domCanvas.attr("width",o).attr("height",a);const s="horizontal"===t.orientation()?this.data().map(e=>[t.dataPos(e[0]),t.valuePos(e[1]),e[2]]):this.data().map(e=>[t.valuePos(e[1]),t.dataPos(e[0]),e[2]]),r=this.maxWeight_exists()?this.maxWeight():i.max(s,t=>t[2]);if("default"!==this.paletteID()){const t={},e=8,i=this.reversePalette();for(let n=0;n<e;++n)t[n/e]=this._palette((i?e-n:n)/e,0,1);this._heat.gradient(t)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();const l=this.radiusAsPercent()?this.radiusX()*o/100:this.radiusX(),h=this.radiusAsPercent()?this.radiusY()*a/100:this.radiusY();this._heat.clear().radius(l,h,this.blur()).max(r).data(s).draw(this.minOpacity())}};a(Pa,"Heat");let Ca=Pa;function Ia(t){if(!(this instanceof Ia))return new Ia(t);this._canvas=t="string"==typeof t?document.getElementById(t):t,this._ctx=t.getContext("2d"),this._width=t.width,this._height=t.height,this._max=1,this._data=[]}Ca.prototype._class+=" chart_Heat",Ca.prototype._palette=i.Palette.rainbow("default"),Ca.prototype.publish("paletteID","default","set","Color palette for this widget",Ca.prototype._palette.switch(),{tags:["Basic"]}),Ca.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ca.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:a(t=>"default"===t.paletteID(),"disable")}),Ca.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),Ca.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),Ca.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),Ca.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),Ca.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),Ca.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),a(Ia,"simpleheat"),Ia.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:a(function(t){return this._data=t,this},"data"),max:a(function(t){return this._max=t,this},"max"),add:a(function(t){return this._data.push(t),this},"add"),clear:a(function(){return this._data=[],this},"clear"),radius:a(function(t,e,i){i=void 0===i?15:i;const n=this._ellipse=this._createCanvas(),o=n.getContext("2d"),a=this._r=t+i,s=this._r=e+i;return n.width=2*a,n.height=2*s,o.shadowOffsetX=o.shadowOffsetY=2*a,o.shadowOffsetY=o.shadowOffsetY=2*s,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.ellipse(-a,-s,t,e,0,0,2*Math.PI,!0),o.closePath(),o.fill(),this},"radius"),resize:a(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:a(function(t){const e=this._createCanvas(),i=e.getContext("2d"),n=i.createLinearGradient(0,0,0,256);e.width=1,e.height=256;for(const o in t)n.addColorStop(+o,t[o]);return i.fillStyle=n,i.fillRect(0,0,1,256),this._grad=i.getImageData(0,0,1,256).data,this},"gradient"),draw:a(function(t){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);const e=this._ctx;e.clearRect(0,0,this._width,this._height);for(let n,o=0,a=this._data.length;o<a;o++)n=this._data[o],n[2]<0?n[2]=0:n[2]>this._max&&(n[2]=this._max),e.globalAlpha=Math.max(n[2]/this._max,void 0===t?.05:t),e.drawImage(this._ellipse,n[0]-this._r,n[1]-this._r);const i=e.getImageData(0,0,this._width,this._height);return this._colorize(i.data,this._grad),e.putImageData(i,0,0),this},"draw"),_colorize:a(function(t,e){for(let i,n=0,o=t.length;n<o;n+=4)i=4*t[n+3],i&&(t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2])},"_colorize"),_createCanvas:a(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var za=Math.PI/3,Fa=[0,za,2*za,3*za,4*za,5*za];function Da(t){return t[0]}function Ea(t){return t[1]}function Ra(){var t,e,i,n=0,o=0,s=1,r=1,l=Da,h=Ea;function c(t){var n,o={},a=[],s=t.length;for(n=0;n<s;++n)if(!isNaN(c=+l.call(null,r=t[n],n,t))&&!isNaN(u=+h.call(null,r,n,t))){var r,c,u,p=Math.round(u/=i),d=Math.round(c=c/e-(1&p)/2),f=u-p;if(3*Math.abs(f)>1){var y=c-d,_=d+(c<d?-1:1)/2,x=p+(u<p?-1:1),m=c-_,g=u-x;y*y+f*f>m*m+g*g&&(d=_+(1&p?1:-1)/2,p=x)}var b=d+"-"+p,v=o[b];v?v.push(r):(a.push(v=o[b]=[r]),v.x=(d+(1&p)/2)*e,v.y=p*i)}return a}function u(t){var e=0,i=0;return Fa.map(function(n){var o=Math.sin(n)*t,a=-Math.cos(n)*t,s=o-e,r=a-i;return e=o,i=a,[s,r]})}return a(c,"hexbin"),a(u,"hexagon"),c.hexagon=function(e){return"m"+u(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var a=[],l=Math.round(o/i),h=Math.round(n/e),c=l*i;c<r+t;c+=i,++l)for(var u=h*e+(1&l)*e/2;u<s+e/2;u+=e)a.push([u,c]);return a},c.mesh=function(){var e=u(t).slice(0,4).join("l");return c.centers().map(function(t){return"M"+t+"m"+e}).join("")},c.x=function(t){return arguments.length?(l=t,c):l},c.y=function(t){return arguments.length?(h=t,c):h},c.radius=function(n){return arguments.length?(e=2*(t=+n)*Math.sin(za),i=1.5*t,c):t},c.size=function(t){return arguments.length?(n=o=0,s=+t[0],r=+t[1],c):[s-n,r-o]},c.extent=function(t){return arguments.length?(n=+t[0][0],o=+t[0][1],s=+t[1][0],r=+t[1][1],c):[[n,o],[s,r]]},c.radius(1)}a(Da,"pointX"),a(Ea,"pointY"),a(Ra,"d3HexBin");const Oa=class _HexBin extends It{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),e.I2DAggrChart.call(this),this.tooltipValueFormat_default(",.0f"),e.ITooltip.call(this),this.tooltipHTML(t=>{const e=i.extent(t,t=>t.label),n=i.extent(t,t=>t.value);return this.tooltipFormat({series:e[0]===e[1]?e[0]:`${e[0]} -> ${e[1]}`,label:n[0]===n[1]?n[0]:`${n[0]} -> ${n[1]}`,value:t.length})}),this._hexbin=Ra().x(t=>t.x).y(t=>t.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerUpdate(t,e,n=250){super.layerUpdate(t,e,n);const o=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());const a=this.flattenData().map(e=>({x:o.xPos(t,e),y:o.yPos(t,e),label:t.parseData(e.label),value:t.parseValue(e.value),origRow:e})),s=this._hexbin(a),r=i.min(s,function(t){return t.length}),l=i.max(s,function(t){return t.length});this._dataMinWeight=r,this._dataMaxWeight=l;const h=e.selectAll(".hexagon").data(s,function(t){return t.i+"_"+t.j});h.enter().append("path").attr("class","hexagon").call(t._selection.enter.bind(t._selection)).on("click",function(e){const i=o.data();o.click(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),o.columns()[1],t._selection.selected(this))}).on("dblclick",function(e){const i=o.data();o.dblclick(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),o.columns()[1],t._selection.selected(this))}).on("mouseout.tooltip",o.tooltip.hide).on("mousemove.tooltip",o.tooltip.show).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).merge(h).transition().duration(n).attr("d",this._hexbin.hexagon()).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(1)"}).style("fill",function(t){return o._palette(t.length,r,l)}),h.exit().transition().duration(n).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).remove()}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}};a(Oa,"HexBin"),s(Oa,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Na=Oa;Na.prototype._class+=" chart_HexBin",Na.prototype.implements(e.I2DAggrChart.prototype),Na.prototype.implements(e.ITooltip.prototype),Na.prototype.publish("paletteID","Blues","set","Color palette for this widget",Na.prototype._palette.switch(),{tags:["Basic","Shared"]}),Na.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Na.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const ja=class _Line extends Ft{constructor(){super(),this.interpolate_default("linear")}};a(ja,"Line");let La=ja;La.prototype._class+=" chart_Line";const Ba=class _QuarterPie extends ka{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i="left"===this.orientation()?0:this._size.width,n=this._size.height;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle("left"===this.orientation()?0:-Math.PI/2).endAngle("left"===this.orientation()?Math.PI/2:0)}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t})),"Verdana",12).width;return Math.min(this._size.width-t-10,this._size.height-36)-2}};a(Ba,"QuarterPie");let $a=Ba;$a.prototype._class+=" chart_QuarterPie",$a.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const Ha=class _QuartileCandlestick extends i.SVGWidget{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(t,e){super.enter(t,e),this._g=e.append("g"),this._leftLine=this._g.append("rect"),this._rightLine=this._g.append("rect"),this._midLine=this._g.append("rect"),this._midOuterRect=this._g.append("rect"),this._midInnerRect1=this._g.append("rect"),this._midInnerRect2=this._g.append("rect"),this._q0text=this._g.append("text"),this._q1text=this._g.append("text"),this._q2text=this._g.append("text"),this._q3text=this._g.append("text"),this._q4text=this._g.append("text"),this._q0val=this._g.append("text"),this._q1val=this._g.append("text"),this._q2val=this._g.append("text"),this._q3val=this._g.append("text"),this._q4val=this._g.append("text")}update(t,e){super.update(t,e);const n=("horizontal"===this.orientation()?this.width():this.height())-this.lineWidth(),o="horizontal"===this.orientation()?this.height():this.width(),a=i.scaleLinear().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),n-this.edgePadding()]),s=this.candleWidth_exists()?this.candleWidth():o,r=this.lineWidth(),l=this.lineColor(),h=this.roundedCorners(),c=this.edgePadding();let u=a(this.data()[1]),p=a(this.data()[2]),d=a(this.data()[3]);const f=-s/2,y=s/2,_=this.upperTextRotation(),x=this.lowerTextRotation(),m=this.textPadding(),g=this.labelFontSize(),b=this.valueFontSize(),v=Math.max(g,b),w=n-c;if(v>0){for(;u-c<v;)u+=v;for(;p-u<v;)p+=v;for(;d-p<v;)d+=v;for(;w-d<v;)d-=v;for(;d-p<v;)p-=v;for(;p-u<v;)u-=v}let S=-n/2-this.lineWidth()/2,A=0,k=0;let M=1,T="start",P="end";"vertical"===this.orientation()&&(S=0,A=n/2+this.lineWidth()/2,k=-90,T="end",P="start",M=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${S},${A})rotate(${k})scale(1)`),this._leftLine.attr("fill",l).attr("height",s).attr("width",r).attr("x",c).attr("y",f).attr("rx",h).attr("ry",h),this._rightLine.attr("class","right-line").attr("fill",l).attr("height",s).attr("width",r).attr("x",w).attr("y",f).attr("rx",h).attr("ry",h),this._midLine.attr("fill",l).attr("height",r).attr("width",w-c).attr("x",c).attr("y",-r/2),this._midOuterRect.attr("fill",l).attr("height",s).attr("width",d-u).attr("x",u).attr("y",f).attr("rx",h).attr("ry",h),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",s-2*r).attr("width",p-(u+2*r)).attr("x",u+r).attr("y",r-s/2).attr("rx",.618*h).attr("ry",.618*h),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",s-2*r).attr("width",d-p-r).attr("x",p).attr("y",r-s/2).attr("rx",.618*h).attr("ry",.618*h),this._q0text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f-m})rotate(${_})scale(${M})`).attr("font-size",g).attr("text-anchor",T).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f-m})rotate(${_})scale(${M})`).attr("font-size",g).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f-m})rotate(${_})scale(${M})`).attr("font-size",g).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${f-m})rotate(${_})scale(${M})`).attr("font-size",g).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${f-m})rotate(${_})scale(${M})`).attr("font-size",g).attr("text-anchor",T).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${y+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",P).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${y+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${y+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${y+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",P).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${y+m})rotate(${x})scale(${M})`).attr("font-size",b).attr("text-anchor",P).attr("alignment-baseline","baseline").text(this.data()[4])}};a(Ha,"QuartileCandlestick");let Va=Ha;Va.prototype._class+=" chart_QuartileCandlestick",Va.prototype.publish("textColor","black","html-color","Color of label and value text"),Va.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),Va.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),Va.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),Va.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),Va.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),Va.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),Va.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),Va.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),Va.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),Va.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),Va.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),Va.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),Va.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),Va.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const qa=class _Radar extends i.SVGWidget{constructor(){super(),e.INDChart.call(this),e.ITooltip.call(this),i.Utility.SimpleSelectionMixin.call(this)}mapShape(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}setPointAttributes(t,e,i){const n=this;switch(this.mapShape(this.pointShape())){case"rect":t.attr("width",n.pointSize()).attr("height",n.pointSize()).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"circle":t.attr("r",n.pointSize()/2).attr("cx",e).attr("cy",i).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"path":const o=n.pointSize()/2;t.attr("d",function(t){return"M"+(e-o)+" "+(i-o)+" L"+(e+o)+" "+(i+o)+" M"+(e-o)+" "+(i+o)+" L"+(e+o)+" "+(i-o)}).style("stroke",t=>this.strokeColor(t.data,t.column,t.value))}}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t.label,series:t.column,value:t.value}))}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID());const n=this,o=this.height()/2,a=this.width()/2,s=this.columns(),r=this.data(),l=this.flattenData(s,r).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=s[t.colIdx],t.row=r[e],t)),h=[],c=this.degrees2radians(360/this.data().length),u=this.fontSize();let p=0;l.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());p<e.width&&(p=e.width)});const d=Math.min(o-u,a-p),f=e.selectAll(".label").data(l.filter(t=>1===t.colIdx)),y=Math.max.apply(n,l.map(t=>t.value));f.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(f).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const o=n.polar2cartesian(d,e*c-Math.PI/2);h.push(o.map(t=>t*n.labelPaddingRatio()));let a="middle";const s=Math.round(o[0]);a=s>0?"start":a,a=s<0?"end":a,i.select(this).attr("text-anchor",a).attr("x",o[0]).attr("y",o[1])}).text(t=>t.label),f.exit().remove();const _=e.selectAll(".domain").data(l.filter(t=>1===t.colIdx));_.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(_).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>h[e][0]).attr("y2",(t,e)=>h[e][1]),_.exit().remove();const x=e.selectAll(".value_guide").data(this.valueGuideRatios());x.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(x).each(function(t,e){const n=[];h.forEach((e,i)=>{n.push([e[0]*t,e[1]*t])}),i.select(this).attr("points",n.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),x.exit().remove();const m=e.selectAll(".value_guide_text").data(this.valueGuideRatios());m.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(m).attr("x",2).attr("y",t=>h[0][1]*t).text((t,e)=>Math.round(t*y)),x.exit().remove();const g=e.selectAll(".area").data(s.filter((t,e)=>e>0));g.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(g).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>h.map((t,i)=>{const n=r[i][e+1],o=0===n?0:n/y;return t[0]*o+","+t[1]*o}).join(" ")),g.exit().remove();const b=e.selectAll(".point").data(l);b.enter().append("g").attr("class","point").on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).on("click",function(t,e){const i=n.data()[t.rowIdx],o=n.rowToObj(i),a=n._selection.selected(this);n.click(o,n.columns()[t.colIdx],a)}).on("dblclick",function(t,e){n.dblclick(n.rowToObj(n.data()[t.rowIdx]),t.column,n._selection.selected(this))}).each(function(t){const e=i.select(this);e.append("circle").attr("class","pointSelection").attr("r",n.pointSize()).call(n._selection.enter.bind(n._selection)),e.append(n.mapShape(n.pointShape())).attr("class","pointShape")}).merge(b).each(function(t){const e=i.select(this),o=0===t.value?0:t.value/y,a=h[t.rowIdx][0]*o,s=h[t.rowIdx][1]*o;e.select(".pointSelection").attr("cx",a).attr("cy",s);const r=e.select(".pointShape").style("stroke",n.strokeColor(t.row,t.column,t.value)).style("fill",n.fillColor(t.row,t.column,t.value));n.setPointAttributes(r,a,s)}),b.exit().remove()}polar2cartesian(t,e){return[t*Math.cos(e),t*Math.sin(e)]}cartesian2polar(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}degrees2radians(t){return t/57.295779513}radians2degrees(t){return 57.295779513*t}point_in_polygon(t,e){const i=t[0],n=t[1];let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const t=e[a][0],r=e[a][1],l=e[s][0],h=e[s][1];r>n!=h>n&&i<(l-t)*(n-r)/(h-r)+t&&(o=!o)}return o}};a(qa,"Radar");let Wa=qa;Wa.prototype._class+=" chart_Radar",Wa.prototype.implements(e.INDChart.prototype),Wa.prototype.implements(e.ITooltip.prototype),Wa.prototype.mixin(i.Utility.SimpleSelectionMixin),Wa.prototype.publish("paletteID","default","set","Color palette for this widget",Wa.prototype._palette.switch()),Wa.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),Wa.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),Wa.prototype.publish("valueGuideRatios",[.2,.4,.6,.8,1],"array","Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines"),Wa.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),Wa.prototype.publish("fontFamily","","string","fontFamily"),Wa.prototype.publish("fontSize",16,"number","fontSize"),Wa.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const Ga=class _RadialBar extends i.SVGWidget{_domainScale=i.scaleBand();_valueScale=i.scaleLinear();_d3Arc=E().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),e.INDChart.call(this),e.ITooltip.call(this),i.Utility.SimpleSelectionMixin.call(this)}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t[0],value:t[1]})),this._radialAxis=e.append("g").attr("class","r axis"),this._axialAxis=e.append("g").attr("class","a axis"),this._arcs=e.append("g").attr("class","data")}update(t,e){super.update(t,e);const n=this,o=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(t=>t[1]));this._valueScale.domain([0,o]).range([0,this.radians(this.valueMaxAngle())]);const a=this._valueScale.ticks(this.tickCount()),s=this.textSize(a.map(t=>""+t),"Verdana",12).width,r=Math.min(this.width()-2*(10+s),this.height()-44)/2,l=this.data().map(t=>t[0]);this._domainScale.domain(l).range([0,r]).padding(this.domainPadding());const h=this._domainScale.step()*this._domainScale.padding(),c=this._radialAxis.selectAll("circle").data(l);c.enter().append("circle").attr("fill","transparent").merge(c).attr("r",t=>this._domainScale(t)+this._domainScale.step()-h/2),c.exit().remove();const u=this._radialAxis.selectAll(".arc-text").data(l);u.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(u).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),u.exit().remove();const p=this._axialAxis.selectAll("line").data(a);p.enter().append("line").merge(p).attr("x2",t=>r*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>r*Math.sin(this._valueScale(t)-this.radians(90))),p.exit().remove();const d=this._axialAxis.selectAll("text").data(a);d.enter().append("text").style("dominant-baseline","central").merge(d).attr("x",t=>(r+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(r+10)*Math.sin(this._valueScale(t)-this.radians(90))).style("text-anchor",t=>{const e=this.degrees(this._valueScale(t));return e>=0&&e<=20||e>=160&&e<=200||e>=340&&e<=360?"middle":e>=180&&e<=360?"end":null}).text(t=>t),d.exit().remove();const f=this.columns().length>1?this.columns()[1]:"";this._d3Arc.innerRadius(t=>this._domainScale(t[0])).outerRadius(t=>this._domainScale(t[0])+this._domainScale.bandwidth());const y=this._arcs.selectAll("path").data(this.data(),t=>t[0]);y.enter().append("path").attr("class","arc").call(this._selection.enter.bind(this._selection)).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("click",function(t,e){n.click(n.rowToObj(t),f,n._selection.selected(this))}).on("dblclick",function(t,e){n.dblclick(n.rowToObj(t),f,n._selection.selected(this))}).merge(y).style("fill",(t,e)=>this.fillColor(t,t[0],t[1])).transition().delay((t,e)=>e*this.transitionDelay()).duration(this.transitionDuration()).attrTween("d",(t,e)=>{const n=i.interpolate(t._current||0,t[1]);return t._current=t[1],i=>this._d3Arc([t[0],n(i)],e)}),y.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}};a(Ga,"RadialBar"),s(Ga,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let Xa=Ga;Xa.prototype._class+=" chart_RadialBar",Xa.prototype.implements(e.INDChart.prototype),Xa.prototype.implements(e.ITooltip.prototype),Xa.prototype.mixin(i.Utility.SimpleSelectionMixin),Xa.prototype.publish("paletteID","default","set","Color palette for this widget",Xa.prototype._palette.switch()),Xa.prototype.publish("tickCount",10,"number","Number of ticks to display"),Xa.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),Xa.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),Xa.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),Xa.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),Xa.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const Ya=i.Palette.rainbow("Blues"),Ua=i.Palette.ordinal("Quartile",[Ya(100,0,100),Ya(50,0,100),Ya(50,0,100),Ya(75,0,100)]);function Qa(t){const e=i.format(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}Ua("Std. Dev."),Ua("MinMax"),Ua("25%"),Ua("50%"),a(Qa,"myFormatter");const Za=class _StatChart extends i.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=(new Ft).columns(["","Std. Dev."]).paletteID("Quartile").interpolate_default("basis").pointSize(0).xAxisType("linear").xAxisOverlapMode("none").xAxisTickFormat(",").yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=(new Va).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(Ya(90,0,100)).innerRectColor(Ya(10,0,100));constructor(){super(),this.columns(["Min","25%","50%","75%","Max","Mean","Std. Dev."])}stdDev(t){return this.mean()+t*this.standardDeviation()}formatStdDev(t){return this._tickFormatter(this.stdDev(t))}quartile(t){return this.quartiles()[t]}formatQ(t){return this._tickFormatter(this.quartile(t))}domain(t){switch(t){case"25_75":return[this.quartile(1),this.quartile(3)];case"normal":return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(t){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];const e=t[0];return this.quartiles([e[0],e[1],e[2],e[3],e[4]]),this.mean(e[5]),this.standardDeviation(e[6]),this}enter(t,e){super.enter(t,e),this._bellCurve.target(e.append("div").node()),this._candle.target(e.append("div").node()),this._selectElement=e.append("div").style("position","absolute").style("top","0px").style("right","0px").append("select").on("change",()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append("option").attr("value","min_max").text("Min / Max"),this._selectElement.append("option").attr("value","25_75").text("25% / 75%"),this._selectElement.append("option").attr("value","normal").text("Normal")}bellTicks(t){let e;switch(t){case"25_75":e=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case"normal":e=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:"-3σ",value:this.stdDev(-3)},{label:"-2σ",value:this.stdDev(-2)},{label:"-1σ",value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:"+1σ",value:this.stdDev(1)},{label:"+2σ",value:this.stdDev(2)},{label:"+3σ",value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:e=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}const[i,n]=this.domain(this._selectElement.node().value);return e.filter(t=>t.value>=i&&t.value<=n).map(t=>({label:t.label,value:t.value.toString()}))}updateScatter(){const t=this._selectElement.node().value,[e,i]=this.domain(t),n=(i-e)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(e-n).xAxisDomainHigh(i+n).xAxisTicks(this.bellTicks(t)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){const t=this._bellCurve.dataPos(this.quartile(0)),e=this._bellCurve.dataPos(this.quartile(4))-t;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:t+e/2+2,y:this.candleHeight()/2}).width(e).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(t,e){super.update(t,e),this._tickFormatter=Qa(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(t,e){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(t,e)}};a(Za,"StatChart");let Ja=Za;Ja.prototype._class+=" chart_StatChart",Ja.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),Ja.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),Ja.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),Ja.prototype.publish("domainPadding",10,"number","Domain value padding"),Ja.prototype.publish("mean",.5,"number","Mean"),Ja.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),Ja.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const Ka=class _Step extends Ft{constructor(){super(),this.interpolate_default("step")}};a(Ka,"Step");let ts=Ka;ts.prototype._class+=" chart_Step";const es="text",is="html",ns=class _Summary extends i.HTMLWidget{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag="div",this._drawStartPos="center",this.playInterval(this.playInterval())}lookupFieldIdx(t,e){let i=e;if(!(this[t+"_exists"]()&&(i=this.columns().indexOf(this[t]()),i<0)))return i}lookupFieldText(t,e){return this[t+"_exists"]()?this[t]():void 0!==e&&this.columns()[e]||""}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let t;this.hideLabel()||(t=this.lookupFieldIdx("labelColumn",0));const e=this.lookupFieldIdx("iconColumn"),i=this.lookupFieldIdx("valueColumn",1);let n,o;this.hideMore()||(n=this.lookupFieldIdx("moreIconColumn"),o=this.lookupFieldIdx("moreTextColumn"));const a=this.lookupFieldIdx("colorFillColumn"),s=this.lookupFieldIdx("colorStrokeColumn");return this.formattedData().map(function(r){return{icon:void 0===e?this.icon():r[e],label:void 0===t?"":r[t],value:r[i],moreIcon:void 0===n?this.hideMore()?"":this.moreIcon():r[n],moreText:void 0===o?this.hideMore()?"":this.moreText():r[o],fill:void 0===a?this.colorFill():r[a],stroke:void 0===s?this.colorStroke():r[s]}},this)}enter(t,e){super.enter(t,e),this._mainDiv=e.append("div");const i=this;this._headerDiv=this._mainDiv.append("h2").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}),this._textDiv=this._mainDiv.append("div").attr("class","text").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)})}update(t,e){super.update(t,e),this.data().length;const n=this.summaryData();this._playIntervalIdx>=n.length&&(this._playIntervalIdx=0);const o=this._playIntervalIdx<n.length?n[this._playIntervalIdx]:["",""];e.style("width",this.fixedSize()?this.minWidth_exists()?this.minWidth()+"px":null:"100%").style("height",this.fixedSize()?this.minHeight_exists()?this.minHeight()+"px":null:"100%"),this._mainDiv.attr("class","content bgIcon "+o.icon).transition().style("background-color",o.fill).style("color",o.stroke).style("min-width",this.minWidth_exists()?this.minWidth()+"px":null).style("min-height",this.minHeight_exists()?this.minHeight()+"px":null).style("font-size",this.iconFontSize()+"px"),this._headerDiv.transition().style("color",o.stroke).style("font-size",this.headerFontSize()+"px")[this.valueHTML()?is:es](o.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?is:es](o.label);const a=this,s=this._mainDiv.selectAll(".more").data([o]),r=s.enter().append("div").attr("class","more").on("click",function(t){a.click(a.rowToObj(a.currentRow()),a.lookupFieldText("moreTextColumn")||"more",!0)}).each(function(){const t=i.select(this);t.append("i"),t.append("span")}).merge(s).style("display",this.hideMoreWrapper()?"none":null).style("font-size",this.moreFontSize()+"px").style("height",this.moreWrapperHeight_exists()?this.moreWrapperHeight()+"px":null).transition().style("background-color",i.rgb(o.fill).darker(.75).toString());r.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?r.select("span").each(function(t){this.innerHTML=t.moreText}):r.select("span").text(t=>t.moreText),s.exit().remove()}exit(t,e){super.exit(t,e)}};a(ns,"Summary");let os=ns;os.prototype._class+=" chart_Summary",os.prototype.implements(e.I2DChart.prototype),os.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),os.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:a(t=>t.iconColumn(),"disable")}),os.prototype.publish("headerFontSize",null,"number","headerFontSize"),os.prototype.publish("textFontSize",null,"number","textFontSize"),os.prototype.publish("moreFontSize",null,"number","moreFontSize"),os.prototype.publish("iconFontSize",null,"number","iconFontSize"),os.prototype.publish("hideLabel",!1,"boolean","Hide label column"),os.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:a(t=>t.hideLabel(),"disable")}),os.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:a(t=>t.hideLabel(),"disable")}),os.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),os.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),os.prototype.publish("hideMore",!1,"boolean","Hide More Information"),os.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),os.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),os.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:a(t=>t.hideMore(),"disable")}),os.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:a(t=>t.hideMore()||t.moreIconColumn(),"disable")}),os.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:a(t=>t.hideMore(),"disable")}),os.prototype.publish("moreText","More Info","string","More text",null,{disable:a(t=>t.hideMore()||t.moreTextColumn(),"disable")}),os.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:a(t=>t.hideMore(),"disable")}),os.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),os.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:a(t=>t.colorFillColumn(),"disable")}),os.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),os.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:a(t=>t.colorStrokeColumn(),"disable")}),os.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),os.prototype.publish("minWidth",225,"number","Minimum Width"),os.prototype.publish("minHeight",150,"number","Minimum Height"),os.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const as=os.prototype.playInterval;os.prototype.playInterval=function(t){const e=as.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const ss=class _SummaryC extends i.CanvasWidget{_playIntervalIdx=0;constructor(){super(),e.I2DChart.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(t,e){super.enter.apply(this,arguments);const{width:i,height:n}=this.size();t.height=n,t.width=i}update(t,e){super.update.apply(this,arguments);const n=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);const o=this.size(),s=Math.min(o.width,o.height),r=this.fontSizeRatio(),l=this.columns().indexOf(this.labelColumn()),h=this.columns().indexOf(this.valueColumn()),c=this.columns().indexOf(this.colorFillColumn()),u=this.columns().indexOf(this.colorStrokeColumn()),p=this.columns().indexOf(this.iconColumn()),d=-1!==p?this.currentRow()[p]:this.icon(),f=-1!==l?this.currentRow()[l]:"",y=-1!==h?this.currentRow()[h]:"",_=-1!==c?this.currentRow()[c]:this.colorFill(),x=-1!==u?this.currentRow()[u]:this.colorStroke();let m=o.height*(r-this.paddingSizeRatio());const g=o.height*(1-r-this.paddingSizeRatio()),b=o.height*(this.iconSizeRatio()-this.paddingSizeRatio()),v=s*this.paddingSizeRatio(),w=t.getContext("2d");w.clearRect(0,0,o.width,o.height);const S=n.fontFamily();function A(t,e,i,n){w.textBaseline="top",w.font=`${i}px ${S}`,w.fillStyle=x;let a=w.measureText(t);if(a.width>o.width-2*v){i*=(o.width-2*v)/a.width,w.font=`${i}px ${S}`,a=w.measureText(t)}const s=M(a.width,n);return w.fillText(t,s,e),i}function k(t,e,i){if(void 0===t)return;w.textBaseline=n.iconBaseline(),w.font=`${e}px FontAwesome`,w.fillStyle=x;let a=w.measureText(t);if(a.width>o.width-2*v){const i=(o.width-2*v)/a.width;w.font=e*i+"px FontAwesome",a=w.measureText(t)}const s=M(a.width,i),r=T(n.iconBaseline());w.fillText(t,s,r)}function M(t,e){switch(e){case"start":return v;case"middle":return o.width/2-t/2;case"end":return o.width-t-v}}function T(t){switch(t){case"top":return v;case"middle":return o.height/2;case"bottom":return o.height-v}}w.fillStyle=_,w.fillRect(0,0,o.width,o.height),w.globalAlpha=this.iconOpacity(),k(i.Utility.faChar(d),b,n.iconAnchor()),w.globalAlpha=this.valueOpacity(),m=A(y,v,m,n.valueAnchor()),w.globalAlpha=this.labelOpacity(),A(f,m+v,g,n.labelAnchor()),a(A,"drawText"),a(k,"drawIcon"),a(M,"getTextOffsetX"),a(T,"getTextOffsetY")}};a(ss,"SummaryC");let rs=ss;rs.prototype._class+=" chart_SummaryC",rs.prototype.implements(e.I2DChart.prototype),rs.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),rs.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),rs.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),rs.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),rs.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),rs.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:a(t=>t.iconColumn(),"disable")}),rs.prototype.publish("fontFamily","Arial","string","Font Family"),rs.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),rs.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),rs.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),rs.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:a(t=>t.colorFillColumn(),"disable")}),rs.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),rs.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:a(t=>t.colorStrokeColumn(),"disable")}),rs.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),rs.prototype.publish("minWidth",225,"number","Minimum Width"),rs.prototype.publish("minHeight",150,"number","Minimum Height"),rs.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),rs.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),rs.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),rs.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),rs.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),rs.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),rs.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const ls=rs.prototype.playInterval;rs.prototype.playInterval=function(t){const e=ls.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const hs=Math.PI/180,cs=2048;function us(){const t=i.dispatch("word","end"),e={};let n=[256,256],o=ps,s=ds,r=ys,l=fs,h=fs,c=_s,u=xs,p=[],d=ws,f=1/0,y=null,_=Math.random,x=ks;function m(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=cs/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function g(t,e,i){const o=e.x,a=e.y,s=Math.sqrt(n[0]*n[0]+n[1]*n[1]),r=d(n),l=_()<.5?1:-1;let h,c,u,p=-l;for(;(h=r(p+=l))&&(c=~~h[0],u=~~h[1],!(Math.min(Math.abs(c),Math.abs(u))>=s));)if(e.x=o+c,e.y=a+u,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>n[0]||e.y+e.y1>n[1])&&(!i||!gs(e,t,n[0]))&&(!i||vs(e,i))){const i=e.sprite,o=e.width>>5,a=n[0]>>5,s=e.x-(o<<4),r=127&s,l=32-r,h=e.y1-e.y0;let c,u=(e.y+e.y0)*a+(s>>5);for(let e=0;e<h;e++){c=0;for(let n=0;n<=o;n++)t[u+n]|=c<<l|(n<o?(c=i[e*o+n])>>>r:0);u+=a}return delete e.sprite,!0}return!1}return e.canvas=function(t){return arguments.length?(x=Ms(t),e):x},e.start=function(){const i=m(x()),a=As((n[0]>>5)*n[1]);let d=null;const b=p.length;let v=-1;const w=[],S=p.map(function(t,e){return t.text=o.call(this,t,e),t.font=s.call(this,t,e),t.style=l.call(this,t,e),t.weight=h.call(this,t,e),t.rotate=c.call(this,t,e),t.size=~~r.call(this,t,e),t.padding=u.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return y&&clearInterval(y),y=setInterval(A,0),A(),e;function A(){const o=Date.now();for(;Date.now()-o<f&&++v<b&&y;){const o=S[v];o.x=n[0]*(_()+.5)>>1,o.y=n[1]*(_()+.5)>>1,ms(i,o,S,v),o.hasText&&g(a,o,d)&&(w.push(o),t.call("word",e,o),d?bs(d,o):d=[{x:o.x+o.x0,y:o.y+o.y0},{x:o.x+o.x1,y:o.y+o.y1}],o.x-=n[0]>>1,o.y-=n[1]>>1)}v>=b&&(e.stop(),t.call("end",e,w,d))}},e.stop=function(){return y&&(clearInterval(y),y=null),e},a(m,"getContext"),a(g,"place"),e.timeInterval=function(t){return arguments.length?(f=null==t?1/0:t,e):f},e.words=function(t){return arguments.length?(p=t,e):p},e.size=function(t){return arguments.length?(n=[+t[0],+t[1]],e):n},e.font=function(t){return arguments.length?(s=Ms(t),e):s},e.fontStyle=function(t){return arguments.length?(l=Ms(t),e):l},e.fontWeight=function(t){return arguments.length?(h=Ms(t),e):h},e.rotate=function(t){return arguments.length?(c=Ms(t),e):c},e.text=function(t){return arguments.length?(o=Ms(t),e):o},e.spiral=function(t){return arguments.length?(d=Ts[t]||t,e):d},e.fontSize=function(t){return arguments.length?(r=Ms(t),e):r},e.padding=function(t){return arguments.length?(u=Ms(t),e):u},e.random=function(t){return arguments.length?(_=t,e):_},e.on=function(){const i=t.on.apply(t,arguments);return i===t?e:i},e}function ps(t){return t.text}function ds(){return"serif"}function fs(){return"normal"}function ys(t){return Math.sqrt(t.value)}function _s(){return 30*(~~(6*Math.random())-3)}function xs(){return 1}function ms(t,e,i,n){if(e.sprite)return;const o=t.context,a=t.ratio;o.clearRect(0,0,2048/a,cs/a);let s=0,r=0,l=0;const h=i.length;for(--n;++n<h;){e=i[n],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=o.measureText(e.text+"m").width*a,h=e.size<<1;if(e.rotate){const i=Math.sin(e.rotate*hs),n=Math.cos(e.rotate*hs),o=t*n,a=t*i,s=h*n,r=h*i;t=Math.max(Math.abs(o+r),Math.abs(o-r))+31>>5<<5,h=~~Math.max(Math.abs(a+s),Math.abs(a-s))}else t=t+31>>5<<5;if(h>l&&(l=h),s+t>=2048&&(s=0,r+=l,l=0),r+h>=cs)break;o.translate((s+(t>>1))/a,(r+(h>>1))/a),e.rotate&&o.rotate(e.rotate*hs),o.fillText(e.text,0,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,0,0)),o.restore(),e.width=t,e.height=h,e.xoff=s,e.yoff=r,e.x1=t>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=t}const c=o.getImageData(0,0,2048/a,cs/a).data,u=[];for(;--n>=0;){if(!(e=i[n]).hasText)continue;const t=e.width,o=t>>5;let a=e.y1-e.y0;for(let e=0;e<a*o;e++)u[e]=0;if(s=e.xoff,null==s)return;r=e.yoff;let l=0,h=-1;for(let i=0;i<a;i++){for(let e=0;e<t;e++){const t=o*i+(e>>5),n=c[2048*(r+i)+(s+e)<<2]?1<<31-e%32:0;u[t]|=n,l|=n}l?h=i:(e.y0++,a--,i--,r++)}e.y1=e.y0+h,e.sprite=u.slice(0,(e.y1-e.y0)*o)}}function gs(t,e,i){i>>=5;const n=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,r=32-s,l=t.y1-t.y0;let h,c=(t.y+t.y0)*i+(a>>5);for(let u=0;u<l;u++){h=0;for(let t=0;t<=o;t++)if((h<<r|(t<o?(h=n[u*o+t])>>>s:0))&e[c+t])return!0;c+=i}return!1}function bs(t,e){const i=t[0],n=t[1];e.x+e.x0<i.x&&(i.x=e.x+e.x0),e.y+e.y0<i.y&&(i.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function vs(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function ws(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Ss(t){const e=4*t[0]/t[1];let i=0,n=0;return function(t){const o=t<0?-1:1;switch(Math.sqrt(1+4*o*t)-o&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}function As(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function ks(){return document.createElement("canvas")}function Ms(t){return"function"==typeof t?t:function(){return t}}a(us,"d3Cloud"),a(ps,"cloudText"),a(ds,"cloudFont"),a(fs,"cloudFontNormal"),a(ys,"cloudFontSize"),a(_s,"cloudRotate"),a(xs,"cloudPadding"),a(ms,"cloudSprite"),a(gs,"cloudCollide"),a(bs,"cloudBounds"),a(vs,"collideRects"),a(ws,"archimedeanSpiral"),a(Ss,"rectangularSpiral"),a(As,"zeroArray"),a(ks,"cloudCanvas"),a(Ms,"functor");const Ts={archimedean:ws,rectangular:Ss},Ps=class _WordCloud extends i.SVGWidget{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),e.I2DChart.call(this),e.ITooltip.call(this),i.Utility.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(t=>({__viz_label:t[0],__viz_weight:t[1],__viz_row:t}))}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._root=e.append("g"),this._canvas=document.createElement("canvas");const n=this;this._d3Zoom=i.zoom().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=i.d3Event();e&&e.transform&&n.zoomed(n._d3Zoom,[e.transform.x,e.transform.y],e.transform.k)}),e.call(this._d3Zoom),this.tooltipHTML(function(t){const e=n.columns(),i=e&&e.length?e[0]:"Word";return n.tooltipFormat({label:t.__viz_label,series:i,value:t.__viz_weight})})}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Cloud=us().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const n=this.calcData(),o=this,s=i.extent(n,function(t){return t.__viz_weight});let r;switch(this.scaleMode()){case"log":r=i.scaleLog;break;case"sqrt":r=i.scaleSqrt;break;case"pow":r=i.scalePow;break;default:r=i.scaleLinear}const l=r().domain(s).range([this.fontSizeFrom(),this.fontSizeTo()]),h=i.scaleLinear().domain([0,o.angleCount()-1]).range([o.angleFrom(),o.angleTo()]);function c(t,e){const i=o._root.selectAll("text").data(t,function(t){return t.__viz_label?t.__viz_label.toLowerCase():""});i.enter().append("text").attr("text-anchor","middle").call(o._selection.enter.bind(o._selection)).text(function(t){return t.__viz_label}).on("click",function(t){o.click(o.rowToObj(t.__viz_row),o.columns()[1],o._selection.selected(this))}).on("dblclick",function(t){o.dblclick(o.rowToObj(t.__viz_row),o.columns()[1],o._selection.selected(this))}).on("mouseout.tooltip",o.tooltip.hide).on("mousemove.tooltip",o.tooltip.show).style("opacity",1e-6).merge(i).style("font-size",function(t){return l(t.__viz_weight)+"px"}).style("font-family",o.fontFamily()).transition().duration(1e3).attr("transform",function(t){return"translate("+[t.x,t.y]+")rotate("+t.rotate+")"}).style("fill",function(t){return o._palette(t.__viz_label?t.__viz_label.toLowerCase():"")}).style("opacity",1),i.exit().transition().duration(1e3).style("opacity",1e-4).remove()}this._d3Cloud.stop().size([this.width(),this.height()]).words(n).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(t){return t.__viz_label.trim()}).fontSize(function(t){return l(t.__viz_weight)}).rotate((t,e)=>h(e%o.angleCount())).on("word",t=>{}).on("end",c).start(),a(c,"draw")}zoomed(t,e,i){if(e[0]!==this._prevOffsetX||e[1]!==this._prevOffsetY||i!==this._prevZoom){switch(this._root.attr("transform",e),t){case this:break;case this._d3Zoom:this.offsetX(e[0]),this.offsetY(e[1]),this.zoom(i)}this._prevOffsetX=e[0],this._prevOffsetY=e[1],this._prevZoom=i}}};a(Ps,"WordCloud"),s(Ps,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Cs=Ps;function Is(){const t=i.timeFormat(".%L"),e=i.timeFormat(":%S"),n=i.timeFormat("%H:%M"),o=i.timeFormat("%H:00"),a=i.timeFormat("%b %d"),s=i.timeFormat("%b"),r=i.timeFormat("%Y");return i=>0!==i.getMilliseconds()?t(i):0!==i.getSeconds()?e(i):0!==i.getMinutes()?n(i):0!==i.getHours()?o(i):1!==i.getDate()?a(i):0!==i.getMonth()?s(i):r(i)}Cs.prototype._class+=" chart_WordCloud",Cs.prototype.implements(e.I2DChart.prototype),Cs.prototype.implements(e.ITooltip.prototype),Cs.prototype.mixin(i.Utility.SimpleSelectionMixin),Cs.prototype.publish("paletteID","default","set","Color palette for this widget",Cs.prototype._palette.switch(),{tags:["Basic","Shared"]}),Cs.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Cs.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),Cs.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),Cs.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),Cs.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),Cs.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),Cs.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),Cs.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),Cs.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),Cs.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),Cs.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),Cs.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),Cs.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),a(Is,"multiScale24Hours"),t.Area=Et,t.Axis=Pt,t.BUILD_VERSION="3.24.0",t.Bar=jt,t.Bubble=Ie,t.BubbleXY=Fe,t.Bullet=ni,t.Column=Ot,t.Contour=jn,t.Gantt=Bn,t.Gauge=va,t.HalfPie=Ta,t.Heat=Ca,t.HexBin=Na,t.Line=La,t.PKG_NAME="@hpcc-js/chart",t.PKG_VERSION="3.7.8",t.Pie=ka,t.QuarterPie=$a,t.QuartileCandlestick=Va,t.Radar=Wa,t.RadialBar=Xa,t.Scatter=Ft,t.StatChart=Ja,t.Step=ts,t.Summary=os,t.SummaryC=rs,t.WordCloud=Cs,t.XYAxis=It,t.multiScale24Hours=Is,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/api"),require("@hpcc-js/common"),require("@hpcc-js/util")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/api`,`@hpcc-js/common`,`@hpcc-js/util`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/chart`]={},e[`@hpcc-js/api`],e[`@hpcc-js/common`],e[`@hpcc-js/util`]))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.defineProperty,__name=(e,t)=>i(e,`name`,{value:t,configurable:!0}),a=`@hpcc-js/chart`,o=`3.8.0`,s=`3.26.0`,c=Math.PI,l=2*c,u=1e-6,d=l-u;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function path(){return new Path}Path.prototype=path.prototype={constructor:Path,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,l=r-t,d=a-e,f=o-t,p=d*d+f*f;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(p>u)if(!(Math.abs(f*s-l*d)>u)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var m=n-a,h=r-o,g=s*s+l*l,_=m*m+h*h,v=Math.sqrt(g),b=Math.sqrt(p),S=i*Math.tan((c-Math.acos((g+p-_)/(2*v*b)))/2),C=S/b,w=S/v;Math.abs(C-1)>u&&(this._+=`L`+(e+C*d)+`,`+(t+C*f)),this._+=`A`+i+`,`+i+`,0,0,`+ +(f*m>d*h)+`,`+(this._x1=e+w*s)+`,`+(this._y1=t+w*l)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),f=e+o,p=t+s,m=1^a,h=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+f+`,`+p:(Math.abs(this._x1-f)>u||Math.abs(this._y1-p)>u)&&(this._+=`L`+f+`,`+p),n&&(h<0&&(h=h%l+l),h>d?this._+=`A`+n+`,`+n+`,0,1,`+m+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+m+`,`+(this._x1=f)+`,`+(this._y1=p):h>u&&(this._+=`A`+n+`,`+n+`,0,`+ +(h>=c)+`,`+m+`,`+(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._}};function constant_default$3(e){return function constant(){return e}}__name(constant_default$3,`default`);var f=Math.abs,p=Math.atan2,m=Math.cos,h=Math.max,g=Math.min,_=Math.sin,v=Math.sqrt,b=Math.PI,S=b/2,C=2*b;function acos(e){return e>1?0:e<-1?b:Math.acos(e)}function asin$1(e){return e>=1?S:e<=-1?-S:Math.asin(e)}__name(asin$1,`asin`);function arcInnerRadius$1(e){return e.innerRadius}__name(arcInnerRadius$1,`arcInnerRadius`);function arcOuterRadius$1(e){return e.outerRadius}__name(arcOuterRadius$1,`arcOuterRadius`);function arcStartAngle$1(e){return e.startAngle}__name(arcStartAngle$1,`arcStartAngle`);function arcEndAngle$1(e){return e.endAngle}__name(arcEndAngle$1,`arcEndAngle`),__name(arc_default$1,`default`);function arcPadAngle$1(e){return e&&e.padAngle}__name(arcPadAngle$1,`arcPadAngle`);function intersect$1(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}__name(intersect$1,`intersect`);function cornerTangents$1(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/v(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,g=r+d,_=(f+m)/2,b=(p+g)/2,S=m-f,C=g-p,w=S*S+C*C,T=i-a,E=f*g-m*p,D=(C<0?-1:1)*v(h(0,T*T*w-E*E)),O=(E*C-S*D)/w,k=(-E*S-C*D)/w,A=(E*C+S*D)/w,j=(-E*S+C*D)/w,M=O-_,N=k-b,P=A-_,F=j-b;return M*M+N*N>P*P+F*F&&(O=A,k=j),{cx:O,cy:k,x01:-u,y01:-d,x11:O*(i/T-1),y11:k*(i/T-1)}}__name(cornerTangents$1,`cornerTangents`);function arc_default$1(){var e=arcInnerRadius$1,t=arcOuterRadius$1,n=constant_default$3(0),r=null,i=arcStartAngle$1,a=arcEndAngle$1,o=arcPadAngle$1,s=null;function arc(){var c,l,u=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-S,w=a.apply(this,arguments)-S,T=f(w-h),E=w>h;if(s||=c=path(),d<u&&(l=d,d=u,u=l),!(d>1e-12))s.moveTo(0,0);else if(T>C-1e-12)s.moveTo(d*m(h),d*_(h)),s.arc(0,0,d,h,w,!E),u>1e-12&&(s.moveTo(u*m(w),u*_(w)),s.arc(0,0,u,w,h,E));else{var D=h,O=w,k=h,A=w,j=T,M=T,N=o.apply(this,arguments)/2,P=N>1e-12&&(r?+r.apply(this,arguments):v(u*u+d*d)),F=g(f(d-u)/2,+n.apply(this,arguments)),I=F,L=F,R,z;if(P>1e-12){var B=asin$1(P/u*_(N)),V=asin$1(P/d*_(N));(j-=B*2)>1e-12?(B*=E?1:-1,k+=B,A-=B):(j=0,k=A=(h+w)/2),(M-=V*2)>1e-12?(V*=E?1:-1,D+=V,O-=V):(M=0,D=O=(h+w)/2)}var H=d*m(D),U=d*_(D),ee=u*m(A),te=u*_(A);if(F>1e-12){var W=d*m(O),G=d*_(O),ne=u*m(k),re=u*_(k),K;if(T<b&&(K=intersect$1(H,U,ne,re,W,G,ee,te))){var ie=H-K[0],ae=U-K[1],oe=W-K[0],se=G-K[1],ce=1/_(acos((ie*oe+ae*se)/(v(ie*ie+ae*ae)*v(oe*oe+se*se)))/2),le=v(K[0]*K[0]+K[1]*K[1]);I=g(F,(u-le)/(ce-1)),L=g(F,(d-le)/(ce+1))}}M>1e-12?L>1e-12?(R=cornerTangents$1(ne,re,H,U,d,L,E),z=cornerTangents$1(W,G,ee,te,d,L,E),s.moveTo(R.cx+R.x01,R.cy+R.y01),L<F?s.arc(R.cx,R.cy,L,p(R.y01,R.x01),p(z.y01,z.x01),!E):(s.arc(R.cx,R.cy,L,p(R.y01,R.x01),p(R.y11,R.x11),!E),s.arc(0,0,d,p(R.cy+R.y11,R.cx+R.x11),p(z.cy+z.y11,z.cx+z.x11),!E),s.arc(z.cx,z.cy,L,p(z.y11,z.x11),p(z.y01,z.x01),!E))):(s.moveTo(H,U),s.arc(0,0,d,D,O,!E)):s.moveTo(H,U),!(u>1e-12)||!(j>1e-12)?s.lineTo(ee,te):I>1e-12?(R=cornerTangents$1(ee,te,W,G,u,-I,E),z=cornerTangents$1(H,U,ne,re,u,-I,E),s.lineTo(R.cx+R.x01,R.cy+R.y01),I<F?s.arc(R.cx,R.cy,I,p(R.y01,R.x01),p(z.y01,z.x01),!E):(s.arc(R.cx,R.cy,I,p(R.y01,R.x01),p(R.y11,R.x11),!E),s.arc(0,0,u,p(R.cy+R.y11,R.cx+R.x11),p(z.cy+z.y11,z.cx+z.x11),E),s.arc(z.cx,z.cy,I,p(z.y11,z.x11),p(z.y01,z.x01),!E))):s.arc(0,0,u,A,k,E)}if(s.closePath(),c)return s=null,c+``||null}return arc.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-b/2;return[m(r)*n,_(r)*n]},arc.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$3(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),arc):n},arc.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default$3(+e),arc):r},arc.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default$3(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:constant_default$3(+e),arc):o},arc.context=function(e){return arguments.length?(s=e??null,arc):s},arc}function Linear$1(e){this._context=e}__name(Linear$1,`Linear`),Linear$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}},__name(linear_default$1,`default`);function linear_default$1(e){return new Linear$1(e)}function x$1(e){return e[0]}__name(x$1,`x`);function y$1(e){return e[1]}__name(y$1,`y`);function line_default$1(){var e=x$1,t=y$1,n=constant_default$3(!0),r=null,i=linear_default$1,a=null;function line(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=path())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return line.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),line):e},line.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$3(+e),line):t},line.defined=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(!!e),line):n},line.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),line):i},line.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),line):r},line}__name(line_default$1,`default`);function area_default$1(){var e=x$1,t=null,n=constant_default$3(0),r=y$1,i=constant_default$3(!0),a=null,o=linear_default$1,s=null;function area(c){var l,u,d,f=c.length,p,m=!1,h,g=Array(f),_=Array(f);for(a??(s=o(h=path())),l=0;l<=f;++l){if(!(l<f&&i(p=c[l],l,c))===m)if(m=!m)u=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=l-1;d>=u;--d)s.point(g[d],_[d]);s.lineEnd(),s.areaEnd()}m&&(g[l]=+e(p,l,c),_[l]=+n(p,l,c),s.point(t?+t(p,l,c):g[l],r?+r(p,l,c):_[l]))}if(h)return s=null,h+``||null}function arealine(){return line_default$1().defined(i).curve(o).context(a)}return area.x=function(n){return arguments.length?(e=typeof n==`function`?n:constant_default$3(+n),t=null,area):e},area.x0=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),area):e},area.x1=function(e){return arguments.length?(t=e==null?null:typeof e==`function`?e:constant_default$3(+e),area):t},area.y=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),r=null,area):n},area.y0=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),area):n},area.y1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default$3(+e),area):r},area.lineX0=area.lineY0=function(){return arealine().x(e).y(n)},area.lineY1=function(){return arealine().x(e).y(r)},area.lineX1=function(){return arealine().x(t).y(n)},area.defined=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(!!e),area):i},area.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),area):o},area.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),area):a},area}__name(area_default$1,`default`);function descending_default(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}__name(descending_default,`default`);function identity_default$2(e){return e}__name(identity_default$2,`default`);function pie_default(){var e=identity_default$2,t=descending_default,n=null,r=constant_default$3(0),i=constant_default$3(C),a=constant_default$3(0);function pie(o){var s,c=o.length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),h=Math.min(C,Math.max(-C,i.apply(this,arguments)-m)),g,_=Math.min(Math.abs(h)/c,a.apply(this,arguments)),v=_*(h<0?-1:1),b;for(s=0;s<c;++s)(b=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=b);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(h-c*v)/d:0;s<c;++s,m=g)l=f[s],b=p[l],g=m+(b>0?b*u:0)+v,p[l]={data:o[l],index:s,value:b,startAngle:m,endAngle:g,padAngle:_};return p}return pie.value=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),pie):e},pie.sortValues=function(e){return arguments.length?(t=e,n=null,pie):t},pie.sort=function(e){return arguments.length?(n=e,t=null,pie):n},pie.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$3(+e),pie):r},pie.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(+e),pie):i},pie.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default$3(+e),pie):a},pie}__name(pie_default,`default`);function point$7(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}__name(point$7,`point`);function Basis$1(e){this._context=e}__name(Basis$1,`Basis`),__name(basis_default,`default`),Basis$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$7(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$7(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function basis_default(e){return new Basis$1(e)}function Bundle$1(e,t){this._basis=new Basis$1(e),this._beta=t}__name(Bundle$1,`Bundle`),Bundle$1.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var w=(function custom(e){function bundle(t){return e===1?new Basis$1(t):new Bundle$1(t,e)}return bundle.beta=function(e){return custom(+e)},bundle})(.85);function point$6(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}__name(point$6,`point`);function Cardinal$1(e,t){this._context=e,this._k=(1-t)/6}__name(Cardinal$1,`Cardinal`),Cardinal$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$6(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:point$6(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var T=(function custom(e){function cardinal(t){return new Cardinal$1(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function point$5(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}__name(point$5,`point`);function CatmullRom$1(e,t){this._context=e,this._alpha=t}__name(CatmullRom$1,`CatmullRom`),CatmullRom$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:point$5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var E=(function custom(e){function catmullRom(t){return e?new CatmullRom$1(t,e):new Cardinal$1(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function sign$1(e){return e<0?-1:1}__name(sign$1,`sign`);function slope3$1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sign$1(a)+sign$1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}__name(slope3$1,`slope3`);function slope2$1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}__name(slope2$1,`slope2`);function point$4(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}__name(point$4,`point`);function MonotoneX$1(e){this._context=e}__name(MonotoneX$1,`MonotoneX`),MonotoneX$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point$4(this,this._t0,slope2$1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,point$4(this,slope2$1(this,n=slope3$1(this,e,t)),n);break;default:point$4(this,this._t0,n=slope3$1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MonotoneY$1(e){this._context=new ReflectContext$1(e)}__name(MonotoneY$1,`MonotoneY`),(MonotoneY$1.prototype=Object.create(MonotoneX$1.prototype)).point=function(e,t){MonotoneX$1.prototype.point.call(this,t,e)};function ReflectContext$1(e){this._context=e}__name(ReflectContext$1,`ReflectContext`),ReflectContext$1.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function monotoneX(e){return new MonotoneX$1(e)}function Natural$1(e){this._context=e}__name(Natural$1,`Natural`),Natural$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=controlPoints$1(e),i=controlPoints$1(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function controlPoints$1(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}__name(natural_default,`default`),__name(controlPoints$1,`controlPoints`);function natural_default(e){return new Natural$1(e)}function Step$2(e,t){this._context=e,this._t=t}__name(Step$2,`Step`),Step$2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}},__name(step_default,`default`);function step_default(e){return new Step$2(e,.5)}function stepBefore(e){return new Step$2(e,0)}function stepAfter(e){return new Step$2(e,1)}var D=Array.prototype.slice;function identity_default$1(e){return e}__name(identity_default$1,`default`);var O=1,k=2,A=3,j=4,M=1e-6;function translateX(e){return`translate(`+(e+.5)+`,0)`}function translateY(e){return`translate(0,`+(e+.5)+`)`}function number(e){return function(t){return+e(t)}}function center(e){var t=Math.max(0,e.bandwidth()-1)/2;return e.round()&&(t=Math.round(t)),function(n){return+e(n)+t}}function entering(){return!this.__axis}function axis(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=e===O||e===j?-1:1,l=e===j||e===k?`x`:`y`,u=e===O||e===A?translateX:translateY;function axis(d){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),p=i??(t.tickFormat?t.tickFormat.apply(t,n):identity_default$1),m=Math.max(a,0)+s,h=t.range(),g=+h[0]+.5,_=+h[h.length-1]+.5,v=(t.bandwidth?center:number)(t.copy()),b=d.selection?d.selection():d,S=b.selectAll(`.domain`).data([null]),C=b.selectAll(`.tick`).data(f,t).order(),w=C.exit(),T=C.enter().append(`g`).attr(`class`,`tick`),E=C.select(`line`),D=C.select(`text`);S=S.merge(S.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),C=C.merge(T),E=E.merge(T.append(`line`).attr(`stroke`,`currentColor`).attr(l+`2`,c*a)),D=D.merge(T.append(`text`).attr(`fill`,`currentColor`).attr(l,c*m).attr(`dy`,e===O?`0em`:e===A?`0.71em`:`0.32em`)),d!==b&&(S=S.transition(d),C=C.transition(d),E=E.transition(d),D=D.transition(d),w=w.transition(d).attr(`opacity`,M).attr(`transform`,function(e){return isFinite(e=v(e))?u(e):this.getAttribute(`transform`)}),T.attr(`opacity`,M).attr(`transform`,function(e){var t=this.parentNode.__axis;return u(t&&isFinite(t=t(e))?t:v(e))})),w.remove(),S.attr(`d`,e===j||e==k?o?`M`+c*o+`,`+g+`H0.5V`+_+`H`+c*o:`M0.5,`+g+`V`+_:o?`M`+g+`,`+c*o+`V0.5H`+_+`V`+c*o:`M`+g+`,0.5H`+_),C.attr(`opacity`,1).attr(`transform`,function(e){return u(v(e))}),E.attr(l+`2`,c*a),D.attr(l,c*m).text(p),b.filter(entering).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===k?`start`:e===j?`end`:`middle`),b.each(function(){this.__axis=v})}return axis.scale=function(e){return arguments.length?(t=e,axis):t},axis.ticks=function(){return n=D.call(arguments),axis},axis.tickArguments=function(e){return arguments.length?(n=e==null?[]:D.call(e),axis):n.slice()},axis.tickValues=function(e){return arguments.length?(r=e==null?null:D.call(e),axis):r&&r.slice()},axis.tickFormat=function(e){return arguments.length?(i=e,axis):i},axis.tickSize=function(e){return arguments.length?(a=o=+e,axis):a},axis.tickSizeInner=function(e){return arguments.length?(a=+e,axis):a},axis.tickSizeOuter=function(e){return arguments.length?(o=+e,axis):o},axis.tickPadding=function(e){return arguments.length?(s=+e,axis):s},axis}function axisTop(e){return axis(O,e)}function axisRight(e){return axis(k,e)}function axisBottom(e){return axis(A,e)}function axisLeft(e){return axis(j,e)}var Axis=class extends n.SVGWidget{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(e=`origin`){super(),this._drawStartPos=e,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(e,t){if(e instanceof Array)return e.map(function(e){return this.parse(e)},this);if(e!=null){if(this.parser)return this.parser(typeof e==`number`?e.toString():e);if(t&&typeof e==`string`)return+e}return e}parseInvert(e){return e instanceof Array?e.map(function(e){return this.parseInvert(e)},this):this.parserInvert&&e?this.parserInvert(e):e}format(e){return e instanceof Array?e.map(function(e){return this.format(e)},this):e!=null&&this.formatter?this.formatter(e):e}parseFormat(e){return this.format(this.parse(e))}tickFormatFunc(e){return arguments.length?(this._tickFormatFunc=e,this.updateScale(),this):this._tickFormatFunc}scalePos(e){let t=this.d3Scale(this.parse(e));return this.type()===`ordinal`&&(t+=this.bandwidth()/2),t}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case`left`:case`right`:return!1;default:}return!0}domain(e){return arguments.length?(this.d3Scale.domain(e),this):this.d3Scale.domain()}range(e){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(e,.1):this.d3Scale.rangeRound&&this.d3Scale.range(e),this}invert(e){return this.d3Scale.invert(e)}guideTarget(e){return this._guideElement=(0,n.select)(e).attr(`class`,this._class),this}enter(e,t){super.enter(e,t),this.svg=t.append(`g`),this.svgAxis=this.svg.append(`g`).attr(`class`,`axis`),this.svgGuides=(this._guideElement||t).append(`g`).attr(`class`,`guide`)}_prevOrientation;updateScale(){switch(this.type()){case`ordinal`:if(this.d3Scale=(0,n.scaleBand)().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){let e=this.ordinalMappings();this.formatter=t=>e[t]||t}else this.formatter=null;break;case`linear`:this.d3Scale=(0,n.scaleLinear)(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,n.format)(this.tickFormat()):null;break;case`pow`:this.d3Scale=(0,n.scalePow)().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,n.format)(this.tickFormat()):null;break;case`log`:this.d3Scale=(0,n.scaleLog)().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,n.format)(this.tickFormat()):null;break;case`time`:this.d3Scale=(0,n.scaleTime)(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?(0,n.timeParse)(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?(0,n.timeFormat)(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?(0,n.timeFormat)(this.tickFormat()):null;break;default:}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case`left`:this.d3Axis=axisLeft(this.d3Scale),this.d3Guides=axisLeft(this.d3Scale);break;case`top`:this.d3Axis=axisTop(this.d3Scale),this.d3Guides=axisTop(this.d3Scale);break;case`right`:this.d3Axis=axisRight(this.d3Scale),this.d3Guides=axisRight(this.d3Scale);break;default:this.d3Axis=axisBottom(this.d3Scale),this.d3Guides=axisBottom(this.d3Scale);break}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(``),this.svgGuides&&this.svgGuides.html(``)}if(this.extend())switch(this.type()){case`ordinal`:break;default:let e,t,n,r,i,a;this.isHorizontal()?(e=this.width(),this.d3Scale.range([0,e]),t=e*this.extend()/100,n=this.d3Scale.invert(0),i=this.d3Scale.invert(-t),r=this.d3Scale.invert(e),a=this.d3Scale.invert(e+t)):(e=this.height(),this.d3Scale.range([e,0]),t=e*this.extend()/100,n=this.d3Scale.invert(e),i=this.d3Scale.invert(e+t),r=this.d3Scale.invert(0),a=this.d3Scale.invert(-t)),i===n&&(i=n-n*this.extend()/100),a===r&&(a=r+r*this.extend()/100),Math.sign(n)!==Math.sign(i)&&(i=0),Math.sign(r)!==Math.sign(a)&&(a=0),this.d3Scale.domain([i,a]);break}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat(``).ticks(this.tickCount());let e=this.ticks();return e.length&&(this.d3Axis.tickValues(e.map(e=>this.parse(e.value))).tickFormat((t,n)=>e[n].label),this.d3Guides.tickValues(e.map(e=>this.parse(e.value)))),this}adjustText(e,t){let r=this.isHorizontal(),i=this.orientation()===`left`,a=this.orientation()===`bottom`,o=this,s=e.selectAll(`.tick > text`).style(`font-family`,this.fontFamily()).style(`font-size`,this.fontSize_exists()?this.fontSize()+`px`:null);if(this.overlapMode()===`linebreak`)this.type()===`ordinal`&&s.call(function(){return o.linebreak.apply(o,arguments)},this.bandwidth());else if(this.overlapMode()===`wrap`)this.type()===`ordinal`&&s.call(function(){return o.wrap.apply(o,arguments)},this.bandwidth());else switch(r?this.overlapMode():`none`){case`stagger`:s.style(`text-anchor`,`middle`).attr(`dy`,function(e,n){return(a?1:-1)*((a?.71:0)+n%t)+`em`}).attr(`dx`,0).attr(`visibility`,null).attr(`transform`,`rotate(0)`);break;case`hide`:s.style(`text-anchor`,`middle`).attr(`dy`,(a?.71:0)+`em`).attr(`dx`,0).attr(`visibility`,function(e,n){return n%t?`hidden`:null}).attr(`transform`,`rotate(0)`);break;case`rotate`:let e=-this.labelRotation()||0;if(e!==0&&t>1){s.each(function(){let t=(0,n.select)(this),r=t.node().getBBox(),i=(a?1:-1)*Math.sin(Math.PI*(-Math.abs(e)/180));t.style(`text-anchor`,e>0?a?`start`:`end`:a?`end`:`start`).attr(`dy`,r.height/2*i+`px`).attr(`dx`,e>0?a?`0.71em`:`-0.71em`:a?`-0.71em`:`0.71em`).attr(`transform`,`rotate(`+e+`)`).attr(`visibility`,null)});break}default:s.style(`text-anchor`,r?`middle`:i?`end`:`start`).attr(`dy`,r?(a?.71:0)+`em`:`0.32em`).attr(`dx`,0).attr(`visibility`,null).attr(`transform`,`rotate(0)`)}}calcTickOverlapModulus(e){let t=1;switch(this.overlapMode()){case`rotate`:case`stagger`:case`hide`:let n=[];e.selectAll(`.tick > text`).each(function(){let e=this.getBoundingClientRect();for(let r=n.length-1;r>=0&&!(n[r].right<e.left);--r)n.length+1-r>t&&(t=n.length+1-r);n.push(e)});break;default:}return t}calcOverflow(e,t){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};let n=this.isHorizontal();this.range(n?[0,this.width()]:[this.height(),0]);let r=e.append(`g`).attr(`class`,this.classID()),i=r.append(`g`);i.attr(`class`,n?`x`:`y`).call(this.d3Axis),t&&e.selectAll(`.tick > text`).remove();let a={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(i)};this.adjustText(i,a.tickOverlapModulus);let o=i.node().getBBox();switch(a.depth=n?o.height:o.width,this.shrinkToFit()){case`low`:case`both`:a.left=n?-o.x:0,a.bottom=n?0:-(this.height()-(o.height+o.y));break;default:}switch(this.shrinkToFit()){case`high`:case`both`:a.top=n?0:-o.y,a.right=n?-(this.width()-o.x-o.width):0;break;default:}return r.remove(),a}wrap(e,t,r){r||=/\s+/;let i=this;e.each(function(){let e=(0,n.select)(this),a=e.text().split(r).reverse(),o=[],s=0,c=1.1,l=e.attr(`x`),u=e.attr(`y`),d=parseFloat(e.style(`font-size`))||10,f=Math.floor(t/(d*c))-1,p=i.isHorizontal()?1:Math.ceil(a.length/f),m=parseFloat(e.attr(`dy`)),h=e.text(null).append(`tspan`).attr(`x`,l).attr(`y`,u).attr(`dy`,m+`em`),g=0,_=a.pop();for(;_;)o.push(_),h.text(o.join(` `)),g++,h.node().getComputedTextLength()>t&&g>=p&&(o.pop(),h.text(o.join(` `)),o=[_],h=e.append(`tspan`).attr(`x`,l).attr(`y`,u).attr(`dy`,++s*c+m+`em`).text(_),g=0),_=a.pop();i.isHorizontal()||e.selectAll(`tspan`).attr(`y`,-s/2+`em`)})}linebreak(e,t){this.wrap(e,t,`
|
|
2
|
+
`)}update(e,t){super.update(e,t),this.svg.style(`display`,this.hidden()?`none`:null);let n=this.calcOverflow(t),r=this.isHorizontal()?n.left:this.height()-n.top-n.bottom,i=this.isHorizontal()?this.width()-n.right-this.padding():0+this.padding();this.range(this.reverse()?[i,r]:[r,i]);let a=this;function doPosition(e){e.attr(`transform`,function(){switch(a.orientation()){case`left`:return`translate(`+n.depth+`, `+n.top+`)`;case`top`:return`translate(0,`+n.depth+`)`;case`right`:return`translate(`+(a.width()-n.depth)+`, `+n.top+`)`;case`bottom`:return`translate(0,`+(a.height()-n.depth)+`)`;default:}return`translate(0,0)`})}this.svg.style(`visibility`,this.type()===`none`?`hidden`:null).transition().call(doPosition),this._guideElement&&this.svgGuides.transition().call(doPosition),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,n.tickOverlapModulus);let o={x:this.pos().x,width:this.width()},s=this.svgAxis.selectAll(`.axisTitle`).data(this.title()?[this.title()]:[]),c=s.enter().append(`text`).attr(`class`,`axisTitle`).merge(s).transition().attr(`dx`,null).style(`text-anchor`,`end`);switch(this.orientation()){case`left`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,2).attr(`dy`,`.71em`);break;case`right`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,4).attr(`dx`,null).attr(`dy`,`-.71em`);break;case`top`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,2).attr(`dx`,null).attr(`dy`,`.71em`);break;case`bottom`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,-2).attr(`dy`,null);break;default:}c.text(this.title_exists()?this.title():``),s.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(`.tick`).classed(`guide-0`,e=>e===0&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(e,t){super.postUpdate(e,t),this._guideElement&&this._guideElement.attr(`transform`,this._element.attr(`transform`))}};Axis.prototype._class+=` chart_Axis`,Axis.prototype.publish(`type`,`linear`,`set`,`Type`,[`none`,`ordinal`,`linear`,`pow`,`log`,`time`]),Axis.prototype.publish(`timePattern`,`%Y-%m-%d`,`string`,`Time Series Pattern`,null,{disable:e=>e.type()!==`time`}),Axis.prototype.publish(`reverse`,!1,`boolean`,`Reverse`),Axis.prototype.publish(`title`,null,`string`,`Title`),Axis.prototype.publish(`orientation`,`bottom`,`set`,`Placement/orientation of the axis`,[`left`,`top`,`right`,`bottom`]),Axis.prototype.publish(`powExponent`,2,`number`,`Power exponent (disabled when type is not 'pow')`,null,{disable:e=>e.type()!==`pow`}),Axis.prototype.publish(`logBase`,10,`number`,`Logarithmic base (disabled when type is not 'log')`,null,{disable:e=>e.type()!==`log`}),Axis.prototype.publish(`ordinals`,[],`array`,`Array of ordinal values to display (disabled when type is not 'ordinal')`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`fontSize`,null,`number`,`Size of tick label font (pixels)`,null,{optional:!0}),Axis.prototype.publish(`fontFamily`,null,`string`,`Font family of tick labels`,null,{optional:!0}),Axis.prototype.publish(`tickCount`,null,`number`,`Number of ticks to display (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickFormat`,null,`string`,`Format rules for tick text (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickLength`,null,`number`,`Height (or width for left/right orientations) of the axis ticks (in pixels)`,null,{optional:!0}),Axis.prototype.publish(`ticks`,[],`array`,`Custom tick labels`,null,{optional:!0}),Axis.prototype.publish(`low`,null,`any`,`Minimum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`high`,null,`any`,`Maximum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`overlapMode`,`none`,`set`,`Specifies the behavior when tick labels overlap`,[`none`,`stagger`,`hide`,`rotate`,`linebreak`,`wrap`]),Axis.prototype.publish(`labelRotation`,33,`number`,`Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')`,null,{optional:!0,disable:e=>e.overlapMode()!==`rotate`}),Axis.prototype.publish(`shrinkToFit`,`both`,`set`,`shrinkToFit`,[`none`,`low`,`high`,`both`]),Axis.prototype.publish(`extend`,5,`number`,`Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`hidden`,!1,`boolean`,`Hides axis when 'true'`),Axis.prototype.publish(`ordinalPaddingInner`,.1,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`ordinalPaddingOuter`,.1,`number`,`Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`ordinalMappings`,null,`object`,`Alternative label mappings (icons)`,null,{optional:!0}),Axis.prototype.publish(`padding`,0,`number`,`Padding space at top of axis (pixels)`,null,{optional:!0}),Axis.prototype._origType=Axis.prototype.type,Axis.prototype.type=function(e){let t=Axis.prototype._origType.apply(this,arguments);return e!==void 0&&(this._type=e,this.updateScale()),t},Axis.prototype._origTimePattern=Axis.prototype.timePattern,Axis.prototype.timePattern=function(e){let t=Axis.prototype._origTimePattern.apply(this,arguments);return e!==void 0&&(this._timePattern=e,this.updateScale()),t};var XYAxis=class extends n.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),n.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.domainAxis=new Axis().classed({domain:!0}).orientation_default(`bottom`).type(`ordinal`).overlapMode_default(`stagger`).shrinkToFit_default(`high`).extend_default(0),this.valueAxis=new Axis().classed({value:!0}).orientation_default(`left`).type(`linear`).shrinkToFit_default(`high`),this.xyBrush=(0,n.brush)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.xBrush=(0,n.brushX)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.yBrush=(0,n.brushY)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(e){return this.domainAxis.parse(e)}parseValue(e){return this.valueAxis.parse(e,!0)}formatData(e){return this.domainAxis.format(e)}formatValue(e){return this.valueAxis.format(e)}parsedData(){return this.data().map(function(e){let t=0;return e.map(function(e,n){if(n===0)return this.parseData(e);if(n>=this.columns().length)return e;let r=this.yAxisStacked()?[t,t+this.parseValue(e)]:this.parseValue(e);return t+=this.parseValue(e),r},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(e,t){super.enter(e,t),this.svg=t.append(`g`),this.svgRegions=t.append(`g`),this.svgDomainGuide=this.svg.append(`g`),this.svgValueGuide=this.svg.append(`g`),this.svgData=this.svg.append(`g`),this.svgDataClipRect=this.svg.append(`clipPath`).attr(`id`,this.id()+`_clippath`).append(`rect`).attr(`x`,0).attr(`y`,0),this.svgData=this.svg.append(`g`).attr(`clip-path`,`url(#`+this.id()+`_clippath)`),this._selection.widgetElement(this.svgData),this.svgFocus=t.append(`g`),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=t.append(`g`).attr(`class`,`brush`),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(e,t,n){let r,i,a;return e.type===`e`||e.type===`w`?(r=+(e.type===`e`),i=r?1:-1,a=n/3,`M`+.5*i+`,`+a+`A6,6 0 0 `+r+` `+6.5*i+`,`+(a+6)+`V`+(2*a-6)+`A6,6 0 0 `+r+` `+.5*i+`,`+2*a+`ZM`+2.5*i+`,`+(a+8)+`V`+(2*a-8)+`M`+4.5*i+`,`+(a+8)+`V`+(2*a-8)):(r=+(e.type===`s`),a=r?1:-1,i=t/3,`M`+i+`, `+.5*a+`A6,6 0 0 `+(r+1)%2+` `+(i+6)+`,`+6.5*a+`H`+(2*i-6)+`A6,6 0 0 `+(r+1)%2+` `+2*i+`,`+.5*a+`ZM`+(i+8)+`,`+2.5*a+`H`+(2*i-8)+`M`+(i+8)+`,`+4.5*a+`H`+(2*i-8))}_skipSelection=!1;skipSelection(e){return arguments.length?(this._skipSelection=e,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let e=[],t=this,r=(0,n.brushSelection)(this.svgBrush.node());r&&(e=this.data().filter(function(e){let n=t.dataPos(e[0]);if(t.use2dSelection()){let i=t.valuePos(e[1])+t.valueAxis.bandwidth()/2;return n>=r[0][0]&&n<=r[1][0]&&i>=r[0][1]&&i<=r[1][1]}else return n>=r[0]&&n<=r[1]})),this.selection(e)}brushMoved2(){let e=this.orientation()===`horizontal`,t=this.use2dSelection()?[]:e?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],r=this.svgBrush.selectAll(`.handle--custom`).data(t),i=(0,n.d3Event)()?.selection;i==null?r.attr(`display`,`none`):e?r.attr(`display`,null).attr(`transform`,(e,t)=>`translate(`+i[t]+`,0)`):r.attr(`display`,null).attr(`transform`,(e,t)=>`translate(0, `+i[t]+`)`)}dataPos(e){return this.domainAxis.scalePos(e)}valuePos(e){return this.valueAxis.scalePos(e)}getAxisSize(e){return{width:this.xAxis?this.xAxis.width():e.xAxis.width(),height:this.yAxis?this.yAxis.height():e.yAxis.width()}}calcMargin(e,t,n){let r={top:!n&&this.selectionMode()?10:2,right:n&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},i=this.width()-r.left-r.right,a=this.height()-r.top-r.bottom,o=0,s=30,c=0,l=30;for(let e=0;e<10;++e){this.xAxis.width(i-l).height(0);let e=this.xAxis.calcOverflow(t),n=e.depth;this.yAxis.width(0).height(a-s);let r=this.yAxis.calcOverflow(t),u=r.depth;if(o=e.right,c=r.top,n===s&&u===l)break;s=n,l=u}return this.xAxis.x(i/2+l/2+r.left).y(a+r.top).width(i-l),this.yAxis.x(r.left).y(a/2-s/2+r.top).height(a-s),r.left+=l,r.top+=c,r.right+=o,r.bottom+=s,r}updateRegions(e,t,r){let i=this,a=this.svgRegions.selectAll(`.region`).data(this.regions());a.enter().append(`rect`).attr(`class`,`region`),r?a.attr(`x`,function(e){return i.dataPos(e.x0)}).attr(`y`,0).attr(`width`,function(e){return i.dataPos(e.x1)-i.dataPos(e.x0)}).attr(`height`,this.height()).style(`stroke`,function(e){return i._palette(e.colorID)}).style(`fill`,function(e){return(0,n.hsl)(i._palette(e.colorID)).brighter()}):a.attr(`x`,0).attr(`y`,function(e){return i.dataPos(e.x0)}).attr(`width`,this.width()).attr(`height`,function(e){return i.dataPos(e.x0)-i.dataPos(e.x1)}).style(`stroke`,function(e){return i._palette(e.colorID)}).style(`fill`,function(e){return(0,n.hsl)(i._palette(e.colorID)).brighter()}),a.exit().remove()}_prevXAxisType;update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let r=this,i=this.orientation()===`horizontal`;switch(this.updateRegions(e,t,i),this.domainAxis.orientation(i?`bottom`:`left`).title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(i?`left`:`bottom`),this.xAxis=i?this.domainAxis:this.valueAxis,this.yAxis=i?this.valueAxis:this.domainAxis,this.xAxisType()){case`ordinal`:let e=this.columns().length,t={};this.domainAxis.ordinals(this.data().map(function(n){return t[n[0]]=r.xAxisOrdinalMapping(n,n[e]),n[0]})).ordinalMappings(t);break;default:let i=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert((0,n.min)(this.parsedData(),function(e){return e[0]})),a=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert((0,n.max)(this.parsedData(),function(e){return e[0]}));i!==void 0&&a!==void 0&&this.domainAxis.low(i).high(a);break}let a=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert((0,n.min)(this.parsedData(),function(e){return(0,n.min)(e.filter(function(e,t){return t>0&&r.columns()[t]&&r.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[0]:e})})),o=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert((0,n.max)(this.parsedData(),function(e){return(0,n.max)(e.filter(function(e,t){return t>0&&r.columns()[t]&&r.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[1]:e})}));this.valueAxis.low(a).high(o),this.margin=this.calcMargin(e,t,i);let s=this.width()-this.margin.left-this.margin.right;s<0&&(s=0);let c=this.height()-this.margin.top-this.margin.bottom;c<0&&(c=0);let l=i?s:c,u=i?c:s;if(this.domainAxis.tickLength(this.xAxisGuideLines()?u:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr(`width`,s).attr(`height`,c),this.svgData.transition().attr(`transform`,`translate(`+this.margin.left+`,`+this.margin.top+`)`),this.updateBrush(s,c,l,i),this.updateFocusChart(e,t,this.margin,s,c,i),this.chartsUpdate(s,c,250),this.selectionMode())return this.brushMoved()}updateBrush(e,t,r,i){let a=this.use2dSelection()?this.xyBrush:i?this.xBrush:this.yBrush,o=(0,n.brushSelection)(this.svgBrush.node());a.extent([[0,0],[e,t]]),this.svgBrush.attr(`transform`,`translate(`+this.margin.left+`, `+this.margin.top+`)`).style(`display`,this.selectionMode()?null:`none`).call(a);let s=this.use2dSelection()?[]:i?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],c=this.svgBrush.selectAll(`.handle--custom`).data(s);if(c.enter().append(`path`).attr(`class`,`handle--custom`).merge(c).attr(`cursor`,i?`ew-resize`:`ns-resize`).attr(`d`,n=>this.resizeBrushHandle(n,e,t)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(o){if(this._prevBrush.orientation!==this.orientation()){let e=o[0];o[0]=this._prevBrush.maxCurrExtent-o[1],o[1]=this._prevBrush.maxCurrExtent-e}let e=r/this._prevBrush.maxCurrExtent;e!==1&&this.svgBrush.transition().on(`start`,function(){a.on(`end`,null)}).call(a.move,[o[0]*e,o[1]*e]).on(`end`,()=>{a.on(`end`,()=>this.brushMoved())})}}else this.svgBrush.call(a.move,[0,r]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:r}}}updateFocusChart(e,t,n,r,i,a){let o=this,s=this.svgFocus.selectAll(`#`+this.id()+`_focusChart`).data(this.xAxisFocus()?[!0]:[]);s.enter().append(`g`).attr(`id`,this.id()+`_focusChart`).attr(`class`,`focus`).each(function(){o.focusChart=new o.constructor().target(this),o.focusChart.xBrush.on(`brush.focus`,function(){o.syncAxis(r),o.chartsUpdate(r,i,0)}),o.focusChart.layers(o.layers().map(e=>new e.constructor))}).merge(s).each(function(){o.copyPropsTo(o.focusChart,[`layers`]);let e=0;for(let t of o.layers())t.copyPropsTo(o.focusChart.layers()[e]),e++;o.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation(`horizontal`).xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(o.width()/2).y(o.height()-o.xAxisFocusHeight()/2).width(o.width()).height(o.xAxisFocusHeight()).columns(o.columns()).data(o.data()).render(),o.syncAxis(r)}),s.exit().each(function(){o.focusChart&&(o.focusChart.target(null),delete o.focusChart)}).remove()}syncAxis(e){let t=(0,n.brushSelection)(this.focusChart.svgBrush.node());if(t){if(this.focusChart.xAxisType()!==`ordinal`)this.xAxis.domain([this.focusChart.xAxis.invert(t[0]),this.focusChart.xAxis.invert(t[1])]);else{let n=(t[1]-t[0])/e;this.xAxis.range([-t[0]/n,(e-t[0])/n])}this.xAxis.rerender()}}layerColumns(e){let t=e.columns(),n=super.columns().filter(e=>e!==t[0]);return n.length?[t[0],...n]:t}layerColumnIndices(e){let t=e.columns();return this.layerColumns(e).map(e=>t.indexOf(e))}layerColumnIndex(e,t){return e.columns().indexOf(t)}layerData(e){if(arguments.length===1){let t=this.layerColumnIndices(e);return e.data().map(e=>{let n=t.map(t=>e[t]);return n.__hpcc_origRow=e,n})}throw Error(`Setting data on XYAxisLayer is not supported.`)}layerEnter(e,t,n=250){}layerUpdate(e,t,n=250){}layerExit(e,t,n=250){}chartsEnter(e,t,n=250){this.layerEnter(this,t,n);for(let e of this.layers())e.__xyAxisElement=t.append(`g`).attr(`class`,e.class()),e.target(e.__xyAxisElement.node()).layerEnter(this,t,n)}chartsUpdate(e,t,n){this.layerUpdate(this,this.svgData,n);for(let r of this.layers())r.resize({width:e,height:t}).layerUpdate(this,r.__xyAxisElement,n)}exit(e,t){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(e,t)}selection(e){let t=this;this._selection.widgetElement().selectAll(`.selected,.deselected`).each(function(r){let i=e.indexOf(r.origRow)>=0;(0,n.select)(this).classed(`selected`,i).classed(`deselected`,!i).attr(`filter`,t._selection.svgGlowID()&&i?`url(#${t._selection.svgGlowID()})`:null)});let r=e.map(e=>this.rowToObj(e));setTimeout(()=>{this.click(r,``,!0)},0)}xAxisOrdinalMapping(e,t){return e[0]}click(e,t,n){}_selection};XYAxis.prototype._class+=` chart_XYAxis`,XYAxis.prototype.mixin(n.Utility.SimpleSelectionMixin),XYAxis.prototype.publish(`orientation`,`horizontal`,`set`,`Selects orientation for the axis`,[`horizontal`,`vertical`]),XYAxis.prototype.publish(`pointSizeColumn`,null,`string`,`pointSizeColumn`,null,{optional:!0}),XYAxis.prototype.publish(`minPointSize`,6,`number`,`minPointSize`),XYAxis.prototype.publish(`maxPointSize`,26,`number`,`maxPointSize`),XYAxis.prototype.publish(`use2dSelection`,!1,`boolean`,`2D Range Selector`),XYAxis.prototype.publish(`selectionMode`,!1,`boolean`,`Range Selector`),XYAxis.prototype.publishProxy(`xAxisTitle`,`domainAxis`,`title`),XYAxis.prototype.publishProxy(`xAxisTickCount`,`domainAxis`,`tickCount`),XYAxis.prototype.publishProxy(`xAxisTickFormat`,`domainAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`xAxisTicks`,`domainAxis`,`ticks`),XYAxis.prototype.publishProxy(`xAxisType`,`domainAxis`,`type`),XYAxis.prototype.publishProxy(`xAxisTypeTimePattern`,`domainAxis`,`timePattern`),XYAxis.prototype.publish(`xAxisDomainLow`,null,`string`,`X-Axis Low`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publish(`xAxisDomainHigh`,null,`string`,`X-Axis High`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`xAxisFontSize`,`domainAxis`,`fontSize`),XYAxis.prototype.publishProxy(`xAxisFontFamily`,`domainAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingInner`,`domainAxis`,`ordinalPaddingInner`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingOuter`,`domainAxis`,`ordinalPaddingOuter`),XYAxis.prototype.publishProxy(`xAxisOverlapMode`,`domainAxis`,`overlapMode`),XYAxis.prototype.publishProxy(`xAxisLabelRotation`,`domainAxis`,`labelRotation`),XYAxis.prototype.publishProxy(`xAxisDomainPadding`,`domainAxis`,`extend`),XYAxis.prototype.publish(`xAxisGuideLines`,!1,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publish(`xAxisFocus`,!1,`boolean`,`X-Axis Focus`,null,{disable:e=>e.orientation()!==`horizontal`}),XYAxis.prototype.publish(`xAxisFocusHeight`,80,`number`,`X-Axis Focus Height`,null,{disable:e=>!e.xAxisFocus()}),XYAxis.prototype.publishProxy(`xAxisHidden`,`domainAxis`,`hidden`),XYAxis.prototype.publishProxy(`yAxisFontSize`,`valueAxis`,`fontSize`),XYAxis.prototype.publishProxy(`yAxisFontFamily`,`valueAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`yAxisTitle`,`valueAxis`,`title`),XYAxis.prototype.publishProxy(`yAxisTickCount`,`valueAxis`,`tickCount`),XYAxis.prototype.publishProxy(`yAxisTickFormat`,`valueAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`yAxisTicks`,`valueAxis`,`ticks`),XYAxis.prototype.publishProxy(`yAxisType`,`valueAxis`,`type`),XYAxis.prototype.publishProxy(`yAxisTypeTimePattern`,`valueAxis`,`timePattern`),XYAxis.prototype.publishProxy(`yAxisTypePowExponent`,`valueAxis`,`powExponent`),XYAxis.prototype.publishProxy(`yAxisTypeLogBase`,`valueAxis`,`logBase`),XYAxis.prototype.publish(`yAxisStacked`,!1,`boolean`,`Stacked Chart`,null,{tags:[`Basic`],disable:e=>e.xAxisType()!==`ordinal`||e._class.indexOf(`chart_Column`)<0}),XYAxis.prototype.publish(`yAxisDomainLow`,null,`string`,`Y-Axis Low`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publish(`yAxisDomainHigh`,null,`string`,`Y-Axis High`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`yAxisDomainPadding`,`valueAxis`,`extend`),XYAxis.prototype.publish(`yAxisGuideLines`,!0,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publishProxy(`yAxisHidden`,`valueAxis`,`hidden`),XYAxis.prototype.publish(`regions`,[],`array`,`Regions`),XYAxis.prototype.publish(`layers`,[],`widgetArray`,`Layers`,null,{render:!1}),XYAxis.prototype.publishProxy(`xAxisPadding`,`domainAxis`,`padding`),XYAxis.prototype.publishProxy(`yAxisPadding`,`valueAxis`,`padding`),XYAxis.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var Scatter=class extends XYAxis{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`,multi:!0}];constructor(){super(),t.INDChart.call(this),t.ITooltip.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}curve(){switch(this.interpolate()){case`linear`:return linear_default$1;case`step`:return step_default;case`step-before`:return stepBefore;case`step-after`:return stepAfter;case`basis`:return basis_default;case`bundle`:return w;case`cardinal`:return T;case`catmullRom`:return E;case`natural`:return natural_default;default:return monotoneX}}getScale(){switch(this.pointSizeScale()){case`linear`:return(0,n.scaleLinear)();case`pow`:return(0,n.scalePow)().exponent(2);case`log`:return(0,n.scaleLog)();case`sqrt`:return(0,n.scaleSqrt)()}}pointColor(e,t,n,r){return this.interpolate()&&this.pointDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}lineColor(e,t,n,r){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}areaColor(e,t,n,r){return this.fillColor(e,t,n,r)}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(e){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:e.label,arr:r.columns().slice(1).map(function(t,n){return{label:t,color:r._palette(t),value:r.data()[e.rowIdx][n+1]}})});default:return r.tooltipFormat({label:e.label,series:e.column,value:e.value})}})}_prevPointShape;layerUpdate(e,t,r=250){super.layerUpdate(e,t);let i=e.orientation()===`horizontal`,a=i?this.height():this.width(),o=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.parentRelativeDiv.attr(`tabindex`,null).attr(`role`,null).attr(`aria-label`,null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._prevPointShape!==this.pointShape()&&(t.selectAll(`.data`).remove(),this._prevPointShape=this.pointShape());function mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}let s=this.pointSizeColumn_exists(),c,l,u;s&&(c=this.columns().indexOf(this.pointSizeColumn()),l=(0,n.extent)(this.data(),e=>e[c]),u=this.getScale().domain(l));let d=this.layerColumns(e),f=this.layerData(e),p=this.flattenData(d,f).map(function(e){return e.shape=mapShape(o.pointShape()),e.column=d[e.colIdx],e.row=f[e.rowIdx],e.origRow=f[e.rowIdx].__hpcc_origRow,l?(e.size=u(e.row[c])*(o.maxPointSize()-o.minPointSize())+o.minPointSize(),e.column===o.pointSizeColumn()?!1:e):(e.size=o.pointSize(),e)}).filter(e=>e),m=t.selectAll(`.area`).data(d.filter(function(e,t){return o.interpolate()&&o.interpolateFill()&&t>0})),h=m.enter().append(`path`),g=area_default$1().curve(this.curve());i?g.x(function(t){return o.xPos(e,t)}).y0(Math.min(a,this.yPos(e,{value:0}))).y1(function(t){return o.yPos(e,t)}):g.y(function(t){return o.yPos(e,t)}).x0(Math.max(0,this.xPos(e,{value:0}))).x1(function(t){return o.xPos(e,t)}),h.merge(m).attr(`class`,e=>`area series series-`+this.cssTag(e)).each(function(e,t){(0,n.select)(this).attr(`d`,g(p.filter(function(e){return e.colIdx===t+1}))).style(`opacity`,o.interpolateFillOpacity()).style(`stroke`,`none`).style(`fill`,o.areaColor([],e,void 0,[]))}),m.exit().remove();let _=t.selectAll(`.line`).data(d.filter(function(e,t){return o.interpolate()&&t>0})),v=_.enter().append(`path`),b=line_default$1().x(function(t){return o.xPos(e,t)}).y(function(t){return o.yPos(e,t)}).curve(this.curve());v.merge(_).attr(`class`,e=>`line series series-`+this.cssTag(e)).each(function(e,t){let r=(0,n.select)(this),i=p.filter(function(e){return e.colIdx===t+1});r.attr(`d`,b(i)).style(`stroke`,o.lineColor([],e,void 0,[])).style(`fill`,`none`)}),_.exit().remove();let S=t.selectAll(`.point`).data(p,function(e,t){return e.shape+`_`+t});S.enter().append(`g`).each(function(t){let r=(0,n.select)(this);r.append(t.shape).attr(`class`,`pointShape`),r.append(`text`).attr(`class`,`pointValue`).style(`display`,`none`).attr(`text-anchor`,o.valueAnchor()).attr(`alignment-baseline`,o.valueBaseline()).attr(`fill`,function(e,t){return o.valueBaseline()===`middle`||o.valueBaseline()===`central`?o.textColor(e.row,e.column,e.value,e.origRow):null}),r.append(`circle`).attr(`class`,`pointSelection`).on(`mouseout.tooltip`,o.tooltip.hide).on(`mousemove.tooltip`,o.tooltip.show).call(e._selection.enter.bind(e._selection)).on(`click`,function(t,n){o.click(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`dblclick`,function(t,n){o.dblclick(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`keydown`,function(t,r){if(o.tabNavigation()){let t=(0,n.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}})}).merge(S).attr(`class`,e=>`point series series-`+this.cssTag(e.column)).each(function(t){(0,n.select)(this).select(`.pointValue`).attr(`x`,function(t){return o.xPos(e,t)}).attr(`y`,function(t){return o.yPos(e,t)}).style(`display`,o.showValue()?`block`:`none`).attr(`text-anchor`,o.valueAnchor()).attr(`alignment-baseline`,o.valueBaseline()).text(function(e){return e.value}),(0,n.select)(this).select(`.pointSelection`).attr(`cx`,function(t){return o.xPos(e,t)}).attr(`cy`,function(t){return o.yPos(e,t)}).attr(`r`,t.size).attr(`tabindex`,o.tabNavigation()?0:null).attr(`role`,o.tabNavigation()?`button`:null).attr(`aria-label`,o.tabNavigation()?e=>`${e.column||`Value`}: ${e.value} @ ${e.label}`:null);let r=(0,n.select)(this).select(`.pointShape`);switch(t.shape){case`rect`:r.attr(`x`,function(n){return o.xPos(e,n)-t.size/2}).attr(`y`,function(n){return o.yPos(e,n)-t.size/2}).attr(`width`,t.size).attr(`height`,t.size).style(`fill`,o.pointColor(t.row,t.column,t.value,t.origRow));break;case`circle`:r.attr(`cx`,function(t){return o.xPos(e,t)}).attr(`cy`,function(t){return o.yPos(e,t)}).attr(`r`,t.size*.9).style(`fill`,o.pointColor(t.row,t.column,t.value,t.origRow));break;case`path`:r.attr(`d`,function(n){return`M`+(o.xPos(e,n)-t.size/2)+` `+(o.yPos(e,n)-t.size/2)+` L`+(o.xPos(e,n)+t.size/2)+` `+(o.yPos(e,n)+t.size/2)+` M`+(o.xPos(e,n)-t.size/2)+` `+(o.yPos(e,n)+t.size/2)+` L`+(o.xPos(e,n)+t.size/2)+` `+(o.yPos(e,n)-t.size/2)}).style(`stroke`,o.pointColor(t.row,t.column,t.value,t.origRow));break;default:}}),S.exit().remove()}exit(e,t){super.exit(e,t)}};Scatter.prototype._class+=` chart_Scatter`,Scatter.prototype.implements(t.INDChart.prototype),Scatter.prototype.implements(t.ITooltip.prototype),Scatter.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Scatter.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Scatter.prototype.publish(`pointSizeScale`,`linear`,`set`,`pointSizeScale`,[`linear`,`pow`,`log`,`sqrt`]),Scatter.prototype.publish(`pointShape`,`cross`,`set`,`Shape of the data points`,[`circle`,`rectangle`,`cross`]),Scatter.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Scatter.prototype.publish(`interpolate`,``,`set`,`Interpolate Data`,[``,`linear`,`step`,`step-before`,`step-after`,`basis`,`bundle`,`cardinal`,`catmullRom`,`natural`,`monotone`]),Scatter.prototype.publish(`pointDarken`,!0,`boolean`,`If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color`,null,{disable:e=>!e.interpolate()}),Scatter.prototype.publish(`interpolateDarken`,!0,`boolean`,`If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color`,null,{disable:e=>!e.interpolateFill()}),Scatter.prototype.publish(`interpolateFill`,!1,`boolean`,`If true, the area between the line and zero will be filled`),Scatter.prototype.publish(`interpolateFillOpacity`,.66,`number`,`Fill interpolation Opacity`,null,{range:{min:0,step:.01,max:1}}),Scatter.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Scatter.prototype.publish(`showValue`,!1,`boolean`),Scatter.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Scatter.prototype.publish(`valueBaseline`,`ideographic`,`set`,`alignment-baseline for shown value text`,[`auto`,`baseline`,`before-edge`,`text-before-edge`,`middle`,`central`,`after-edge`,`text-after-edge`,`ideographic`,`alphabetic`,`hanging`,`mathematical`,`inherit`]);var Area=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`).interpolateFill_default(!0)}};Area.prototype._class+=` chart_Area`;var Column=class extends XYAxis{static __inputs=[{id:`label`,type:`string`},{id:`values`,type:`number`,multi:!0}];_linearGap;textLocal=(0,n.local)();stackedTextLocal=(0,n.local)();isHorizontal;constructor(){super(),t.INDChart.call(this),t.ITooltip.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(t){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:t.row[0],arr:r.columns().slice(1).map(function(e,n){return{label:e,color:r._palette(e),value:t.row[n+1]}})});default:let n=t.row[t.idx];return n instanceof Array&&(n=n[1]-n[0]),r.tooltipFormat({label:t.row[0],series:r.layerColumns(e)[t.idx],value:n})}})}adjustedData(e){return this.layerData(e).map(t=>{let n=0;return t.map((t,r)=>{if(r===0||r>=this.layerColumns(e).length)return t;let i=e.yAxisStacked()?[n,n+t]:t;return n+=t,i},this)},this)}layerUpdate(e,t,r=250){super.layerUpdate(e,t,r);let i=e.orientation()===`horizontal`;this.isHorizontal=i;let a=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.parentRelativeDiv.attr(`tabindex`,null).attr(`role`,null).attr(`aria-label`,null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let o=(0,n.format)(a.showValueAsPercentFormat()),s=10,c=0;switch(e.xAxisType()){case`ordinal`:s=e.bandwidth(),c=-s/2;break;case`linear`:case`time`:s=Math.max(Math.abs(e.dataPos(2)-e.dataPos(1))*(100-this._linearGap)/100,s),c=-s/2;break;default:}this.tooltip.direction(i?`n`:`e`);let l=(0,n.scaleBand)().domain(a.layerColumns(e).filter(function(e,t){return t>0})).rangeRound(i?[0,s]:[s,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0),u=[],d=[],f=this.columns().length,p=this.data();this.showValue()&&this.showValueAsPercent()===`series`&&p.forEach(e=>{e.filter((e,t)=>t>0&&t<f).forEach((e,t)=>{d[t+1]===void 0&&(d[t+1]=0),d[t+1]+=e})}),(this.showDomainTotal()||this.showValue()&&this.showValueAsPercent()===`domain`)&&(u=p.map(e=>e.filter((e,t)=>t>0&&t<f).reduce((e,t)=>e+t,0)));let m=t.selectAll(`.dataRow`).data(this.adjustedData(e)),h=e.data(),g=this.getAxisSize(e);m.enter().append(`g`).attr(`class`,`dataRow`).merge(m).each(function(t,p){let m=(0,n.select)(this),_=m.selectAll(`.dataCell`).data(t.filter(function(t,n){return n<a.layerColumns(e).length}).map(function(n,r){return{column:a.layerColumns(e)[r],row:t,origRow:h[p],value:n,idx:r}}).filter(function(e){return e.value!==null&&e.idx>0}),e=>e.column),v=_.enter().append(`g`).attr(`class`,`dataCell`).on(`mouseout.tooltip`,function(e){(!a.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&a.tooltip.hide.apply(a,arguments)}).on(`mousemove.tooltip`,function(e){(!a.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&a.tooltip.show.apply(a,arguments)}).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){a.click(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`dblclick`,function(t){a.dblclick(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`keydown`,function(t,r){if(a.tabNavigation()){let t=(0,n.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}}).style(`opacity`,0).each(function(e){let t=(0,n.select)(this);t.append(`rect`).attr(`class`,`columnRect series series-`+a.cssTag(e.column)),t.append(`text`).attr(`class`,`columnRectText`).style(`stroke`,`transparent`)});v.transition().duration(r).style(`opacity`,1);let b=e.yAxisStacked()?s:l.bandwidth();v.merge(_).attr(`tabindex`,a.tabNavigation()?0:null).attr(`role`,a.tabNavigation()?`button`:null).attr(`aria-label`,a.tabNavigation()?e=>`${e.origRow[0]} - ${e.column}: ${e.value instanceof Array?e.value[1]-e.value[0]:e.value}`:null).each(function(s){let m=(0,n.select)(this),h=e.dataPos(t[0])+(e.yAxisStacked()?0:l(s.column))+c,_=s.value instanceof Array?s.value[1]:s.value,v=s.origRow[s.idx];if(a.showValue()){let e=a.dataMeta();switch(a.showValueAsPercent()){case`series`:let t=e.sum===void 0?d[s.idx]:e.sum;v=o(v/t);break;case`domain`:let r=e.sum===void 0?u[p]:e.sum;v=o(v/r);break;default:v=(0,n.format)(a.showValueFormat())(v);break}}let S=e.valuePos(_),C=e.valuePos(s.value instanceof Array?s.value[0]:0),w=Math.min(C,S),T=Math.abs(S-C),E=a.innerTextFontSize(),D=a.innerTextPadding_exists()?a.innerTextPadding():E/2.5,O=a.intersectRectRect({x:i?h:w,y:i?w:h,width:i?b:T,height:i?T:b},{x:0,y:0,width:g.width,height:g.height}),k=m.select(`rect`).transition().duration(r).style(`fill`,e=>a.fillColor(e.row,e.column,e.value,e.origRow));i?k.attr(`x`,h).attr(`y`,w).attr(`width`,b).attr(`height`,T):k.attr(`y`,h).attr(`x`,w).attr(`height`,b).attr(`width`,T);let A=m.select(`text`).transition().duration(r).style(`font-size`,E+`px`).style(`fill`,e=>a.textColor(e.row,e.column,e.value,e.origRow));A.style(`font-family`,a.innerTextFontFamily_exists()?a.innerTextFontFamily():null);let j=a.innerTextPadding_exists()?a.innerTextPadding():8,M=E/2.7;if(i){let e=O.y+O.height-D;A.attr(`x`,h+b/2).attr(`y`,e+M).attr(`transform`,`rotate(-90, ${h+b/2}, ${e})`)}else A.attr(`x`,O.x+j).attr(`y`,h+b/2+M);A.attr(`height`,b).attr(`width`,T),a.showInnerText()&&A.text(e=>{let t=a.innerText(e.origRow,e.origRow[f],e.idx);if(t){let n=i?O.height:O.width,r=a.calcInnerText(n,t,v);return e.innerTextObj=r,r.text}return``});let N=m.selectAll(`.dataText`).data(a.showValue()?[`${_}`]:[]);N.enter().append(`g`).attr(`class`,`dataText`).each(function(e){a.textLocal.set(this,new n.Text().target(this).colorStroke_default(`transparent`))}).merge(N).each(function(){let e={x:0,y:0},t=a.valueFontFamily(),n=a.valueFontSize(),r=a.textSize(v,t,n),o=parseFloat(v)>=0,c=a.valueAnchor()?a.valueAnchor():i?`middle`:`start`,l=O.x,u=g.width-(O.x+O.width),d=O.y,f=g.height-(O.y+O.height),p,m,_;if(s.innerTextObj){let{padding:t,valueTextWidth:r}=s.innerTextObj;m=!1,i?(c=`middle`,e.x=h+b/2,s.innerTextObj.category===4?(m=!0,e.y=w-t-n/2):e.y=w+t+n/2):(c=`start`,s.innerTextObj.category===4?(m=!0,e.x=T+w+t):e.x=T+w-r-t,e.y=h+b/2)}else i?(p=O.height<r.height,m=!a.valueCentered()||p,e.x=O.x+O.width/2,m?o?(_=d<r.height+j,_?p?e.y=O.y+O.height+r.height:(m=!1,e.y=O.y+O.height/2):e.y=O.y-r.height/2-j):(_=f<r.height,_?p?e.y=O.y-r.height/2-j:(m=!1,e.y=O.y+O.height/2):e.y=O.y+r.height+j):e.y=O.y+O.height/2):(p=O.width<r.width,m=!a.valueCentered()||p,e.y=O.y+O.height/2,m?o?(_=u<r.width+j,_?a.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x-(r.width-j):e.x=O.x+O.width+r.width/2+j):(_=l<r.width,_?a.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x+O.width+(r.width-j):e.x=O.x-(r.width-j)):e.x=O.x+O.width/2);let S=m?null:a.textColor(s.row,s.column,s.value,s.origRow),C=a.columns(),E=a.yAxisStacked()&&p||m&&a.yAxisStacked()&&C.indexOf(s.column)!==C.length-1;a.textLocal.get(this).pos(e).anchor(c).fontFamily(t).fontSize(n).text(`${v}`).colorFill(S).visible(a.showValue()&&!E).render()}),N.exit().each(function(e){a.textLocal.get(this).target(null)}).remove()}),_.exit().transition().duration(r).style(`opacity`,0).remove();let S=e.yAxisStacked()?u[p]:Math.max(...t.filter((e,t)=>t>0&&t<f)),C=m.selectAll(`.stackedTotalText`).data(a.showDomainTotal()?[u[p]]:[]);C.enter().append(`g`).attr(`class`,`stackedTotalText`).each(function(e){a.stackedTextLocal.set(this,new n.Text().target(this).colorStroke_default(`transparent`))}).merge(C).each(function(n){let r={x:0,y:0},o=e.dataPos(t[0]),s=e.valuePos(S),c=a.valueFontFamily(),l=a.valueFontSize(),u=a.textSize(n,c,l),d=parseFloat(n)>=0,f=`middle`;i?(r.x=o,d?r.y=s-u.height/2:r.y=s+u.height/2):(f=`start`,r.y=o,d?r.x=s+u.width/2:r.x=s-u.width/2),a.stackedTextLocal.get(this).pos(r).anchor(f).fontFamily(c).fontSize(l).text(n).render()}),C.exit().each(function(e){a.textLocal.get(this).target(null)}).remove()}),m.exit().transition().duration(r).remove()}calcInnerText(e,t,n){let r=this.innerTextFontFamily_exists()?this.innerTextFontFamily():`Verdana`,i=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():`Verdana`,o=this.valueFontSize(),s=this.innerTextPadding_exists()?this.innerTextPadding():i/2.5,c=this.isHorizontal?o:this.textSize(n,a,o).width,l=this.textSize(`...`,r,i).width,u=this.textSize(t,r,i).width,d=t,f=s*3+u+c,p=s*3+l+c,m=s*1+c,h=4;if(f<e)h=1;else if(p<e){let n=e-p,a=``;for(let e of t)if(this.textSize(a+e,r,i).width>n){t=a+`...`;break}else a+=e;h=2}else m<e?(t=``,h=3):t=``;return{text:t,isTruncated:d!==t,padding:s,category:h,valueTextWidth:c}}innerText(e,t,n){return e[0]}};Column.prototype._class+=` chart_Column`,Column.prototype.implements(t.INDChart.prototype),Column.prototype.implements(t.ITooltip.prototype),Column.prototype.publish(`valueFontFamily`,null,`string`,`Font family of value text`,null,{optional:!0}),Column.prototype.publish(`valueFontSize`,12,`number`,`Height of value text (pixels)`),Column.prototype.publish(`innerTextFontFamily`,null,`string`,`Font family of inner text`,null,{optional:!0}),Column.prototype.publish(`innerTextPadding`,8,`number`,`Offset of inner text (pixels)`,null,{optional:!0}),Column.prototype.publish(`innerTextFontSize`,12,`number`,`Height of inner text (pixels)`),Column.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,()=>Column.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Column.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Column.prototype.publish(`showValue`,!1,`boolean`,`Show Value in column`),Column.prototype.publish(`showInnerText`,!1,`boolean`,`Show Label in column`),Column.prototype.publish(`showValueFormat`,`,`,`string`,`D3 Format for Value`,null,{disable:e=>!e.showValue()||!!e.showValueAsPercent()}),Column.prototype.publish(`showValueAsPercent`,null,`set`,`If showValue is true, optionally show value as a percentage by Series or Domain`,[null,`series`,`domain`],{disable:e=>!e.showValue(),optional:!0}),Column.prototype.publish(`showValueAsPercentFormat`,`.0%`,`string`,`D3 Format for %`,null,{disable:e=>!e.showValue()||!e.showValueAsPercent()}),Column.prototype.publish(`showDomainTotal`,!1,`boolean`,`Show Total Value for Stacked Columns`,null),Column.prototype.publish(`valueCentered`,!1,`boolean`,`Show Value in center of column`),Column.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Column.prototype.publish(`xAxisSeriesPaddingInner`,0,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`),Column.prototype.publish(`tooltipInnerTextEllipsedOnly`,!1,`boolean`,`Show tooltip only when inner text is truncated with an ellipsis`);var Bar=class extends Column{constructor(){super(),this.orientation_default(`vertical`)}};Bar.prototype._class+=` chart_Bar`;function count(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function count_default(){return this.eachAfter(count)}__name(count_default,`default`);function each_default(e){var t=this,n,r=[t],i,a,o;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}__name(each_default,`default`);function eachBefore_default(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}__name(eachBefore_default,`default`);function eachAfter_default(e){for(var t=this,n=[t],r=[],i,a,o;t=n.pop();)if(r.push(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;t=r.pop();)e(t);return this}__name(eachAfter_default,`default`);function sum_default(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})}__name(sum_default,`default`);function sort_default(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}__name(sort_default,`default`);function path_default$1(e){for(var t=this,n=leastCommonAncestor(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}__name(path_default$1,`default`);function leastCommonAncestor(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}function ancestors_default(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}__name(ancestors_default,`default`);function descendants_default(){var e=[];return this.each(function(t){e.push(t)}),e}__name(descendants_default,`default`);function leaves_default(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}__name(leaves_default,`default`);function links_default(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}__name(links_default,`default`);function hierarchy(e,t){var n=new Node$1(e),r=+e.value&&(n.value=e.value),i,a=[n],o,s,c,l;for(t??=defaultChildren;i=a.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(l=s.length))for(i.children=Array(l),c=l-1;c>=0;--c)a.push(o=i.children[c]=new Node$1(s[c])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(computeHeight)}function node_copy(){return hierarchy(this).eachBefore(copyData)}function defaultChildren(e){return e.children}function copyData(e){e.data=e.data.data}function computeHeight(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Node$1(e){this.data=e,this.depth=this.height=0,this.parent=null}__name(Node$1,`Node`),Node$1.prototype=hierarchy.prototype={constructor:Node$1,count:count_default,each:each_default,eachAfter:eachAfter_default,eachBefore:eachBefore_default,sum:sum_default,sort:sort_default,path:path_default$1,ancestors:ancestors_default,descendants:descendants_default,leaves:leaves_default,links:links_default,copy:node_copy};var N=Array.prototype.slice;function shuffle(e){for(var t=e.length,n,r;t;)r=Math.random()*t--|0,n=e[t],e[t]=e[r],e[r]=n;return e}function enclose_default(e){for(var t=0,n=(e=shuffle(N.call(e))).length,r=[],i,a;t<n;)i=e[t],a&&enclosesWeak(a,i)?++t:(a=encloseBasis(r=extendBasis(r,i)),t=0);return a}__name(enclose_default,`default`);function extendBasis(e,t){var n,r;if(enclosesWeakAll(t,e))return[t];for(n=0;n<e.length;++n)if(enclosesNot(t,e[n])&&enclosesWeakAll(encloseBasis2(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(enclosesNot(encloseBasis2(e[n],e[r]),t)&&enclosesNot(encloseBasis2(e[n],t),e[r])&&enclosesNot(encloseBasis2(e[r],t),e[n])&&enclosesWeakAll(encloseBasis3(e[n],e[r],t),e))return[e[n],e[r],t];throw Error()}function enclosesNot(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function enclosesWeak(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 enclosesWeakAll(e,t){for(var n=0;n<t.length;++n)if(!enclosesWeak(e,t[n]))return!1;return!0}function encloseBasis(e){switch(e.length){case 1:return encloseBasis1(e[0]);case 2:return encloseBasis2(e[0],e[1]);case 3:return encloseBasis3(e[0],e[1],e[2])}}function encloseBasis1(e){return{x:e.x,y:e.y,r:e.r}}function encloseBasis2(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,o=t.y,s=t.r,c=a-n,l=o-r,u=s-i,d=Math.sqrt(c*c+l*l);return{x:(n+a+c/d*u)/2,y:(r+o+l/d*u)/2,r:(d+i+s)/2}}function encloseBasis3(e,t,n){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,c=t.r,l=n.x,u=n.y,d=n.r,f=r-o,p=r-l,m=i-s,h=i-u,g=c-a,_=d-a,v=r*r+i*i-a*a,b=v-o*o-s*s+c*c,S=v-l*l-u*u+d*d,C=p*m-f*h,w=(m*S-h*b)/(C*2)-r,T=(h*g-m*_)/C,E=(p*b-f*S)/(C*2)-i,D=(f*_-p*g)/C,O=T*T+D*D-1,k=2*(a+w*T+E*D),A=w*w+E*E-a*a,j=-(O?(k+Math.sqrt(k*k-4*O*A))/(2*O):A/k);return{x:r+w+T*j,y:i+E+D*j,r:j}}function place(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function intersects(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 score(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 Node(e){this._=e,this.next=null,this.previous=null}function packEnclose(e){if(!(i=e.length))return 0;var t=e[0],n,r,i,a,o,s,c,l,u,d;if(t.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;place(n,t,r=e[2]),t=new Node(t),n=new Node(n),r=new Node(r),t.next=r.previous=n,n.next=t.previous=r,r.next=n.previous=t;pack:for(s=3;s<i;++s){place(t._,n._,r=e[s]),r=new Node(r),c=n.next,l=t.previous,u=n._.r,d=t._.r;do if(u<=d){if(intersects(c._,r._)){n=c,t.next=n,n.previous=t,--s;continue pack}u+=c._.r,c=c.next}else{if(intersects(l._,r._)){t=l,t.next=n,n.previous=t,--s;continue pack}d+=l._.r,l=l.previous}while(c!==l.next);for(r.previous=t,r.next=n,t.next=n.previous=n=r,a=score(t);(r=r.next)!==n;)(o=score(r))<a&&(t=r,a=o);n=t.next}for(t=[n._],r=n;(r=r.next)!==n;)t.push(r._);for(r=enclose_default(t),s=0;s<i;++s)t=e[s],t.x-=r.x,t.y-=r.y;return r.r}function optional(e){return e==null?null:required(e)}function required(e){if(typeof e!=`function`)throw Error();return e}function constantZero(){return 0}function constant_default$2(e){return function(){return e}}__name(constant_default$2,`default`);function defaultRadius(e){return Math.sqrt(e.value)}function pack_default(){var e=null,t=1,n=1,r=constantZero;function pack(i){return i.x=t/2,i.y=n/2,e?i.eachBefore(radiusLeaf(e)).eachAfter(packChildren(r,.5)).eachBefore(translateChild(1)):i.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero,1)).eachAfter(packChildren(r,i.r/Math.min(t,n))).eachBefore(translateChild(Math.min(t,n)/(2*i.r))),i}return pack.radius=function(t){return arguments.length?(e=optional(t),pack):e},pack.size=function(e){return arguments.length?(t=+e[0],n=+e[1],pack):[t,n]},pack.padding=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$2(+e),pack):r},pack}__name(pack_default,`default`);function radiusLeaf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function packChildren(e,t){return function(n){if(r=n.children){var r,i,a=r.length,o=e(n)*t||0,s;if(o)for(i=0;i<a;++i)r[i].r+=o;if(s=packEnclose(r),o)for(i=0;i<a;++i)r[i].r-=o;n.r=s+o}}}function translateChild(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}var Bubble=class extends n.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];labelWidgets;d3Pack;constructor(){super(),t.I2DChart.call(this),t.ITooltip.call(this),n.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.labelWidgets={},this.d3Pack=pack_default().size([this.width(),this.height()]).padding(1.5)}size(e){let t=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),t}enter(e,t){super.enter(e,t),this._selection.widgetElement(t);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e[0]),value:e[1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){super.update(e,t);let r=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let i=hierarchy({children:this.cloneData()}).sum(function(e){return e[1]}).sort(function(e,t){return t[1]<e[1]?-1:+(t[1]>e[1])});this.d3Pack(i);let a=t.selectAll(`.node`).data(i.children||[],e=>e.data[0]);a.enter().append(`g`).attr(`class`,(e,t)=>`node series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){r.click(r.rowToObj(e.data),r.columns()[1],r._selection.selected(this))}).on(`dblclick`,function(e){r.dblclick(r.rowToObj(e.data),r.columns()[1],r._selection.selected(this))}).each(function(e){let t=(0,n.select)(this),i={x:e.x,y:e.y};t.append(`circle`).attr(`transform`,`translate(`+i.x+`,`+i.y+`)`).attr(`r`,0).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show),e.__viz_faChar?r.labelWidgets[e.data[0]]=new n.FAChar().char(e.__viz_faChar).target(this).render():r.labelWidgets[e.data[0]]=new n.Text().text(e.data[0]).target(this).render()}).merge(a).transition().attr(`opacity`,1).each(function(e){let t=(0,n.select)(this),i={x:e.x,y:e.y};t.select(`circle`).transition().attr(`transform`,`translate(`+i.x+`,`+i.y+`)`).style(`fill`,r.fillColor(e.data,r.columns()[1],e.data[1])).attr(`r`,e.r).select(`title`).text(e.data[0]+` (`+e.data[1]+`)`),e.__viz_faChar?r.labelWidgets[e.data[0]].pos(i).render():r.labelWidgets[e.data[0]].pos(i).colorFill_default(r.textColor(e.data,r.columns()[1],e.data[1])).width(e.r*2).text(e.data[0]).render()}),a.exit().transition().style(`opacity`,0).remove()}exit(e,t){super.exit(e,t)}};Bubble.prototype._class+=` chart_Bubble`,Bubble.prototype.implements(t.I2DChart.prototype),Bubble.prototype.implements(t.ITooltip.prototype),Bubble.prototype.mixin(n.Utility.SimpleSelectionMixin),Bubble.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Bubble.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Bubble.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]});var BubbleXY=class extends Scatter{constructor(){super()}enter(e,t){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(e,t)}};BubbleXY.prototype._class+=` chart_BubbleXY`;var P=0,F=0,I=0,L=1e3,R,z,B=0,V=0,H=0,U=typeof performance==`object`&&performance.now?performance:Date,ee=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function now(){return V||=(ee(clearNow),U.now()+H)}function clearNow(){V=0}function Timer(){this._call=this._time=this._next=null}Timer.prototype=timer.prototype={constructor:Timer,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?now():+n)+(t==null?0:+t),!this._next&&z!==this&&(z?z._next=this:R=this,z=this),this._call=e,this._time=n,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};function timer(e,t,n){var r=new Timer;return r.restart(e,t,n),r}function timerFlush(){now(),++P;for(var e=R,t;e;)(t=V-e._time)>=0&&e._call.call(null,t),e=e._next;--P}function wake(){V=(B=U.now())+H,P=F=0;try{timerFlush()}finally{P=0,nap(),V=0}}function poke(){var e=U.now(),t=e-B;t>L&&(H-=t,B=e)}function nap(){for(var e,t=R,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:R=n);z=e,sleep(r)}function sleep(e){P||(F&&=clearTimeout(F),e-V>24?(e<1/0&&(F=setTimeout(wake,e-U.now()-H)),I&&=clearInterval(I)):(I||=(B=U.now(),setInterval(poke,L)),P=1,ee(wake)))}function bullet_default(){var e=`left`,t=!1,r=!1,i=bulvarRanges,a=bulvarMarkers,o=bulvarMeasures,s=380,c=30,l=axisLeft();function bulvar(e){e.each(function(e,u){var d=i.call(this,e,u).slice().sort(n.descending),f=a.call(this,e,u).slice().sort(n.descending),p=o.call(this,e,u).slice().sort(n.descending),m=(0,n.select)(this),h,g,_=m.select(`g.wrap`);_.empty()&&(_=m.append(`g`).attr(`class`,`wrap`)),r?(h=c,g=s,_.attr(`transform`,`rotate(90)translate(0,`+-s+`)`)):(h=s,g=c,_.attr(`transform`,null));var v=(0,n.scaleLinear)().domain([0,Math.max(d[0],f[0],p[0])]).range(t?[h,0]:[0,h]),b=this.__chart__||(0,n.scaleLinear)().domain([0,1/0]).range(v.range());this.__chart__=v;var S=bulvarWidth(b),C=bulvarWidth(v),w=_.selectAll(`rect.range`).data(d);w.enter().append(`rect`).attr(`class`,function(e,t){return`range s`+t}).attr(`width`,S).attr(`height`,g).attr(`x`,t?b:0).merge(w).transition(w).attr(`x`,t?v:0).attr(`width`,C).attr(`height`,g);var T=_.selectAll(`rect.measure`).data(p);T.enter().append(`rect`).attr(`class`,function(e,t){return`measure s`+t}).attr(`width`,S).attr(`height`,g/3).attr(`x`,t?b:0).attr(`y`,g/3).merge(T).transition(T).attr(`width`,C).attr(`height`,g/3).attr(`x`,t?v:0).attr(`y`,g/3);var E=_.selectAll(`line.marker`).data(f);E.enter().append(`line`).attr(`class`,`marker`).attr(`x1`,b).attr(`x2`,b).attr(`y1`,g/6).attr(`y2`,g*5/6).merge(E).transition(E).attr(`x1`,v).attr(`x2`,v).attr(`y1`,g/6).attr(`y2`,g*5/6);var D=m.selectAll(`g.axis`).data([0]);D.enter().append(`g`).attr(`class`,`axis`),D.attr(`transform`,r?null:`translate(0,`+g+`)`).call(l.scale(v))}),timerFlush()}return bulvar.orient=function(n){return arguments.length?(e=n+``,t=e===`right`||e===`bottom`,l.orient((r=e===`top`||e===`bottom`)?`left`:`bottom`),bulvar):e},bulvar.ranges=function(e){return arguments.length?(i=e,bulvar):i},bulvar.markers=function(e){return arguments.length?(a=e,bulvar):a},bulvar.measures=function(e){return arguments.length?(o=e,bulvar):o},bulvar.width=function(e){return arguments.length?(s=+e,bulvar):s},bulvar.height=function(e){return arguments.length?(c=+e,bulvar):c},bulvar.tickFormat=function(e){return arguments.length?(l.tickFormat(e),bulvar):l.tickFormat()},bulvar}__name(bullet_default,`default`);function bulvarRanges(e){return e.ranges}function bulvarMarkers(e){return e.markers}function bulvarMeasures(e){return e.measures}function bulvarWidth(e){var t=e(0);return function(n){return Math.abs(e(n)-t)}}var Bullet=class extends n.HTMLWidget{_hiddenColumns={};constructor(){super(),n.Utility.SimpleSelectionMixin.call(this,!0)}bulletData(){let e=this;this._hiddenColumns={};let t=this.columns();return this.data().map(function(e){return{title:valueOf(e,this.titleColumn()),subtitle:valueOf(e,this.subtitleColumn()),ranges:valueOf(e,this.rangesColumn(),`range`),measures:valueOf(e,this.measuresColumn(),`measure`),markers:valueOf(e,this.markersColumn(),`marker`),origRow:e}},this);function valueOf(n,r,i){let a=t.indexOf(r);return a>=0?n[a]instanceof Array?n[a]:[n[a]]:(i&&(e._hiddenColumns[i]=!0),[0])}}enter(e,t){super.enter(e,t),(0,n.select)(e.parentNode).style(`overflow`,`auto`),this._selection.widgetElement(t)}update(e,t){super.update(e,t);let r=this;t.selectAll(`.axis`).style(`display`,`none`),t.selectAll(`.range,.measure,.marker`).style(`display`,null);let i={left:2,top:8,right:2,bottom:8},a=this.width()-i.left-i.right,o=40-i.top-i.bottom,s=t.selectAll(`svg`).data(this.bulletData()),c=s.enter().append(`svg`).attr(`class`,`bullet`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){r.click(r.rowToObj(e.origRow),r.titleColumn(),r._selection.selected(this))}).on(`dblclick`,function(e){r.dblclick(r.rowToObj(e.origRow),r.titleColumn(),r._selection.selected(this))}).each(function(){let e=(0,n.select)(this).append(`g`).attr(`class`,(e,t)=>`bulletBar series series-`+r.cssTag(r.titleColumn())).append(`g`).attr(`class`,`bulletTitle`);e.append(`text`).attr(`class`,`title`),e.append(`text`).attr(`class`,`subtitle`).attr(`dy`,`1em`)}).merge(s),l=c.select(`.bulletTitle`).style(`text-anchor`,`end`).attr(`transform`,`translate(-6,`+o/2+`)`);l.select(`.title`).text(function(e){return e.title}),l.select(`.subtitle`).text(function(e){return e.subtitle});let u=0;l.each(function(){let e=this.getBBox();e.width>u&&(u=e.width)});let d=bullet_default().width(a-u-6).height(o);c.attr(`width`,a).attr(`height`,o+i.top+i.bottom).style(`margin-left`,`${i.left}px`),c.select(`.bulletBar`).attr(`transform`,`translate(`+(u+6)+`,`+i.top+`)`).call(d),s.exit().remove(),Object.keys(this._hiddenColumns).length>0&&t.selectAll(`.${Object.keys(this._hiddenColumns).join(`,.`)}`).style(`display`,`none`)}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}_selection};Bullet.prototype._class+=` chart_Bullet`,Bullet.prototype.publish(`titleColumn`,null,`set`,`Title Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`subtitleColumn`,null,`set`,`Subtitle Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`rangesColumn`,null,`set`,`Ranges Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`measuresColumn`,null,`set`,`Measures Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`markersColumn`,null,`set`,`Markers Column`,function(){return this.columns()},{optional:!0});var te=Array.prototype.slice;function ascending_default(e,t){return e-t}__name(ascending_default,`default`);function area_default(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}__name(area_default,`default`);function constant_default$1(e){return function(){return e}}__name(constant_default$1,`default`);function contains_default(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=ringContains(e,t[n]))return i;return 0}__name(contains_default,`default`);function ringContains(e,t){for(var n=t[0],r=t[1],i=-1,a=0,o=e.length,s=o-1;a<o;s=a++){var c=e[a],l=c[0],u=c[1],d=e[s],f=d[0],p=d[1];if(segmentContains(c,d,t))return 0;u>r!=p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=-i)}return i}function segmentContains(e,t,n){var r;return collinear(e,t,n)&&within(e[r=+(e[0]===t[0])],n[r],t[r])}function collinear(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function within(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function noop_default$1(){}__name(noop_default$1,`default`);var W=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function contours_default(){var e=1,t=1,r=n.thresholdSturges,i=smoothLinear;function contours(e){var t=r(e);if(Array.isArray(t))t=t.slice().sort(ascending_default);else{var i=(0,n.extent)(e),a=i[0],o=i[1];t=(0,n.tickStep)(a,o,t),t=(0,n.range)(Math.floor(a/t)*t,Math.floor(o/t)*t,t)}return t.map(function(t){return contour(e,t)})}function contour(e,t){var n=[],r=[];return isorings(e,t,function(a){i(a,e,t),area_default(a)>0?n.push([a]):r.push(a)}),r.forEach(function(e){for(var t=0,r=n.length,i;t<r;++t)if(contains_default((i=n[t])[0],e)!==-1){i.push(e);return}}),{type:`MultiPolygon`,value:t,coordinates:n}}function isorings(n,r,i){var a=[],o=[],s=c=-1,c,l,u=n[0]>=r,d,f;for(W[u<<1].forEach(stitch);++s<e-1;)l=u,u=n[s+1]>=r,W[l|u<<1].forEach(stitch);for(W[u<<0].forEach(stitch);++c<t-1;){for(s=-1,u=n[c*e+e]>=r,d=n[c*e]>=r,W[u<<1|d<<2].forEach(stitch);++s<e-1;)l=u,u=n[c*e+e+s+1]>=r,f=d,d=n[c*e+s+1]>=r,W[l|u<<1|d<<2|f<<3].forEach(stitch);W[u|d<<3].forEach(stitch)}for(s=-1,d=n[c*e]>=r,W[d<<2].forEach(stitch);++s<e-1;)f=d,d=n[c*e+s+1]>=r,W[d<<2|f<<3].forEach(stitch);W[d<<3].forEach(stitch);function stitch(e){var t=[e[0][0]+s,e[0][1]+c],n=[e[1][0]+s,e[1][1]+c],r=index(t),l=index(n),u,d;(u=o[r])?(d=a[l])?(delete o[u.end],delete a[d.start],u===d?(u.ring.push(n),i(u.ring)):a[u.start]=o[d.end]={start:u.start,end:d.end,ring:u.ring.concat(d.ring)}):(delete o[u.end],u.ring.push(n),o[u.end=l]=u):(u=a[l])?(d=o[r])?(delete a[u.start],delete o[d.end],u===d?(u.ring.push(n),i(u.ring)):a[d.start]=o[u.end]={start:d.start,end:u.end,ring:d.ring.concat(u.ring)}):(delete a[u.start],u.ring.unshift(t),a[u.start=r]=u):a[r]=o[l]={start:r,end:l,ring:[t,n]}}}function index(t){return t[0]*2+t[1]*(e+1)*4}function smoothLinear(n,r,i){n.forEach(function(n){var a=n[0],o=n[1],s=a|0,c=o|0,l,u=r[c*e+s];a>0&&a<e&&s===a&&(l=r[c*e+s-1],n[0]=a+(i-l)/(u-l)-.5),o>0&&o<t&&c===o&&(l=r[(c-1)*e+s],n[1]=o+(i-l)/(u-l)-.5)})}return contours.contour=contour,contours.size=function(n){if(!arguments.length)return[e,t];var r=Math.ceil(n[0]),i=Math.ceil(n[1]);if(!(r>0)||!(i>0))throw Error(`invalid size`);return e=r,t=i,contours},contours.thresholds=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$1(Array.isArray(e)?te.call(e):e),contours):r},contours.smooth=function(e){return arguments.length?(i=e?smoothLinear:noop_default$1,contours):i===smoothLinear},contours}__name(contours_default,`default`);function blurX(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<i;++o)for(var s=0,c=0;s<r+n;++s)s<r&&(c+=e.data[s+o*r]),s>=n&&(s>=a&&(c-=e.data[s-a+o*r]),t.data[s-n+o*r]=c/Math.min(s+1,r-1+a-s,a))}function blurY(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<r;++o)for(var s=0,c=0;s<i+n;++s)s<i&&(c+=e.data[o+s*r]),s>=n&&(s>=a&&(c-=e.data[o+(s-a)*r]),t.data[o+(s-n)*r]=c/Math.min(s+1,i-1+a-s,a))}function defaultX(e){return e[0]}function defaultY(e){return e[1]}function defaultWeight(){return 1}function density_default(){var e=defaultX,t=defaultY,r=defaultWeight,i=960,a=500,o=20,s=2,c=o*3,l=i+c*2>>s,u=a+c*2>>s,d=constant_default$1(20);function density(i){var a=new Float32Array(l*u),f=new Float32Array(l*u);i.forEach(function(n,i,o){var d=+e(n,i,o)+c>>s,f=+t(n,i,o)+c>>s,p=+r(n,i,o);d>=0&&d<l&&f>=0&&f<u&&(a[d+f*l]+=p)}),blurX({width:l,height:u,data:a},{width:l,height:u,data:f},o>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:a},o>>s),blurX({width:l,height:u,data:a},{width:l,height:u,data:f},o>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:a},o>>s),blurX({width:l,height:u,data:a},{width:l,height:u,data:f},o>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:a},o>>s);var p=d(a);if(!Array.isArray(p)){var m=(0,n.max)(a);p=(0,n.tickStep)(0,m,p),p=(0,n.range)(0,Math.floor(m/p)*p,p),p.shift()}return contours_default().thresholds(p).size([l,u])(a).map(transform)}function transform(e){return e.value*=2**(-2*s),e.coordinates.forEach(transformPolygon),e}function transformPolygon(e){e.forEach(transformRing)}function transformRing(e){e.forEach(transformPoint)}function transformPoint(e){e[0]=e[0]*2**s-c,e[1]=e[1]*2**s-c}function resize(){return c=o*3,l=i+c*2>>s,u=a+c*2>>s,density}return density.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$1(+t),density):e},density.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$1(+e),density):t},density.weight=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$1(+e),density):r},density.size=function(e){if(!arguments.length)return[i,a];var t=Math.ceil(e[0]),n=Math.ceil(e[1]);if(!(t>=0)&&!(t>=0))throw Error(`invalid size`);return i=t,a=n,resize()},density.cellSize=function(e){if(!arguments.length)return 1<<s;if(!((e=+e)>=1))throw Error(`invalid cell size`);return s=Math.floor(Math.log(e)/Math.LN2),resize()},density.thresholds=function(e){return arguments.length?(d=typeof e==`function`?e:constant_default$1(Array.isArray(e)?te.call(e):e),density):d},density.bandwidth=function(e){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((e=+e)>=0))throw Error(`invalid bandwidth`);return o=Math.round((Math.sqrt(4*e*e+1)-1)/2),resize()},density}__name(density_default,`default`);function adder_default(){return new Adder}__name(adder_default,`default`);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(G,e,this.t),add(this,G.s,this.s),this.s?this.t+=G.t:this.s=G.t},valueOf:function(){return this.s}};var G=new Adder;function add(e,t,n){var r=e.s=t+n,i=r-t;e.t=t-(r-i)+(n-i)}var ne=Math.PI;ne/2,ne/4;var re=ne*2;180/ne,ne/180;var K=Math.abs,ie=Math.sqrt;function noop(){}function streamGeometry(e,t){e&&oe.hasOwnProperty(e.type)&&oe[e.type](e,t)}var ae={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)streamGeometry(n[r].geometry,t)}},oe={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){streamLine(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamLine(n[r],t,0)},Polygon:function(e,t){streamPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamPolygon(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)streamGeometry(n[r],t)}};function streamLine(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function streamPolygon(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)streamLine(e[n],t,1);t.polygonEnd()}function stream_default(e,t){e&&ae.hasOwnProperty(e.type)?ae[e.type](e,t):streamGeometry(e,t)}__name(stream_default,`default`);function identity_default(e){return e}__name(identity_default,`default`);var se=adder_default(),ce=adder_default(),le,ue,de,fe,pe={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){pe.lineStart=areaRingStart,pe.lineEnd=areaRingEnd},polygonEnd:function(){pe.lineStart=pe.lineEnd=pe.point=noop,se.add(K(ce)),ce.reset()},result:function(){var e=se/2;return se.reset(),e}};function areaRingStart(){pe.point=areaPointFirst}function areaPointFirst(e,t){pe.point=areaPoint,le=de=e,ue=fe=t}function areaPoint(e,t){ce.add(fe*e-de*t),de=e,fe=t}function areaRingEnd(){areaPoint(le,ue)}var me=1/0,he=me,ge=-me,_e=ge,ve={point:boundsPoint,lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var e=[[me,he],[ge,_e]];return ge=_e=-(he=me=1/0),e}};function boundsPoint(e,t){e<me&&(me=e),e>ge&&(ge=e),t<he&&(he=t),t>_e&&(_e=t)}var ye=0,be=0,xe=0,Se=0,Ce=0,we=0,Te=0,Ee=0,De=0,Oe,ke,q,J,Y={point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){Y.lineStart=centroidRingStart,Y.lineEnd=centroidRingEnd},polygonEnd:function(){Y.point=centroidPoint,Y.lineStart=centroidLineStart,Y.lineEnd=centroidLineEnd},result:function(){var e=De?[Te/De,Ee/De]:we?[Se/we,Ce/we]:xe?[ye/xe,be/xe]:[NaN,NaN];return ye=be=xe=Se=Ce=we=Te=Ee=De=0,e}};function centroidPoint(e,t){ye+=e,be+=t,++xe}function centroidLineStart(){Y.point=centroidPointFirstLine}function centroidPointFirstLine(e,t){Y.point=centroidPointLine,centroidPoint(q=e,J=t)}function centroidPointLine(e,t){var n=e-q,r=t-J,i=ie(n*n+r*r);Se+=i*(q+e)/2,Ce+=i*(J+t)/2,we+=i,centroidPoint(q=e,J=t)}function centroidLineEnd(){Y.point=centroidPoint}function centroidRingStart(){Y.point=centroidPointFirstRing}function centroidRingEnd(){centroidPointRing(Oe,ke)}function centroidPointFirstRing(e,t){Y.point=centroidPointRing,centroidPoint(Oe=q=e,ke=J=t)}function centroidPointRing(e,t){var n=e-q,r=t-J,i=ie(n*n+r*r);Se+=i*(q+e)/2,Ce+=i*(J+t)/2,we+=i,i=J*e-q*t,Te+=i*(q+e),Ee+=i*(J+t),De+=i*3,centroidPoint(q=e,J=t)}function PathContext(e){this._context=e}PathContext.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,re);break}},result:noop};var Ae=adder_default(),je,Me,Ne,Pe,Fe,Ie={point:noop,lineStart:function(){Ie.point=lengthPointFirst},lineEnd:function(){je&&lengthPoint(Me,Ne),Ie.point=noop},polygonStart:function(){je=!0},polygonEnd:function(){je=null},result:function(){var e=+Ae;return Ae.reset(),e}};function lengthPointFirst(e,t){Ie.point=lengthPoint,Me=Pe=e,Ne=Fe=t}function lengthPoint(e,t){Pe-=e,Fe-=t,Ae.add(ie(Pe*Pe+Fe*Fe)),Pe=e,Fe=t}function PathString(){this._string=[]}PathString.prototype={_radius:4.5,_circle:circle(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push(`Z`),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push(`M`,e,`,`,t),this._point=1;break;case 1:this._string.push(`L`,e,`,`,t);break;default:this._circle??=circle(this._radius),this._string.push(`M`,e,`,`,t,this._circle);break}},result:function(){if(this._string.length){var e=this._string.join(``);return this._string=[],e}else return null}};function circle(e){return`m0,`+e+`a`+e+`,`+e+` 0 1,1 0,`+-2*e+`a`+e+`,`+e+` 0 1,1 0,`+2*e+`z`}function path_default(e,t){var n=4.5,r,i;function path(e){return e&&(typeof n==`function`&&i.pointRadius(+n.apply(this,arguments)),stream_default(e,r(i))),i.result()}return path.area=function(e){return stream_default(e,r(pe)),pe.result()},path.measure=function(e){return stream_default(e,r(Ie)),Ie.result()},path.bounds=function(e){return stream_default(e,r(ve)),ve.result()},path.centroid=function(e){return stream_default(e,r(Y)),Y.result()},path.projection=function(t){return arguments.length?(r=t==null?(e=null,identity_default):(e=t).stream,path):e},path.context=function(e){return arguments.length?(i=e==null?(t=null,new PathString):new PathContext(t=e),typeof n!=`function`&&i.pointRadius(n),path):t},path.pointRadius=function(e){return arguments.length?(n=typeof e==`function`?e:(i.pointRadius(+e),+e),path):n},path.projection(e).context(t)}__name(path_default,`default`);var Contour=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerEnter(e,t,n=250){super.layerEnter(e,t,n)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n),this._palette=this._palette.switch(this.paletteID());let r=this.flattenData(this.layerColumns(e),this.layerData(e)),i=density_default().x(t=>this.xPos(e,t)).y(t=>this.yPos(e,t)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(r),a=i.map(e=>e.value),o=Math.min.apply(this,a),s=Math.max.apply(this,a);this._dataMinWeight=o,this._dataMaxWeight=s;let c=t.selectAll(`path`).data(i);c.enter().append(`path`).merge(c).attr(`d`,path_default()).attr(`fill`,e=>this.showContourFill()?this._palette(e.value,o,s):`none`).attr(`stroke`,this.contourStrokeColor()).attr(`stroke-linejoin`,`round`).attr(`stroke-width`,this.contourStrokeWidth()),c.exit().remove()}exit(e,t){super.exit(e,t)}};Contour.prototype._class+=` chart_Contour`,Contour.prototype.implements(t.I1DChart.prototype),Contour.prototype.publish(`paletteID`,`YlGnBu`,`string`,`Color palette for this widget`),Contour.prototype.publish(`useClonedPalette`,!0,`boolean`,`Enable or disable using a cloned palette`),Contour.prototype.publish(`showContourFill`,!0,`boolean`,`Show/hide the contour background colors`),Contour.prototype.publish(`showContour`,!0,`boolean`,`Show/hide the contour border lines`),Contour.prototype.publish(`contourBandwidth`,40,`number`,`Controls the sensitivity of the contour grouping algorithm`),Contour.prototype.publish(`contourStrokeColor`,`#2C3A47`,`html-color`,`Color of the contour border lines`),Contour.prototype.publish(`contourStrokeWidth`,1,`number`,`Width of the contour border lines`);var Gantt=class extends Bar{constructor(){super(),this.orientation_default(`vertical`).xAxisType_default(`ordinal`).yAxisType_default(`time`)}};Gantt.prototype._class+=` chart_Gantt`;function constant_default(e){return function constant(){return e}}__name(constant_default,`default`);var Le=Math.PI,Re=Le/2,ze=2*Le;function arcInnerRadius(e){return e.innerRadius}function arcOuterRadius(e){return e.outerRadius}function arcStartAngle(e){return e.startAngle}function arcEndAngle(e){return e.endAngle}function arcPadAngle(e){return e&&e.padAngle}function asin(e){return e>=1?Re:e<=-1?-Re:Math.asin(e)}function intersect(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=(u*(t-a)-d*(e-i))/(d*c-u*l);return[e+f*c,t+f*l]}function cornerTangents(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,b=h-p,S=v*v+b*b,C=i-a,w=f*h-m*p,T=(b<0?-1:1)*Math.sqrt(Math.max(0,C*C*S-w*w)),E=(w*b-v*T)/S,D=(-w*v-b*T)/S,O=(w*b+v*T)/S,k=(-w*v+b*T)/S,A=E-g,j=D-_,M=O-g,N=k-_;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-u,y01:-d,x11:E*(i/C-1),y11:D*(i/C-1)}}function arc_default(){var e=arcInnerRadius,t=arcOuterRadius,n=constant_default(0),r=null,i=arcStartAngle,a=arcEndAngle,o=arcPadAngle,s=null;function arc(){var c,l,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-Re,p=a.apply(this,arguments)-Re,m=Math.abs(p-f),h=p>f;if(s||=c=path(),d<u&&(l=d,d=u,u=l),!(d>1e-12))s.moveTo(0,0);else if(m>ze-1e-12)s.moveTo(d*Math.cos(f),d*Math.sin(f)),s.arc(0,0,d,f,p,!h),u>1e-12&&(s.moveTo(u*Math.cos(p),u*Math.sin(p)),s.arc(0,0,u,p,f,h));else{var g=f,_=p,v=f,b=p,S=m,C=m,w=o.apply(this,arguments)/2,T=w>1e-12&&(r?+r.apply(this,arguments):Math.sqrt(u*u+d*d)),E=Math.min(Math.abs(d-u)/2,+n.apply(this,arguments)),D=E,O=E,k,A;if(T>1e-12){var j=asin(T/u*Math.sin(w)),M=asin(T/d*Math.sin(w));(S-=j*2)>1e-12?(j*=h?1:-1,v+=j,b-=j):(S=0,v=b=(f+p)/2),(C-=M*2)>1e-12?(M*=h?1:-1,g+=M,_-=M):(C=0,g=_=(f+p)/2)}var N=d*Math.cos(g),P=d*Math.sin(g),F=u*Math.cos(b),I=u*Math.sin(b);if(E>1e-12){var L=d*Math.cos(_),R=d*Math.sin(_),z=u*Math.cos(v),B=u*Math.sin(v);if(m<Le){var V=S>1e-12?intersect(N,P,z,B,L,R,F,I):[F,I],H=N-V[0],U=P-V[1],ee=L-V[0],te=R-V[1],W=1/Math.sin(Math.acos((H*ee+U*te)/(Math.sqrt(H*H+U*U)*Math.sqrt(ee*ee+te*te)))/2),G=Math.sqrt(V[0]*V[0]+V[1]*V[1]);D=Math.min(E,(u-G)/(W-1)),O=Math.min(E,(d-G)/(W+1))}}C>1e-12?O>1e-12?(k=cornerTangents(z,B,N,P,d,O,h),A=cornerTangents(L,R,F,I,d,O,h),s.moveTo(k.cx+k.x01,k.cy+k.y01),O<E?s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,d,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),!h),s.arc(A.cx,A.cy,O,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):(s.moveTo(N,P),s.arc(0,0,d,g,_,!h)):s.moveTo(N,P),!(u>1e-12)||!(S>1e-12)?s.lineTo(F,I):D>1e-12?(k=cornerTangents(F,I,L,R,u,-D,h),A=cornerTangents(N,P,z,B,u,-D,h),s.lineTo(k.cx+k.x01,k.cy+k.y01),D<E?s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,u,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),h),s.arc(A.cx,A.cy,D,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):s.arc(0,0,u,b,v,h)}if(s.closePath(),c)return s=null,c+``||null}return arc.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Le/2;return[Math.cos(r)*n,Math.sin(r)*n]},arc.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(+e),arc):n},arc.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default(+e),arc):r},arc.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:constant_default(+e),arc):o},arc.context=function(e){return arguments.length?(s=e??null,arc):s},arc}__name(arc_default,`default`);function Linear(e){this._context=e}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function linear_default(e){return new Linear(e)}__name(linear_default,`default`);function x(e){return e[0]}function y(e){return e[1]}function line_default(){var e=x,t=y,n=constant_default(!0),r=null,i=linear_default,a=null;function line(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=path())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return line.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),line):e},line.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),line):t},line.defined=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(!!e),line):n},line.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),line):i},line.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),line):r},line}__name(line_default,`default`),curveRadial(linear_default);function Radial(e){this._curve=e}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function curveRadial(e){function radial(t){return new Radial(e(t))}return radial._curve=e,radial}Math.sqrt(1/3)*2;var Be=Math.sin(Le/10)/Math.sin(7*Le/10);Math.sin(ze/10)*Be,-Math.cos(ze/10)*Be,Math.sqrt(3)/2,(1/Math.sqrt(12)/2+1)*3;function noop_default(){}__name(noop_default,`default`);function point$3(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}__name(point$3,`point`);function Basis(e){this._context=e}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$3(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisClosed(e){this._context=e}BasisClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisOpen(e){this._context=e}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bundle(e,t){this._basis=new Basis(e),this._beta=t}Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},(function custom(e){function bundle(t){return e===1?new Basis(t):new Bundle(t,e)}return bundle.beta=function(e){return custom(+e)},bundle})(.85);function point$2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}__name(point$2,`point`);function Cardinal(e,t){this._context=e,this._k=(1-t)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$2(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new Cardinal(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalClosed(e,t){this._context=e,this._k=(1-t)/6}CardinalClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalClosed(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalOpen(e,t){this._context=e,this._k=(1-t)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalOpen(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function point$1(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}__name(point$1,`point`);function CatmullRom(e,t){this._context=e,this._alpha=t}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ve=(function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomClosed(e,t){this._context=e,this._alpha=t}CatmullRomClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomOpen(e,t){this._context=e,this._alpha=t}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function LinearClosed(e){this._context=e}LinearClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function sign(e){return e<0?-1:1}function slope3(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sign(a)+sign(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function slope2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function point(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function MonotoneX(e){this._context=e}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,point(this,slope2(this,n=slope3(this,e,t)),n);break;default:point(this,this._t0,n=slope3(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MonotoneY(e){this._context=new ReflectContext(e)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(e,t){MonotoneX.prototype.point.call(this,t,e)};function ReflectContext(e){this._context=e}ReflectContext.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Natural(e){this._context=e}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=controlPoints(e),i=controlPoints(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function controlPoints(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Step$1(e,t){this._context=e,this._t=t}__name(Step$1,`Step`),Step$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}},Array.prototype.slice;var He=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},classCallCheck=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},Ue=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We=function get(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:get(i,t,n)}else if(`value`in r)return r.value;else{var a=r.get;return a===void 0?void 0:a.call(n)}},inherits=function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},possibleConstructorReturn=function(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e},toConsumableArray=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)},Ge=function(){function Annotation(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.nx,o=e.ny,s=e.dy,c=s===void 0?0:s,l=e.dx,u=l===void 0?0:l,d=e.color,f=d===void 0?`grey`:d,p=e.data,m=e.type,h=e.subject,g=e.connector,_=e.note,v=e.disable,b=e.id,S=e.className;classCallCheck(this,Annotation),this._dx=a===void 0?u:a-n,this._dy=o===void 0?c:o-i,this._x=n,this._y=i,this._color=f,this.id=b,this._className=S||``,this._type=m||``,this.data=p,this.note=_||{},this.connector=g||{},this.subject=h||{},this.disable=v||[]}return Ue(Annotation,[{key:`updatePosition`,value:function updatePosition(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&this.type.subject.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawSubject())}},{key:`clearComponents`,value:function clearComponents(){this.type.clearComponents&&this.type.clearComponents()}},{key:`updateOffset`,value:function updateOffset(){this.type.setOffset&&(this.type.setOffset(),this.type.connector.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawConnector(),this.type.redrawNote())}},{key:`className`,get:function get$$1(){return this._className},set:function set$$1(e){this._className=e,this.type.setClassName&&this.type.setClassName()}},{key:`type`,get:function get$$1(){return this._type},set:function set$$1(e){this._type=e,this.clearComponents()}},{key:`x`,get:function get$$1(){return this._x},set:function set$$1(e){this._x=e,this.updatePosition()}},{key:`y`,get:function get$$1(){return this._y},set:function set$$1(e){this._y=e,this.updatePosition()}},{key:`color`,get:function get$$1(){return this._color},set:function set$$1(e){this._color=e,this.updatePosition()}},{key:`dx`,get:function get$$1(){return this._dx},set:function set$$1(e){this._dx=e,this.updateOffset()}},{key:`dy`,get:function get$$1(){return this._dy},set:function set$$1(e){this._dy=e,this.updateOffset()}},{key:`nx`,set:function set$$1(e){this._dx=e-this._x,this.updateOffset()}},{key:`ny`,set:function set$$1(e){this._dy=e-this._y,this.updateOffset()}},{key:`offset`,get:function get$$1(){return{x:this._dx,y:this._dy}},set:function set$$1(e){var t=e.x,n=e.y;this._dx=t,this._dy=n,this.updateOffset()}},{key:`position`,get:function get$$1(){return{x:this._x,y:this._y}},set:function set$$1(e){var t=e.x,n=e.y;this._x=t,this._y=n,this.updatePosition()}},{key:`translation`,get:function get$$1(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:`json`,get:function get$$1(){var e={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(e.data=this.data),this.type&&(e.type=this.type),this._className&&(e.className=this._className),Object.keys(this.connector).length>0&&(e.connector=this.connector),Object.keys(this.subject).length>0&&(e.subject=this.subject),Object.keys(this.note).length>0&&(e.note=this.note),e}}]),Annotation}(),Ke=function(){function AnnotationCollection(e){var t=e.annotations,n=e.accessors,r=e.accessorsInverse;classCallCheck(this,AnnotationCollection),this.accessors=n,this.accessorsInverse=r,this.annotations=t}return Ue(AnnotationCollection,[{key:`clearTypes`,value:function clearTypes(e){this.annotations.forEach(function(t){t.type=void 0,t.subject=e&&e.subject||t.subject,t.connector=e&&e.connector||t.connector,t.note=e&&e.note||t.note})}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(){var e=this;this.annotations.forEach(function(t){t.type.setPositionWithAccessors(e.accessors)})}},{key:`editMode`,value:function editMode(e){this.annotations.forEach(function(t){t.type&&(t.type.editMode=e,t.type.updateEditMode())})}},{key:`updateDisable`,value:function updateDisable(e){this.annotations.forEach(function(t){t.disable=e,t.type&&e.forEach(function(e){t.type[e]&&(t.type[e].remove&&t.type[e].remove(),t.type[e]=void 0)})})}},{key:`updateTextWrap`,value:function updateTextWrap(e){this.annotations.forEach(function(t){t.type&&t.type.updateTextWrap&&t.type.updateTextWrap(e)})}},{key:`updateText`,value:function updateText(){this.annotations.forEach(function(e){e.type&&e.type.drawText&&e.type.drawText()})}},{key:`updateNotePadding`,value:function updateNotePadding(e){this.annotations.forEach(function(t){t.type&&(t.type.notePadding=e)})}},{key:`json`,get:function get$$1(){var e=this;return this.annotations.map(function(t){var n=t.json;return e.accessorsInverse&&t.data&&(n.data={},Object.keys(e.accessorsInverse).forEach(function(r){n.data[r]=e.accessorsInverse[r]({x:t.x,y:t.y})})),n})}},{key:`noteNodes`,get:function get$$1(){return this.annotations.map(function(e){return X({},e.type.getNoteBBoxOffset(),{positionX:e.x,positionY:e.y})})}}]),AnnotationCollection}(),qe=function pointHandle(e){var t=e.cx,n=t===void 0?0:t,r=e.cy;return{move:{x:n,y:r===void 0?0:r}}},Je=function circleHandles(e){var t=e.cx,n=t===void 0?0:t,r=e.cy,i=r===void 0?0:r,a=e.r1,o=e.r2,s=e.padding,c={move:{x:n,y:i}};return a!==void 0&&(c.r1={x:n+a/Math.sqrt(2),y:i+a/Math.sqrt(2)}),o!==void 0&&(c.r2={x:n+o/Math.sqrt(2),y:i+o/Math.sqrt(2)}),s!==void 0&&(c.padding={x:n+a+s,y:i}),c},Ye=function addHandles(e){var t=e.group,r=e.handles,i=e.r,a=i===void 0?10:i,o=t.selectAll(`circle.handle`).data(r);o.enter().append(`circle`).attr(`class`,`handle`).attr(`fill`,`grey`).attr(`fill-opacity`,.1).attr(`cursor`,`move`).attr(`stroke-dasharray`,5).attr(`stroke`,`grey`).call((0,n.drag)().container((0,n.select)(`g.annotations`).node()).on(`start`,function(e){return e.start&&e.start(e)}).on(`drag`,function(e){return e.drag&&e.drag(e)}).on(`end`,function(e){return e.end&&e.end(e)})),t.selectAll(`circle.handle`).attr(`cx`,function(e){return e.x}).attr(`cy`,function(e){return e.y}).attr(`r`,function(e){return e.r||a}).attr(`class`,function(e){return`handle `+(e.className||``)}),o.exit().remove()},Xe=function leftRightDynamic(e,t){return(e===`dynamic`||e===`left`||e===`right`)&&(e=t<0?`top`:`bottom`),e},Ze=function topBottomDynamic(e,t){return(e===`dynamic`||e===`top`||e===`bottom`)&&(e=t<0?`right`:`left`),e},Qe=[`topBottom`,`top`,`bottom`],$e=[`leftRight`,`left`,`right`],noteAlignment=(function(e){var t=e.padding,n=t===void 0?0:t,r=e.bbox,i=r===void 0?{x:0,y:0,width:0,height:0}:r,a=e.align,o=e.orientation,s=e.offset,c=s===void 0?{x:0,y:0}:s,l=-i.x,u=0;return Qe.indexOf(o)===-1?$e.indexOf(o)!==-1&&(a=Xe(a,c.y),c.x<0&&o===`leftRight`||o===`left`?l-=i.width+n:l+=n,a===`middle`?u-=i.height/2:a===`top`&&(u-=i.height)):(a=Ze(a,c.x),c.y<0&&o===`topBottom`||o===`top`?u-=i.height+n:u+=n,a===`middle`?l-=i.width/2:a===`right`&&(l-=i.width)),{x:l,y:u}}),Z=function lineBuilder(e){var t=e.data,n=e.curve,r=n===void 0?linear_default:n,i=e.canvasContext,a=e.className,o=e.classID,s=line_default().curve(r),c={type:`path`,className:a,classID:o,data:t};return i?(s.context(i),c.pathMethods=s):c.attrs={d:s(t)},c},et=function arcBuilder(e){var t=e.data,n=e.canvasContext,r={type:`path`,className:e.className,classID:e.classID,data:t},i=arc_default().innerRadius(t.innerRadius||0).outerRadius(t.outerRadius||t.radius||2).startAngle(t.startAngle||0).endAngle(t.endAngle||2*Math.PI);return n?(i.context(n),r.pathMethods=lineGen):r.attrs={d:i()},r},noteVertical=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.bbox,s=e.offset;return t=Xe(t,s.y),t===`top`?a-=o.height:t===`middle`&&(a-=o.height/2),{components:[Z({data:[[r,a],[r,a+o.height]],className:`note-line`})]}}),noteHorizontal=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.offset,s=e.bbox;return t=Ze(t,o.x),t===`right`?r-=s.width:t===`middle`&&(r-=s.width/2),{components:[Z({data:[[r,a],[r+s.width,a]],className:`note-line`})]}}),tt=function lineSetup(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`circle`&&(l.outerRadius||l.radius)){var u=Math.sqrt((a-o)*(a-o)+(s-c)*(s-c)),d=Math.asin(-c/u),f=l.outerRadius||l.radius+(l.radiusPadding||0);a=Math.abs(Math.cos(d)*f)*(o<0?-1:1),s=Math.abs(Math.sin(d)*f)*(c<0?-1:1)}if(n===`rect`){var p=l.width,m=l.height;(p>0&&r.dx>0||p<0&&r.dx<0)&&(a=Math.abs(p)>Math.abs(r.dx)?p/2:p),(m>0&&r.dy>0||m<0&&r.dy<0)&&(s=Math.abs(m)>Math.abs(r.dy)?m/2:m),a===p/2&&s===m/2&&(a=o,s=c)}return[[a,s],[o,c]]},connectorLine=(function(e){return{components:[Z({data:tt(e),className:`connector`})]}}),connectorElbow=(function(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`rect`){var u=l.width,d=l.height;(u>0&&r.dx>0||u<0&&r.dx<0)&&(a=Math.abs(u)>Math.abs(r.dx)?u/2:u),(d>0&&r.dy>0||d<0&&r.dy<0)&&(s=Math.abs(d)>Math.abs(r.dy)?d/2:d),a===u/2&&s===d/2&&(a=o,s=c)}var f=[[a,s],[o,c]],p=c-s,m=o-a,h=o,g=c,_=c<s&&o>a||o<a&&c>s?-1:1;if(Math.abs(m)<Math.abs(p)?(h=o,g=s+m*_):(g=c,h=a+p*_),n===`circle`&&(l.outerRadius||l.radius)){var v=(l.outerRadius||l.radius)+(l.radiusPadding||0),b=v/Math.sqrt(2);if(Math.abs(m)>b&&Math.abs(p)>b)a=b*(o<0?-1:1),s=b*(c<0?-1:1),f=[[a,s],[h,g],[o,c]];else if(Math.abs(m)>Math.abs(p)){var S=Math.asin(-c/v);a=Math.abs(Math.cos(S)*v)*(o<0?-1:1),f=[[a,c],[o,c]]}else{var C=Math.acos(o/v);s=Math.abs(Math.sin(C)*v)*(c<0?-1:1),f=[[o,s],[o,c]]}}else f=[[a,s],[h,g],[o,c]];return{components:[Z({data:f,className:`connector`})]}}),connectorCurve=(function(e){var t=e.type,r=e.connectorData,i=e.subjectType;r||={},(!r.points||typeof r.points==`number`)&&(r.points=nt(t.annotation.offset,r.points)),r.curve||=Ve;var a=[];if(t.editMode){var o=r.points.map(function(e,t){return X({},qe({cx:e[0],cy:e[1]}),{index:t})}),s=function updatePoint(e){r.points[e][0]+=n.event.dx,r.points[e][1]+=n.event.dy,t.redrawConnector()};a=t.mapHandles(o.map(function(e){return X({},e.move,{drag:s.bind(t,e.index)})}))}var c=tt({type:t,subjectType:i});return c=[c[0]].concat(toConsumableArray(r.points),[c[1]]),{components:[Z({data:c,curve:r.curve,className:`connector`})],handles:a}}),nt=function createPoints(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n={x:e.x/(t+1),y:e.y/(t+1)},r=[],i=1;i<=t;i++)r.push([n.x*i+i%2*20,n.y*i-i%2*20]);return r},connectorArrow=(function(e){var t=e.annotation,n=e.start,r=e.end,i=e.scale,a=i===void 0?1:i,o=t.position;n=n?[-r[0]+n[0],-r[1]+n[1]]:[t.dx,t.dy],r||=[t.x-o.x,t.y-o.y];var s=r[0],c=r[1],l=n[0],u=n[1],d=10*a,f=16/180*Math.PI,p=Math.atan(u/l);return l<0&&(p+=Math.PI),{components:[Z({data:[[s,c],[Math.cos(p+f)*d+s,Math.sin(p+f)*d+c],[Math.cos(p-f)*d+s,Math.sin(p-f)*d+c],[s,c]],className:`connector-end connector-arrow`,classID:`connector-end`})]}}),connectorDot=(function(e){var t=e.line,n=e.scale,r=et({className:`connector-end connector-dot`,classID:`connector-end`,data:{radius:3*Math.sqrt(n===void 0?1:n)}});return r.attrs.transform=`translate(`+t.data[0][0]+`, `+t.data[0][1]+`)`,{components:[r]}}),subjectCircle=(function(e){var t=e.subjectData,r=e.type;!t.radius&&!t.outerRadius&&(t.radius=20);var i=[],a=et({data:t,className:`subject`});if(r.editMode){var o=Je({r1:a.data.outerRadius||a.data.radius,r2:a.data.innerRadius,padding:t.radiusPadding}),s=function updateRadius(e){t[e]=t[e]+n.event.dx*Math.sqrt(2),r.redrawSubject(),r.redrawConnector()},c=[X({},o.r1,{drag:s.bind(r,t.outerRadius===void 0?`radius`:`outerRadius`)})];t.innerRadius&&c.push(X({},o.r2,{drag:s.bind(r,`innerRadius`)})),i=r.mapHandles(c)}return a.attrs[`fill-opacity`]=0,{components:[a],handles:i}}),subjectRect=(function(e){var t=e.subjectData,r=e.type;t.width||=100,t.height||=100;var i=[],a=t.width,o=t.height,s=Z({data:[[0,0],[a,0],[a,o],[0,o],[0,0]],className:`subject`});if(r.editMode){var c=[{x:a,y:o/2,drag:function updateWidth(){t.width=n.event.x,r.redrawSubject(),r.redrawConnector()}.bind(r)},{x:a/2,y:o,drag:function updateHeight(){t.height=n.event.y,r.redrawSubject(),r.redrawConnector()}.bind(r)}];i=r.mapHandles(c)}return s.attrs[`fill-opacity`]=.1,{components:[s],handles:i}}),subjectThreshold=(function(e){var t=e.subjectData,n=e.type.annotation.position,r=(t.x1===void 0?n.x:t.x1)-n.x,i=(t.x2===void 0?n.x:t.x2)-n.x,a=(t.y1===void 0?n.y:t.y1)-n.y,o=(t.y2===void 0?n.y:t.y2)-n.y;return{components:[Z({data:[[r,a],[i,o]],className:`subject`})]}}),subjectBadge=(function(e){var t=e.subjectData,r=t===void 0?{}:t,i=e.type,a=i===void 0?{}:i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.typeSettings&&a.typeSettings.subject;r.radius||(s&&s.radius?r.radius=s.radius:r.radius=14),r.x||s&&s.x&&(r.x=s.x),r.y||s&&s.y&&(r.y=s.y);var c=[],l=[],u=r.radius,d=u*.7,f=0,p=0,m=Math.sqrt(2)*u,h={xleftcorner:-u,xrightcorner:u,ytopcorner:-u,ybottomcorner:u,xleft:-m,xright:m,ytop:-m,ybottom:m};r.x&&!r.y?f=h[`x`+r.x]:r.y&&!r.x?p=h[`y`+r.y]:r.x&&r.y&&(f=h[`x`+r.x+`corner`],p=h[`y`+r.y+`corner`]);var g=`translate(`+f+`, `+p+`)`,_=et({className:`subject`,data:{radius:u}});_.attrs.transform=g,_.attrs.fill=o.color,_.attrs[`stroke-linecap`]=`round`,_.attrs[`stroke-width`]=`3px`;var v=et({className:`subject-ring`,data:{outerRadius:u,innerRadius:d}});v.attrs.transform=g,v.attrs[`stroke-width`]=`3px`,v.attrs.fill=`white`;var b=void 0;if(f&&p||!f&&!p)b=Z({className:`subject-pointer`,data:[[0,0],[f||0,0],[0,p||0],[0,0]]});else if(f||p){var S=function notCornerPointerXY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return e&&e/Math.sqrt(2)/Math.sqrt(2)||t*u/Math.sqrt(2)};b=Z({className:`subject-pointer`,data:[[0,0],[S(f),S(p)],[S(f,-1),S(p,-1)],[0,0]]})}if(b&&(b.attrs.fill=o.color,b.attrs[`stroke-linecap`]=`round`,b.attrs[`stroke-width`]=`3px`,l.push(b)),a.editMode){var C={x:f*2,y:p*2,drag:function dragBadge(){r.x=n.event.x<-u*2?`left`:n.event.x>u*2?`right`:void 0,r.y=n.event.y<-u*2?`top`:n.event.y>u*2?`bottom`:void 0,a.redrawSubject()}.bind(a)};!C.x&&!C.y&&(C.y=-u),c=a.mapHandles([C])}var w=void 0;return r.text&&(w={type:`text`,className:`badge-text`,attrs:{fill:`white`,stroke:`none`,"font-size":`.7em`,text:r.text,"text-anchor":`middle`,dy:`.25em`,x:f,y:p}}),l.push(_),l.push(v),l.push(w),{components:l,handles:c}}),rt=function(){function Type(e){var t=e.a,n=e.annotation,r=e.editMode,i=e.dispatcher,a=e.notePadding,o=e.accessors;if(classCallCheck(this,Type),this.a=t,this.note=n.disable.indexOf(`note`)===-1&&t.select(`g.annotation-note`),this.noteContent=this.note&&t.select(`g.annotation-note-content`),this.connector=n.disable.indexOf(`connector`)===-1&&t.select(`g.annotation-connector`),this.subject=n.disable.indexOf(`subject`)===-1&&t.select(`g.annotation-subject`),this.dispatcher=i,i){var s=ct.bind(null,i,n);s({component:this.note,name:`note`}),s({component:this.connector,name:`connector`}),s({component:this.subject,name:`subject`})}this.annotation=n,this.editMode=n.editMode||r,this.notePadding=a===void 0?3:a,this.offsetCornerX=0,this.offsetCornerY=0,o&&n.data&&this.init(o)}return Ue(Type,[{key:`init`,value:function init(e){this.annotation.x||this.mapX(e),this.annotation.y||this.mapY(e)}},{key:`mapY`,value:function mapY(e){e.y&&(this.annotation.y=e.y(this.annotation.data))}},{key:`mapX`,value:function mapX(e){e.x&&(this.annotation.x=e.x(this.annotation.data))}},{key:`updateEditMode`,value:function updateEditMode(){this.a.selectAll(`circle.handle`).remove()}},{key:`drawOnSVG`,value:function drawOnSVG(e,t){var n=this;Array.isArray(t)||(t=[t]),t.filter(function(e){return e}).forEach(function(t){var r=t.type,i=t.className,a=t.attrs,o=t.handles,s=t.classID;if(r===`handle`)Ye({group:e,r:a&&a.r,handles:o});else{Q(e,[n.annotation],r,i,s);for(var c=e.select(r+`.`+(s||i)),l=Object.keys(a),u=[],d=c.node().attributes,f=d.length-1;f>=0;f--){var p=d[f].name;l.indexOf(p)===-1&&p!==`class`&&u.push(p)}l.forEach(function(e){e===`text`?c.text(a[e]):c.attr(e,a[e])}),u.forEach(function(e){return c.attr(e,null)})}})}},{key:`getNoteBBox`,value:function getNoteBBox(){return ut(this.note,`.annotation-note-content text`)}},{key:`getNoteBBoxOffset`,value:function getNoteBBoxOffset(){var e=ut(this.note,`.annotation-note-content`),t=this.noteContent.attr(`transform`).split(/\(|\,|\)/g);return e.offsetCornerX=parseFloat(t[1])+this.annotation.dx,e.offsetCornerY=parseFloat(t[2])+this.annotation.dy,e.offsetX=this.annotation.dx,e.offsetY=this.annotation.dy,e}},{key:`drawSubject`,value:function drawSubject(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.subject,r=t.type,i={type:this,subjectData:n},a={};r===`circle`?a=subjectCircle(i):r===`rect`?a=subjectRect(i):r===`threshold`?a=subjectThreshold(i):r===`badge`&&(a=subjectBadge(i,this.annotation));var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l;return c.forEach(function(t){t&&t.attrs&&!t.attrs.stroke&&(t.attrs.stroke=e.annotation.color)}),this.editMode&&(u=u.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),c.push({type:`handle`,handles:u})),c}},{key:`drawConnector`,value:function drawConnector(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.connector,r=n.type||t.type,i={type:this,connectorData:n};i.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a={};a=r===`curve`?connectorCurve(i):r===`elbow`?connectorElbow(i):connectorLine(i);var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l,d=c[0];d&&(d.attrs.stroke=this.annotation.color,d.attrs.fill=`none`);var f=n.end||t.end,p={};if(f===`arrow`){var m=d.data[1],h=d.data[0];Math.sqrt((m[0]-h[0])**2+(m[1]-h[1])**2)<5&&d.data[2]&&(m=d.data[2]),p=connectorArrow({annotation:this.annotation,start:m,end:h,scale:n.endScale})}else f===`dot`?p=connectorDot({line:d,scale:n.endScale}):(!f||f===`none`)&&this.connector&&this.connector.select(`.connector-end`).remove();return p.components&&(p.components.forEach(function(t){t.attrs.fill=e.annotation.color,t.attrs.stroke=e.annotation.color}),c=c.concat(p.components)),this.editMode&&u.length!==0&&c.push({type:`handle`,handles:u}),c}},{key:`drawNote`,value:function drawNote(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this.annotation.note,i=r.align||t.align||`dynamic`,a={bbox:t.bbox,align:i,offset:this.annotation.offset},o=r.lineType||t.lineType,s={};o===`vertical`?s=noteVertical(a):o===`horizontal`&&(s=noteHorizontal(a));var c=s,l=c.components,u=l===void 0?[]:l,d=c.handles,f=d===void 0?[]:d;if(u.forEach(function(t){t.attrs.stroke=e.annotation.color}),this.editMode){f=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),u.push({type:`handle`,handles:f});var p=this.dragNote.bind(this),m=this.dragstarted.bind(this),h=this.dragended.bind(this);this.note.call((0,n.drag)().container((0,n.select)(`g.annotations`).node()).on(`start`,function(e){return m(e)}).on(`drag`,function(e){return p(e)}).on(`end`,function(e){return h(e)}))}else this.note.on(`mousedown.drag`,null);return u}},{key:`drawNoteContent`,value:function drawNoteContent(e){var t=this.annotation.note,n=t.padding===void 0?this.notePadding:t.padding,r=t.orientation||e.orientation||`topBottom`,i=t.lineType||e.lineType,a=t.align||e.align||`dynamic`;i===`vertical`?r=`leftRight`:i===`horizontal`&&(r=`topBottom`);var o=noteAlignment({padding:n,bbox:e.bbox,offset:this.annotation.offset,orientation:r,align:a}),s=o.x,c=o.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=c+this.annotation.dy,this.note&&this.noteContent.attr(`transform`,`translate(`+s+`, `+c+`)`),[]}},{key:`drawOnScreen`,value:function drawOnScreen(e,t){return this.drawOnSVG(e,t)}},{key:`redrawSubject`,value:function redrawSubject(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:`redrawConnector`,value:function redrawConnector(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:`redrawNote`,value:function redrawNote(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:e})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:e}))}},{key:`setPosition`,value:function setPosition(){var e=this.annotation.position;this.a.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}},{key:`clearComponents`,value:function clearComponents(){this.subject&&this.subject.select(`*`).remove(),this.connector&&this.connector.select(`*`).remove()}},{key:`setOffset`,value:function setOffset(){if(this.note){var e=this.annotation.offset;this.note.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(e){e&&this.annotation.data&&(this.mapX(e),this.mapY(e)),this.setPosition()}},{key:`setClassName`,value:function setClassName(){this.a.attr(`class`,`annotation `+(this.className&&this.className())+` `+(this.editMode?`editable`:``)+` `+(this.annotation.className||``))}},{key:`draw`,value:function draw(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:`dragstarted`,value:function dragstarted(){n.event.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call(`dragstart`,this.a,this.annotation),this.a.classed(`dragging`,!0),this.a.selectAll(`circle.handle`).style(`pointer-events`,`none`)}},{key:`dragended`,value:function dragended(){this.dispatcher&&this.dispatcher.call(`dragend`,this.a,this.annotation),this.a.classed(`dragging`,!1),this.a.selectAll(`circle.handle`).style(`pointer-events`,`all`)}},{key:`dragSubject`,value:function dragSubject(){var e=this.annotation.position;e.x+=n.event.dx,e.y+=n.event.dy,this.annotation.position=e}},{key:`dragNote`,value:function dragNote(){var e=this.annotation.offset;e.x+=n.event.dx,e.y+=n.event.dy,this.annotation.offset=e}},{key:`mapHandles`,value:function mapHandles(e){var t=this;return e.map(function(e){return X({},e,{start:t.dragstarted.bind(t),end:t.dragended.bind(t)})})}}]),Type}(),it=function customType(e,t,n){return function(e){inherits(customType,e);function customType(e){classCallCheck(this,customType);var n=possibleConstructorReturn(this,(customType.__proto__||Object.getPrototypeOf(customType)).call(this,e));return n.typeSettings=t,t.disable&&t.disable.forEach(function(e){n[e]&&n[e].remove(),n[e]=void 0,e===`note`&&(n.noteContent=void 0)}),n}return Ue(customType,[{key:`className`,value:function className(){return``+(t.className||We(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this)&&We(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this).call(this)||``)}},{key:`drawSubject`,value:function drawSubject(e){return this.typeSettings.subject=X({},t.subject,this.typeSettings.subject),We(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawSubject`,this).call(this,X({},e,this.typeSettings.subject))}},{key:`drawConnector`,value:function drawConnector(e){return this.typeSettings.connector=X({},t.connector,this.typeSettings.connector),We(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawConnector`,this).call(this,X({},e,t.connector,this.typeSettings.connector))}},{key:`drawNote`,value:function drawNote(e){return this.typeSettings.note=X({},t.note,this.typeSettings.note),We(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNote`,this).call(this,X({},e,t.note,this.typeSettings.note))}},{key:`drawNoteContent`,value:function drawNoteContent(e){return We(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNoteContent`,this).call(this,X({},e,t.note,this.typeSettings.note))}}],[{key:`init`,value:function init(e,t){return We(customType.__proto__||Object.getPrototypeOf(customType),`init`,this).call(this,e,t),n&&(e=n(e,t)),e}}]),customType}(e)},at=function(e){inherits(d3NoteText,e);function d3NoteText(e){classCallCheck(this,d3NoteText);var t=possibleConstructorReturn(this,(d3NoteText.__proto__||Object.getPrototypeOf(d3NoteText)).call(this,e));return t.textWrap=e.textWrap||120,t.drawText(),t}return Ue(d3NoteText,[{key:`updateTextWrap`,value:function updateTextWrap(e){this.textWrap=e,this.drawText()}},{key:`drawText`,value:function drawText(){if(this.note){Q(this.note,[this.annotation],`g`,`annotation-note-content`);var e=this.note.select(`g.annotation-note-content`);Q(e,[this.annotation],`rect`,`annotation-note-bg`),Q(e,[this.annotation],`text`,`annotation-note-label`),Q(e,[this.annotation],`text`,`annotation-note-title`);var t={height:0},n=this.a.select(`text.annotation-note-label`),r=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,i=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,o={top:0,bottom:0,left:0,right:0};if(typeof a==`number`?o={top:a,bottom:a,left:a,right:a}:a&&(a===void 0?`undefined`:He(a))===`object`&&(o=X(o,a)),this.annotation.note.title){var s=this.a.select(`text.annotation-note-title`);s.text(this.annotation.note.title),s.attr(`fill`,this.annotation.color),s.attr(`font-weight`,`bold`),s.call(lt,r,i),t=s.node().getBBox()}n.text(this.annotation.note.label).attr(`dx`,`0`),n.call(lt,r,i),n.attr(`y`,t.height*1.1||0),n.attr(`fill`,this.annotation.color);var c=this.getNoteBBox();this.a.select(`rect.annotation-note-bg`).attr(`width`,c.width+o.left+o.right).attr(`height`,c.height+o.top+o.bottom).attr(`x`,c.x-o.left).attr(`y`,-o.top).attr(`fill`,`white`).attr(`fill-opacity`,0)}}}]),d3NoteText}(rt);it(at,{className:`label`,note:{align:`middle`}});var ot=it(at,{className:`callout`,note:{lineType:`horizontal`}}),st=it(ot,{className:`callout elbow`,connector:{type:`elbow`}});it(ot,{className:`callout curve`,connector:{type:`curve`}}),it(rt,{className:`badge`,subject:{type:`badge`},disable:[`connector`,`note`]}),it(at,{className:`callout circle`,subject:{type:`circle`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),it(at,{className:`callout rect`,subject:{type:`rect`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),it(function(e){inherits(ThresholdMap,e);function ThresholdMap(){return classCallCheck(this,ThresholdMap),possibleConstructorReturn(this,(ThresholdMap.__proto__||Object.getPrototypeOf(ThresholdMap)).apply(this,arguments))}return Ue(ThresholdMap,[{key:`mapY`,value:function mapY(e){We(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapY`,this).call(this,e);var t=this.annotation;(t.subject.x1||t.subject.x2)&&t.data&&e.y&&(t.y=e.y(t.data)),(t.subject.x1||t.subject.x2)&&!t.x&&(t.x=t.subject.x1||t.subject.x2)}},{key:`mapX`,value:function mapX(e){We(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapX`,this).call(this,e);var t=this.annotation;(t.subject.y1||t.subject.y2)&&t.data&&e.x&&(t.x=e.x(t.data)),(t.subject.y1||t.subject.y2)&&!t.y&&(t.y=t.subject.y1||t.subject.y2)}}]),ThresholdMap}(ot),{className:`callout xythreshold`,subject:{type:`threshold`}});var Q=function newWithClass(e,t,n,r,i){var a=e.selectAll(n+`.`+(i||r)).data(t);return a.enter().append(n).merge(a).attr(`class`,r),a.exit().remove(),e},ct=function addHandlers(e,t,n){var r=n.component,i=n.name;r&&r.on(`mouseover.annotations`,function(){e.call(i+`over`,r,t)}).on(`mouseout.annotations`,function(){return e.call(i+`out`,r,t)}).on(`click.annotations`,function(){return e.call(i+`click`,r,t)})},lt=function wrap(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1.2;e.each(function(){for(var e=(0,n.select)(this),a=e.text().split(r||/[ \t\r\n]+/).reverse().filter(function(e){return e!==``}),o=void 0,s=[],c=e.text(null).append(`tspan`).attr(`x`,0).attr(`dy`,`0.8em`);o=a.pop();)s.push(o),c.text(s.join(` `)),c.node().getComputedTextLength()>t&&s.length>1&&(s.pop(),c.text(s.join(` `)),s=[o],c=e.append(`tspan`).attr(`x`,0).attr(`dy`,i+`em`).text(o))})},ut=function bboxWithoutHandles(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`:not(.handle)`;return e?e.selectAll(t).nodes().reduce(function(e,t){var n=t.getBBox();e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),e.width=Math.max(e.width,n.width);var r=t&&t.attributes&&t.attributes.y;return e.height=Math.max(e.height,(r&&parseFloat(r.value)||0)+n.height),e},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function annotation(){var e=[],t=void 0,r=void 0,i=[],a={},o={},s=!1,c=void 0,l=ot,u=void 0,d=void 0,f=(0,n.dispatch)(`subjectover`,`subjectout`,`subjectclick`,`connectorover`,`connectorout`,`connectorclick`,`noteover`,`noteout`,`noteclick`,`dragend`,`dragstart`),p=void 0,m=function annotation(r){p=r,s||r.selectAll(`circle.handle`).remove();var m=e.map(function(e){return e.type||=l,e.disable||=i,new Ge(e)});t||=new Ke({annotations:m,accessors:a,accessorsInverse:o,ids:c}),r.selectAll(`g`).data([t]).enter().append(`g`).attr(`class`,`annotations`);var h=r.select(`g.annotations`);Q(h,t.annotations,`g`,`annotation`),h.selectAll(`g.annotation`).each(function(e){var t=(0,n.select)(this);t.attr(`class`,`annotation`),Q(t,[e],`g`,`annotation-connector`),Q(t,[e],`g`,`annotation-subject`),Q(t,[e],`g`,`annotation-note`),Q(t.select(`g.annotation-note`),[e],`g`,`annotation-note-content`),e.type=e.type.toString()===`[object Object]`?e.type:new e.type({a:t,annotation:e,textWrap:u,notePadding:d,editMode:s,dispatcher:f,accessors:a}),e.type.draw(),e.type.drawText&&e.type.drawText()})};return m.json=function(){return console.log(`Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.`,t.json),window.copy(JSON.stringify(t.json.map(function(e){return delete e.type,e}))),m},m.update=function(){return e&&t&&(e=t.annotations.map(function(e){return e.type.draw(),e})),m},m.updateText=function(){return t&&(t.updateText(u),e=t.annotations),m},m.updatedAccessors=function(){return t.setPositionWithAccessors(),e=t.annotations,m},m.disable=function(n){return arguments.length?(i=n,t&&(t.updateDisable(i),e=t.annotations),m):i},m.textWrap=function(n){return arguments.length?(u=n,t&&(t.updateTextWrap(u),e=t.annotations),m):u},m.notePadding=function(n){return arguments.length?(d=n,t&&(t.updateNotePadding(d),e=t.annotations),m):d},m.type=function(n,r){return arguments.length?(l=n,t&&(t.annotations.map(function(e){e.type.note&&e.type.note.selectAll(`*:not(.annotation-note-content)`).remove(),e.type.noteContent&&e.type.noteContent.selectAll(`*`).remove(),e.type.subject&&e.type.subject.selectAll(`*`).remove(),e.type.connector&&e.type.connector.selectAll(`*`).remove(),e.type.typeSettings={},e.type=l,e.subject=r&&r.subject||e.subject,e.connector=r&&r.connector||e.connector,e.note=r&&r.note||e.note}),e=t.annotations),m):l},m.annotations=function(n){return arguments.length?(e=n,t&&t.annotations&&(e.some(function(e){return!e.type||e.type.toString()!==`[object Object]`})?(t=null,m(p)):t.annotations=e),m):t&&t.annotations||e},m.context=function(e){return arguments.length?(r=e,m):r},m.accessors=function(e){return arguments.length?(a=e,m):a},m.accessorsInverse=function(e){return arguments.length?(o=e,m):o},m.ids=function(e){return arguments.length?(c=e,m):c},m.editMode=function(n){return arguments.length?(s=n,p&&p.selectAll(`g.annotation`).classed(`editable`,s),t&&(t.editMode(s),e=t.annotations),m):s},m.collection=function(e){return arguments.length?(t=e,m):t},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m}function value2Angle(e){return(e-.5)*.65*2*Math.PI}function pointOnArc(e,t){return{x:Math.cos(e-Math.PI/2)*t,y:Math.sin(e-Math.PI/2)*t}}function indicatorTranslate(e,t,n=!1){let r=pointOnArc(e,t),i=e*180/Math.PI+(n===!0?180:0);return`translate(${r.x}, ${r.y}) rotate(${i})`}function indicatorTween(e,t,r=!1){return function(i){let a=(0,n.interpolate)(i.angle,e);return i.angle=e,function(e){return indicatorTranslate(a(e),t,r)}}}function arcTween(e,t,r){return function(i){let a=(0,n.interpolate)(i.startAngle,e),o=(0,n.interpolate)(i.endAngle,t);return function(e){return i.startAngle=a(e),i.endAngle=o(e),r(i)}}}var $=class Gauge extends n.SVGWidget{_d3Arc=arc_default$1().innerRadius(85).outerRadius(100);_colorScale=(0,n.scaleLinear)().interpolate(n.interpolateHcl);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(e){if(e===null||e.label===``)this._tooltipG.transition().style(`opacity`,0).on(`interrupt end`,()=>{this._tooltipG.selectAll(`g`).remove()});else{this._tooltipG.interrupt().style(`opacity`,1),e.w=this._centerText.datum().w+10;let t=`horizontal`,n=0,r=5,i=5;e.y>=5&&e.y<=25?(n=e.x<0?-e.w/2:e.w/2,r=12.5,i=void 0,t=`vertical`):e.y>25&&(r=25,i=0);let a=annotation().type(st).annotations([{data:e,dx:-e.x+n,dy:-e.y+r,color:`black`,note:{label:e.label,lineType:t,padding:i,align:`middle`}}]).accessors({x:e=>e.x,y:e=>e.y});this._tooltipG.call(a)}}calcSize(e,t,n){let r=e.node().getBBox(),i=t/r.width,a=n/r.height,o=i<a?i:a;return{width:r.width,height:r.height,scale:o}}updateText(e,t,n,r,i){e.datum({x:t,y:n,w:r,h:i}).attr(`transform`,null);let a=this.calcSize(e,r,i),o=t+r/2-a.width/2*a.scale,s=n+i/2-a.height/2*a.scale;e.attr(`transform`,`translate(${o}, ${s}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(e,t){super.enter(e,t),t.on(`click`,e=>{this.click(e)}),this._usageArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`green`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._freeArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(1)}).style(`fill`,`lightGrey`),this._meanArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`black`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.tickValueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._mainTooltip=t.append(`title`);let n=this;function appendIndicator(){return t.append(`path`).datum({angle:value2Angle(0)}).style(`fill`,`black`).style(`stroke`,`black`).attr(`d`,`M 0 0 l -3 -3 l 6 0 z`).on(`mousemove`,e=>{let[t,r]=n._d3Arc.centroid(n._meanArc.datum());n.tip({x:t,y:r,label:n.tickValueDescription()})}).on(`mouseout`,e=>{n.tip(null)})}this._indInner=appendIndicator(),this._indOuter=appendIndicator(),this._centerText=t.append(`text`).attr(`dy`,`.66em`).style(`fill`,`green`).on(`mousemove`,e=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._bottomText=t.append(`text`).attr(`dy`,`.66em`).on(`mousemove`,e=>{this.tip({x:0,y:e.y,label:this.titleDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._tooltipG=t.append(`g`).attr(`class`,`annotation-tip`)}update(e,t){super.update(e,t),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),t.attr(`title`,this.tooltip()).style(`cursor`,this.click===Gauge.prototype.click?null:`pointer`);let r=this.calcWidth()/3,i=this.calcWidth()/2-5;this._d3Arc.innerRadius(r).outerRadius(i);let a=this.value(),o=this.tickValue();this._usageArc.style(`fill`,this._colorScale(a)).transition().duration(750).attrTween(`d`,arcTween(value2Angle(0),value2Angle(a),this._d3Arc)),this._freeArc.style(`fill`,this.emptyColor()).transition().duration(750).attrTween(`d`,arcTween(value2Angle(a),value2Angle(1),this._d3Arc)),this._meanArc.style(`fill`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`d`,arcTween(value2Angle(o-.001),value2Angle(o+.001),this._d3Arc)),this._indInner.style(`fill`,this.tickColor()).style(`stroke`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`transform`,indicatorTween(value2Angle(o),r,!0)),this._indOuter.style(`fill`,this.tickColor()).style(`stroke`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`transform`,indicatorTween(value2Angle(o),i)),this._centerText.style(`fill`,this._colorScale(a)).text((0,n.format)(`.0%`)(a)),this._bottomText.style(`fill`,this.click===Gauge.prototype.click?this.titleColor():this.titleClickColor()).style(`text-decoration`,this.click===Gauge.prototype.click?null:`underline`).text(this.title());let s=pointOnArc(value2Angle(1),r-8);this.updateText(this._centerText,-s.x,-s.y,2*s.x,2*s.y);let c=pointOnArc(value2Angle(1),i);c.y+=5;let l=this.calcWidth()-20,u=this.calcWidth()/2-c.y-5;this.updateText(this._bottomText,-l/2,c.y,l,u),this._mainTooltip.text(this.tooltip())}click(e){}};$.prototype._class+=` chart_Gauge`,$.prototype.publish(`title`,``,`string`,`Title`),$.prototype.publish(`titleDescription`,``,`string`,`Title Description`),$.prototype.publish(`titleColor`,`black`,`html-color`,`Color of the title text`),$.prototype.publish(`titleClickColor`,`blue`,`html-color`,`Color of the title text when clickable`),$.prototype.publish(`maxDiameter`,128,`number`,`Max Diameter`),$.prototype.publish(`value`,0,`number`,`Value`),$.prototype.publish(`valueDescription`,``,`string`,`Value Description`),$.prototype.publish(`showTick`,!1,`boolean`,`Show Tick`),$.prototype.publish(`tickValue`,0,`number`,`Tick Value`),$.prototype.publish(`tickValueDescription`,``,`string`,`Tick Value Description`),$.prototype.publish(`tooltip`,``,`string`,`Tooltip`),$.prototype.publish(`colorRange`,[`green`,`green`,`green`,`green`,`green`,`green`,`green`,`green`,`orange`,`red`,`red`],`array`,`Array of colors for the filled gauge portion. The fill color will be relative to the gauge value.`),$.prototype.publish(`colorDomain`,[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],`array`,`This array augments the mapping of the value to the fill colorRange.`),$.prototype.publish(`emptyColor`,`lightgrey`,`html-color`,`Color of the empty portion of the gauge`),$.prototype.publish(`tickColor`,`black`,`html-color`,`Color of the tick`);var sortAscending=(e,t)=>e[1]-t[1]>0?1:-1,sortDescending=(e,t)=>e[1]-t[1]>0?-1:1,Pie=class extends n.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),t.I2DChart.call(this),t.ITooltip.call(this),n.Utility.SimpleSelectionMixin.call(this),this.d3Pie=pie_default(),this.d3Arc=arc_default$1(),this.d3LabelArc=arc_default$1(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(e,t){return this.intersectCircle(this.calcOuterRadius(),e,t)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e},!1)),`Verdana`,12).width,t=this._size.width-(this.showLabels()?e*2:0)-20,n=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),r=Math.min(t,n)/2-2;return t/2-2<this.minOuterRadius()?this._labelWidthLimit=e-(this.minOuterRadius()-(t/2-2)):this._labelWidthLimit=e,r<this.minOuterRadius()?this.minOuterRadius():r}calcSmallValueLabelHeight(){let e=this.data().reduce((e,t)=>e+t[1],0),t=0;return this.data().forEach(n=>{n[1]/e<.1&&t++}),this.labelHeight()*t}calcTotalValue(){return this.data().reduce((e,t)=>e+t[1],0)}calcPadAngleRadians(){let e=this.slicePadding();return e>0?Math.min(e,.05):0}getLabelText(e,t){let n,r=e.data[0];if(this._labelWidthLimit!==void 0&&t){let e=this.textSize(r,`Verdana`,this.labelHeight()).width;this._labelWidthLimit<e&&(n=r.length*(this._labelWidthLimit/e)-3,r=n<r.length?r.slice(0,n)+`...`:r)}if(this.showSeriesValue()&&(r+=` : ${this._seriesValueFormatter(e.data[1])}`),this.showSeriesPercentage()){let t=this._totalValue,n=this.dataMeta();n.sum!==void 0&&(t=n.sum);let i=e.data[1]/t*100;r+=` : ${this._seriesPercentageFormatter(i)}%`}return r}selection(e){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch{return}let t=JSON.stringify(e);this._selection.selection2(e=>t===JSON.stringify(e.data))}selectByLabel(e){let t=this.data().filter(t=>t[0]===e)[0];t&&this.selection(t)}_slices;_labels;enter(e,t){super.enter(e,t),this._selection.widgetElement(t).skipBringToTop(!0),this._slices=t.append(`g`),this._labels=t.append(`g`);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e.data[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e.data[0]),value:e.data[r+1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let r=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=(0,n.format)(this.seriesValueFormat()),this._seriesPercentageFormatter=(0,n.format)(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();let i=this.calcOuterRadius(),a=Math.max(this.calcInnerRadius(),Math.min(i/30,6)),o=i+12;this.d3Arc.innerRadius(a).padRadius(i).outerRadius(i).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];let s=[...this.data()];switch(this.sortDataByValue()){case`ascending`:s.sort(sortAscending);break;case`descending`:s.sort(sortDescending);break}let c=this._slices.selectAll(`.arc`).data(this.d3Pie(s),e=>e.data[0]);this._labelPositions=[],c.enter().append(`g`).attr(`class`,(e,t)=>`arc series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){r.click(r.rowToObj(e.data),r.columns()[1],r._selection.selected(this))}).on(`dblclick`,function(e){r.dblclick(r.rowToObj(e.data),r.columns()[1],r._selection.selected(this))}).on(`keydown`,function(e,t){let i=(0,n.d3Event)();r.tabNavigation()&&(i.code===`Space`||i.key===`Enter`)&&(i.preventDefault(),r._selection.click(this))}).each(function(e,t){(0,n.select)(this).append(`path`).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).on(`mouseover`,arcTween(0,0)).on(`mouseout`,arcTween(-5,150))}).merge(c).transition().attr(`opacity`,1).attr(`tabindex`,r.tabNavigation()?`0`:null).attr(`role`,r.tabNavigation()?`button`:null).attr(`aria-label`,r.tabNavigation()?e=>`${e.data[0]}: ${e.data[1]}`:null).each(function(e,t){let a=r.getQuadrant(midAngle(e));r._quadIdxArr[a].push(t),e.outerRadius=i-5,(0,n.select)(this).select(`path`).transition().attr(`d`,r.d3Arc).style(`fill`,r.fillColor(e.data,r.columns()[1],e.data[1]))}),c.exit().transition().style(`opacity`,0).remove(),this.d3LabelArc.innerRadius(o).outerRadius(o);let l=this._labels.selectAll(`text`).data(this.showLabels()?this.d3Pie(s):[],e=>e.data[0]),u=l.enter().append(`text`).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).attr(`dy`,`.5em`).on(`click`,function(e){r._slices.selectAll(`g`).filter(function(t){e.data===t.data&&(r._selection.click(this),r.click(r.rowToObj(e.data),r.columns()[1],r._selection.selected(this)))})}).on(`dblclick`,function(e){r._slices.selectAll(`g`).filter(function(t){e.data===t.data&&r.dblclick(r.rowToObj(e.data),r.columns()[1],r._selection.selected(this))})}).merge(l).text(e=>this.getLabelText(e,!0)).each(function(e,t){let n=r.d3LabelArc.centroid(e),i=midAngle(e);n[0]=o*(r.isLeftSide(i)?1:-1),r._labelPositions.push({top:n[1],bottom:n[1]+r.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),u.transition().style(`font-size`,this.labelHeight()+`px`).attr(`transform`,(e,t)=>{let n=r.d3LabelArc.centroid(e);return n[0]=o*(r.isLeftSide(midAngle(e))?1:-1),n[1]=r._labelPositions[t].top,`translate(`+n+`)`}).style(`text-anchor`,e=>this.isLeftSide(midAngle(e))?`start`:`end`)),l.exit().remove();let d=this._labels.selectAll(`polyline`).data(this.showLabels()?this.d3Pie(s):[],e=>this.getLabelText(e,!0));d.enter().append(`polyline`).merge(d).transition().attr(`points`,function(e,t){let n=r.d3LabelArc.centroid(e),i=r.d3Arc.centroid(e),a=[...n];return n[0]=o*(r.isLeftSide(midAngle(e))?1:-1),n[1]=r._labelPositions[t].top,[i,a,n]}),d.exit().remove(),this.showLabels()&&this.centerOnLabels();function midAngle(e){return e.startAngle+(e.endAngle-e.startAngle)/2}function arcTween(e,t){return function(){(0,n.select)(this).transition().delay(t).attrTween(`d`,function(t){let a=(0,n.interpolate)(t.outerRadius,i+e);return function(e){return t.outerRadius=a(e),r.d3Arc(t)}})}}}isLeftSide(e){return e=(0,r.normalizeRadians)(e),e>Math.PI*2?e:e<Math.PI&&e>0}getQuadrant(e){let t=0,n=(0,r.normalizeRadians)(e);return t=n<=Math.PI*1&&n>=Math.PI*.5?3:t,t=n<=Math.PI*.5&&n>=Math.PI*0?2:t,t=n<=Math.PI*0&&n>=Math.PI*-.5?1:t,t}centerOnLabels(){let e=this.pos().y,t=e*2,n=this.calcOuterRadius(),r=Math.min(this._minLabelTop,-n),i=Math.max(this._maxLabelBottom,n),a=t-(i-r),o=Math.abs(this._minLabelTop),s=0;i>e?(s=e-i+this.labelHeight()/2,s-=a/2):r<0&&o>e&&(s=o-e+this.labelHeight()/2,s+=a/2);let c=this.pos();this.pos({y:c.y+s,x:c.x})}adjustForOverlap(){let e=this.labelHeight();this._quadIdxArr.forEach((t,n)=>{this._quadIdxArr[n].sort((e,t)=>{if(n===1||n===2)return this._labelPositions[e].top>this._labelPositions[t].top?-1:1;if(n===0||n===3)return this._labelPositions[e].top>this._labelPositions[t].top?1:-1});let r;this._quadIdxArr[n].forEach((t,i)=>{if(i>0){if(n===1||n===2){if(r<this._labelPositions[t].bottom){let e=this._labelPositions[t].bottom-r;this._labelPositions[t].top-=e,this._labelPositions[t].bottom-=e}}else if((n===0||n===3)&&r+e>this._labelPositions[t].top){let n=Math.abs(this._labelPositions[t].top)-Math.abs(r+e);this._labelPositions[t].top-=n,this._labelPositions[t].bottom-=n}}r=this._labelPositions[t].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((e,t)=>{this._quadIdxArr[t].forEach((e,t)=>{this._minLabelTop>this._labelPositions[e].top&&(this._minLabelTop=this._labelPositions[e].top),this._maxLabelBottom<this._labelPositions[e].bottom&&(this._maxLabelBottom=this._labelPositions[e].bottom)})})}exit(e,t){super.exit(e,t)}updateD3Pie(){let e=(0,r.normalizeRadians)((0,r.degreesToRadians)(this.startAngle()));switch(this.sortDataByValue()){case`ascending`:this.d3Pie.sort(sortAscending);break;case`descending`:this.d3Pie.sort(sortDescending);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(e).endAngle(2*Math.PI+e).value(function(e){return e[1]})}};Pie.prototype._class+=` chart_Pie`,Pie.prototype.implements(t.I2DChart.prototype),Pie.prototype.implements(t.ITooltip.prototype),Pie.prototype.mixin(n.Utility.SimpleSelectionMixin),Pie.prototype.publish(`showLabels`,!0,`boolean`,`If true, wedge labels will display`),Pie.prototype.publish(`showSeriesValue`,!1,`boolean`,`Append data series value next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesValueFormat`,`,.0f`,`string`,`Number format used for formatting series values`,null,{disable:e=>!e.showSeriesValue()}),Pie.prototype.publish(`showSeriesPercentage`,!1,`boolean`,`Append data series percentage next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesPercentageFormat`,`,.0f`,`string`,`Number format used for formatting series percentages`,null,{disable:e=>!e.showSeriesPercentage()}),Pie.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Pie.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Pie.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Pie.prototype.publish(`innerRadius`,0,`number`,`Sets inner pie hole radius as a percentage of the radius of the pie chart`,null,{tags:[`Basic`],range:{min:0,step:1,max:100}}),Pie.prototype.publish(`minOuterRadius`,20,`number`,`Minimum outer radius (pixels)`),Pie.prototype.publish(`startAngle`,0,`number`,`Starting angle of the first (and largest) wedge (degrees)`),Pie.prototype.publish(`labelHeight`,12,`number`,`Font size of labels (pixels)`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`slicePadding`,.01,`number`,`Padding between pie slices (converted to pixels)`,null,{tags:[`Basic`],range:{min:0,step:.01,max:.2}}),Pie.prototype.publish(`sortDataByValue`,`descending`,`set`,`Sort data by value`,[`none`,`ascending`,`descending`]),Pie.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var HalfPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this._pos.x,r=this._pos.y;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),r+=this._size.height/4,this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}};HalfPie.prototype._class+=` chart_HalfPie`;var Heat=class extends XYAxis{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(e){return this.radiusX(e),this.radiusY(e),this}layerEnter(e,t,n=250){super.layerEnter(e,t,n),this._domForeignObject=this.svg.insert(`foreignObject`,`#${this.id()+`_clippath`}`),this._domCanvas=this._domForeignObject.append(`xhtml:body`).style(`margin`,`0px`).style(`padding`,`0px`).style(`background-color`,`transparent`).append(`canvas`),this._heat=simpleheat(this._domCanvas.node())}layerUpdate(e,t,r=250){super.layerUpdate(e,t),this._palette=this._palette.switch(this.paletteID());let i=this.width()-this.margin.left-this.margin.right;i<0&&(i=0);let a=this.height()-this.margin.top-this.margin.bottom;a<0&&(a=0),this._domForeignObject.attr(`x`,this.margin.left).attr(`y`,this.margin.top).attr(`width`,i).attr(`height`,a),this._domCanvas.attr(`width`,i).attr(`height`,a);let o=e.orientation()===`horizontal`?this.data().map(t=>[e.dataPos(t[0]),e.valuePos(t[1]),t[2]]):this.data().map(t=>[e.valuePos(t[1]),e.dataPos(t[0]),t[2]]),s=this.maxWeight_exists()?this.maxWeight():(0,n.max)(o,e=>e[2]);if(this.paletteID()!==`default`){let e={},t=this.reversePalette();for(let n=0;n<8;++n)e[n/8]=this._palette((t?8-n:n)/8,0,1);this._heat.gradient(e)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();let c=this.radiusAsPercent()?this.radiusX()*i/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*a/100:this.radiusY();this._heat.clear().radius(c,l,this.blur()).max(s).data(o).draw(this.minOpacity())}};Heat.prototype._class+=` chart_Heat`,Heat.prototype._palette=n.Palette.rainbow(`default`),Heat.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Heat.prototype._palette.switch(),{tags:[`Basic`]}),Heat.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Heat.prototype.publish(`reversePalette`,!1,`boolean`,`Reverse Palette Colors`,null,{disable:e=>e.paletteID()===`default`}),Heat.prototype.publish(`radiusX`,25,`number`,`Point X radius (25 by default)`),Heat.prototype.publish(`radiusY`,25,`number`,`Point Y radius (25 by default)`),Heat.prototype.publish(`radiusAsPercent`,!1,`boolean`,`Calculate RadiusX + RadiusY as % of size`),Heat.prototype.publish(`blur`,15,`number`,`Point blur radius (15 by default)`),Heat.prototype.publish(`maxWeight`,void 0,`number`,`Clamp max weight to value (optional), omitting uses max data point`,void 0,{optional:!0}),Heat.prototype.publish(`minOpacity`,.05,`number`,`Minimum point opacity (0.05 by default)`);function simpleheat(e){if(!(this instanceof simpleheat))return new simpleheat(e);this._canvas=e=typeof e==`string`?document.getElementById(e):e,this._ctx=e.getContext(`2d`),this._width=e.width,this._height=e.height,this._max=1,this._data=[]}simpleheat.prototype={defaultRadius:25,defaultGradient:{.4:`blue`,.6:`cyan`,.7:`lime`,.8:`yellow`,1:`red`},data:function(e){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t,n){n=n===void 0?15:n;let r=this._ellipse=this._createCanvas(),i=r.getContext(`2d`),a=this._r=e+n,o=this._r=t+n;return r.width=a*2,r.height=o*2,i.shadowOffsetX=i.shadowOffsetY=a*2,i.shadowOffsetY=i.shadowOffsetY=o*2,i.shadowBlur=n,i.shadowColor=`black`,i.beginPath(),i.ellipse(-a,-o,e,t,0,0,Math.PI*2,!0),i.closePath(),i.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(e){let t=this._createCanvas(),n=t.getContext(`2d`),r=n.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(let t in e)r.addColorStop(+t,e[t]);return n.fillStyle=r,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);let t=this._ctx;t.clearRect(0,0,this._width,this._height);for(let n=0,r=this._data.length,i;n<r;n++)i=this._data[n],i[2]<0?i[2]=0:i[2]>this._max&&(i[2]=this._max),t.globalAlpha=Math.max(i[2]/this._max,e===void 0?.05:e),t.drawImage(this._ellipse,i[0]-this._r,i[1]-this._r);let n=t.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),t.putImageData(n,0,0),this},_colorize:function(e,t){for(let n=0,r=e.length,i;n<r;n+=4)i=e[n+3]*4,i&&(e[n]=t[i],e[n+1]=t[i+1],e[n+2]=t[i+2])},_createCanvas:function(){return typeof document<`u`?document.createElement(`canvas`):new this._canvas.constructor}};var dt=Math.PI/3,ft=[0,dt,2*dt,3*dt,4*dt,5*dt];function pointX(e){return e[0]}function pointY(e){return e[1]}function hexbin_default(){var e=0,t=0,n=1,r=1,i=pointX,a=pointY,o,s,c;function hexbin(e){var t={},n=[],r,o=e.length;for(r=0;r<o;++r)if(!(isNaN(u=+i.call(null,l=e[r],r,e))||isNaN(d=+a.call(null,l,r,e)))){var l,u,d,f=Math.round(d/=c),p=Math.round(u=u/s-(f&1)/2),m=d-f;if(Math.abs(m)*3>1){var h=u-p,g=p+(u<p?-1:1)/2,_=f+(d<f?-1:1),v=u-g,b=d-_;h*h+m*m>v*v+b*b&&(p=g+(f&1?1:-1)/2,f=_)}var S=p+`-`+f,C=t[S];C?C.push(l):(n.push(C=t[S]=[l]),C.x=(p+(f&1)/2)*s,C.y=f*c)}return n}function hexagon(e){var t=0,n=0;return ft.map(function(r){var i=Math.sin(r)*e,a=-Math.cos(r)*e,o=i-t,s=a-n;return t=i,n=a,[o,s]})}return hexbin.hexagon=function(e){return`m`+hexagon(e==null?o:+e).join(`l`)+`z`},hexbin.centers=function(){for(var i=[],a=Math.round(t/c),l=Math.round(e/s),u=a*c;u<r+o;u+=c,++a)for(var d=l*s+(a&1)*s/2;d<n+s/2;d+=s)i.push([d,u]);return i},hexbin.mesh=function(){var e=hexagon(o).slice(0,4).join(`l`);return hexbin.centers().map(function(t){return`M`+t+`m`+e}).join(``)},hexbin.x=function(e){return arguments.length?(i=e,hexbin):i},hexbin.y=function(e){return arguments.length?(a=e,hexbin):a},hexbin.radius=function(e){return arguments.length?(o=+e,s=o*2*Math.sin(dt),c=o*1.5,hexbin):o},hexbin.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],hexbin):[n-e,r-t]},hexbin.extent=function(i){return arguments.length?(e=+i[0][0],t=+i[0][1],n=+i[1][0],r=+i[1][1],hexbin):[[e,t],[n,r]]},hexbin.radius(1)}__name(hexbin_default,`default`);var HexBin=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),t.I2DAggrChart.call(this),this.tooltipValueFormat_default(`,.0f`),t.ITooltip.call(this),this.tooltipHTML(e=>{let t=(0,n.extent)(e,e=>e.label),r=(0,n.extent)(e,e=>e.value);return this.tooltipFormat({series:t[0]===t[1]?t[0]:`${t[0]} -> ${t[1]}`,label:r[0]===r[1]?r[0]:`${r[0]} -> ${r[1]}`,value:e.length})}),this._hexbin=hexbin_default().x(e=>e.x).y(e=>e.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerUpdate(e,t,r=250){super.layerUpdate(e,t,r);let i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());let a=this.flattenData().map(t=>({x:i.xPos(e,t),y:i.yPos(e,t),label:e.parseData(t.label),value:e.parseValue(t.value),origRow:t})),o=this._hexbin(a),s=(0,n.min)(o,function(e){return e.length}),c=(0,n.max)(o,function(e){return e.length});this._dataMinWeight=s,this._dataMaxWeight=c;let l=t.selectAll(`.hexagon`).data(o,function(e){return e.i+`_`+e.j});l.enter().append(`path`).attr(`class`,`hexagon`).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){let n=i.data();i.click(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),i.columns()[1],e._selection.selected(this))}).on(`dblclick`,function(t){let n=i.data();i.dblclick(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),i.columns()[1],e._selection.selected(this))}).on(`mouseout.tooltip`,i.tooltip.hide).on(`mousemove.tooltip`,i.tooltip.show).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).merge(l).transition().duration(r).attr(`d`,this._hexbin.hexagon()).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(1)`}).style(`fill`,function(e){return i._palette(e.length,s,c)}),l.exit().transition().duration(r).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).remove()}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};HexBin.prototype._class+=` chart_HexBin`,HexBin.prototype.implements(t.I2DAggrChart.prototype),HexBin.prototype.implements(t.ITooltip.prototype),HexBin.prototype.publish(`paletteID`,`Blues`,`set`,`Color palette for this widget`,HexBin.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),HexBin.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),HexBin.prototype.publish(`binSize`,20,`number`,`Bin radius`,null,{range:{min:1,max:300,step:1}});var Line=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`)}};Line.prototype._class+=` chart_Line`;var QuarterPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this.orientation()===`left`?0:this._size.width,r=this._size.height;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(this.orientation()===`left`?0:-Math.PI/2).endAngle(this.orientation()===`left`?Math.PI/2:0)}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e})),`Verdana`,12).width;return Math.min(this._size.width-e-10,this._size.height-36)-2}};QuarterPie.prototype._class+=` chart_QuarterPie`,QuarterPie.prototype.publish(`orientation`,`left`,`set`,`Determines the placement and start/end angle.`,[`left`,`right`]);var QuartileCandlestick=class extends n.SVGWidget{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(e,t){super.enter(e,t),this._g=t.append(`g`),this._leftLine=this._g.append(`rect`),this._rightLine=this._g.append(`rect`),this._midLine=this._g.append(`rect`),this._midOuterRect=this._g.append(`rect`),this._midInnerRect1=this._g.append(`rect`),this._midInnerRect2=this._g.append(`rect`),this._q0text=this._g.append(`text`),this._q1text=this._g.append(`text`),this._q2text=this._g.append(`text`),this._q3text=this._g.append(`text`),this._q4text=this._g.append(`text`),this._q0val=this._g.append(`text`),this._q1val=this._g.append(`text`),this._q2val=this._g.append(`text`),this._q3val=this._g.append(`text`),this._q4val=this._g.append(`text`)}update(e,t){super.update(e,t);let r=(this.orientation()===`horizontal`?this.width():this.height())-this.lineWidth(),i=this.orientation()===`horizontal`?this.height():this.width(),a=(0,n.scaleLinear)().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),r-this.edgePadding()]),o=this.candleWidth_exists()?this.candleWidth():i,s=this.lineWidth(),c=this.lineColor(),l=this.roundedCorners(),u=this.edgePadding(),d=a(this.data()[1]),f=a(this.data()[2]),p=a(this.data()[3]),m=-o/2,h=o/2,g=this.upperTextRotation(),_=this.lowerTextRotation(),v=this.textPadding(),b=this.labelFontSize(),S=this.valueFontSize(),C=Math.max(b,S),w=r-u;if(C>0){for(;d-u<C;)d+=C;for(;f-d<C;)f+=C;for(;p-f<C;)p+=C;for(;w-p<C;)p-=C;for(;p-f<C;)f-=C;for(;f-d<C;)d-=C}let T=-r/2-this.lineWidth()/2,E=0,D=0,O=1,k=`start`,A=`end`;this.orientation()===`vertical`&&(T=0,E=r/2+this.lineWidth()/2,D=-90,k=`end`,A=`start`,O=-1),this._g.style(`shape-rendering`,`crispEdges`).attr(`transform`,`translate(${T},${E})rotate(${D})scale(1)`),this._leftLine.attr(`fill`,c).attr(`height`,o).attr(`width`,s).attr(`x`,u).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._rightLine.attr(`class`,`right-line`).attr(`fill`,c).attr(`height`,o).attr(`width`,s).attr(`x`,w).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midLine.attr(`fill`,c).attr(`height`,s).attr(`width`,w-u).attr(`x`,u).attr(`y`,-s/2),this._midOuterRect.attr(`fill`,c).attr(`height`,o).attr(`width`,p-d).attr(`x`,d).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midInnerRect1.attr(`fill`,this.innerRectColor()).attr(`height`,o-s*2).attr(`width`,f-(d+s*2)).attr(`x`,d+s).attr(`y`,s-o/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._midInnerRect2.attr(`fill`,this.innerRectColor()).attr(`height`,o-s*2).attr(`width`,p-f-s).attr(`x`,f).attr(`y`,s-o/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._q0text.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`hanging`).text(this.columns()[0]),this._q1text.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[1]),this._q2text.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[2]),this._q3text.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[3]),this._q4text.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`baseline`).text(this.columns()[4]),this._q0val.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`hanging`).text(this.data()[0]),this._q1val.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[1]),this._q2val.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[2]),this._q3val.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[3]),this._q4val.attr(`height`,o).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`baseline`).text(this.data()[4])}};QuartileCandlestick.prototype._class+=` chart_QuartileCandlestick`,QuartileCandlestick.prototype.publish(`textColor`,`black`,`html-color`,`Color of label and value text`),QuartileCandlestick.prototype.publish(`showLabels`,!0,`boolean`,`If true, labels will be shown`),QuartileCandlestick.prototype.publish(`showValues`,!0,`boolean`,`If true, values will be shown`),QuartileCandlestick.prototype.publish(`orientation`,`horizontal`,`set`,`Determines layout`,[`horizontal`,`vertical`]),QuartileCandlestick.prototype.publish(`valueFontSize`,12,`number`,`Font size of value text (pixels)`),QuartileCandlestick.prototype.publish(`labelFontSize`,12,`number`,`Font size of label text (pixels)`),QuartileCandlestick.prototype.publish(`roundedCorners`,8,`number`,`Radius of rounded rect corners (pixels)`),QuartileCandlestick.prototype.publish(`lineWidth`,4,`number`,`Width of lines (pixels)`),QuartileCandlestick.prototype.publish(`candleWidth`,null,`number`,`Height of outer rect (pixels)`,null,{optional:!0}),QuartileCandlestick.prototype.publish(`textPadding`,8,`number`,`Padding between outer rect and text (pixels)`),QuartileCandlestick.prototype.publish(`edgePadding`,30,`number`,`Padding between outer rect and left/right sides (pixels)`),QuartileCandlestick.prototype.publish(`lineColor`,`#333`,`html-color`,`Color of outer rect and lines`),QuartileCandlestick.prototype.publish(`innerRectColor`,`white`,`html-color`,`Color of the inner rects`),QuartileCandlestick.prototype.publish(`upperTextRotation`,-60,`number`,`Rotation of label text (degrees)`),QuartileCandlestick.prototype.publish(`lowerTextRotation`,-60,`number`,`Rotation of value text (degrees)`);var Radar=class extends n.SVGWidget{constructor(){super(),t.INDChart.call(this),t.ITooltip.call(this),n.Utility.SimpleSelectionMixin.call(this)}mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}setPointAttributes(e,t,n){let r=this.mapShape(this.pointShape()),i=this;switch(r){case`rect`:e.attr(`width`,i.pointSize()).attr(`height`,i.pointSize()).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`circle`:e.attr(`r`,i.pointSize()/2).attr(`cx`,t).attr(`cy`,n).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`path`:let r=i.pointSize()/2;e.attr(`d`,function(e){return`M`+(t-r)+` `+(n-r)+` L`+(t+r)+` `+(n+r)+` M`+(t-r)+` `+(n+r)+` L`+(t+r)+` `+(n-r)}).style(`stroke`,e=>this.strokeColor(e.data,e.column,e.value));break;default:}}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e.label,series:e.column,value:e.value}))}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID());let r=this,i=this.height(),a=this.width(),o=i/2,s=a/2,c=this.columns(),l=this.data(),u=this.flattenData(c,l).map((e,t)=>(e.shape=this.mapShape(this.pointShape()),e.column=c[e.colIdx],e.row=l[t],e)),d=[],f=this.degrees2radians(360/this.data().length),p=this.fontSize(),m=0;u.filter(e=>e.colIdx===1).forEach(e=>{let t=super.textSize(e.label,`${this.fontFamily()}`,this.fontSize());m<t.width&&(m=t.width)});let h=Math.min(o-p,s-m),g=t.selectAll(`.label`).data(u.filter(e=>e.colIdx===1)),_=Math.max.apply(r,u.map(e=>e.value));g.enter().append(`text`).attr(`class`,`label`).attr(`text-anchor`,`middle`).merge(g).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).each(function(e,t){let i=r.polar2cartesian(h,t*f-Math.PI/2);d.push(i.map(e=>e*r.labelPaddingRatio()));let a=`middle`,o=Math.round(i[0]);a=o>0?`start`:a,a=o<0?`end`:a,(0,n.select)(this).attr(`text-anchor`,a).attr(`x`,i[0]).attr(`y`,i[1])}).text(e=>e.label),g.exit().remove();let v=t.selectAll(`.domain`).data(u.filter(e=>e.colIdx===1));v.enter().append(`line`).classed(`domain`,!0).style(`stroke`,`#000`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`1px`).merge(v).attr(`x1`,0).attr(`y1`,0).attr(`x2`,(e,t)=>d[t][0]).attr(`y2`,(e,t)=>d[t][1]),v.exit().remove();let b=t.selectAll(`.value_guide`).data(this.valueGuideRatios());b.enter().append(`polygon`).classed(`value_guide`,!0).style(`stroke`,`grey`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(b).each(function(e,t){let r=[];d.forEach((t,n)=>{r.push([t[0]*e,t[1]*e])}),(0,n.select)(this).attr(`points`,r.join(` `)).attr(`stroke`,`rgb(0, 0, 0)`).attr(`stroke-opacity`,.75).attr(`stroke-width`,.3).attr(`fill-opacity`,0)}),b.exit().remove();let S=t.selectAll(`.value_guide_text`).data(this.valueGuideRatios());S.enter().append(`text`).attr(`class`,`value_guide_text`).attr(`text-anchor`,`start`).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).merge(S).attr(`x`,2).attr(`y`,e=>d[0][1]*e).text((e,t)=>Math.round(e*_)),b.exit().remove();let C=t.selectAll(`.area`).data(c.filter((e,t)=>t>0));C.enter().append(`polygon`).attr(`class`,`area`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(C).style(`stroke`,e=>this.strokeColor([],e,0)).style(`fill`,e=>this.fillColor([],e,0)).style(`fill-opacity`,this.fillOpacity()).attr(`points`,(e,t)=>d.map((e,n)=>{let r=l[n][t+1],i=r===0?0:r/_;return e[0]*i+`,`+e[1]*i}).join(` `)),C.exit().remove();let w=t.selectAll(`.point`).data(u);w.enter().append(`g`).attr(`class`,`point`).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).on(`click`,function(e,t){let n=r.data()[e.rowIdx],i=r.rowToObj(n),a=r._selection.selected(this);r.click(i,r.columns()[e.colIdx],a)}).on(`dblclick`,function(e,t){r.dblclick(r.rowToObj(r.data()[e.rowIdx]),e.column,r._selection.selected(this))}).each(function(e){let t=(0,n.select)(this);t.append(`circle`).attr(`class`,`pointSelection`).attr(`r`,r.pointSize()).call(r._selection.enter.bind(r._selection)),t.append(r.mapShape(r.pointShape())).attr(`class`,`pointShape`)}).merge(w).each(function(e){let t=(0,n.select)(this),i=e.value===0?0:e.value/_,a=d[e.rowIdx][0]*i,o=d[e.rowIdx][1]*i;t.select(`.pointSelection`).attr(`cx`,a).attr(`cy`,o);let s=t.select(`.pointShape`).style(`stroke`,r.strokeColor(e.row,e.column,e.value)).style(`fill`,r.fillColor(e.row,e.column,e.value));r.setPointAttributes(s,a,o)}),w.exit().remove()}polar2cartesian(e,t){return[e*Math.cos(t),e*Math.sin(t)]}cartesian2polar(e,t){return[Math.atan2(t,e),Math.sqrt(e*e+t*t)]}degrees2radians(e){return e/57.295779513}radians2degrees(e){return e*57.295779513}point_in_polygon(e,t){let n=e[0],r=e[1],i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e][0],s=t[e][1],c=t[a][0],l=t[a][1];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}};Radar.prototype._class+=` chart_Radar`,Radar.prototype.implements(t.INDChart.prototype),Radar.prototype.implements(t.ITooltip.prototype),Radar.prototype.mixin(n.Utility.SimpleSelectionMixin),Radar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Radar.prototype._palette.switch()),Radar.prototype.publish(`pointShape`,`cross`,`set`,`pointShape`,[`circle`,`rectangle`,`cross`]),Radar.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Radar.prototype.publish(`valueGuideRatios`,[.2,.4,.6,.8,1],`array`,`Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines`),Radar.prototype.publish(`fillOpacity`,.66,`number`,`Opacity of the data polygon(s)`),Radar.prototype.publish(`fontFamily`,``,`string`,`fontFamily`),Radar.prototype.publish(`fontSize`,16,`number`,`fontSize`),Radar.prototype.publish(`labelPaddingRatio`,.9,`number`,`labelPaddingRatio`);var RadialBar=class extends n.SVGWidget{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`}];_domainScale=(0,n.scaleBand)();_valueScale=(0,n.scaleLinear)();_d3Arc=arc_default$1().startAngle(0).endAngle(e=>this._valueScale(e[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),t.INDChart.call(this),t.ITooltip.call(this),n.Utility.SimpleSelectionMixin.call(this)}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e[0],value:e[1]})),this._radialAxis=t.append(`g`).attr(`class`,`r axis`),this._axialAxis=t.append(`g`).attr(`class`,`a axis`),this._arcs=t.append(`g`).attr(`class`,`data`)}update(e,t){super.update(e,t);let r=this,i=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(e=>e[1]));this._valueScale.domain([0,i]).range([0,this.radians(this.valueMaxAngle())]);let a=this._valueScale.ticks(this.tickCount()),o=this.textSize(a.map(e=>``+e),`Verdana`,12).width,s=Math.min(this.width()-(10+o)*2,this.height()-44)/2,c=this.data().map(e=>e[0]);this._domainScale.domain(c).range([0,s]).padding(this.domainPadding());let l=this._domainScale.step()*this._domainScale.padding(),u=this._radialAxis.selectAll(`circle`).data(c);u.enter().append(`circle`).attr(`fill`,`transparent`).merge(u).attr(`r`,e=>this._domainScale(e)+this._domainScale.step()-l/2),u.exit().remove();let d=this._radialAxis.selectAll(`.arc-text`).data(c);d.enter().append(`text`).attr(`class`,`arc-text`).attr(`x`,-4).attr(`alignment-baseline`,`middle`).attr(`text-anchor`,`end`).merge(d).attr(`y`,e=>-this._domainScale(e)-this._domainScale.bandwidth()/2).text(e=>e),d.exit().remove();let f=this._axialAxis.selectAll(`line`).data(a);f.enter().append(`line`).merge(f).attr(`x2`,e=>s*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y2`,e=>s*Math.sin(this._valueScale(e)-this.radians(90))),f.exit().remove();let p=this._axialAxis.selectAll(`text`).data(a);p.enter().append(`text`).style(`dominant-baseline`,`central`).merge(p).attr(`x`,e=>(s+10)*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y`,e=>(s+10)*Math.sin(this._valueScale(e)-this.radians(90))).style(`text-anchor`,e=>{let t=this.degrees(this._valueScale(e));return t>=0&&t<=20||t>=160&&t<=200||t>=340&&t<=360?`middle`:t>=180&&t<=360?`end`:null}).text(e=>e),p.exit().remove();let m=this.columns().length>1?this.columns()[1]:``;this._d3Arc.innerRadius(e=>this._domainScale(e[0])).outerRadius(e=>this._domainScale(e[0])+this._domainScale.bandwidth());let h=this._arcs.selectAll(`path`).data(this.data(),e=>e[0]);h.enter().append(`path`).attr(`class`,`arc`).call(this._selection.enter.bind(this._selection)).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).on(`click`,function(e,t){r.click(r.rowToObj(e),m,r._selection.selected(this))}).on(`dblclick`,function(e,t){r.dblclick(r.rowToObj(e),m,r._selection.selected(this))}).merge(h).style(`fill`,(e,t)=>this.fillColor(e,e[0],e[1])).transition().delay((e,t)=>t*this.transitionDelay()).duration(this.transitionDuration()).attrTween(`d`,(e,t)=>{let r=(0,n.interpolate)(e._current||0,e[1]);return e._current=e[1],n=>this._d3Arc([e[0],r(n)],t)}),h.exit().remove()}degrees(e){return e*180/Math.PI}radians(e){return e*Math.PI/180}};RadialBar.prototype._class+=` chart_RadialBar`,RadialBar.prototype.implements(t.INDChart.prototype),RadialBar.prototype.implements(t.ITooltip.prototype),RadialBar.prototype.mixin(n.Utility.SimpleSelectionMixin),RadialBar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,RadialBar.prototype._palette.switch()),RadialBar.prototype.publish(`tickCount`,10,`number`,`Number of ticks to display`),RadialBar.prototype.publish(`domainPadding`,.25,`number`,`Padding between chart edge and container edge (0..1)`),RadialBar.prototype.publish(`valueMaxAngle`,270,`number`,`Maximum angular length of a bar (degrees)`),RadialBar.prototype.publish(`valueDomainHigh`,null,`number`,`Value domain high`,void 0,{optional:!0}),RadialBar.prototype.publish(`transitionDelay`,100,`number`,`Delay between the start of each row animation (ms)`),RadialBar.prototype.publish(`transitionDuration`,750,`number`,`Duration of a row's animation (ms)`);var pt=n.Palette.rainbow(`Blues`),mt=n.Palette.ordinal(`Quartile`,[pt(100,0,100),pt(50,0,100),pt(50,0,100),pt(75,0,100)]);mt(`Std. Dev.`),mt(`MinMax`),mt(`25%`),mt(`50%`);function myFormatter(e){let t=(0,n.format)(e);return function(e){let n=(Math.round(e*100)/100).toString();return n.length<=4?n:t(e)}}var StatChart=class extends n.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=new Scatter().columns([``,`Std. Dev.`]).paletteID(`Quartile`).interpolate_default(`basis`).pointSize(0).xAxisType(`linear`).xAxisOverlapMode(`none`).xAxisTickFormat(`,`).yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=new QuartileCandlestick().columns([`Min`,`25%`,`50%`,`75%`,`Max`]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(pt(90,0,100)).innerRectColor(pt(10,0,100));constructor(){super(),this.columns([`Min`,`25%`,`50%`,`75%`,`Max`,`Mean`,`Std. Dev.`])}stdDev(e){return this.mean()+e*this.standardDeviation()}formatStdDev(e){return this._tickFormatter(this.stdDev(e))}quartile(e){return this.quartiles()[e]}formatQ(e){return this._tickFormatter(this.quartile(e))}domain(e){switch(e){case`25_75`:return[this.quartile(1),this.quartile(3)];case`normal`:return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(e){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];let t=e[0];return this.quartiles([t[0],t[1],t[2],t[3],t[4]]),this.mean(t[5]),this.standardDeviation(t[6]),this}enter(e,t){super.enter(e,t),this._bellCurve.target(t.append(`div`).node()),this._candle.target(t.append(`div`).node()),this._selectElement=t.append(`div`).style(`position`,`absolute`).style(`top`,`0px`).style(`right`,`0px`).append(`select`).on(`change`,()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append(`option`).attr(`value`,`min_max`).text(`Min / Max`),this._selectElement.append(`option`).attr(`value`,`25_75`).text(`25% / 75%`),this._selectElement.append(`option`).attr(`value`,`normal`).text(`Normal`)}bellTicks(e){let t;switch(e){case`25_75`:t=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case`normal`:t=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:`-3σ`,value:this.stdDev(-3)},{label:`-2σ`,value:this.stdDev(-2)},{label:`-1σ`,value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:`+1σ`,value:this.stdDev(1)},{label:`+2σ`,value:this.stdDev(2)},{label:`+3σ`,value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:t=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}let[n,r]=this.domain(this._selectElement.node().value);return t.filter(e=>e.value>=n&&e.value<=r).map(e=>({label:e.label,value:e.value.toString()}))}updateScatter(){let e=this._selectElement.node().value,[t,n]=this.domain(e),r=(n-t)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(t-r).xAxisDomainHigh(n+r).xAxisTicks(this.bellTicks(e)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){let e=this._bellCurve.dataPos(this.quartile(0)),t=this._bellCurve.dataPos(this.quartile(4))-e;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:e+t/2+2,y:this.candleHeight()/2}).width(t).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(e,t){super.update(e,t),this._tickFormatter=myFormatter(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(e,t){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(e,t)}};StatChart.prototype._class+=` chart_StatChart`,StatChart.prototype.publish(`view`,`min_max`,`set`,`View`,[`min_max`,`25_75`,`normal`]),StatChart.prototype.publish(`tickFormat`,`.2e`,`string`,`X-Axis Tick Format`),StatChart.prototype.publish(`candleHeight`,20,`number`,`Height of candle widget (pixels)`),StatChart.prototype.publish(`domainPadding`,10,`number`,`Domain value padding`),StatChart.prototype.publish(`mean`,.5,`number`,`Mean`),StatChart.prototype.publish(`standardDeviation`,.125,`number`,`Standard Deviation (σ)`),StatChart.prototype.publish(`quartiles`,[0,.25,.5,.75,1],`object`,`Quartiles (Min, 25%, 50%, 75%, Max)`);var Step=class extends Scatter{constructor(){super(),this.interpolate_default(`step`)}};Step.prototype._class+=` chart_Step`;var ht=`text`,gt=`html`,Summary=class extends n.HTMLWidget{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag=`div`,this._drawStartPos=`center`,this.playInterval(this.playInterval())}lookupFieldIdx(e,t){let n=t;if(!(this[e+`_exists`]()&&(n=this.columns().indexOf(this[e]()),n<0)))return n}lookupFieldText(e,t){return this[e+`_exists`]()?this[e]():t===void 0?``:this.columns()[t]||``}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let e;this.hideLabel()||(e=this.lookupFieldIdx(`labelColumn`,0));let t=this.lookupFieldIdx(`iconColumn`),n=this.lookupFieldIdx(`valueColumn`,1),r,i;this.hideMore()||(r=this.lookupFieldIdx(`moreIconColumn`),i=this.lookupFieldIdx(`moreTextColumn`));let a=this.lookupFieldIdx(`colorFillColumn`),o=this.lookupFieldIdx(`colorStrokeColumn`);return this.formattedData().map(function(s){return{icon:t===void 0?this.icon():s[t],label:e===void 0?``:s[e],value:s[n],moreIcon:r===void 0?this.hideMore()?``:this.moreIcon():s[r],moreText:i===void 0?this.hideMore()?``:this.moreText():s[i],fill:a===void 0?this.colorFill():s[a],stroke:o===void 0?this.colorStroke():s[o]}},this)}enter(e,t){super.enter(e,t),this._mainDiv=t.append(`div`);let n=this;this._headerDiv=this._mainDiv.append(`h2`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}),this._textDiv=this._mainDiv.append(`div`).attr(`class`,`text`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)})}update(e,t){super.update(e,t),this.data().length;let r=this.summaryData();this._playIntervalIdx>=r.length&&(this._playIntervalIdx=0);let i=this._playIntervalIdx<r.length?r[this._playIntervalIdx]:[``,``];t.style(`width`,this.fixedSize()?this.minWidth_exists()?this.minWidth()+`px`:null:`100%`).style(`height`,this.fixedSize()?this.minHeight_exists()?this.minHeight()+`px`:null:`100%`),this._mainDiv.attr(`class`,`content bgIcon `+i.icon).transition().style(`background-color`,i.fill).style(`color`,i.stroke).style(`min-width`,this.minWidth_exists()?this.minWidth()+`px`:null).style(`min-height`,this.minHeight_exists()?this.minHeight()+`px`:null).style(`font-size`,this.iconFontSize()+`px`),this._headerDiv.transition().style(`color`,i.stroke).style(`font-size`,this.headerFontSize()+`px`)[this.valueHTML()?gt:ht](i.value),this._textDiv.style(`font-size`,this.textFontSize()+`px`)[this.labelHTML()?gt:ht](i.label);let a=this,o=this._mainDiv.selectAll(`.more`).data([i]),s=o.enter().append(`div`).attr(`class`,`more`).on(`click`,function(e){a.click(a.rowToObj(a.currentRow()),a.lookupFieldText(`moreTextColumn`)||`more`,!0)}).each(function(){let e=(0,n.select)(this);e.append(`i`),e.append(`span`)}).merge(o).style(`display`,this.hideMoreWrapper()?`none`:null).style(`font-size`,this.moreFontSize()+`px`).style(`height`,this.moreWrapperHeight_exists()?this.moreWrapperHeight()+`px`:null).transition().style(`background-color`,(0,n.rgb)(i.fill).darker(.75).toString());s.select(`i`).attr(`class`,function(e){return`fa `+e.moreIcon}),this.moreTextHTML()?s.select(`span`).each(function(e){this.innerHTML=e.moreText}):s.select(`span`).text(e=>e.moreText),o.exit().remove()}exit(e,t){super.exit(e,t)}};Summary.prototype._class+=` chart_Summary`,Summary.prototype.implements(t.I2DChart.prototype),Summary.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),Summary.prototype.publish(`headerFontSize`,null,`number`,`headerFontSize`),Summary.prototype.publish(`textFontSize`,null,`number`,`textFontSize`),Summary.prototype.publish(`moreFontSize`,null,`number`,`moreFontSize`),Summary.prototype.publish(`iconFontSize`,null,`number`,`iconFontSize`),Summary.prototype.publish(`hideLabel`,!1,`boolean`,`Hide label column`),Summary.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideLabel()}),Summary.prototype.publish(`labelHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideLabel()}),Summary.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`valueHTML`,!1,`boolean`,`Allow HTML`),Summary.prototype.publish(`hideMore`,!1,`boolean`,`Hide More Information`),Summary.prototype.publish(`hideMoreWrapper`,!1,`boolean`,`Hide More Information Wrapper`),Summary.prototype.publish(`moreWrapperHeight`,null,`number`,`Height of the 'more' text wrapper (pixels)`),Summary.prototype.publish(`moreIconColumn`,null,`set`,`Select More Icon Column`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreIcon`,`fa-info-circle`,`string`,`FA Char icon class`,null,{disable:e=>e.hideMore()||e.moreIconColumn()}),Summary.prototype.publish(`moreTextColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreText`,`More Info`,`string`,`More text`,null,{disable:e=>e.hideMore()||e.moreTextColumn()}),Summary.prototype.publish(`moreTextHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideMore()}),Summary.prototype.publish(`colorFillColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorFill`,`#3498db`,`html-color`,`Fill Color`,null,{disable:e=>e.colorFillColumn()}),Summary.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorStroke`,`#ffffff`,`html-color`,`Fill Color`,null,{disable:e=>e.colorStrokeColumn()}),Summary.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),Summary.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),Summary.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),Summary.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0});var _t=Summary.prototype.playInterval;Summary.prototype.playInterval=function(e){let t=_t.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var SummaryC=class extends n.CanvasWidget{_playIntervalIdx=0;constructor(){super(),t.I2DChart.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(e,t){super.enter.apply(this,arguments);let{width:n,height:r}=this.size();e.height=r,e.width=n}update(e,t){super.update.apply(this,arguments);let r=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);let i=this.size(),a=Math.min(i.width,i.height),o=this.fontSizeRatio(),s=this.columns().indexOf(this.labelColumn()),c=this.columns().indexOf(this.valueColumn()),l=this.columns().indexOf(this.colorFillColumn()),u=this.columns().indexOf(this.colorStrokeColumn()),d=this.columns().indexOf(this.iconColumn()),f=d===-1?this.icon():this.currentRow()[d],p=s===-1?``:this.currentRow()[s],m=c===-1?``:this.currentRow()[c],h=l===-1?this.colorFill():this.currentRow()[l],g=u===-1?this.colorStroke():this.currentRow()[u],_=i.height*(o-this.paddingSizeRatio()),v=i.height*(1-o-this.paddingSizeRatio()),b=i.height*(this.iconSizeRatio()-this.paddingSizeRatio()),S=a*this.paddingSizeRatio(),C=e.getContext(`2d`);C.clearRect(0,0,i.width,i.height);let w=r.fontFamily();C.fillStyle=h,C.fillRect(0,0,i.width,i.height),C.globalAlpha=this.iconOpacity(),drawIcon(n.Utility.faChar(f),b,r.iconAnchor()),C.globalAlpha=this.valueOpacity(),_=drawText(m,S,_,r.valueAnchor()),C.globalAlpha=this.labelOpacity(),drawText(p,_+S,v,r.labelAnchor());function drawText(e,t,n,r){C.textBaseline=`top`,C.font=`${n}px ${w}`,C.fillStyle=g;let a=C.measureText(e);if(a.width>i.width-S*2){let t=(i.width-S*2)/a.width;n*=t,C.font=`${n}px ${w}`,a=C.measureText(e)}let o=getTextOffsetX(a.width,r);return C.fillText(e,o,t),n}function drawIcon(e,t,n){if(e===void 0)return;C.textBaseline=r.iconBaseline(),C.font=`${t}px FontAwesome`,C.fillStyle=g;let a=C.measureText(e);a.width>i.width-S*2&&(C.font=`${t*((i.width-S*2)/a.width)}px FontAwesome`,a=C.measureText(e));let o=getTextOffsetX(a.width,n),s=getTextOffsetY(r.iconBaseline());C.fillText(e,o,s)}function getTextOffsetX(e,t){switch(t){case`start`:return S;case`middle`:return i.width/2-e/2;case`end`:return i.width-e-S}}function getTextOffsetY(e){switch(e){case`top`:return S;case`middle`:return i.height/2;case`bottom`:return i.height-S}}}};SummaryC.prototype._class+=` chart_SummaryC`,SummaryC.prototype.implements(t.I2DChart.prototype),SummaryC.prototype.publish(`iconBaseline`,`bottom`,`string`,`Text baseline for the icon`,[`top`,`middle`,`bottom`]),SummaryC.prototype.publish(`iconAnchor`,`end`,`set`,`Anchors the icon either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`valueAnchor`,`start`,`set`,`Anchors the value either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`labelAnchor`,`start`,`set`,`Anchors the label either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),SummaryC.prototype.publish(`fontFamily`,`Arial`,`string`,`Font Family`),SummaryC.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFillColumn`,null,`set`,`Column for background color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFill`,`#0097e6`,`html-color`,`Background Color`,null,{disable:e=>e.colorFillColumn()}),SummaryC.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for font color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorStroke`,`#2f3640`,`html-color`,`Font Color`,null,{disable:e=>e.colorStrokeColumn()}),SummaryC.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),SummaryC.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),SummaryC.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),SummaryC.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0}),SummaryC.prototype.publish(`fontSizeRatio`,.618,`number`,`Ratio between widget height and value font size`),SummaryC.prototype.publish(`valueOpacity`,1,`number`,`Opacity of value text (0..1)`),SummaryC.prototype.publish(`labelOpacity`,.9,`number`,`Opacity of label text (0..1)`),SummaryC.prototype.publish(`iconOpacity`,.3,`number`,`Opacity of icon text (0..1)`),SummaryC.prototype.publish(`paddingSizeRatio`,.1,`number`,`Ratio of the smallest dimension for edge padding (0..1)`),SummaryC.prototype.publish(`iconSizeRatio`,.9,`number`,`Ratio of the height for icon size (0..1)`);var vt=SummaryC.prototype.playInterval;SummaryC.prototype.playInterval=function(e){let t=vt.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var yt=Math.PI/180,bt=64,xt=2048;function d3Cloud(){let e=(0,n.dispatch)(`word`,`end`),t={},r=[256,256],i=cloudText,a=cloudFont,o=cloudFontSize,s=cloudFontNormal,c=cloudFontNormal,l=cloudRotate,u=cloudPadding,d=[],f=archimedeanSpiral,p=1/0,m=null,h=Math.random,g=cloudCanvas;t.canvas=function(e){return arguments.length?(g=functor(e),t):g},t.start=function(){let n=getContext(g()),f=zeroArray((r[0]>>5)*r[1]),_=null,v=d.length,b=-1,S=[],C=d.map(function(e,t){return e.text=i.call(this,e,t),e.font=a.call(this,e,t),e.style=s.call(this,e,t),e.weight=c.call(this,e,t),e.rotate=l.call(this,e,t),e.size=~~o.call(this,e,t),e.padding=u.call(this,e,t),e}).sort(function(e,t){return t.size-e.size});return m&&clearInterval(m),m=setInterval(step,0),step(),t;function step(){let i=Date.now();for(;Date.now()-i<p&&++b<v&&m;){let i=C[b];i.x=r[0]*(h()+.5)>>1,i.y=r[1]*(h()+.5)>>1,cloudSprite(n,i,C,b),i.hasText&&place(f,i,_)&&(S.push(i),e.call(`word`,t,i),_?cloudBounds(_,i):_=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=r[0]>>1,i.y-=r[1]>>1)}b>=v&&(t.stop(),e.call(`end`,t,S,_))}},t.stop=function(){return m&&=(clearInterval(m),null),t};function getContext(e){e.width=e.height=1;let t=Math.sqrt(e.getContext(`2d`).getImageData(0,0,1,1).data.length>>2);e.width=(bt<<5)/t,e.height=xt/t;let n=e.getContext(`2d`);return n.fillStyle=n.strokeStyle=`red`,n.textAlign=`center`,{context:n,ratio:t}}function place(e,t,n){let i=t.x,a=t.y,o=Math.sqrt(r[0]*r[0]+r[1]*r[1]),s=f(r),c=h()<.5?1:-1,l=-c,u,d,p;for(;(u=s(l+=c))&&(d=~~u[0],p=~~u[1],!(Math.min(Math.abs(d),Math.abs(p))>=o));)if(t.x=i+d,t.y=a+p,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>r[0]||t.y+t.y1>r[1])&&(!n||!cloudCollide(t,e,r[0]))&&(!n||collideRects(t,n))){let n=t.sprite,i=t.width>>5,a=r[0]>>5,o=t.x-(i<<4),s=o&127,c=32-s,l=t.y1-t.y0,u=(t.y+t.y0)*a+(o>>5),d;for(let t=0;t<l;t++){d=0;for(let r=0;r<=i;r++)e[u+r]|=d<<c|(r<i?(d=n[t*i+r])>>>s:0);u+=a}return delete t.sprite,!0}return!1}return t.timeInterval=function(e){return arguments.length?(p=e??1/0,t):p},t.words=function(e){return arguments.length?(d=e,t):d},t.size=function(e){return arguments.length?(r=[+e[0],+e[1]],t):r},t.font=function(e){return arguments.length?(a=functor(e),t):a},t.fontStyle=function(e){return arguments.length?(s=functor(e),t):s},t.fontWeight=function(e){return arguments.length?(c=functor(e),t):c},t.rotate=function(e){return arguments.length?(l=functor(e),t):l},t.text=function(e){return arguments.length?(i=functor(e),t):i},t.spiral=function(e){return arguments.length?(f=St[e]||e,t):f},t.fontSize=function(e){return arguments.length?(o=functor(e),t):o},t.padding=function(e){return arguments.length?(u=functor(e),t):u},t.random=function(e){return arguments.length?(h=e,t):h},t.on=function(){let n=e.on.apply(e,arguments);return n===e?t:n},t}function cloudText(e){return e.text}function cloudFont(){return`serif`}function cloudFontNormal(){return`normal`}function cloudFontSize(e){return Math.sqrt(e.value)}function cloudRotate(){return(~~(Math.random()*6)-3)*30}function cloudPadding(){return 1}function cloudSprite(e,t,n,r){if(t.sprite)return;let i=e.context,a=e.ratio;i.clearRect(0,0,(bt<<5)/a,xt/a);let o=0,s=0,c=0,l=n.length;for(--r;++r<l;){t=n[r],i.save(),i.font=t.style+` `+t.weight+` `+~~((t.size+1)/a)+`px `+t.font;let e=i.measureText(t.text+`m`).width*a,l=t.size<<1;if(t.rotate){let n=Math.sin(t.rotate*yt),r=Math.cos(t.rotate*yt),i=e*r,a=e*n,o=l*r,s=l*n;e=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else e=e+31>>5<<5;if(l>c&&(c=l),o+e>=bt<<5&&(o=0,s+=c,c=0),s+l>=xt)break;i.translate((o+(e>>1))/a,(s+(l>>1))/a),t.rotate&&i.rotate(t.rotate*yt),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=e,t.height=l,t.xoff=o,t.yoff=s,t.x1=e>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=e}let u=i.getImageData(0,0,(bt<<5)/a,xt/a).data,d=[];for(;--r>=0;){if(t=n[r],!t.hasText)continue;let e=t.width,i=e>>5,a=t.y1-t.y0;for(let e=0;e<a*i;e++)d[e]=0;if(o=t.xoff,o==null)return;s=t.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let t=0;t<e;t++){let e=i*n+(t>>5),r=u[(s+n)*(bt<<5)+(o+t)<<2]?1<<31-t%32:0;d[e]|=r,c|=r}c?l=n:(t.y0++,a--,n--,s++)}t.y1=t.y0+l,t.sprite=d.slice(0,(t.y1-t.y0)*i)}}function cloudCollide(e,t,n){n>>=5;let r=e.sprite,i=e.width>>5,a=e.x-(i<<4),o=a&127,s=32-o,c=e.y1-e.y0,l=(e.y+e.y0)*n+(a>>5),u;for(let e=0;e<c;e++){u=0;for(let n=0;n<=i;n++)if((u<<s|(n<i?(u=r[e*i+n])>>>o:0))&t[l+n])return!0;l+=n}return!1}function cloudBounds(e,t){let n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function collideRects(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function archimedeanSpiral(e){let t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function rectangularSpiral(e){let t=4*e[0]/e[1],n=0,r=0;return function(e){let i=e<0?-1:1;switch(Math.sqrt(1+4*i*e)-i&3){case 0:n+=t;break;case 1:r+=4;break;case 2:n-=t;break;default:r-=4;break}return[n,r]}}function zeroArray(e){let t=[],n=-1;for(;++n<e;)t[n]=0;return t}function cloudCanvas(){return document.createElement(`canvas`)}function functor(e){return typeof e==`function`?e:function(){return e}}var St={archimedean:archimedeanSpiral,rectangular:rectangularSpiral},WordCloud=class extends n.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),t.I2DChart.call(this),t.ITooltip.call(this),n.Utility.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(e=>({__viz_label:e[0],__viz_weight:e[1],__viz_row:e}))}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this._root=t.append(`g`),this._canvas=document.createElement(`canvas`);let r=this;this._d3Zoom=(0,n.zoom)().scaleExtent([.1,10]),this._d3Zoom.on(`zoom`,function(e){let t=(0,n.d3Event)();t&&t.transform&&r.zoomed(r._d3Zoom,[t.transform.x,t.transform.y],t.transform.k)}),t.call(this._d3Zoom),this.tooltipHTML(function(e){let t=r.columns(),n=t&&t.length?t[0]:`Word`;return r.tooltipFormat({label:e.__viz_label,series:n,value:e.__viz_weight})})}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._d3Cloud=d3Cloud().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());let r=this.calcData(),i=this,a=(0,n.extent)(r,function(e){return e.__viz_weight}),o;switch(this.scaleMode()){case`log`:o=n.scaleLog;break;case`sqrt`:o=n.scaleSqrt;break;case`pow`:o=n.scalePow;break;default:o=n.scaleLinear;break}let s=o().domain(a).range([this.fontSizeFrom(),this.fontSizeTo()]),c=(0,n.scaleLinear)().domain([0,i.angleCount()-1]).range([i.angleFrom(),i.angleTo()]);this._d3Cloud.stop().size([this.width(),this.height()]).words(r).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(e){return e.__viz_label.trim()}).fontSize(function(e){return s(e.__viz_weight)}).rotate((e,t)=>c(t%i.angleCount())).on(`word`,e=>{}).on(`end`,draw).start();function draw(e,t){let n=i._root.selectAll(`text`).data(e,function(e){return e.__viz_label?e.__viz_label.toLowerCase():``});n.enter().append(`text`).attr(`text-anchor`,`middle`).call(i._selection.enter.bind(i._selection)).text(function(e){return e.__viz_label}).on(`click`,function(e){i.click(i.rowToObj(e.__viz_row),i.columns()[1],i._selection.selected(this))}).on(`dblclick`,function(e){i.dblclick(i.rowToObj(e.__viz_row),i.columns()[1],i._selection.selected(this))}).on(`mouseout.tooltip`,i.tooltip.hide).on(`mousemove.tooltip`,i.tooltip.show).style(`opacity`,1e-6).merge(n).style(`font-size`,function(e){return s(e.__viz_weight)+`px`}).style(`font-family`,i.fontFamily()).transition().duration(1e3).attr(`transform`,function(e){return`translate(`+[e.x,e.y]+`)rotate(`+e.rotate+`)`}).style(`fill`,function(e){return i._palette(e.__viz_label?e.__viz_label.toLowerCase():``)}).style(`opacity`,1),n.exit().transition().duration(1e3).style(`opacity`,1e-4).remove()}}zoomed(e,t,n){if(t[0]!==this._prevOffsetX||t[1]!==this._prevOffsetY||n!==this._prevZoom){switch(this._root.attr(`transform`,t),e){case this:break;case this._d3Zoom:this.offsetX(t[0]),this.offsetY(t[1]),this.zoom(n);break}this._prevOffsetX=t[0],this._prevOffsetY=t[1],this._prevZoom=n}}};WordCloud.prototype._class+=` chart_WordCloud`,WordCloud.prototype.implements(t.I2DChart.prototype),WordCloud.prototype.implements(t.ITooltip.prototype),WordCloud.prototype.mixin(n.Utility.SimpleSelectionMixin),WordCloud.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,WordCloud.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),WordCloud.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),WordCloud.prototype.publish(`fontFamily`,`Impact`,`string`,`Font Name`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeFrom`,6,`number`,`Minimum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeTo`,48,`number`,`Maximum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleFrom`,-60,`number`,`Minimum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleTo`,60,`number`,`Maximum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleCount`,5,`number`,`Number of different angles`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`padding`,0,`number`,`Padding between words (pixels)`,null,{tags:[`Intermediate`]}),WordCloud.prototype.publish(`scaleMode`,`linear`,`set`,`Text scaling mode`,[`linear`,`log`,`sqrt`,`pow`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`spiral`,`archimedean`,`set`,`Text scaling mode`,[`archimedean`,`rectangular`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`offsetX`,0,`number`,`X offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`offsetY`,0,`number`,`Y offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`zoom`,1,`number`,`Zoom`,null,{tags:[`Advanced`]});function multiScale24Hours(){let e=(0,n.timeFormat)(`.%L`),t=(0,n.timeFormat)(`:%S`),r=(0,n.timeFormat)(`%H:%M`),i=(0,n.timeFormat)(`%H:00`),a=(0,n.timeFormat)(`%b %d`),o=(0,n.timeFormat)(`%b`),s=(0,n.timeFormat)(`%Y`);return n=>n.getMilliseconds()===0?n.getSeconds()===0?n.getMinutes()===0?n.getHours()===0?n.getDate()===1?n.getMonth()===0?s(n):o(n):a(n):i(n):r(n):t(n):e(n)}e.Area=Area,e.Axis=Axis,e.BUILD_VERSION=s,e.Bar=Bar,e.Bubble=Bubble,e.BubbleXY=BubbleXY,e.Bullet=Bullet,e.Column=Column,e.Contour=Contour,e.Gantt=Gantt,e.Gauge=$,e.HalfPie=HalfPie,e.Heat=Heat,e.HexBin=HexBin,e.Line=Line,e.PKG_NAME=a,e.PKG_VERSION=o,e.Pie=Pie,e.QuarterPie=QuarterPie,e.QuartileCandlestick=QuartileCandlestick,e.Radar=Radar,e.RadialBar=RadialBar,e.Scatter=Scatter,e.StatChart=StatChart,e.Step=Step,e.Summary=Summary,e.SummaryC=SummaryC,e.WordCloud=WordCloud,e.XYAxis=XYAxis,e.multiScale24Hours=multiScale24Hours});
|
|
2
3
|
//# sourceMappingURL=index.umd.cjs.map
|
|
3
|
-
|
|
4
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1px;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispedges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispedges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispedges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:#0000;stroke-width:2px;pointer-events:all;transition:all .2s}.chart_Scatter .point .pointSelection.selected{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection:hover{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Scatter .point .pointSelection:focus{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection.selected:focus{stroke:#6f42c1!important}.chart_Scatter .point .pointSelection:focus-visible{outline:none}.chart_Scatter .point .pointSelection:active{outline:none!important}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:#0000;border-width:2px}.chart_Column .dataCell.selected .columnRect{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Column .dataCell:hover .columnRect{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Column .dataCell:focus .columnRect{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Column .dataCell.selected:focus .columnRect{stroke:#6f42c1!important}.chart_Column .dataCell:focus-visible{outline:none}.chart_Column .dataCell:active{outline:none!important}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:1px solid #0000;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path,.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:#0000;stroke-width:2px}.chart_Pie .arc.selected path{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_Pie .arc:hover path{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Pie .arc:focus path{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Pie .arc.selected:focus path{stroke:#6f42c1!important}.chart_Pie .arc:focus-visible{outline:none}.chart_Pie .arc:active{outline:none!important}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{margin-top:10px;margin-bottom:10px;margin-left:10px;font-size:3em;font-weight:700}.chart_Summary .bgIcon:before{opacity:.4;font-family:FontAwesome;font-size:5.5em;position:absolute;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;background-color:#efd752;width:100%;height:100%}.chart_Summary .content div{opacity:.8;margin-top:-1.1em;font-size:1.1em}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{width:100%;height:3em;line-height:3em;position:absolute;bottom:0}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|