/** * Highcharts JS v11.2.0 (2023-10-30) * * Variable Pie module for Highcharts * * (c) 2010-2021 Grzegorz Blachliński * * License: www.highcharts.com/license */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/variable-pie",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(t,e,i,a){t.hasOwnProperty(e)||(t[e]=a.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Series/VariablePie/VariablePieSeriesDefaults.js",[],function(){return{minPointSize:"10%",maxPointSize:"100%",zMin:void 0,zMax:void 0,sizeBy:"area",tooltip:{pointFormat:' {series.name}
Value: {point.y}
Size: {point.z}
'}}}),i(e,"Series/VariablePie/VariablePieSeries.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"],e["Series/VariablePie/VariablePieSeriesDefaults.js"]],function(t,e,i){let{pie:a}=t.seriesTypes,{arrayMax:s,arrayMin:n,clamp:r,extend:o,fireEvent:l,merge:h,pick:d}=e;class p extends a{constructor(){super(...arguments),this.data=void 0,this.options=void 0,this.points=void 0,this.radii=void 0}calculateExtremes(){let t,e;let i=this.chart,a=i.plotWidth,o=i.plotHeight,l=this.options,h=2*(l.slicedOffset||0),p=this.zData,u=Math.min(a,o)-h,c={},f=this.center||this.getCenter();for(let t of["minPointSize","maxPointSize"]){let e=l[t],i=/%$/.test(e);e=parseInt(e,10),c[t]=i?u*e/100:2*e}this.minPxSize=f[3]+c.minPointSize,this.maxPxSize=r(f[2],f[3]+c.minPointSize,c.maxPointSize),p.length&&(t=d(l.zMin,n(p.filter(this.zValEval))),e=d(l.zMax,s(p.filter(this.zValEval))),this.getRadii(t,e,this.minPxSize,this.maxPxSize))}getRadii(t,e,i,a){let s,n,r;let o=this.zData,l=[],h=this.options,d="radius"!==h.sizeBy,p=e-t;for(let h=0;h=e?r=a/2:(s=p>0?(n-t)/p:.5,d&&(s=Math.sqrt(s)),r=Math.ceil(i+s*(a-i))/2),l.push(r);this.radii=l}redraw(){this.center=null,super.redraw()}getDataLabelPosition(t,e){let{center:i,options:a}=this,s=t.angle||0,n=this.radii[t.index],r=i[0]+Math.cos(s)*n,o=i[1]+Math.sin(s)*n,l=(a.slicedOffset||0)+(a.borderWidth||0),h=Math.min(l,e/5);return{distance:e,natural:{x:r+Math.cos(s)*e,y:o+Math.sin(s)*e},computed:{},alignment:t.half?"right":"left",connectorPosition:{breakAt:{x:r+Math.cos(s)*h,y:o+Math.sin(s)*h},touchingSliceAt:{x:r,y:o}}}}translate(t){this.generatePoints();let e=this.options,i=e.slicedOffset,a=e.startAngle||0,s=Math.PI/180*(a-90),n=Math.PI/180*(d(e.endAngle,a+360)-90),r=n-s,o=this.points,h=e.ignoreHiddenPoint,p=0,u,c,f,M,m,P,g;this.startAngleRad=s,this.endAngleRad=n,this.calculateExtremes(),t||(this.center=t=this.getCenter());for(let e=0;e1.5*Math.PI?f-=2*Math.PI:f<-Math.PI/2&&(f+=2*Math.PI),P.slicedTranslation={translateX:Math.round(Math.cos(f)*i),translateY:Math.round(Math.sin(f)*i)},M=Math.cos(f)*t[2]/2,m=Math.sin(f)*t[2]/2,P.tooltipPos=[t[0]+.7*M,t[1]+.7*m],P.half=f<-Math.PI/2||f>Math.PI/2?1:0,P.angle=f;l(this,"afterTranslate")}zValEval(t){return!("number"!=typeof t||isNaN(t))||null}}return p.defaultOptions=h(a.defaultOptions,i),o(p.prototype,{pointArrayMap:["y","z"],parallelArrays:["x","y","z"]}),t.registerSeriesType("variablepie",p),p}),i(e,"masters/modules/variable-pie.src.js",[],function(){})});//# sourceMappingURL=variable-pie.js.map