import{g as t}from"./index-B1MHyEgd.js";function e(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}})}),Object.freeze(t)}var i,r={exports:{}};var a,n=i?r.exports:(i=1,a="undefined"==typeof window?r.exports:window,r.exports=((t,e)=>(()=>{var i={512:t=>{t.exports=e},944:e=>{e.exports=t}},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var n=r[t]={exports:{}};return i[t](n,n.exports,a),n.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};a.d(n,{default:()=>m});var s=a(944),o=a.n(s),l=a(512),h=a.n(l);let{pie:p}=h().seriesTypes,{arrayMax:d,arrayMin:c,clamp:u,extend:f,fireEvent:g,merge:x,pick:M}=o();class y extends p{calculateExtremes(){let t,e,i=this.chart,r=i.plotWidth,a=i.plotHeight,n=this.options,s=2*(n.slicedOffset||0),o=this.getColumn("z"),l=Math.min(r,a)-s,h={},p=this.center||this.getCenter();for(let t of["minPointSize","maxPointSize"]){let e=n[t],i=/%$/.test(e);e=parseInt(e,10),h[t]=i?l*e/100:2*e}this.minPxSize=p[3]+h.minPointSize,this.maxPxSize=u(p[2],p[3]+h.minPointSize,h.maxPointSize),o.length&&(t=M(n.zMin,c(o.filter(this.zValEval))),e=M(n.zMax,d(o.filter(this.zValEval))),this.getRadii(t,e,this.minPxSize,this.maxPxSize))}getRadii(t,e,i,r){let a,n,s,o=this.getColumn("z"),l=[],h="radius"!==this.options.sizeBy,p=e-t;for(let d=0;d<o.length;d++)(n=this.zValEval(o[d])?o[d]:t)<=t?s=i/2:n>=e?s=r/2:(a=p>0?(n-t)/p:.5,h&&(a=Math.sqrt(a)),s=Math.ceil(i+a*(r-i))/2),l.push(s);this.radii=l}redraw(){this.center=null,super.redraw()}getDataLabelPosition(t,e){let{center:i,options:r}=this,a=t.angle||0,n=this.radii[t.index],s=i[0]+Math.cos(a)*n,o=i[1]+Math.sin(a)*n,l=Math.min((r.slicedOffset||0)+(r.borderWidth||0),e/5);return{distance:e,natural:{x:s+Math.cos(a)*e,y:o+Math.sin(a)*e},computed:{},alignment:t.half?"right":"left",connectorPosition:{breakAt:{x:s+Math.cos(a)*l,y:o+Math.sin(a)*l},touchingSliceAt:{x:s,y:o}}}}translate(t){this.generatePoints();let e,i,r,a,n,s,o,l=this.options,h=l.slicedOffset,p=l.startAngle||0,d=Math.PI/180*(p-90),c=Math.PI/180*(M(l.endAngle,p+360)-90),u=c-d,f=this.points,x=l.ignoreHiddenPoint,y=0;this.startAngleRad=d,this.endAngleRad=c,this.calculateExtremes(),t||(this.center=t=this.getCenter());for(let l=0;l<f.length;l++)s=f[l],o=this.radii[l],e=d+y*u,(!x||s.visible)&&(y+=s.percentage/100),i=d+y*u,s.shapeType="arc",s.shapeArgs={x:t[0],y:t[1],r:o,innerR:t[3]/2,start:Math.round(1e3*e)/1e3,end:Math.round(1e3*i)/1e3},(r=(i+e)/2)>1.5*Math.PI?r-=2*Math.PI:r<-Math.PI/2&&(r+=2*Math.PI),s.slicedTranslation={translateX:Math.round(Math.cos(r)*h),translateY:Math.round(Math.sin(r)*h)},a=Math.cos(r)*t[2]/2,n=Math.sin(r)*t[2]/2,s.tooltipPos=[t[0]+.7*a,t[1]+.7*n],s.half=+(r<-Math.PI/2||r>Math.PI/2),s.angle=r;g(this,"afterTranslate")}zValEval(t){return!("number"!=typeof t||isNaN(t))||null}}y.defaultOptions=x(p.defaultOptions,{minPointSize:"10%",maxPointSize:"100%",zMin:void 0,zMax:void 0,sizeBy:"area",tooltip:{pointFormat:'<span style="color:{point.color}">●</span> {series.name}<br/>Value: {point.y}<br/>Size: {point.z}<br/>'}}),f(y.prototype,{pointArrayMap:["y","z"],parallelArrays:["x","y","z"]}),h().registerSeriesType("variablepie",y);let m=o();return n.default})())(a._Highcharts,a._Highcharts.SeriesRegistry)),s=e({__proto__:null,default:t(n)},[n]);export{s as v};
//# sourceMappingURL=variable-pie-DzNDCmSs.js.map
