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/unit.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,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,i,a)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,o=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&n(t,i,e[i]);if(a)for(var i of a(e))r.call(e,i)&&n(t,i,e[i]);return t},l=(t,a)=>e(t,i(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const a=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const u=c(require("apexcharts/core")),h=1/45;function d(t,e,i,a){return{value:t,velocity:0,target:t,stiffness:e,damping:i}}function m(t,e){if(e<=0)return p(t);let i=e;for(;i>0;){const e=Math.min(i,h),a=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=a*e,t.value+=t.velocity*e,i-=e}return!!p(t)&&(t.value=t.target,t.velocity=0,!0)}function f(t,e){t.target=e}function p(t){var e,i;const a=null!=(e=t.restVelocity)?e:.05,s=null!=(i=t.restDisplacement)?i:.05;return Math.abs(t.velocity)<a&&Math.abs(t.value-t.target)<s}const x={crisp:[210,26],gentle:[120,20],snappy:[320,30]};const g=u.__apex_Graphics,y="__apexcharts_unit_layouts__";function b(t){return t&&globalThis[y][t]||null}globalThis[y]||(globalThis[y]={});const M="__apexcharts_unit_marks__";function _(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const i=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!i.every(t=>isFinite(t))||i[2]<=0||i[3]<=0?null:Object.freeze(l(o({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:i,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function A(t){return t&&globalThis[M][t]||null}globalThis[M]||(globalThis[M]={});const w=u.__apex_Utils,S=u.__apex_Environment_Environment,R=u.__apex_BrowserAPIs_BrowserAPIs,k=u.__apex_Animations_prefersReducedMotion;const F=Math.PI*(3-Math.sqrt(5));function v(t){return 1-Math.pow(1-t,3)}function E(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function D(t,e){const[i,a]=null!=(r=x[null!=(s=t)?s:"crisp"])?r:x.crisp;var s,r;const n=800/Math.max(1,e);return[i*n*n,a*n]}u.default.use({unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,i=new g(e,this.ctx),a=i.group({class:"apexcharts-unit"});if(e.globals.noData||!Array.isArray(t)||0===t.length)return a;const s=e.config.plotOptions.unit,r="packed"===s.layout?"packed":"columns"===s.layout?"columns":"grid"===s.layout?"grid":"scatter"===s.layout?"scatter":"arc"===s.layout?"arc":"custom"===s.layout?"custom":"grouped",n=s.transition,o="flow"===n,l="identity"===n,c=s.unitValue>0?s.unitValue:1;let u=t.map(t=>{const e=Math.abs(w.parseNumber(t))/c;return e>0?Math.max(1,Math.round(e)):0});u=this._applyMaxUnits(u,s.maxUnits);const h=u.reduce((t,e)=>t+e,0),d="packed"===r?this._layoutPacked(u,s):"columns"===r?this._layoutColumns(u,s):"grid"===r?this._layoutGrid(u,s):"scatter"===r?this._layoutScatter(s):"arc"===r?this._layoutArc(u,s):"custom"===r?this._layoutCustom(u,s):this._layoutGrouped(u,s),m="grid"===r&&!(!s.grid||!s.grid.split);m&&this._drawGridTrack(a,i,s),"scatter"===r&&this._drawScatterAxes(a,i);const f=this._lastDotR,p=this._shouldAnimate(),x=this.ctx&&this.ctx.morphTypeChange,y=p&&!!x&&"function"==typeof x.isActive&&x.isActive()&&"function"==typeof x.getInitialCenterFor,b=y&&"function"==typeof x.getInitialSlotFor,M=y&&"function"==typeof x.usesPieceTakeover&&x.usesPieceTakeover(),_=p&&!y&&this.ctx?this.ctx._unitPrevDots:null,A=new Map,S=[],R=e.seriesData.unitData||[],k=this._bubbleStats(R,s,f);let F=0;if(d.forEach(t=>{const n=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",c=i.group({class:"apexcharts-series",seriesName:w.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),d=y&&!b?x.getInitialCenterFor(t.i):null,g=t.dots.length,v=R[t.i];if(t.dots.forEach((e,a)=>{const r=null!=e.j?e.j:a,u=v?v[r]:void 0,h=u&&"object"==typeof u&&u.fillColor?u.fillColor:n,y=null!=e.r?e.r:k?this._radiusForValue(this._unitValueOf(u),k):f,w=this._markSpecFor(s,u,t.i,y),R=this._drawDot(i,s,y,h,t.i,r,w);let E;if(c.add(R),l){const t=u&&"object"==typeof u?null!=u.id?u.id:u.name:void 0;E=null!=t?`id:${t}`:`g:${F}`}else E=o?String(F):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(F++,A.set(E,{x:e.x,y:e.y,fill:h,r:y,spec:w}),M)this._place(R.node,w,e.x,e.y),R.node.setAttribute("opacity","0"),R.node.setAttribute("data-piece-hidden","1");else if(p){const i=_&&_.get(E),a=i||(b?x.getInitialSlotFor(t.i,r,g):d),n=s.gather&&s.gather.enter||"burst",o=m||"fade"===n||"rise"===n,l=a?a.x:o?e.x:t.cx,c=a?a.y:"rise"!==n||m?o?e.y:t.cy:e.y+14;R.node.style.opacity=a?"1":"0",this._place(R.node,w,l,c),S.push({node:R.node,spec:w,x:e.x,y:e.y,cx0:l,cy0:c,key:E,r0:i&&null!=i.r?i.r:y,r1:y,fill0:i?i.fill:h,fill1:h,delay:0,isEnter:!a})}else this._place(R.node,w,e.x,e.y)}),("grouped"===r||"columns"===r||m)&&s.clusterLabels&&s.clusterLabels.show&&u[t.i]>0){const e=m?this._gridDenom:h;this._drawClusterLabel(c,t,u[t.i],e,s,n)}a.add(c)}),this._outerLabelsOn(s)&&this._drawOuterLabels(a,d,u,h,s,p&&!_),_){const t=this._collectExits(_,A,s);if(t.length){const e=i.group({class:"apexcharts-unit-exits"});a.add(e),this._runExits(e,t,s)}}return this.ctx&&(this.ctx._unitPrevDots=A),!this.ctx||p&&!y||(this.ctx._unitSprings=null),p&&S.length?this._runGather(S):e.globals.animationEnded=!0,a}_applyMaxUnits(t,e){const i=t.reduce((t,e)=>t+e,0);if(!e||e<=0||i<=e)return t;const a=e/i;return t.map(t=>t>0?Math.max(1,Math.round(t*a)):0)}_layoutCustom(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),n=this._resolveLayoutProvider(e);if(!n)return this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,a-2*o),height:s},c=Math.sqrt(l.width*l.height/Math.PI),u=this._resolveStep(e,c,r);this._lastDotR=this._dotRadiusFromStep(u,e);const h=this._lastDotR,d=this._layoutObjects(t,h);let m;try{m=n(d,l)}catch(i){return this._layoutGrouped(t,e)}if(!Array.isArray(m))return this._layoutGrouped(t,e);const f=new Map;m.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&f.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const p=t.map((t,e)=>({i:e,cx:a/2,cy:s/2,outerR:h,dots:[]}));return d.forEach(t=>{const e=f.get(t.id);e&&p[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),p.forEach(t=>{if(!t.dots.length)return;let e=0,i=0;t.dots.forEach(t=>{e+=t.x,i+=t.y}),t.cx=e/t.dots.length,t.cy=i/t.dots.length;let a=0;t.dots.forEach(e=>{a=Math.max(a,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=a+h}),p}_layoutObjects(t,e){const i=this.w,a=i.seriesData.unitData||[],s=i.seriesData.seriesNames||[],r=[];let n=0;return t.forEach((t,i)=>{var o;const l=a[i];for(let a=0;a<t;a++){const t=l?l[a]:void 0,c=!t||"object"!=typeof t||null==t.id&&null==t.name?`${i}:${a}`:String(null!=t.id?t.id:t.name);r.push({id:c,index:n,seriesIndex:i,dataPointIndex:a,label:s[i],value:null!=(o=this._unitValueOf(t))?o:void 0,datum:t,r:e}),n++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=b(e);if(t)return t}return null}_layoutGrouped(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,n=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,n.length),l=new Array(t.length).fill(-1);n.forEach((t,e)=>l[t]=e);const c=a/o,u=s-r,h=Math.max(1,...t),d=.08*Math.min(c,u),m=Math.max(4,Math.min(c,u)/2-d),f=this._resolveStep(e,m,h);this._lastDotR=this._dotRadiusFromStep(f,e);const p=this._lastDotR,x=r+u/2,g=t.map(t=>f*Math.sqrt(Math.max(1,t))+p);let y=t.map((t,e)=>(t=>l[t]>=0?c*(l[t]+.5):a/2)(e));const b=n.map(t=>g[t]);let M=!1;for(let t=1;t<o;t++)if(y[n[t]]-y[n[t-1]]<b[t]+b[t-1]){M=!0;break}if(M){const e=Math.max(2*p,8),i=b.reduce((t,e)=>t+2*e,0)+e*(o-1);let s;if(i<=a){let t=(a-i)/2;s=b.map(i=>{const a=t+i;return t+=2*i+e,a})}else if(1===o)s=[a/2];else{const t=b[0],e=a-b[o-1];s=b.map((i,a)=>t+(e-t)*a/(o-1))}y=t.map((t,e)=>l[e]>=0?s[l[e]]:a/2)}return t.map((t,e)=>({i:e,cx:y[e],cy:x,outerR:g[e],dots:this._spiral(y[e],x,t,f,0)}))}_layoutPacked(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=Math.max(4,Math.min(a,s-6)/2-.06*Math.min(a,s)),o=this._resolveStep(e,n,r);this._lastDotR=this._dotRadiusFromStep(o,e);const l=a/2,c=6+(s-6)/2,u=t.map((t,e)=>e);!1!==e.sortByGroup&&u.sort((e,i)=>t[e]-t[i]);const h=t.map((t,e)=>({i:e,cx:l,cy:c,outerR:o*Math.sqrt(r)+this._lastDotR,dots:[]}));let d=0;return u.forEach(e=>{for(let i=0;i<t[e];i++){const t=o*Math.sqrt(d+.5),i=d*F;h[e].dots.push({x:l+t*Math.cos(i),y:c+t*Math.sin(i),slot:d}),d++}}),h}_layoutArc(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=e.arc||{},o="number"==typeof n.startAngle?n.startAngle:-90,l="number"==typeof n.endAngle?n.endAngle:90,c=o*Math.PI/180,u=l*Math.PI/180,h=u-c||Math.PI,d=Math.max(0,Math.min(.95,"number"==typeof n.innerRadiusRatio?n.innerRadiusRatio:.4)),m=t=>Math.sin(t),f=t=>-Math.cos(t),p=this._arcBounds(c,u),x=.04*Math.min(a,s),g=Math.max(1e-6,p.maxX-p.minX),y=Math.max(1e-6,p.maxY-p.minY),b=Math.max(4,Math.min((a-2*x)/g,(s-2*x)/y)),M=b*d,_=a/2-(p.minX+p.maxX)/2*b,A=s/2-(p.minY+p.maxY)/2*b,w=this._arcAllocate(r,M,b,h,e);this._lastDotR=w.dotR;const S=[];for(let t=0;t<w.R;t++){const e=w.radii[t],i=w.seatsPerRow[t];for(let t=0;t<i;t++){const a=1===i?(c+u)/2:c+h*(t+.5)/i;S.push({a:a,x:_+e*m(a),y:A+e*f(a)})}}S.sort((t,e)=>t.a-e.a);const R=t.map((t,e)=>({i:e,cx:_,cy:A,outerR:b,dots:[]}));let k=0,F=0;return S.forEach((e,i)=>{for(;k<t.length&&F>=t[k];)k++,F=0;k>=t.length||(R[k].dots.push({x:e.x,y:e.y,slot:i}),F++)}),R}_arcBounds(t,e){const i=t=>Math.sin(t),a=t=>-Math.cos(t),s=Math.min(t,e),r=Math.max(t,e),n=[0,i(t),i(e)],o=[0,a(t),a(e)],l=Math.PI/2;for(let t=Math.ceil(s/l);t*l<=r;t++)n.push(i(t*l)),o.push(a(t*l));return{minX:Math.min(...n),maxX:Math.max(...n),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,i,a,s){const r=s.spacing>0?s.spacing:1.05,n=Math.abs(a)||Math.PI,o=this._fixedRadius(s),l=a=>{a=Math.max(1,Math.round(a));const s=[];for(let t=0;t<a;t++)s.push(1===a?(e+i)/2:e+t/(a-1)*(i-e));const o=s.reduce((t,e)=>t+e,0)||1,l=s.map(e=>t*e/o),c=l.map(t=>Math.floor(t));let u=t-c.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{u>0&&(c[t.idx]++,u--)});u>0;)c[a-1]++,u--;const h=1===a?i-e||i:(i-e)/(a-1);let d=1/0;for(let t=0;t<a;t++){const e=c[t];if(e<=0)continue;const i=s[t]*n/e;i<d&&(d=i)}const m=Math.min(h,d);return{R:a,radii:s,seatsPerRow:c,dotR:Math.max(1,m/(2*r))}},c=s.arc&&s.arc.rows;let u;if("number"==typeof c&&c>=1)u=l(c);else if(o){u=l((i-e)/(2*o*r)+1)}else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));u=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>u.dotR&&(u=e)}}return o&&(u.dotR=o),u}_layoutColumns(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),n=r&&"bottom"===e.clusterLabels.position,o=r&&!n?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),c=Math.max(1,l.length),u=new Array(t.length).fill(-1);l.forEach((t,e)=>u[t]=e);const h=a/c,d=.62*h,m=Math.max(8,.04*s)+(n?30:0),f=Math.max(4,s-o-m),p=Math.max(1,...t),x=e.spacing>0?e.spacing:1,g=e.columns?e.columns.size:void 0;let y;y="image"!==e.shape&&"auto"===g?null:"image"!==e.shape&&"number"==typeof g&&g>0?g:this._fixedRadius(e);let b=1,M=0;if(y){M=2*y*x,this._lastDotR=y;const t=Math.max(1,Math.floor(f/M)),e=Math.max(1,Math.floor(d/M));b=Math.max(1,Math.min(e,Math.ceil(p/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(d/4)));for(let i=1;i<=e;i++){const e=Math.ceil(p/i),a=Math.min(d/i,f/e);a>t&&(t=a,b=i)}M=t,this._lastDotR=Math.max(1,M/(2*x))}const _=this._lastDotR,A=Math.ceil(p/b),w=o+(f+Math.min(f,A*M))/2;return t.map((t,e)=>{const i=u[e]>=0?h*(u[e]+.5):a/2,s=Math.ceil(Math.max(1,t)/b)*M,r=i-b*M/2+M/2,n=[];for(let e=0;e<t;e++){const t=Math.floor(e/b),i=e%b;n.push({x:r+i*M,y:w-_-t*M})}return{i:e,cx:i,cy:w-s/2,outerR:s/2,flat:!0,dots:n}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),c=l.reduce((t,e)=>t+e,0),u=Math.max(1,Math.ceil(Math.max(1,c)/n)),h=e.spacing>0?e.spacing:1,d=Math.max(4,a),m=Math.max(4,s-6),f=this._fixedRadius(e);let p=0;f?(p=2*f*h,this._lastDotR=f):(p=Math.min(d/n,m/u),this._lastDotR=Math.max(1,p/(2*h)));const x=n*p,g=u*p,y=(a-x)/2+p/2,b=6+(m-g)/2,M=t=>"bottom"===o?b+g-p/2-t*p:b+p/2+t*p,_=t.map((t,e)=>({i:e,cx:a/2,cy:6+m/2,outerR:Math.max(x,g)/2,dots:[]}));let A=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=A%n,i=Math.floor(A/n);_[t].dots.push({x:y+e*p,y:M(i),slot:A}),A++}return _}_layoutGridSplit(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),c=Math.max(1,Math.ceil(l/n)),u=t.map((t,e)=>e).filter(e=>t[e]>0),h=Math.max(1,u.length),d=r.max>0?r.max:Math.max(1,...t),m=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(h)))),f=Math.max(1,Math.ceil(h/m)),p=!(e.clusterLabels&&!1===e.clusterLabels.show),x=p&&e.clusterLabels&&"bottom"===e.clusterLabels.position,g=p&&!x?22:4,y=p&&x?22:4,b=a/m,M=s/f,_=Math.max(4,.86*b),A=Math.max(4,M-g-y),w=e.spacing>0?e.spacing:1,S=this._fixedRadius(e);let R=0;S?(R=2*S*w,this._lastDotR=S):(R=Math.min(_/n,A/c),this._lastDotR=Math.max(1,R/(2*w)));const k=n*R,F=c*R,v=(t,e)=>"bottom"===o?t+F-R/2-e*R:t+R/2+e*R,E=[],D=[];return u.forEach((e,i)=>{const a=i%m,s=Math.floor(i/m),r=a*b,o=r+(b-k)/2+R/2,c=s*M+g+(A-F)/2,u=t=>({x:o+t%n*R,y:v(c,Math.floor(t/n))});for(let t=0;t<l;t++)E.push(u(t));const h=Math.max(0,Math.min(l,Math.round(t[e]/d*l))),f=[];for(let t=0;t<h;t++){const e=u(t);f.push({x:e.x,y:e.y,slot:i*l+t})}D.push({i:e,cx:r+b/2,cy:c+F/2,outerR:F/2,flat:!0,split:!0,dots:f})}),this._gridDenom=d,this._gridTrack={cells:E},D}_drawGridTrack(t,e,i){const a=this._gridTrack;if(!a||!a.cells||!a.cells.length)return;const s=this._lastDotR,r=(i.grid||{}).trackColor||"rgba(128,128,128,0.14)",n=e.group({class:"apexcharts-unit-track"});a.cells.forEach(t=>{let a;if("square"===i.shape){const n=2*s;a=e.drawRect(0,0,n,n,i.borderRadius||0,r,1,0,"none"),a.node.setAttribute("fill",r),a.node.setAttribute("x",String(t.x-s)),a.node.setAttribute("y",String(t.y-s))}else a=e.drawCircle(s,{fill:r,"stroke-width":0,stroke:"none"}),a.node.setAttribute("fill",r),a.node.setAttribute("cx",String(t.x)),a.node.setAttribute("cy",String(t.y));a.node.classList.add("apexcharts-unit-track-cell"),n.add(a)}),t.add(n)}_layoutScatter(t){const e=this.w,i=t.scatter||{};if("value"===i.y)return this._layoutScatter2D(t);if("vertical"===i.orientation)return this._layoutScatterVertical(t);const a=e.layout.gridWidth,s=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),c=r.map(t=>Array.isArray(t)?t.map(o):[]),u=t=>null!=t&&isFinite(t),h=c.map((t,e)=>e).filter(t=>c[t].some(u)),d=Math.max(1,h.length);let m=1/0,f=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<m&&(m=t),t>f&&(f=t))})),m===1/0&&(m=0,f=1);const p=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),x=this._scatterValueDomain(i,m,f,p),g=x.min,y=x.max,b=y-g||1,M=null!=i.laneLabelWidth?Math.max(0,i.laneLabelWidth):d>1?92:8,_=30+(i.xTitle?20:0),A=M,w=a-8,S=s-_,R=Math.max(4,w-A),k=Math.max(4,S-10),F=t=>A+(t-g)/b*R,v=k/d;let E=0;const D=this._fixedRadius(t);if(D)E=D;else{const t=Math.max(1,...h.map(t=>c[t].filter(u).length));E=Math.max(2,Math.min(6,.12*v,R/(2.5*Math.sqrt(t))))}this._lastDotR=E;const L=t.spacing>0?t.spacing:1,T=Math.max(.5,E*L),C="jitter"===i.spread,$=[],B=[],z=l?l.rMax:E;h.forEach((t,e)=>{const i=(t=>10+v*(t+.5))(e);B.push({i:t,cy:i,name:n[t]||`series-${t+1}`});const a=(r[t]||[]).map((t,e)=>{const a=o(t),s={j:e,px:F(u(a)?a:g),y:i};return l&&(s.r=this._scatterRadius(t,l,E)),s});if(C){const t=Math.max(z,v/2-z);a.forEach((e,a)=>{const s=(9301*a+49297)%233280/233280;e.y=i+(2*s-1)*t})}else this._beeswarm(a,i,E,T,z);$.push({i:t,cx:(A+w)/2,cy:i,outerR:v/2,dots:a.map(t=>({x:t.px,y:t.y,r:t.r}))})});const O=x.ticks;return this._scatterAxis={mode:"1d",plotL:A,plotR:w,plotT:10,plotB:S,xMin:g,xMax:y,plotX:F,ticks:O,lanes:B,xTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},$}_layoutScatterVertical(t){const e=this.w,i=t.scatter||{},a=e.layout.gridWidth,s=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),c=r.map(t=>Array.isArray(t)?t.map(o):[]),u=t=>null!=t&&isFinite(t),h=c.map((t,e)=>e).filter(t=>c[t].some(u)),d=Math.max(1,h.length);let m=1/0,f=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<m&&(m=t),t>f&&(f=t))})),m===1/0&&(m=0,f=1);const p=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),x=this._scatterValueDomain(i,m,f,p),g=x.min,y=x.max,b=y-g||1,M=46+(i.xTitle?18:0),_=a-10,A=s-(d>1?26:10),w=Math.max(4,_-M),S=Math.max(4,A-10),R=t=>A-(t-g)/b*S,k=w/d;let F=0;const v=this._fixedRadius(t);if(v)F=v;else{const t=Math.max(1,...h.map(t=>c[t].filter(u).length));F=Math.max(2,Math.min(6,.12*k,S/(2.5*Math.sqrt(t))))}this._lastDotR=F;const E=t.spacing>0?t.spacing:1,D=Math.max(.5,F*E),L="jitter"===i.spread,T=[],C=[],$=l?l.rMax:F;h.forEach((t,e)=>{const i=(t=>M+k*(t+.5))(e);C.push({i:t,cx:i,name:n[t]||`series-${t+1}`});const a=(r[t]||[]).map((t,e)=>{const a=o(t),s={j:e,py:R(u(a)?a:g),x:i};return l&&(s.r=this._scatterRadius(t,l,F)),s});if(L){const t=Math.max($,k/2-$);a.forEach((e,a)=>{const s=(9301*a+49297)%233280/233280;e.x=i+(2*s-1)*t})}else this._beeswarm(a,i,F,D,$,!0);T.push({i:t,cx:i,cy:(10+A)/2,outerR:k/2,dots:a.map(t=>({x:t.x,y:t.py,r:t.r}))})});const B=x.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:M,plotR:_,plotT:10,plotB:A,vMin:g,vMax:y,plotY:R,ticks:B,lanes:C,valueTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},T}_layoutScatter2D(t){const e=this.w,i=e.layout.gridWidth,a=e.layout.gridHeight,s=t.scatter||{},r=e.seriesData.unitData||[],n=t=>"number"==typeof t&&isFinite(t),o=t=>t&&"object"==typeof t?t.x:null,l=t=>t&&"object"==typeof t?null!=t.y?t.y:t.value:null,c=r.map((t,e)=>e).filter(t=>(r[t]||[]).some(t=>n(o(t))&&n(l(t))));let u=1/0,h=-1/0,d=1/0,m=-1/0;r.forEach(t=>(t||[]).forEach(t=>{const e=o(t),i=l(t);n(e)&&n(i)&&(e<u&&(u=e),e>h&&(h=e),i<d&&(d=i),i>m&&(m=i))})),u===1/0&&(u=0,h=1,d=0,m=1);const f=Math.max(2,Math.round(s.tickAmount>0?s.tickAmount:5)),p=Math.max(2,Math.round(s.yTickAmount>0?s.yTickAmount:5)),x=this._niceScale(null!=s.xMin?s.xMin:u,null!=s.xMax?s.xMax:h,f),g=this._niceScale(null!=s.yMin?s.yMin:d,null!=s.yMax?s.yMax:m,p),y=null!=s.xMin?s.xMin:x.min,b=null!=s.xMax?s.xMax:x.max,M=null!=s.yMin?s.yMin:g.min,_=null!=s.yMax?s.yMax:g.max,A=b-y||1,w=_-M||1,S=46+(s.yTitle?18:0),R=30+(s.xTitle?20:0),k=S,F=i-12,v=a-R,E=Math.max(4,F-k),D=Math.max(4,v-10),L=t=>k+(t-y)/A*E,T=t=>v-(t-M)/w*D,C=this._scatterSizeStats(s,r),$=this._fixedRadius(t)||5;this._lastDotR=$;const B=[];c.forEach(t=>{const e=(r[t]||[]).map(t=>{const e=o(t),i=l(t);return{x:L(n(e)?e:y),y:T(n(i)?i:M),r:C?this._scatterRadius(t,C,$):void 0}});B.push({i:t,cx:(k+F)/2,cy:(10+v)/2,outerR:D/2,dots:e})});const z=(t,e,i,a,s,r)=>{const n=[];if(s)for(let e=0;e<r;e++)n.push(t+i*e/(r-1));else{const s=a||i/Math.max(1,r-1);for(let i=t;i<=e+.5*s;i+=s)n.push(Math.abs(i)<1e-9*s?0:i)}return n};return this._scatterAxis={mode:"2d",plotL:k,plotR:F,plotT:10,plotB:v,plotX:L,plotY:T,xTicks:z(y,b,A,x.spacing,null!=s.xMin||null!=s.xMax,f),yTicks:z(M,_,w,g.spacing,null!=s.yMin||null!=s.yMax,p),xTitle:s.xTitle,yTitle:s.yTitle,xFormatter:"function"==typeof s.xFormatter?s.xFormatter:null,yFormatter:"function"==typeof s.yFormatter?s.yFormatter:null,gridlines:!1!==s.gridlines},B}_scatterSizeStats(t,e){const i=t&&t.sizeRange;if(!Array.isArray(i)||i.length<2)return null;const a=Math.max(.5,+i[0]),s=Math.max(a,+i[1]),r=t.sizeField||"z";let n=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<n&&(n=e),e>o&&(o=e))})),n===1/0?null:{zmin:n,zmax:o,rMin:a,rMax:s,field:r}}_scatterRadius(t,e,i){if(!e)return i;const a=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof a||!isFinite(a))return e.rMin;const s=e.zmax>e.zmin?(a-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,s)),n=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(n+r*(o-n))}_beeswarm(t,e,i,a,s,r=!1){const n=r?"py":"px",o=r?"x":"y",l=t.slice().sort((t,e)=>t[n]-e[n]),c=[],u=null!=s?s:i;l.forEach(t=>{const s=null!=t.r?t.r:i;let r=0;for(let i=0;i<2e3;i++){const o=0===i?0:Math.ceil(i/2)*a*(i%2?1:-1),l=e+o;let h=!0;for(let e=c.length-1;e>=0;e--){const i=c[e],a=t[n]-i.f;if(a>s+u)break;const r=s+i.r,o=l-i.s;if(a*a+o*o<r*r){h=!1;break}}if(h){r=o;break}}t[o]=e+r,c.push({f:t[n],s:t[o],r:s})})}_scatterValueDomain(t,e,i,a){const s=(t,e,i)=>{const a=[];for(let s=t;s<=e+.5*i;s+=i)a.push(Math.abs(s)<1e-9*i?0:s);return a};if(null!=t.xMin||null!=t.xMax){let r=null!=t.xMin?t.xMin:e,n=null!=t.xMax?t.xMax:i;n>r||(n=r+1);const o=(n-r)/Math.max(1,a-1);return e<r&&(r-=Math.ceil((r-e)/o)*o),i>n&&(n+=Math.ceil((i-n)/o)*o),{min:r,max:n,ticks:s(r,n,o)}}const r=this._niceScale(e,i,a),n=r.spacing||(r.max-r.min)/Math.max(1,a-1);return{min:r.min,max:r.max,ticks:s(r.min,r.max,n)}}_niceScale(t,e,i){const a=t;let s=e;s>a||(s=a+1);const r=this._niceNum(s-a,!1),n=this._niceNum(r/Math.max(1,i-1),!0);return{min:Math.floor(a/n)*n,max:Math.ceil(s/n)*n,spacing:n}}_niceNum(t,e){const i=t>0?t:1,a=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,a);let r;return r=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,r*Math.pow(10,a)}_drawScatterAxes(t,e){const i=this.w;if(!S.isBrowser())return;const a=this._scatterAxis;if(!a)return;const s="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),n=i.config.grid&&i.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=i.config.xaxis&&i.config.xaxis.labels&&i.config.xaxis.labels.style&&i.config.xaxis.labels.style.colors,c=Array.isArray(l)?l[0]:l,u=c||"rgba(120,130,140,0.9)",h=(t,e,i,a,n)=>{const o=R.createElementNS(s,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(i)),o.setAttribute("y2",String(a)),o.setAttribute("stroke",n),o.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(o)},d=(t,e,a,n,o,l,c,u)=>{const h=R.createElementNS(s,"text");h.setAttribute("class",u),h.setAttribute("x",String(e)),h.setAttribute("y",String(a)),h.setAttribute("text-anchor",n),h.setAttribute("dominant-baseline","middle"),h.setAttribute("font-size",`${l}px`),h.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),h.setAttribute("font-weight",String(c)),h.setAttribute("fill",o),h.textContent=t,r.node.appendChild(h)};if("2d"!==a.mode){if("vertical"===a.orientation){if(a.ticks.forEach(t=>{const e=a.plotY(t);a.gridlines&&h(a.plotL,e,a.plotR,e,n);const i=a.formatter?String(a.formatter(t)):this._formatTick(t);d(i,a.plotL-8,e,"end",u,11,400,"apexcharts-unit-tick")}),h(a.plotL,a.plotT,a.plotL,a.plotB,o),a.valueTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(a.plotT+a.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",u),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(a.valueTitle),r.node.appendChild(t)}return a.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,t.cx,a.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}a.ticks.forEach((t,e)=>{const i=a.plotX(t);a.gridlines&&h(i,a.plotT,i,a.plotB,n);const s=a.formatter?String(a.formatter(t)):this._formatTick(t),r=0===e?"start":e===a.ticks.length-1?"end":"middle";d(s,i,a.plotB+14,r,u,11,400,"apexcharts-unit-tick")}),h(a.plotL,a.plotB,a.plotR,a.plotB,o),a.xTitle&&d(String(a.xTitle),(a.plotL+a.plotR)/2,a.plotB+32,"middle",u,12,600,"apexcharts-unit-axis-title"),a.plotL>12&&a.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,a.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(a.yTicks.forEach(t=>{const e=a.plotY(t);a.gridlines&&h(a.plotL,e,a.plotR,e,n);const i=a.yFormatter?String(a.yFormatter(t)):this._formatTick(t);d(i,a.plotL-8,e,"end",u,11,400,"apexcharts-unit-tick")}),a.xTicks.forEach(t=>{const e=a.plotX(t);a.gridlines&&h(e,a.plotT,e,a.plotB,n);const i=a.xFormatter?String(a.xFormatter(t)):this._formatTick(t);d(i,e,a.plotB+14,"middle",u,11,400,"apexcharts-unit-tick")}),h(a.plotL,a.plotB,a.plotR,a.plotB,o),h(a.plotL,a.plotT,a.plotL,a.plotB,o),a.xTitle&&d(String(a.xTitle),(a.plotL+a.plotR)/2,a.plotB+32,"middle",u,12,600,"apexcharts-unit-axis-title"),a.yTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(a.plotT+a.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",u),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(a.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t){if(!isFinite(t))return"";const e=Math.abs(t);return e>=1e6?+(t/1e6).toFixed(1)+"M":e>=1e4?+(t/1e3).toFixed(1)+"k":Number.isInteger(t)?String(t):String(+t.toFixed(2))}_largestRemainder(t,e){const i=t.reduce((t,e)=>t+e,0);if(i<=0||e<=0)return t.map(()=>0);const a=t.map(t=>t/i*e),s=a.map(t=>Math.floor(t)),r=s.reduce((t,e)=>t+e,0),n=Math.max(0,e-r),o=a.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=s.slice();for(let t=0;t<n&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,i,a,s){const r=[];for(let n=0;n<i;n++){const i=s+n,o=a*Math.sqrt(i+.5),l=i*F;r.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){if("number"==typeof t)return t;if(t&&"object"==typeof t){const e=null!=t.value?t.value:t.y;return"number"==typeof e?e:null}return null}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const i=e.max>e.min?(t-e.min)/(e.max-e.min):1,a=Math.max(0,Math.min(1,i));if("linear"===e.scale)return e.minR+a*(e.maxR-e.minR);const s=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(s+a*(r-s))}_bubbleStats(t,e,i){if(!this._bubbleActive(e))return null;let a=1/0,s=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<a&&(a=e),e>s&&(s=e))})}),a===1/0||s<a)return null;const r=e.sizeByValue,n=i,o=Math.max(1,Math.min(n,"number"==typeof r.minRadius?r.minRadius:.35*n));return{min:a,max:s,minR:o,maxR:n,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,i){const a=t.spacing>0?t.spacing:1,s=this._fixedRadius(t);return s?2*s*a:e/(Math.sqrt(Math.max(1,i))+.5)}_dotRadiusFromStep(t,e){const i=e.spacing>0?e.spacing:1,a=this._fixedRadius(e);return a||Math.max(1,t/(2*i))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const i=null!=e?e:this._lastDotR;return{hx:i,hy:i}}_place(t,e,i,a){const s=e;2===s.pk?t.setAttribute("transform","translate("+(i-s.ox)+","+(a-s.oy)+s.tail):1===s.pk?(t.setAttribute("x",String(i-s.hx)),t.setAttribute("y",String(a-s.hy))):(t.setAttribute("cx",String(i)),t.setAttribute("cy",String(a)))}_baseSpec(t,e){const i=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:i};const{hx:a,hy:s}=this._halfExtent(t,i);return{pk:1,hx:a,hy:s,r:i}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return _(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return _(e);const i=A(e);return i||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||this._markWarned.add(e),null)}_glyphSpec(t,e,i){const a=Math.round(10*e)/10,s=t.name+"|"+t.path.length+"|"+a,r=this._specCache.get(s);if(r)return r;const n=t.viewBox||[0,0,100,100],o=2*a*(1-Math.max(0,Math.min(.9,i.padding||0)))*("number"==typeof i.scale&&i.scale>0?i.scale:1),l="width"===i.fit?o/n[2]:"height"===i.fit?o/n[3]:o/Math.max(n[2],n[3]),c=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(n[0]+n[2]/2)*l,oy:(n[1]+n[3]/2)*l,tail:") scale("+l+")",r:a});return this._specCache.set(s,c),c}_markSpecFor(t,e,i,a){if("pictogram"!==t.shape)return this._baseSpec(t,a);const s=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,n=Array.isArray(s.mark)?s.mark[i%s.mark.length]:s.mark,c=this._resolveMark(null!=r?r:n);return c?this._glyphSpec(c,a,s):this._baseSpec(l(o({},t),{shape:"square"===s.fallback?"square":"circle"}),a)}_drawDot(t,e,i,a,s,r,n){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,c=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[s]||"none",u="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let h;if(n&&2===n.pk)h=o.dom.Paper.path(n.d),h.node.setAttribute("fill",a),"evenodd"===n.fillRule&&h.node.setAttribute("fill-rule","evenodd"),u<1&&h.node.setAttribute("fill-opacity",String(u)),h.node.setAttribute("data:r",String(n.r));else if("image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,i=e.image.height||20;h=o.dom.Paper.image(e.image.src),h.node.setAttribute("width",String(t)),h.node.setAttribute("height",String(i)),h.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&h.node.setAttribute("filter",`url(#${this._tintFilter(a)})`)}else if("square"===e.shape){const s=2*i;h=t.drawRect(0,0,s,s,e.borderRadius||0,a,1,l,c),h.node.setAttribute("fill",a),u<1&&h.node.setAttribute("fill-opacity",String(u))}else h=t.drawCircle(i,{fill:a,"stroke-width":l,stroke:c}),h.node.setAttribute("fill",a),u<1&&h.node.setAttribute("fill-opacity",String(u));return h.node.classList.add("apexcharts-unit-area"),h.node.setAttribute("i",String(s)),h.node.setAttribute("j",String(r)),h}_tintFilter(t){const e=this.w,i="http://www.w3.org/2000/svg",a=String(t).replace(/[^a-zA-Z0-9]/g,""),s=`apexcharts-unit-tint-${e.globals.chartID}-${a}`,r=e.dom.Paper.node;if(r.querySelector(`#${s}`))return s;let n=r.querySelector("defs");n||(n=R.createElementNS(i,"defs"),r.insertBefore(n,r.firstChild));const o=R.createElementNS(i,"filter");o.setAttribute("id",s),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=R.createElementNS(i,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const c=R.createElementNS(i,"feComposite");return c.setAttribute("in","flood"),c.setAttribute("in2","SourceAlpha"),c.setAttribute("operator","in"),o.appendChild(l),o.appendChild(c),n.appendChild(o),s}_placeDot(t,e,i,a,s){this._place(t,s||this._baseSpec(e),i,a)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const i=e.match(/rgba?\(([^)]+)\)/);if(i){const t=i[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!!S.isBrowser()&&(!(!e||!1===e.enabled)&&(!1!==t.globals.shouldAnimate&&(!(t.globals.resized&&!t.globals.dataChanged)&&(!e.respectReducedMotion||!k()))))}_seedSprings(t,e,i){const[a,s]=D(e.spring,i),r=this.ctx?this.ctx._unitSprings:null,n=new Map;for(let e=0;e<t.length;e++){const i=t[e],o=r&&!i.isEnter&&null!=i.key?r.get(i.key):null,l=o?o.x:d(i.cx0,a,s),c=o?o.y:d(i.cy0,a,s);o&&(l.stiffness=a,c.stiffness=a,l.damping=s,c.damping=s,i.cx0=l.value,i.cy0=c.value,this._place(i.node,i.spec,i.cx0,i.cy0),0===l.velocity&&0===c.velocity||(i.delay=0)),i.sx=l,i.sy=c,null!=i.key&&n.set(i.key,{x:l,y:c})}this.ctx&&(this.ctx._unitSprings=n)}_runGather(t){const e=this.w,i=e.config.plotOptions.unit,a=Math.max(1,e.config.chart.animations.speed||800),s=Math.min(.6*a,450),r=t.length;for(let e=0;e<r;e++)t[e].delay=r>1?e/(r-1)*s:0;const n=i.gather||{},o=n.motion||"auto";"spring"===o||"auto"===o&&(!n.easing||"outCubic"===n.easing)?this._seedSprings(t,n,a):this.ctx&&(this.ctx._unitSprings=null);for(let e=0;e<r;e++){const i=t[e];0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r0))}for(let e=0;e<r;e++){const i=t[e];i.fill0&&i.fill1&&i.fill0!==i.fill1&&(i._c0=this._rgb(i.fill0),i._c1=this._rgb(i.fill1))}const l="outBack"===n.easing?(c="number"==typeof n.overshoot?n.overshoot:1.70158,t=>1+(c+1)*Math.pow(t-1,3)+c*Math.pow(t-1,2)):"inOutCubic"===n.easing?E:v;var c;null!=this.w.globals.unitGatherRAF&&(R.cancelAnimationFrame(this.w.globals.unitGatherRAF),this.w.globals.unitGatherRAF=null);const u=performance.now();let h=u;const d=e=>{if(this.w.globals.isDestroyed)return this.w.globals.unitGatherRAF=null,void(this.w.globals.animationEnded=!0);const i=Math.min(.25,Math.max(0,(e-h)/1e3));h=e;let s=!0;for(let n=0;n<r;n++){const r=t[n],o=e-u-r.delay,c=Math.max(0,Math.min(1,o/a)),h=v(c);let d,p;if(r.sx&&r.sy){o>=0&&!r.released&&(f(r.sx,r.x),f(r.sy,r.y),r.released=!0);const t=m(r.sx,i),e=m(r.sy,i);r.released&&t&&e||(s=!1),d=r.sx.value,p=r.sy.value}else{const t=l(c);d=r.cx0+(r.x-r.cx0)*t,p=r.cy0+(r.y-r.cy0)*t}if(this._place(r.node,r.spec,d,p),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*c))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*h),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*h),i=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*h);r.node.setAttribute("fill",`rgb(${t},${e},${i})`)}0===r.spec.pk&&null!=r.r0&&null!=r.r1&&r.r0!==r.r1&&r.node.setAttribute("r",String(r.r0+(r.r1-r.r0)*h)),c<1&&(s=!1)}if(s){for(let e=0;e<r;e++){const i=t[e];i.node.style.opacity="",i._c1&&i.fill1&&i.node.setAttribute("fill",i.fill1),0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r1))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)};this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)}_collectExits(t,e,i){const a=Math.max(0,i.maxUnits||5e3),s=[];for(const[i,r]of t)if(!e.has(i)&&(s.push(r),s.length>=a))break;return s}_runExits(t,e,i){const a=this.w,s=new g(a,this.ctx),r=this._lastDotR,n=a.layout.gridWidth/2,o=a.layout.gridHeight/2,l="grid"===i.layout||"scatter"===i.layout||"arc"===i.layout||"custom"===i.layout?0:.35,c=[];if(e.forEach(e=>{const a=null!=e.r?e.r:r,n=e.spec||this._baseSpec(i,a),o=this._drawDot(s,i,a,e.fill,0,0,n);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,n,e.x,e.y),t.add(o),c.push({node:o.node,x0:e.x,y0:e.y,spec:n})}),!this._shouldAnimate())return void c.forEach(t=>t.node.remove());const u=Math.max(1,a.config.chart.animations.speed||800);null!=this.w.globals.unitExitRAF&&(R.cancelAnimationFrame(this.w.globals.unitExitRAF),this.w.globals.unitExitRAF=null);const h=performance.now(),d=e=>{if(this.w.globals.isDestroyed)return void(this.w.globals.unitExitRAF=null);const i=Math.max(0,Math.min(1,(e-h)/u)),a=v(i);for(let t=0;t<c.length;t++){const e=c[t];if(l){const t=e.x0+(n-e.x0)*a*l,i=e.y0+(o-e.y0)*a*l;this._place(e.node,e.spec,t,i)}e.node.style.opacity=String(1-a)}i<1?this.w.globals.unitExitRAF=R.requestAnimationFrame(d):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=R.requestAnimationFrame(d)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,i,a){const s=this.w,r=s.seriesData.seriesNames[t]||`series-${t+1}`,n=i>0?e/i*100:0,o=a.clusterLabels,l="function"==typeof o.formatter?o.formatter(r,{seriesIndex:t,value:e,percent:n,w:s}):`${r}\n${n.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const i=this.w,a=e.clusterLabels,s=a.external.connector||{},r=t.reduce((t,e)=>t+e,0),n=[];if(t.forEach((t,i)=>{t>0&&n.push(...this._outerLabelLines(i,t,r,e))}),!n.length)return 0;const o=function(t,e,i={}){const a=new g(t),s=i.fontSize||"12px",r=parseFloat(s)||12;let n=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=a.getTextRects(e,s,i.fontFamily,"").width;n=Math.max(n,o>0?o:e.length*r*.58)}),n}(i,n,{fontSize:a.fontSize,fontFamily:a.fontFamily||i.config.chart.fontFamily}),l=o+(null!=s.gap?s.gap:8)+(null!=s.length?s.length:22)+8+Math.abs(parseFloat(a.external.offsetX)||0);return Math.min(l,.25*i.layout.gridWidth)}_drawOuterLabels(t,e,i,a,s,r){const n=this.w;if(!S.isBrowser())return;const o=s.clusterLabels,l=o.external,c=l.connector||{},u=null!=c.gap?c.gap:8,h=null!=c.length?c.length:22,d=parseFloat(l.offsetX)||0,m=parseFloat(l.offsetY)||0,f=n.layout.gridWidth,p=n.layout.gridHeight,x=this._lastDotR,y=e.filter(t=>t.dots.length>0);if(!y.length)return;let b=0,M=0;if(y.length>1){const t=y.map(t=>t.cx),e=y.map(t=>t.cy);b=Math.max(...t)-Math.min(...t),M=Math.max(...e)-Math.min(...e)}const _=b>M,A=parseFloat(o.fontSize)||13,w=Math.round(1.35*A),R=[];if(y.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,i[t.i],a,s);if(!r.some(t=>""!==t))return;const n=_?t.cx>=f/2?"right":"left":e%2==0?"right":"left",o="right"===n?1:-1;let l=t.dots[0],c=-1/0;t.dots.forEach(e=>{const i=o*e.x-.75*Math.abs(e.y-t.cy);i>c&&(c=i,l=e)});const p={x:l.x+o*(l.r||x),y:l.y},g={x:p.x+o*u,y:p.y};R.push({i:t.i,lines:r,anchor:p,elbow:g,labelX:g.x+o*h+d,idealY:p.y+m,labelY:p.y+m,side:n})}),!R.length)return;const k=R.reduce((t,e)=>Math.max(t,e.lines.length),1)*w,F=k/2;["left","right"].forEach(t=>{!function(t,e,i,a){const s=t.slice().sort((t,e)=>t.idealY-e.idealY);s.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<s.length;t++)s[t].labelY-s[t-1].labelY<e&&(s[t].labelY=s[t-1].labelY+e);const r=s[s.length-1],n=r?r.labelY-i:0;if(n>0)for(let t=s.length-1;t>=0;t--)s[t].labelY-=n,t<s.length-1&&s[t+1].labelY-s[t].labelY<e&&(s[t].labelY=s[t+1].labelY-e);if(null!=a&&s.length&&s[0].labelY<a){const t=a-s[0].labelY;for(let e=0;e<s.length;e++)s[e].labelY+=t}}(R.filter(e=>e.side===t),k+2,p-F,F)});const v=new g(n,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,n.config.chart.animations.speed||800);v.node.classList.add("apexcharts-unit-label-delay"),v.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}R.forEach(t=>{const e=n.globals.colors[t.i]||n.globals.colors[0]||"#008FFB";v.add(function(t,e){const{lines:i,lineHeight:a,anchor:s,elbow:r,labelX:n,labelY:o,side:l,connector:c,style:u,foreColor:h}=e,d=new g(t),m=d.group({class:e.groupClass||"apexcharts-outer-label-group"});if(c.show){const t=`M ${s.x} ${s.y} L ${r.x} ${r.y} L ${n} ${o}`,i=d.drawPath({d:t,stroke:c.color,strokeWidth:c.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),m.add(i)}const f="right"===l?n+4:n-4,p=i.length,x=o-(p-1)*a/2,y=d.drawText({x:f,y:x,text:1===p?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:u.fontSize,fontFamily:u.fontFamily,fontWeight:u.fontWeight,foreColor:h,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(p>1){const t=y.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${f}`),t[e].setAttribute("dy",0===e?"0":`${a}`)}return m.add(y),m}(n,{lines:t.lines,lineHeight:w,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==c.show,width:null!=c.width?c.width:1.5,color:c.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||n.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||n.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(v)}_drawClusterLabel(t,e,i,a,s,r){const n=this.w;if(!S.isBrowser())return;const o="http://www.w3.org/2000/svg",l=n.seriesData.seriesNames[e.i]||`series-${e.i+1}`,c=a>0?i/a*100:0,u=s.clusterLabels,h=parseFloat(u.fontSize)||13;let d;d="function"==typeof u.formatter?u.formatter(l,{seriesIndex:e.i,value:i,percent:c,w:n}):`${l} (${c.toFixed(1)}%)`;const m="string"==typeof d?d:String(d),f=R.createElementNS(o,"text");f.setAttribute("class","apexcharts-unit-label"),f.setAttribute("text-anchor","middle"),f.setAttribute("font-size",`${h}px`),f.setAttribute("font-family",u.fontFamily||n.config.chart.fontFamily||"inherit"),f.setAttribute("font-weight",String(u.fontWeight||600)),f.setAttribute("fill",u.color||r);const p="bottom"===u.position,x=e.outerR+.6*h+3+(u.offsetY||0),g=m.length*h*.55;if(!p&&!e.flat&&!1!==u.curved&&g<=Math.PI*x*.95){const i=e.cy,a=`M ${e.cx-x} ${i} A ${x} ${x} 0 0 1 ${e.cx+x} ${i}`,s=`apexcharts-unit-label-${n.globals.chartID}-${e.i}`,r=R.createElementNS(o,"path");r.setAttribute("id",s),r.setAttribute("d",a),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=R.createElementNS(o,"textPath");l.setAttribute("href",`#${s}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${s}`),l.setAttribute("startOffset","50%"),l.textContent=m,f.appendChild(l),t.node.appendChild(r)}else{f.setAttribute("x",String(e.cx));const t=p?e.cy+e.outerR+h+6+(u.offsetY||0):e.cy-e.outerR-6-(u.offsetY||0);f.setAttribute("y",String(t)),f.textContent=m}t.node.appendChild(f)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>u.default});
|
package/dist/unit.esm.js
CHANGED
|
@@ -18,38 +18,38 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* ApexCharts v7.
|
|
21
|
+
* ApexCharts v7.4.0
|
|
22
22
|
* (c) 2018-2026 ApexCharts
|
|
23
23
|
*/
|
|
24
24
|
import * as _core from "apexcharts/core";
|
|
25
25
|
import _core__default from "apexcharts/core";
|
|
26
26
|
import { default as default2 } from "apexcharts/core";
|
|
27
|
-
const
|
|
28
|
-
function
|
|
27
|
+
const D = 0.05, K = 0.05, O = 1 / 45;
|
|
28
|
+
function $(e, t, s, i) {
|
|
29
29
|
const n = { value: e, velocity: 0, target: e, stiffness: t, damping: s };
|
|
30
30
|
return n;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (t <= 0) return
|
|
32
|
+
function q(e, t) {
|
|
33
|
+
if (t <= 0) return W(e);
|
|
34
34
|
let s = t;
|
|
35
35
|
for (; s > 0; ) {
|
|
36
|
-
const t2 = Math.min(s,
|
|
36
|
+
const t2 = Math.min(s, O), i = -e.stiffness * (e.value - e.target) - e.damping * e.velocity;
|
|
37
37
|
e.velocity += i * t2, e.value += e.velocity * t2, s -= t2;
|
|
38
38
|
}
|
|
39
|
-
return !!
|
|
39
|
+
return !!W(e) && (e.value = e.target, e.velocity = 0, true);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function _(e, t) {
|
|
42
42
|
e.target = t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function W(e) {
|
|
45
45
|
var _a, _b;
|
|
46
|
-
const t = (_a = e.restVelocity) != null ? _a :
|
|
46
|
+
const t = (_a = e.restVelocity) != null ? _a : D, s = (_b = e.restDisplacement) != null ? _b : K;
|
|
47
47
|
return Math.abs(e.velocity) < t && Math.abs(e.value - e.target) < s;
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
49
|
+
const V = { crisp: [210, 26], gentle: [120, 20], snappy: [320, 30] };
|
|
50
|
+
function z(e) {
|
|
51
51
|
var _a;
|
|
52
|
-
return (_a =
|
|
52
|
+
return (_a = V[e != null ? e : "crisp"]) != null ? _a : V.crisp;
|
|
53
53
|
}
|
|
54
54
|
const Graphics = _core.__apex_Graphics;
|
|
55
55
|
const LAYOUT_KEY = "__apexcharts_unit_layouts__";
|
|
@@ -226,7 +226,7 @@ const PK_CIRCLE = 0;
|
|
|
226
226
|
const PK_CORNER = 1;
|
|
227
227
|
const PK_GLYPH = 2;
|
|
228
228
|
function springParams(preset, speed) {
|
|
229
|
-
const [stiffness, damping] =
|
|
229
|
+
const [stiffness, damping] = z(
|
|
230
230
|
/** @type {import('apex-commons').SpringPreset|undefined} */
|
|
231
231
|
preset
|
|
232
232
|
);
|
|
@@ -301,12 +301,12 @@ class Unit {
|
|
|
301
301
|
const burstCount = cluster.dots.length;
|
|
302
302
|
const catData = unitData[cluster.i];
|
|
303
303
|
cluster.dots.forEach((d, jj) => {
|
|
304
|
-
const
|
|
305
|
-
const datum = catData ? catData[
|
|
304
|
+
const j = d.j != null ? d.j : jj;
|
|
305
|
+
const datum = catData ? catData[j] : void 0;
|
|
306
306
|
const dotFill = datum && typeof datum === "object" && datum.fillColor ? datum.fillColor : color;
|
|
307
307
|
const rj = d.r != null ? d.r : sizeStats ? this._radiusForValue(this._unitValueOf(datum), sizeStats) : dotR;
|
|
308
308
|
const spec = this._markSpecFor(opts, datum, cluster.i, rj);
|
|
309
|
-
const el = this._drawDot(graphics, opts, rj, dotFill, cluster.i,
|
|
309
|
+
const el = this._drawDot(graphics, opts, rj, dotFill, cluster.i, j, spec);
|
|
310
310
|
elSeries.add(el);
|
|
311
311
|
let key;
|
|
312
312
|
if (identity) {
|
|
@@ -317,7 +317,7 @@ class Unit {
|
|
|
317
317
|
} else if (d.slot != null) {
|
|
318
318
|
key = `slot:${d.slot}`;
|
|
319
319
|
} else {
|
|
320
|
-
key = `${cluster.i}:${
|
|
320
|
+
key = `${cluster.i}:${j}`;
|
|
321
321
|
}
|
|
322
322
|
gIndex++;
|
|
323
323
|
nextPrev.set(key, { x: d.x, y: d.y, fill: dotFill, r: rj, spec });
|
|
@@ -327,7 +327,7 @@ class Unit {
|
|
|
327
327
|
el.node.setAttribute("data-piece-hidden", "1");
|
|
328
328
|
} else if (animate) {
|
|
329
329
|
const from = prev && prev.get(key);
|
|
330
|
-
const anchor = from || (perRowBurst ? morph.getInitialSlotFor(cluster.i,
|
|
330
|
+
const anchor = from || (perRowBurst ? morph.getInitialSlotFor(cluster.i, j, burstCount) : burst);
|
|
331
331
|
const enter = opts.gather && opts.gather.enter || "burst";
|
|
332
332
|
const inPlace = gridSplit || enter === "fade" || enter === "rise";
|
|
333
333
|
const cx0 = anchor ? anchor.x : inPlace ? d.x : cluster.cx;
|
|
@@ -470,7 +470,7 @@ class Unit {
|
|
|
470
470
|
r: typeof p.r === "number" && p.r > 0 ? p.r : void 0
|
|
471
471
|
});
|
|
472
472
|
});
|
|
473
|
-
const clusters = counts.map((
|
|
473
|
+
const clusters = counts.map((_2, i) => ({
|
|
474
474
|
i,
|
|
475
475
|
cx: gw / 2,
|
|
476
476
|
cy: gh / 2,
|
|
@@ -526,14 +526,14 @@ class Unit {
|
|
|
526
526
|
counts.forEach((n, i) => {
|
|
527
527
|
var _a;
|
|
528
528
|
const catData = unitData[i];
|
|
529
|
-
for (let
|
|
530
|
-
const datum = catData ? catData[
|
|
531
|
-
const id = datum && typeof datum === "object" && (datum.id != null || datum.name != null) ? String(datum.id != null ? datum.id : datum.name) : `${i}:${
|
|
529
|
+
for (let j = 0; j < n; j++) {
|
|
530
|
+
const datum = catData ? catData[j] : void 0;
|
|
531
|
+
const id = datum && typeof datum === "object" && (datum.id != null || datum.name != null) ? String(datum.id != null ? datum.id : datum.name) : `${i}:${j}`;
|
|
532
532
|
objects.push({
|
|
533
533
|
id,
|
|
534
534
|
index,
|
|
535
535
|
seriesIndex: i,
|
|
536
|
-
dataPointIndex:
|
|
536
|
+
dataPointIndex: j,
|
|
537
537
|
label: names[i],
|
|
538
538
|
// Normalised at the boundary: internally "no value" is null, but the
|
|
539
539
|
// public object shape uses an absent property.
|
|
@@ -577,7 +577,7 @@ class Unit {
|
|
|
577
577
|
const gw = w.layout.gridWidth;
|
|
578
578
|
const gh = w.layout.gridHeight;
|
|
579
579
|
const labelSpace = opts.clusterLabels && opts.clusterLabels.show ? 30 : 6;
|
|
580
|
-
const visible = counts.map((
|
|
580
|
+
const visible = counts.map((_2, i) => i).filter((i) => counts[i] > 0);
|
|
581
581
|
const Kv = Math.max(1, visible.length);
|
|
582
582
|
const slotOf = new Array(counts.length).fill(-1);
|
|
583
583
|
visible.forEach((i, s) => slotOf[i] = s);
|
|
@@ -592,7 +592,7 @@ class Unit {
|
|
|
592
592
|
const cy = labelSpace + availH / 2;
|
|
593
593
|
const outerRs = counts.map((n) => step * Math.sqrt(Math.max(1, n)) + dotR);
|
|
594
594
|
const cellCentre = (i) => slotOf[i] >= 0 ? cellW * (slotOf[i] + 0.5) : gw / 2;
|
|
595
|
-
let centers = counts.map((
|
|
595
|
+
let centers = counts.map((_2, i) => cellCentre(i));
|
|
596
596
|
const visOuter = visible.map((i) => outerRs[i]);
|
|
597
597
|
let overlap = false;
|
|
598
598
|
for (let s = 1; s < Kv; s++) {
|
|
@@ -617,10 +617,10 @@ class Unit {
|
|
|
617
617
|
} else {
|
|
618
618
|
const lo = visOuter[0];
|
|
619
619
|
const hi = gw - visOuter[Kv - 1];
|
|
620
|
-
visCenters = visOuter.map((
|
|
620
|
+
visCenters = visOuter.map((_2, s) => lo + (hi - lo) * s / (Kv - 1));
|
|
621
621
|
}
|
|
622
622
|
centers = counts.map(
|
|
623
|
-
(
|
|
623
|
+
(_2, i) => slotOf[i] >= 0 ? visCenters[slotOf[i]] : gw / 2
|
|
624
624
|
);
|
|
625
625
|
}
|
|
626
626
|
return counts.map((n, i) => ({
|
|
@@ -652,11 +652,11 @@ class Unit {
|
|
|
652
652
|
this._lastDotR = this._dotRadiusFromStep(step, opts);
|
|
653
653
|
const cx = gw / 2;
|
|
654
654
|
const cy = labelSpace + (gh - labelSpace) / 2;
|
|
655
|
-
const order = counts.map((
|
|
655
|
+
const order = counts.map((_2, i) => i);
|
|
656
656
|
if (opts.sortByGroup !== false) {
|
|
657
657
|
order.sort((a, b) => counts[a] - counts[b]);
|
|
658
658
|
}
|
|
659
|
-
const clusters = counts.map((
|
|
659
|
+
const clusters = counts.map((_2, i) => ({
|
|
660
660
|
i,
|
|
661
661
|
cx,
|
|
662
662
|
cy,
|
|
@@ -666,7 +666,7 @@ class Unit {
|
|
|
666
666
|
}));
|
|
667
667
|
let gi = 0;
|
|
668
668
|
order.forEach((catI) => {
|
|
669
|
-
for (let
|
|
669
|
+
for (let j = 0; j < counts[catI]; j++) {
|
|
670
670
|
const r = step * Math.sqrt(gi + 0.5);
|
|
671
671
|
const theta = gi * GOLDEN_ANGLE;
|
|
672
672
|
clusters[catI].dots.push({
|
|
@@ -728,7 +728,7 @@ class Unit {
|
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
seats.sort((s1, s2) => s1.a - s2.a);
|
|
731
|
-
const clusters = counts.map((
|
|
731
|
+
const clusters = counts.map((_2, i) => ({
|
|
732
732
|
i,
|
|
733
733
|
cx,
|
|
734
734
|
cy,
|
|
@@ -789,11 +789,11 @@ class Unit {
|
|
|
789
789
|
const spacing = opts.spacing > 0 ? opts.spacing : 1.05;
|
|
790
790
|
const absSpan = Math.abs(span) || Math.PI;
|
|
791
791
|
const fixed = this._fixedRadius(opts);
|
|
792
|
-
const evalR = (
|
|
793
|
-
|
|
792
|
+
const evalR = (R) => {
|
|
793
|
+
R = Math.max(1, Math.round(R));
|
|
794
794
|
const radii = [];
|
|
795
|
-
for (let r = 0; r <
|
|
796
|
-
radii.push(
|
|
795
|
+
for (let r = 0; r < R; r++) {
|
|
796
|
+
radii.push(R === 1 ? (r0 + r1) / 2 : r0 + (r1 - r0) * (r / (R - 1)));
|
|
797
797
|
}
|
|
798
798
|
const weightSum = radii.reduce((a, x) => a + x, 0) || 1;
|
|
799
799
|
const raw = radii.map((rho) => total * rho / weightSum);
|
|
@@ -806,19 +806,19 @@ class Unit {
|
|
|
806
806
|
}
|
|
807
807
|
});
|
|
808
808
|
while (left > 0) {
|
|
809
|
-
seatsPerRow[
|
|
809
|
+
seatsPerRow[R - 1]++;
|
|
810
810
|
left--;
|
|
811
811
|
}
|
|
812
|
-
const radialPitch =
|
|
812
|
+
const radialPitch = R === 1 ? r1 - r0 || r1 : (r1 - r0) / (R - 1);
|
|
813
813
|
let minArcPitch = Infinity;
|
|
814
|
-
for (let r = 0; r <
|
|
814
|
+
for (let r = 0; r < R; r++) {
|
|
815
815
|
const n = seatsPerRow[r];
|
|
816
816
|
if (n <= 0) continue;
|
|
817
817
|
const arcPitch = radii[r] * absSpan / n;
|
|
818
818
|
if (arcPitch < minArcPitch) minArcPitch = arcPitch;
|
|
819
819
|
}
|
|
820
820
|
const pitch = Math.min(radialPitch, minArcPitch);
|
|
821
|
-
return { R
|
|
821
|
+
return { R, radii, seatsPerRow, dotR: Math.max(1, pitch / (2 * spacing)) };
|
|
822
822
|
};
|
|
823
823
|
const arcRows = opts.arc && opts.arc.rows;
|
|
824
824
|
let res;
|
|
@@ -830,8 +830,8 @@ class Unit {
|
|
|
830
830
|
} else {
|
|
831
831
|
const maxR = Math.max(1, Math.min(40, Math.ceil(Math.sqrt(total)) + 6));
|
|
832
832
|
res = evalR(1);
|
|
833
|
-
for (let
|
|
834
|
-
const cand = evalR(
|
|
833
|
+
for (let R = 2; R <= maxR; R++) {
|
|
834
|
+
const cand = evalR(R);
|
|
835
835
|
if (cand.dotR > res.dotR) res = cand;
|
|
836
836
|
}
|
|
837
837
|
}
|
|
@@ -855,7 +855,7 @@ class Unit {
|
|
|
855
855
|
const labelsOn = !!(opts.clusterLabels && opts.clusterLabels.show);
|
|
856
856
|
const labelsBelow = labelsOn && opts.clusterLabels.position === "bottom";
|
|
857
857
|
const topPad = labelsOn && !labelsBelow ? 30 : 6;
|
|
858
|
-
const visible = counts.map((
|
|
858
|
+
const visible = counts.map((_2, i) => i).filter((i) => counts[i] > 0);
|
|
859
859
|
const Kv = Math.max(1, visible.length);
|
|
860
860
|
const slotOf = new Array(counts.length).fill(-1);
|
|
861
861
|
visible.forEach((i, s) => slotOf[i] = s);
|
|
@@ -906,9 +906,9 @@ class Unit {
|
|
|
906
906
|
const barH = rows * pitch;
|
|
907
907
|
const left = cx - cols * pitch / 2 + pitch / 2;
|
|
908
908
|
const dots = [];
|
|
909
|
-
for (let
|
|
910
|
-
const rowIdx = Math.floor(
|
|
911
|
-
const colIdx =
|
|
909
|
+
for (let j = 0; j < n; j++) {
|
|
910
|
+
const rowIdx = Math.floor(j / cols);
|
|
911
|
+
const colIdx = j % cols;
|
|
912
912
|
dots.push({
|
|
913
913
|
x: left + colIdx * pitch,
|
|
914
914
|
y: bottom - r - rowIdx * pitch
|
|
@@ -970,7 +970,7 @@ class Unit {
|
|
|
970
970
|
const originX = (gw - blockW) / 2 + pitch / 2;
|
|
971
971
|
const topY = labelSpace + (availH - blockH) / 2;
|
|
972
972
|
const rowY = (rowIdx) => fillFrom === "bottom" ? topY + blockH - pitch / 2 - rowIdx * pitch : topY + pitch / 2 + rowIdx * pitch;
|
|
973
|
-
const clusters = counts.map((
|
|
973
|
+
const clusters = counts.map((_2, i) => ({
|
|
974
974
|
i,
|
|
975
975
|
cx: gw / 2,
|
|
976
976
|
cy: labelSpace + availH / 2,
|
|
@@ -980,7 +980,7 @@ class Unit {
|
|
|
980
980
|
}));
|
|
981
981
|
let k = 0;
|
|
982
982
|
for (let ci = 0; ci < cells.length; ci++) {
|
|
983
|
-
for (let
|
|
983
|
+
for (let j = 0; j < cells[ci]; j++) {
|
|
984
984
|
const col = k % cols;
|
|
985
985
|
const rowIdx = Math.floor(k / cols);
|
|
986
986
|
clusters[ci].dots.push({
|
|
@@ -1016,14 +1016,14 @@ class Unit {
|
|
|
1016
1016
|
const fillFrom = gcfg.fillFrom === "top" ? "top" : "bottom";
|
|
1017
1017
|
const cellsPerTile = Math.max(1, Math.round(gcfg.total > 0 ? gcfg.total : 100));
|
|
1018
1018
|
const rowsPerTile = Math.max(1, Math.ceil(cellsPerTile / cols));
|
|
1019
|
-
const visible = counts.map((
|
|
1020
|
-
const
|
|
1019
|
+
const visible = counts.map((_2, i) => i).filter((i) => counts[i] > 0);
|
|
1020
|
+
const K2 = Math.max(1, visible.length);
|
|
1021
1021
|
const denom = gcfg.max > 0 ? gcfg.max : Math.max(1, ...counts);
|
|
1022
1022
|
const tileCols = Math.max(
|
|
1023
1023
|
1,
|
|
1024
|
-
Math.round(gcfg.tileColumns > 0 ? gcfg.tileColumns : Math.ceil(Math.sqrt(
|
|
1024
|
+
Math.round(gcfg.tileColumns > 0 ? gcfg.tileColumns : Math.ceil(Math.sqrt(K2)))
|
|
1025
1025
|
);
|
|
1026
|
-
const tileRows = Math.max(1, Math.ceil(
|
|
1026
|
+
const tileRows = Math.max(1, Math.ceil(K2 / tileCols));
|
|
1027
1027
|
const labelsOn = !(opts.clusterLabels && opts.clusterLabels.show === false);
|
|
1028
1028
|
const labelsBelow = labelsOn && opts.clusterLabels && opts.clusterLabels.position === "bottom";
|
|
1029
1029
|
const topBand = labelsOn && !labelsBelow ? 22 : 4;
|
|
@@ -1143,7 +1143,7 @@ class Unit {
|
|
|
1143
1143
|
(cat) => Array.isArray(cat) ? cat.map(valueOf) : []
|
|
1144
1144
|
);
|
|
1145
1145
|
const isNum = (v) => v != null && isFinite(v);
|
|
1146
|
-
const visible = catVals.map((
|
|
1146
|
+
const visible = catVals.map((_2, i) => i).filter((i) => catVals[i].some(isNum));
|
|
1147
1147
|
const Kv = Math.max(1, visible.length);
|
|
1148
1148
|
let vmin = Infinity;
|
|
1149
1149
|
let vmax = -Infinity;
|
|
@@ -1200,9 +1200,9 @@ class Unit {
|
|
|
1200
1200
|
const cy = laneCy(slot);
|
|
1201
1201
|
lanes.push({ i: ci, cy, name: names[ci] || `series-${ci + 1}` });
|
|
1202
1202
|
const cat = unitData[ci] || [];
|
|
1203
|
-
const pts = cat.map((d,
|
|
1203
|
+
const pts = cat.map((d, j) => {
|
|
1204
1204
|
const v = valueOf(d);
|
|
1205
|
-
const p = { j
|
|
1205
|
+
const p = { j, px: plotX(isNum(v) ? v : xMin), y: cy };
|
|
1206
1206
|
if (sizeStats) p.r = this._scatterRadius(d, sizeStats, r);
|
|
1207
1207
|
return p;
|
|
1208
1208
|
});
|
|
@@ -1262,7 +1262,7 @@ class Unit {
|
|
|
1262
1262
|
(cat) => Array.isArray(cat) ? cat.map(valueOf) : []
|
|
1263
1263
|
);
|
|
1264
1264
|
const isNum = (v) => v != null && isFinite(v);
|
|
1265
|
-
const visible = catVals.map((
|
|
1265
|
+
const visible = catVals.map((_2, i) => i).filter((i) => catVals[i].some(isNum));
|
|
1266
1266
|
const Kv = Math.max(1, visible.length);
|
|
1267
1267
|
let vmin = Infinity;
|
|
1268
1268
|
let vmax = -Infinity;
|
|
@@ -1319,9 +1319,9 @@ class Unit {
|
|
|
1319
1319
|
const cx = laneCx(slot);
|
|
1320
1320
|
lanes.push({ i: ci, cx, name: names[ci] || `series-${ci + 1}` });
|
|
1321
1321
|
const cat = unitData[ci] || [];
|
|
1322
|
-
const pts = cat.map((d,
|
|
1322
|
+
const pts = cat.map((d, j) => {
|
|
1323
1323
|
const v = valueOf(d);
|
|
1324
|
-
const p = { j
|
|
1324
|
+
const p = { j, py: plotY(isNum(v) ? v : vMin), x: cx };
|
|
1325
1325
|
if (sizeStats) p.r = this._scatterRadius(d, sizeStats, r);
|
|
1326
1326
|
return p;
|
|
1327
1327
|
});
|
|
@@ -1379,7 +1379,7 @@ class Unit {
|
|
|
1379
1379
|
const isNum = (v) => typeof v === "number" && isFinite(v);
|
|
1380
1380
|
const xOf = (d) => d && typeof d === "object" ? d.x : null;
|
|
1381
1381
|
const yOf = (d) => d && typeof d === "object" ? d.y != null ? d.y : d.value : null;
|
|
1382
|
-
const visible = unitData.map((
|
|
1382
|
+
const visible = unitData.map((_2, i) => i).filter(
|
|
1383
1383
|
(i) => (unitData[i] || []).some((d) => isNum(xOf(d)) && isNum(yOf(d)))
|
|
1384
1384
|
);
|
|
1385
1385
|
let xmn = Infinity;
|
|
@@ -1517,10 +1517,10 @@ class Unit {
|
|
|
1517
1517
|
let zmax = -Infinity;
|
|
1518
1518
|
unitData.forEach(
|
|
1519
1519
|
(cat) => (cat || []).forEach((d) => {
|
|
1520
|
-
const
|
|
1521
|
-
if (typeof
|
|
1522
|
-
if (
|
|
1523
|
-
if (
|
|
1520
|
+
const z2 = d && typeof d === "object" ? d[field] : null;
|
|
1521
|
+
if (typeof z2 === "number" && isFinite(z2)) {
|
|
1522
|
+
if (z2 < zmin) zmin = z2;
|
|
1523
|
+
if (z2 > zmax) zmax = z2;
|
|
1524
1524
|
}
|
|
1525
1525
|
})
|
|
1526
1526
|
);
|
|
@@ -1537,9 +1537,9 @@ class Unit {
|
|
|
1537
1537
|
*/
|
|
1538
1538
|
_scatterRadius(d, st, fallback) {
|
|
1539
1539
|
if (!st) return fallback;
|
|
1540
|
-
const
|
|
1541
|
-
if (typeof
|
|
1542
|
-
const t = st.zmax > st.zmin ? (
|
|
1540
|
+
const z2 = d && typeof d === "object" ? d[st.field] : null;
|
|
1541
|
+
if (typeof z2 !== "number" || !isFinite(z2)) return st.rMin;
|
|
1542
|
+
const t = st.zmax > st.zmin ? (z2 - st.zmin) / (st.zmax - st.zmin) : 1;
|
|
1543
1543
|
const tc = Math.max(0, Math.min(1, t));
|
|
1544
1544
|
const aMin = st.rMin * st.rMin;
|
|
1545
1545
|
const aMax = st.rMax * st.rMax;
|
|
@@ -2173,7 +2173,7 @@ class Unit {
|
|
|
2173
2173
|
* chart-wide shape
|
|
2174
2174
|
* @returns {any}
|
|
2175
2175
|
*/
|
|
2176
|
-
_drawDot(graphics, opts, dotR, color, i,
|
|
2176
|
+
_drawDot(graphics, opts, dotR, color, i, j, spec) {
|
|
2177
2177
|
const w = this.w;
|
|
2178
2178
|
const strokeW = w.config.stroke.show ? w.config.stroke.width : 0;
|
|
2179
2179
|
const strokeColor = Array.isArray(w.globals.stroke.colors) ? w.globals.stroke.colors[i] || "none" : "none";
|
|
@@ -2213,7 +2213,7 @@ class Unit {
|
|
|
2213
2213
|
}
|
|
2214
2214
|
el.node.classList.add("apexcharts-unit-area");
|
|
2215
2215
|
el.node.setAttribute("i", String(i));
|
|
2216
|
-
el.node.setAttribute("j", String(
|
|
2216
|
+
el.node.setAttribute("j", String(j));
|
|
2217
2217
|
return el;
|
|
2218
2218
|
}
|
|
2219
2219
|
/**
|
|
@@ -2335,8 +2335,8 @@ class Unit {
|
|
|
2335
2335
|
for (let k = 0; k < dots.length; k++) {
|
|
2336
2336
|
const d = dots[k];
|
|
2337
2337
|
const carried = live && !d.isEnter && d.key != null ? live.get(d.key) : null;
|
|
2338
|
-
const sx = carried ? carried.x :
|
|
2339
|
-
const sy = carried ? carried.y :
|
|
2338
|
+
const sx = carried ? carried.x : $(d.cx0, stiffness, damping);
|
|
2339
|
+
const sy = carried ? carried.y : $(d.cy0, stiffness, damping);
|
|
2340
2340
|
if (carried) {
|
|
2341
2341
|
sx.stiffness = stiffness;
|
|
2342
2342
|
sy.stiffness = stiffness;
|
|
@@ -2420,12 +2420,12 @@ class Unit {
|
|
|
2420
2420
|
let cx, cy;
|
|
2421
2421
|
if (d.sx && d.sy) {
|
|
2422
2422
|
if (elapsed >= 0 && !d.released) {
|
|
2423
|
-
|
|
2424
|
-
|
|
2423
|
+
_(d.sx, d.x);
|
|
2424
|
+
_(d.sy, d.y);
|
|
2425
2425
|
d.released = true;
|
|
2426
2426
|
}
|
|
2427
|
-
const restX =
|
|
2428
|
-
const restY =
|
|
2427
|
+
const restX = q(d.sx, dt);
|
|
2428
|
+
const restY = q(d.sy, dt);
|
|
2429
2429
|
if (!d.released || !restX || !restY) done = false;
|
|
2430
2430
|
cx = d.sx.value;
|
|
2431
2431
|
cy = d.sy.value;
|
|
@@ -2757,14 +2757,14 @@ ${percent.toFixed(1)}%`;
|
|
|
2757
2757
|
textEl.setAttribute("font-weight", String(cfg.fontWeight || 600));
|
|
2758
2758
|
textEl.setAttribute("fill", cfg.color || color);
|
|
2759
2759
|
const bottom = cfg.position === "bottom";
|
|
2760
|
-
const
|
|
2760
|
+
const R = cluster.outerR + fontSize * 0.6 + 3 + (cfg.offsetY || 0);
|
|
2761
2761
|
const estWidth = str.length * fontSize * 0.55;
|
|
2762
|
-
const curved = !bottom && !cluster.flat && cfg.curved !== false && estWidth <= Math.PI *
|
|
2762
|
+
const curved = !bottom && !cluster.flat && cfg.curved !== false && estWidth <= Math.PI * R * 0.95;
|
|
2763
2763
|
if (curved) {
|
|
2764
2764
|
const yMid = cluster.cy;
|
|
2765
|
-
const x1 = cluster.cx -
|
|
2766
|
-
const x2 = cluster.cx +
|
|
2767
|
-
const d = `M ${x1} ${yMid} A ${
|
|
2765
|
+
const x1 = cluster.cx - R;
|
|
2766
|
+
const x2 = cluster.cx + R;
|
|
2767
|
+
const d = `M ${x1} ${yMid} A ${R} ${R} 0 0 1 ${x2} ${yMid}`;
|
|
2768
2768
|
const arcId = `apexcharts-unit-label-${w.globals.chartID}-${cluster.i}`;
|
|
2769
2769
|
const pathEl = BrowserAPIs.createElementNS(NS, "path");
|
|
2770
2770
|
pathEl.setAttribute("id", arcId);
|