apexcharts 8.2.0 → 8.3.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/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +271 -173
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +35 -0
- package/dist/apexcharts.esm.js +1722 -1527
- package/dist/apexcharts.full.js +1459 -1075
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +994 -715
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +994 -715
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +91 -40
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +433 -394
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +364 -322
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +91 -40
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +364 -322
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +433 -394
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +271 -173
- 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 +433 -394
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +250 -187
- 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 +2 -2
- package/dist/features/drilldown.esm.js +4 -2
- package/dist/features/drilldown.js +2 -2
- 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 +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/exports.js +1 -1
- 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/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +14 -9
- package/dist/features/highlight-filter.js +2 -2
- 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 +97 -145
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +63 -43
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- 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 +1 -1
- 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 +2 -2
- package/dist/features/renderer-canvas.esm.js +2 -1
- package/dist/features/renderer-canvas.js +2 -2
- 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 +1 -1
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +3 -2
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +92 -2
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +83 -47
- package/dist/features/trellis.js +2 -2
- 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 +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/features/weave.js +1 -1
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +950 -795
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +3 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +433 -394
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +54 -38
- package/dist/icicle.js +2 -2
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +91 -40
- package/dist/line.js +2 -2
- package/dist/locales/en.json +2 -1
- package/dist/locales/ro.json +3 -2
- 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 +2 -2
- package/dist/radar.esm.js +5 -4
- package/dist/radar.js +2 -2
- 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 +72 -26
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +91 -40
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +433 -394
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +91 -40
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +93 -41
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +103 -93
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +105 -86
- package/dist/treemap.js +2 -2
- 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 +2 -2
- package/dist/unit.esm.js +280 -202
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +72 -26
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +432 -393
- package/package.json +1 -1
- package/src/apexcharts.js +13 -6
- package/src/assets/apexcharts.css +35 -0
- package/src/charts/Bar.js +62 -55
- package/src/charts/BarStacked.js +80 -88
- package/src/charts/BoxCandleStick.js +28 -31
- package/src/charts/Icicle.js +37 -37
- package/src/charts/Line.js +118 -42
- package/src/charts/Radar.js +5 -7
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +108 -66
- package/src/charts/Unit.js +368 -250
- package/src/charts/Violin.js +48 -30
- package/src/charts/common/Breadcrumb.js +2 -2
- package/src/charts/common/Hierarchy.js +32 -11
- package/src/charts/common/Jitter.js +32 -7
- package/src/charts/common/bar/DataLabels.js +76 -81
- package/src/charts/common/bar/Helpers.js +43 -7
- package/src/charts/common/line/Helpers.js +12 -15
- package/src/charts/common/partition/NodeTooltip.js +8 -1
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Core.js +4 -0
- package/src/modules/CoreUtils.js +18 -42
- package/src/modules/Data.js +23 -24
- package/src/modules/DataLabels.js +6 -6
- package/src/modules/Graphics.js +62 -49
- package/src/modules/Markers.js +3 -1
- package/src/modules/Range.js +44 -29
- package/src/modules/RendererController.js +17 -3
- package/src/modules/Scales.js +32 -9
- package/src/modules/Series.js +39 -18
- package/src/modules/Theme.js +1 -1
- package/src/modules/ZoomPanSelection.js +119 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/highlightFilter/HighlightFilter.js +8 -9
- package/src/modules/highlightFilter/TreemapPart.js +2 -2
- package/src/modules/legend/HeatmapGradientLegend.js +76 -45
- package/src/modules/legend/Helpers.js +2 -0
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/settings/Options.js +7 -0
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Tooltip.js +20 -4
- package/src/modules/tooltip/Utils.js +8 -0
- package/src/modules/trellis/Trellis.js +6 -0
- package/src/modules/trellis/TrellisChrome.js +18 -7
- package/src/modules/trellis/TrellisSync.js +2 -0
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/types/internal.d.ts +9 -3
- package/types/apexcharts.d.ts +31 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var e=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(t,s,r)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,l=(e,t)=>{for(var s in t||(t={}))i.call(t,s)&&a(e,s,t[s]);if(r)for(var s of r(t))n.call(t,s)&&a(e,s,t[s]);return e},o=(e,r)=>t(e,s(r));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 s in e)if("default"!==s){const r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const c=h(require("apexcharts/core")),u=c.__apex_Graphics,d=c.__apex_Utils;class f{static xRatio(e){const t=e.layout.gridWidth||1;return(e.globals.maxX-e.globals.minX)/t}static dataXToPx(e,t){return(t-e.globals.minX)/f.xRatio(e)}static pxToDataX(e,t){return e.globals.minX+t*f.xRatio(e)}static screenXToPlotPx(e,t){const s=e.dom.baseEl,r=s&&s.querySelector(".apexcharts-svg");if(!r)return t-e.layout.translateX;const i=r.getBoundingClientRect(),n=e.globals.svgWidth?i.width/e.globals.svgWidth:1;return(t-i.left)/(n||1)-e.layout.translateX}}const g=c.__apex_Environment_Environment;function p(e,t){const s=(t.collapsedSeries||[]).concat(t.ancillaryCollapsedSeries||[]);return e.map((e,t)=>{const a=e||{},{hidden:h}=a,c=((e,t)=>{var s={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(null!=e&&r)for(var a of r(e))t.indexOf(a)<0&&n.call(e,a)&&(s[a]=e[a]);return s})(a,["hidden"]);let u=c.data;if(Array.isArray(u)&&!u.length){const e=s.find(e=>e.index===t);e&&Array.isArray(e.data)&&(u=e.data)}return o(l({},c),{data:Array.isArray(u)?u.slice():u})})}const m=["wiggle","silhouette","zero","expand"],x=["inside-out","inverse","none"];function y(e,t,s){const r=s&&void 0!==s[t]?s[t]:t+1;return null==e?{x:r,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:r,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:r,y:e.y,rest:e}:{x:r,y:e,rest:{}}}const b="__apexcharts_series_transforms__";var v,A;globalThis[b]||(globalThis[b]={}),v="streamgraph","function"==typeof(A=function(e,t){var s,r;const i=t.config,n=t.globals;if(!Array.isArray(e))return e;n.streamgraphRawSeries||(n.streamgraphRawSeries=p(e,n));const a=n.streamgraphRawSeries;if(a.some(e=>function(e){for(let t=0;t<e.length;t++){const s=e[t],r=Array.isArray(s)?s[1]:s&&"object"==typeof s?s.y:s;if(Array.isArray(r)&&2===r.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[])))return t.streamgraphData=null,e;const h=(null==(s=i.plotOptions)?void 0:s.streamgraph)||{},c=-1!==m.indexOf(h.offset)?h.offset:"wiggle",u=-1!==x.indexOf(h.order)?h.order:"inside-out",f=null==(r=i.xaxis)?void 0:r.categories,g=function(e){return(e.collapsedSeriesIndices||[]).concat(e.ancillaryCollapsedSeriesIndices||[])}(n),{xs:b,rows:v,grids:A}=function(e,t){var s;const r=[],i=[],n=new Map,a=[];for(let o=0;o<e.length;o++){const h=Array.isArray(null==(s=e[o])?void 0:s.data)?e[o].data:[],c=new Map;for(let e=0;e<h.length;e++){const{x:s,y:a,rest:o}=y(h[e],e,t),u=s instanceof Date?s.getTime():s;n.has(u)||(n.set(u,r.length),r.push(s),i.push(l({},o))),c.set(n.get(u),d.parseNumber(a))}a.push(c)}return{xs:r,rows:i,grids:a}}(a,f),P=function(e){const t=[];for(let s=0;s<e.length;s++){const r=e[s]instanceof Date?e[s].getTime():e[s];if("number"!=typeof r||!isFinite(r))return null;t.push(s)}const s=t.map(t=>({j:t,v:e[t]instanceof Date?e[t].getTime():e[t]}));s.sort((e,t)=>e.v-t.v);const r=s.map(e=>e.j);for(let e=0;e<r.length;e++)if(r[e]!==e)return r;return null}(b),w=P?P.map(e=>b[e]):b,_=P?P.map(e=>v[e]):v,S=w.length;let k=!1;const F=[];for(let e=0;e<a.length;e++){const t=new Array(S);for(let s=0;s<S;s++){const r=A[e].get(P?P[s]:s);let i=null==r?0:Number(r);isFinite(i)||(i=0),i<0&&(k=!0,i=0),t[s]=i}F.push(t)}k&&!n.streamgraphWarnedNegative&&(n.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const Y=[];for(let e=0;e<a.length;e++)-1===g.indexOf(e)&&Y.push(e);let M=F;if("expand"===c){M=F.map(e=>e.slice());for(let e=0;e<S;e++){let t=0;for(let s=0;s<Y.length;s++)t+=M[Y[s]][e];if(t)for(let s=0;s<Y.length;s++)M[Y[s]][e]/=t}}const C=function(e,t,s){if("none"===e)return t.slice();if("inverse"===e)return t.slice().reverse();const r={},i={};for(let e=0;e<t.length;e++){const n=t[e],a=s[n];let l=0,o=-1/0,h=0;for(let e=0;e<a.length;e++)l+=a[e],a[e]>o&&(o=a[e],h=e);r[n]=l,i[n]=h}const n=t.slice().sort((e,t)=>i[e]-i[t]||e-t);let a=0,l=0;const o=[],h=[];for(let e=0;e<n.length;e++){const t=n[e];a<l?(a+=r[t],o.push(t)):(l+=r[t],h.push(t))}return h.reverse().concat(o)}(u,Y,M),I=function(e,t,s,r){const i=new Array(r).fill(0);if(0===r||0===t.length)return i;if("zero"===e||"expand"===e)return i;if("silhouette"===e){for(let e=0;e<r;e++){let r=0;for(let i=0;i<t.length;i++)r+=s[t[i]][e];i[e]=-r/2}return i}let n=0;for(let e=1;e<r;e++){let r=0,a=0;for(let i=0;i<t.length;i++){const n=s[t[i]],l=n[e];let o=(l-n[e-1])/2;for(let r=0;r<i;r++){const i=s[t[r]];o+=i[e]-i[e-1]}r+=l,a+=o*l}r&&(n-=a/r),i[e]=n}return i}(c,C,M,S),L=a.map(()=>null),j=a.map(()=>null);for(let e=0;e<C.length;e++)L[C[e]]=new Array(S),j[C[e]]=new Array(S);for(let e=0;e<S;e++){let t=I[e];for(let s=0;s<C.length;s++){const r=C[s],i=L[r],n=j[r];i[e]=t,t+=M[r][e],n[e]=t}}return t.streamgraphData={names:a.map((e,t)=>{var s;return null!=(s=null==e?void 0:e.name)?s:`Series ${t+1}`}),xs:w,values:F,lows:L,highs:j,order:C,offset:c,hidden:a.map((e,t)=>t).filter(e=>-1!==g.indexOf(e))},a.map((e,t)=>{const s=L[t],r=j[t];if(!s||!r)return o(l({},e),{data:[]});const i=new Array(S);for(let e=0;e<S;e++)i[e]=o(l({},_[e]),{x:w[e],y:[s[e],r[e]]});return o(l({},e),{data:i})})})?globalThis[b][v]=A:console.warn(`ApexCharts: registerSeriesTransform("${v}") expects a function (series, w) => series.`),c.default.registerFeatures({streamgraph:class{constructor(e,t){this.w=e,this.ctx=t,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(e){var t;const s=this.w,r=s.globals,i=s.layout.gridHeight,n=r.maxY-r.minY;if(!n||!isFinite(n))return i/2;const a=(e-r.minY)/n;return(null==(t=s.config.yaxis[0])?void 0:t.reversed)?a*i:i-a*i}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var e,t,s,r,i,n,a;const l=this.w;if(!this.isActive())return;const o=null==(t=null==(e=l.config.plotOptions)?void 0:e.streamgraph)?void 0:t.labels;if(!o||!1===o.show)return;const h=l.dom.elGraphical,c=l.streamgraphData;if(!h||!c)return;this.removeLabels();const d=new u(l,this.ctx),f=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(s=o.style)?void 0:s.fontSize)||"auto",p=(null==(r=o.style)?void 0:r.fontFamily)||l.config.chart.fontFamily,m=(null==(i=o.style)?void 0:i.fontWeight)||600,x=null==o.minWidth?24:o.minWidth,y=[];for(let e=0;e<c.order.length;e++){const t=c.order[e],s=this._placeLabel(t,{fontSize:g,fontFamily:p,fontWeight:m,minWidth:x,graphics:d});s&&y.push(s)}let b=0;for(const e of this._deconflict(y)){const t=e.k,s=d.drawText({x:e.x,y:e.y,text:e.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:e.fontSize,fontFamily:p,fontWeight:m,foreColor:(null==(a=null==(n=o.style)?void 0:n.colors)?void 0:a[t])||e.color,cssClass:"apexcharts-streamgraph-label"});s.node.setAttribute("data:realIndex",String(t)),f.add(s),b++}if(!b)return;const v=h.node.querySelector(".apexcharts-xaxis");v?h.node.insertBefore(f.node,v):h.add(f),this.holdUntilBandsLand(f)}_placeLabel(e,{fontSize:t,fontFamily:s,fontWeight:r,minWidth:i,graphics:n}){const a=this.w,l=a.streamgraphData,o=l.lows[e],h=l.highs[e];if(!o||!h)return null;const c=a.globals.seriesXvalues[e],u=o.length;if(!Array.isArray(c)||c.length<u||0===u)return null;const d=new Array(u);let f=0;for(let e=0;e<u;e++){const t=Math.abs(this._yPx(h[e])-this._yPx(o[e]));d[e]=t,t>f&&(f=t)}if(f<=0)return null;const g=this._resolveFontSize(t,f),p=String(l.names[e]);let m=g,x=n.getTextRects(p,`${m}px`,s,"",!0,r);if(f<x.height+6)return null;const y=this._widestRun(d,c,x.height+6,u);if(!y)return null;if(x.width>y.width&&"auto"===t){const e=Math.floor(m*(y.width/x.width));if(e<this._autoBounds().min)return null;if(m=e,x=n.getTextRects(p,`${m}px`,s,"",!0,r),f<x.height+6)return null}const b=x.height+6,v=[];for(const t of this._runs(d,b,u)){const r=Number(c[t.l]),a=Number(c[t.r]);if(!isFinite(r)||!isFinite(a))continue;let l=a-r;if(l<=0&&u>1){const e=Math.abs(Number(c[Math.min(t.r+1,u-1)])-Number(c[Math.max(t.l-1,0)]));l=isFinite(e)?e:0}if(l<i||l<.35*x.width)continue;const d=x.width<=l?p:n.getTextBasedOnMaxWidth({text:p,maxWidth:l,fontSize:`${m}px`,fontFamily:s});if(!d||"..."===d)continue;const f=d===p?x.width:x.width*(d.length/p.length),g=[r+l/2];l>2.2*f&&g.push(r+f/2+2,a-f/2-2);for(const s of g){let r=t.l,i=1/0;for(let e=t.l;e<=t.r;e++){const t=Math.abs(Number(c[e])-s);t<i&&(i=t,r=e)}v.push({x:s,y:(this._yPx(o[r])+this._yPx(h[r]))/2,text:d,color:this._contrastOn(e),fontSize:`${m}px`,width:f,height:x.height})}if(v.length>=6)break}return v.length?{k:e,weight:f,candidates:v}:null}_runs(e,t,s){const r=[];let i=0;for(;i<s;){if(e[i]<t){i++;continue}let n=i,a=e[i];for(;n+1<s&&e[n+1]>=t;)n++,e[n]>a&&(a=e[n]);r.push({l:i,r:n,maxT:a}),i=n+1}return r.sort((e,t)=>t.maxT-e.maxT)}_widestRun(e,t,s,r){let i=-1;for(const n of this._runs(e,s,r)){const e=Number(t[n.r])-Number(t[n.l]);isFinite(e)&&e>i&&(i=e)}return i>=0?{width:i}:null}_deconflict(e){const t=e.slice().sort((e,t)=>t.weight-e.weight),s=[],r=e=>!s.some(t=>e.left<t.box.right&&e.right>t.box.left&&e.top<t.box.bottom&&e.bottom>t.box.top);for(const e of t)for(const t of e.candidates){const i={left:t.x-t.width/2,right:t.x+t.width/2,top:t.y-t.height/2,bottom:t.y+t.height/2};if(r(i)){s.push(o(l({k:e.k},t),{box:i}));break}}return s}_autoBounds(){var e,t;const s=(null==(t=null==(e=this.w.config.plotOptions)?void 0:e.streamgraph)?void 0:t.labels)||{};return{min:null==s.minFontSize?9:s.minFontSize,max:null==s.maxFontSize?30:s.maxFontSize}}_resolveFontSize(e,t){if("auto"!==e){const t=parseFloat(e);return isFinite(t)&&t>0?t:12}const{min:s,max:r}=this._autoBounds();return Math.max(s,Math.min(r,Math.round(.36*t)))}_contrastOn(e){var t;const s=this.w,r=null==(t=s.globals.colors)?void 0:t[e],i="string"==typeof r?d.parseHex(r):null;return i?d.relativeLuminance(i)>.45?"#000000":"#ffffff":s.config.chart.foreColor}removeLabels(){const e=this.w.dom.elGraphical,t=e&&e.node.querySelector(".apexcharts-streamgraph-labels");t&&t.parentNode&&t.parentNode.removeChild(t)}bindHover(){const e=this.w;if(!g.isBrowser())return;if(!1===this._hoverCfg().show)return;const t=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");t&&!t.__apexStreamHover&&(t.__apexStreamHover=!0,t.addEventListener("mousemove",e=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(e))}),t.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var e,t;return(null==(t=null==(e=this.w.config.plotOptions)?void 0:e.streamgraph)?void 0:t.hover)||{}}_bandAt(e){const t=this.w,s=t.streamgraphData;if(!s||!s.order.length)return-1;const r=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");if(!r)return-1;const i=r.getBoundingClientRect(),n=t.globals.svgWidth?i.width/t.globals.svgWidth:1,a=f.screenXToPlotPx(t,e.clientX),l=(e.clientY-i.top)/(n||1)-t.layout.translateY;if(a<0||a>t.layout.gridWidth)return-1;if(l<0||l>t.layout.gridHeight)return-1;const o=t.globals.seriesXvalues[s.order[0]];if(!Array.isArray(o)||!o.length)return-1;const h=t.interact?t.interact.capturedDataPointIndex:-1;let c=-1;if(h>=0&&h<o.length)c=h;else{let e=1/0;for(let t=0;t<o.length;t++){const s=Math.abs(Number(o[t])-a);s<e&&(e=s,c=t)}}if(c<0)return-1;let u=-1,d=1/0;for(let e=0;e<s.order.length;e++){const t=s.order[e],r=this._yPx(s.highs[t][c]),i=this._yPx(s.lows[t][c]),n=Math.min(r,i),a=Math.max(r,i);if(l>=n&&l<=a)return t;const o=l<n?n-l:l-a;o<d&&(d=o,u=t)}return u}_dim(e){const t=this.w;if(e===this._hovered)return;this._hovered=e;const s=this._hoverCfg(),r=null==s.opacity?.35:s.opacity,i=t.dom.baseEl.querySelectorAll(".apexcharts-series"),n=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),a=(t,s)=>e<0||s===e;for(let e=0;e<i.length;e++){const t=i[e];t.style.transition="opacity .15s ease",t.style.opacity=a(0,Number(t.getAttribute("data:realIndex")))?"":String(r)}for(let e=0;e<n.length;e++){const s=n[e];s.style.transition="opacity .15s ease, fill .15s ease",a(0,Number(s.getAttribute("data:realIndex")))?this._restoreLabel(s):(s.getAttribute("data:fill")||s.setAttribute("data:fill",s.getAttribute("fill")||""),s.setAttribute("fill",t.config.chart.foreColor),s.style.opacity="0.65")}}_restoreLabel(e){const t=e.getAttribute("data:fill");t&&e.setAttribute("fill",t),e.style.opacity=""}clearDim(){this._hovered=-1;const e=this.w;if(!e.dom.baseEl)return;const t=e.dom.baseEl.querySelectorAll(".apexcharts-series");for(let e=0;e<t.length;e++){t[e].style.opacity=""}const s=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let e=0;e<s.length;e++)this._restoreLabel(s[e])}holdUntilBandsLand(e){const t=this.w;g.isBrowser()&&t.globals.shouldAnimate&&!t.globals.animationEnded&&(e.node.classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:e.node,holdUntilComplete:!0}))}}});const P=c.__apex_CoreUtils,w=c.__apex_Fill,_=c.__apex_DataLabels,S=c.__apex_Markers,k=c.__apex_charts_Scatter,F=c.__apex_Series;class Y{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 P(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:r,i:i,j:n,prevY:a}){const l=this.w,o=[],h=[];let c=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.axisFlags.isXNumeric&&(c=(l.seriesData.seriesX[t][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===n&&(o.push(c),h.push(d.isNumber(e[i][0])?a+l.config.markers.offsetY:null)),o.push(s+l.config.markers.offsetX),h.push(d.isNumber(e[i][n+1])?r+l.config.markers.offsetY:null),{x:o,y:h}}checkPreviousPaths({pathFromLine:e,pathFromArea:t,realIndex:s}){const r=this.w;for(let i=0;i<r.globals.previousPaths.length;i++){const n=r.globals.previousPaths[i];("line"===n.type||"area"===n.type)&&n.paths.length>0&&parseInt(n.realIndex,10)===parseInt(s,10)&&("line"===n.type?(this.lineCtx.appendPathFrom=!1,e=r.globals.previousPaths[i].paths[0].d):"area"===n.type&&(this.lineCtx.appendPathFrom=!1,t=r.globals.previousPaths[i].paths[0].d,r.config.stroke.show&&r.globals.previousPaths[i].paths[1]&&(e=r.globals.previousPaths[i].paths[1].d)))}return{pathFromLine:e,pathFromArea:t}}previousRangeAreaPath(e){for(const t of this.w.globals.previousPaths)if("rangeArea"===t.type&&parseInt(t.realIndex,10)===parseInt(String(e),10)&&1===t.paths.length&&t.paths[0].d)return t.paths[0].d;return null}determineFirstPrevY({i:e,realIndex:t,series:s,prevY:r,lineYPosition:i,translationsIndex:n}){var a,l,o;const h=this.w,c=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(c)if(e>0){const e=this.lineCtx.stackTopAt(t,0);i=void 0===e?this.lineCtx.zeroY:e}else i=this.lineCtx.zeroY;else i=this.lineCtx.zeroY;r=i-s[e][0]/this.lineCtx.yRatio[n]+2*(this.lineCtx.isReversed?s[e][0]/this.lineCtx.yRatio[n]:0)}else if(c&&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]){r=i=this.lineCtx.prevSeriesY[t][0];break}return{prevY:r,lineYPosition:i}}}function M(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 C=e=>{const t=function(e){const t=[];let s=e[0],r=e[1],i=t[0]=L(s,r),n=1;for(let a=e.length-1;n<a;n++)s=r,r=e[n+1],t[n]=.5*(i+(i=L(s,r)));return t[n]=i,t}(e),s=e.length-1,r=[];let i,n,a,l;for(let r=0;r<s;r++)a=L(e[r],e[r+1]),Math.abs(a)<1e-6?t[r]=t[r+1]=0:(i=t[r]/a,n=t[r+1]/a,l=i*i+n*n,l>9&&(l=3*a/Math.sqrt(l),t[r]=l*i,t[r+1]=l*n));for(let i=0;i<=s;i++)l=(e[Math.min(s,i+1)][0]-e[Math.max(0,i-1)][0])/(6*(1+t[i]*t[i])),r.push([l||0,t[i]*l||0]);return r},I={points(e){const t=C(e),s=e[1],r=e[0],i=[],n=t[1],a=t[0];i.push(r,[r[0]+a[0],r[1]+a[1],s[0]-n[0],s[1]-n[1],s[0],s[1]]);for(let s=2,r=t.length;s<r;s++){const r=e[s],n=t[s];i.push([r[0]-n[0],r[1]-n[1],r[0],r[1]])}return i},slice(e,t,s){const r=e.slice(t,s);if(t){if(s-t>1&&r[1].length<6){const e=r[0].length;r[1]=[2*r[0][e-2]-r[0][e-4],2*r[0][e-1]-r[0][e-3]].concat(r[1])}r[0]=r[0].slice(-2)}return r}};function L(e,t){return(t[1]-e[1])/(t[0]-e[0])}const j=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function R(e,t){const{ax:s,bx:r,ay:i,by:n}=t,a=[],l=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].toUpperCase(),t=(o[2].match(j)||[]).map(parseFloat);if("Z"===e){a.push("z");continue}if("H"===e){for(const e of t)a.push(`H ${s*e+r}`);continue}if("V"===e){for(const e of t)a.push(`V ${i*e+n}`);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]+r} ${i*t[e+6]+n}`);continue}const l=[];for(let e=0;e+1<t.length;e+=2)l.push(`${s*t[e]+r} ${i*t[e+1]+n}`);l.length&&a.push(`${e} ${l.join(" ")}`)}return a.join(" ")}const X=c.__apex_Animations,N=c.__apex_BrowserAPIs_BrowserAPIs,z=c.__apex_Easing_resolveEasing,D=c.__apex_PathMorphing_parsePath,O=c.__apex_PathMorphing_arrayToPath;function $(e,t,s){if(!e||"string"!=typeof e)return null;const r=D(e);if(!r.length||"M"!==r[0][0])return null;for(let e=1;e<r.length;e++)if("M"===r[e][0])return null;let i=r,n=null;if(s){if(r.length<5)return null;if(n=r.slice(-3),i=r.slice(0,-3),"Z"!==n[2][0])return null;if("L"!==n[1][0])return null;if("L"!==n[0][0]&&"C"!==n[0][0])return null}else if("Z"===r[r.length-1][0])return null;if(i.length!==t||i.length<2)return null;const a=i[1][0];if("L"!==a&&"C"!==a)return null;for(let e=2;e<i.length;e++)if(i[e][0]!==a)return null;const l=i.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:i,closing:n,segType:a,anchors:l}}function T(e,t,s){return[e[0]+(t[0]-e[0])*s,e[1]+(t[1]-e[1])*s]}function W(e,t,s){const r=e,i=[t[1],t[2]],n=[t[3],t[4]],a=[t[5],t[6]],l=T(r,i,s),o=T(i,n,s),h=T(n,a,s),c=T(l,o,s),u=T(o,h,s),d=T(c,u,s);return{first:["C",l[0],l[1],c[0],c[1],d[0],d[1]],second:["C",u[0],u[1],h[0],h[1],a[0],a[1]],mid:d}}function B(e,t,s){const r=[t[1],t[2]],i=T(e,r,s);return{first:["L",i[0],i[1]],second:["L",r[0],r[1]],mid:i}}function E(e,t){const{body:s,closing:r,segType:i,anchors:n}=e,a=n.length,l=t.length,o=e=>"C"===i?["C",e[0],e[1],e[0],e[1],e[0],e[1]]:["L",e[0],e[1]],h=[["M",n[0][0],n[0][1]]];let c=0;for(;c<l&&0!==t[c];)c++;for(let e=1;e<=c;e++)h.push(o(n[0]));let u=c+1;for(let e=0;e<a-1;e++){let r=0;for(;u+r<l&&-1===t[u+r];)r++;const a=s[e+1];if(r){const t=r+1;let s=n[e],l=a;for(let e=0;e<r;e++){const r=1/(t-e),n="C"===i?W(s,l,r):B(s,l,r);h.push(n.first),s=n.mid,l=n.second}h.push(l)}else h.push(a.slice());u+=r+1}for(;u<l;)h.push(o(n[a-1])),u++;return r&&r.forEach(e=>h.push(e.slice())),h}function H(e,t,s,r,i,n){const a=$(e,r,n);if(!a)return null;const l=$(t,i,n);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:O(E(a,o)),toInterp:O(E(l,h))}}function q(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 r=null!=(t=s.largeDatasetThreshold)?t:0;return!(r>0&&e.globals.dataPoints>r)&&!!(g.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate)}function V(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 J(e,t,s=!1,r=!1){var i,n;if(!q(e))return null;const a=e.globals.prevStreamFrame;if(!a)return null;const l=null==(i=a.seriesY)?void 0:i[t],o=null==(n=e.seriesData.series)?void 0:n[t];if(!Array.isArray(l)||!Array.isArray(o))return null;if(!l.length||!o.length)return null;const h=V(l.map((e,s)=>function(e,t,s){var r,i;if(e.isXNumeric){const i=null==(r=e.seriesX)?void 0:r[t];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const n=null==(i=e.labels)?void 0:i[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}(a,t,s))),c=V(o.map((s,r)=>function(e,t,s){var r,i,n,a;if(null==(r=e.axisFlags)?void 0:r.isXNumeric){const r=null==(n=null==(i=e.seriesData)?void 0:i.seriesX)?void 0:n[t];if(r&&r.length&&null!=r[s])return"x:"+r[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,r))),u=function(e,t){const s=new Map;e.forEach((e,t)=>{s.has(e)||s.set(e,t)});const r=new Array(t.length),i=new Set;let n=-1,a=!0,l=e.length===t.length;t.forEach((e,t)=>{const o=s.has(e)&&!i.has(s.get(e))?s.get(e):-1;r[t]=o,-1!==o&&(i.add(o),o<n&&(a=!1),n=o),o!==t&&(l=!1)});const o=[];for(let t=0;t<e.length;t++)i.has(t)||o.push(t);return{toOld:r,exits:o,ordered:a,changed:!l}}(h,c);return(u.ordered||r)&&(u.changed||s)?{join:u,oldKeys:h,newKeys:c}:null}function U(e){var t,s;const r=e.config.chart.animations;return z(null!=(s=null==(t=r.dynamicAnimation)?void 0:t.easing)?s:r.easing)}function K(e,t,s,r,i){const n=performance.now(),a=l=>{if(e.globals.isDestroyed)return;const o=Math.max(0,Math.min(1,(l-n)/t));r(s(o),o),o<1?N.requestAnimationFrame(a):i&&i()};N.requestAnimationFrame(a)}function Z(e,{elPointsMain:t,realIndex:s,speed:r}){var i,n,a,l;if(!(null==t?void 0:t.node))return!1;const o=J(e,s,!0);if(!o)return!1;const h=e.globals.prevStreamFrame;if(!h)return!1;const c=null==(i=h.xPixels)?void 0:i[s],u=null==(n=h.yPixels)?void 0:n[s];if(!c||!u)return!1;const d=t.node.querySelectorAll(".apexcharts-marker");if(!d.length)return!1;const f=(null==(a=e.globals.seriesXvalues)?void 0:a[s])||[],g=(null==(l=e.globals.seriesYvalues)?void 0:l[s])||[],p=U(e),m=Math.max(1,r||1);return t.node.classList.remove("apexcharts-element-hidden"),d.forEach(t=>{var r,i,n,a,l,d,x,y,b;const v=parseInt(null!=(i=null!=(r=t.getAttribute("j"))?r:t.getAttribute("rel"))?i:"",10);if(!isFinite(v)||v<0||v>=o.join.toOld.length)return;const A=o.join.toOld[v],P=null!=f[v]&&null!=g[v]?[f[v],g[v]]:null;if(-1===A||!P){const s=t.style;return s.opacity="0",void K(e,m,p,e=>{s.opacity=String(e)},()=>{s.opacity=""})}const w=(null!=(n=c[A])?n:NaN)-P[0],_=(null!=(a=u[A])?a:NaN)-P[1];if(!isFinite(w)||!isFinite(_))return;const S=null!=(x=null==(d=null==(l=h.rPixels)?void 0:l[s])?void 0:d[A])?x:NaN,k=parseFloat(null!=(b=null!=(y=t.getAttribute("r"))?y:t.getAttribute("default-marker-size"))?b:""),F=isFinite(S)&&isFinite(k)&&k>0&&Math.abs(S-k)>.25;if(!(Math.abs(w)>=.5||Math.abs(_)>=.5)&&!F)return;const Y=e=>{const s=w*(1-e),r=_*(1-e);if(F){const i=(S+(k-S)*e)/k;t.setAttribute("transform",`translate(${s+P[0]*(1-i)}, ${r+P[1]*(1-i)}) scale(${i})`)}else t.setAttribute("transform",`translate(${s}, ${r})`)};Y(0),K(e,m,p,Y,()=>{t.removeAttribute("transform")})}),!0}function G(e,t,s,r){e.setAttribute("transform",`translate(${t*(1-r)}, ${s*(1-r)}) scale(${r})`)}function Q(e,{type:t,realIndex:s,pathFromLine:r,pathFromArea:i,linePaths:n,areaPaths:a}){var l,o;const h=J(e,s);if(!h)return null;const{join:c,oldKeys:u,newKeys:d}=h,f=e.globals.prevStreamFrame;if(!f)return null;const g=null==(l=f.seriesY)?void 0:l[s],p=null==(o=e.seriesData.series)?void 0:o[s];if(g.length<2||p.length<2)return null;if(g.some(e=>null===e)||p.some(e=>null===e))return null;const m=function(e,t){const s=new Set(e.exits),r=[];let i=0;for(let t=0;t<e.toOld.length;t++){const n=e.toOld[t];if(-1!==n){for(;i<n;)s.has(i)&&r.push({oldJ:i,newJ:-1}),i++;r.push({oldJ:n,newJ:t}),i=n+1}else r.push({oldJ:-1,newJ:t})}for(;i<t;)s.has(i)&&r.push({oldJ:i,newJ:-1}),i++;return r}(c,u.length),x={};return Array.isArray(n)&&1===n.length&&r&&(x.line=H(r,n[0],m,u.length,d.length,!1)),"area"===t&&Array.isArray(a)&&1===a.length&&i&&(x.area=H(i,a[0],m,u.length,d.length,!0)),x.line||x.area?x:null}class ee{constructor(e,t,s,r){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)||r,this.scatter=new k(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Y(this),this.markers=new S(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,this._shapeOnly=!1}draw(e,t,s,r){var i;const n=this.w,a=this.ctx.highlightFilter,l=new u(this.w),o=n.globals.comboCharts?t:n.config.chart.type,h=l.group({class:`apexcharts-${o}-series apexcharts-plot-series`}),c=new P(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=c.getLogSeries(e,s),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[],this.prevSeriesYByX=new Map;const d=[];for(let t=0;t<e.length;t++){e=this.lineHelpers.sameValueSeriesFix(t,e);const i=n.globals.comboCharts?s[t]:t,l=this.yRatio.length>1?i:0,h=this._collapsedBaselineRow(e,t,i);this._shapeOnly=!!h,h&&((e=e.slice())[t]=h,"rangeArea"===o&&r&&((r=r.slice())[t]=h)),this._initSerieVariables(e,t,i),F.addCollapsedClassToSeries(this.w,this.elSeries,i);const c=this._buildSeriesPaths(o,e,t,i,l,s,r);this._handlePaths({type:o,realIndex:i,i:t,paths:c}),null==a||a.line(this,o,e,t,i,l,c),this.markers.flushBatch(this.elPointsMain,i),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),d.push(this.elSeries)}if(void 0!==(null==(i=n.config.series[0])?void 0:i.zIndex)&&d.sort((e,t)=>Number(e.node.getAttribute("zIndex"))-Number(t.node.getAttribute("zIndex"))),n.config.chart.stacked)for(let e=d.length-1;e>=0;e--)h.add(d[e]);else for(let e=0;e<d.length;e++)h.add(d[e]);return h}_buildSeriesPaths(e,t,s,r,i,n,a){const h=this.w,c=[],u=[],d=[];let f=h.globals.padHorizontal+this.categoryAxisCorrection;h.axisFlags.isXNumeric&&h.seriesData.seriesX.length>0&&(f=(h.seriesData.seriesX[r][0]-h.globals.minX)/this.xRatio),d.push(f);const g=f;let p,m=this.zeroY,x=this.zeroY;m=this.lineHelpers.determineFirstPrevY({i:s,realIndex:r,series:t,prevY:m,lineYPosition:0,translationsIndex:i}).prevY,"monotoneCubic"===h.config.stroke.curve&&null===t[s][0]?c.push(null):c.push(m);const y=m;let b;"rangeArea"===e&&(b=this.lineHelpers.determineFirstPrevY({i:s,realIndex:r,series:a,prevY:x,lineYPosition:0,translationsIndex:i}),x=b.prevY,p=x,u.push(null!==c[0]?x:null));const v=this._calculatePathsFrom(r,m),A=[c[0]],P=[u[0]],w={type:e,series:t,realIndex:r,translationsIndex:i,i:s,x:f,y:1,pX:g,pY:y,pathsFrom:v,linePaths:[],areaPaths:[],seriesIndex:n,lineYPosition:0,xArrj:d,yArrj:c,y2Arrj:u,seriesRangeEnd:a},_=this._iterateOverDataPoints(o(l({},w),{iterations:"rangeArea"===e?t[s].length-1:void 0,isRangeStart:!0}));if("rangeArea"===e){const e=this._calculatePathsFrom(r,x),t=this._iterateOverDataPoints(o(l({},w),{series:a,xArrj:[f],yArrj:A,y2Arrj:P,pY:p,areaPaths:_.areaPaths,pathsFrom:e,iterations:a[s].length-1,isRangeStart:!1})),i=_.linePaths.length/2;for(let e=0;e<i;e++)_.linePaths[e]=t.linePaths[e+i]+_.linePaths[e];_.linePaths.splice(i);const n=1===_.linePaths.length?this.lineHelpers.previousRangeAreaPath(r):null;_.pathFromLine=null!=n?n:t.pathFromLine+_.pathFromLine}else/z\s*$/i.test(_.pathFromArea)||(_.pathFromArea+="z");return _}_collapsedBaselineRow(e,t,s){const r=this.w,i=r.globals;if(r.config.chart.stacked||this.pointsChart)return null;if(!Array.isArray(e[t])||0!==e[t].length)return null;if(-1===i.collapsedSeriesIndices.indexOf(s)&&-1===i.ancillaryCollapsedSeriesIndices.indexOf(s))return null;const n=r.axisFlags.isXNumeric?(r.seriesData.seriesX[s]||[]).length:i.dataPoints;if(!n)return null;const a=d.isNumber(i.minYArr[s])?i.minYArr[s]:i.minY,l=d.isNumber(i.maxYArr[s])?i.maxYArr[s]:i.maxY,o=Math.min(Math.max(0,a),l);return new Array(n).fill(d.isNumber(o)?o:0)}_initSerieVariables(e,t,s){const r=this.w,i=new u(this.w);this.xDivision=r.layout.gridWidth/(r.globals.dataPoints-("on"===r.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(r.config.stroke.width)?r.config.stroke.width[s]:r.config.stroke.width;let n=0;this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[s],n=s),this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.zeroY=r.layout.gridHeight-this.baseLineY[n]-(this.isReversed?r.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[n]:0),this.areaBottomY=this.zeroY,(this.zeroY>r.layout.gridHeight||"end"===r.config.plotOptions.area.fillTo)&&(this.areaBottomY=r.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const a=r.config.series[s];if(this.elSeries=i.group({class:"apexcharts-series",zIndex:void 0!==a.zIndex?a.zIndex:s,seriesName:d.escapeString(r.seriesData.seriesNames[s])}),this.elPointsMain=i.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,r.globals.hasNullValues){const e=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[r.layout.gridHeight+r.globals.markers.largestSize]},seriesIndex:t,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==e&&this.elPointsMain.add(e)}this.elDataLabelsWrap=i.group({class:"apexcharts-datalabels","data:realIndex":s});const l=e[t].length===r.globals.dataPoints;this.elSeries.attr({"data:longestSeries":l,rel:t+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom(e,t){const s=new u(this.w);let r=s.move(0,this.areaBottomY)+s.line(0,this.areaBottomY),i=r;if(this.w.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:r,pathFromArea:i,realIndex:e});r=t.pathFromLine,i=t.pathFromArea}return{prevY:t,pathFromLine:r,pathFromArea:i}}_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(s.config.chart.stacked&&Array.isArray(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e))for(let s=0;s<t.length;s++){const r=this._stackKey(e,s);if(null==r)continue;const i=t[s];d.isNumber(i)&&this.prevSeriesYByX.set(r,i)}}_handlePaths({type:e,realIndex:t,i:s,paths:r}){var i,n,a,h,c,d,f;const g=this.w,p=new u(this.w),m=function(e,t){const s=e&&e.renderer;return s&&s.kind&&"svg"!==s.kind?s:t}(this.ctx,p),x=new w(this.w);this.marks=[],this.prevSeriesY.push(r.yArrj),this._recordStackTops(t,r.yArrj);let y=null;"line"!==e&&"area"!==e||!g.globals.dataChanged||(y=function(e,t,s,r){var i;const n=e.globals,a=n.prevStreamFrame;if(!a||!n.dataChanged||!(null==(i=e.axisFlags)?void 0:i.isXNumeric))return null;const l=a.seriesX[t],o=a.seriesY[t],h=e.seriesData.seriesX[t],c=e.seriesData.series[t];if(!(l&&o&&h&&c))return null;if(l.length<3||h.length<3)return null;let u=-1;for(let e=0;e<l.length;e++)if(l[e]===h[0]){u=e;break}if(-1===u)return null;const d=Math.min(l.length-u,h.length);if(d<2)return null;const f=h.length-d;if(0===u&&0===f)return null;for(let e=0;e<d;e++){if(l[u+e]!==h[e])return null;const t=o[u+e],s=c[e];if(t!==s&&(null!=t||null!=s))return null}const g=a.xPixels[t],p=a.yPixels[t];if(!g||!p)return null;let m=-1,x=-1;for(let e=0;e<d;e++)null!=g[u+e]&&null!=p[u+e]&&null!=s[e]&&null!=r[e]&&(-1===m&&(m=e),x=e);if(-1===m||x<=m)return null;const y=s[m],b=s[x],v=g[u+m],A=g[u+x];if(Math.abs(b-y)<1e-6)return null;const P=(A-v)/(b-y),w=v-P*y;if(!isFinite(P)||!isFinite(w))return null;if(Math.abs(P-1)>.02)return null;if(Math.abs(w)<.5)return null;let _=m,S=m;for(let e=m;e<=x;e++){const t=r[e];null!=t&&null!=p[u+e]&&(t<r[_]&&(_=e),t>r[S]&&(S=e))}let k=1,F=0;const Y=r[_],M=r[S];if(Math.abs(M-Y)>1e-6?(k=(p[u+S]-p[u+_])/(M-Y),F=p[u+_]-k*Y):F=p[u+_]-Y,!isFinite(k)||!isFinite(F)||k<.2||k>5)return null;const C=Math.floor((m+x)/2);if(C!==m&&C!==x&&null!=s[C]&&null!=g[u+C]){const e=P*s[C]+w;if(Math.abs(e-g[u+C])>1.5)return null;if(null!=r[C]&&null!=p[u+C]){const e=k*r[C]+F;if(Math.abs(e-p[u+C])>1.5)return null}}return n.streamScrolled=!0,{ax:P,bx:w,ay:k,by:F}}(g,t,r.xArrj,r.yArrj));let b=null;y||"line"!==e&&"area"!==e||(b=Q(g,{type:e,realIndex:t,pathFromLine:r.pathFromLine,pathFromArea:r.pathFromArea,linePaths:r.linePaths,areaPaths:r.areaPaths})),g.globals.seriesXvalues[t]=r.xArrj,g.globals.seriesYvalues[t]=r.yArrj;const v=g.config.forecastDataPoints;if(v.count>0&&"rangeArea"!==e){const e=g.globals.seriesXvalues[t][g.globals.seriesXvalues[t].length-v.count-1],s=p.drawRect(e,0,g.layout.gridWidth,g.layout.gridHeight,0);g.dom.elForecastMask.appendChild(s.node);const r=p.drawRect(0,0,e,g.layout.gridHeight,0);g.dom.elNonForecastMask.appendChild(r.node)}if(this.pointsChart)Z(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed}),function(e,{elPointsMain:t,realIndex:s,speed:r}){if(!(null==t?void 0:t.node)||!q(e))return!1;if(-1===(e.globals.risingSeries||[]).indexOf(s))return!1;const i=t.node.querySelectorAll(".apexcharts-marker");if(!i.length)return!1;const n=U(e);t.node.classList.remove("apexcharts-element-hidden"),i.forEach(t=>{const s=t.getBBox(),i=s.x+s.width/2,a=s.y+s.height/2;G(t,i,a,0),K(e,Math.max(1,r||1),n,e=>G(t,i,a,e),()=>t.removeAttribute("transform"))})}(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed}),(g.seriesData.series[t]||[]).length||function(e,{elPointsMain:t,realIndex:s,speed:r,drawPoint:i}){var n,a,l;if(!(null==t?void 0:t.node)||!q(e))return!1;if(-1===(e.globals.collapsingSeriesIndices||[]).indexOf(s))return!1;const o=e.globals.prevStreamFrame,h=null==(n=null==o?void 0:o.xPixels)?void 0:n[s],c=null==(a=null==o?void 0:o.yPixels)?void 0:a[s];if(!Array.isArray(h)||!Array.isArray(c))return!1;const u=(null==(l=null==o?void 0:o.rPixels)?void 0:l[s])||[],d=e.globals.markers.size[s]||0,f=U(e);let g=!1;for(let n=0;n<h.length;n++){const a=h[n],l=c[n];if(null==a||null==l||!isFinite(a)||!isFinite(l))continue;const o=isFinite(u[n])?u[n]:d;if(!(o>0))continue;const p=i(a,l,o,n);if(!(null==p?void 0:p.node))continue;t.add(p);const m=p.node;m.classList.add("apexcharts-marker-exit");const x=X.trackSeriesTween(e,s);K(e,Math.max(1,r||1),f,e=>G(m,a,l,1-e),()=>{G(m,a,l,0),x()}),g=!0}g&&t.node.classList.remove("apexcharts-element-hidden")}(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed,drawPoint:(e,s,r,i)=>this.scatter.drawPoint(e,s,r,t,i,i)});else{g.globals.delayedElements.push({el:this.elPointsMain.node,index:t});Z(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed})||"line"!==e||g.config.stroke.show||!g.globals.dataChanged&&!g.globals.resized||this.elPointsMain.node.classList.remove("apexcharts-element-hidden"),J(g,t)&&(null==(i=this.elDataLabelsWrap)?void 0:i.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),g.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0}))}const A={i:s,realIndex:t,animationDelay:s,initialSpeed:g.config.chart.animations.speed,dataChangeSpeed:g.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${e}`},P=r.numericXY,_="line"===e||"area"===e,S=_&&r.linePaths.length>1?[r.linePaths.join(" ")]:r.linePaths,k=_&&r.areaPaths.length>1?[r.areaPaths.join(" ")]:r.areaPaths;if("area"===e){const e=x.fillPath({seriesNumber:t});for(let t=0;t<k.length;t++){const s=m.renderPaths(o(l({},A),{pathFrom:y?R(r.areaPaths[t],y):null!=(a=null==(n=null==b?void 0:b.area)?void 0:n.from)?a:r.pathFromArea,pathTo:k[t],pathToNumeric:P?{xs:P.xs,ys:P.ys,closeY:P.areaCloseY}:void 0,pathToInterp:null==(h=null==b?void 0:b.area)?void 0:h.toInterp,scrollMorph:!!y,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:e}));this.elSeries.add(s),this.marks.push(s)}}if(g.config.stroke.show&&!this.pointsChart){let i=null;if("line"===e)i=x.fillPath({seriesNumber:t,i:s});else if("solid"===g.config.stroke.fill.type)i=g.globals.stroke.colors[t];else{const e=g.config.fill;g.config.fill=g.config.stroke.fill,i=x.fillPath({seriesNumber:t,i:s}),g.config.fill=e}for(let s=0;s<S.length;s++){let n=i;"rangeArea"===e&&(n=x.fillPath({seriesNumber:t}));const a=o(l({},A),{pathFrom:y?R(r.linePaths[s],y):null!=(d=null==(c=null==b?void 0:b.line)?void 0:c.from)?d:r.pathFromLine,pathTo:S[s],pathToNumeric:P?{xs:P.xs,ys:P.ys}:void 0,pathToInterp:null==(f=null==b?void 0:b.line)?void 0:f.toInterp,scrollMorph:!!y,stroke:i,strokeWidth:this.strokeWidth,strokeLineCap:g.config.stroke.lineCap,fill:"rangeArea"===e?n:"none"}),h=m.renderPaths(a);if(this.elSeries.add(h),this.marks.push(h),h.attr("fill-rule","evenodd"),v.count>0&&"rangeArea"!==e){const e=m.renderPaths(a);e.node.setAttribute("stroke-dasharray",v.dashArray),v.strokeWidth&&e.node.setAttribute("stroke-width",v.strokeWidth),this.elSeries.add(e),e.attr("clip-path",`url(#forecastMask${g.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${g.globals.cuid})`)}}}}_iterateOverDataPoints({type:e,series:t,iterations:s,realIndex:r,translationsIndex:i,i:n,x:a,y:l,pX:o,pY:h,pathsFrom:c,linePaths:f,areaPaths:g,seriesIndex:p,lineYPosition:m,xArrj:x,yArrj:y,y2Arrj:b,isRangeStart:v,seriesRangeEnd:A}){var P,w;const _=this.w,S=new u(this.w),k=this.yRatio,F=c.prevY;let Y,C,{pathFromLine:I,pathFromArea:L}=c;const j=d.isNumber(_.globals.minYArr[r])?_.globals.minYArr[r]:_.globals.minY;s||(s=_.globals.dataPoints>1?_.globals.dataPoints-1:_.globals.dataPoints);const R=(e,t)=>t-e/k[i]+2*(this.isReversed?e/k[i]:0);let X=l;const N=_.config.chart.stacked&&!_.globals.comboCharts||_.config.chart.stacked&&_.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(P=this.w.config.series[r])?void 0:P.type)||"column"===(null==(w=this.w.config.series[r])?void 0:w.type));let z=_.config.stroke.curve;Array.isArray(z)&&(z=Array.isArray(p)?z[p[n]]:z[n]);let D,O=0;const $=this.pointsChart?this._scatterJitterPx(r):null;if("straight"===z&&!this.pointsChart){const u=this._fastStraightPath({type:e,series:t,i:n,realIndex:r,translationsIndex:i,iterations:s,x:a,y:l,pX:o,pY:h,pathsFrom:c,linePaths:f,areaPaths:g,xArrj:x,yArrj:y,y2Arrj:b,stackSeries:N});if(u)return u}for(let i=0;i<s&&0!==t[n].length;i++){const c=void 0===t[n][i+1]||null===t[n][i+1];if(_.axisFlags.isXNumeric){let e=_.seriesData.seriesX[r][i+1];void 0===_.seriesData.seriesX[r][i+1]&&(e=_.seriesData.seriesX[r][s-1]),a=(e-_.globals.minX)/this.xRatio}else a+=this.xDivision;if(N)if(n>0&&_.globals.collapsedSeries.length<_.config.series.length-1){if((e=>{var t;for(let s=e;s>=0;s--){const e=null!=(t=null==p?void 0:p[s])?t:s;if(-1===_.globals.collapsedSeriesIndices.indexOf(e)&&-1===_.globals.ancillaryCollapsedSeriesIndices.indexOf(e))return s}return-1})(n-1)<0)m=this.zeroY;else{const e=this.stackTopAt(r,i+1);m=void 0===e?this.zeroY:e}}else m=this.zeroY;else m=this.zeroY;c?l=R(j,m):(l=R(t[n][i+1],m),"rangeArea"===e&&(X=R(A[n][i+1],m)));let u=a,d=l;if($){const e=100003*r+(i+1);$.x&&(u=a+2*(M(7919*e+13)-.5)*$.x),$.y&&(d=l+2*(M(6271*e+97)-.5)*$.y)}x.push(null===t[n][i+1]?null:u),!c||"smooth"!==_.config.stroke.curve&&"monotoneCubic"!==_.config.stroke.curve?(y.push(d),b.push(X)):(y.push(null),b.push(null));const P=this.lineHelpers.calculatePoints({series:t,x:u,y:d,realIndex:r,i:n,j:i,prevY:F}),w=this._createPaths({type:e,series:t,i:n,j:i,x:a,y:l,y2:X,xArrj:x,yArrj:y,y2Arrj:b,pX:o,pY:h,pathState:O,segmentStartX:D,linePath:Y,areaPath:C,linePaths:f,areaPaths:g,curve:z,isRangeStart:v});g=w.areaPaths,f=w.linePaths,o=w.pX,h=w.pY,O=w.pathState,D=w.segmentStartX,C=w.areaPath,Y=w.linePath,!this.appendPathFrom||_.globals.hasNullValues||"monotoneCubic"===z&&"rangeArea"===e||(I+=S.line(a,this.areaBottomY),L+=S.line(a,this.areaBottomY)),this._shapeOnly||(this.handleNullDataPoints(t,P,n,i,r),this._handleMarkersAndLabels({type:e,pointsPos:P,i:n,j:i,realIndex:r,isRangeStart:v}))}return{yArrj:y,xArrj:x,pathFromArea:L,areaPaths:g,pathFromLine:I,linePaths:f}}_handleMarkersAndLabels({type:e,pointsPos:t,isRangeStart:s,i:r,j:i,realIndex:n}){const a=this.w,l=new _(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,i,{realIndex:n,pointsPos:t,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!a.globals.dataChanged&&!a.globals.resized&&!a.globals.markers.batched)&&a.seriesData.series[r].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const e=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:n,j:i+1});null!==e&&e!==this._elLastPointsWrap&&(this.elPointsMain.add(e),this._elLastPointsWrap=e)}const o=l.drawDataLabel({type:e,isRangeStart:s,pos:t,i:n,j:i+1});null!==o&&this.elDataLabelsWrap.add(o)}_scatterJitterPx(e){var t;const s=this.w,r=null==(t=s.config.plotOptions.scatter)?void 0:t.jitter;if(!r||!r.enabled||!r.x&&!r.y)return null;const i=s.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,n=this.yRatio.length>1?e:0,a=this.yRatio[n]?1/this.yRatio[n]:0;return{x:(r.x||0)*i,y:(r.y||0)*a}}_fastStraightPath({type:e,series:t,i:s,realIndex:r,translationsIndex:i,iterations:n,x:a,y:l,pX:o,pY:h,pathsFrom:c,linePaths:u,areaPaths:d,xArrj:f,yArrj:g,y2Arrj:p,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[r]>0)return null;const y=t[s],b=y.length;if(!n||b<2||b-1!==n)return null;for(let e=0;e<=n;e++){const t=y[e];if(null==t)return null}const v=x.axisFlags.isXNumeric,A=v?x.seriesData.seriesX[r]:null;if(v&&(!A||A.length<b))return null;const P=this.yRatio[i],w=this.isReversed,_=this.zeroY,S=this.areaBottomY,k=this.xRatio,F=x.globals.minX,Y=this.xDivision,M=x.config.markers.offsetX,C=x.config.markers.offsetY,I=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:L,pathFromArea:j}=c;const R=this.ctx&&this.ctx.renderer,X=!(!R||!R.kind||"svg"===R.kind),N=!X||x.globals.dataChanged&&!!x.globals.prevStreamFrame,z=X?new Float64Array(b):null,D=X?new Float64Array(b):null;z&&D&&(z[0]=o,D[0]=h),void 0===x.globals.pointsArray[r]&&(x.globals.pointsArray[r]=[]);const O=x.globals.pointsArray[r],$=A?(A[0]-F)/k+M:this.categoryAxisCorrection+M;O.push([$,c.prevY+C]);const T=N?new Array(n+1):[];N&&(T[0]="M "+o+" "+h);const W=N&&I?new Array(n):null;let B=a,E=o,H=h;for(let e=0;e<n;e++){A?E=(A[e+1]-F)/k:(B+=Y,E=B);const t=y[e+1];H=_-t/P+2*(w?t/P:0),f.push(E),g.push(H),p.push(l),O.push([E+M,H+C]),N&&(T[e+1]=" L "+E+" "+H,W&&(W[e]=" L "+E+" "+S)),z&&D&&(z[e+1]=E,D[e+1]=H)}let q="",V="";if(N&&(q=T.join(""),V=q+" L "+E+" "+S+" L "+o+" "+S+"z"),W){const e=W.join("");L+=e,j+=e}else!N&&I&&(L+=" L "+E+" "+S,j+=" L "+E+" "+S);return u.push(q),d.push(V),{yArrj:g,xArrj:f,pathFromArea:j,areaPaths:d,pathFromLine:L,linePaths:u,numericXY:z?{xs:z,ys:D,areaCloseY:S}:void 0}}_createPaths({type:e,series:t,i:s,j:r,x:i,y:n,xArrj:a,yArrj:l,y2:o,y2Arrj:h,pX:c,pY:d,pathState:f,segmentStartX:g,linePath:p,areaPath:m,linePaths:x,areaPaths:y,curve:b,isRangeStart:v}){const A=new u(this.w),P=this.areaBottomY,w="rangeArea"===e,_="rangeArea"===e&&v;switch(b){case"monotoneCubic":{const e=v?l:h,i=(e,t)=>e.map((e,s)=>[e,t[s]]).filter(e=>null!==e[1]),n=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=n(e),r=[];for(let e=0,i=0;e<s.length;i+=s[e++])r[e]=I.slice(t,i,i+s[e]);return r};switch(f){case 0:if(null===e[r+1])break;f=1;case 1:if(!(w?a.length===t[s].length:r===t[s].length-2))break;case 2:{const t=v?a:a.slice().reverse(),s=v?e:e.slice().reverse(),r=i(t,s),n=r.length>1?I.points(r):r;let l=[];w&&(_?y=r:l=y.reverse());let h=0,c=0;if(o(s,n).forEach(e=>{h++;const t=(e=>{let t="";for(let s=0;s<e.length;s++){const r=e[s],i=r.length;i>4?(t+=`C${r[0]}, ${r[1]}`,t+=`, ${r[2]}, ${r[3]}`,t+=`, ${r[4]}, ${r[5]}`):i>2&&(t+=`S${r[0]}, ${r[1]}`,t+=`, ${r[2]}, ${r[3]}`)}return t})(e),s=c;c+=e.length;const i=c-1;_?p=A.move(r[s][0],r[s][1])+t:w?p=A.move(l[s][0],l[s][1])+A.line(r[s][0],r[s][1])+t+A.line(l[i][0],l[i][1]):(p=A.move(r[s][0],r[s][1])+t,m=p+A.line(r[i][0],P)+A.line(r[s][0],P)+"z",y.push(m)),x.push(p)}),w&&h>1&&!_){const e=x.slice(h).reverse();x.splice(h),e.forEach(e=>x.push(e))}f=0;break}}break}case"smooth":{const e=.35*(i-c);if(null===t[s][r])f=0;else switch(f){case 0:if(g=c,p=_?A.move(c,h[r])+A.line(c,d):A.move(c,d),m=A.move(c,d),null===t[s][r+1]||void 0===t[s][r+1]){x.push(p),y.push(m);break}if(f=1,r<t[s].length-2){const t=A.curve(c+e,d,i-e,n,i,n);p+=t,m+=t;break}case 1:if(null===t[s][r+1])p+=_?A.line(c,o):A.move(c,d),m+=A.line(c,P)+A.line(g,P)+"z",x.push(p),y.push(m),f=-1;else{const a=A.curve(c+e,d,i-e,n,i,n);p+=a,m+=a,r>=t[s].length-2&&(_&&(p+=A.curve(i,n,i,n,i,o)+A.move(i,o)),m+=A.curve(i,n,i,n,i,P)+A.line(g,P)+"z",x.push(p),y.push(m),f=-1)}}c=i,d=n;break}default:{const e=(e,t,s)=>{let r="";switch(e){case"stepline":r=A.line(t,null,"H")+A.line(null,s,"V");break;case"linestep":r=A.line(null,s,"V")+A.line(t,null,"H");break;case"straight":r=A.line(t,s)}return r};if(null===t[s][r])f=0;else switch(f){case 0:if(g=c,p=_?A.move(c,h[r])+A.line(c,d):A.move(c,d),m=A.move(c,d),null===t[s][r+1]||void 0===t[s][r+1]){x.push(p),y.push(m);break}if(f=1,r<t[s].length-2){const t=e(b,i,n);p+=t,m+=t;break}case 1:if(null===t[s][r+1])p+=_?A.line(c,o):A.move(c,d),m+=A.line(c,P)+A.line(g,P)+"z",x.push(p),y.push(m),f=-1;else{const a=e(b,i,n);p+=a,m+=a,r>=t[s].length-2&&(_&&(p+=A.line(i,o)),m+=A.line(i,P)+A.line(g,P)+"z",x.push(p),y.push(m),f=-1)}}c=i,d=n;break}}return{linePaths:x,areaPaths:y,pX:c,pY:d,pathState:f,segmentStartX:g,linePath:p,areaPath:m}}handleNullDataPoints(e,t,s,r,i){const n=this.w;if(null===e[s][r]&&n.config.markers.showNullDataPoints||1===e[s].length){let e=this.strokeWidth-n.config.markers.strokeWidth/2;e>0||(e=0);const s=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:i,j:r+1,pSize:e,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}c.default.use({line:ee,area:ee,scatter:ee,bubble:ee,rangeArea:ee}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
|
5
|
+
"use strict";var e=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(t,s,r)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,l=(e,t)=>{for(var s in t||(t={}))i.call(t,s)&&a(e,s,t[s]);if(r)for(var s of r(t))n.call(t,s)&&a(e,s,t[s]);return e},o=(e,r)=>t(e,s(r));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 s in e)if("default"!==s){const r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const c=h(require("apexcharts/core")),u=c.__apex_Graphics,d=c.__apex_Utils;class f{static xRatio(e){const t=e.layout.gridWidth||1;return(e.globals.maxX-e.globals.minX)/t}static dataXToPx(e,t){return(t-e.globals.minX)/f.xRatio(e)}static pxToDataX(e,t){return e.globals.minX+t*f.xRatio(e)}static screenXToPlotPx(e,t){const s=e.dom.baseEl,r=s&&s.querySelector(".apexcharts-svg");if(!r)return t-e.layout.translateX;const i=r.getBoundingClientRect(),n=e.globals.svgWidth?i.width/e.globals.svgWidth:1;return(t-i.left)/(n||1)-e.layout.translateX}}const g=c.__apex_Environment_Environment;function p(e,t){const s=(t.collapsedSeries||[]).concat(t.ancillaryCollapsedSeries||[]);return e.map((e,t)=>{const a=e||{},{hidden:h}=a,c=((e,t)=>{var s={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(null!=e&&r)for(var a of r(e))t.indexOf(a)<0&&n.call(e,a)&&(s[a]=e[a]);return s})(a,["hidden"]);let u=c.data;if(Array.isArray(u)&&!u.length){const e=s.find(e=>e.index===t);e&&Array.isArray(e.data)&&(u=e.data)}return o(l({},c),{data:Array.isArray(u)?u.slice():u})})}const m=["wiggle","silhouette","zero","expand"],x=["inside-out","inverse","none"];function y(e,t,s){const r=s&&void 0!==s[t]?s[t]:t+1;return null==e?{x:r,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:r,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:r,y:e.y,rest:e}:{x:r,y:e,rest:{}}}const b="__apexcharts_series_transforms__";var v,A;globalThis[b]||(globalThis[b]={}),v="streamgraph","function"==typeof(A=function(e,t){var s,r;const i=t.config,n=t.globals;if(!Array.isArray(e))return e;n.streamgraphRawSeries||(n.streamgraphRawSeries=p(e,n));const a=n.streamgraphRawSeries;if(a.some(e=>function(e){for(let t=0;t<e.length;t++){const s=e[t],r=Array.isArray(s)?s[1]:s&&"object"==typeof s?s.y:s;if(Array.isArray(r)&&2===r.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[])))return t.streamgraphData=null,e;const h=(null==(s=i.plotOptions)?void 0:s.streamgraph)||{},c=-1!==m.indexOf(h.offset)?h.offset:"wiggle",u=-1!==x.indexOf(h.order)?h.order:"inside-out",f=null==(r=i.xaxis)?void 0:r.categories,g=function(e){return(e.collapsedSeriesIndices||[]).concat(e.ancillaryCollapsedSeriesIndices||[])}(n),{xs:b,rows:v,grids:A}=function(e,t){var s;const r=[],i=[],n=new Map,a=[];for(let o=0;o<e.length;o++){const h=Array.isArray(null==(s=e[o])?void 0:s.data)?e[o].data:[],c=new Map;for(let e=0;e<h.length;e++){const{x:s,y:a,rest:o}=y(h[e],e,t),u=s instanceof Date?s.getTime():s;n.has(u)||(n.set(u,r.length),r.push(s),i.push(l({},o))),c.set(n.get(u),d.parseNumber(a))}a.push(c)}return{xs:r,rows:i,grids:a}}(a,f),P=function(e){const t=[];for(let s=0;s<e.length;s++){const r=e[s]instanceof Date?e[s].getTime():e[s];if("number"!=typeof r||!isFinite(r))return null;t.push(s)}const s=t.map(t=>({j:t,v:e[t]instanceof Date?e[t].getTime():e[t]}));s.sort((e,t)=>e.v-t.v);const r=s.map(e=>e.j);for(let e=0;e<r.length;e++)if(r[e]!==e)return r;return null}(b),w=P?P.map(e=>b[e]):b,_=P?P.map(e=>v[e]):v,S=w.length;let k=!1;const F=[];for(let e=0;e<a.length;e++){const t=new Array(S);for(let s=0;s<S;s++){const r=A[e].get(P?P[s]:s);let i=null==r?0:Number(r);isFinite(i)||(i=0),i<0&&(k=!0,i=0),t[s]=i}F.push(t)}k&&!n.streamgraphWarnedNegative&&(n.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const Y=[];for(let e=0;e<a.length;e++)-1===g.indexOf(e)&&Y.push(e);let M=F;if("expand"===c){M=F.map(e=>e.slice());for(let e=0;e<S;e++){let t=0;for(let s=0;s<Y.length;s++)t+=M[Y[s]][e];if(t)for(let s=0;s<Y.length;s++)M[Y[s]][e]/=t}}const C=function(e,t,s){if("none"===e)return t.slice();if("inverse"===e)return t.slice().reverse();const r={},i={};for(let e=0;e<t.length;e++){const n=t[e],a=s[n];let l=0,o=-1/0,h=0;for(let e=0;e<a.length;e++)l+=a[e],a[e]>o&&(o=a[e],h=e);r[n]=l,i[n]=h}const n=t.slice().sort((e,t)=>i[e]-i[t]||e-t);let a=0,l=0;const o=[],h=[];for(let e=0;e<n.length;e++){const t=n[e];a<l?(a+=r[t],o.push(t)):(l+=r[t],h.push(t))}return h.reverse().concat(o)}(u,Y,M),L=function(e,t,s,r){const i=new Array(r).fill(0);if(0===r||0===t.length)return i;if("zero"===e||"expand"===e)return i;if("silhouette"===e){for(let e=0;e<r;e++){let r=0;for(let i=0;i<t.length;i++)r+=s[t[i]][e];i[e]=-r/2}return i}let n=0;for(let e=1;e<r;e++){let r=0,a=0;for(let i=0;i<t.length;i++){const n=s[t[i]],l=n[e];let o=(l-n[e-1])/2;for(let r=0;r<i;r++){const i=s[t[r]];o+=i[e]-i[e-1]}r+=l,a+=o*l}r&&(n-=a/r),i[e]=n}return i}(c,C,M,S),j=a.map(()=>null),I=a.map(()=>null);for(let e=0;e<C.length;e++)j[C[e]]=new Array(S),I[C[e]]=new Array(S);for(let e=0;e<S;e++){let t=L[e];for(let s=0;s<C.length;s++){const r=C[s],i=j[r],n=I[r];i[e]=t,t+=M[r][e],n[e]=t}}return t.streamgraphData={names:a.map((e,t)=>{var s;return null!=(s=null==e?void 0:e.name)?s:`Series ${t+1}`}),xs:w,values:F,lows:j,highs:I,order:C,offset:c,hidden:a.map((e,t)=>t).filter(e=>-1!==g.indexOf(e))},a.map((e,t)=>{const s=j[t],r=I[t];if(!s||!r)return o(l({},e),{data:[]});const i=new Array(S);for(let e=0;e<S;e++)i[e]=o(l({},_[e]),{x:w[e],y:[s[e],r[e]]});return o(l({},e),{data:i})})})?globalThis[b][v]=A:console.warn(`ApexCharts: registerSeriesTransform("${v}") expects a function (series, w) => series.`),c.default.registerFeatures({streamgraph:class{constructor(e,t){this.w=e,this.ctx=t,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(e){var t;const s=this.w,r=s.globals,i=s.layout.gridHeight,n=r.maxY-r.minY;if(!n||!isFinite(n))return i/2;const a=(e-r.minY)/n;return(null==(t=s.config.yaxis[0])?void 0:t.reversed)?a*i:i-a*i}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var e,t,s,r,i,n,a;const l=this.w;if(!this.isActive())return;const o=null==(t=null==(e=l.config.plotOptions)?void 0:e.streamgraph)?void 0:t.labels;if(!o||!1===o.show)return;const h=l.dom.elGraphical,c=l.streamgraphData;if(!h||!c)return;this.removeLabels();const d=new u(l,this.ctx),f=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(s=o.style)?void 0:s.fontSize)||"auto",p=(null==(r=o.style)?void 0:r.fontFamily)||l.config.chart.fontFamily,m=(null==(i=o.style)?void 0:i.fontWeight)||600,x=null==o.minWidth?24:o.minWidth,y=[];for(let e=0;e<c.order.length;e++){const t=c.order[e],s=this._placeLabel(t,{fontSize:g,fontFamily:p,fontWeight:m,minWidth:x,graphics:d});s&&y.push(s)}let b=0;for(const e of this._deconflict(y)){const t=e.k,s=d.drawText({x:e.x,y:e.y,text:e.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:e.fontSize,fontFamily:p,fontWeight:m,foreColor:(null==(a=null==(n=o.style)?void 0:n.colors)?void 0:a[t])||e.color,cssClass:"apexcharts-streamgraph-label"});s.node.setAttribute("data:realIndex",String(t)),f.add(s),b++}if(!b)return;const v=h.node.querySelector(".apexcharts-xaxis");v?h.node.insertBefore(f.node,v):h.add(f),this.holdUntilBandsLand(f)}_placeLabel(e,{fontSize:t,fontFamily:s,fontWeight:r,minWidth:i,graphics:n}){const a=this.w,l=a.streamgraphData,o=l.lows[e],h=l.highs[e];if(!o||!h)return null;const c=a.globals.seriesXvalues[e],u=o.length;if(!Array.isArray(c)||c.length<u||0===u)return null;const d=new Array(u);let f=0;for(let e=0;e<u;e++){const t=Math.abs(this._yPx(h[e])-this._yPx(o[e]));d[e]=t,t>f&&(f=t)}if(f<=0)return null;const g=this._resolveFontSize(t,f),p=String(l.names[e]);let m=g,x=n.getTextRects(p,`${m}px`,s,"",!0,r);if(f<x.height+6)return null;const y=this._widestRun(d,c,x.height+6,u);if(!y)return null;if(x.width>y.width&&"auto"===t){const e=Math.floor(m*(y.width/x.width));if(e<this._autoBounds().min)return null;if(m=e,x=n.getTextRects(p,`${m}px`,s,"",!0,r),f<x.height+6)return null}const b=x.height+6,v=[];for(const t of this._runs(d,b,u)){const a=Number(c[t.l]),l=Number(c[t.r]);if(!isFinite(a)||!isFinite(l))continue;let d=l-a;if(d<=0&&u>1){const e=Math.abs(Number(c[Math.min(t.r+1,u-1)])-Number(c[Math.max(t.l-1,0)]));d=isFinite(e)?e:0}if(d<i||d<.35*x.width)continue;const f=x.width<=d?p:n.getTextBasedOnMaxWidth({text:p,maxWidth:d,fontSize:`${m}px`,fontFamily:s,fontWeight:r});if(!f||"..."===f)continue;const g=f===p?x.width:x.width*(f.length/p.length),y=[a+d/2];d>2.2*g&&y.push(a+g/2+2,l-g/2-2);for(const s of y){let r=t.l,i=1/0;for(let e=t.l;e<=t.r;e++){const t=Math.abs(Number(c[e])-s);t<i&&(i=t,r=e)}v.push({x:s,y:(this._yPx(o[r])+this._yPx(h[r]))/2,text:f,color:this._contrastOn(e),fontSize:`${m}px`,width:g,height:x.height})}if(v.length>=6)break}return v.length?{k:e,weight:f,candidates:v}:null}_runs(e,t,s){const r=[];let i=0;for(;i<s;){if(e[i]<t){i++;continue}let n=i,a=e[i];for(;n+1<s&&e[n+1]>=t;)n++,e[n]>a&&(a=e[n]);r.push({l:i,r:n,maxT:a}),i=n+1}return r.sort((e,t)=>t.maxT-e.maxT)}_widestRun(e,t,s,r){let i=-1;for(const n of this._runs(e,s,r)){const e=Number(t[n.r])-Number(t[n.l]);isFinite(e)&&e>i&&(i=e)}return i>=0?{width:i}:null}_deconflict(e){const t=e.slice().sort((e,t)=>t.weight-e.weight),s=[],r=e=>!s.some(t=>e.left<t.box.right&&e.right>t.box.left&&e.top<t.box.bottom&&e.bottom>t.box.top);for(const e of t)for(const t of e.candidates){const i={left:t.x-t.width/2,right:t.x+t.width/2,top:t.y-t.height/2,bottom:t.y+t.height/2};if(r(i)){s.push(o(l({k:e.k},t),{box:i}));break}}return s}_autoBounds(){var e,t;const s=(null==(t=null==(e=this.w.config.plotOptions)?void 0:e.streamgraph)?void 0:t.labels)||{};return{min:null==s.minFontSize?9:s.minFontSize,max:null==s.maxFontSize?30:s.maxFontSize}}_resolveFontSize(e,t){if("auto"!==e){const t=parseFloat(e);return isFinite(t)&&t>0?t:12}const{min:s,max:r}=this._autoBounds();return Math.max(s,Math.min(r,Math.round(.36*t)))}_contrastOn(e){var t;const s=this.w,r=null==(t=s.globals.colors)?void 0:t[e],i="string"==typeof r?d.parseHex(r):null;return i?d.relativeLuminance(i)>.45?"#000000":"#ffffff":s.config.chart.foreColor}removeLabels(){const e=this.w.dom.elGraphical,t=e&&e.node.querySelector(".apexcharts-streamgraph-labels");t&&t.parentNode&&t.parentNode.removeChild(t)}bindHover(){const e=this.w;if(!g.isBrowser())return;if(!1===this._hoverCfg().show)return;const t=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");t&&!t.__apexStreamHover&&(t.__apexStreamHover=!0,t.addEventListener("mousemove",e=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(e))}),t.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var e,t;return(null==(t=null==(e=this.w.config.plotOptions)?void 0:e.streamgraph)?void 0:t.hover)||{}}_bandAt(e){const t=this.w,s=t.streamgraphData;if(!s||!s.order.length)return-1;const r=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");if(!r)return-1;const i=r.getBoundingClientRect(),n=t.globals.svgWidth?i.width/t.globals.svgWidth:1,a=f.screenXToPlotPx(t,e.clientX),l=(e.clientY-i.top)/(n||1)-t.layout.translateY;if(a<0||a>t.layout.gridWidth)return-1;if(l<0||l>t.layout.gridHeight)return-1;const o=t.globals.seriesXvalues[s.order[0]];if(!Array.isArray(o)||!o.length)return-1;const h=t.interact?t.interact.capturedDataPointIndex:-1;let c=-1;if(h>=0&&h<o.length)c=h;else{let e=1/0;for(let t=0;t<o.length;t++){const s=Math.abs(Number(o[t])-a);s<e&&(e=s,c=t)}}if(c<0)return-1;let u=-1,d=1/0;for(let e=0;e<s.order.length;e++){const t=s.order[e],r=this._yPx(s.highs[t][c]),i=this._yPx(s.lows[t][c]),n=Math.min(r,i),a=Math.max(r,i);if(l>=n&&l<=a)return t;const o=l<n?n-l:l-a;o<d&&(d=o,u=t)}return u}_dim(e){const t=this.w;if(e===this._hovered)return;this._hovered=e;const s=this._hoverCfg(),r=null==s.opacity?.35:s.opacity,i=t.dom.baseEl.querySelectorAll(".apexcharts-series"),n=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),a=(t,s)=>e<0||s===e;for(let e=0;e<i.length;e++){const t=i[e];t.style.transition="opacity .15s ease",t.style.opacity=a(0,Number(t.getAttribute("data:realIndex")))?"":String(r)}for(let e=0;e<n.length;e++){const s=n[e];s.style.transition="opacity .15s ease, fill .15s ease",a(0,Number(s.getAttribute("data:realIndex")))?this._restoreLabel(s):(s.getAttribute("data:fill")||s.setAttribute("data:fill",s.getAttribute("fill")||""),s.setAttribute("fill",t.config.chart.foreColor),s.style.opacity="0.65")}}_restoreLabel(e){const t=e.getAttribute("data:fill");t&&e.setAttribute("fill",t),e.style.opacity=""}clearDim(){this._hovered=-1;const e=this.w;if(!e.dom.baseEl)return;const t=e.dom.baseEl.querySelectorAll(".apexcharts-series");for(let e=0;e<t.length;e++){t[e].style.opacity=""}const s=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let e=0;e<s.length;e++)this._restoreLabel(s[e])}holdUntilBandsLand(e){const t=this.w;g.isBrowser()&&t.globals.shouldAnimate&&!t.globals.animationEnded&&(e.node.classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:e.node,holdUntilComplete:!0}))}}});const P=c.__apex_CoreUtils,w=c.__apex_Fill,_=c.__apex_DataLabels,S=c.__apex_Markers,k=c.__apex_charts_Scatter,F=c.__apex_Series;class Y{constructor(e){this.w=e.w,this.lineCtx=e}sameValueSeriesFix(e,t,s){const r=this.w,i=t[e];return"gradient"!==r.config.fill.type&&"gradient"!==r.config.fill.type[s]||!i.every(e=>e===i[0])||(t[e]=i.slice(),t[e][i.length-1]+=1e-6),t}calculatePoints({series:e,realIndex:t,x:s,y:r,i:i,j:n,prevY:a}){const l=this.w,o=[],h=[];let c=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.axisFlags.isXNumeric&&(c=(l.seriesData.seriesX[t][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===n&&(o.push(c),h.push(d.isNumber(e[i][0])?a+l.config.markers.offsetY:null)),o.push(s+l.config.markers.offsetX),h.push(d.isNumber(e[i][n+1])?r+l.config.markers.offsetY:null),{x:o,y:h}}checkPreviousPaths({pathFromLine:e,pathFromArea:t,realIndex:s}){const r=this.w;for(let i=0;i<r.globals.previousPaths.length;i++){const n=r.globals.previousPaths[i];("line"===n.type||"area"===n.type)&&n.paths.length>0&&parseInt(n.realIndex,10)===parseInt(s,10)&&("line"===n.type?(this.lineCtx.appendPathFrom=!1,e=r.globals.previousPaths[i].paths[0].d):"area"===n.type&&(this.lineCtx.appendPathFrom=!1,t=r.globals.previousPaths[i].paths[0].d,r.config.stroke.show&&r.globals.previousPaths[i].paths[1]&&(e=r.globals.previousPaths[i].paths[1].d)))}return{pathFromLine:e,pathFromArea:t}}previousRangeAreaPath(e){for(const t of this.w.globals.previousPaths)if("rangeArea"===t.type&&parseInt(t.realIndex,10)===parseInt(String(e),10)&&1===t.paths.length&&t.paths[0].d)return t.paths[0].d;return null}determineFirstPrevY({i:e,realIndex:t,series:s,prevY:r,lineYPosition:i,translationsIndex:n}){var a,l,o;const h=this.w,c=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(c)if(e>0){const e=this.lineCtx.stackTopAt(t,0);i=void 0===e?this.lineCtx.zeroY:e}else i=this.lineCtx.zeroY;else i=this.lineCtx.zeroY;r=i-s[e][0]/this.lineCtx.yRatio[n]+2*(this.lineCtx.isReversed?s[e][0]/this.lineCtx.yRatio[n]:0)}else if(c&&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]){r=i=this.lineCtx.prevSeriesY[t][0];break}return{prevY:r,lineYPosition:i}}}function M(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 C=e=>{const t=function(e){const t=[];let s=e[0],r=e[1],i=t[0]=j(s,r),n=1;for(let a=e.length-1;n<a;n++)s=r,r=e[n+1],t[n]=.5*(i+(i=j(s,r)));return t[n]=i,t}(e),s=e.length-1,r=[];let i,n,a,l;for(let r=0;r<s;r++)a=j(e[r],e[r+1]),Math.abs(a)<1e-6?t[r]=t[r+1]=0:(i=t[r]/a,n=t[r+1]/a,l=i*i+n*n,l>9&&(l=3*a/Math.sqrt(l),t[r]=l*i,t[r+1]=l*n));for(let i=0;i<=s;i++)l=(e[Math.min(s,i+1)][0]-e[Math.max(0,i-1)][0])/(6*(1+t[i]*t[i])),r.push([l||0,t[i]*l||0]);return r},L={points(e){const t=C(e),s=e[1],r=e[0],i=[],n=t[1],a=t[0];i.push(r,[r[0]+a[0],r[1]+a[1],s[0]-n[0],s[1]-n[1],s[0],s[1]]);for(let s=2,r=t.length;s<r;s++){const r=e[s],n=t[s];i.push([r[0]-n[0],r[1]-n[1],r[0],r[1]])}return i},slice(e,t,s){const r=e.slice(t,s);if(t){if(s-t>1&&r[1].length<6){const e=r[0].length;r[1]=[2*r[0][e-2]-r[0][e-4],2*r[0][e-1]-r[0][e-3]].concat(r[1])}r[0]=r[0].slice(-2)}return r}};function j(e,t){return(t[1]-e[1])/(t[0]-e[0])}const I=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function X(e,t){const{ax:s,bx:r,ay:i,by:n}=t,a=[],l=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].toUpperCase(),t=(o[2].match(I)||[]).map(parseFloat);if("Z"===e){a.push("z");continue}if("H"===e){for(const e of t)a.push(`H ${s*e+r}`);continue}if("V"===e){for(const e of t)a.push(`V ${i*e+n}`);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]+r} ${i*t[e+6]+n}`);continue}const l=[];for(let e=0;e+1<t.length;e+=2)l.push(`${s*t[e]+r} ${i*t[e+1]+n}`);l.length&&a.push(`${e} ${l.join(" ")}`)}return a.join(" ")}const R=c.__apex_Animations,N=c.__apex_BrowserAPIs_BrowserAPIs,z=c.__apex_Easing_resolveEasing,D=c.__apex_PathMorphing_parsePath,O=c.__apex_PathMorphing_arrayToPath;function $(e,t,s){if(!e||"string"!=typeof e)return null;const r=D(e);if(!r.length||"M"!==r[0][0])return null;for(let e=1;e<r.length;e++)if("M"===r[e][0])return null;let i=r,n=null;if(s){if(r.length<5)return null;if(n=r.slice(-3),i=r.slice(0,-3),"Z"!==n[2][0])return null;if("L"!==n[1][0])return null;if("L"!==n[0][0]&&"C"!==n[0][0])return null}else if("Z"===r[r.length-1][0])return null;if(i.length!==t||i.length<2)return null;const a=i[1][0];if("L"!==a&&"C"!==a)return null;for(let e=2;e<i.length;e++)if(i[e][0]!==a)return null;const l=i.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:i,closing:n,segType:a,anchors:l}}function T(e,t,s){return[e[0]+(t[0]-e[0])*s,e[1]+(t[1]-e[1])*s]}function W(e,t,s){const r=e,i=[t[1],t[2]],n=[t[3],t[4]],a=[t[5],t[6]],l=T(r,i,s),o=T(i,n,s),h=T(n,a,s),c=T(l,o,s),u=T(o,h,s),d=T(c,u,s);return{first:["C",l[0],l[1],c[0],c[1],d[0],d[1]],second:["C",u[0],u[1],h[0],h[1],a[0],a[1]],mid:d}}function B(e,t,s){const r=[t[1],t[2]],i=T(e,r,s);return{first:["L",i[0],i[1]],second:["L",r[0],r[1]],mid:i}}function E(e,t){const{body:s,closing:r,segType:i,anchors:n}=e,a=n.length,l=t.length,o=e=>"C"===i?["C",e[0],e[1],e[0],e[1],e[0],e[1]]:["L",e[0],e[1]],h=[["M",n[0][0],n[0][1]]];let c=0;for(;c<l&&0!==t[c];)c++;for(let e=1;e<=c;e++)h.push(o(n[0]));let u=c+1;for(let e=0;e<a-1;e++){let r=0;for(;u+r<l&&-1===t[u+r];)r++;const a=s[e+1];if(r){const t=r+1;let s=n[e],l=a;for(let e=0;e<r;e++){const r=1/(t-e),n="C"===i?W(s,l,r):B(s,l,r);h.push(n.first),s=n.mid,l=n.second}h.push(l)}else h.push(a.slice());u+=r+1}for(;u<l;)h.push(o(n[a-1])),u++;return r&&r.forEach(e=>h.push(e.slice())),h}function H(e,t,s,r,i,n){const a=$(e,r,n);if(!a)return null;const l=$(t,i,n);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:O(E(a,o)),toInterp:O(E(l,h))}}function q(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 r=null!=(t=s.largeDatasetThreshold)?t:0;return!(r>0&&e.globals.dataPoints>r)&&!!(g.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate)}function V(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 J(e,t,s=0|(s=>null==(s=e.seriesData.series[t])?void 0:s.length)()){return V(Array.from({length:s},(s,r)=>function(e,t,s){var r,i,n,a;if(null==(r=e.axisFlags)?void 0:r.isXNumeric){const r=null==(n=null==(i=e.seriesData)?void 0:i.seriesX)?void 0:n[t];if(r&&r.length&&null!=r[s])return"x:"+r[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,r)))}function U(e,t,s=!1,r=!1){var i,n;if(!q(e))return null;const a=e.globals.prevStreamFrame;if(!a)return null;const l=null==(i=a.seriesY)?void 0:i[t],o=null==(n=e.seriesData.series)?void 0:n[t];if(!Array.isArray(l)||!Array.isArray(o))return null;if(!l.length||!o.length)return null;const h=V(l.map((e,s)=>function(e,t,s){var r,i;if(e.isXNumeric){const i=null==(r=e.seriesX)?void 0:r[t];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const n=null==(i=e.labels)?void 0:i[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}(a,t,s))),c=J(e,t),u=function(e,t){const s=new Map;e.forEach((e,t)=>{s.has(e)||s.set(e,t)});const r=new Array(t.length),i=new Set;let n=-1,a=!0,l=e.length===t.length;t.forEach((e,t)=>{const o=s.has(e)&&!i.has(s.get(e))?s.get(e):-1;r[t]=o,-1!==o&&(i.add(o),o<n&&(a=!1),n=o),o!==t&&(l=!1)});const o=[];for(let t=0;t<e.length;t++)i.has(t)||o.push(t);return{toOld:r,exits:o,ordered:a,changed:!l}}(h,c);return(u.ordered||r)&&(u.changed||s)?{join:u,oldKeys:h,newKeys:c}:null}function K(e){var t,s;const r=e.config.chart.animations;return z(null!=(s=null==(t=r.dynamicAnimation)?void 0:t.easing)?s:r.easing)}function Z(e,t,s,r,i){const n=performance.now(),a=l=>{if(e.globals.isDestroyed)return;const o=Math.max(0,Math.min(1,(l-n)/t));r(s(o),o),o<1?N.requestAnimationFrame(a):i&&i()};N.requestAnimationFrame(a)}function G(e,{elPointsMain:t,realIndex:s,speed:r}){var i,n,a,l;if(!(null==t?void 0:t.node))return!1;const o=U(e,s,!0);if(!o)return!1;const h=e.globals.prevStreamFrame;if(!h)return!1;const c=null==(i=h.xPixels)?void 0:i[s],u=null==(n=h.yPixels)?void 0:n[s];if(!c||!u)return!1;const d=t.node.querySelectorAll(".apexcharts-marker");if(!d.length)return!1;const f=(null==(a=e.globals.seriesXvalues)?void 0:a[s])||[],g=(null==(l=e.globals.seriesYvalues)?void 0:l[s])||[],p=K(e),m=Math.max(1,r||1);return t.node.classList.remove("apexcharts-element-hidden"),d.forEach(t=>{var r,i,n,a,l,d,x,y,b;const v=parseInt(null!=(i=null!=(r=t.getAttribute("j"))?r:t.getAttribute("rel"))?i:"",10);if(!isFinite(v)||v<0||v>=o.join.toOld.length)return;const A=o.join.toOld[v],P=null!=f[v]&&null!=g[v]?[f[v],g[v]]:null;if(-1===A||!P){const s=t.style;return s.opacity="0",void Z(e,m,p,e=>{s.opacity=String(e)},()=>{s.opacity=""})}const w=(null!=(n=c[A])?n:NaN)-P[0],_=(null!=(a=u[A])?a:NaN)-P[1];if(!isFinite(w)||!isFinite(_))return;const S=null!=(x=null==(d=null==(l=h.rPixels)?void 0:l[s])?void 0:d[A])?x:NaN,k=parseFloat(null!=(b=null!=(y=t.getAttribute("r"))?y:t.getAttribute("default-marker-size"))?b:""),F=isFinite(S)&&isFinite(k)&&k>0&&Math.abs(S-k)>.25;if(!(Math.abs(w)>=.5||Math.abs(_)>=.5)&&!F)return;const Y=e=>{const s=w*(1-e),r=_*(1-e);if(F){const i=(S+(k-S)*e)/k;t.setAttribute("transform",`translate(${s+P[0]*(1-i)}, ${r+P[1]*(1-i)}) scale(${i})`)}else t.setAttribute("transform",`translate(${s}, ${r})`)};Y(0),Z(e,m,p,Y,()=>{t.removeAttribute("transform")})}),!0}function Q(e,t,s,r){e.setAttribute("transform",`translate(${t*(1-r)}, ${s*(1-r)}) scale(${r})`)}function ee(e,{type:t,realIndex:s,pathFromLine:r,pathFromArea:i,linePaths:n,areaPaths:a}){var l,o;const h=U(e,s);if(!h)return null;const{join:c,oldKeys:u,newKeys:d}=h,f=e.globals.prevStreamFrame;if(!f)return null;const g=null==(l=f.seriesY)?void 0:l[s],p=null==(o=e.seriesData.series)?void 0:o[s];if(g.length<2||p.length<2)return null;if(g.some(e=>null===e)||p.some(e=>null===e))return null;const m=function(e,t){const s=new Set(e.exits),r=[];let i=0;for(let t=0;t<e.toOld.length;t++){const n=e.toOld[t];if(-1!==n){for(;i<n;)s.has(i)&&r.push({oldJ:i,newJ:-1}),i++;r.push({oldJ:n,newJ:t}),i=n+1}else r.push({oldJ:-1,newJ:t})}for(;i<t;)s.has(i)&&r.push({oldJ:i,newJ:-1}),i++;return r}(c,u.length),x={};return Array.isArray(n)&&1===n.length&&r&&(x.line=H(r,n[0],m,u.length,d.length,!1)),"area"===t&&Array.isArray(a)&&1===a.length&&i&&(x.area=H(i,a[0],m,u.length,d.length,!0)),x.line||x.area?x:null}class te{constructor(e,t,s,r){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)||r,this.scatter=new k(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Y(this),this.markers=new S(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,this._shapeOnly=!1}draw(e,t,s,r){var i;const n=this.w,a=this.ctx.highlightFilter,l=new u(this.w),o=n.globals.comboCharts?t:n.config.chart.type,h=l.group({class:`apexcharts-${o}-series apexcharts-plot-series`}),c=new P(this.w);if(this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=c.getLogSeries(e,s),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[],this.prevSeriesYByX=new Map,this._stackXs=null,n.config.chart.stacked&&n.axisFlags.isXNumeric){const t=e.map((e,t)=>n.globals.comboCharts?s[t]:t).filter(e=>!this._hidden(e)).map(e=>n.seriesData.seriesX[e]||[]);t.some(e=>e.length!==t[0].length||e.some((e,s)=>e!==t[0][s]))&&(this._stackXs=[...new Set(t.flat())].sort((e,t)=>e-t))}const d=[];for(let t=0;t<e.length;t++){const i=n.globals.comboCharts?s[t]:t;e=this.lineHelpers.sameValueSeriesFix(t,e,i);const l=this.yRatio.length>1?i:0,h=this._collapsedBaselineRow(e,t,i);this._shapeOnly=!!h,h&&((e=e.slice())[t]=h,"rangeArea"===o&&r&&((r=r.slice())[t]=h)),this._initSerieVariables(e,t,i),F.addCollapsedClassToSeries(this.w,this.elSeries,i);const c=this._buildSeriesPaths(o,e,t,i,l,s,r);this._handlePaths({type:o,realIndex:i,i:t,paths:c}),null==a||a.line(this,o,e,t,i,l,c),this.markers.flushBatch(this.elPointsMain,i),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),d.push(this.elSeries)}if(void 0!==(null==(i=n.config.series[0])?void 0:i.zIndex)&&d.sort((e,t)=>Number(e.node.getAttribute("zIndex"))-Number(t.node.getAttribute("zIndex"))),n.config.chart.stacked)for(let e=d.length-1;e>=0;e--)h.add(d[e]);else for(let e=0;e<d.length;e++)h.add(d[e]);return h}_buildSeriesPaths(e,t,s,r,i,n,a){const h=this.w,c=[],u=[],d=[];let f=h.globals.padHorizontal+this.categoryAxisCorrection;h.axisFlags.isXNumeric&&h.seriesData.seriesX.length>0&&(f=(h.seriesData.seriesX[r][0]-h.globals.minX)/this.xRatio),d.push(f);const g=f;let p,m=this.zeroY,x=this.zeroY;m=this.lineHelpers.determineFirstPrevY({i:s,realIndex:r,series:t,prevY:m,lineYPosition:0,translationsIndex:i}).prevY,"monotoneCubic"===h.config.stroke.curve&&null===t[s][0]?c.push(null):c.push(m);const y=m;let b;"rangeArea"===e&&(b=this.lineHelpers.determineFirstPrevY({i:s,realIndex:r,series:a,prevY:x,lineYPosition:0,translationsIndex:i}),x=b.prevY,p=x,u.push(null!==c[0]?x:null));const v=this._calculatePathsFrom(r,m),A=[c[0]],P=[u[0]],w={type:e,series:t,realIndex:r,translationsIndex:i,i:s,x:f,y:1,pX:g,pY:y,pathsFrom:v,linePaths:[],areaPaths:[],seriesIndex:n,lineYPosition:0,xArrj:d,yArrj:c,y2Arrj:u,seriesRangeEnd:a},_=this._iterateOverDataPoints(o(l({},w),{iterations:"rangeArea"===e?t[s].length-1:void 0,isRangeStart:!0}));if("rangeArea"===e){const e=this._calculatePathsFrom(r,x),t=this._iterateOverDataPoints(o(l({},w),{series:a,xArrj:[f],yArrj:A,y2Arrj:P,pY:p,areaPaths:_.areaPaths,pathsFrom:e,iterations:a[s].length-1,isRangeStart:!1})),i=_.linePaths.length/2;for(let e=0;e<i;e++)_.linePaths[e]=t.linePaths[e+i]+_.linePaths[e];_.linePaths.splice(i);const n=1===_.linePaths.length?this.lineHelpers.previousRangeAreaPath(r):null;_.pathFromLine=null!=n?n:t.pathFromLine+_.pathFromLine}else/z\s*$/i.test(_.pathFromArea)||(_.pathFromArea+="z");return _}_collapsedBaselineRow(e,t,s){const r=this.w,i=r.globals;if(r.config.chart.stacked||this.pointsChart)return null;if(!Array.isArray(e[t])||0!==e[t].length)return null;if(!this._hidden(s))return null;const n=r.axisFlags.isXNumeric?(r.seriesData.seriesX[s]||[]).length:i.dataPoints;if(!n)return null;const a=d.isNumber(i.minYArr[s])?i.minYArr[s]:i.minY,l=d.isNumber(i.maxYArr[s])?i.maxYArr[s]:i.maxY,o=Math.min(Math.max(0,a),l);return new Array(n).fill(d.isNumber(o)?o:0)}_initSerieVariables(e,t,s){const r=this.w,i=new u(this.w);this.xDivision=r.layout.gridWidth/(r.globals.dataPoints-("on"===r.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(r.config.stroke.width)?r.config.stroke.width[s]:r.config.stroke.width;let n=0;this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[s],n=s),this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.zeroY=r.layout.gridHeight-this.baseLineY[n]-(this.isReversed?r.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[n]:0),this.areaBottomY=this.zeroY,(this.zeroY>r.layout.gridHeight||"end"===r.config.plotOptions.area.fillTo)&&(this.areaBottomY=r.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const a=r.config.series[s];if(this.elSeries=i.group({class:"apexcharts-series",zIndex:void 0!==a.zIndex?a.zIndex:s,seriesName:d.escapeString(r.seriesData.seriesNames[s])}),this.elPointsMain=i.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,r.globals.hasNullValues){const e=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[r.layout.gridHeight+r.globals.markers.largestSize]},seriesIndex:t,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==e&&this.elPointsMain.add(e)}this.elDataLabelsWrap=i.group({class:"apexcharts-datalabels","data:realIndex":s});const l=e[t].length===r.globals.dataPoints;this.elSeries.attr({"data:longestSeries":l,rel:t+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom(e,t){const s=new u(this.w);let r=s.move(0,this.areaBottomY)+s.line(0,this.areaBottomY),i=r;if(this.w.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:r,pathFromArea:i,realIndex:e});r=t.pathFromLine,i=t.pathFromArea}return{prevY:t,pathFromLine:r,pathFromArea:i}}_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)}_hidden(e){const t=this.w.globals;return t.collapsedSeriesIndices.indexOf(e)>-1||t.ancillaryCollapsedSeriesIndices.indexOf(e)>-1}_recordStackTops(e,t,s=this.w.seriesData.series[e]){if(this.w.config.chart.stacked&&Array.isArray(t)&&!this._hidden(e))for(let r=0;r<t.length;r++){const i=this._stackKey(e,r);if(null==i)continue;const n=t[r];d.isNumber(n)&&null!=(null==s?void 0:s[r])&&this.prevSeriesYByX.set(i,n)}}_handlePaths({type:e,realIndex:t,i:s,paths:r}){var i,n,a,h,c,d,f;const g=this.w,p=new u(this.w),m=function(e,t){const s=e&&e.renderer;return s&&s.kind&&"svg"!==s.kind?s:t}(this.ctx,p),x=new w(this.w);this.marks=[],this.prevSeriesY.push(r.yArrj),this._recordStackTops(t,r.yArrj);let y=null;"line"!==e&&"area"!==e||!g.globals.dataChanged||(y=function(e,t,s,r){var i;const n=e.globals,a=n.prevStreamFrame;if(!a||!n.dataChanged||!(null==(i=e.axisFlags)?void 0:i.isXNumeric))return null;const l=a.seriesX[t],o=a.seriesY[t],h=e.seriesData.seriesX[t],c=e.seriesData.series[t];if(!(l&&o&&h&&c))return null;if(l.length<3||h.length<3)return null;let u=-1;for(let e=0;e<l.length;e++)if(l[e]===h[0]){u=e;break}if(-1===u)return null;const d=Math.min(l.length-u,h.length);if(d<2)return null;const f=h.length-d;if(0===u&&0===f)return null;for(let e=0;e<d;e++){if(l[u+e]!==h[e])return null;const t=o[u+e],s=c[e];if(t!==s&&(null!=t||null!=s))return null}const g=a.xPixels[t],p=a.yPixels[t];if(!g||!p)return null;let m=-1,x=-1;for(let e=0;e<d;e++)null!=g[u+e]&&null!=p[u+e]&&null!=s[e]&&null!=r[e]&&(-1===m&&(m=e),x=e);if(-1===m||x<=m)return null;const y=s[m],b=s[x],v=g[u+m],A=g[u+x];if(Math.abs(b-y)<1e-6)return null;const P=(A-v)/(b-y),w=v-P*y;if(!isFinite(P)||!isFinite(w))return null;if(Math.abs(P-1)>.02)return null;if(Math.abs(w)<.5)return null;let _=m,S=m;for(let e=m;e<=x;e++){const t=r[e];null!=t&&null!=p[u+e]&&(t<r[_]&&(_=e),t>r[S]&&(S=e))}let k=1,F=0;const Y=r[_],M=r[S];if(Math.abs(M-Y)>1e-6?(k=(p[u+S]-p[u+_])/(M-Y),F=p[u+_]-k*Y):F=p[u+_]-Y,!isFinite(k)||!isFinite(F)||k<.2||k>5)return null;const C=Math.floor((m+x)/2);if(C!==m&&C!==x&&null!=s[C]&&null!=g[u+C]){const e=P*s[C]+w;if(Math.abs(e-g[u+C])>1.5)return null;if(null!=r[C]&&null!=p[u+C]){const e=k*r[C]+F;if(Math.abs(e-p[u+C])>1.5)return null}}return n.streamScrolled=!0,{ax:P,bx:w,ay:k,by:F}}(g,t,r.xArrj,r.yArrj));let b=null;y||"line"!==e&&"area"!==e||(b=ee(g,{type:e,realIndex:t,pathFromLine:r.pathFromLine,pathFromArea:r.pathFromArea,linePaths:r.linePaths,areaPaths:r.areaPaths})),g.globals.seriesXvalues[t]=r.xArrj,g.globals.seriesYvalues[t]=r.yArrj;const v=g.config.forecastDataPoints;if(v.count>0&&"rangeArea"!==e){const e=r.xArrj.length-v.count-1,s=g.axisFlags.isXNumeric?(g.seriesData.seriesX[t][e]-g.globals.minX)/this.xRatio:g.globals.padHorizontal+this.categoryAxisCorrection+e*this.xDivision,i=p.drawRect(s,0,g.layout.gridWidth,g.layout.gridHeight,0);g.dom.elForecastMask.appendChild(i.node);const n=p.drawRect(0,0,s,g.layout.gridHeight,0);g.dom.elNonForecastMask.appendChild(n.node)}if(this.pointsChart)G(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed}),function(e,{elPointsMain:t,realIndex:s,speed:r}){if(!(null==t?void 0:t.node)||!q(e))return!1;if(-1===(e.globals.risingSeries||[]).indexOf(s))return!1;const i=t.node.querySelectorAll(".apexcharts-marker");if(!i.length)return!1;const n=K(e);t.node.classList.remove("apexcharts-element-hidden"),i.forEach(t=>{const s=t.getBBox(),i=s.x+s.width/2,a=s.y+s.height/2;Q(t,i,a,0),Z(e,Math.max(1,r||1),n,e=>Q(t,i,a,e),()=>t.removeAttribute("transform"))})}(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed}),(g.seriesData.series[t]||[]).length||function(e,{elPointsMain:t,realIndex:s,speed:r,drawPoint:i}){var n,a,l;if(!(null==t?void 0:t.node)||!q(e))return!1;if(-1===(e.globals.collapsingSeriesIndices||[]).indexOf(s))return!1;const o=e.globals.prevStreamFrame,h=null==(n=null==o?void 0:o.xPixels)?void 0:n[s],c=null==(a=null==o?void 0:o.yPixels)?void 0:a[s];if(!Array.isArray(h)||!Array.isArray(c))return!1;const u=(null==(l=null==o?void 0:o.rPixels)?void 0:l[s])||[],d=e.globals.markers.size[s]||0,f=K(e);let g=!1;for(let n=0;n<h.length;n++){const a=h[n],l=c[n];if(null==a||null==l||!isFinite(a)||!isFinite(l))continue;const o=isFinite(u[n])?u[n]:d;if(!(o>0))continue;const p=i(a,l,o,n);if(!(null==p?void 0:p.node))continue;t.add(p);const m=p.node;m.classList.add("apexcharts-marker-exit");const x=R.trackSeriesTween(e,s);Z(e,Math.max(1,r||1),f,e=>Q(m,a,l,1-e),()=>{Q(m,a,l,0),x()}),g=!0}g&&t.node.classList.remove("apexcharts-element-hidden")}(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed,drawPoint:(e,s,r,i)=>this.scatter.drawPoint(e,s,r,t,i,i)});else{g.globals.delayedElements.push({el:this.elPointsMain.node,index:t});G(g,{elPointsMain:this.elPointsMain,realIndex:t,speed:g.config.chart.animations.dynamicAnimation.speed})||"line"!==e||g.config.stroke.show||!g.globals.dataChanged&&!g.globals.resized||this.elPointsMain.node.classList.remove("apexcharts-element-hidden"),U(g,t)&&(null==(i=this.elDataLabelsWrap)?void 0:i.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),g.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0}))}const A={i:s,realIndex:t,animationDelay:s,initialSpeed:g.config.chart.animations.speed,dataChangeSpeed:g.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${e}`},P=r.numericXY,_="line"===e||"area"===e,S=_&&r.linePaths.length>1?[r.linePaths.join(" ")]:r.linePaths,k=_&&r.areaPaths.length>1?[r.areaPaths.join(" ")]:r.areaPaths;if("area"===e){const e=x.fillPath({seriesNumber:t});for(let t=0;t<k.length;t++){const s=m.renderPaths(o(l({},A),{pathFrom:y?X(r.areaPaths[t],y):null!=(a=null==(n=null==b?void 0:b.area)?void 0:n.from)?a:r.pathFromArea,pathTo:k[t],pathToNumeric:P?{xs:P.xs,ys:P.ys,closeY:P.areaCloseY}:void 0,pathToInterp:null==(h=null==b?void 0:b.area)?void 0:h.toInterp,scrollMorph:!!y,stroke:"none",strokeWidth:0,strokeLinecap:null,fill:e}));this.elSeries.add(s),this.marks.push(s)}}if(g.config.stroke.show&&!this.pointsChart){let i=null;if("line"===e)i=x.fillPath({seriesNumber:t,i:s});else if("solid"===g.config.stroke.fill.type)i=g.globals.stroke.colors[t];else{const e=g.config.fill;g.config.fill=g.config.stroke.fill,i=x.fillPath({seriesNumber:t,i:s}),g.config.fill=e}for(let s=0;s<S.length;s++){let n=i;"rangeArea"===e&&(n=x.fillPath({seriesNumber:t}));const a=o(l({},A),{pathFrom:y?X(r.linePaths[s],y):null!=(d=null==(c=null==b?void 0:b.line)?void 0:c.from)?d:r.pathFromLine,pathTo:S[s],pathToNumeric:P?{xs:P.xs,ys:P.ys}:void 0,pathToInterp:null==(f=null==b?void 0:b.line)?void 0:f.toInterp,scrollMorph:!!y,stroke:i,strokeWidth:this.strokeWidth,strokeLinecap:g.config.stroke.lineCap,fill:"rangeArea"===e?n:"none"}),h=m.renderPaths(a);if(this.elSeries.add(h),this.marks.push(h),h.attr("fill-rule","evenodd"),v.count>0&&"rangeArea"!==e){const e=m.renderPaths(a);e.node.setAttribute("stroke-dasharray",v.dashArray),v.strokeWidth&&e.node.setAttribute("stroke-width",v.strokeWidth),this.elSeries.add(e),e.attr("clip-path",`url(#forecastMask${g.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${g.globals.cuid})`)}}}}_iterateOverDataPoints({type:e,series:t,iterations:s,realIndex:r,translationsIndex:i,i:n,x:a,y:l,pX:o,pY:h,pathsFrom:c,linePaths:f,areaPaths:g,seriesIndex:p,lineYPosition:m,xArrj:x,yArrj:y,y2Arrj:b,isRangeStart:v,seriesRangeEnd:A}){var P,w,_;const S=this.w,k=new u(this.w),F=this.yRatio,Y=c.prevY;let C,L,{pathFromLine:j,pathFromArea:I}=c;const X=d.isNumber(S.globals.minYArr[r])?S.globals.minYArr[r]:S.globals.minY;s||(s=S.globals.dataPoints>1?S.globals.dataPoints-1:S.globals.dataPoints);const R=(e,t)=>t-e/F[i]+2*(this.isReversed?e/F[i]:0);let N=l;const z=S.config.chart.stacked&&!S.globals.comboCharts||S.config.chart.stacked&&S.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(P=this.w.config.series[r])?void 0:P.type)||"column"===(null==(w=this.w.config.series[r])?void 0:w.type));let D=S.config.stroke.curve;Array.isArray(D)&&(D=Array.isArray(p)?D[p[n]]:D[n]);let O,$=0;const T=this.pointsChart?this._scatterJitterPx(r):null;if("straight"===D&&!this.pointsChart){const u=this._fastStraightPath({type:e,series:t,i:n,realIndex:r,translationsIndex:i,iterations:s,x:a,y:l,pX:o,pY:h,pathsFrom:c,linePaths:f,areaPaths:g,xArrj:x,yArrj:y,y2Arrj:b,stackSeries:z});if(u)return u}const W=z?this._stackXs:null;let B=0;const E=[];for(let i=0;i<s&&0!==t[n].length;i++){const c=void 0===t[n][i+1]||null===t[n][i+1];if(S.axisFlags.isXNumeric){const e=S.seriesData.seriesX[r];let t=e[i+1];if(void 0===t&&(t=e[s-1]),a=(t-S.globals.minX)/this.xRatio,W){const s=[];for(;W[B]<=e[i];)B++;for(;W[B]<t;)s.push([(W[B]-S.globals.minX)/this.xRatio,null!=(_=this.prevSeriesYByX.get(W[B++]))?_:this.zeroY]);s.length&&(E[i+1]=s)}}else a+=this.xDivision;if(z)if(n>0&&S.globals.collapsedSeries.length<S.config.series.length-1){if((e=>{var t;for(let s=e;s>=0;s--){const e=null!=(t=null==p?void 0:p[s])?t:s;if(!this._hidden(e))return s}return-1})(n-1)<0)m=this.zeroY;else{const e=this.stackTopAt(r,i+1);m=void 0===e?this.zeroY:e}}else m=this.zeroY;else m=this.zeroY;c?l=R(X,m):(l=R(t[n][i+1],m),"rangeArea"===e&&(N=R(A[n][i+1],m)));let u=a,d=l;if(T){const e=100003*r+(i+1);T.x&&(u=a+2*(M(7919*e+13)-.5)*T.x),T.y&&(d=l+2*(M(6271*e+97)-.5)*T.y)}x.push(null===t[n][i+1]?null:u),!c||"smooth"!==S.config.stroke.curve&&"monotoneCubic"!==S.config.stroke.curve?(y.push(d),b.push(N)):(y.push(null),b.push(null));const P=this.lineHelpers.calculatePoints({series:t,x:u,y:d,realIndex:r,i:n,j:i,prevY:Y}),w=this._createPaths({type:e,series:t,i:n,j:i,x:a,y:l,midsAt:E,y2:N,xArrj:x,yArrj:y,y2Arrj:b,pX:o,pY:h,pathState:$,segmentStartX:O,linePath:C,areaPath:L,linePaths:f,areaPaths:g,curve:D,isRangeStart:v});g=w.areaPaths,f=w.linePaths,o=w.pX,h=w.pY,$=w.pathState,O=w.segmentStartX,L=w.areaPath,C=w.linePath,!this.appendPathFrom||S.globals.hasNullValues||"monotoneCubic"===D&&"rangeArea"===e||(j+=k.line(a,this.areaBottomY),I+=k.line(a,this.areaBottomY)),this._shapeOnly||(this.handleNullDataPoints(t,P,n,i,r),this._handleMarkersAndLabels({type:e,pointsPos:P,i:n,j:i,realIndex:r,isRangeStart:v}))}return{yArrj:y,xArrj:x,pathFromArea:I,areaPaths:g,pathFromLine:j,linePaths:f}}_handleMarkersAndLabels({type:e,pointsPos:t,isRangeStart:s,i:r,j:i,realIndex:n}){const a=this.w,l=new _(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,i,{realIndex:n,pointsPos:t,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!a.globals.dataChanged&&!a.globals.resized&&!a.globals.markers.batched)&&a.seriesData.series[r].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const e=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:n,j:i+1});null!==e&&e!==this._elLastPointsWrap&&(this.elPointsMain.add(e),this._elLastPointsWrap=e)}const o=l.drawDataLabel({type:e,isRangeStart:s,pos:t,i:n,j:i+1});null!==o&&this.elDataLabelsWrap.add(o)}_scatterJitterPx(e){var t;const s=this.w,r=null==(t=s.config.plotOptions.scatter)?void 0:t.jitter;if(!r||!r.enabled||!r.x&&!r.y)return null;const i=s.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,n=this.yRatio.length>1?e:0,a=this.yRatio[n]?1/this.yRatio[n]:0;return{x:(r.x||0)*i,y:(r.y||0)*a}}_fastStraightPath({type:e,series:t,i:s,realIndex:r,translationsIndex:i,iterations:n,x:a,y:l,pX:o,pY:h,pathsFrom:c,linePaths:u,areaPaths:d,xArrj:f,yArrj:g,y2Arrj:p,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[r]>0)return null;const y=t[s],b=y.length;if(!n||b<2||b-1!==n)return null;for(let e=0;e<=n;e++){const t=y[e];if(null==t)return null}const v=x.axisFlags.isXNumeric,A=v?x.seriesData.seriesX[r]:null;if(v&&(!A||A.length<b))return null;const P=this.yRatio[i],w=this.isReversed,_=this.zeroY,S=this.areaBottomY,k=this.xRatio,F=x.globals.minX,Y=this.xDivision,M=x.config.markers.offsetX,C=x.config.markers.offsetY,L=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:j,pathFromArea:I}=c;const X=this.ctx&&this.ctx.renderer,R=!(!X||!X.kind||"svg"===X.kind),N=!R||x.globals.dataChanged&&!!x.globals.prevStreamFrame,z=R?new Float64Array(b):null,D=R?new Float64Array(b):null;z&&D&&(z[0]=o,D[0]=h),void 0===x.globals.pointsArray[r]&&(x.globals.pointsArray[r]=[]);const O=x.globals.pointsArray[r],$=A?(A[0]-F)/k+M:this.categoryAxisCorrection+M;O.push([$,c.prevY+C]);const T=N?new Array(n+1):[];N&&(T[0]="M "+o+" "+h);const W=N&&L?new Array(n):null;let B=a,E=o,H=h;for(let e=0;e<n;e++){A?E=(A[e+1]-F)/k:(B+=Y,E=B);const t=y[e+1];H=_-t/P+2*(w?t/P:0),f.push(E),g.push(H),p.push(l),O.push([E+M,H+C]),N&&(T[e+1]=" L "+E+" "+H,W&&(W[e]=" L "+E+" "+S)),z&&D&&(z[e+1]=E,D[e+1]=H)}let q="",V="";if(N&&(q=T.join(""),V=q+" L "+E+" "+S+" L "+o+" "+S+"z"),W){const e=W.join("");j+=e,I+=e}else!N&&L&&(j+=" L "+E+" "+S,I+=" L "+E+" "+S);return u.push(q),d.push(V),{yArrj:g,xArrj:f,pathFromArea:I,areaPaths:d,pathFromLine:j,linePaths:u,numericXY:z?{xs:z,ys:D,areaCloseY:S}:void 0}}_createPaths({type:e,series:t,i:s,j:r,x:i,y:n,midsAt:a,xArrj:l,yArrj:o,y2:h,y2Arrj:c,pX:d,pY:f,pathState:g,segmentStartX:p,linePath:m,areaPath:x,linePaths:y,areaPaths:b,curve:v,isRangeStart:A}){const P=new u(this.w),w=this.areaBottomY,_="rangeArea"===e,S="rangeArea"===e&&A,k=a[r+1],F=e=>k?[...k,[i,n]].map(([t,s],r,i)=>e(...r?i[r-1]:[d,f],t,s)).join(""):e(d,f,i,n);switch(v){case"monotoneCubic":{const e=A?o:c,i=(e,t)=>e.map((e,s)=>[e,t[s]]).filter(e=>null!==e[1]),n=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},h=(e,t)=>{const s=n(e),r=[];for(let e=0,i=0;e<s.length;i+=s[e++])r[e]=L.slice(t,i,i+s[e]);return r};switch(g){case 0:if(null===e[r+1])break;g=1;case 1:if(!(_?l.length===t[s].length:r===t[s].length-2))break;case 2:{let t=A?l:l.slice().reverse(),s=A?e:e.slice().reverse();if(a.length&&!_){const e=[];t.forEach((t,r)=>{null!==s[r]&&null!=s[r-1]&&a[r]&&e.push(...a[r]),e.push([t,s[r]])}),t=e.map(e=>e[0]),s=e.map(e=>e[1])}const r=i(t,s),n=r.length>1?L.points(r):r;let o=[];_&&(S?b=r:o=b.reverse());let c=0,u=0;if(h(s,n).forEach(e=>{c++;const t=(e=>{let t="";for(let s=0;s<e.length;s++){const r=e[s],i=r.length;i>4?(t+=`C${r[0]}, ${r[1]}`,t+=`, ${r[2]}, ${r[3]}`,t+=`, ${r[4]}, ${r[5]}`):i>2&&(t+=`S${r[0]}, ${r[1]}`,t+=`, ${r[2]}, ${r[3]}`)}return t})(e),s=u;u+=e.length;const i=u-1;S?m=P.move(r[s][0],r[s][1])+t:_?m=P.move(o[s][0],o[s][1])+P.line(r[s][0],r[s][1])+t+P.line(o[i][0],o[i][1]):(m=P.move(r[s][0],r[s][1])+t,x=m+P.line(r[i][0],w)+P.line(r[s][0],w)+"z",b.push(x)),y.push(m)}),_&&c>1&&!S){const e=y.slice(c).reverse();y.splice(c),e.forEach(e=>y.push(e))}g=0;break}}break}case"smooth":{const e=(e,t,s,r)=>{const i=.35*(s-e);return P.curve(e+i,t,s-i,r,s,r)};if(null===t[s][r])g=0;else switch(g){case 0:if(p=d,m=S?P.move(d,c[r])+P.line(d,f):P.move(d,f),x=P.move(d,f),null===t[s][r+1]||void 0===t[s][r+1]){y.push(m),b.push(x);break}if(g=1,r<t[s].length-2){const t=F(e);m+=t,x+=t;break}case 1:if(null===t[s][r+1])m+=S?P.line(d,h):P.move(d,f),x+=P.line(d,w)+P.line(p,w)+"z",y.push(m),b.push(x),g=-1;else{const a=F(e);m+=a,x+=a,r>=t[s].length-2&&(S&&(m+=P.curve(i,n,i,n,i,h)+P.move(i,h)),x+=P.curve(i,n,i,n,i,w)+P.line(p,w)+"z",y.push(m),b.push(x),g=-1)}}d=i,f=n;break}default:{const e=(e,t,s,r)=>{let i="";switch(v){case"stepline":i=P.line(s,null,"H")+P.line(null,r,"V");break;case"linestep":i=P.line(null,r,"V")+P.line(s,null,"H");break;case"straight":i=P.line(s,r)}return i};if(null===t[s][r])g=0;else switch(g){case 0:if(p=d,m=S?P.move(d,c[r])+P.line(d,f):P.move(d,f),x=P.move(d,f),null===t[s][r+1]||void 0===t[s][r+1]){y.push(m),b.push(x);break}if(g=1,r<t[s].length-2){const t=F(e);m+=t,x+=t;break}case 1:if(null===t[s][r+1])m+=S?P.line(d,h):P.move(d,f),x+=P.line(d,w)+P.line(p,w)+"z",y.push(m),b.push(x),g=-1;else{const n=F(e);m+=n,x+=n,r>=t[s].length-2&&(S&&(m+=P.line(i,h)),x+=P.line(i,w)+P.line(p,w)+"z",y.push(m),b.push(x),g=-1)}}d=i,f=n;break}}return{linePaths:y,areaPaths:b,pX:d,pY:f,pathState:g,segmentStartX:p,linePath:m,areaPath:x}}handleNullDataPoints(e,t,s,r,i){const n=this.w;if(null===e[s][r]&&n.config.markers.showNullDataPoints||1===e[s].length){let e=this.strokeWidth-n.config.markers.strokeWidth/2;e>0||(e=0);const s=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:i,j:r+1,pSize:e,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}c.default.use({line:te,area:te,scatter:te,bubble:te,rangeArea:te}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
package/dist/streamgraph.esm.js
CHANGED
|
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
/*!
|
|
33
|
-
* ApexCharts v8.
|
|
33
|
+
* ApexCharts v8.3.0
|
|
34
34
|
* (c) 2018-2026 ApexCharts
|
|
35
35
|
*/
|
|
36
36
|
import * as _core from "apexcharts/core";
|
|
@@ -277,7 +277,8 @@ class StreamLabels {
|
|
|
277
277
|
text: name,
|
|
278
278
|
maxWidth: span,
|
|
279
279
|
fontSize: `${px}px`,
|
|
280
|
-
fontFamily
|
|
280
|
+
fontFamily,
|
|
281
|
+
fontWeight
|
|
281
282
|
});
|
|
282
283
|
if (!text || text === "...") continue;
|
|
283
284
|
const drawnWidth = text === name ? rect.width : rect.width * (text.length / name.length);
|
|
@@ -948,18 +949,16 @@ class Helpers {
|
|
|
948
949
|
this.lineCtx = lineCtx;
|
|
949
950
|
}
|
|
950
951
|
/**
|
|
951
|
-
* @param {number} i
|
|
952
|
+
* @param {number} i index into `series`, the rows this draw call renders
|
|
952
953
|
* @param {any[]} series
|
|
954
|
+
* @param {number} realIndex index into the config / fill options
|
|
953
955
|
*/
|
|
954
|
-
sameValueSeriesFix(i, series) {
|
|
956
|
+
sameValueSeriesFix(i, series, realIndex) {
|
|
955
957
|
const w = this.w;
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
gSeries[gSeries.length - 1] = gSeries[gSeries.length - 1] + 1e-6;
|
|
961
|
-
series[i] = gSeries;
|
|
962
|
-
}
|
|
958
|
+
const s = series[i];
|
|
959
|
+
if ((w.config.fill.type === "gradient" || w.config.fill.type[realIndex] === "gradient") && s.every((v) => v === s[0])) {
|
|
960
|
+
series[i] = s.slice();
|
|
961
|
+
series[i][s.length - 1] += 1e-6;
|
|
963
962
|
}
|
|
964
963
|
return series;
|
|
965
964
|
}
|
|
@@ -1559,6 +1558,11 @@ function uniquifyKeys(keys) {
|
|
|
1559
1558
|
return count === 0 ? k : `${k}#${count}`;
|
|
1560
1559
|
});
|
|
1561
1560
|
}
|
|
1561
|
+
function seriesKeys(w, realIndex, n = ((_a) => (_a = w.seriesData.series[realIndex]) == null ? void 0 : _a.length)() | 0) {
|
|
1562
|
+
return uniquifyKeys(
|
|
1563
|
+
Array.from({ length: n }, (_, j) => datumKey(w, realIndex, j))
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1562
1566
|
function seriesJoin(w, realIndex, includeIdentity = false, allowReorder = false) {
|
|
1563
1567
|
var _a, _b;
|
|
1564
1568
|
if (!lengthTransitionEnabled(w)) return null;
|
|
@@ -1571,7 +1575,7 @@ function seriesJoin(w, realIndex, includeIdentity = false, allowReorder = false)
|
|
|
1571
1575
|
const oldKeys = uniquifyKeys(
|
|
1572
1576
|
oldY.map((_, j) => frameDatumKey(frame, realIndex, j))
|
|
1573
1577
|
);
|
|
1574
|
-
const newKeys =
|
|
1578
|
+
const newKeys = seriesKeys(w, realIndex);
|
|
1575
1579
|
const join = joinKeys(oldKeys, newKeys);
|
|
1576
1580
|
if (!join.ordered && !allowReorder) return null;
|
|
1577
1581
|
if (!join.changed && !includeIdentity) return null;
|
|
@@ -1835,13 +1839,27 @@ class Line {
|
|
|
1835
1839
|
this.yRatio = coreUtils.getLogYRatios(this.yRatio);
|
|
1836
1840
|
this.prevSeriesY = [];
|
|
1837
1841
|
this.prevSeriesYByX = /* @__PURE__ */ new Map();
|
|
1842
|
+
this._stackXs = null;
|
|
1843
|
+
if (w.config.chart.stacked && w.axisFlags.isXNumeric) {
|
|
1844
|
+
const xs = series.map(
|
|
1845
|
+
(_, i) => w.globals.comboCharts ? (
|
|
1846
|
+
/** @type {any} */
|
|
1847
|
+
seriesIndex[i]
|
|
1848
|
+
) : i
|
|
1849
|
+
).filter((ri) => !this._hidden(ri)).map((ri) => w.seriesData.seriesX[ri] || []);
|
|
1850
|
+
if (xs.some(
|
|
1851
|
+
(a) => a.length !== xs[0].length || a.some((v, k) => v !== xs[0][k])
|
|
1852
|
+
)) {
|
|
1853
|
+
this._stackXs = [...new Set(xs.flat())].sort((a, b) => a - b);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1838
1856
|
const allSeries = [];
|
|
1839
1857
|
for (let i = 0; i < series.length; i++) {
|
|
1840
|
-
series = this.lineHelpers.sameValueSeriesFix(i, series);
|
|
1841
1858
|
const realIndex = w.globals.comboCharts ? (
|
|
1842
1859
|
/** @type {any} */
|
|
1843
1860
|
seriesIndex[i]
|
|
1844
1861
|
) : i;
|
|
1862
|
+
series = this.lineHelpers.sameValueSeriesFix(i, series, realIndex);
|
|
1845
1863
|
const translationsIndex = this.yRatio.length > 1 ? realIndex : 0;
|
|
1846
1864
|
const flat = this._collapsedBaselineRow(series, i, realIndex);
|
|
1847
1865
|
this._shapeOnly = !!flat;
|
|
@@ -2025,9 +2043,7 @@ class Line {
|
|
|
2025
2043
|
const gl = w.globals;
|
|
2026
2044
|
if (w.config.chart.stacked || this.pointsChart) return null;
|
|
2027
2045
|
if (!Array.isArray(series[i]) || series[i].length !== 0) return null;
|
|
2028
|
-
if (
|
|
2029
|
-
return null;
|
|
2030
|
-
}
|
|
2046
|
+
if (!this._hidden(realIndex)) return null;
|
|
2031
2047
|
const n = w.axisFlags.isXNumeric ? (w.seriesData.seriesX[realIndex] || []).length : gl.dataPoints;
|
|
2032
2048
|
if (!n) return null;
|
|
2033
2049
|
const lo = Utils.isNumber(gl.minYArr[realIndex]) ? gl.minYArr[realIndex] : gl.minY;
|
|
@@ -2156,6 +2172,11 @@ class Line {
|
|
|
2156
2172
|
if (key === void 0 || key === null) return void 0;
|
|
2157
2173
|
return this.prevSeriesYByX.get(key);
|
|
2158
2174
|
}
|
|
2175
|
+
/** @param {number} ri */
|
|
2176
|
+
_hidden(ri) {
|
|
2177
|
+
const g = this.w.globals;
|
|
2178
|
+
return g.collapsedSeriesIndices.indexOf(ri) > -1 || g.ancillaryCollapsedSeriesIndices.indexOf(ri) > -1;
|
|
2179
|
+
}
|
|
2159
2180
|
/**
|
|
2160
2181
|
* Fold a drawn series into the running stack top, so the next series can find
|
|
2161
2182
|
* its baseline by x (#4886).
|
|
@@ -2171,19 +2192,18 @@ class Line {
|
|
|
2171
2192
|
* correct if that representation ever changes.
|
|
2172
2193
|
* @param {number} realIndex
|
|
2173
2194
|
* @param {any[]} yArrj
|
|
2195
|
+
* @param {any[]} [row] the drawn row, if not the series' own (a part)
|
|
2174
2196
|
*/
|
|
2175
|
-
_recordStackTops(realIndex, yArrj) {
|
|
2197
|
+
_recordStackTops(realIndex, yArrj, row = this.w.seriesData.series[realIndex]) {
|
|
2176
2198
|
const w = this.w;
|
|
2177
2199
|
if (!w.config.chart.stacked) return;
|
|
2178
2200
|
if (!Array.isArray(yArrj)) return;
|
|
2179
|
-
if (
|
|
2180
|
-
return;
|
|
2181
|
-
}
|
|
2201
|
+
if (this._hidden(realIndex)) return;
|
|
2182
2202
|
for (let j = 0; j < yArrj.length; j++) {
|
|
2183
2203
|
const key = this._stackKey(realIndex, j);
|
|
2184
2204
|
if (key === void 0 || key === null) continue;
|
|
2185
2205
|
const y = yArrj[j];
|
|
2186
|
-
if (!Utils.isNumber(y)) continue;
|
|
2206
|
+
if (!Utils.isNumber(y) || (row == null ? void 0 : row[j]) == null) continue;
|
|
2187
2207
|
this.prevSeriesYByX.set(key, y);
|
|
2188
2208
|
}
|
|
2189
2209
|
}
|
|
@@ -2216,7 +2236,8 @@ class Line {
|
|
|
2216
2236
|
w.globals.seriesYvalues[realIndex] = paths.yArrj;
|
|
2217
2237
|
const forecast = w.config.forecastDataPoints;
|
|
2218
2238
|
if (forecast.count > 0 && type !== "rangeArea") {
|
|
2219
|
-
const
|
|
2239
|
+
const ci = paths.xArrj.length - forecast.count - 1;
|
|
2240
|
+
const forecastCutoff = w.axisFlags.isXNumeric ? (w.seriesData.seriesX[realIndex][ci] - w.globals.minX) / this.xRatio : w.globals.padHorizontal + this.categoryAxisCorrection + ci * this.xDivision;
|
|
2220
2241
|
const elForecastMask = graphics.drawRect(
|
|
2221
2242
|
forecastCutoff,
|
|
2222
2243
|
0,
|
|
@@ -2303,7 +2324,7 @@ class Line {
|
|
|
2303
2324
|
scrollMorph: !!streamScroll,
|
|
2304
2325
|
stroke: "none",
|
|
2305
2326
|
strokeWidth: 0,
|
|
2306
|
-
|
|
2327
|
+
strokeLinecap: null,
|
|
2307
2328
|
fill: pathFill
|
|
2308
2329
|
}));
|
|
2309
2330
|
this.elSeries.add(renderedPath);
|
|
@@ -2345,7 +2366,7 @@ class Line {
|
|
|
2345
2366
|
scrollMorph: !!streamScroll,
|
|
2346
2367
|
stroke: lineFill,
|
|
2347
2368
|
strokeWidth: this.strokeWidth,
|
|
2348
|
-
|
|
2369
|
+
strokeLinecap: w.config.stroke.lineCap,
|
|
2349
2370
|
fill: type === "rangeArea" ? pathFill : "none"
|
|
2350
2371
|
});
|
|
2351
2372
|
const renderedPath = emit.renderPaths(linePathCommonOpts);
|
|
@@ -2399,7 +2420,7 @@ class Line {
|
|
|
2399
2420
|
isRangeStart,
|
|
2400
2421
|
seriesRangeEnd
|
|
2401
2422
|
}) {
|
|
2402
|
-
var _a, _b;
|
|
2423
|
+
var _a, _b, _c;
|
|
2403
2424
|
const w = this.w;
|
|
2404
2425
|
const graphics = new Graphics(this.w);
|
|
2405
2426
|
const yRatio = this.yRatio;
|
|
@@ -2451,15 +2472,30 @@ class Line {
|
|
|
2451
2472
|
});
|
|
2452
2473
|
if (fast) return fast;
|
|
2453
2474
|
}
|
|
2475
|
+
const ks = stackSeries ? this._stackXs : null;
|
|
2476
|
+
let kp = 0;
|
|
2477
|
+
const midsAt = [];
|
|
2454
2478
|
for (let j = 0; j < iterations; j++) {
|
|
2455
2479
|
if (series[i].length === 0) break;
|
|
2456
2480
|
const isNull = typeof series[i][j + 1] === "undefined" || series[i][j + 1] === null;
|
|
2457
2481
|
if (w.axisFlags.isXNumeric) {
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2482
|
+
const sxs = w.seriesData.seriesX[realIndex];
|
|
2483
|
+
let sX = sxs[j + 1];
|
|
2484
|
+
if (typeof sX === "undefined") {
|
|
2485
|
+
sX = sxs[iterations - 1];
|
|
2461
2486
|
}
|
|
2462
2487
|
x = (sX - w.globals.minX) / this.xRatio;
|
|
2488
|
+
if (ks) {
|
|
2489
|
+
const m = [];
|
|
2490
|
+
while (ks[kp] <= sxs[j]) kp++;
|
|
2491
|
+
while (ks[kp] < sX) {
|
|
2492
|
+
m.push([
|
|
2493
|
+
(ks[kp] - w.globals.minX) / this.xRatio,
|
|
2494
|
+
(_c = this.prevSeriesYByX.get(ks[kp++])) != null ? _c : this.zeroY
|
|
2495
|
+
]);
|
|
2496
|
+
}
|
|
2497
|
+
if (m.length) midsAt[j + 1] = m;
|
|
2498
|
+
}
|
|
2463
2499
|
} else {
|
|
2464
2500
|
x = x + this.xDivision;
|
|
2465
2501
|
}
|
|
@@ -2469,9 +2505,7 @@ class Line {
|
|
|
2469
2505
|
var _a2;
|
|
2470
2506
|
for (let pii = pi; pii >= 0; pii--) {
|
|
2471
2507
|
const ri = (_a2 = seriesIndex == null ? void 0 : seriesIndex[pii]) != null ? _a2 : pii;
|
|
2472
|
-
if (
|
|
2473
|
-
return pii;
|
|
2474
|
-
}
|
|
2508
|
+
if (!this._hidden(ri)) return pii;
|
|
2475
2509
|
}
|
|
2476
2510
|
return -1;
|
|
2477
2511
|
};
|
|
@@ -2527,6 +2561,7 @@ class Line {
|
|
|
2527
2561
|
j,
|
|
2528
2562
|
x,
|
|
2529
2563
|
y,
|
|
2564
|
+
midsAt,
|
|
2530
2565
|
y2,
|
|
2531
2566
|
xArrj,
|
|
2532
2567
|
yArrj,
|
|
@@ -2767,7 +2802,7 @@ class Line {
|
|
|
2767
2802
|
numericXY: nxs ? { xs: nxs, ys: nys, areaCloseY: bottomY } : void 0
|
|
2768
2803
|
};
|
|
2769
2804
|
}
|
|
2770
|
-
/** @param {{type: any, series: any, i: any, j: any, x: any, y: any, xArrj: any, yArrj: any, y2: any, y2Arrj: any, pX: any, pY: any, pathState: any, segmentStartX: any, linePath: any, areaPath: any, linePaths: any, areaPaths: any, curve: any, isRangeStart: any}} opts */
|
|
2805
|
+
/** @param {{type: any, series: any, i: any, j: any, x: any, y: any, midsAt: any[][], xArrj: any, yArrj: any, y2: any, y2Arrj: any, pX: any, pY: any, pathState: any, segmentStartX: any, linePath: any, areaPath: any, linePaths: any, areaPaths: any, curve: any, isRangeStart: any}} opts */
|
|
2771
2806
|
_createPaths({
|
|
2772
2807
|
type,
|
|
2773
2808
|
series,
|
|
@@ -2775,6 +2810,7 @@ class Line {
|
|
|
2775
2810
|
j,
|
|
2776
2811
|
x,
|
|
2777
2812
|
y,
|
|
2813
|
+
midsAt,
|
|
2778
2814
|
xArrj,
|
|
2779
2815
|
yArrj,
|
|
2780
2816
|
y2,
|
|
@@ -2794,6 +2830,8 @@ class Line {
|
|
|
2794
2830
|
const areaBottomY = this.areaBottomY;
|
|
2795
2831
|
const rangeArea = type === "rangeArea";
|
|
2796
2832
|
const isLowerRangeAreaPath = type === "rangeArea" && isRangeStart;
|
|
2833
|
+
const mids = midsAt[j + 1];
|
|
2834
|
+
const via = (f) => mids ? [...mids, [x, y]].map(([bx, by], k, a) => f(...k ? a[k - 1] : [pX, pY], bx, by)).join("") : f(pX, pY, x, y);
|
|
2797
2835
|
switch (curve) {
|
|
2798
2836
|
case "monotoneCubic": {
|
|
2799
2837
|
const yAj = isRangeStart ? yArrj : y2Arrj;
|
|
@@ -2839,8 +2877,19 @@ class Line {
|
|
|
2839
2877
|
}
|
|
2840
2878
|
// falls through
|
|
2841
2879
|
case 2: {
|
|
2842
|
-
|
|
2843
|
-
|
|
2880
|
+
let _xAj = isRangeStart ? xArrj : xArrj.slice().reverse();
|
|
2881
|
+
let _yAj = isRangeStart ? yAj : yAj.slice().reverse();
|
|
2882
|
+
if (midsAt.length && !rangeArea) {
|
|
2883
|
+
const P = [];
|
|
2884
|
+
_xAj.forEach((v, k) => {
|
|
2885
|
+
if (_yAj[k] !== null && _yAj[k - 1] != null && midsAt[k]) {
|
|
2886
|
+
P.push(...midsAt[k]);
|
|
2887
|
+
}
|
|
2888
|
+
P.push([v, _yAj[k]]);
|
|
2889
|
+
});
|
|
2890
|
+
_xAj = P.map((p) => p[0]);
|
|
2891
|
+
_yAj = P.map((p) => p[1]);
|
|
2892
|
+
}
|
|
2844
2893
|
const smoothInputs = getSmoothInputs(_xAj, _yAj);
|
|
2845
2894
|
const points = smoothInputs.length > 1 ? spline.points(smoothInputs) : smoothInputs;
|
|
2846
2895
|
let smoothInputsLower = [];
|
|
@@ -2899,7 +2948,10 @@ class Line {
|
|
|
2899
2948
|
break;
|
|
2900
2949
|
}
|
|
2901
2950
|
case "smooth": {
|
|
2902
|
-
const
|
|
2951
|
+
const toPoint = (ax, ay, bx, by) => {
|
|
2952
|
+
const l = (bx - ax) * 0.35;
|
|
2953
|
+
return graphics.curve(ax + l, ay, bx - l, by, bx, by);
|
|
2954
|
+
};
|
|
2903
2955
|
if (series[i][j] === null) {
|
|
2904
2956
|
pathState = 0;
|
|
2905
2957
|
} else {
|
|
@@ -2919,7 +2971,7 @@ class Line {
|
|
|
2919
2971
|
}
|
|
2920
2972
|
pathState = 1;
|
|
2921
2973
|
if (j < series[i].length - 2) {
|
|
2922
|
-
const p =
|
|
2974
|
+
const p = via(toPoint);
|
|
2923
2975
|
linePath += p;
|
|
2924
2976
|
areaPath += p;
|
|
2925
2977
|
break;
|
|
@@ -2937,7 +2989,7 @@ class Line {
|
|
|
2937
2989
|
areaPaths.push(areaPath);
|
|
2938
2990
|
pathState = -1;
|
|
2939
2991
|
} else {
|
|
2940
|
-
const p =
|
|
2992
|
+
const p = via(toPoint);
|
|
2941
2993
|
linePath += p;
|
|
2942
2994
|
areaPath += p;
|
|
2943
2995
|
if (j >= series[i].length - 2) {
|
|
@@ -2958,9 +3010,9 @@ class Line {
|
|
|
2958
3010
|
break;
|
|
2959
3011
|
}
|
|
2960
3012
|
default: {
|
|
2961
|
-
const pathToPoint = (
|
|
3013
|
+
const pathToPoint = (_ax, _ay, x2, y3) => {
|
|
2962
3014
|
let path = "";
|
|
2963
|
-
switch (
|
|
3015
|
+
switch (curve) {
|
|
2964
3016
|
case "stepline":
|
|
2965
3017
|
path = graphics.line(x2, null, "H") + graphics.line(null, y3, "V");
|
|
2966
3018
|
break;
|
|
@@ -2992,7 +3044,7 @@ class Line {
|
|
|
2992
3044
|
}
|
|
2993
3045
|
pathState = 1;
|
|
2994
3046
|
if (j < series[i].length - 2) {
|
|
2995
|
-
const p = pathToPoint
|
|
3047
|
+
const p = via(pathToPoint);
|
|
2996
3048
|
linePath += p;
|
|
2997
3049
|
areaPath += p;
|
|
2998
3050
|
break;
|
|
@@ -3010,7 +3062,7 @@ class Line {
|
|
|
3010
3062
|
areaPaths.push(areaPath);
|
|
3011
3063
|
pathState = -1;
|
|
3012
3064
|
} else {
|
|
3013
|
-
const p = pathToPoint
|
|
3065
|
+
const p = via(pathToPoint);
|
|
3014
3066
|
linePath += p;
|
|
3015
3067
|
areaPath += p;
|
|
3016
3068
|
if (j >= series[i].length - 2) {
|