@hpcc-js/chart 3.8.0 → 3.8.1
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 +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { degreesToRadians as re, normalizeRadians as ie } from "@hpcc-js/util";
|
|
|
5
5
|
var ae = Object.defineProperty, __name = (e, t) => ae(e, "name", {
|
|
6
6
|
value: t,
|
|
7
7
|
configurable: !0
|
|
8
|
-
}), oe = "@hpcc-js/chart", se = "3.8.
|
|
8
|
+
}), oe = "@hpcc-js/chart", se = "3.8.1", ce = "3.26.1", le = Math.PI, ue = 2 * le, de = 1e-6, fe = ue - de;
|
|
9
9
|
function Path() {
|
|
10
10
|
this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";
|
|
11
11
|
}
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,`
|
|
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.1`,s=`3.26.1`,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
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});
|
|
3
3
|
//# sourceMappingURL=index.umd.cjs.map
|
|
4
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)}})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/chart",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "hpcc-js - Viz Chart",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"types/*"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
|
|
24
|
+
"clean": "rimraf --glob lib* types types-3.4 dist *.tsbuildinfo .turbo",
|
|
25
25
|
"bundle": "vite build",
|
|
26
26
|
"bundle-watch": "vite build --watch",
|
|
27
27
|
"bundle-serve": "vite --port 5500",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"update-major": "npx --yes npm-check-updates -u"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@hpcc-js/api": "^3.5.
|
|
43
|
-
"@hpcc-js/common": "^3.8.
|
|
44
|
-
"@hpcc-js/util": "^3.6.
|
|
42
|
+
"@hpcc-js/api": "^3.5.1",
|
|
43
|
+
"@hpcc-js/common": "^3.8.1",
|
|
44
|
+
"@hpcc-js/util": "^3.6.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@hpcc-js/esbuild-plugins": "^1.9.
|
|
47
|
+
"@hpcc-js/esbuild-plugins": "^1.9.1",
|
|
48
48
|
"@types/d3-shape": "1.3.12",
|
|
49
49
|
"@types/d3-transition": "1.3.6",
|
|
50
50
|
"d3-array": "^1",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
79
79
|
},
|
|
80
80
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "0cfcae9b4ccbd0b3c9f21381f4581bf121392585"
|
|
82
82
|
}
|