apexcharts 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +30 -11
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +545 -463
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +1149 -801
- package/dist/apexcharts.js +684 -254
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +684 -254
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +20 -10
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +20 -10
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +20 -10
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +20 -10
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +545 -463
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +20 -10
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +364 -26
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +12 -14
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +14 -1
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +38 -38
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +11 -11
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +11 -11
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +172 -25
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +180 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +20 -10
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radar.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +20 -10
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +20 -10
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +1 -1
- package/dist/unit.esm.js +79 -79
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +20 -10
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +20 -10
- package/package.json +2 -2
- package/src/apexcharts.js +39 -15
- package/src/charts/common/bar/Helpers.js +31 -12
- package/src/modules/Data.js +8 -2
- package/src/modules/Exports.js +14 -12
- package/src/modules/Formatters.js +24 -1
- package/src/modules/Range.js +28 -1
- package/src/modules/Toolbar.js +112 -2
- package/src/modules/ZoomPanSelection.js +85 -7
- package/src/modules/accessibility/KeyboardNavigation.js +14 -0
- package/src/modules/axes/YAxis.js +12 -15
- package/src/modules/helpers/UpdateHelpers.js +25 -8
- package/src/modules/settings/Globals.js +5 -10
- package/src/modules/settings/Options.js +15 -0
- package/src/modules/weave/PluginAPI.js +57 -1
- package/src/modules/weave/WeaveHost.js +148 -0
- package/src/ssr/DOMShim.js +50 -0
- package/src/types/internal.d.ts +1 -1
- package/src/utils/Utils.js +6 -9
- package/types/apexcharts.d.ts +17 -0
package/dist/line.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexLine={})}(this,function(e){"use strict";var t=Object.defineProperty,s=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,l=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,o=(e,t)=>{for(var s in t||(t={}))r.call(t,s)&&l(e,s,t[s]);if(n)for(var s of n(t))a.call(t,s)&&l(e,s,t[s]);return e},h=(e,t)=>s(e,i(t));const u=globalThis.ApexCharts,c=globalThis.ApexCharts.__internals.__apex_CoreUtils,p=globalThis.ApexCharts.__internals.__apex_Graphics,d=globalThis.ApexCharts.__internals.__apex_Fill,g=globalThis.ApexCharts.__internals.__apex_DataLabels,f=globalThis.ApexCharts.__internals.__apex_Markers,m=globalThis.ApexCharts.__internals.__apex_charts_Scatter,x=globalThis.ApexCharts.__internals.__apex_Series,y=globalThis.ApexCharts.__internals.__apex_Utils;class b{constructor(e){this.w=e.w,this.lineCtx=e}sameValueSeriesFix(e,t){const s=this.w;if("gradient"===s.config.fill.type||"gradient"===s.config.fill.type[e]){if(new c(this.lineCtx.w).seriesHaveSameValues(e)){const s=t[e].slice();s[s.length-1]=s[s.length-1]+1e-6,t[e]=s}}return t}calculatePoints({series:e,realIndex:t,x:s,y:i,i:n,j:r,prevY:a}){const l=this.w,o=[],h=[];let u=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.axisFlags.isXNumeric&&(u=(l.seriesData.seriesX[t][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===r&&(o.push(u),h.push(y.isNumber(e[n][0])?a+l.config.markers.offsetY:null)),o.push(s+l.config.markers.offsetX),h.push(y.isNumber(e[n][r+1])?i+l.config.markers.offsetY:null),{x:o,y:h}}checkPreviousPaths({pathFromLine:e,pathFromArea:t,realIndex:s}){const i=this.w;for(let n=0;n<i.globals.previousPaths.length;n++){const r=i.globals.previousPaths[n];("line"===r.type||"area"===r.type)&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(s,10)&&("line"===r.type?(this.lineCtx.appendPathFrom=!1,e=i.globals.previousPaths[n].paths[0].d):"area"===r.type&&(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[n].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[n].paths[1]&&(e=i.globals.previousPaths[n].paths[1].d)))}return{pathFromLine:e,pathFromArea:t}}determineFirstPrevY({i:e,realIndex:t,series:s,prevY:i,lineYPosition:n,translationsIndex:r}){var a,l,o;const h=this.w,u=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(a=this.w.config.series[t])?void 0:a.type)||"column"===(null==(l=this.w.config.series[t])?void 0:l.type));if(void 0!==(null==(o=s[e])?void 0:o[0])){if(u)if(e>0){const e=this.lineCtx.stackTopAt(t,0);n=void 0===e?this.lineCtx.zeroY:e}else n=this.lineCtx.zeroY;else n=this.lineCtx.zeroY;i=n-s[e][0]/this.lineCtx.yRatio[r]+2*(this.lineCtx.isReversed?s[e][0]/this.lineCtx.yRatio[r]:0)}else if(u&&e>0&&void 0===s[e][0])for(let t=e-1;t>=0;t--)if(null!==s[t][0]&&void 0!==s[t][0]){i=n=this.lineCtx.prevSeriesY[t][0];break}return{prevY:i,lineYPosition:n}}}function v(e){let t=(2654435769^e)>>>0;return t=Math.imul(t^t>>>16,73244475),t=Math.imul(t^t>>>16,73244475),((t^t>>>16)>>>0)/4294967296}const P=e=>{const t=function(e){const t=[];let s=e[0],i=e[1],n=t[0]=w(s,i),r=1;for(let a=e.length-1;r<a;r++)s=i,i=e[r+1],t[r]=.5*(n+(n=w(s,i)));return t[r]=n,t}(e),s=e.length-1,i=[];let n,r,a,l;for(let i=0;i<s;i++)a=w(e[i],e[i+1]),Math.abs(a)<1e-6?t[i]=t[i+1]=0:(n=t[i]/a,r=t[i+1]/a,l=n*n+r*r,l>9&&(l=3*a/Math.sqrt(l),t[i]=l*n,t[i+1]=l*r));for(let n=0;n<=s;n++)l=(e[Math.min(s,n+1)][0]-e[Math.max(0,n-1)][0])/(6*(1+t[n]*t[n])),i.push([l||0,t[n]*l||0]);return i},A={points(e){const t=P(e),s=e[1],i=e[0],n=[],r=t[1],a=t[0];n.push(i,[i[0]+a[0],i[1]+a[1],s[0]-r[0],s[1]-r[1],s[0],s[1]]);for(let s=2,i=t.length;s<i;s++){const i=e[s],r=t[s];n.push([i[0]-r[0],i[1]-r[1],i[0],i[1]])}return n},slice(e,t,s){const i=e.slice(t,s);if(t){if(s-t>1&&i[1].length<6){const e=i[0].length;i[1]=[2*i[0][e-2]-i[0][e-4],2*i[0][e-1]-i[0][e-3]].concat(i[1])}i[0]=i[0].slice(-2)}return i}};function w(e,t){return(t[1]-e[1])/(t[0]-e[0])}const k=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function _(e,t){const{ax:s,bx:i,ay:n,by:r}=t,a=[],l=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].toUpperCase(),t=(o[2].match(k)||[]).map(parseFloat);if("Z"===e){a.push("z");continue}if("H"===e){for(const e of t)a.push(`H ${s*e+i}`);continue}if("V"===e){for(const e of t)a.push(`V ${n*e+r}`);continue}if("A"===e){for(let e=0;e+6<t.length;e+=7)a.push(`A ${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${s*t[e+5]+i} ${n*t[e+6]+r}`);continue}const l=[];for(let e=0;e+1<t.length;e+=2)l.push(`${s*t[e]+i} ${n*t[e+1]+r}`);l.length&&a.push(`${e} ${l.join(" ")}`)}return a.join(" ")}const Y=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,F=globalThis.ApexCharts.__internals.__apex_Environment_Environment;function C(e){return-Math.cos(e*Math.PI)/2+.5}function M(e,t,s,i){e=Math.min(Math.max(e,0),1),s=Math.min(Math.max(s,0),1);const n=3*e,r=3*(s-e)-n,a=1-n-r,l=3*t,o=3*(i-t)-l,h=1-l-o,u=e=>((a*e+r)*e+n)*e;return e=>e<=0?0:e>=1?1:(e=>((h*e+o)*e+l)*e)((e=>{let t=0,s=1,i=e;if(i<t)return t;if(i>s)return s;for(;t<s;){const n=u(i);if(Math.abs(n-e)<1e-4)return i;e>n?t=i:s=i,i=(t+s)/2}return i})(e))}const S=new Map;function I(e){return"function"==typeof e?j(e):(t=e,Array.isArray(t)&&4===t.length&&t.every(e=>"number"==typeof e)?M(e[0],e[1],e[2],e[3]):"string"==typeof e&&S.has(e)?j(S.get(e)):C);var t}function j(e){return t=>{const s=e(t);return"number"==typeof s&&isFinite(s)?s:t}}S.set("linear",e=>e),S.set("easeInOutSine",C),S.set("easeInSine",e=>1-Math.cos(e*Math.PI/2)),S.set("easeOutSine",e=>Math.sin(e*Math.PI/2)),S.set("easeInQuad",e=>e*e),S.set("easeOutQuad",e=>1-(1-e)*(1-e)),S.set("easeInOutQuad",e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2),S.set("easeInCubic",e=>e*e*e),S.set("easeOutCubic",e=>1-Math.pow(1-e,3)),S.set("easeInOutCubic",e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2),S.set("easeOutBack",e=>{const t=1.70158;return 1+2.70158*Math.pow(e-1,3)+t*Math.pow(e-1,2)}),S.set("easeInOutBack",e=>{const t=2.5949095;return e<.5?Math.pow(2*e,2)*(7.189819*e-t)/2:(Math.pow(2*e-2,2)*((t+1)*(2*e-2)+t)+2)/2});const L=globalThis.ApexCharts.__internals,X=L.__apex_PathMorphing_parsePath;L.__apex_PathMorphing_morphPaths,L.__apex_PathMorphing_pathBbox;const R=L.__apex_PathMorphing_arrayToPath;function z(e,t,s){if(!e||"string"!=typeof e)return null;const i=X(e);if(!i.length||"M"!==i[0][0])return null;for(let e=1;e<i.length;e++)if("M"===i[e][0])return null;let n=i,r=null;if(s){if(i.length<5)return null;if(r=i.slice(-3),n=i.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===i[i.length-1][0])return null;if(n.length!==t||n.length<2)return null;const a=n[1][0];if("L"!==a&&"C"!==a)return null;for(let e=2;e<n.length;e++)if(n[e][0]!==a)return null;const l=n.map(e=>"C"===e[0]?[Number(e[5]),Number(e[6])]:[Number(e[1]),Number(e[2])]);for(const e of l)if(!isFinite(e[0])||!isFinite(e[1]))return null;return{body:n,closing:r,segType:a,anchors:l}}function D(e,t,s){return[e[0]+(t[0]-e[0])*s,e[1]+(t[1]-e[1])*s]}function N(e,t,s){const i=e,n=[t[1],t[2]],r=[t[3],t[4]],a=[t[5],t[6]],l=D(i,n,s),o=D(n,r,s),h=D(r,a,s),u=D(l,o,s),c=D(o,h,s),p=D(u,c,s);return{first:["C",l[0],l[1],u[0],u[1],p[0],p[1]],second:["C",c[0],c[1],h[0],h[1],a[0],a[1]],mid:p}}function T(e,t,s){const i=[t[1],t[2]],n=D(e,i,s);return{first:["L",n[0],n[1]],second:["L",i[0],i[1]],mid:n}}function $(e,t){const{body:s,closing:i,segType:n,anchors:r}=e,a=r.length,l=t.length,o=e=>"C"===n?["C",e[0],e[1],e[0],e[1],e[0],e[1]]:["L",e[0],e[1]],h=[["M",r[0][0],r[0][1]]];let u=0;for(;u<l&&0!==t[u];)u++;for(let e=1;e<=u;e++)h.push(o(r[0]));let c=u+1;for(let e=0;e<a-1;e++){let i=0;for(;c+i<l&&-1===t[c+i];)i++;const a=s[e+1];if(i){const t=i+1;let s=r[e],l=a;for(let e=0;e<i;e++){const i=1/(t-e),r="C"===n?N(s,l,i):T(s,l,i);h.push(r.first),s=r.mid,l=r.second}h.push(l)}else h.push(a.slice());c+=i+1}for(;c<l;)h.push(o(r[a-1])),c++;return i&&i.forEach(e=>h.push(e.slice())),h}function O(e,t,s,i,n,r){const a=z(e,i,r);if(!a)return null;const l=z(t,n,r);if(!l)return null;if(a.segType!==l.segType)return null;if((a.closing||l.closing)&&(!a.closing||!l.closing||a.closing[0][0]!==l.closing[0][0]))return null;const o=s.map(e=>e.oldJ),h=s.map(e=>e.newJ);return{from:R($(a,o)),toInterp:R($(l,h))}}function B(e){const t=new Map;return e.map(e=>{const s=t.get(e)||0;return t.set(e,s+1),0===s?e:`${e}#${s}`})}function W(e,t,s=!1,i=!1){var n,r;if(!function(e){var t;const s=e.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const i=null!=(t=s.largeDatasetThreshold)?t:0;return!(i>0&&e.globals.dataPoints>i||!(F.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate))}(e))return null;const a=e.globals.prevStreamFrame;if(!a)return null;const l=null==(n=a.seriesY)?void 0:n[t],o=null==(r=e.seriesData.series)?void 0:r[t];if(!Array.isArray(l)||!Array.isArray(o))return null;if(!l.length||!o.length)return null;const h=B(l.map((e,s)=>function(e,t,s){var i,n;if(e.isXNumeric){const n=null==(i=e.seriesX)?void 0:i[t];if(n&&n.length&&null!=n[s])return"x:"+n[s]}const r=null==(n=e.labels)?void 0:n[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(a,t,s))),u=B(o.map((s,i)=>function(e,t,s){var i,n,r,a;if(null==(i=e.axisFlags)?void 0:i.isXNumeric){const i=null==(r=null==(n=e.seriesData)?void 0:n.seriesX)?void 0:r[t];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const l=null==(a=e.globals.labels)?void 0:a[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}(e,t,i))),c=function(e,t){const s=new Map;e.forEach((e,t)=>{s.has(e)||s.set(e,t)});const i=new Array(t.length),n=new Set;let r=-1,a=!0,l=e.length===t.length;t.forEach((e,t)=>{const o=s.has(e)&&!n.has(s.get(e))?s.get(e):-1;i[t]=o,-1!==o&&(n.add(o),o<r&&(a=!1),r=o),o!==t&&(l=!1)});const o=[];for(let t=0;t<e.length;t++)n.has(t)||o.push(t);return{toOld:i,exits:o,ordered:a,changed:!l}}(h,u);return(c.ordered||i)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:u}:null}function H(e,t,s,i,n){const r=performance.now(),a=l=>{if(e.globals.isDestroyed)return;const o=Math.max(0,Math.min(1,(l-r)/t));i(s(o),o),o<1?Y.requestAnimationFrame(a):n&&n()};Y.requestAnimationFrame(a)}function V(e,{elPointsMain:t,realIndex:s,speed:i}){var n,r,a,l;if(!(null==t?void 0:t.node))return!1;const o=W(e,s,!0);if(!o)return!1;const h=e.globals.prevStreamFrame;if(!h)return!1;const u=null==(n=h.xPixels)?void 0:n[s],c=null==(r=h.yPixels)?void 0:r[s];if(!u||!c)return!1;const p=t.node.querySelectorAll(".apexcharts-marker");if(!p.length)return!1;const d=(null==(a=e.globals.seriesXvalues)?void 0:a[s])||[],g=(null==(l=e.globals.seriesYvalues)?void 0:l[s])||[],f=function(e){var t,s;const i=e.config.chart.animations;return I(null!=(s=null==(t=i.dynamicAnimation)?void 0:t.easing)?s:i.easing)}(e),m=Math.max(1,i||1);return t.node.classList.remove("apexcharts-element-hidden"),p.forEach(t=>{var i,n,r,a,l,p,x,y,b;const v=parseInt(null!=(n=null!=(i=t.getAttribute("j"))?i:t.getAttribute("rel"))?n:"",10);if(!isFinite(v)||v<0||v>=o.join.toOld.length)return;const P=o.join.toOld[v],A=null!=d[v]&&null!=g[v]?[d[v],g[v]]:null;if(-1===P||!A){const s=t.style;return s.opacity="0",void H(e,m,f,e=>{s.opacity=String(e)},()=>{s.opacity=""})}const w=(null!=(r=u[P])?r:NaN)-A[0],k=(null!=(a=c[P])?a:NaN)-A[1];if(!isFinite(w)||!isFinite(k))return;const _=null!=(x=null==(p=null==(l=h.rPixels)?void 0:l[s])?void 0:p[P])?x:NaN,Y=parseFloat(null!=(b=null!=(y=t.getAttribute("r"))?y:t.getAttribute("default-marker-size"))?b:""),F=isFinite(_)&&isFinite(Y)&&Y>0&&Math.abs(_-Y)>.25;if(!(Math.abs(w)>=.5||Math.abs(k)>=.5)&&!F)return;const C=e=>{const s=w*(1-e),i=k*(1-e);if(F){const n=(_+(Y-_)*e)/Y;t.setAttribute("transform",`translate(${s+A[0]*(1-n)}, ${i+A[1]*(1-n)}) scale(${n})`)}else t.setAttribute("transform",`translate(${s}, ${i})`)};C(0),H(e,m,f,C,()=>{t.removeAttribute("transform")})}),!0}function E(e,{type:t,realIndex:s,pathFromLine:i,pathFromArea:n,linePaths:r,areaPaths:a}){var l,o;const h=W(e,s);if(!h)return null;const{join:u,oldKeys:c,newKeys:p}=h,d=e.globals.prevStreamFrame;if(!d)return null;const g=null==(l=d.seriesY)?void 0:l[s],f=null==(o=e.seriesData.series)?void 0:o[s];if(g.length<2||f.length<2)return null;if(g.some(e=>null===e)||f.some(e=>null===e))return null;const m=function(e,t){const s=new Set(e.exits),i=[];let n=0;for(let t=0;t<e.toOld.length;t++){const r=e.toOld[t];if(-1!==r){for(;n<r;)s.has(n)&&i.push({oldJ:n,newJ:-1}),n++;i.push({oldJ:r,newJ:t}),n=r+1}else i.push({oldJ:-1,newJ:t})}for(;n<t;)s.has(n)&&i.push({oldJ:n,newJ:-1}),n++;return i}(u,c.length),x={};return Array.isArray(r)&&1===r.length&&i&&(x.line=O(i,r[0],m,c.length,p.length,!1)),"area"===t&&Array.isArray(a)&&1===a.length&&n&&(x.area=O(n,a[0],m,c.length,p.length,!0)),x.line||x.area?x:null}class J{constructor(e,t,s,i){this.ctx=t,this.w=e,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||i,this.scatter=new m(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new b(this),this.markers=new f(this.w,this.ctx),this.prevSeriesY=[],this.prevSeriesYByX=new Map,this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null,this._elLastPointsWrap=null}draw(e,t,s,i){var n;const r=this.w,a=new p(this.w),l=r.globals.comboCharts?t:r.config.chart.type,u=a.group({class:`apexcharts-${l}-series apexcharts-plot-series`}),d=new c(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=d.getLogSeries(e),this.yRatio=d.getLogYRatios(this.yRatio),this.prevSeriesY=[],this.prevSeriesYByX=new Map;const g=[];for(let t=0;t<e.length;t++){e=this.lineHelpers.sameValueSeriesFix(t,e);const n=r.globals.comboCharts?s[t]:t,a=this.yRatio.length>1?n:0;this._initSerieVariables(e,t,n);const u=[],c=[],p=[];let d=r.globals.padHorizontal+this.categoryAxisCorrection;const f=1,m=[],y=[];x.addCollapsedClassToSeries(this.w,this.elSeries,n),r.axisFlags.isXNumeric&&r.seriesData.seriesX.length>0&&(d=(r.seriesData.seriesX[n][0]-r.globals.minX)/this.xRatio),p.push(d);const b=d;let v;const P=b;let A=this.zeroY,w=this.zeroY;const k=0;A=this.lineHelpers.determineFirstPrevY({i:t,realIndex:n,series:e,prevY:A,lineYPosition:k,translationsIndex:a}).prevY,"monotoneCubic"===r.config.stroke.curve&&null===e[t][0]?u.push(null):u.push(A);const _=A;let Y;"rangeArea"===l&&(Y=this.lineHelpers.determineFirstPrevY({i:t,realIndex:n,series:i,prevY:w,lineYPosition:k,translationsIndex:a}),w=Y.prevY,v=w,c.push(null!==u[0]?w:null));const F=this._calculatePathsFrom({type:l,series:e,i:t,realIndex:n,translationsIndex:a,prevX:P,prevY:A,prevY2:w}),C=[u[0]],M=[c[0]],S={type:l,series:e,realIndex:n,translationsIndex:a,i:t,x:d,y:f,pX:b,pY:_,pathsFrom:F,linePaths:m,areaPaths:y,seriesIndex:s,lineYPosition:k,xArrj:p,yArrj:u,y2Arrj:c,seriesRangeEnd:i},I=this._iterateOverDataPoints(h(o({},S),{iterations:"rangeArea"===l?e[t].length-1:void 0,isRangeStart:!0}));if("rangeArea"===l){const e=this._calculatePathsFrom({series:i,i:t,realIndex:n,prevX:P,prevY:w}),s=this._iterateOverDataPoints(h(o({},S),{series:i,xArrj:[d],yArrj:C,y2Arrj:M,pY:v,areaPaths:I.areaPaths,pathsFrom:e,iterations:i[t].length-1,isRangeStart:!1})),r=I.linePaths.length/2;for(let e=0;e<r;e++)I.linePaths[e]=s.linePaths[e+r]+I.linePaths[e];I.linePaths.splice(r),I.pathFromLine=s.pathFromLine+I.pathFromLine}else/z\s*$/i.test(I.pathFromArea)||(I.pathFromArea+="z");this._handlePaths({type:l,realIndex:n,i:t,paths:I}),this.markers.flushBatch(this.elPointsMain,n),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),g.push(this.elSeries)}if(void 0!==(null==(n=r.config.series[0])?void 0:n.zIndex)&&g.sort((e,t)=>Number(e.node.getAttribute("zIndex"))-Number(t.node.getAttribute("zIndex"))),r.config.chart.stacked)for(let e=g.length-1;e>=0;e--)u.add(g[e]);else for(let e=0;e<g.length;e++)u.add(g[e]);return u}_initSerieVariables(e,t,s){const i=this.w,n=new p(this.w);this.xDivision=i.layout.gridWidth/(i.globals.dataPoints-("on"===i.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(i.config.stroke.width)?i.config.stroke.width[s]:i.config.stroke.width;let r=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],r=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.layout.gridHeight-this.baseLineY[r]-(this.isReversed?i.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.layout.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const a=i.config.series[s];if(this.elSeries=n.group({class:"apexcharts-series",zIndex:void 0!==a.zIndex?a.zIndex:s,seriesName:y.escapeString(i.seriesData.seriesNames[s])}),this.elPointsMain=n.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,i.globals.hasNullValues){const e=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.layout.gridHeight+i.globals.markers.largestSize]},seriesIndex:t,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==e&&this.elPointsMain.add(e)}this.elDataLabelsWrap=n.group({class:"apexcharts-datalabels","data:realIndex":s});const l=e[t].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":l,rel:t+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:e,series:t,i:s,realIndex:i,translationsIndex:n,prevX:r,prevY:a,prevY2:l}){const o=this.w,h=new p(this.w);let u,c,d,g;if(null===t[s][0]){for(let e=0;e<t[s].length;e++)if(null!==t[s][e]){r=this.xDivision*e,a=this.zeroY-t[s][e]/this.yRatio[n],u=h.move(r,a),c=h.move(r,this.areaBottomY);break}}else u=h.move(r,a),"rangeArea"===e&&(u=h.move(r,l)+h.line(r,a)),c=h.move(r,this.areaBottomY)+h.line(r,a);if(d=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),g=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),o.globals.previousPaths.length>0){const e=this.lineHelpers.checkPreviousPaths({pathFromLine:d,pathFromArea:g,realIndex:i});d=e.pathFromLine,g=e.pathFromArea}return{prevX:r,prevY:a,linePath:u,areaPath:c,pathFromLine:d,pathFromArea:g}}_stackKey(e,t){if(!this.w.axisFlags.isXNumeric)return t;const s=this.w.seriesData.seriesX[e];return s?s[t]:void 0}stackTopAt(e,t){const s=this._stackKey(e,t);if(null!=s)return this.prevSeriesYByX.get(s)}_recordStackTops(e,t){const s=this.w;if(Array.isArray(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e))for(let s=0;s<t.length;s++){const i=this._stackKey(e,s);if(null==i)continue;const n=t[s];y.isNumber(n)&&this.prevSeriesYByX.set(i,n)}}_handlePaths({type:e,realIndex:t,i:s,paths:i}){var n,r,a,l,u,c,g;const f=this.w,m=new p(this.w),x=function(e,t){const s=e&&e.renderer;return s&&s.kind&&"svg"!==s.kind?s:t}(this.ctx,m),y=new d(this.w);this.prevSeriesY.push(i.yArrj),this._recordStackTops(t,i.yArrj);let b=null;"line"!==e&&"area"!==e||!f.globals.dataChanged||(b=function(e,t,s,i){var n;const r=e.globals,a=r.prevStreamFrame;if(!a||!r.dataChanged||!(null==(n=e.axisFlags)?void 0:n.isXNumeric))return null;const l=a.seriesX[t],o=a.seriesY[t],h=e.seriesData.seriesX[t],u=e.seriesData.series[t];if(!(l&&o&&h&&u))return null;if(l.length<3||h.length<3)return null;let c=-1;for(let e=0;e<l.length;e++)if(l[e]===h[0]){c=e;break}if(-1===c)return null;const p=Math.min(l.length-c,h.length);if(p<2)return null;const d=h.length-p;if(0===c&&0===d)return null;for(let e=0;e<p;e++){if(l[c+e]!==h[e])return null;const t=o[c+e],s=u[e];if(t!==s&&(null!=t||null!=s))return null}const g=a.xPixels[t],f=a.yPixels[t];if(!g||!f)return null;let m=-1,x=-1;for(let e=0;e<p;e++)null!=g[c+e]&&null!=f[c+e]&&null!=s[e]&&null!=i[e]&&(-1===m&&(m=e),x=e);if(-1===m||x<=m)return null;const y=s[m],b=s[x],v=g[c+m],P=g[c+x];if(Math.abs(b-y)<1e-6)return null;const A=(P-v)/(b-y),w=v-A*y;if(!isFinite(A)||!isFinite(w))return null;if(Math.abs(A-1)>.02)return null;if(Math.abs(w)<.5)return null;let k=m,_=m;for(let e=m;e<=x;e++){const t=i[e];null!=t&&null!=f[c+e]&&(t<i[k]&&(k=e),t>i[_]&&(_=e))}let Y=1,F=0;const C=i[k],M=i[_];if(Math.abs(M-C)>1e-6?(Y=(f[c+_]-f[c+k])/(M-C),F=f[c+k]-Y*C):F=f[c+k]-C,!isFinite(Y)||!isFinite(F)||Y<.2||Y>5)return null;const S=Math.floor((m+x)/2);if(S!==m&&S!==x&&null!=s[S]&&null!=g[c+S]){const e=A*s[S]+w;if(Math.abs(e-g[c+S])>1.5)return null;if(null!=i[S]&&null!=f[c+S]){const e=Y*i[S]+F;if(Math.abs(e-f[c+S])>1.5)return null}}return r.streamScrolled=!0,{ax:A,bx:w,ay:Y,by:F}}(f,t,i.xArrj,i.yArrj));let v=null;b||"line"!==e&&"area"!==e||(v=E(f,{type:e,realIndex:t,pathFromLine:i.pathFromLine,pathFromArea:i.pathFromArea,linePaths:i.linePaths,areaPaths:i.areaPaths})),f.globals.seriesXvalues[t]=i.xArrj,f.globals.seriesYvalues[t]=i.yArrj;const P=f.config.forecastDataPoints;if(P.count>0&&"rangeArea"!==e){const e=f.globals.seriesXvalues[t][f.globals.seriesXvalues[t].length-P.count-1],s=m.drawRect(e,0,f.layout.gridWidth,f.layout.gridHeight,0);f.dom.elForecastMask.appendChild(s.node);const i=m.drawRect(0,0,e,f.layout.gridHeight,0);f.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart?V(f,{elPointsMain:this.elPointsMain,realIndex:t,speed:f.config.chart.animations.dynamicAnimation.speed}):(f.globals.delayedElements.push({el:this.elPointsMain.node,index:t}),V(f,{elPointsMain:this.elPointsMain,realIndex:t,speed:f.config.chart.animations.dynamicAnimation.speed}),W(f,t)&&(null==(n=this.elDataLabelsWrap)?void 0:n.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),f.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0})));const A={i:s,realIndex:t,animationDelay:s,initialSpeed:f.config.chart.animations.speed,dataChangeSpeed:f.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${e}`},w=i.numericXY,k="line"===e||"area"===e,Y=k&&i.linePaths.length>1?[i.linePaths.join(" ")]:i.linePaths,F=k&&i.areaPaths.length>1?[i.areaPaths.join(" ")]:i.areaPaths;if("area"===e){const e=y.fillPath({seriesNumber:t});for(let t=0;t<F.length;t++){const s=x.renderPaths(h(o({},A),{pathFrom:b?_(i.areaPaths[t],b):null!=(a=null==(r=null==v?void 0:v.area)?void 0:r.from)?a:i.pathFromArea,pathTo:F[t],pathToNumeric:w?{xs:w.xs,ys:w.ys,closeY:w.areaCloseY}:void 0,pathToInterp:null==(l=null==v?void 0:v.area)?void 0:l.toInterp,scrollMorph:!!b,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:e}));this.elSeries.add(s)}}if(f.config.stroke.show&&!this.pointsChart){let n=null;if("line"===e)n=y.fillPath({seriesNumber:t,i:s});else if("solid"===f.config.stroke.fill.type)n=f.globals.stroke.colors[t];else{const e=f.config.fill;f.config.fill=f.config.stroke.fill,n=y.fillPath({seriesNumber:t,i:s}),f.config.fill=e}for(let s=0;s<Y.length;s++){let r=n;"rangeArea"===e&&(r=y.fillPath({seriesNumber:t}));const a=h(o({},A),{pathFrom:b?_(i.linePaths[s],b):null!=(c=null==(u=null==v?void 0:v.line)?void 0:u.from)?c:i.pathFromLine,pathTo:Y[s],pathToNumeric:w?{xs:w.xs,ys:w.ys}:void 0,pathToInterp:null==(g=null==v?void 0:v.line)?void 0:g.toInterp,scrollMorph:!!b,stroke:n,strokeWidth:this.strokeWidth,strokeLineCap:f.config.stroke.lineCap,fill:"rangeArea"===e?r:"none"}),l=x.renderPaths(a);if(this.elSeries.add(l),l.attr("fill-rule","evenodd"),P.count>0&&"rangeArea"!==e){const e=x.renderPaths(a);e.node.setAttribute("stroke-dasharray",P.dashArray),P.strokeWidth&&e.node.setAttribute("stroke-width",P.strokeWidth),this.elSeries.add(e),e.attr("clip-path",`url(#forecastMask${f.globals.cuid})`),l.attr("clip-path",`url(#nonForecastMask${f.globals.cuid})`)}}}}_iterateOverDataPoints({type:e,series:t,iterations:s,realIndex:i,translationsIndex:n,i:r,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:d,seriesIndex:g,lineYPosition:f,xArrj:m,yArrj:x,y2Arrj:b,isRangeStart:P,seriesRangeEnd:A}){var w,k;const _=this.w,Y=new p(this.w),F=this.yRatio;let{prevY:C,linePath:M,areaPath:S,pathFromLine:I,pathFromArea:j}=u;const L=y.isNumber(_.globals.minYArr[i])?_.globals.minYArr[i]:_.globals.minY;s||(s=_.globals.dataPoints>1?_.globals.dataPoints-1:_.globals.dataPoints);const X=(e,t)=>t-e/F[n]+2*(this.isReversed?e/F[n]:0);let R=l;const z=_.config.chart.stacked&&!_.globals.comboCharts||_.config.chart.stacked&&_.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(w=this.w.config.series[i])?void 0:w.type)||"column"===(null==(k=this.w.config.series[i])?void 0:k.type));let D=_.config.stroke.curve;Array.isArray(D)&&(D=Array.isArray(g)?D[g[r]]:D[r]);let N,T=0;const $=this.pointsChart?this._scatterJitterPx(i):null;if("straight"===D&&!this.pointsChart){const p=this._fastStraightPath({type:e,series:t,i:r,realIndex:i,translationsIndex:n,iterations:s,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:d,xArrj:m,yArrj:x,y2Arrj:b,stackSeries:z});if(p)return p}for(let n=0;n<s&&0!==t[r].length;n++){const u=void 0===t[r][n+1]||null===t[r][n+1];if(_.axisFlags.isXNumeric){let e=_.seriesData.seriesX[i][n+1];void 0===_.seriesData.seriesX[i][n+1]&&(e=_.seriesData.seriesX[i][s-1]),a=(e-_.globals.minX)/this.xRatio}else a+=this.xDivision;if(z)if(r>0&&_.globals.collapsedSeries.length<_.config.series.length-1){if((e=>{var t;for(let s=e;s>=0;s--){const e=null!=(t=null==g?void 0:g[s])?t:s;if(-1===_.globals.collapsedSeriesIndices.indexOf(e)&&-1===_.globals.ancillaryCollapsedSeriesIndices.indexOf(e))return s}return-1})(r-1)<0)f=this.zeroY;else{const e=this.stackTopAt(i,n+1);f=void 0===e?this.zeroY:e}}else f=this.zeroY;else f=this.zeroY;u?l=X(L,f):(l=X(t[r][n+1],f),"rangeArea"===e&&(R=X(A[r][n+1],f)));let p=a,y=l;if($){const e=100003*i+(n+1);$.x&&(p=a+2*(v(7919*e+13)-.5)*$.x),$.y&&(y=l+2*(v(6271*e+97)-.5)*$.y)}m.push(null===t[r][n+1]?null:p),!u||"smooth"!==_.config.stroke.curve&&"monotoneCubic"!==_.config.stroke.curve?(x.push(y),b.push(R)):(x.push(null),b.push(null));const w=this.lineHelpers.calculatePoints({series:t,x:p,y:y,realIndex:i,i:r,j:n,prevY:C}),k=this._createPaths({type:e,series:t,i:r,j:n,x:a,y:l,y2:R,xArrj:m,yArrj:x,y2Arrj:b,pX:o,pY:h,pathState:T,segmentStartX:N,linePath:M,areaPath:S,linePaths:c,areaPaths:d,curve:D,isRangeStart:P});d=k.areaPaths,c=k.linePaths,o=k.pX,h=k.pY,T=k.pathState,N=k.segmentStartX,S=k.areaPath,M=k.linePath,!this.appendPathFrom||_.globals.hasNullValues||"monotoneCubic"===D&&"rangeArea"===e||(I+=Y.line(a,this.areaBottomY),j+=Y.line(a,this.areaBottomY)),this.handleNullDataPoints(t,w,r,n,i),this._handleMarkersAndLabels({type:e,pointsPos:w,i:r,j:n,realIndex:i,isRangeStart:P})}return{yArrj:x,xArrj:m,pathFromArea:j,areaPaths:d,pathFromLine:I,linePaths:c,linePath:M,areaPath:S}}_handleMarkersAndLabels({type:e,pointsPos:t,isRangeStart:s,i:i,j:n,realIndex:r}){const a=this.w,l=new g(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,n,{realIndex:r,pointsPos:t,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!a.globals.dataChanged&&!a.globals.resized&&!a.globals.markers.batched)&&a.seriesData.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const e=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:r,j:n+1});null!==e&&e!==this._elLastPointsWrap&&(this.elPointsMain.add(e),this._elLastPointsWrap=e)}const o=l.drawDataLabel({type:e,isRangeStart:s,pos:t,i:r,j:n+1});null!==o&&this.elDataLabelsWrap.add(o)}_scatterJitterPx(e){var t;const s=this.w,i=null==(t=s.config.plotOptions.scatter)?void 0:t.jitter;if(!i||!i.enabled||!i.x&&!i.y)return null;const n=s.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,r=this.yRatio.length>1?e:0,a=this.yRatio[r]?1/this.yRatio[r]:0;return{x:(i.x||0)*n,y:(i.y||0)*a}}_fastStraightPath({type:e,series:t,i:s,realIndex:i,translationsIndex:n,iterations:r,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:p,xArrj:d,yArrj:g,y2Arrj:f,stackSeries:m}){const x=this.w;if("line"!==e&&"area"!==e)return null;if(x.globals.comboCharts||m)return null;if(x.config.dataLabels.enabled)return null;if(x.config.markers.discrete.length)return null;if(x.globals.markers.size[i]>0)return null;const y=t[s],b=y.length;if(!r||b<2||b-1!==r)return null;for(let e=0;e<=r;e++){const t=y[e];if(null==t)return null}const v=x.axisFlags.isXNumeric,P=v?x.seriesData.seriesX[i]:null;if(v&&(!P||P.length<b))return null;const A=this.yRatio[n],w=this.isReversed,k=this.zeroY,_=this.areaBottomY,Y=this.xRatio,F=x.globals.minX,C=this.xDivision,M=x.config.markers.offsetX,S=x.config.markers.offsetY,I=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:j,pathFromArea:L}=u;const X=this.ctx&&this.ctx.renderer,R=!(!X||!X.kind||"svg"===X.kind),z=!R||x.globals.dataChanged&&!!x.globals.prevStreamFrame,D=R?new Float64Array(b):null,N=R?new Float64Array(b):null;D&&N&&(D[0]=o,N[0]=h),void 0===x.globals.pointsArray[i]&&(x.globals.pointsArray[i]=[]);const T=x.globals.pointsArray[i],$=P?(P[0]-F)/Y+M:this.categoryAxisCorrection+M;T.push([$,u.prevY+S]);const O=z?new Array(r+1):[];z&&(O[0]="M "+o+" "+h);const B=z&&I?new Array(r):null;let W=a,H=o,V=h;for(let e=0;e<r;e++){P?H=(P[e+1]-F)/Y:(W+=C,H=W);const t=y[e+1];V=k-t/A+2*(w?t/A:0),d.push(H),g.push(V),f.push(l),T.push([H+M,V+S]),z&&(O[e+1]=" L "+H+" "+V,B&&(B[e]=" L "+H+" "+_)),D&&N&&(D[e+1]=H,N[e+1]=V)}let E="",J="";if(z&&(E=O.join(""),J=E+" L "+H+" "+_+" L "+o+" "+_+"z"),B){const e=B.join("");j+=e,L+=e}else!z&&I&&(j+=" L "+H+" "+_,L+=" L "+H+" "+_);return c.push(E),p.push(J),{yArrj:g,xArrj:d,pathFromArea:L,areaPaths:p,pathFromLine:j,linePaths:c,linePath:E,areaPath:J,numericXY:D?{xs:D,ys:N,areaCloseY:_}:void 0}}_createPaths({type:e,series:t,i:s,j:i,x:n,y:r,xArrj:a,yArrj:l,y2:o,y2Arrj:h,pX:u,pY:c,pathState:d,segmentStartX:g,linePath:f,areaPath:m,linePaths:x,areaPaths:y,curve:b,isRangeStart:v}){const P=new p(this.w),w=this.areaBottomY,k="rangeArea"===e,_="rangeArea"===e&&v;switch(b){case"monotoneCubic":{const e=v?l:h,n=(e,t)=>e.map((e,s)=>[e,t[s]]).filter(e=>null!==e[1]),r=e=>{const t=[];let s=0;return e.forEach(e=>{null!==e?s++:s>0&&(t.push(s),s=0)}),s>0&&t.push(s),t},o=(e,t)=>{const s=r(e),i=[];for(let e=0,n=0;e<s.length;n+=s[e++])i[e]=A.slice(t,n,n+s[e]);return i};switch(d){case 0:if(null===e[i+1])break;d=1;case 1:if(!(k?a.length===t[s].length:i===t[s].length-2))break;case 2:{const t=v?a:a.slice().reverse(),s=v?e:e.slice().reverse(),i=n(t,s),r=i.length>1?A.points(i):i;let l=[];k&&(_?y=i:l=y.reverse());let h=0,u=0;if(o(s,r).forEach(e=>{h++;const t=(e=>{let t="";for(let s=0;s<e.length;s++){const i=e[s],n=i.length;n>4?(t+=`C${i[0]}, ${i[1]}`,t+=`, ${i[2]}, ${i[3]}`,t+=`, ${i[4]}, ${i[5]}`):n>2&&(t+=`S${i[0]}, ${i[1]}`,t+=`, ${i[2]}, ${i[3]}`)}return t})(e),s=u;u+=e.length;const n=u-1;_?f=P.move(i[s][0],i[s][1])+t:k?f=P.move(l[s][0],l[s][1])+P.line(i[s][0],i[s][1])+t+P.line(l[n][0],l[n][1]):(f=P.move(i[s][0],i[s][1])+t,m=f+P.line(i[n][0],w)+P.line(i[s][0],w)+"z",y.push(m)),x.push(f)}),k&&h>1&&!_){const e=x.slice(h).reverse();x.splice(h),e.forEach(e=>x.push(e))}d=0;break}}break}case"smooth":{const e=.35*(n-u);if(null===t[s][i])d=0;else switch(d){case 0:if(g=u,f=_?P.move(u,h[i])+P.line(u,c):P.move(u,c),m=P.move(u,c),null===t[s][i+1]||void 0===t[s][i+1]){x.push(f),y.push(m);break}if(d=1,i<t[s].length-2){const t=P.curve(u+e,c,n-e,r,n,r);f+=t,m+=t;break}case 1:if(null===t[s][i+1])f+=_?P.line(u,o):P.move(u,c),m+=P.line(u,w)+P.line(g,w)+"z",x.push(f),y.push(m),d=-1;else{const a=P.curve(u+e,c,n-e,r,n,r);f+=a,m+=a,i>=t[s].length-2&&(_&&(f+=P.curve(n,r,n,r,n,o)+P.move(n,o)),m+=P.curve(n,r,n,r,n,w)+P.line(g,w)+"z",x.push(f),y.push(m),d=-1)}}u=n,c=r;break}default:{const e=(e,t,s)=>{let i="";switch(e){case"stepline":i=P.line(t,null,"H")+P.line(null,s,"V");break;case"linestep":i=P.line(null,s,"V")+P.line(t,null,"H");break;case"straight":i=P.line(t,s)}return i};if(null===t[s][i])d=0;else switch(d){case 0:if(g=u,f=_?P.move(u,h[i])+P.line(u,c):P.move(u,c),m=P.move(u,c),null===t[s][i+1]||void 0===t[s][i+1]){x.push(f),y.push(m);break}if(d=1,i<t[s].length-2){const t=e(b,n,r);f+=t,m+=t;break}case 1:if(null===t[s][i+1])f+=_?P.line(u,o):P.move(u,c),m+=P.line(u,w)+P.line(g,w)+"z",x.push(f),y.push(m),d=-1;else{const a=e(b,n,r);f+=a,m+=a,i>=t[s].length-2&&(_&&(f+=P.line(n,o)),m+=P.line(n,w)+P.line(g,w)+"z",x.push(f),y.push(m),d=-1)}}u=n,c=r;break}}return{linePaths:x,areaPaths:y,pX:u,pY:c,pathState:d,segmentStartX:g,linePath:f,areaPath:m}}handleNullDataPoints(e,t,s,i,n){const r=this.w;if(null===e[s][i]&&r.config.markers.showNullDataPoints||1===e[s].length){let e=this.strokeWidth-r.config.markers.strokeWidth/2;e>0||(e=0);const s=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:n,j:i+1,pSize:e,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}u.use({line:J,area:J,scatter:J,bubble:J,rangeArea:J}),e.default=u,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var e=Object.defineProperty,r=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,L=(r,t,o)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,n=(e,r)=>{for(var t in r||(r={}))a.call(r,t)&&L(e,t,r[t]);if(o)for(var t of o(r))s.call(r,t)&&L(e,t,r[t]);return e};function c(e){const o=(a=n({},e),s={viewBox:e.viewBox||[0,0,100,100]},r(a,t(s)));var a,s;return o.with=r=>c(n(n({},e),r)),Object.freeze(o)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=c({name:"person",category:"people",source:"original",path:"M 37 18 A 13 13 0 0 1 63 18 A 13 13 0 0 1 37 18 Z M 50 34 C 61 34 69 40 70 50 L 73 72 L 65 72 L 63 58 L 61 96 L 53 96 L 51 66 L 49 66 L 47 96 L 39 96 L 37 58 L 35 72 L 27 72 L 30 50 C 31 40 39 34 50 34 Z"}),i=c({name:"house",category:"objects",source:"original",path:"M 50 8 L 94 46 L 82 46 L 82 92 L 58 92 L 58 64 L 42 64 L 42 92 L 18 92 L 18 46 L 6 46 Z"}),C=c({name:"heart",category:"symbols",source:"original",path:"M 50 90 C 22 70 6 54 6 36 C 6 21 17 11 30 11 C 39 11 46 16 50 24 C 54 16 61 11 70 11 C 83 11 94 21 94 36 C 94 54 78 70 50 90 Z"}),u=c({name:"tree",category:"nature",source:"original",path:"M 50 6 C 66 6 78 18 78 33 C 78 38 77 42 75 46 C 82 50 86 57 86 65 C 86 77 76 86 64 86 L 55 86 L 55 96 L 45 96 L 45 86 L 36 86 C 24 86 14 77 14 65 C 14 57 18 50 25 46 C 23 42 22 38 22 33 C 22 18 34 6 50 6 Z"}),g=c({name:"droplet",category:"nature",source:"original",path:"M 50 4 C 50 4 84 42 84 64 C 84 82 69 96 50 96 C 31 96 16 82 16 64 C 16 42 50 4 50 4 Z"}),l=c({name:"star",category:"symbols",source:"original",path:"M 50 6 L 61.2 36.6 L 93.8 37.8 L 68.1 57.9 L 77 89.2 L 50 71 L 23 89.2 L 31.9 57.9 L 6.2 37.8 L 38.8 36.6 Z"}),b=c({name:"car",category:"transport",source:"original",path:"M 6 72 L 9 53 C 10 46 15 41 22 40 L 32 23 C 35 19 39 17 44 17 L 60 17 C 65 17 69 19 71 23 L 81 40 C 88 41 93 46 94 53 L 97 72 L 97 80 L 6 80 Z M 13 88 A 11 11 0 1 1 35 88 A 11 11 0 1 1 13 88 Z M 65 88 A 11 11 0 1 1 87 88 A 11 11 0 1 1 65 88 Z"}),y=c({name:"bag",category:"objects",source:"original",path:"M 10 30 L 90 30 L 95 96 L 5 96 Z M 32 30 C 32 14 40 4 50 4 C 60 4 68 14 68 30 L 59 30 C 59 19 55 13 50 13 C 45 13 41 19 41 30 Z"}),h=c({name:"book",category:"objects",source:"original",path:"M 8 14 C 8 14 26 6 50 16 C 74 6 92 14 92 14 L 92 88 C 92 88 74 80 50 90 C 26 80 8 88 8 88 Z"}),m=c({name:"cup",category:"objects",source:"original",path:"M 14 22 L 70 22 L 70 34 L 80 34 C 90 34 96 41 96 51 C 96 63 87 71 75 71 L 69 71 C 65 84 55 92 42 92 C 26 92 14 79 14 61 Z"}),M=c({name:"bulb",category:"objects",source:"original",path:"M 50 4 C 32 4 18 18 18 36 C 18 48 25 56 31 63 C 35 68 37 72 37 78 L 63 78 C 63 72 65 68 69 63 C 75 56 82 48 82 36 C 82 18 68 4 50 4 Z M 38 84 L 38 90 L 62 90 L 62 84 Z M 42 94 L 45 99 L 55 99 L 58 94 Z"}),x=c({name:"plane",category:"transport",source:"original",path:"M 50 4 C 55 4 58 12 58 24 L 58 38 L 94 62 L 94 72 L 58 60 L 58 82 L 70 90 L 70 97 L 50 92 L 30 97 L 30 90 L 42 82 L 42 60 L 6 72 L 6 62 L 42 38 L 42 24 C 42 12 45 4 50 4 Z"}),f=[p,i,C,u,g,l,b,y,h,m,M,x],Z="__apexcharts_unit_marks__";function j(){const e=globalThis;return e[Z]||(e[Z]={}),e[Z]}exports.bag=y,exports.book=h,exports.bulb=M,exports.car=b,exports.catalog=f,exports.cup=m,exports.definePictogram=c,exports.droplet=g,exports.heart=C,exports.house=i,exports.person=p,exports.plane=x,exports.registerMarks=function(e){const r=j(),t=[];return(Array.isArray(e)?e.map(e=>[e?e.name:"",e]):Object.entries(e)).forEach(([e,o])=>{const a=String(e);a&&o&&"string"==typeof o.path&&(r[a]=o,t.push(a))}),t},exports.registeredMarkNames=function(){return Object.keys(j())},exports.star=l,exports.tree=u,exports.unregisterMarks=function(e){const r=j();(Array.isArray(e)?e:[e]).forEach(e=>{delete r[e]})};
|
package/dist/pictograms.esm.js
CHANGED
package/dist/pictograms.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).ApexPictograms={})}(this,function(e){"use strict";var r=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,c=(e,t,o)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,s=(e,r)=>{for(var t in r||(r={}))n.call(r,t)&&c(e,t,r[t]);if(a)for(var t of a(r))L.call(r,t)&&c(e,t,r[t]);return e};function i(e){const r=(a=s({},e),n={viewBox:e.viewBox||[0,0,100,100]},t(a,o(n)));var a,n;return r.with=r=>i(s(s({},e),r)),Object.freeze(r)}const p=i({name:"person",category:"people",source:"original",path:"M 37 18 A 13 13 0 0 1 63 18 A 13 13 0 0 1 37 18 Z M 50 34 C 61 34 69 40 70 50 L 73 72 L 65 72 L 63 58 L 61 96 L 53 96 L 51 66 L 49 66 L 47 96 L 39 96 L 37 58 L 35 72 L 27 72 L 30 50 C 31 40 39 34 50 34 Z"}),l=i({name:"house",category:"objects",source:"original",path:"M 50 8 L 94 46 L 82 46 L 82 92 L 58 92 L 58 64 L 42 64 L 42 92 L 18 92 L 18 46 L 6 46 Z"}),u=i({name:"heart",category:"symbols",source:"original",path:"M 50 90 C 22 70 6 54 6 36 C 6 21 17 11 30 11 C 39 11 46 16 50 24 C 54 16 61 11 70 11 C 83 11 94 21 94 36 C 94 54 78 70 50 90 Z"}),C=i({name:"tree",category:"nature",source:"original",path:"M 50 6 C 66 6 78 18 78 33 C 78 38 77 42 75 46 C 82 50 86 57 86 65 C 86 77 76 86 64 86 L 55 86 L 55 96 L 45 96 L 45 86 L 36 86 C 24 86 14 77 14 65 C 14 57 18 50 25 46 C 23 42 22 38 22 33 C 22 18 34 6 50 6 Z"}),g=i({name:"droplet",category:"nature",source:"original",path:"M 50 4 C 50 4 84 42 84 64 C 84 82 69 96 50 96 C 31 96 16 82 16 64 C 16 42 50 4 50 4 Z"}),b=i({name:"star",category:"symbols",source:"original",path:"M 50 6 L 61.2 36.6 L 93.8 37.8 L 68.1 57.9 L 77 89.2 L 50 71 L 23 89.2 L 31.9 57.9 L 6.2 37.8 L 38.8 36.6 Z"}),y=i({name:"car",category:"transport",source:"original",path:"M 6 72 L 9 53 C 10 46 15 41 22 40 L 32 23 C 35 19 39 17 44 17 L 60 17 C 65 17 69 19 71 23 L 81 40 C 88 41 93 46 94 53 L 97 72 L 97 80 L 6 80 Z M 13 88 A 11 11 0 1 1 35 88 A 11 11 0 1 1 13 88 Z M 65 88 A 11 11 0 1 1 87 88 A 11 11 0 1 1 65 88 Z"}),f=i({name:"bag",category:"objects",source:"original",path:"M 10 30 L 90 30 L 95 96 L 5 96 Z M 32 30 C 32 14 40 4 50 4 C 60 4 68 14 68 30 L 59 30 C 59 19 55 13 50 13 C 45 13 41 19 41 30 Z"}),h=i({name:"book",category:"objects",source:"original",path:"M 8 14 C 8 14 26 6 50 16 C 74 6 92 14 92 14 L 92 88 C 92 88 74 80 50 90 C 26 80 8 88 8 88 Z"}),m=i({name:"cup",category:"objects",source:"original",path:"M 14 22 L 70 22 L 70 34 L 80 34 C 90 34 96 41 96 51 C 96 63 87 71 75 71 L 69 71 C 65 84 55 92 42 92 C 26 92 14 79 14 61 Z"}),M=i({name:"bulb",category:"objects",source:"original",path:"M 50 4 C 32 4 18 18 18 36 C 18 48 25 56 31 63 C 35 68 37 72 37 78 L 63 78 C 63 72 65 68 69 63 C 75 56 82 48 82 36 C 82 18 68 4 50 4 Z M 38 84 L 38 90 L 62 90 L 62 84 Z M 42 94 L 45 99 L 55 99 L 58 94 Z"}),d=i({name:"plane",category:"transport",source:"original",path:"M 50 4 C 55 4 58 12 58 24 L 58 38 L 94 62 L 94 72 L 58 60 L 58 82 L 70 90 L 70 97 L 50 92 L 30 97 L 30 90 L 42 82 L 42 60 L 6 72 L 6 62 L 42 38 L 42 24 C 42 12 45 4 50 4 Z"}),Z=[p,l,u,C,g,b,y,f,h,m,M,d],j="__apexcharts_unit_marks__";function A(){const e=globalThis;return e[j]||(e[j]={}),e[j]}function O(e){const r=A(),t=[];return(Array.isArray(e)?e.map(e=>[e?e.name:"",e]):Object.entries(e)).forEach(([e,o])=>{const a=String(e);a&&o&&"string"==typeof o.path&&(r[a]=o,t.push(a))}),t}O(Z);const x=globalThis;x.ApexCharts&&(x.ApexCharts.pictograms=Z),e.bag=f,e.book=h,e.bulb=M,e.car=y,e.catalog=Z,e.cup=m,e.definePictogram=i,e.droplet=g,e.heart=u,e.house=l,e.person=p,e.plane=d,e.registerMarks=O,e.registeredMarkNames=function(){return Object.keys(A())},e.star=b,e.tree=C,e.unregisterMarks=function(e){const r=A();(Array.isArray(e)?e:[e]).forEach(e=>{delete r[e]})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/dist/pie.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,l=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,r=(e,t)=>{for(var a in t||(t={}))s.call(t,a)&&l(e,a,t[a]);if(i)for(var a of i(t))n.call(t,a)&&l(e,a,t[a]);return e},o=(e,i)=>t(e,a(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)}const c=h(require("apexcharts/core")),d=c.__apex_Animations,g=c.__apex_Fill,p=c.__apex_Utils,f=c.__apex_Graphics,u=c.__apex_Filters,b=c.__apex_Scales;class m{constructor(e){this.w=e}drawYAxisTexts(e,t,a,i){const s=this.w,n=s.config.yaxis[0],l=s.formatters.yLabelFormatters[0];return new f(this.w).drawText({x:e+n.labels.offsetX,y:t+n.labels.offsetY,text:l(i,a),textAnchor:"middle",fontSize:n.labels.style.fontSize,fontFamily:n.labels.style.fontFamily,foreColor:Array.isArray(n.labels.style.colors)?n.labels.style.colors[a]:n.labels.style.colors})}getMaxLabelWidth(e,{fontSize:t,fontFamily:a}={}){const i=new f(this.w);let s=0;return e.forEach(e=>{if(null==e||""===e)return;const n=i.getTextRects(`${e}`,t||"12px",a,"");s=Math.max(s,n.width)}),s}drawExternalLabel(e){return function(e,t){const{lines:a,lineHeight:i,anchor:s,elbow:n,labelX:l,labelY:r,side:o,connector:h,style:c,foreColor:d}=t,g=new f(e),p=g.group({class:t.groupClass||"apexcharts-outer-label-group"});if(h.show){const e=`M ${s.x} ${s.y} L ${n.x} ${n.y} L ${l} ${r}`,a=g.drawPath({d:e,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});a.node.classList.add(t.connectorClass||"apexcharts-outer-label-connector"),p.add(a)}const u="right"===o?l+4:l-4,b=a.length,m=r-(b-1)*i/2,x=g.drawText({x:u,y:m,text:1===b?a[0]:a,textAnchor:"right"===o?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:t.textClass||"apexcharts-outer-label"});if(b>1){const e=x.node.getElementsByTagName("tspan");for(let t=0;t<e.length;t++)e[t].setAttribute("x",`${u}`),e[t].setAttribute("dy",0===t?"0":`${i}`)}return p.add(x),p}(this.w,o(r({},e),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const x=c.__apex_Environment_Environment,y=Math.PI/180,A=180/Math.PI;function w(e,t,a,i){return{x:e+a*Math.cos((i-90)*y),y:t+a*Math.sin((i-90)*y)}}const S=e=>`${e.x} ${e.y}`;function v({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,r:l,spanDeg:r}){const o=(a,i)=>w(e,t,a,i),h=l/i*A,c=l/a*A,d=o(i,s+h),g=o(i,n-h),p=r-2*h>180?1:0,f=o(i,n),u=o(i-l,n),b=o(i,s),m=o(i-l,s),x=o(a,n-c),y=o(a,s+c),v=r-2*c>180?1:0,L=o(a,n),O=o(a+l,n),z=o(a,s),C=o(a+l,s);return["M",S(d),"A",i,i,0,p,1,S(g),"Q",S(f),S(u),"L",S(O),"Q",S(L),S(x),"A",a,a,0,v,0,S(y),"Q",S(z),S(C),"L",S(m),"Q",S(b),S(d),"Z"].join(" ")}class L{constructor(e,t){this.ctx=t,this.w=e,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=Math.min(e.layout.gridWidth,e.layout.gridHeight),this.centerY=e.layout.gridHeight/2,this.centerX=e.layout.gridWidth/2,"radialBar"===e.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(e.config.plotOptions.pie.endAngle-e.config.plotOptions.pie.startAngle),this.initialAngle=e.config.plotOptions.pie.startAngle%this.fullAngle,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.externalCfg=e.config.plotOptions.pie.dataLabels.external;const a=e.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||a.fontSize,fontFamily:this.externalCfg.fontFamily||a.fontFamily,fontWeight:this.externalCfg.fontWeight||a.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,e.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!e.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100;const i=e.config.plotOptions.pie.customScale,s=e.layout.gridWidth/2,n=e.layout.gridHeight/2;this.translateX=s-s*i,this.translateY=n-n*i,this.dataLabelsGroup=new f(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${i})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(e){var t,a,i;const s=this.w,n=s.seriesData.seriesNames[e],l=this.externalCfg.formatter;return"function"==typeof l?l(n,{seriesIndex:e,percent:null==(a=null==(t=s.globals.seriesPercent)?void 0:t[e])?void 0:a[0],value:null==(i=s.globals.seriesTotals)?void 0:i[e],w:s}):null==n?"":`${n}`}getExternalLabelLines(e){const t=this.getExternalLabelText(e);return(Array.isArray(t)?t:`${null==t?"":t}`.split("\n")).map(e=>null==e?"":`${e}`)}reserveExternalLabelSpace(){const e=this.w,t=new m(e),a=(e.seriesData.seriesNames||[]).map((e,t)=>this.getExternalLabelLines(t)),i=t.getMaxLabelWidth(a.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=a.reduce((e,t)=>Math.max(e,t.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const s=this.externalCfg.connector,n=this.externalLabelMaxLines*this.externalLabelLineH,l=i+(s.length||0)+(s.gap||0)+12,r=n/2+(s.gap||0)+6,o=Math.min(e.globals.radialSize,e.layout.gridWidth/2-l,e.layout.gridHeight/2-r);e.globals.radialSize=Math.max(o,.15*this.defaultSize),e.globals.pieExternalLabelMarginY=r;const h=e.config.chart.height?String(e.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?e.layout.gridHeight/2:e.globals.radialSize+r}draw(e){var t;const a=this.w,i=new f(this.w),s=i.group({class:"apexcharts-pie"});if(a.globals.noData)return s;let n=0;for(let t=0;t<e.length;t++)n+=p.negToZero(e[t]);const l=[],r=i.group();0===n&&(n=1e-5),e.forEach(e=>{this.maxY=Math.max(this.maxY,e)}),a.config.yaxis[0].max&&(this.maxY=a.config.yaxis[0].max),"back"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s);const o=a.globals.collapsedSeriesIndices||[];let h=1;if("polarArea"===this.chartType){let t=0;for(let a=0;a<e.length;a++)-1===o.indexOf(a)&&t++;h=Math.max(1,t)}for(let t=0;t<e.length;t++){const i=this.fullAngle*p.negToZero(e[t])/n;l.push(i),"polarArea"===this.chartType?(l[t]=o.indexOf(t)>-1?0:this.fullAngle/h,this.sliceSizes.push(a.globals.radialSize*e[t]/(this.maxY||1))):this.sliceSizes.push(a.globals.radialSize)}const c=!0===(null==(t=this.ctx.morphTypeChange)?void 0:t.isActive());if(a.globals.dataChanged&&!c)if("polarArea"===this.chartType){const e=a.globals.previousPaths,t=a.globals.prevPolarAngles;if(Array.isArray(t)&&t.length===e.length)this.prevSectorAngleArr=t.slice();else for(let t=0;t<e.length;t++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,e.length));let i=0;for(let t=0;t<e.length;t++)i=Math.max(i,p.negToZero(e[t]));a.config.yaxis[0].max&&(i=a.config.yaxis[0].max),this.prevSliceSizes=e.map(e=>a.globals.radialSize*p.negToZero(e)/(i||1))}else{let e,t=0;for(let e=0;e<a.globals.previousPaths.length;e++)t+=p.negToZero(a.globals.previousPaths[e]);for(let i=0;i<a.globals.previousPaths.length;i++)e=this.fullAngle*p.negToZero(a.globals.previousPaths[i])/t,this.prevSectorAngleArr.push(e)}if("polarArea"===this.chartType&&(a.globals.prevPolarAngles=l.slice()),this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const e=i.drawCircle(this.donutSize);e.attr({cx:this.centerX,cy:this.centerY,fill:a.config.plotOptions.pie.donut.background?a.config.plotOptions.pie.donut.background:"transparent"}),r.add(e)}const d=this.drawArcs(l,e);if(this.sliceLabels.forEach(e=>{d.add(e)}),r.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${a.config.plotOptions.pie.customScale})`}),r.add(d),s.add(r),this.donutDataLabels.show){const e=this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged&&this.animDur>0,t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:e?0:this.donutDataLabels.show});if(e){const e=this.dataLabelsGroup.node;e.style.transition="opacity 280ms ease-out",setTimeout(()=>{e.style.opacity="1"},this.animDur)}s.add(t)}return"front"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s),s}drawArcs(e,t){var a,i,s,n,l;const r=this.w,o=new u(this.w),h=new f(this.w),c=new g(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",r.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let b=this.initialAngle,y=this.initialAngle,A=this.initialAngle,w=this.initialAngle;this.strokeWidth=r.config.stroke.show?r.config.stroke.width:0;const S=!0===(null==(a=this.ctx.morphTypeChange)?void 0:a.isActive());for(let a=0;a<e.length;a++){const g=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:p.escapeString(r.seriesData.seriesNames[a]),rel:a+1,"data:realIndex":a});d.add(g),b=A,y=w,A=b+e[a],w=y+this.prevSectorAngleArr[a];const m=A<b?this.fullAngle+A-b:A-b,x=c.fillPath({seriesNumber:a,size:this.sliceSizes[a],value:t[a]}),v=S?this.ctx.morphTypeChange.getInitialPathFor(a,0):null,L="polarArea"===this.chartType&&r.globals.dataChanged&&!S?this.prevSliceSizes[a]||0:void 0,O=v||this.getChangedPath(y,w,L),z=h.drawPath({d:O,stroke:Array.isArray(this.lineColorArr)?null!=(i=this.lineColorArr[a])?i:this.lineColorArr[a%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:x,fillOpacity:r.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${a}`});if(z.attr({index:0,j:a}),o.setSelectionFilter(z,0,a),r.config.chart.dropShadow.enabled){const e=r.config.chart.dropShadow;o.dropShadow(z,e,a)}this.addListeners(z,this.donutDataLabels,a);let C={x:0,y:0};const P=(b+m/2)%this.fullAngle;let T={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(C=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/1.25+r.config.plotOptions.pie.dataLabels.offset,P),T=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/2,P)):"donut"===this.chartType&&(C=p.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2+r.config.plotOptions.pie.dataLabels.offset,P),T=p.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2,P)),f.setAttrs(z.node,{"data:angle":m,"data:startAngle":b,"data:strokeWidth":this.strokeWidth,"data:value":t[a],"data:cx":T.x,"data:cy":T.y}),g.add(z);let E=!1;if(S){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]});z.node.setAttribute("data:pathFinal",e),E=!0===(null==(n=(s=this.ctx.morphTypeChange).claimsTargetMark)?void 0:n.call(s,a,0)),E&&(z.attr({d:e}),z.node.setAttribute("data:pathOrig",e),z.node.setAttribute("opacity","0"),z.node.setAttribute("data-piece-hidden","1"))}let D=0;if(!this.initialAnim||r.globals.resized||r.globals.dataChanged?this.animBeginArr.push(0):(D=m/this.fullAngle*r.config.chart.animations.speed,0===D&&(D=1),this.animDur=D+this.animDur,this.animBeginArr.push(this.animDur)),E);else if(S&&v){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]}),t=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations;z.node.setAttribute("data:pathOrig",e);const s=z.animate(t).plot(e,"polygons").attr({"stroke-width":this.strokeWidth});s&&"function"==typeof s.after?s.after(()=>i.animationCompleted(z)):i.animationCompleted(z)}else this.dynamicAnim&&r.globals.dataChanged?this.animatePaths(z,{size:this.sliceSizes[a],prevSize:L,endAngle:A,startAngle:b,prevStartAngle:y,prevEndAngle:w,animateStartingPos:!0,i:a,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:r.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(z,{size:this.sliceSizes[a],endAngle:A,startAngle:b,i:a,totalItems:e.length-1,animBeginArr:this.animBeginArr,dur:D});if(this.getExpandOffset()>0?z.node.addEventListener("mouseup",this.pieClicked.bind(this,a)):0===a&&u.drilldownBlocksSliceOffset(r)&&(null==(l=this.ctx.drilldown)||l.warnSliceOffsetDisabled()),void 0!==r.interact.selectedDataPoints[0]&&r.interact.selectedDataPoints[0].indexOf(a)>-1)if(this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged&&this.animDur>0){const e=this,t=a;setTimeout(()=>e.pieClicked(t,{animate:!1}),this.animDur)}else this.pieClicked(a,{animate:!1});if(r.config.dataLabels.enabled){const t=C.x,i=C.y;let s=100*m/this.fullAngle+"%";if(0!==m&&r.config.plotOptions.pie.dataLabels.minAngleToShowLabel<e[a]){const e=r.config.dataLabels.formatter;void 0!==e&&(s=e(r.globals.seriesPercent[a][0],{seriesIndex:a,w:r}));const n=r.globals.dataLabels.style.colors[a],l=h.group({class:"apexcharts-datalabels"}),c=h.drawText({x:t,y:i,text:s,textAnchor:"middle",fontSize:r.config.dataLabels.style.fontSize,fontFamily:r.config.dataLabels.style.fontFamily,fontWeight:r.config.dataLabels.style.fontWeight,foreColor:n});if(l.add(c),r.config.dataLabels.dropShadow.enabled){const e=r.config.dataLabels.dropShadow;o.dropShadow(c,e)}c.node.classList.add("apexcharts-pie-label"),r.config.chart.animations.animate&&!1===r.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=r.config.chart.animations.speed/940+"s"),this.sliceLabels.push(l),this.sliceLabelGroups[a]=l.node}}if(this.showExternalLabels&&0!==m){const e=this.getExternalLabelLines(a);if(e.some(e=>""!==e)){const t=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize,P),i=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize+(this.externalCfg.connector.gap||0),P),s=i.x>=this.centerX,n=s?i.x+(this.externalCfg.connector.length||0):i.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:a,lines:e,anchor:t,elbow:i,side:s?"right":"left",labelX:n+parseFloat(this.externalCfg.offsetX||0),idealY:i.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||r.globals.colors[a],foreColor:this.externalCfg.color||r.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const e=x.isBrowser()&&(S||this.dynamicAnim&&r.globals.dataChanged||this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged);this.externalLabels.forEach(t=>{const a=new m(r).drawExternalLabel({lines:t.lines,lineHeight:this.externalLabelLineH,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:t.connectorColor},style:this.externalLabelStyle,foreColor:t.foreColor});e&&(a.node.classList.add("apexcharts-element-hidden"),r.globals.delayedElements.push({el:a.node})),this.externalLabelGroups[t.i]=a.node,d.add(a)})}return d}placeExternalLabels(){const e=this.w,t=this.externalLabelMaxLines*this.externalLabelLineH+2,a=this.centerY+e.globals.radialSize+e.globals.pieExternalLabelMarginY;["left","right"].forEach(e=>{!function(e,t,a){const i=e.slice().sort((e,t)=>e.idealY-t.idealY);i.forEach(e=>{e.labelY=e.idealY});for(let e=1;e<i.length;e++)i[e].labelY-i[e-1].labelY<t&&(i[e].labelY=i[e-1].labelY+t);const s=i[i.length-1],n=s?s.labelY-a:0;if(n>0)for(let e=i.length-1;e>=0;e--)i[e].labelY-=n,e<i.length-1&&i[e+1].labelY-i[e].labelY<t&&(i[e].labelY=i[e+1].labelY-t)}(this.externalLabels.filter(t=>t.side===e),t,a)})}addListeners(e,t,a){const i=new f(this.w,this.ctx);e.node.addEventListener("mouseenter",i.pathMouseEnter.bind(i,e)),e.node.addEventListener("mouseleave",i.pathMouseLeave.bind(i,e)),e.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof a&&(e.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,a)),e.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),e.node.addEventListener("mousedown",i.pathMouseDown.bind(i,e)),this.donutDataLabels.total.showAlways||(e.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,e.node,t)))}animatePaths(e,t){const a=this.w;let i=t.endAngle<t.startAngle?this.fullAngle+t.endAngle-t.startAngle:t.endAngle-t.startAngle,s=i,n=t.startAngle;const l=t.startAngle;void 0!==t.prevStartAngle&&void 0!==t.prevEndAngle&&(n=t.prevEndAngle,s=t.prevEndAngle<t.prevStartAngle?this.fullAngle+t.prevEndAngle-t.prevStartAngle:t.prevEndAngle-t.prevStartAngle),t.i===a.config.series.length-1&&(i+l>this.fullAngle?t.endAngle=t.endAngle-(i+l):i+l<this.fullAngle&&(t.endAngle=t.endAngle+(this.fullAngle-(i+l)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(e,n,l,i,s,t)}animateArc(e,t,a,i,s,n){const l=this,r=this.w,o=new d(this.w),h=n.size;let c;(isNaN(t)||isNaN(s))&&(t=a,s=i,n.dur=0);let g=i,p=a;const f=t<a?this.fullAngle+t-a:t-a,u="number"==typeof n.prevSize;r.globals.dataChanged&&n.shouldSetPrevPaths&&n.prevEndAngle&&(c=l.getPiePath({me:l,startAngle:n.prevStartAngle,angle:n.prevEndAngle<n.prevStartAngle?this.fullAngle+n.prevEndAngle-n.prevStartAngle:n.prevEndAngle-n.prevStartAngle,size:u?n.prevSize:h}),e.attr({d:c})),0!==n.dur?e.animate(n.dur,n.animBeginArr[n.i]).after(function(){"pie"!==l.chartType&&"donut"!==l.chartType&&"polarArea"!==l.chartType||this.animate(r.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":l.strokeWidth}),n.i===r.config.series.length-1&&o.animationCompleted(e)}).during(r=>{g=f+(i-f)*r,n.animateStartingPos&&(g=s+(i-s)*r,p=t-s+(a-(t-s))*r),c=l.getPiePath({me:l,startAngle:p,angle:g,size:u?n.prevSize+(h-n.prevSize)*r:h}),e.node.setAttribute("data:pathOrig",c),e.attr({d:c})}):(c=l.getPiePath({me:l,startAngle:p,angle:i,size:h}),n.isTrack||(r.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",c),e.attr({d:c,"stroke-width":l.strokeWidth}))}pieClicked(e,t){const a=this.w,i=!(t&&!1===t.animate),s=a.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!s)return;if("true"===s.attr("data:pieClicked"))return s.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(e,0,i);const n=a.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(n,e=>{const t="true"===e.getAttribute("data:pieClicked");e.setAttribute("data:pieClicked","false"),t&&this.offsetSlice(parseInt(e.getAttribute("j"),10),0,i)}),a.interact.capturedDataPointIndex=e,s.attr("data:pieClicked","true"),this.offsetSlice(e,this.getExpandOffset(),i)}getExpandOffset(){const e=this.w.config.plotOptions.pie;if(!e.expandOnClick||"polarArea"===this.chartType)return 0;if(u.drilldownBlocksSliceOffset(this.w))return 0;const t=Number(e.expandOffset);return Number.isFinite(t)&&t>0?t:0}getSliceMovers(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return[t?t.node:null,this.sliceLabelGroups[e],this.externalLabelGroups[e],this.hoverOutlineIndex===e&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(e,t,a=!0){const i=this.w;if(!i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`))return;const{dx:s,dy:n}=this.getSliceOffsetVector(e,t),l=`translate(${s} ${n})`,r=a&&i.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(e).forEach(e=>{e.style.transition=r,e.setAttribute("transform",l)})}getSliceOffsetVector(e,t){const a=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`),i=a?parseFloat(a.attr("data:angle")):NaN;if(!t||!Number.isFinite(i)||i>=this.fullAngle)return{dx:0,dy:0};const s=parseFloat(a.attr("data:startAngle")),n=Math.PI*(s+i/2-90)/180;return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}showHoverOutline(e){const t=this.w;if(!u.hoverOutlineOwnsHoverState(t))return;if(!this.elHoverOutline)return;const a=this.getHoverOutlinePath(e);if(!a)return;const i=t.config.plotOptions.pie.hoverOutline,s=i.color||t.globals.colors[e];if(!this.elHoverOutlinePath){const e=new f(t);this.elHoverOutlinePath=e.drawPath({d:a,fill:s,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:a,fill:s,"fill-opacity":i.opacity});const{dx:n,dy:l}=this.getSliceOffsetVector(e,this.isSliceOut(e)?this.getExpandOffset():0);this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${n} ${l})`),this.hoverOutlineIndex=e,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}isSliceOut(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return!!t&&"true"===t.attr("data:pieClicked")}getHoverOutlinePath(e){const t=this.w,a=t.config.plotOptions.pie.hoverOutline,i=t.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!i)return null;const s=parseFloat(i.attr("data:angle"));if(!Number.isFinite(s)||s<=0)return null;const n=this.sliceSizes[e],l=Number(a.size);if(!Number.isFinite(n)||!Number.isFinite(l)||l<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(i.attr("data:startAngle")),angle:s,size:n});if(!(c>0))return null;const d=n+(this.strokeWidth||0)/2+(Number(a.gap)||0),g=d+l,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:g,a0:h,a1:h+c,spanDeg:c},f=Math.min(l/2,c*Math.PI/180/2*d);return f>.5?v(o(r({},p),{r:f})):function({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,spanDeg:l}){const r=(a,i)=>w(e,t,a,i),o=l>180?1:0,h=r(i,s),c=r(i,n),d=r(a,n),g=r(a,s);return["M",S(h),"A",i,i,0,o,1,S(c),"L",S(d),"A",a,a,0,o,0,S(g),"Z"].join(" ")}(p)}getChangedPath(e,t,a){let i="";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:e,angle:t-e,size:"number"==typeof a?a:this.size})),i}getSliceExtent({me:e,startAngle:t,angle:a,size:i}){const s=this.w;let n=t,l=a+t;Math.ceil(l)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(l=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let r=l-n;const o="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,h=s.config.plotOptions.pie.spacing;if(o&&h>0&&r>0){const t="donut"===e.chartType?(i+e.donutSize)/2:i,a=t>0?h/t*(180/Math.PI):0,s=Math.min(a/2,Math.max(0,r/2-.5));n+=s,r-=2*s}return l=n+r,Math.ceil(l)>this.fullAngle&&(l-=this.fullAngle),{startDeg:n,spanDeg:r,endDeg:l}}getPiePath({me:e,startAngle:t,angle:a,size:i}){let s;const n=this.w,l=new f(this.w),{startDeg:r,spanDeg:o,endDeg:h}=this.getSliceExtent({me:e,startAngle:t,angle:a,size:i}),c="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,d=Math.PI*(r-90)/180,g=n.config.plotOptions.pie.borderRadius;if(g>0&&c){const t=this.getRoundedSlicePath({me:e,startDeg:r,spanDeg:o,size:i,borderRadius:g});if(t)return t}const u=Math.PI*(h-90)/180,b=e.centerX+i*Math.cos(d),m=e.centerY+i*Math.sin(d),x=e.centerX+i*Math.cos(u),y=e.centerY+i*Math.sin(u),A=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,h),w=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,r),S=o>180?1:0,v=["M",b,m,"A",i,i,0,S,1,x,y];return s="donut"===e.chartType?[...v,"L",A.x,A.y,"A",e.donutSize,e.donutSize,0,S,0,w.x,w.y,"L",b,m,"z"].join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[...v,"L",e.centerX,e.centerY,"L",b,m].join(" "):[...v].join(" "),l.roundPathCorners(s,2*this.strokeWidth)}getRoundedSlicePath({me:e,startDeg:t,spanDeg:a,size:i,borderRadius:s}){if(!(a>0))return null;const n=Math.PI/180,l=e.centerX,r=e.centerY,o="donut"===e.chartType,h=i,c=o?e.donutSize:0,d=a*n;let g=s;if(g=Math.min(g,d*h/2),o?(g=Math.min(g,d*c/2),g=Math.min(g,(h-c)/2)):g=Math.min(g,h/2),!(g>.5))return null;const p=t,f=t+a;return o?v({cx:l,cy:r,rIn:c,rOut:h,a0:p,a1:f,r:g,spanDeg:a}):function({cx:e,cy:t,rOut:a,a0:i,a1:s,r:n,spanDeg:l}){const r=(a,i)=>w(e,t,a,i),o=n/a*A,h=r(a,i+o),c=r(a,s-o),d=l-2*o>180?1:0,g=r(a,s),p=r(a-n,s),f=r(a,i),u=r(a-n,i);return["M",S(h),"A",a,a,0,d,1,S(c),"Q",S(g),S(p),"L",`${e} ${t}`,"L",S(u),"Q",S(f),S(h),"Z"].join(" ")}({cx:l,cy:r,rOut:h,a0:p,a1:f,r:g,spanDeg:a})}drawPolarElements(e){const t=this.w,a=new b(this.w),i=new f(this.w),s=new m(this.w),n=i.group(),l=i.group(),r=a.niceScale(0,Math.ceil(this.maxY),0),o=r.result.reverse(),h=r.result.length;this.maxY=r.niceMax;let c=t.globals.radialSize;const d=c/(h-1);for(let e=0;e<h-1;e++){const a=i.drawCircle(c);if(a.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){const a=s.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,e,o[e]);l.add(a)}n.add(a),c-=d}this.drawSpokes(e),e.add(n),e.add(l)}renderInnerDataLabels(e,t,a){const i=this.w,s=new f(this.w),n=t.total.show;e.node.innerHTML="",e.node.style.opacity=a.opacity;const l=a.centerX,r=this.donutDataLabels.total.label?a.centerY:a.centerY-a.centerY/6;let o,h;o=void 0===t.name.color?i.globals.colors[0]:t.name.color;let c=t.name.fontSize,d=t.name.fontFamily,g=t.name.fontWeight;h=void 0===t.value.color?i.config.chart.foreColor:t.value.color;const p=t.value.formatter;let u="",b="";if(n?(o=t.total.color,c=t.total.fontSize,d=t.total.fontFamily,g=t.total.fontWeight,b=this.donutDataLabels.total.label?t.total.label:"",u=t.total.formatter(i)):1===i.seriesData.series.length&&(u=p(i.seriesData.series[0],i),b=i.seriesData.seriesNames[0]),b&&(b=t.name.formatter(b,t.total.show,i)),t.name.show){const a=s.drawText({x:l,y:r+parseFloat(t.name.offsetY),text:b,textAnchor:"middle",foreColor:o,fontSize:c,fontWeight:g,fontFamily:d});a.node.classList.add("apexcharts-datalabel-label"),e.add(a)}if(t.value.show){const a=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,i=s.drawText({x:l,y:r+a,text:u,textAnchor:"middle",foreColor:h,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});i.node.classList.add("apexcharts-datalabel-value"),e.add(i)}return e}printInnerLabels(e,t,a,i){const s=this.w;let n;i?n=void 0===e.name.color?s.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:e.name.color:s.seriesData.series.length>1&&e.total.show&&(n=e.total.color);const l=s.dom.baseEl.querySelector(".apexcharts-datalabel-label"),r=s.dom.baseEl.querySelector(".apexcharts-datalabel-value");a=(0,e.value.formatter)(a,s),i||"function"!=typeof e.total.formatter||(a=e.total.formatter(s));const o=t===e.total.label;if(t=this.donutDataLabels.total.label?e.name.formatter(t,o,s):"",null!==l&&(l.textContent=t),null!==r&&(r.textContent=a),null!==l){l.style.fill=n}}printDataLabelsInner(e,t){const a=this.w,i=e.getAttribute("data:value"),s=a.seriesData.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];a.seriesData.series.length>1&&this.printInnerLabels(t,s,i,e);const n=a.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==n){n.style.opacity="1"}}drawSpokes(e){const t=this.w,a=new f(this.w),i=t.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const s=[],n=360/t.seriesData.series.length;for(let e=0;e<t.seriesData.series.length;e++)s.push(p.polarToCartesian(this.centerX,this.centerY,t.globals.radialSize,t.config.plotOptions.pie.startAngle+n*e));s.forEach((t,s)=>{const n=a.drawLine(t.x,t.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[s]:i.connectorColors);e.add(n)})}revertDataLabelsInner(){const e=this.w;if(this.donutDataLabels.show){const t=e.dom.Paper.findOne(".apexcharts-datalabels-group"),a=this.renderInnerDataLabels(t,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});e.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(a)}}}c.default.use({pie:L,donut:L,polarArea:L}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
package/dist/pie.esm.js
CHANGED
package/dist/pie.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexPie={})}(this,function(e){"use strict";var t=Object.defineProperty,a=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,r=(e,a,i)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i,o=(e,t)=>{for(var a in t||(t={}))n.call(t,a)&&r(e,a,t[a]);if(s)for(var a of s(t))l.call(t,a)&&r(e,a,t[a]);return e},h=(e,t)=>a(e,i(t));const c=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals,g=d.__apex_Animations;d.__apex_Animations_computeStagger,d.__apex_Animations_applyAnimationPolicy,d.__apex_Animations_prefersReducedMotion,d.__apex_Animations_applyProgressiveReveal;const p=globalThis.ApexCharts.__internals.__apex_Fill,f=globalThis.ApexCharts.__internals.__apex_Utils,u=globalThis.ApexCharts.__internals.__apex_Graphics,b=globalThis.ApexCharts.__internals.__apex_Filters,m=globalThis.ApexCharts.__internals.__apex_Scales;class x{constructor(e){this.w=e}drawYAxisTexts(e,t,a,i){const s=this.w,n=s.config.yaxis[0],l=s.formatters.yLabelFormatters[0];return new u(this.w).drawText({x:e+n.labels.offsetX,y:t+n.labels.offsetY,text:l(i,a),textAnchor:"middle",fontSize:n.labels.style.fontSize,fontFamily:n.labels.style.fontFamily,foreColor:Array.isArray(n.labels.style.colors)?n.labels.style.colors[a]:n.labels.style.colors})}getMaxLabelWidth(e,{fontSize:t,fontFamily:a}={}){const i=new u(this.w);let s=0;return e.forEach(e=>{if(null==e||""===e)return;const n=i.getTextRects(`${e}`,t||"12px",a,"");s=Math.max(s,n.width)}),s}drawExternalLabel(e){return function(e,t){const{lines:a,lineHeight:i,anchor:s,elbow:n,labelX:l,labelY:r,side:o,connector:h,style:c,foreColor:d}=t,g=new u(e),p=g.group({class:t.groupClass||"apexcharts-outer-label-group"});if(h.show){const e=`M ${s.x} ${s.y} L ${n.x} ${n.y} L ${l} ${r}`,a=g.drawPath({d:e,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});a.node.classList.add(t.connectorClass||"apexcharts-outer-label-connector"),p.add(a)}const f="right"===o?l+4:l-4,b=a.length,m=r-(b-1)*i/2,x=g.drawText({x:f,y:m,text:1===b?a[0]:a,textAnchor:"right"===o?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:t.textClass||"apexcharts-outer-label"});if(b>1){const e=x.node.getElementsByTagName("tspan");for(let t=0;t<e.length;t++)e[t].setAttribute("x",`${f}`),e[t].setAttribute("dy",0===t?"0":`${i}`)}return p.add(x),p}(this.w,h(o({},e),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const A=globalThis.ApexCharts.__internals.__apex_Environment_Environment,y=Math.PI/180,w=180/Math.PI;function S(e,t,a,i){return{x:e+a*Math.cos((i-90)*y),y:t+a*Math.sin((i-90)*y)}}const v=e=>`${e.x} ${e.y}`;function L({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,r:l,spanDeg:r}){const o=(a,i)=>S(e,t,a,i),h=l/i*w,c=l/a*w,d=o(i,s+h),g=o(i,n-h),p=r-2*h>180?1:0,f=o(i,n),u=o(i-l,n),b=o(i,s),m=o(i-l,s),x=o(a,n-c),A=o(a,s+c),y=r-2*c>180?1:0,L=o(a,n),C=o(a+l,n),O=o(a,s),z=o(a+l,s);return["M",v(d),"A",i,i,0,p,1,v(g),"Q",v(f),v(u),"L",v(C),"Q",v(L),v(x),"A",a,a,0,y,0,v(A),"Q",v(O),v(z),"L",v(m),"Q",v(b),v(d),"Z"].join(" ")}class C{constructor(e,t){this.ctx=t,this.w=e,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=Math.min(e.layout.gridWidth,e.layout.gridHeight),this.centerY=e.layout.gridHeight/2,this.centerX=e.layout.gridWidth/2,"radialBar"===e.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(e.config.plotOptions.pie.endAngle-e.config.plotOptions.pie.startAngle),this.initialAngle=e.config.plotOptions.pie.startAngle%this.fullAngle,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.externalCfg=e.config.plotOptions.pie.dataLabels.external;const a=e.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||a.fontSize,fontFamily:this.externalCfg.fontFamily||a.fontFamily,fontWeight:this.externalCfg.fontWeight||a.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,e.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!e.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100;const i=e.config.plotOptions.pie.customScale,s=e.layout.gridWidth/2,n=e.layout.gridHeight/2;this.translateX=s-s*i,this.translateY=n-n*i,this.dataLabelsGroup=new u(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${i})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(e){var t,a,i;const s=this.w,n=s.seriesData.seriesNames[e],l=this.externalCfg.formatter;return"function"==typeof l?l(n,{seriesIndex:e,percent:null==(a=null==(t=s.globals.seriesPercent)?void 0:t[e])?void 0:a[0],value:null==(i=s.globals.seriesTotals)?void 0:i[e],w:s}):null==n?"":`${n}`}getExternalLabelLines(e){const t=this.getExternalLabelText(e);return(Array.isArray(t)?t:`${null==t?"":t}`.split("\n")).map(e=>null==e?"":`${e}`)}reserveExternalLabelSpace(){const e=this.w,t=new x(e),a=(e.seriesData.seriesNames||[]).map((e,t)=>this.getExternalLabelLines(t)),i=t.getMaxLabelWidth(a.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=a.reduce((e,t)=>Math.max(e,t.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const s=this.externalCfg.connector,n=this.externalLabelMaxLines*this.externalLabelLineH,l=i+(s.length||0)+(s.gap||0)+12,r=n/2+(s.gap||0)+6,o=Math.min(e.globals.radialSize,e.layout.gridWidth/2-l,e.layout.gridHeight/2-r);e.globals.radialSize=Math.max(o,.15*this.defaultSize),e.globals.pieExternalLabelMarginY=r;const h=e.config.chart.height?String(e.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?e.layout.gridHeight/2:e.globals.radialSize+r}draw(e){var t;const a=this.w,i=new u(this.w),s=i.group({class:"apexcharts-pie"});if(a.globals.noData)return s;let n=0;for(let t=0;t<e.length;t++)n+=f.negToZero(e[t]);const l=[],r=i.group();0===n&&(n=1e-5),e.forEach(e=>{this.maxY=Math.max(this.maxY,e)}),a.config.yaxis[0].max&&(this.maxY=a.config.yaxis[0].max),"back"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s);const o=a.globals.collapsedSeriesIndices||[];let h=1;if("polarArea"===this.chartType){let t=0;for(let a=0;a<e.length;a++)-1===o.indexOf(a)&&t++;h=Math.max(1,t)}for(let t=0;t<e.length;t++){const i=this.fullAngle*f.negToZero(e[t])/n;l.push(i),"polarArea"===this.chartType?(l[t]=o.indexOf(t)>-1?0:this.fullAngle/h,this.sliceSizes.push(a.globals.radialSize*e[t]/(this.maxY||1))):this.sliceSizes.push(a.globals.radialSize)}const c=!0===(null==(t=this.ctx.morphTypeChange)?void 0:t.isActive());if(a.globals.dataChanged&&!c)if("polarArea"===this.chartType){const e=a.globals.previousPaths,t=a.globals.prevPolarAngles;if(Array.isArray(t)&&t.length===e.length)this.prevSectorAngleArr=t.slice();else for(let t=0;t<e.length;t++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,e.length));let i=0;for(let t=0;t<e.length;t++)i=Math.max(i,f.negToZero(e[t]));a.config.yaxis[0].max&&(i=a.config.yaxis[0].max),this.prevSliceSizes=e.map(e=>a.globals.radialSize*f.negToZero(e)/(i||1))}else{let e,t=0;for(let e=0;e<a.globals.previousPaths.length;e++)t+=f.negToZero(a.globals.previousPaths[e]);for(let i=0;i<a.globals.previousPaths.length;i++)e=this.fullAngle*f.negToZero(a.globals.previousPaths[i])/t,this.prevSectorAngleArr.push(e)}if("polarArea"===this.chartType&&(a.globals.prevPolarAngles=l.slice()),this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const e=i.drawCircle(this.donutSize);e.attr({cx:this.centerX,cy:this.centerY,fill:a.config.plotOptions.pie.donut.background?a.config.plotOptions.pie.donut.background:"transparent"}),r.add(e)}const d=this.drawArcs(l,e);if(this.sliceLabels.forEach(e=>{d.add(e)}),r.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${a.config.plotOptions.pie.customScale})`}),r.add(d),s.add(r),this.donutDataLabels.show){const e=this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged&&this.animDur>0,t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:e?0:this.donutDataLabels.show});if(e){const e=this.dataLabelsGroup.node;e.style.transition="opacity 280ms ease-out",setTimeout(()=>{e.style.opacity="1"},this.animDur)}s.add(t)}return"front"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s),s}drawArcs(e,t){var a,i,s,n,l;const r=this.w,o=new b(this.w),h=new u(this.w),c=new p(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",r.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let g=this.initialAngle,m=this.initialAngle,y=this.initialAngle,w=this.initialAngle;this.strokeWidth=r.config.stroke.show?r.config.stroke.width:0;const S=!0===(null==(a=this.ctx.morphTypeChange)?void 0:a.isActive());for(let a=0;a<e.length;a++){const p=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:f.escapeString(r.seriesData.seriesNames[a]),rel:a+1,"data:realIndex":a});d.add(p),g=y,m=w,y=g+e[a],w=m+this.prevSectorAngleArr[a];const x=y<g?this.fullAngle+y-g:y-g,A=c.fillPath({seriesNumber:a,size:this.sliceSizes[a],value:t[a]}),v=S?this.ctx.morphTypeChange.getInitialPathFor(a,0):null,L="polarArea"===this.chartType&&r.globals.dataChanged&&!S?this.prevSliceSizes[a]||0:void 0,C=v||this.getChangedPath(m,w,L),O=h.drawPath({d:C,stroke:Array.isArray(this.lineColorArr)?null!=(i=this.lineColorArr[a])?i:this.lineColorArr[a%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:A,fillOpacity:r.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${a}`});if(O.attr({index:0,j:a}),o.setSelectionFilter(O,0,a),r.config.chart.dropShadow.enabled){const e=r.config.chart.dropShadow;o.dropShadow(O,e,a)}this.addListeners(O,this.donutDataLabels,a);let z={x:0,y:0};const P=(g+x/2)%this.fullAngle;let T={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(z=f.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/1.25+r.config.plotOptions.pie.dataLabels.offset,P),T=f.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/2,P)):"donut"===this.chartType&&(z=f.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2+r.config.plotOptions.pie.dataLabels.offset,P),T=f.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2,P)),u.setAttrs(O.node,{"data:angle":x,"data:startAngle":g,"data:strokeWidth":this.strokeWidth,"data:value":t[a],"data:cx":T.x,"data:cy":T.y}),p.add(O);let E=!1;if(S){const e=this.getPiePath({me:this,startAngle:g,angle:x,size:this.sliceSizes[a]});O.node.setAttribute("data:pathFinal",e),E=!0===(null==(n=(s=this.ctx.morphTypeChange).claimsTargetMark)?void 0:n.call(s,a,0)),E&&(O.attr({d:e}),O.node.setAttribute("data:pathOrig",e),O.node.setAttribute("opacity","0"),O.node.setAttribute("data-piece-hidden","1"))}let D=0;if(!this.initialAnim||r.globals.resized||r.globals.dataChanged?this.animBeginArr.push(0):(D=x/this.fullAngle*r.config.chart.animations.speed,0===D&&(D=1),this.animDur=D+this.animDur,this.animBeginArr.push(this.animDur)),E);else if(S&&v){const e=this.getPiePath({me:this,startAngle:g,angle:x,size:this.sliceSizes[a]}),t=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations;O.node.setAttribute("data:pathOrig",e);const s=O.animate(t).plot(e,"polygons").attr({"stroke-width":this.strokeWidth});s&&"function"==typeof s.after?s.after(()=>i.animationCompleted(O)):i.animationCompleted(O)}else this.dynamicAnim&&r.globals.dataChanged?this.animatePaths(O,{size:this.sliceSizes[a],prevSize:L,endAngle:y,startAngle:g,prevStartAngle:m,prevEndAngle:w,animateStartingPos:!0,i:a,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:r.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(O,{size:this.sliceSizes[a],endAngle:y,startAngle:g,i:a,totalItems:e.length-1,animBeginArr:this.animBeginArr,dur:D});if(this.getExpandOffset()>0?O.node.addEventListener("mouseup",this.pieClicked.bind(this,a)):0===a&&b.drilldownBlocksSliceOffset(r)&&(null==(l=this.ctx.drilldown)||l.warnSliceOffsetDisabled()),void 0!==r.interact.selectedDataPoints[0]&&r.interact.selectedDataPoints[0].indexOf(a)>-1)if(this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged&&this.animDur>0){const e=this,t=a;setTimeout(()=>e.pieClicked(t,{animate:!1}),this.animDur)}else this.pieClicked(a,{animate:!1});if(r.config.dataLabels.enabled){const t=z.x,i=z.y;let s=100*x/this.fullAngle+"%";if(0!==x&&r.config.plotOptions.pie.dataLabels.minAngleToShowLabel<e[a]){const e=r.config.dataLabels.formatter;void 0!==e&&(s=e(r.globals.seriesPercent[a][0],{seriesIndex:a,w:r}));const n=r.globals.dataLabels.style.colors[a],l=h.group({class:"apexcharts-datalabels"}),c=h.drawText({x:t,y:i,text:s,textAnchor:"middle",fontSize:r.config.dataLabels.style.fontSize,fontFamily:r.config.dataLabels.style.fontFamily,fontWeight:r.config.dataLabels.style.fontWeight,foreColor:n});if(l.add(c),r.config.dataLabels.dropShadow.enabled){const e=r.config.dataLabels.dropShadow;o.dropShadow(c,e)}c.node.classList.add("apexcharts-pie-label"),r.config.chart.animations.animate&&!1===r.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=r.config.chart.animations.speed/940+"s"),this.sliceLabels.push(l),this.sliceLabelGroups[a]=l.node}}if(this.showExternalLabels&&0!==x){const e=this.getExternalLabelLines(a);if(e.some(e=>""!==e)){const t=f.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize,P),i=f.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize+(this.externalCfg.connector.gap||0),P),s=i.x>=this.centerX,n=s?i.x+(this.externalCfg.connector.length||0):i.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:a,lines:e,anchor:t,elbow:i,side:s?"right":"left",labelX:n+parseFloat(this.externalCfg.offsetX||0),idealY:i.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||r.globals.colors[a],foreColor:this.externalCfg.color||r.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const e=A.isBrowser()&&(S||this.dynamicAnim&&r.globals.dataChanged||this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged);this.externalLabels.forEach(t=>{const a=new x(r).drawExternalLabel({lines:t.lines,lineHeight:this.externalLabelLineH,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:t.connectorColor},style:this.externalLabelStyle,foreColor:t.foreColor});e&&(a.node.classList.add("apexcharts-element-hidden"),r.globals.delayedElements.push({el:a.node})),this.externalLabelGroups[t.i]=a.node,d.add(a)})}return d}placeExternalLabels(){const e=this.w,t=this.externalLabelMaxLines*this.externalLabelLineH+2,a=this.centerY+e.globals.radialSize+e.globals.pieExternalLabelMarginY;["left","right"].forEach(e=>{!function(e,t,a){const i=e.slice().sort((e,t)=>e.idealY-t.idealY);i.forEach(e=>{e.labelY=e.idealY});for(let e=1;e<i.length;e++)i[e].labelY-i[e-1].labelY<t&&(i[e].labelY=i[e-1].labelY+t);const s=i[i.length-1],n=s?s.labelY-a:0;if(n>0)for(let e=i.length-1;e>=0;e--)i[e].labelY-=n,e<i.length-1&&i[e+1].labelY-i[e].labelY<t&&(i[e].labelY=i[e+1].labelY-t)}(this.externalLabels.filter(t=>t.side===e),t,a)})}addListeners(e,t,a){const i=new u(this.w,this.ctx);e.node.addEventListener("mouseenter",i.pathMouseEnter.bind(i,e)),e.node.addEventListener("mouseleave",i.pathMouseLeave.bind(i,e)),e.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof a&&(e.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,a)),e.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),e.node.addEventListener("mousedown",i.pathMouseDown.bind(i,e)),this.donutDataLabels.total.showAlways||(e.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,e.node,t)))}animatePaths(e,t){const a=this.w;let i=t.endAngle<t.startAngle?this.fullAngle+t.endAngle-t.startAngle:t.endAngle-t.startAngle,s=i,n=t.startAngle;const l=t.startAngle;void 0!==t.prevStartAngle&&void 0!==t.prevEndAngle&&(n=t.prevEndAngle,s=t.prevEndAngle<t.prevStartAngle?this.fullAngle+t.prevEndAngle-t.prevStartAngle:t.prevEndAngle-t.prevStartAngle),t.i===a.config.series.length-1&&(i+l>this.fullAngle?t.endAngle=t.endAngle-(i+l):i+l<this.fullAngle&&(t.endAngle=t.endAngle+(this.fullAngle-(i+l)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(e,n,l,i,s,t)}animateArc(e,t,a,i,s,n){const l=this,r=this.w,o=new g(this.w),h=n.size;let c;(isNaN(t)||isNaN(s))&&(t=a,s=i,n.dur=0);let d=i,p=a;const f=t<a?this.fullAngle+t-a:t-a,u="number"==typeof n.prevSize;r.globals.dataChanged&&n.shouldSetPrevPaths&&n.prevEndAngle&&(c=l.getPiePath({me:l,startAngle:n.prevStartAngle,angle:n.prevEndAngle<n.prevStartAngle?this.fullAngle+n.prevEndAngle-n.prevStartAngle:n.prevEndAngle-n.prevStartAngle,size:u?n.prevSize:h}),e.attr({d:c})),0!==n.dur?e.animate(n.dur,n.animBeginArr[n.i]).after(function(){"pie"!==l.chartType&&"donut"!==l.chartType&&"polarArea"!==l.chartType||this.animate(r.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":l.strokeWidth}),n.i===r.config.series.length-1&&o.animationCompleted(e)}).during(r=>{d=f+(i-f)*r,n.animateStartingPos&&(d=s+(i-s)*r,p=t-s+(a-(t-s))*r),c=l.getPiePath({me:l,startAngle:p,angle:d,size:u?n.prevSize+(h-n.prevSize)*r:h}),e.node.setAttribute("data:pathOrig",c),e.attr({d:c})}):(c=l.getPiePath({me:l,startAngle:p,angle:i,size:h}),n.isTrack||(r.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",c),e.attr({d:c,"stroke-width":l.strokeWidth}))}pieClicked(e,t){const a=this.w,i=!(t&&!1===t.animate),s=a.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!s)return;if("true"===s.attr("data:pieClicked"))return s.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(e,0,i);const n=a.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(n,e=>{const t="true"===e.getAttribute("data:pieClicked");e.setAttribute("data:pieClicked","false"),t&&this.offsetSlice(parseInt(e.getAttribute("j"),10),0,i)}),a.interact.capturedDataPointIndex=e,s.attr("data:pieClicked","true"),this.offsetSlice(e,this.getExpandOffset(),i)}getExpandOffset(){const e=this.w.config.plotOptions.pie;if(!e.expandOnClick||"polarArea"===this.chartType)return 0;if(b.drilldownBlocksSliceOffset(this.w))return 0;const t=Number(e.expandOffset);return Number.isFinite(t)&&t>0?t:0}getSliceMovers(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return[t?t.node:null,this.sliceLabelGroups[e],this.externalLabelGroups[e],this.hoverOutlineIndex===e&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(e,t,a=!0){const i=this.w;if(!i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`))return;const{dx:s,dy:n}=this.getSliceOffsetVector(e,t),l=`translate(${s} ${n})`,r=a&&i.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(e).forEach(e=>{e.style.transition=r,e.setAttribute("transform",l)})}getSliceOffsetVector(e,t){const a=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`),i=a?parseFloat(a.attr("data:angle")):NaN;if(!t||!Number.isFinite(i)||i>=this.fullAngle)return{dx:0,dy:0};const s=parseFloat(a.attr("data:startAngle")),n=Math.PI*(s+i/2-90)/180;return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}showHoverOutline(e){const t=this.w;if(!b.hoverOutlineOwnsHoverState(t))return;if(!this.elHoverOutline)return;const a=this.getHoverOutlinePath(e);if(!a)return;const i=t.config.plotOptions.pie.hoverOutline,s=i.color||t.globals.colors[e];if(!this.elHoverOutlinePath){const e=new u(t);this.elHoverOutlinePath=e.drawPath({d:a,fill:s,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:a,fill:s,"fill-opacity":i.opacity});const{dx:n,dy:l}=this.getSliceOffsetVector(e,this.isSliceOut(e)?this.getExpandOffset():0);this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${n} ${l})`),this.hoverOutlineIndex=e,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}isSliceOut(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return!!t&&"true"===t.attr("data:pieClicked")}getHoverOutlinePath(e){const t=this.w,a=t.config.plotOptions.pie.hoverOutline,i=t.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!i)return null;const s=parseFloat(i.attr("data:angle"));if(!Number.isFinite(s)||s<=0)return null;const n=this.sliceSizes[e],l=Number(a.size);if(!Number.isFinite(n)||!Number.isFinite(l)||l<=0)return null;const{startDeg:r,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(i.attr("data:startAngle")),angle:s,size:n});if(!(c>0))return null;const d=n+(this.strokeWidth||0)/2+(Number(a.gap)||0),g=d+l,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:g,a0:r,a1:r+c,spanDeg:c},f=Math.min(l/2,c*Math.PI/180/2*d);return f>.5?L(h(o({},p),{r:f})):function({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,spanDeg:l}){const r=(a,i)=>S(e,t,a,i),o=l>180?1:0,h=r(i,s),c=r(i,n),d=r(a,n),g=r(a,s);return["M",v(h),"A",i,i,0,o,1,v(c),"L",v(d),"A",a,a,0,o,0,v(g),"Z"].join(" ")}(p)}getChangedPath(e,t,a){let i="";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:e,angle:t-e,size:"number"==typeof a?a:this.size})),i}getSliceExtent({me:e,startAngle:t,angle:a,size:i}){const s=this.w;let n=t,l=a+t;Math.ceil(l)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(l=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let r=l-n;const o="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,h=s.config.plotOptions.pie.spacing;if(o&&h>0&&r>0){const t="donut"===e.chartType?(i+e.donutSize)/2:i,a=t>0?h/t*(180/Math.PI):0,s=Math.min(a/2,Math.max(0,r/2-.5));n+=s,r-=2*s}return l=n+r,Math.ceil(l)>this.fullAngle&&(l-=this.fullAngle),{startDeg:n,spanDeg:r,endDeg:l}}getPiePath({me:e,startAngle:t,angle:a,size:i}){let s;const n=this.w,l=new u(this.w),{startDeg:r,spanDeg:o,endDeg:h}=this.getSliceExtent({me:e,startAngle:t,angle:a,size:i}),c="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,d=Math.PI*(r-90)/180,g=n.config.plotOptions.pie.borderRadius;if(g>0&&c){const t=this.getRoundedSlicePath({me:e,startDeg:r,spanDeg:o,size:i,borderRadius:g});if(t)return t}const p=Math.PI*(h-90)/180,b=e.centerX+i*Math.cos(d),m=e.centerY+i*Math.sin(d),x=e.centerX+i*Math.cos(p),A=e.centerY+i*Math.sin(p),y=f.polarToCartesian(e.centerX,e.centerY,e.donutSize,h),w=f.polarToCartesian(e.centerX,e.centerY,e.donutSize,r),S=o>180?1:0,v=["M",b,m,"A",i,i,0,S,1,x,A];return s="donut"===e.chartType?[...v,"L",y.x,y.y,"A",e.donutSize,e.donutSize,0,S,0,w.x,w.y,"L",b,m,"z"].join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[...v,"L",e.centerX,e.centerY,"L",b,m].join(" "):[...v].join(" "),l.roundPathCorners(s,2*this.strokeWidth)}getRoundedSlicePath({me:e,startDeg:t,spanDeg:a,size:i,borderRadius:s}){if(!(a>0))return null;const n=Math.PI/180,l=e.centerX,r=e.centerY,o="donut"===e.chartType,h=i,c=o?e.donutSize:0,d=a*n;let g=s;if(g=Math.min(g,d*h/2),o?(g=Math.min(g,d*c/2),g=Math.min(g,(h-c)/2)):g=Math.min(g,h/2),!(g>.5))return null;const p=t,f=t+a;return o?L({cx:l,cy:r,rIn:c,rOut:h,a0:p,a1:f,r:g,spanDeg:a}):function({cx:e,cy:t,rOut:a,a0:i,a1:s,r:n,spanDeg:l}){const r=(a,i)=>S(e,t,a,i),o=n/a*w,h=r(a,i+o),c=r(a,s-o),d=l-2*o>180?1:0,g=r(a,s),p=r(a-n,s),f=r(a,i),u=r(a-n,i);return["M",v(h),"A",a,a,0,d,1,v(c),"Q",v(g),v(p),"L",`${e} ${t}`,"L",v(u),"Q",v(f),v(h),"Z"].join(" ")}({cx:l,cy:r,rOut:h,a0:p,a1:f,r:g,spanDeg:a})}drawPolarElements(e){const t=this.w,a=new m(this.w),i=new u(this.w),s=new x(this.w),n=i.group(),l=i.group(),r=a.niceScale(0,Math.ceil(this.maxY),0),o=r.result.reverse(),h=r.result.length;this.maxY=r.niceMax;let c=t.globals.radialSize;const d=c/(h-1);for(let e=0;e<h-1;e++){const a=i.drawCircle(c);if(a.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){const a=s.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,e,o[e]);l.add(a)}n.add(a),c-=d}this.drawSpokes(e),e.add(n),e.add(l)}renderInnerDataLabels(e,t,a){const i=this.w,s=new u(this.w),n=t.total.show;e.node.innerHTML="",e.node.style.opacity=a.opacity;const l=a.centerX,r=this.donutDataLabels.total.label?a.centerY:a.centerY-a.centerY/6;let o,h;o=void 0===t.name.color?i.globals.colors[0]:t.name.color;let c=t.name.fontSize,d=t.name.fontFamily,g=t.name.fontWeight;h=void 0===t.value.color?i.config.chart.foreColor:t.value.color;const p=t.value.formatter;let f="",b="";if(n?(o=t.total.color,c=t.total.fontSize,d=t.total.fontFamily,g=t.total.fontWeight,b=this.donutDataLabels.total.label?t.total.label:"",f=t.total.formatter(i)):1===i.seriesData.series.length&&(f=p(i.seriesData.series[0],i),b=i.seriesData.seriesNames[0]),b&&(b=t.name.formatter(b,t.total.show,i)),t.name.show){const a=s.drawText({x:l,y:r+parseFloat(t.name.offsetY),text:b,textAnchor:"middle",foreColor:o,fontSize:c,fontWeight:g,fontFamily:d});a.node.classList.add("apexcharts-datalabel-label"),e.add(a)}if(t.value.show){const a=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,i=s.drawText({x:l,y:r+a,text:f,textAnchor:"middle",foreColor:h,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});i.node.classList.add("apexcharts-datalabel-value"),e.add(i)}return e}printInnerLabels(e,t,a,i){const s=this.w;let n;i?n=void 0===e.name.color?s.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:e.name.color:s.seriesData.series.length>1&&e.total.show&&(n=e.total.color);const l=s.dom.baseEl.querySelector(".apexcharts-datalabel-label"),r=s.dom.baseEl.querySelector(".apexcharts-datalabel-value");a=(0,e.value.formatter)(a,s),i||"function"!=typeof e.total.formatter||(a=e.total.formatter(s));const o=t===e.total.label;if(t=this.donutDataLabels.total.label?e.name.formatter(t,o,s):"",null!==l&&(l.textContent=t),null!==r&&(r.textContent=a),null!==l){l.style.fill=n}}printDataLabelsInner(e,t){const a=this.w,i=e.getAttribute("data:value"),s=a.seriesData.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];a.seriesData.series.length>1&&this.printInnerLabels(t,s,i,e);const n=a.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==n){n.style.opacity="1"}}drawSpokes(e){const t=this.w,a=new u(this.w),i=t.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const s=[],n=360/t.seriesData.series.length;for(let e=0;e<t.seriesData.series.length;e++)s.push(f.polarToCartesian(this.centerX,this.centerY,t.globals.radialSize,t.config.plotOptions.pie.startAngle+n*e));s.forEach((t,s)=>{const n=a.drawLine(t.x,t.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[s]:i.connectorColors);e.add(n)})}revertDataLabelsInner(){const e=this.w;if(this.donutDataLabels.show){const t=e.dom.Paper.findOne(".apexcharts-datalabels-group"),a=this.renderInnerDataLabels(t,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});e.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(a)}}}c.use({pie:C,donut:C,polarArea:C}),e.default=c,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/polarArea.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,l=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,r=(e,t)=>{for(var a in t||(t={}))s.call(t,a)&&l(e,a,t[a]);if(i)for(var a of i(t))n.call(t,a)&&l(e,a,t[a]);return e},o=(e,i)=>t(e,a(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)}const c=h(require("apexcharts/core")),d=c.__apex_Animations,g=c.__apex_Fill,p=c.__apex_Utils,f=c.__apex_Graphics,u=c.__apex_Filters,b=c.__apex_Scales;class m{constructor(e){this.w=e}drawYAxisTexts(e,t,a,i){const s=this.w,n=s.config.yaxis[0],l=s.formatters.yLabelFormatters[0];return new f(this.w).drawText({x:e+n.labels.offsetX,y:t+n.labels.offsetY,text:l(i,a),textAnchor:"middle",fontSize:n.labels.style.fontSize,fontFamily:n.labels.style.fontFamily,foreColor:Array.isArray(n.labels.style.colors)?n.labels.style.colors[a]:n.labels.style.colors})}getMaxLabelWidth(e,{fontSize:t,fontFamily:a}={}){const i=new f(this.w);let s=0;return e.forEach(e=>{if(null==e||""===e)return;const n=i.getTextRects(`${e}`,t||"12px",a,"");s=Math.max(s,n.width)}),s}drawExternalLabel(e){return function(e,t){const{lines:a,lineHeight:i,anchor:s,elbow:n,labelX:l,labelY:r,side:o,connector:h,style:c,foreColor:d}=t,g=new f(e),p=g.group({class:t.groupClass||"apexcharts-outer-label-group"});if(h.show){const e=`M ${s.x} ${s.y} L ${n.x} ${n.y} L ${l} ${r}`,a=g.drawPath({d:e,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});a.node.classList.add(t.connectorClass||"apexcharts-outer-label-connector"),p.add(a)}const u="right"===o?l+4:l-4,b=a.length,m=r-(b-1)*i/2,x=g.drawText({x:u,y:m,text:1===b?a[0]:a,textAnchor:"right"===o?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:t.textClass||"apexcharts-outer-label"});if(b>1){const e=x.node.getElementsByTagName("tspan");for(let t=0;t<e.length;t++)e[t].setAttribute("x",`${u}`),e[t].setAttribute("dy",0===t?"0":`${i}`)}return p.add(x),p}(this.w,o(r({},e),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const x=c.__apex_Environment_Environment,y=Math.PI/180,A=180/Math.PI;function w(e,t,a,i){return{x:e+a*Math.cos((i-90)*y),y:t+a*Math.sin((i-90)*y)}}const S=e=>`${e.x} ${e.y}`;function v({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,r:l,spanDeg:r}){const o=(a,i)=>w(e,t,a,i),h=l/i*A,c=l/a*A,d=o(i,s+h),g=o(i,n-h),p=r-2*h>180?1:0,f=o(i,n),u=o(i-l,n),b=o(i,s),m=o(i-l,s),x=o(a,n-c),y=o(a,s+c),v=r-2*c>180?1:0,L=o(a,n),O=o(a+l,n),z=o(a,s),C=o(a+l,s);return["M",S(d),"A",i,i,0,p,1,S(g),"Q",S(f),S(u),"L",S(O),"Q",S(L),S(x),"A",a,a,0,v,0,S(y),"Q",S(z),S(C),"L",S(m),"Q",S(b),S(d),"Z"].join(" ")}class L{constructor(e,t){this.ctx=t,this.w=e,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=Math.min(e.layout.gridWidth,e.layout.gridHeight),this.centerY=e.layout.gridHeight/2,this.centerX=e.layout.gridWidth/2,"radialBar"===e.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(e.config.plotOptions.pie.endAngle-e.config.plotOptions.pie.startAngle),this.initialAngle=e.config.plotOptions.pie.startAngle%this.fullAngle,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.externalCfg=e.config.plotOptions.pie.dataLabels.external;const a=e.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||a.fontSize,fontFamily:this.externalCfg.fontFamily||a.fontFamily,fontWeight:this.externalCfg.fontWeight||a.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,e.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!e.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100;const i=e.config.plotOptions.pie.customScale,s=e.layout.gridWidth/2,n=e.layout.gridHeight/2;this.translateX=s-s*i,this.translateY=n-n*i,this.dataLabelsGroup=new f(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${i})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(e){var t,a,i;const s=this.w,n=s.seriesData.seriesNames[e],l=this.externalCfg.formatter;return"function"==typeof l?l(n,{seriesIndex:e,percent:null==(a=null==(t=s.globals.seriesPercent)?void 0:t[e])?void 0:a[0],value:null==(i=s.globals.seriesTotals)?void 0:i[e],w:s}):null==n?"":`${n}`}getExternalLabelLines(e){const t=this.getExternalLabelText(e);return(Array.isArray(t)?t:`${null==t?"":t}`.split("\n")).map(e=>null==e?"":`${e}`)}reserveExternalLabelSpace(){const e=this.w,t=new m(e),a=(e.seriesData.seriesNames||[]).map((e,t)=>this.getExternalLabelLines(t)),i=t.getMaxLabelWidth(a.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=a.reduce((e,t)=>Math.max(e,t.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const s=this.externalCfg.connector,n=this.externalLabelMaxLines*this.externalLabelLineH,l=i+(s.length||0)+(s.gap||0)+12,r=n/2+(s.gap||0)+6,o=Math.min(e.globals.radialSize,e.layout.gridWidth/2-l,e.layout.gridHeight/2-r);e.globals.radialSize=Math.max(o,.15*this.defaultSize),e.globals.pieExternalLabelMarginY=r;const h=e.config.chart.height?String(e.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?e.layout.gridHeight/2:e.globals.radialSize+r}draw(e){var t;const a=this.w,i=new f(this.w),s=i.group({class:"apexcharts-pie"});if(a.globals.noData)return s;let n=0;for(let t=0;t<e.length;t++)n+=p.negToZero(e[t]);const l=[],r=i.group();0===n&&(n=1e-5),e.forEach(e=>{this.maxY=Math.max(this.maxY,e)}),a.config.yaxis[0].max&&(this.maxY=a.config.yaxis[0].max),"back"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s);const o=a.globals.collapsedSeriesIndices||[];let h=1;if("polarArea"===this.chartType){let t=0;for(let a=0;a<e.length;a++)-1===o.indexOf(a)&&t++;h=Math.max(1,t)}for(let t=0;t<e.length;t++){const i=this.fullAngle*p.negToZero(e[t])/n;l.push(i),"polarArea"===this.chartType?(l[t]=o.indexOf(t)>-1?0:this.fullAngle/h,this.sliceSizes.push(a.globals.radialSize*e[t]/(this.maxY||1))):this.sliceSizes.push(a.globals.radialSize)}const c=!0===(null==(t=this.ctx.morphTypeChange)?void 0:t.isActive());if(a.globals.dataChanged&&!c)if("polarArea"===this.chartType){const e=a.globals.previousPaths,t=a.globals.prevPolarAngles;if(Array.isArray(t)&&t.length===e.length)this.prevSectorAngleArr=t.slice();else for(let t=0;t<e.length;t++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,e.length));let i=0;for(let t=0;t<e.length;t++)i=Math.max(i,p.negToZero(e[t]));a.config.yaxis[0].max&&(i=a.config.yaxis[0].max),this.prevSliceSizes=e.map(e=>a.globals.radialSize*p.negToZero(e)/(i||1))}else{let e,t=0;for(let e=0;e<a.globals.previousPaths.length;e++)t+=p.negToZero(a.globals.previousPaths[e]);for(let i=0;i<a.globals.previousPaths.length;i++)e=this.fullAngle*p.negToZero(a.globals.previousPaths[i])/t,this.prevSectorAngleArr.push(e)}if("polarArea"===this.chartType&&(a.globals.prevPolarAngles=l.slice()),this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const e=i.drawCircle(this.donutSize);e.attr({cx:this.centerX,cy:this.centerY,fill:a.config.plotOptions.pie.donut.background?a.config.plotOptions.pie.donut.background:"transparent"}),r.add(e)}const d=this.drawArcs(l,e);if(this.sliceLabels.forEach(e=>{d.add(e)}),r.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${a.config.plotOptions.pie.customScale})`}),r.add(d),s.add(r),this.donutDataLabels.show){const e=this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged&&this.animDur>0,t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:e?0:this.donutDataLabels.show});if(e){const e=this.dataLabelsGroup.node;e.style.transition="opacity 280ms ease-out",setTimeout(()=>{e.style.opacity="1"},this.animDur)}s.add(t)}return"front"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s),s}drawArcs(e,t){var a,i,s,n,l;const r=this.w,o=new u(this.w),h=new f(this.w),c=new g(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",r.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let b=this.initialAngle,y=this.initialAngle,A=this.initialAngle,w=this.initialAngle;this.strokeWidth=r.config.stroke.show?r.config.stroke.width:0;const S=!0===(null==(a=this.ctx.morphTypeChange)?void 0:a.isActive());for(let a=0;a<e.length;a++){const g=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:p.escapeString(r.seriesData.seriesNames[a]),rel:a+1,"data:realIndex":a});d.add(g),b=A,y=w,A=b+e[a],w=y+this.prevSectorAngleArr[a];const m=A<b?this.fullAngle+A-b:A-b,x=c.fillPath({seriesNumber:a,size:this.sliceSizes[a],value:t[a]}),v=S?this.ctx.morphTypeChange.getInitialPathFor(a,0):null,L="polarArea"===this.chartType&&r.globals.dataChanged&&!S?this.prevSliceSizes[a]||0:void 0,O=v||this.getChangedPath(y,w,L),z=h.drawPath({d:O,stroke:Array.isArray(this.lineColorArr)?null!=(i=this.lineColorArr[a])?i:this.lineColorArr[a%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:x,fillOpacity:r.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${a}`});if(z.attr({index:0,j:a}),o.setSelectionFilter(z,0,a),r.config.chart.dropShadow.enabled){const e=r.config.chart.dropShadow;o.dropShadow(z,e,a)}this.addListeners(z,this.donutDataLabels,a);let C={x:0,y:0};const P=(b+m/2)%this.fullAngle;let T={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(C=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/1.25+r.config.plotOptions.pie.dataLabels.offset,P),T=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/2,P)):"donut"===this.chartType&&(C=p.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2+r.config.plotOptions.pie.dataLabels.offset,P),T=p.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2,P)),f.setAttrs(z.node,{"data:angle":m,"data:startAngle":b,"data:strokeWidth":this.strokeWidth,"data:value":t[a],"data:cx":T.x,"data:cy":T.y}),g.add(z);let E=!1;if(S){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]});z.node.setAttribute("data:pathFinal",e),E=!0===(null==(n=(s=this.ctx.morphTypeChange).claimsTargetMark)?void 0:n.call(s,a,0)),E&&(z.attr({d:e}),z.node.setAttribute("data:pathOrig",e),z.node.setAttribute("opacity","0"),z.node.setAttribute("data-piece-hidden","1"))}let D=0;if(!this.initialAnim||r.globals.resized||r.globals.dataChanged?this.animBeginArr.push(0):(D=m/this.fullAngle*r.config.chart.animations.speed,0===D&&(D=1),this.animDur=D+this.animDur,this.animBeginArr.push(this.animDur)),E);else if(S&&v){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]}),t=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations;z.node.setAttribute("data:pathOrig",e);const s=z.animate(t).plot(e,"polygons").attr({"stroke-width":this.strokeWidth});s&&"function"==typeof s.after?s.after(()=>i.animationCompleted(z)):i.animationCompleted(z)}else this.dynamicAnim&&r.globals.dataChanged?this.animatePaths(z,{size:this.sliceSizes[a],prevSize:L,endAngle:A,startAngle:b,prevStartAngle:y,prevEndAngle:w,animateStartingPos:!0,i:a,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:r.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(z,{size:this.sliceSizes[a],endAngle:A,startAngle:b,i:a,totalItems:e.length-1,animBeginArr:this.animBeginArr,dur:D});if(this.getExpandOffset()>0?z.node.addEventListener("mouseup",this.pieClicked.bind(this,a)):0===a&&u.drilldownBlocksSliceOffset(r)&&(null==(l=this.ctx.drilldown)||l.warnSliceOffsetDisabled()),void 0!==r.interact.selectedDataPoints[0]&&r.interact.selectedDataPoints[0].indexOf(a)>-1)if(this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged&&this.animDur>0){const e=this,t=a;setTimeout(()=>e.pieClicked(t,{animate:!1}),this.animDur)}else this.pieClicked(a,{animate:!1});if(r.config.dataLabels.enabled){const t=C.x,i=C.y;let s=100*m/this.fullAngle+"%";if(0!==m&&r.config.plotOptions.pie.dataLabels.minAngleToShowLabel<e[a]){const e=r.config.dataLabels.formatter;void 0!==e&&(s=e(r.globals.seriesPercent[a][0],{seriesIndex:a,w:r}));const n=r.globals.dataLabels.style.colors[a],l=h.group({class:"apexcharts-datalabels"}),c=h.drawText({x:t,y:i,text:s,textAnchor:"middle",fontSize:r.config.dataLabels.style.fontSize,fontFamily:r.config.dataLabels.style.fontFamily,fontWeight:r.config.dataLabels.style.fontWeight,foreColor:n});if(l.add(c),r.config.dataLabels.dropShadow.enabled){const e=r.config.dataLabels.dropShadow;o.dropShadow(c,e)}c.node.classList.add("apexcharts-pie-label"),r.config.chart.animations.animate&&!1===r.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=r.config.chart.animations.speed/940+"s"),this.sliceLabels.push(l),this.sliceLabelGroups[a]=l.node}}if(this.showExternalLabels&&0!==m){const e=this.getExternalLabelLines(a);if(e.some(e=>""!==e)){const t=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize,P),i=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize+(this.externalCfg.connector.gap||0),P),s=i.x>=this.centerX,n=s?i.x+(this.externalCfg.connector.length||0):i.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:a,lines:e,anchor:t,elbow:i,side:s?"right":"left",labelX:n+parseFloat(this.externalCfg.offsetX||0),idealY:i.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||r.globals.colors[a],foreColor:this.externalCfg.color||r.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const e=x.isBrowser()&&(S||this.dynamicAnim&&r.globals.dataChanged||this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged);this.externalLabels.forEach(t=>{const a=new m(r).drawExternalLabel({lines:t.lines,lineHeight:this.externalLabelLineH,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:t.connectorColor},style:this.externalLabelStyle,foreColor:t.foreColor});e&&(a.node.classList.add("apexcharts-element-hidden"),r.globals.delayedElements.push({el:a.node})),this.externalLabelGroups[t.i]=a.node,d.add(a)})}return d}placeExternalLabels(){const e=this.w,t=this.externalLabelMaxLines*this.externalLabelLineH+2,a=this.centerY+e.globals.radialSize+e.globals.pieExternalLabelMarginY;["left","right"].forEach(e=>{!function(e,t,a){const i=e.slice().sort((e,t)=>e.idealY-t.idealY);i.forEach(e=>{e.labelY=e.idealY});for(let e=1;e<i.length;e++)i[e].labelY-i[e-1].labelY<t&&(i[e].labelY=i[e-1].labelY+t);const s=i[i.length-1],n=s?s.labelY-a:0;if(n>0)for(let e=i.length-1;e>=0;e--)i[e].labelY-=n,e<i.length-1&&i[e+1].labelY-i[e].labelY<t&&(i[e].labelY=i[e+1].labelY-t)}(this.externalLabels.filter(t=>t.side===e),t,a)})}addListeners(e,t,a){const i=new f(this.w,this.ctx);e.node.addEventListener("mouseenter",i.pathMouseEnter.bind(i,e)),e.node.addEventListener("mouseleave",i.pathMouseLeave.bind(i,e)),e.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof a&&(e.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,a)),e.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),e.node.addEventListener("mousedown",i.pathMouseDown.bind(i,e)),this.donutDataLabels.total.showAlways||(e.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,e.node,t)))}animatePaths(e,t){const a=this.w;let i=t.endAngle<t.startAngle?this.fullAngle+t.endAngle-t.startAngle:t.endAngle-t.startAngle,s=i,n=t.startAngle;const l=t.startAngle;void 0!==t.prevStartAngle&&void 0!==t.prevEndAngle&&(n=t.prevEndAngle,s=t.prevEndAngle<t.prevStartAngle?this.fullAngle+t.prevEndAngle-t.prevStartAngle:t.prevEndAngle-t.prevStartAngle),t.i===a.config.series.length-1&&(i+l>this.fullAngle?t.endAngle=t.endAngle-(i+l):i+l<this.fullAngle&&(t.endAngle=t.endAngle+(this.fullAngle-(i+l)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(e,n,l,i,s,t)}animateArc(e,t,a,i,s,n){const l=this,r=this.w,o=new d(this.w),h=n.size;let c;(isNaN(t)||isNaN(s))&&(t=a,s=i,n.dur=0);let g=i,p=a;const f=t<a?this.fullAngle+t-a:t-a,u="number"==typeof n.prevSize;r.globals.dataChanged&&n.shouldSetPrevPaths&&n.prevEndAngle&&(c=l.getPiePath({me:l,startAngle:n.prevStartAngle,angle:n.prevEndAngle<n.prevStartAngle?this.fullAngle+n.prevEndAngle-n.prevStartAngle:n.prevEndAngle-n.prevStartAngle,size:u?n.prevSize:h}),e.attr({d:c})),0!==n.dur?e.animate(n.dur,n.animBeginArr[n.i]).after(function(){"pie"!==l.chartType&&"donut"!==l.chartType&&"polarArea"!==l.chartType||this.animate(r.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":l.strokeWidth}),n.i===r.config.series.length-1&&o.animationCompleted(e)}).during(r=>{g=f+(i-f)*r,n.animateStartingPos&&(g=s+(i-s)*r,p=t-s+(a-(t-s))*r),c=l.getPiePath({me:l,startAngle:p,angle:g,size:u?n.prevSize+(h-n.prevSize)*r:h}),e.node.setAttribute("data:pathOrig",c),e.attr({d:c})}):(c=l.getPiePath({me:l,startAngle:p,angle:i,size:h}),n.isTrack||(r.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",c),e.attr({d:c,"stroke-width":l.strokeWidth}))}pieClicked(e,t){const a=this.w,i=!(t&&!1===t.animate),s=a.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!s)return;if("true"===s.attr("data:pieClicked"))return s.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(e,0,i);const n=a.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(n,e=>{const t="true"===e.getAttribute("data:pieClicked");e.setAttribute("data:pieClicked","false"),t&&this.offsetSlice(parseInt(e.getAttribute("j"),10),0,i)}),a.interact.capturedDataPointIndex=e,s.attr("data:pieClicked","true"),this.offsetSlice(e,this.getExpandOffset(),i)}getExpandOffset(){const e=this.w.config.plotOptions.pie;if(!e.expandOnClick||"polarArea"===this.chartType)return 0;if(u.drilldownBlocksSliceOffset(this.w))return 0;const t=Number(e.expandOffset);return Number.isFinite(t)&&t>0?t:0}getSliceMovers(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return[t?t.node:null,this.sliceLabelGroups[e],this.externalLabelGroups[e],this.hoverOutlineIndex===e&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(e,t,a=!0){const i=this.w;if(!i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`))return;const{dx:s,dy:n}=this.getSliceOffsetVector(e,t),l=`translate(${s} ${n})`,r=a&&i.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(e).forEach(e=>{e.style.transition=r,e.setAttribute("transform",l)})}getSliceOffsetVector(e,t){const a=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`),i=a?parseFloat(a.attr("data:angle")):NaN;if(!t||!Number.isFinite(i)||i>=this.fullAngle)return{dx:0,dy:0};const s=parseFloat(a.attr("data:startAngle")),n=Math.PI*(s+i/2-90)/180;return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}showHoverOutline(e){const t=this.w;if(!u.hoverOutlineOwnsHoverState(t))return;if(!this.elHoverOutline)return;const a=this.getHoverOutlinePath(e);if(!a)return;const i=t.config.plotOptions.pie.hoverOutline,s=i.color||t.globals.colors[e];if(!this.elHoverOutlinePath){const e=new f(t);this.elHoverOutlinePath=e.drawPath({d:a,fill:s,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:a,fill:s,"fill-opacity":i.opacity});const{dx:n,dy:l}=this.getSliceOffsetVector(e,this.isSliceOut(e)?this.getExpandOffset():0);this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${n} ${l})`),this.hoverOutlineIndex=e,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}isSliceOut(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return!!t&&"true"===t.attr("data:pieClicked")}getHoverOutlinePath(e){const t=this.w,a=t.config.plotOptions.pie.hoverOutline,i=t.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!i)return null;const s=parseFloat(i.attr("data:angle"));if(!Number.isFinite(s)||s<=0)return null;const n=this.sliceSizes[e],l=Number(a.size);if(!Number.isFinite(n)||!Number.isFinite(l)||l<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(i.attr("data:startAngle")),angle:s,size:n});if(!(c>0))return null;const d=n+(this.strokeWidth||0)/2+(Number(a.gap)||0),g=d+l,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:g,a0:h,a1:h+c,spanDeg:c},f=Math.min(l/2,c*Math.PI/180/2*d);return f>.5?v(o(r({},p),{r:f})):function({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,spanDeg:l}){const r=(a,i)=>w(e,t,a,i),o=l>180?1:0,h=r(i,s),c=r(i,n),d=r(a,n),g=r(a,s);return["M",S(h),"A",i,i,0,o,1,S(c),"L",S(d),"A",a,a,0,o,0,S(g),"Z"].join(" ")}(p)}getChangedPath(e,t,a){let i="";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:e,angle:t-e,size:"number"==typeof a?a:this.size})),i}getSliceExtent({me:e,startAngle:t,angle:a,size:i}){const s=this.w;let n=t,l=a+t;Math.ceil(l)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(l=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let r=l-n;const o="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,h=s.config.plotOptions.pie.spacing;if(o&&h>0&&r>0){const t="donut"===e.chartType?(i+e.donutSize)/2:i,a=t>0?h/t*(180/Math.PI):0,s=Math.min(a/2,Math.max(0,r/2-.5));n+=s,r-=2*s}return l=n+r,Math.ceil(l)>this.fullAngle&&(l-=this.fullAngle),{startDeg:n,spanDeg:r,endDeg:l}}getPiePath({me:e,startAngle:t,angle:a,size:i}){let s;const n=this.w,l=new f(this.w),{startDeg:r,spanDeg:o,endDeg:h}=this.getSliceExtent({me:e,startAngle:t,angle:a,size:i}),c="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,d=Math.PI*(r-90)/180,g=n.config.plotOptions.pie.borderRadius;if(g>0&&c){const t=this.getRoundedSlicePath({me:e,startDeg:r,spanDeg:o,size:i,borderRadius:g});if(t)return t}const u=Math.PI*(h-90)/180,b=e.centerX+i*Math.cos(d),m=e.centerY+i*Math.sin(d),x=e.centerX+i*Math.cos(u),y=e.centerY+i*Math.sin(u),A=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,h),w=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,r),S=o>180?1:0,v=["M",b,m,"A",i,i,0,S,1,x,y];return s="donut"===e.chartType?[...v,"L",A.x,A.y,"A",e.donutSize,e.donutSize,0,S,0,w.x,w.y,"L",b,m,"z"].join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[...v,"L",e.centerX,e.centerY,"L",b,m].join(" "):[...v].join(" "),l.roundPathCorners(s,2*this.strokeWidth)}getRoundedSlicePath({me:e,startDeg:t,spanDeg:a,size:i,borderRadius:s}){if(!(a>0))return null;const n=Math.PI/180,l=e.centerX,r=e.centerY,o="donut"===e.chartType,h=i,c=o?e.donutSize:0,d=a*n;let g=s;if(g=Math.min(g,d*h/2),o?(g=Math.min(g,d*c/2),g=Math.min(g,(h-c)/2)):g=Math.min(g,h/2),!(g>.5))return null;const p=t,f=t+a;return o?v({cx:l,cy:r,rIn:c,rOut:h,a0:p,a1:f,r:g,spanDeg:a}):function({cx:e,cy:t,rOut:a,a0:i,a1:s,r:n,spanDeg:l}){const r=(a,i)=>w(e,t,a,i),o=n/a*A,h=r(a,i+o),c=r(a,s-o),d=l-2*o>180?1:0,g=r(a,s),p=r(a-n,s),f=r(a,i),u=r(a-n,i);return["M",S(h),"A",a,a,0,d,1,S(c),"Q",S(g),S(p),"L",`${e} ${t}`,"L",S(u),"Q",S(f),S(h),"Z"].join(" ")}({cx:l,cy:r,rOut:h,a0:p,a1:f,r:g,spanDeg:a})}drawPolarElements(e){const t=this.w,a=new b(this.w),i=new f(this.w),s=new m(this.w),n=i.group(),l=i.group(),r=a.niceScale(0,Math.ceil(this.maxY),0),o=r.result.reverse(),h=r.result.length;this.maxY=r.niceMax;let c=t.globals.radialSize;const d=c/(h-1);for(let e=0;e<h-1;e++){const a=i.drawCircle(c);if(a.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){const a=s.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,e,o[e]);l.add(a)}n.add(a),c-=d}this.drawSpokes(e),e.add(n),e.add(l)}renderInnerDataLabels(e,t,a){const i=this.w,s=new f(this.w),n=t.total.show;e.node.innerHTML="",e.node.style.opacity=a.opacity;const l=a.centerX,r=this.donutDataLabels.total.label?a.centerY:a.centerY-a.centerY/6;let o,h;o=void 0===t.name.color?i.globals.colors[0]:t.name.color;let c=t.name.fontSize,d=t.name.fontFamily,g=t.name.fontWeight;h=void 0===t.value.color?i.config.chart.foreColor:t.value.color;const p=t.value.formatter;let u="",b="";if(n?(o=t.total.color,c=t.total.fontSize,d=t.total.fontFamily,g=t.total.fontWeight,b=this.donutDataLabels.total.label?t.total.label:"",u=t.total.formatter(i)):1===i.seriesData.series.length&&(u=p(i.seriesData.series[0],i),b=i.seriesData.seriesNames[0]),b&&(b=t.name.formatter(b,t.total.show,i)),t.name.show){const a=s.drawText({x:l,y:r+parseFloat(t.name.offsetY),text:b,textAnchor:"middle",foreColor:o,fontSize:c,fontWeight:g,fontFamily:d});a.node.classList.add("apexcharts-datalabel-label"),e.add(a)}if(t.value.show){const a=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,i=s.drawText({x:l,y:r+a,text:u,textAnchor:"middle",foreColor:h,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});i.node.classList.add("apexcharts-datalabel-value"),e.add(i)}return e}printInnerLabels(e,t,a,i){const s=this.w;let n;i?n=void 0===e.name.color?s.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:e.name.color:s.seriesData.series.length>1&&e.total.show&&(n=e.total.color);const l=s.dom.baseEl.querySelector(".apexcharts-datalabel-label"),r=s.dom.baseEl.querySelector(".apexcharts-datalabel-value");a=(0,e.value.formatter)(a,s),i||"function"!=typeof e.total.formatter||(a=e.total.formatter(s));const o=t===e.total.label;if(t=this.donutDataLabels.total.label?e.name.formatter(t,o,s):"",null!==l&&(l.textContent=t),null!==r&&(r.textContent=a),null!==l){l.style.fill=n}}printDataLabelsInner(e,t){const a=this.w,i=e.getAttribute("data:value"),s=a.seriesData.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];a.seriesData.series.length>1&&this.printInnerLabels(t,s,i,e);const n=a.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==n){n.style.opacity="1"}}drawSpokes(e){const t=this.w,a=new f(this.w),i=t.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const s=[],n=360/t.seriesData.series.length;for(let e=0;e<t.seriesData.series.length;e++)s.push(p.polarToCartesian(this.centerX,this.centerY,t.globals.radialSize,t.config.plotOptions.pie.startAngle+n*e));s.forEach((t,s)=>{const n=a.drawLine(t.x,t.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[s]:i.connectorColors);e.add(n)})}revertDataLabelsInner(){const e=this.w;if(this.donutDataLabels.show){const t=e.dom.Paper.findOne(".apexcharts-datalabels-group"),a=this.renderInnerDataLabels(t,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});e.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(a)}}}c.default.use({pie:L,donut:L,polarArea:L}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
package/dist/polarArea.esm.js
CHANGED
package/dist/radar.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var t=Object.defineProperty,s=Object.defineProperties,e=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,r=(s,e,a)=>e in s?t(s,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[e]=a,n=(t,s)=>{for(var e in s||(s={}))i.call(s,e)&&r(t,e,s[e]);if(a)for(var e of a(s))o.call(s,e)&&r(t,e,s[e]);return t},l=(t,a)=>s(t,e(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const e in t)if("default"!==e){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,a.get?a:{enumerable:!0,get:()=>t[e]})}return s.default=t,Object.freeze(s)}const c=h(require("apexcharts/core")),d=c.__apex_Fill,g=c.__apex_Graphics,p=c.__apex_Markers,x=c.__apex_DataLabels,f=c.__apex_Filters,u=c.__apex_Utils;class y{constructor(t){this.w=t}drawYAxisTexts(t,s,e,a){const i=this.w,o=i.config.yaxis[0],r=i.formatters.yLabelFormatters[0];return new g(this.w).drawText({x:t+o.labels.offsetX,y:s+o.labels.offsetY,text:r(a,e),textAnchor:"middle",fontSize:o.labels.style.fontSize,fontFamily:o.labels.style.fontFamily,foreColor:Array.isArray(o.labels.style.colors)?o.labels.style.colors[e]:o.labels.style.colors})}getMaxLabelWidth(t,{fontSize:s,fontFamily:e}={}){const a=new g(this.w);let i=0;return t.forEach(t=>{if(null==t||""===t)return;const o=a.getTextRects(`${t}`,s||"12px",e,"");i=Math.max(i,o.width)}),i}drawExternalLabel(t){return function(t,s){const{lines:e,lineHeight:a,anchor:i,elbow:o,labelX:r,labelY:n,side:l,connector:h,style:c,foreColor:d}=s,p=new g(t),x=p.group({class:s.groupClass||"apexcharts-outer-label-group"});if(h.show){const t=`M ${i.x} ${i.y} L ${o.x} ${o.y} L ${r} ${n}`,e=p.drawPath({d:t,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});e.node.classList.add(s.connectorClass||"apexcharts-outer-label-connector"),x.add(e)}const f="right"===l?r+4:r-4,u=e.length,y=n-(u-1)*a/2,b=p.drawText({x:f,y:y,text:1===u?e[0]:e,textAnchor:"right"===l?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:s.textClass||"apexcharts-outer-label"});if(u>1){const t=b.node.getElementsByTagName("tspan");for(let s=0;s<t.length;s++)t[s].setAttribute("x",`${f}`),t[s].setAttribute("dy",0===s?"0":`${a}`)}return x.add(b),x}(this.w,l(n({},t),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const b=c.__apex_CoreUtils;c.default.use({radar:class{constructor(t,s){this.ctx=s,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new g(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new b(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const s=this.w,e=new d(this.w),a=[],i=new x(this.w,this.ctx);t.length&&(this.dataPointsLen=t[s.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const o=s.layout.gridWidth/2,r=s.layout.gridHeight/2,h=o+s.config.plotOptions.radar.offsetX,c=r+s.config.plotOptions.radar.offsetY,g=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`});let y=[],b=null,w=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,o)=>{const r=t.length===s.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":r,seriesName:u.escapeString(s.seriesData.seriesNames[o]),rel:o+1,"data:realIndex":o});this.dataRadiusOfPercent[o]=[],this.dataRadius[o]=[],this.angleArr[o]=[],t.forEach((t,s)=>{const e=Math.abs(this.maxValue-this.minValue);t-=this.minValue,this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[o][s]=t/e,this.dataRadius[o][s]=this.dataRadiusOfPercent[o][s]*this.size,this.angleArr[o][s]=s*this.disAngle}),y=this.getDataPointsPos(this.dataRadius[o],this.angleArr[o]);const c=this.createPaths(y,{x:0,y:0});b=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),w=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":o}),s.globals.delayedElements.push({el:b.node,index:o});const d={i:o,realIndex:o,animationDelay:o,initialSpeed:s.config.chart.animations.speed,dataChangeSpeed:s.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:s.globals.stroke.colors[o],strokeLineCap:s.config.stroke.lineCap};let g=null;s.globals.previousPaths.length>0&&(g=this.getPreviousPath(o));for(let t=0;t<c.linePathsTo.length;t++){const a=this.graphics.renderPaths(l(n({},d),{pathFrom:null===g?c.linePathsFrom[t]:g,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[o]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(a);const i=e.fillPath({seriesNumber:o}),r=this.graphics.renderPaths(l(n({},d),{pathFrom:null===g?c.areaPathsFrom[t]:g,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:i,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(s.config.chart.dropShadow.enabled){const t=new f(this.w),e=s.config.chart.dropShadow;t.dropShadow(r,Object.assign({},e,{noUserSpaceOnUse:!0}),o)}h.add(r)}t.forEach((t,e)=>{const a=new p(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:o,dataPointIndex:e});a.pSize||(a.pSize=5,a.pointFillColor="transparent",a.pointStrokeColor="transparent",a.pointStrokeWidth=0);const r=this.graphics.drawMarker(y[e].x,y[e].y,a);r.attr("rel",e),r.attr("j",e),r.attr("index",o),r.node.setAttribute("default-marker-size",a.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(r),b.add(l),h.add(b);const c=s.config.dataLabels;if(c.enabled){const t=c.formatter(s.seriesData.series[o][e],{seriesIndex:o,dataPointIndex:e,w:s});i.plotDataLabelsText({x:y[e].x,y:y[e].y,text:t,textAnchor:"middle",i:o,j:o,seriesIndex:o,dataPointIndex:e,parent:w,offsetCorrection:!1,dataLabelsConfig:n({},c)})}h.add(w)}),a.push(h)}),this.drawPolygons({parent:g}),s.config.xaxis.labels.show){const t=this.drawXAxisTexts();g.add(t)}return a.forEach(t=>{g.add(t)}),g.add(this.yaxisLabels),g}drawPolygons(t){const s=this.w,{parent:e}=t,a=new y(this.w),i=s.globals.yAxisScale[0].result.reverse(),o=i.length,r=[],n=this.size/(o-1);for(let t=0;t<o;t++)r[t]=n*t;r.reverse();const l=[],h=[];r.forEach((t,s)=>{const e=u.getPolygonPos(t,this.dataPointsLen);let a="";e.forEach((t,e)=>{if(0===s){const s=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[e]:this.polygons.connectorColors);h.push(s)}0===e&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),a+=t.x+","+t.y+" "}),l.push(a)}),l.forEach((t,a)=>{const i=this.polygons.strokeColors,o=this.polygons.strokeWidth,r=this.graphics.drawPolygon(t,Array.isArray(i)?i[a]:i,Array.isArray(o)?o[a]:o,s.globals.radarPolygons.fill.colors[a]);e.add(r)}),h.forEach(t=>{e.add(t)}),s.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,s)=>{const e=a.drawYAxisTexts(t.x,t.y,s,i[s]);this.yaxisLabels.add(e)})}drawXAxisTexts(){const t=this.w,s=t.config.xaxis.labels,e=this.graphics.group({class:"apexcharts-xaxis"}),a=u.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((i,o)=>{const r=t.config.xaxis.labels.formatter,l=new x(this.w,this.ctx);if(a[o]){const h=this.getTextPos(a[o],this.size),c=r(i,{seriesIndex:-1,dataPointIndex:o,w:t});l.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:o,j:o,parent:e,className:"apexcharts-xaxis-label",color:Array.isArray(s.style.colors)&&s.style.colors[o]?s.style.colors[o]:"#a8a8a8",dataLabelsConfig:n({textAnchor:h.textAnchor,dropShadow:{enabled:!1}},s),offsetCorrection:!1}).on("click",s=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const e=Object.assign({},t,{labelIndex:o});t.config.chart.events.xAxisLabelClick(s,this.ctx,e)}})}}),e}createPaths(t,s){const e=[];let a=[];const i=[];let o=[];if(t.length){a=[this.graphics.move(s.x,s.y)],o=[this.graphics.move(s.x,s.y)];let r=this.graphics.move(t[0].x,t[0].y),n=this.graphics.move(t[0].x,t[0].y);t.forEach((s,e)=>{r+=this.graphics.line(s.x,s.y),n+=this.graphics.line(s.x,s.y),e===t.length-1&&(r+="Z",n+="Z")}),e.push(r),i.push(n)}return{linePathsFrom:a,linePathsTo:e,areaPathsFrom:o,areaPathsTo:i}}getTextPos(t,s){let e="middle",a=t.x,i=t.y;return Math.abs(t.x)>=10?t.x>0?(e="start",a+=10):t.x<0&&(e="end",a-=10):e="middle",Math.abs(t.y)>=s-10&&(t.y<0?i-=10:t.y>0&&(i+=10)),{textAnchor:e,newX:a,newY:i}}getPreviousPath(t){const s=this.w;let e=null;for(let a=0;a<s.globals.previousPaths.length;a++){const i=s.globals.previousPaths[a];i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&void 0!==s.globals.previousPaths[a].paths[0]&&(e=s.globals.previousPaths[a].paths[0].d)}return e}getDataPointsPos(t,s,e=this.dataPointsLen){t=t||[],s=s||[];const a=[];for(let i=0;i<e;i++){const e={};e.x=t[i]*Math.sin(s[i]),e.y=-t[i]*Math.cos(s[i]),a.push(e)}return a}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
package/dist/radar.esm.js
CHANGED
package/dist/radar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s((t="undefined"!=typeof globalThis?globalThis:t||self).ApexRadar={})}(this,function(t){"use strict";var s=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,l=(t,e,a)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,n=(t,s)=>{for(var e in s||(s={}))o.call(s,e)&&l(t,e,s[e]);if(i)for(var e of i(s))r.call(s,e)&&l(t,e,s[e]);return t},h=(t,s)=>e(t,a(s));const c=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals.__apex_Fill,g=globalThis.ApexCharts.__internals.__apex_Graphics,p=globalThis.ApexCharts.__internals.__apex_Markers,x=globalThis.ApexCharts.__internals.__apex_DataLabels,f=globalThis.ApexCharts.__internals.__apex_Filters,y=globalThis.ApexCharts.__internals.__apex_Utils;class b{constructor(t){this.w=t}drawYAxisTexts(t,s,e,a){const i=this.w,o=i.config.yaxis[0],r=i.formatters.yLabelFormatters[0];return new g(this.w).drawText({x:t+o.labels.offsetX,y:s+o.labels.offsetY,text:r(a,e),textAnchor:"middle",fontSize:o.labels.style.fontSize,fontFamily:o.labels.style.fontFamily,foreColor:Array.isArray(o.labels.style.colors)?o.labels.style.colors[e]:o.labels.style.colors})}getMaxLabelWidth(t,{fontSize:s,fontFamily:e}={}){const a=new g(this.w);let i=0;return t.forEach(t=>{if(null==t||""===t)return;const o=a.getTextRects(`${t}`,s||"12px",e,"");i=Math.max(i,o.width)}),i}drawExternalLabel(t){return function(t,s){const{lines:e,lineHeight:a,anchor:i,elbow:o,labelX:r,labelY:l,side:n,connector:h,style:c,foreColor:d}=s,p=new g(t),x=p.group({class:s.groupClass||"apexcharts-outer-label-group"});if(h.show){const t=`M ${i.x} ${i.y} L ${o.x} ${o.y} L ${r} ${l}`,e=p.drawPath({d:t,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});e.node.classList.add(s.connectorClass||"apexcharts-outer-label-connector"),x.add(e)}const f="right"===n?r+4:r-4,y=e.length,b=l-(y-1)*a/2,u=p.drawText({x:f,y:b,text:1===y?e[0]:e,textAnchor:"right"===n?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:s.textClass||"apexcharts-outer-label"});if(y>1){const t=u.node.getElementsByTagName("tspan");for(let s=0;s<t.length;s++)t[s].setAttribute("x",`${f}`),t[s].setAttribute("dy",0===s?"0":`${a}`)}return x.add(u),x}(this.w,h(n({},t),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const u=globalThis.ApexCharts.__internals.__apex_CoreUtils;c.use({radar:class{constructor(t,s){this.ctx=s,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new g(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new u(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const s=this.w,e=new d(this.w),a=[],i=new x(this.w,this.ctx);t.length&&(this.dataPointsLen=t[s.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const o=s.layout.gridWidth/2,r=s.layout.gridHeight/2,l=o+s.config.plotOptions.radar.offsetX,c=r+s.config.plotOptions.radar.offsetY,g=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${l||0}, ${c||0})`});let b=[],u=null,w=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,o)=>{const r=t.length===s.globals.dataPoints,l=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":r,seriesName:y.escapeString(s.seriesData.seriesNames[o]),rel:o+1,"data:realIndex":o});this.dataRadiusOfPercent[o]=[],this.dataRadius[o]=[],this.angleArr[o]=[],t.forEach((t,s)=>{const e=Math.abs(this.maxValue-this.minValue);t-=this.minValue,this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[o][s]=t/e,this.dataRadius[o][s]=this.dataRadiusOfPercent[o][s]*this.size,this.angleArr[o][s]=s*this.disAngle}),b=this.getDataPointsPos(this.dataRadius[o],this.angleArr[o]);const c=this.createPaths(b,{x:0,y:0});u=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),w=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":o}),s.globals.delayedElements.push({el:u.node,index:o});const d={i:o,realIndex:o,animationDelay:o,initialSpeed:s.config.chart.animations.speed,dataChangeSpeed:s.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:s.globals.stroke.colors[o],strokeLineCap:s.config.stroke.lineCap};let g=null;s.globals.previousPaths.length>0&&(g=this.getPreviousPath(o));for(let t=0;t<c.linePathsTo.length;t++){const a=this.graphics.renderPaths(h(n({},d),{pathFrom:null===g?c.linePathsFrom[t]:g,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[o]:this.strokeWidth,fill:"none",drawShadow:!1}));l.add(a);const i=e.fillPath({seriesNumber:o}),r=this.graphics.renderPaths(h(n({},d),{pathFrom:null===g?c.areaPathsFrom[t]:g,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:i,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(s.config.chart.dropShadow.enabled){const t=new f(this.w),e=s.config.chart.dropShadow;t.dropShadow(r,Object.assign({},e,{noUserSpaceOnUse:!0}),o)}l.add(r)}t.forEach((t,e)=>{const a=new p(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:o,dataPointIndex:e});a.pSize||(a.pSize=5,a.pointFillColor="transparent",a.pointStrokeColor="transparent",a.pointStrokeWidth=0);const r=this.graphics.drawMarker(b[e].x,b[e].y,a);r.attr("rel",e),r.attr("j",e),r.attr("index",o),r.node.setAttribute("default-marker-size",a.pSize);const h=this.graphics.group({class:"apexcharts-series-markers"});h&&h.add(r),u.add(h),l.add(u);const c=s.config.dataLabels;if(c.enabled){const t=c.formatter(s.seriesData.series[o][e],{seriesIndex:o,dataPointIndex:e,w:s});i.plotDataLabelsText({x:b[e].x,y:b[e].y,text:t,textAnchor:"middle",i:o,j:o,seriesIndex:o,dataPointIndex:e,parent:w,offsetCorrection:!1,dataLabelsConfig:n({},c)})}l.add(w)}),a.push(l)}),this.drawPolygons({parent:g}),s.config.xaxis.labels.show){const t=this.drawXAxisTexts();g.add(t)}return a.forEach(t=>{g.add(t)}),g.add(this.yaxisLabels),g}drawPolygons(t){const s=this.w,{parent:e}=t,a=new b(this.w),i=s.globals.yAxisScale[0].result.reverse(),o=i.length,r=[],l=this.size/(o-1);for(let t=0;t<o;t++)r[t]=l*t;r.reverse();const n=[],h=[];r.forEach((t,s)=>{const e=y.getPolygonPos(t,this.dataPointsLen);let a="";e.forEach((t,e)=>{if(0===s){const s=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[e]:this.polygons.connectorColors);h.push(s)}0===e&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),a+=t.x+","+t.y+" "}),n.push(a)}),n.forEach((t,a)=>{const i=this.polygons.strokeColors,o=this.polygons.strokeWidth,r=this.graphics.drawPolygon(t,Array.isArray(i)?i[a]:i,Array.isArray(o)?o[a]:o,s.globals.radarPolygons.fill.colors[a]);e.add(r)}),h.forEach(t=>{e.add(t)}),s.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,s)=>{const e=a.drawYAxisTexts(t.x,t.y,s,i[s]);this.yaxisLabels.add(e)})}drawXAxisTexts(){const t=this.w,s=t.config.xaxis.labels,e=this.graphics.group({class:"apexcharts-xaxis"}),a=y.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((i,o)=>{const r=t.config.xaxis.labels.formatter,l=new x(this.w,this.ctx);if(a[o]){const h=this.getTextPos(a[o],this.size),c=r(i,{seriesIndex:-1,dataPointIndex:o,w:t});l.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:o,j:o,parent:e,className:"apexcharts-xaxis-label",color:Array.isArray(s.style.colors)&&s.style.colors[o]?s.style.colors[o]:"#a8a8a8",dataLabelsConfig:n({textAnchor:h.textAnchor,dropShadow:{enabled:!1}},s),offsetCorrection:!1}).on("click",s=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const e=Object.assign({},t,{labelIndex:o});t.config.chart.events.xAxisLabelClick(s,this.ctx,e)}})}}),e}createPaths(t,s){const e=[];let a=[];const i=[];let o=[];if(t.length){a=[this.graphics.move(s.x,s.y)],o=[this.graphics.move(s.x,s.y)];let r=this.graphics.move(t[0].x,t[0].y),l=this.graphics.move(t[0].x,t[0].y);t.forEach((s,e)=>{r+=this.graphics.line(s.x,s.y),l+=this.graphics.line(s.x,s.y),e===t.length-1&&(r+="Z",l+="Z")}),e.push(r),i.push(l)}return{linePathsFrom:a,linePathsTo:e,areaPathsFrom:o,areaPathsTo:i}}getTextPos(t,s){let e="middle",a=t.x,i=t.y;return Math.abs(t.x)>=10?t.x>0?(e="start",a+=10):t.x<0&&(e="end",a-=10):e="middle",Math.abs(t.y)>=s-10&&(t.y<0?i-=10:t.y>0&&(i+=10)),{textAnchor:e,newX:a,newY:i}}getPreviousPath(t){const s=this.w;let e=null;for(let a=0;a<s.globals.previousPaths.length;a++){const i=s.globals.previousPaths[a];i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&void 0!==s.globals.previousPaths[a].paths[0]&&(e=s.globals.previousPaths[a].paths[0].d)}return e}getDataPointsPos(t,s,e=this.dataPointsLen){t=t||[],s=s||[];const a=[];for(let i=0;i<e;i++){const e={};e.x=t[i]*Math.sin(s[i]),e.y=-t[i]*Math.cos(s[i]),a.push(e)}return a}}}),t.default=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/radialBar.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,r=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,l=(e,t)=>{for(var a in t||(t={}))s.call(t,a)&&r(e,a,t[a]);if(i)for(var a of i(t))n.call(t,a)&&r(e,a,t[a]);return e},o=(e,i)=>t(e,a(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)}const c=h(require("apexcharts/core")),d=c.__apex_Animations,g=c.__apex_Fill,p=c.__apex_Utils,f=c.__apex_Graphics,u=c.__apex_Filters,b=c.__apex_Scales;class m{constructor(e){this.w=e}drawYAxisTexts(e,t,a,i){const s=this.w,n=s.config.yaxis[0],r=s.formatters.yLabelFormatters[0];return new f(this.w).drawText({x:e+n.labels.offsetX,y:t+n.labels.offsetY,text:r(i,a),textAnchor:"middle",fontSize:n.labels.style.fontSize,fontFamily:n.labels.style.fontFamily,foreColor:Array.isArray(n.labels.style.colors)?n.labels.style.colors[a]:n.labels.style.colors})}getMaxLabelWidth(e,{fontSize:t,fontFamily:a}={}){const i=new f(this.w);let s=0;return e.forEach(e=>{if(null==e||""===e)return;const n=i.getTextRects(`${e}`,t||"12px",a,"");s=Math.max(s,n.width)}),s}drawExternalLabel(e){return function(e,t){const{lines:a,lineHeight:i,anchor:s,elbow:n,labelX:r,labelY:l,side:o,connector:h,style:c,foreColor:d}=t,g=new f(e),p=g.group({class:t.groupClass||"apexcharts-outer-label-group"});if(h.show){const e=`M ${s.x} ${s.y} L ${n.x} ${n.y} L ${r} ${l}`,a=g.drawPath({d:e,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});a.node.classList.add(t.connectorClass||"apexcharts-outer-label-connector"),p.add(a)}const u="right"===o?r+4:r-4,b=a.length,m=l-(b-1)*i/2,A=g.drawText({x:u,y:m,text:1===b?a[0]:a,textAnchor:"right"===o?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:t.textClass||"apexcharts-outer-label"});if(b>1){const e=A.node.getElementsByTagName("tspan");for(let t=0;t<e.length;t++)e[t].setAttribute("x",`${u}`),e[t].setAttribute("dy",0===t?"0":`${i}`)}return p.add(A),p}(this.w,o(l({},e),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const A=c.__apex_Environment_Environment,x=Math.PI/180,w=180/Math.PI;function y(e,t,a,i){return{x:e+a*Math.cos((i-90)*x),y:t+a*Math.sin((i-90)*x)}}const S=e=>`${e.x} ${e.y}`;function L({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,r:r,spanDeg:l}){const o=(a,i)=>y(e,t,a,i),h=r/i*w,c=r/a*w,d=o(i,s+h),g=o(i,n-h),p=l-2*h>180?1:0,f=o(i,n),u=o(i-r,n),b=o(i,s),m=o(i-r,s),A=o(a,n-c),x=o(a,s+c),L=l-2*c>180?1:0,v=o(a,n),O=o(a+r,n),z=o(a,s),C=o(a+r,s);return["M",S(d),"A",i,i,0,p,1,S(g),"Q",S(f),S(u),"L",S(O),"Q",S(v),S(A),"A",a,a,0,L,0,S(x),"Q",S(z),S(C),"L",S(m),"Q",S(b),S(d),"Z"].join(" ")}class v{constructor(e,t){this.ctx=t,this.w=e,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=Math.min(e.layout.gridWidth,e.layout.gridHeight),this.centerY=e.layout.gridHeight/2,this.centerX=e.layout.gridWidth/2,"radialBar"===e.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(e.config.plotOptions.pie.endAngle-e.config.plotOptions.pie.startAngle),this.initialAngle=e.config.plotOptions.pie.startAngle%this.fullAngle,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.externalCfg=e.config.plotOptions.pie.dataLabels.external;const a=e.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||a.fontSize,fontFamily:this.externalCfg.fontFamily||a.fontFamily,fontWeight:this.externalCfg.fontWeight||a.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,e.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!e.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100;const i=e.config.plotOptions.pie.customScale,s=e.layout.gridWidth/2,n=e.layout.gridHeight/2;this.translateX=s-s*i,this.translateY=n-n*i,this.dataLabelsGroup=new f(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${i})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(e){var t,a,i;const s=this.w,n=s.seriesData.seriesNames[e],r=this.externalCfg.formatter;return"function"==typeof r?r(n,{seriesIndex:e,percent:null==(a=null==(t=s.globals.seriesPercent)?void 0:t[e])?void 0:a[0],value:null==(i=s.globals.seriesTotals)?void 0:i[e],w:s}):null==n?"":`${n}`}getExternalLabelLines(e){const t=this.getExternalLabelText(e);return(Array.isArray(t)?t:`${null==t?"":t}`.split("\n")).map(e=>null==e?"":`${e}`)}reserveExternalLabelSpace(){const e=this.w,t=new m(e),a=(e.seriesData.seriesNames||[]).map((e,t)=>this.getExternalLabelLines(t)),i=t.getMaxLabelWidth(a.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=a.reduce((e,t)=>Math.max(e,t.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const s=this.externalCfg.connector,n=this.externalLabelMaxLines*this.externalLabelLineH,r=i+(s.length||0)+(s.gap||0)+12,l=n/2+(s.gap||0)+6,o=Math.min(e.globals.radialSize,e.layout.gridWidth/2-r,e.layout.gridHeight/2-l);e.globals.radialSize=Math.max(o,.15*this.defaultSize),e.globals.pieExternalLabelMarginY=l;const h=e.config.chart.height?String(e.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?e.layout.gridHeight/2:e.globals.radialSize+l}draw(e){var t;const a=this.w,i=new f(this.w),s=i.group({class:"apexcharts-pie"});if(a.globals.noData)return s;let n=0;for(let t=0;t<e.length;t++)n+=p.negToZero(e[t]);const r=[],l=i.group();0===n&&(n=1e-5),e.forEach(e=>{this.maxY=Math.max(this.maxY,e)}),a.config.yaxis[0].max&&(this.maxY=a.config.yaxis[0].max),"back"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s);const o=a.globals.collapsedSeriesIndices||[];let h=1;if("polarArea"===this.chartType){let t=0;for(let a=0;a<e.length;a++)-1===o.indexOf(a)&&t++;h=Math.max(1,t)}for(let t=0;t<e.length;t++){const i=this.fullAngle*p.negToZero(e[t])/n;r.push(i),"polarArea"===this.chartType?(r[t]=o.indexOf(t)>-1?0:this.fullAngle/h,this.sliceSizes.push(a.globals.radialSize*e[t]/(this.maxY||1))):this.sliceSizes.push(a.globals.radialSize)}const c=!0===(null==(t=this.ctx.morphTypeChange)?void 0:t.isActive());if(a.globals.dataChanged&&!c)if("polarArea"===this.chartType){const e=a.globals.previousPaths,t=a.globals.prevPolarAngles;if(Array.isArray(t)&&t.length===e.length)this.prevSectorAngleArr=t.slice();else for(let t=0;t<e.length;t++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,e.length));let i=0;for(let t=0;t<e.length;t++)i=Math.max(i,p.negToZero(e[t]));a.config.yaxis[0].max&&(i=a.config.yaxis[0].max),this.prevSliceSizes=e.map(e=>a.globals.radialSize*p.negToZero(e)/(i||1))}else{let e,t=0;for(let e=0;e<a.globals.previousPaths.length;e++)t+=p.negToZero(a.globals.previousPaths[e]);for(let i=0;i<a.globals.previousPaths.length;i++)e=this.fullAngle*p.negToZero(a.globals.previousPaths[i])/t,this.prevSectorAngleArr.push(e)}if("polarArea"===this.chartType&&(a.globals.prevPolarAngles=r.slice()),this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const e=i.drawCircle(this.donutSize);e.attr({cx:this.centerX,cy:this.centerY,fill:a.config.plotOptions.pie.donut.background?a.config.plotOptions.pie.donut.background:"transparent"}),l.add(e)}const d=this.drawArcs(r,e);if(this.sliceLabels.forEach(e=>{d.add(e)}),l.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${a.config.plotOptions.pie.customScale})`}),l.add(d),s.add(l),this.donutDataLabels.show){const e=this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged&&this.animDur>0,t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:e?0:this.donutDataLabels.show});if(e){const e=this.dataLabelsGroup.node;e.style.transition="opacity 280ms ease-out",setTimeout(()=>{e.style.opacity="1"},this.animDur)}s.add(t)}return"front"===a.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(s),s}drawArcs(e,t){var a,i,s,n,r;const l=this.w,o=new u(this.w),h=new f(this.w),c=new g(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",l.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let b=this.initialAngle,x=this.initialAngle,w=this.initialAngle,y=this.initialAngle;this.strokeWidth=l.config.stroke.show?l.config.stroke.width:0;const S=!0===(null==(a=this.ctx.morphTypeChange)?void 0:a.isActive());for(let a=0;a<e.length;a++){const g=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:p.escapeString(l.seriesData.seriesNames[a]),rel:a+1,"data:realIndex":a});d.add(g),b=w,x=y,w=b+e[a],y=x+this.prevSectorAngleArr[a];const m=w<b?this.fullAngle+w-b:w-b,A=c.fillPath({seriesNumber:a,size:this.sliceSizes[a],value:t[a]}),L=S?this.ctx.morphTypeChange.getInitialPathFor(a,0):null,v="polarArea"===this.chartType&&l.globals.dataChanged&&!S?this.prevSliceSizes[a]||0:void 0,O=L||this.getChangedPath(x,y,v),z=h.drawPath({d:O,stroke:Array.isArray(this.lineColorArr)?null!=(i=this.lineColorArr[a])?i:this.lineColorArr[a%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:A,fillOpacity:l.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${a}`});if(z.attr({index:0,j:a}),o.setSelectionFilter(z,0,a),l.config.chart.dropShadow.enabled){const e=l.config.chart.dropShadow;o.dropShadow(z,e,a)}this.addListeners(z,this.donutDataLabels,a);let C={x:0,y:0};const k=(b+m/2)%this.fullAngle;let P={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(C=p.polarToCartesian(this.centerX,this.centerY,l.globals.radialSize/1.25+l.config.plotOptions.pie.dataLabels.offset,k),P=p.polarToCartesian(this.centerX,this.centerY,l.globals.radialSize/2,k)):"donut"===this.chartType&&(C=p.polarToCartesian(this.centerX,this.centerY,(l.globals.radialSize+this.donutSize)/2+l.config.plotOptions.pie.dataLabels.offset,k),P=p.polarToCartesian(this.centerX,this.centerY,(l.globals.radialSize+this.donutSize)/2,k)),f.setAttrs(z.node,{"data:angle":m,"data:startAngle":b,"data:strokeWidth":this.strokeWidth,"data:value":t[a],"data:cx":P.x,"data:cy":P.y}),g.add(z);let T=!1;if(S){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]});z.node.setAttribute("data:pathFinal",e),T=!0===(null==(n=(s=this.ctx.morphTypeChange).claimsTargetMark)?void 0:n.call(s,a,0)),T&&(z.attr({d:e}),z.node.setAttribute("data:pathOrig",e),z.node.setAttribute("opacity","0"),z.node.setAttribute("data-piece-hidden","1"))}let Y=0;if(!this.initialAnim||l.globals.resized||l.globals.dataChanged?this.animBeginArr.push(0):(Y=m/this.fullAngle*l.config.chart.animations.speed,0===Y&&(Y=1),this.animDur=Y+this.animDur,this.animBeginArr.push(this.animDur)),T);else if(S&&L){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]}),t=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations;z.node.setAttribute("data:pathOrig",e);const s=z.animate(t).plot(e,"polygons").attr({"stroke-width":this.strokeWidth});s&&"function"==typeof s.after?s.after(()=>i.animationCompleted(z)):i.animationCompleted(z)}else this.dynamicAnim&&l.globals.dataChanged?this.animatePaths(z,{size:this.sliceSizes[a],prevSize:v,endAngle:w,startAngle:b,prevStartAngle:x,prevEndAngle:y,animateStartingPos:!0,i:a,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:l.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(z,{size:this.sliceSizes[a],endAngle:w,startAngle:b,i:a,totalItems:e.length-1,animBeginArr:this.animBeginArr,dur:Y});if(this.getExpandOffset()>0?z.node.addEventListener("mouseup",this.pieClicked.bind(this,a)):0===a&&u.drilldownBlocksSliceOffset(l)&&(null==(r=this.ctx.drilldown)||r.warnSliceOffsetDisabled()),void 0!==l.interact.selectedDataPoints[0]&&l.interact.selectedDataPoints[0].indexOf(a)>-1)if(this.initialAnim&&!l.globals.resized&&!l.globals.dataChanged&&this.animDur>0){const e=this,t=a;setTimeout(()=>e.pieClicked(t,{animate:!1}),this.animDur)}else this.pieClicked(a,{animate:!1});if(l.config.dataLabels.enabled){const t=C.x,i=C.y;let s=100*m/this.fullAngle+"%";if(0!==m&&l.config.plotOptions.pie.dataLabels.minAngleToShowLabel<e[a]){const e=l.config.dataLabels.formatter;void 0!==e&&(s=e(l.globals.seriesPercent[a][0],{seriesIndex:a,w:l}));const n=l.globals.dataLabels.style.colors[a],r=h.group({class:"apexcharts-datalabels"}),c=h.drawText({x:t,y:i,text:s,textAnchor:"middle",fontSize:l.config.dataLabels.style.fontSize,fontFamily:l.config.dataLabels.style.fontFamily,fontWeight:l.config.dataLabels.style.fontWeight,foreColor:n});if(r.add(c),l.config.dataLabels.dropShadow.enabled){const e=l.config.dataLabels.dropShadow;o.dropShadow(c,e)}c.node.classList.add("apexcharts-pie-label"),l.config.chart.animations.animate&&!1===l.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=l.config.chart.animations.speed/940+"s"),this.sliceLabels.push(r),this.sliceLabelGroups[a]=r.node}}if(this.showExternalLabels&&0!==m){const e=this.getExternalLabelLines(a);if(e.some(e=>""!==e)){const t=p.polarToCartesian(this.centerX,this.centerY,l.globals.radialSize,k),i=p.polarToCartesian(this.centerX,this.centerY,l.globals.radialSize+(this.externalCfg.connector.gap||0),k),s=i.x>=this.centerX,n=s?i.x+(this.externalCfg.connector.length||0):i.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:a,lines:e,anchor:t,elbow:i,side:s?"right":"left",labelX:n+parseFloat(this.externalCfg.offsetX||0),idealY:i.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||l.globals.colors[a],foreColor:this.externalCfg.color||l.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const e=A.isBrowser()&&(S||this.dynamicAnim&&l.globals.dataChanged||this.initialAnim&&!l.globals.resized&&!l.globals.dataChanged);this.externalLabels.forEach(t=>{const a=new m(l).drawExternalLabel({lines:t.lines,lineHeight:this.externalLabelLineH,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:t.connectorColor},style:this.externalLabelStyle,foreColor:t.foreColor});e&&(a.node.classList.add("apexcharts-element-hidden"),l.globals.delayedElements.push({el:a.node})),this.externalLabelGroups[t.i]=a.node,d.add(a)})}return d}placeExternalLabels(){const e=this.w,t=this.externalLabelMaxLines*this.externalLabelLineH+2,a=this.centerY+e.globals.radialSize+e.globals.pieExternalLabelMarginY;["left","right"].forEach(e=>{!function(e,t,a){const i=e.slice().sort((e,t)=>e.idealY-t.idealY);i.forEach(e=>{e.labelY=e.idealY});for(let e=1;e<i.length;e++)i[e].labelY-i[e-1].labelY<t&&(i[e].labelY=i[e-1].labelY+t);const s=i[i.length-1],n=s?s.labelY-a:0;if(n>0)for(let e=i.length-1;e>=0;e--)i[e].labelY-=n,e<i.length-1&&i[e+1].labelY-i[e].labelY<t&&(i[e].labelY=i[e+1].labelY-t)}(this.externalLabels.filter(t=>t.side===e),t,a)})}addListeners(e,t,a){const i=new f(this.w,this.ctx);e.node.addEventListener("mouseenter",i.pathMouseEnter.bind(i,e)),e.node.addEventListener("mouseleave",i.pathMouseLeave.bind(i,e)),e.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof a&&(e.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,a)),e.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),e.node.addEventListener("mousedown",i.pathMouseDown.bind(i,e)),this.donutDataLabels.total.showAlways||(e.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,e.node,t)))}animatePaths(e,t){const a=this.w;let i=t.endAngle<t.startAngle?this.fullAngle+t.endAngle-t.startAngle:t.endAngle-t.startAngle,s=i,n=t.startAngle;const r=t.startAngle;void 0!==t.prevStartAngle&&void 0!==t.prevEndAngle&&(n=t.prevEndAngle,s=t.prevEndAngle<t.prevStartAngle?this.fullAngle+t.prevEndAngle-t.prevStartAngle:t.prevEndAngle-t.prevStartAngle),t.i===a.config.series.length-1&&(i+r>this.fullAngle?t.endAngle=t.endAngle-(i+r):i+r<this.fullAngle&&(t.endAngle=t.endAngle+(this.fullAngle-(i+r)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(e,n,r,i,s,t)}animateArc(e,t,a,i,s,n){const r=this,l=this.w,o=new d(this.w),h=n.size;let c;(isNaN(t)||isNaN(s))&&(t=a,s=i,n.dur=0);let g=i,p=a;const f=t<a?this.fullAngle+t-a:t-a,u="number"==typeof n.prevSize;l.globals.dataChanged&&n.shouldSetPrevPaths&&n.prevEndAngle&&(c=r.getPiePath({me:r,startAngle:n.prevStartAngle,angle:n.prevEndAngle<n.prevStartAngle?this.fullAngle+n.prevEndAngle-n.prevStartAngle:n.prevEndAngle-n.prevStartAngle,size:u?n.prevSize:h}),e.attr({d:c})),0!==n.dur?e.animate(n.dur,n.animBeginArr[n.i]).after(function(){"pie"!==r.chartType&&"donut"!==r.chartType&&"polarArea"!==r.chartType||this.animate(l.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":r.strokeWidth}),n.i===l.config.series.length-1&&o.animationCompleted(e)}).during(l=>{g=f+(i-f)*l,n.animateStartingPos&&(g=s+(i-s)*l,p=t-s+(a-(t-s))*l),c=r.getPiePath({me:r,startAngle:p,angle:g,size:u?n.prevSize+(h-n.prevSize)*l:h}),e.node.setAttribute("data:pathOrig",c),e.attr({d:c})}):(c=r.getPiePath({me:r,startAngle:p,angle:i,size:h}),n.isTrack||(l.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",c),e.attr({d:c,"stroke-width":r.strokeWidth}))}pieClicked(e,t){const a=this.w,i=!(t&&!1===t.animate),s=a.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!s)return;if("true"===s.attr("data:pieClicked"))return s.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(e,0,i);const n=a.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(n,e=>{const t="true"===e.getAttribute("data:pieClicked");e.setAttribute("data:pieClicked","false"),t&&this.offsetSlice(parseInt(e.getAttribute("j"),10),0,i)}),a.interact.capturedDataPointIndex=e,s.attr("data:pieClicked","true"),this.offsetSlice(e,this.getExpandOffset(),i)}getExpandOffset(){const e=this.w.config.plotOptions.pie;if(!e.expandOnClick||"polarArea"===this.chartType)return 0;if(u.drilldownBlocksSliceOffset(this.w))return 0;const t=Number(e.expandOffset);return Number.isFinite(t)&&t>0?t:0}getSliceMovers(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return[t?t.node:null,this.sliceLabelGroups[e],this.externalLabelGroups[e],this.hoverOutlineIndex===e&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(e,t,a=!0){const i=this.w;if(!i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`))return;const{dx:s,dy:n}=this.getSliceOffsetVector(e,t),r=`translate(${s} ${n})`,l=a&&i.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(e).forEach(e=>{e.style.transition=l,e.setAttribute("transform",r)})}getSliceOffsetVector(e,t){const a=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`),i=a?parseFloat(a.attr("data:angle")):NaN;if(!t||!Number.isFinite(i)||i>=this.fullAngle)return{dx:0,dy:0};const s=parseFloat(a.attr("data:startAngle")),n=Math.PI*(s+i/2-90)/180;return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}showHoverOutline(e){const t=this.w;if(!u.hoverOutlineOwnsHoverState(t))return;if(!this.elHoverOutline)return;const a=this.getHoverOutlinePath(e);if(!a)return;const i=t.config.plotOptions.pie.hoverOutline,s=i.color||t.globals.colors[e];if(!this.elHoverOutlinePath){const e=new f(t);this.elHoverOutlinePath=e.drawPath({d:a,fill:s,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:a,fill:s,"fill-opacity":i.opacity});const{dx:n,dy:r}=this.getSliceOffsetVector(e,this.isSliceOut(e)?this.getExpandOffset():0);this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${n} ${r})`),this.hoverOutlineIndex=e,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}isSliceOut(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return!!t&&"true"===t.attr("data:pieClicked")}getHoverOutlinePath(e){const t=this.w,a=t.config.plotOptions.pie.hoverOutline,i=t.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!i)return null;const s=parseFloat(i.attr("data:angle"));if(!Number.isFinite(s)||s<=0)return null;const n=this.sliceSizes[e],r=Number(a.size);if(!Number.isFinite(n)||!Number.isFinite(r)||r<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(i.attr("data:startAngle")),angle:s,size:n});if(!(c>0))return null;const d=n+(this.strokeWidth||0)/2+(Number(a.gap)||0),g=d+r,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:g,a0:h,a1:h+c,spanDeg:c},f=Math.min(r/2,c*Math.PI/180/2*d);return f>.5?L(o(l({},p),{r:f})):function({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:n,spanDeg:r}){const l=(a,i)=>y(e,t,a,i),o=r>180?1:0,h=l(i,s),c=l(i,n),d=l(a,n),g=l(a,s);return["M",S(h),"A",i,i,0,o,1,S(c),"L",S(d),"A",a,a,0,o,0,S(g),"Z"].join(" ")}(p)}getChangedPath(e,t,a){let i="";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:e,angle:t-e,size:"number"==typeof a?a:this.size})),i}getSliceExtent({me:e,startAngle:t,angle:a,size:i}){const s=this.w;let n=t,r=a+t;Math.ceil(r)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(r=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let l=r-n;const o="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,h=s.config.plotOptions.pie.spacing;if(o&&h>0&&l>0){const t="donut"===e.chartType?(i+e.donutSize)/2:i,a=t>0?h/t*(180/Math.PI):0,s=Math.min(a/2,Math.max(0,l/2-.5));n+=s,l-=2*s}return r=n+l,Math.ceil(r)>this.fullAngle&&(r-=this.fullAngle),{startDeg:n,spanDeg:l,endDeg:r}}getPiePath({me:e,startAngle:t,angle:a,size:i}){let s;const n=this.w,r=new f(this.w),{startDeg:l,spanDeg:o,endDeg:h}=this.getSliceExtent({me:e,startAngle:t,angle:a,size:i}),c="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,d=Math.PI*(l-90)/180,g=n.config.plotOptions.pie.borderRadius;if(g>0&&c){const t=this.getRoundedSlicePath({me:e,startDeg:l,spanDeg:o,size:i,borderRadius:g});if(t)return t}const u=Math.PI*(h-90)/180,b=e.centerX+i*Math.cos(d),m=e.centerY+i*Math.sin(d),A=e.centerX+i*Math.cos(u),x=e.centerY+i*Math.sin(u),w=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,h),y=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,l),S=o>180?1:0,L=["M",b,m,"A",i,i,0,S,1,A,x];return s="donut"===e.chartType?[...L,"L",w.x,w.y,"A",e.donutSize,e.donutSize,0,S,0,y.x,y.y,"L",b,m,"z"].join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[...L,"L",e.centerX,e.centerY,"L",b,m].join(" "):[...L].join(" "),r.roundPathCorners(s,2*this.strokeWidth)}getRoundedSlicePath({me:e,startDeg:t,spanDeg:a,size:i,borderRadius:s}){if(!(a>0))return null;const n=Math.PI/180,r=e.centerX,l=e.centerY,o="donut"===e.chartType,h=i,c=o?e.donutSize:0,d=a*n;let g=s;if(g=Math.min(g,d*h/2),o?(g=Math.min(g,d*c/2),g=Math.min(g,(h-c)/2)):g=Math.min(g,h/2),!(g>.5))return null;const p=t,f=t+a;return o?L({cx:r,cy:l,rIn:c,rOut:h,a0:p,a1:f,r:g,spanDeg:a}):function({cx:e,cy:t,rOut:a,a0:i,a1:s,r:n,spanDeg:r}){const l=(a,i)=>y(e,t,a,i),o=n/a*w,h=l(a,i+o),c=l(a,s-o),d=r-2*o>180?1:0,g=l(a,s),p=l(a-n,s),f=l(a,i),u=l(a-n,i);return["M",S(h),"A",a,a,0,d,1,S(c),"Q",S(g),S(p),"L",`${e} ${t}`,"L",S(u),"Q",S(f),S(h),"Z"].join(" ")}({cx:r,cy:l,rOut:h,a0:p,a1:f,r:g,spanDeg:a})}drawPolarElements(e){const t=this.w,a=new b(this.w),i=new f(this.w),s=new m(this.w),n=i.group(),r=i.group(),l=a.niceScale(0,Math.ceil(this.maxY),0),o=l.result.reverse(),h=l.result.length;this.maxY=l.niceMax;let c=t.globals.radialSize;const d=c/(h-1);for(let e=0;e<h-1;e++){const a=i.drawCircle(c);if(a.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){const a=s.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,e,o[e]);r.add(a)}n.add(a),c-=d}this.drawSpokes(e),e.add(n),e.add(r)}renderInnerDataLabels(e,t,a){const i=this.w,s=new f(this.w),n=t.total.show;e.node.innerHTML="",e.node.style.opacity=a.opacity;const r=a.centerX,l=this.donutDataLabels.total.label?a.centerY:a.centerY-a.centerY/6;let o,h;o=void 0===t.name.color?i.globals.colors[0]:t.name.color;let c=t.name.fontSize,d=t.name.fontFamily,g=t.name.fontWeight;h=void 0===t.value.color?i.config.chart.foreColor:t.value.color;const p=t.value.formatter;let u="",b="";if(n?(o=t.total.color,c=t.total.fontSize,d=t.total.fontFamily,g=t.total.fontWeight,b=this.donutDataLabels.total.label?t.total.label:"",u=t.total.formatter(i)):1===i.seriesData.series.length&&(u=p(i.seriesData.series[0],i),b=i.seriesData.seriesNames[0]),b&&(b=t.name.formatter(b,t.total.show,i)),t.name.show){const a=s.drawText({x:r,y:l+parseFloat(t.name.offsetY),text:b,textAnchor:"middle",foreColor:o,fontSize:c,fontWeight:g,fontFamily:d});a.node.classList.add("apexcharts-datalabel-label"),e.add(a)}if(t.value.show){const a=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,i=s.drawText({x:r,y:l+a,text:u,textAnchor:"middle",foreColor:h,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});i.node.classList.add("apexcharts-datalabel-value"),e.add(i)}return e}printInnerLabels(e,t,a,i){const s=this.w;let n;i?n=void 0===e.name.color?s.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:e.name.color:s.seriesData.series.length>1&&e.total.show&&(n=e.total.color);const r=s.dom.baseEl.querySelector(".apexcharts-datalabel-label"),l=s.dom.baseEl.querySelector(".apexcharts-datalabel-value");a=(0,e.value.formatter)(a,s),i||"function"!=typeof e.total.formatter||(a=e.total.formatter(s));const o=t===e.total.label;if(t=this.donutDataLabels.total.label?e.name.formatter(t,o,s):"",null!==r&&(r.textContent=t),null!==l&&(l.textContent=a),null!==r){r.style.fill=n}}printDataLabelsInner(e,t){const a=this.w,i=e.getAttribute("data:value"),s=a.seriesData.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];a.seriesData.series.length>1&&this.printInnerLabels(t,s,i,e);const n=a.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==n){n.style.opacity="1"}}drawSpokes(e){const t=this.w,a=new f(this.w),i=t.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const s=[],n=360/t.seriesData.series.length;for(let e=0;e<t.seriesData.series.length;e++)s.push(p.polarToCartesian(this.centerX,this.centerY,t.globals.radialSize,t.config.plotOptions.pie.startAngle+n*e));s.forEach((t,s)=>{const n=a.drawLine(t.x,t.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[s]:i.connectorColors);e.add(n)})}revertDataLabelsInner(){const e=this.w;if(this.donutDataLabels.show){const t=e.dom.Paper.findOne(".apexcharts-datalabels-group"),a=this.renderInnerDataLabels(t,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});e.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(a)}}}const O=c.__apex_Series,z=c.__apex_BrowserAPIs_BrowserAPIs;c.default.use({radialBar:class extends v{constructor(e,t){super(e,t),this.ctx=t,this.w=e,this.animBeginArr=[0],this.animDur=0,this.startAngle=e.config.plotOptions.radialBar.startAngle,this.endAngle=e.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(e.config.plotOptions.radialBar.endAngle-e.config.plotOptions.radialBar.startAngle),this.trackStartAngle=e.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=e.config.plotOptions.radialBar.track.endAngle,this.barLabels=this.w.config.plotOptions.radialBar.barLabels,this.donutDataLabels=this.w.config.plotOptions.radialBar.dataLabels,this.radialDataLabels=this.donutDataLabels,this.trackStartAngle||(this.trackStartAngle=this.startAngle),this.trackEndAngle||(this.trackEndAngle=this.endAngle),360===this.endAngle&&(this.endAngle=359.99),this.margin=parseInt(e.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(e){var t;const a=this.w,i=new f(this.w),s=i.group({class:"apexcharts-radialbar"});if(a.globals.noData)return s;const n=i.group(),r=a.layout.gridHeight/2,l=a.layout.gridWidth/2;let o=this.defaultSize/2.05;a.config.chart.sparkline.enabled||(o=o-a.config.stroke.width-a.config.chart.dropShadow.blur);const h=a.globals.fill.colors,c=a.config.plotOptions.radialBar,d=Array.isArray(c.bands)&&c.bands.length>0,g=d&&c.bandsStyle&&c.bandsStyle.hideTrackWhenPresent,p="needle"===c.shape;if(c.track.show&&!g){const t=this.drawTracks({size:o,centerX:l,centerY:r,colorArr:h,series:e});n.add(t)}if(d){const t=this.drawBands({size:o,centerX:l,centerY:r,series:e});n.add(t)}const u=this.drawArcs({size:o,centerX:l,centerY:r,colorArr:h,series:e,skipValueArc:p&&!(null==(t=c.needle)?void 0:t.showValueArc)});if(c.ticks&&c.ticks.show){const t=this.drawTicks({size:o,centerX:l,centerY:r,series:e});if(this.initialAnim&&!a.globals.dataChanged&&!a.globals.resized&&A.isBrowser()&&a.globals.shouldAnimate){const e=t.node;e.style.opacity="0",e.style.transition="opacity 280ms ease-out";const i=a.config.chart.animations.speed||800;setTimeout(()=>{e.style.opacity="1"},i)}n.add(t)}if(p){const t=this.drawNeedle({size:o,centerX:l,centerY:r,series:e});n.add(t)}let b=360;a.config.plotOptions.radialBar.startAngle<0&&(b=this.totalAngle);const m=(360-b)/360;if(a.globals.radialSize=o-o*m,this.radialDataLabels.value.show){const e=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);a.globals.radialSize+=e*m}return n.add(u.g),"front"===a.config.plotOptions.radialBar.hollow.position&&(u.g.add(u.elHollow),u.dataLabels&&u.g.add(u.dataLabels)),s.add(n),s}drawTracks(e){const t=this.w,a=new f(this.w),i=a.group({class:"apexcharts-tracks"}),s=new u(this.w),n=new g(this.w),r=this.getStrokeWidth(e);e.size=e.size-r/2;for(let l=0;l<e.series.length;l++){const o=a.group({class:"apexcharts-radialbar-track apexcharts-track"});i.add(o),o.attr({rel:l+1}),e.size=e.size-r-this.margin;const h=t.config.plotOptions.radialBar.track,c=n.fillPath({seriesNumber:0,size:e.size,fillColors:Array.isArray(h.background)?h.background[l]:h.background,solid:!0}),d=this.trackStartAngle;let g=this.trackEndAngle;Math.abs(g)+Math.abs(d)>=360&&(g=360-Math.abs(this.startAngle)-.1);const p=a.drawPath({d:"",stroke:c,strokeWidth:r*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){const e=h.dropShadow;s.dropShadow(p,e)}o.add(p),p.attr("id","apexcharts-radialbarTrack-"+l),this.animatePaths(p,{centerX:e.centerX,centerY:e.centerY,endAngle:g,startAngle:d,size:e.size,i:l,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return i}drawArcs(e){var t;const a=this.w,i=new f(this.w),s=new g(this.w),n=new u(this.w),r=i.group(),l=this.getStrokeWidth(e);e.size=e.size-l/2;let o=a.config.plotOptions.radialBar.hollow.background;const h=e.size-l*e.series.length-this.margin*e.series.length-l*parseInt(a.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=h-a.config.plotOptions.radialBar.hollow.margin;void 0!==a.config.plotOptions.radialBar.hollow.image&&(o=this.drawHollowImage(e,r,h,o));const d=this.drawHollow({size:c,centerX:e.centerX,centerY:e.centerY,fill:o||"transparent"});if(a.config.plotOptions.radialBar.hollow.dropShadow.enabled){const e=a.config.plotOptions.radialBar.hollow.dropShadow;n.dropShadow(d,e)}let b=1;!this.radialDataLabels.total.show&&a.seriesData.series.length>1&&(b=0);let m=null;if(this.radialDataLabels.show){const t=a.dom.Paper.findOne(".apexcharts-datalabels-group");m=this.renderInnerDataLabels(t,this.radialDataLabels,{hollowSize:h,centerX:e.centerX,centerY:e.centerY,opacity:b})}"back"===a.config.plotOptions.radialBar.hollow.position&&(r.add(d),m&&r.add(m));let A=!1;a.config.plotOptions.radialBar.inverseOrder&&(A=!0);const x=!0===(null==(t=this.ctx.morphTypeChange)?void 0:t.isActive());for(let t=A?e.series.length-1:0;A?t>=0:t<e.series.length;A?t--:t++){const o=i.group({class:"apexcharts-series apexcharts-radial-series",seriesName:p.escapeString(a.seriesData.seriesNames[t])});r.add(o),o.attr({rel:t+1,"data:realIndex":t}),O.addCollapsedClassToSeries(this.w,o,t),e.size=e.size-l-this.margin;const h=s.fillPath({seriesNumber:t,size:e.size,value:e.series[t]}),c=this.startAngle;let d;const g=a.config.plotOptions.radialBar,u="number"==typeof g.min?g.min:0,b="number"==typeof g.max?g.max:100,m=b===u?1:b-u,A=e=>{const t=Math.min(Math.max(e,u),b);return Math.max(0,(t-u)/m)},w=A(p.negToZero(e.series[t]));let y,S=Math.round(this.totalAngle*w)+this.startAngle;a.globals.dataChanged&&(d=this.startAngle,y=Math.round(this.totalAngle*A(p.negToZero(a.globals.previousPaths[t])))+d);Math.abs(S)+Math.abs(c)>360&&(S-=.01);Math.abs(y)+Math.abs(d)>360&&(y-=.01);const L=S-c,v=Array.isArray(a.config.stroke.dashArray)?a.config.stroke.dashArray[t]:a.config.stroke.dashArray,z=x?this.ctx.morphTypeChange.getInitialPathFor(t,0):null,C=x?this.ctx.morphTypeChange.getFromType():null,k=!!z&&("bar"===C||"funnel"===C||"pyramid"===C||"pie"===C||"donut"===C||"polarArea"===C),P=i.drawPath({d:z||"",stroke:k||e.skipValueArc?"transparent":h,strokeWidth:k||e.skipValueArc?0:l,fill:k?h:"none",fillOpacity:a.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+t,strokeDashArray:v}),T=c+L/2,Y=p.polarToCartesian(e.centerX,e.centerY,e.size,T);if(f.setAttrs(P.node,{"data:angle":L,"data:value":e.series[t],"data:cx":Y.x,"data:cy":Y.y}),a.config.chart.dropShadow.enabled){const e=a.config.chart.dropShadow;n.dropShadow(P,e,t)}if(n.setSelectionFilter(P,0,t),this.addListeners(P,this.radialDataLabels),o.add(P),P.attr({index:0,j:t}),this.barLabels.enabled){const s=p.polarToCartesian(e.centerX,e.centerY,e.size,c),n=this.barLabels.formatter(a.seriesData.seriesNames[t],{seriesIndex:t,w:a}),r=["apexcharts-radialbar-label"];this.barLabels.onClick||r.push("apexcharts-no-click");let l=this.barLabels.useSeriesColors?a.globals.colors[t]:a.config.chart.foreColor;l||(l=a.config.chart.foreColor);const h=s.x+this.barLabels.offsetX,d=s.y+this.barLabels.offsetY,g=i.drawText({x:h,y:d,text:n,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:l,cssClass:r.join(" ")});g.on("click",this.onBarLabelClick),g.attr({rel:t+1}),0!==c&&g.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),o.add(g)}let D=0;if(!this.initialAnim||a.globals.resized||a.globals.dataChanged||(D=a.config.chart.animations.speed),a.globals.dataChanged&&(D=a.config.chart.animations.dynamicAnimation.speed),this.animDur=D/(1.2*e.series.length)+this.animDur,this.animBeginArr.push(this.animDur),x&&z){const t=this.ctx.morphTypeChange.getSpeed(),a=this.getPiePath({me:this,startAngle:c,angle:L,size:e.size});if(k){const i=this.ctx.morphTypeChange.buildRingSegmentPath(e.centerX,e.centerY,e.size,l,c,c+L);P.animate(t).plot(i,"polygons").after(function(){this.attr({d:a,fill:"none",stroke:e.skipValueArc?"transparent":h,"stroke-width":e.skipValueArc?0:l})})}else P.animate(t).plot(a,"polygons").attr({"stroke-width":l})}else this.animatePaths(P,{centerX:e.centerX,centerY:e.centerY,endAngle:S,startAngle:c,prevEndAngle:y,prevStartAngle:d,size:e.size,i:t,totalItems:2,animBeginArr:this.animBeginArr,dur:D,shouldSetPrevPaths:!0})}return{g:r,elHollow:d,dataLabels:m}}_angleAtValue(e){const t=this.w.config.plotOptions.radialBar,a="number"==typeof t.min?t.min:0,i="number"==typeof t.max?t.max:100,s=i===a?a+1:i,n=(Math.max(a,Math.min(s,Number(e)))-a)/(s-a);return this.startAngle+n*(this.endAngle-this.startAngle)}_describeArc(e,t,a,i,s){const n=p.polarToCartesian(e,t,a,s),r=p.polarToCartesian(e,t,a,i),l=s-i,o=Math.abs(l)>180?1:0;return`M ${n.x} ${n.y} A ${a} ${a} 0 ${o} 0 ${r.x} ${r.y}`}drawBands(e){const t=this.w,a=new f(this.w),i=t.config.plotOptions.radialBar,s=i.bands||[],n=a.group({class:"apexcharts-gauge-bands"}),r=this.getStrokeWidth(e),l=e.size-r/2-r-this.margin,o=r*parseInt(i.bandsStyle.strokeWidth,10)/100,h="number"==typeof i.min?i.min:0,c="number"==typeof i.max?i.max:100,d=c===h?0:(i.bandsStyle.gap||0)*((this.endAngle-this.startAngle)/(c-h));for(let t=0;t<s.length;t++){const r=s[t];if(void 0===r.from||void 0===r.to)continue;const h=this._angleAtValue(r.from),c=this._angleAtValue(r.to),g=Math.min(h,c)+d/2,p=Math.max(h,c)-d/2;if(p-g<=0)continue;const f=a.drawPath({d:this._describeArc(e.centerX,e.centerY,l,g,p),stroke:r.color||"#ccc",strokeWidth:o,fill:"none",strokeLinecap:i.bandsStyle.linecap||"butt",classes:"apexcharts-gauge-band"});f.node.setAttribute("data-band-index",String(t)),n.add(f)}return n}drawTicks(e){var t,a,i,s;const n=this.w,r=new f(this.w),l=n.config.plotOptions.radialBar,o=l.ticks,h=r.group({class:"apexcharts-gauge-ticks"}),c=this.getStrokeWidth(e),d=e.size-c/2-c-this.margin,g="number"==typeof l.min?l.min:0,u="number"==typeof l.max?l.max:100,b=Math.max(2,null!=(a=null==(t=o.major)?void 0:t.count)?a:11),m=Math.max(0,null!=(s=null==(i=o.minor)?void 0:i.count)?s:0),A=(t,a,i)=>{var s,n,l;const c=this._angleAtValue(t),g=null!=(s=a.length)?s:8,f="inside"===a.placement?d-g:d,u="inside"===a.placement?d:d+g,b=p.polarToCartesian(e.centerX,e.centerY,f,c),m=p.polarToCartesian(e.centerX,e.centerY,u,c),A=r.drawLine(b.x,b.y,m.x,m.y,a.color||(i?"#666":"#999"),0,a.width||(i?2:1));if(h.add(A),i&&(null==(n=o.labels)?void 0:n.show)){const i=("inside"===a.placement?f:u)+("inside"===a.placement?-1:1)*(null!=(l=o.labels.offset)?l:6),s=p.polarToCartesian(e.centerX,e.centerY,i,c),n="function"==typeof o.labels.formatter?o.labels.formatter(t):String(t),d=r.drawText({x:s.x,y:s.y,text:n,textAnchor:"middle",dominantBaseline:"middle",fontFamily:o.labels.fontFamily,fontSize:o.labels.fontSize,fontWeight:o.labels.fontWeight,foreColor:o.labels.color,cssClass:"apexcharts-gauge-tick-label"});h.add(d)}};for(let e=0;e<b;e++){if(A(g+e/(b-1)*(u-g),o.major||{},!0),e<b-1&&m>0)for(let t=1;t<=m;t++){A(g+(e+t/(m+1))/(b-1)*(u-g),o.minor||{},!1)}}return h}drawNeedle(e){var t,a,i,s,n;const r=this.w,l=new f(this.w),o=r.config.plotOptions.radialBar.needle||{},h=l.group({class:"apexcharts-gauge-needle"});if(!e.series||0===e.series.length)return h;const c=this.getStrokeWidth(e),d=e.size-c/2-c-this.margin,g="string"==typeof o.length&&o.length.endsWith("%")?d*parseInt(o.length,10)/100:Number(o.length||.85*d),p=null!=(t=o.baseWidth)?t:4,u=null!=(a=o.tipWidth)?a:1,b=o.color||"#333",m=e.centerX,x=Number(null!=(i=o.offsetY)?i:0),w=e.centerY+x,y=`M ${m+p/2} ${w} A ${p/2} ${p/2} 0 0 1 ${m-p/2} ${w} L ${m-u/2} ${w-g} L ${m+u/2} ${w-g} Z`,S=l.drawPath({d:y,stroke:b,strokeWidth:0,fill:b,classes:"apexcharts-gauge-needle-shape"});h.add(S);const L=Number(e.series[0]),v=this._angleAtValue(L),O=this.initialAnim&&!r.globals.dataChanged&&!r.globals.resized,C=this.ctx,k="number"==typeof C._lastNeedleAngle?C._lastNeedleAngle:this.startAngle;C._lastNeedleAngle=v;if(A.isBrowser()&&r.globals.shouldAnimate&&(O||r.globals.dataChanged)&&k!==v){const e=h.node;e.setAttribute("transform-origin",`${m} ${w}`),e.setAttribute("transform",`rotate(${k})`);const t=(null==(s=o.animation)?void 0:s.duration)&&Number(o.animation.duration)||o.animationSpeed&&Number(o.animationSpeed)||(null==(n=r.config.chart.animations.dynamicAnimation)?void 0:n.speed)||r.config.chart.animations.speed||800,a=1.70158,i=a+1,l=O?e=>1+i*Math.pow(e-1,3)+a*Math.pow(e-1,2):e=>1-Math.pow(1-e,3);null!=r.globals.radialNeedleRAF&&(z.cancelAnimationFrame(r.globals.radialNeedleRAF),r.globals.radialNeedleRAF=null);const c=performance.now(),d=a=>{if(this.w.globals.isDestroyed)return void(r.globals.radialNeedleRAF=null);const i=Math.max(0,Math.min(1,(a-c)/t)),s=k+(v-k)*l(i);e.setAttribute("transform",`rotate(${s})`),r.globals.radialNeedleRAF=i<1?z.requestAnimationFrame(d):null};r.globals.radialNeedleRAF=z.requestAnimationFrame(d)}else h.attr({"transform-origin":`${m} ${w}`,transform:`rotate(${v})`});return h}drawHollow(e){var t;const a=new f(this.w),i=this.w.config.plotOptions.radialBar.hollow,s=a.drawCircle(2*e.size),n={class:"apexcharts-radialbar-hollow",cx:e.centerX,cy:e.centerY,r:e.size,fill:e.fill};return(i.stroke||i.strokeDasharray)&&(n.stroke=i.stroke||"transparent",n["stroke-width"]=null!=(t=i.strokeWidth)?t:1,i.strokeDasharray&&(n["stroke-dasharray"]=i.strokeDasharray)),s.attr(n),s}drawHollowImage(e,t,a,i){const s=this.w,n=new g(this.w),r=p.randomId(),l=s.config.plotOptions.radialBar.hollow.image;if(s.config.plotOptions.radialBar.hollow.imageClipped)n.clippedImgArea({width:a,height:a,image:l,patternID:`pattern${s.globals.cuid}${r}`}),i=`url(#pattern${s.globals.cuid}${r})`;else{const a=s.config.plotOptions.radialBar.hollow.imageWidth,i=s.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===a&&void 0===i){const a=s.dom.Paper.image(l,function(t){this.move(e.centerX-t.width/2+s.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-t.height/2+s.config.plotOptions.radialBar.hollow.imageOffsetY)});t.add(a)}else{const n=s.dom.Paper.image(l,function(){this.move(e.centerX-a/2+s.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-i/2+s.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(a,i)});t.add(n)}}return i}getStrokeWidth(e){const t=this.w;return e.size*(100-parseInt(t.config.plotOptions.radialBar.hollow.size,10))/100/(e.series.length+1)-this.margin}onBarLabelClick(e){var t;const a=e.target,i=parseInt(null!=(t=a.getAttribute("rel"))?t:"",10)-1,s=this.barLabels.onClick,n=this.w;s&&s(n.seriesData.seriesNames[i],{w:n,seriesIndex:i})}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|