apexcharts 8.2.0 → 8.3.1
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 +19793 -19713
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +38 -8
- package/dist/apexcharts.esm.js +1882 -1625
- package/dist/apexcharts.full.js +22044 -21634
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +21414 -21124
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +21413 -21123
- 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 +478 -406
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +409 -334
- 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 +409 -334
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +478 -406
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +19793 -19713
- package/dist/donut.common.js +2 -2
- package/dist/donut.esm.js +3 -9
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +478 -406
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +442 -324
- package/dist/features/annotations.common.js +2 -2
- package/dist/features/annotations.esm.js +65 -48
- package/dist/features/annotations.js +2 -2
- 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 +2 -2
- package/dist/features/exports.esm.js +10 -4
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/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 +64 -44
- 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 +2 -2
- package/dist/features/morph.esm.js +9 -5
- package/dist/features/morph.js +2 -2
- package/dist/features/perspectives.common.js +2 -2
- package/dist/features/perspectives.esm.js +4 -1
- package/dist/features/perspectives.js +2 -2
- package/dist/features/raincloud.common.js +2 -2
- package/dist/features/raincloud.esm.js +26 -27
- package/dist/features/raincloud.js +2 -2
- 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 +2 -2
- package/dist/features/stats.esm.js +52 -59
- package/dist/features/stats.js +2 -2
- package/dist/features/storyboard.common.js +2 -2
- package/dist/features/storyboard.esm.js +4 -1
- package/dist/features/storyboard.js +2 -2
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +48 -14
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +148 -18
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +150 -63
- 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 +2 -2
- package/dist/features/weave.esm.js +13 -12
- package/dist/features/weave.js +2 -2
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +1068 -842
- 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 +529 -464
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +80 -46
- 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 +2 -2
- package/dist/pie.esm.js +3 -9
- package/dist/pie.js +2 -2
- package/dist/polarArea.common.js +2 -2
- package/dist/polarArea.esm.js +3 -9
- 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 +2 -2
- package/dist/radialBar.esm.js +5 -12
- package/dist/radialBar.js +2 -2
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +97 -52
- 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 +478 -406
- 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 +138 -53
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +116 -94
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +138 -104
- 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 +477 -405
- package/package.json +1 -1
- package/src/apexcharts.js +40 -59
- package/src/assets/apexcharts.css +38 -8
- 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 +68 -47
- package/src/charts/Line.js +118 -42
- package/src/charts/Pie.js +2 -8
- package/src/charts/Radar.js +5 -7
- package/src/charts/Radial.js +2 -6
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +150 -88
- 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/Stats.js +30 -23
- 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 +29 -7
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/charts/common/treemap/Nested.js +2 -3
- package/src/features/raincloud.js +16 -10
- package/src/features/stats.js +67 -62
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Animations.js +102 -95
- package/src/modules/AxisMapping.js +47 -12
- 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/Exports.js +12 -5
- package/src/modules/Fill.js +17 -8
- package/src/modules/Filters.js +50 -50
- package/src/modules/Graphics.js +69 -51
- package/src/modules/Markers.js +3 -1
- package/src/modules/MorphTypeChange.js +13 -7
- 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 +41 -19
- package/src/modules/Theme.js +1 -1
- package/src/modules/Toolbar.js +3 -2
- package/src/modules/UnitMarkRegistry.js +0 -5
- package/src/modules/ZoomPanSelection.js +123 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/Easing.js +2 -1
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/annotations/Helpers.js +68 -52
- package/src/modules/axes/Grid.js +21 -7
- package/src/modules/axes/YAxis.js +8 -9
- package/src/modules/dimensions/Dimensions.js +9 -3
- package/src/modules/dimensions/Grid.js +2 -2
- package/src/modules/dimensions/XAxis.js +2 -5
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/helpers/UpdateHelpers.js +33 -15
- 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 +8 -1
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/license/LicenseEnforcer.js +5 -0
- package/src/modules/settings/Defaults.js +28 -56
- package/src/modules/settings/Globals.js +5 -0
- package/src/modules/settings/Options.js +7 -7
- package/src/modules/settings/TypeAliases.js +33 -16
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Labels.js +73 -76
- package/src/modules/tooltip/Marker.js +25 -21
- package/src/modules/tooltip/Position.js +88 -51
- package/src/modules/tooltip/Tooltip.js +242 -255
- package/src/modules/tooltip/Utils.js +71 -130
- package/src/modules/tooltip/constants.js +5 -5
- 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/modules/trellis/TrellisTooltip.js +2 -11
- package/src/modules/weave/WeaveHost.js +18 -12
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/svg/SVGFilter.js +26 -17
- package/src/types/internal.d.ts +9 -3
- package/src/utils/Utils.js +0 -14
- package/types/apexcharts.d.ts +33 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
!function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/features/drilldown.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/drilldown.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var r={file:"dist/features/drilldown.js",run:t,done:!1},s=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);s.push(r),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!r.done){var i=e.ApexCharts;if(i)if(i.__internals){r.done=!0;var n=s.indexOf(r);-1!==n&&s.splice(n,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/features/drilldown.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/drilldown.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/drilldown.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/drilldown.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r,a=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&l(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&l(t,i,e[i]);return t},d=(t,e)=>i(t,r(e));const c=globalThis.ApexCharts,h=globalThis.ApexCharts.__internals.__apex_Utils,p=globalThis.ApexCharts.__internals.__apex_Environment_Environment,u=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs;function f(t,e,i,r){var s;const n=null==(s=null==e?void 0:e.dimensions)?void 0:s.dimHelpers,o=n?n.getTitleSubtitleCoords("title").height+n.getTitleSubtitleCoords("subtitle").height:0,l=i.getBoundingClientRect().height||18,a=r&&r.offsetY||0,d=function(t,e){const i=t.layout.translateY||0,r=t.dom.elWrap;if(!r)return i;const s=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!s.length)return i;const n=r.getBoundingClientRect().top,o=e.getBoundingClientRect();let l=i;for(let t=0;t<s.length;t++){const e=s[t].getBoundingClientRect();e.height&&(e.left>=o.right||e.right<=o.left||(l=Math.min(l,e.top-n)))}return l}(t,i);if(d-o>=l+1)return i.style.top=`${d-l-1+a}px`,!0;i.style.top=`${o+a}px`;const c="dark"===t.config.theme.mode;return i.style.background=c?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const w="http://www.w3.org/1999/xhtml";class g{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!p.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const r=i.querySelector(".apexcharts-breadcrumb");r&&r.parentNode&&r.parentNode.removeChild(r);const s=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!s||!1===s.show)return;if(0===this.drilldown.depth)return;const n=u.createElementNS(w,"nav");n.setAttribute("class","apexcharts-breadcrumb"),n.setAttribute("aria-label","Drilldown breadcrumb"),this._position(n,s);const o=null!=s.separator?s.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=u.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,n.appendChild(t)}const r=this._label(e,i);if(i===t.length-1){const t=u.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=r,n.appendChild(t)}else{const t=u.createElementNS(w,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=u.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=u.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=r,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),n.appendChild(t)}}),i.appendChild(n),this.w.globals.axisCharts&&f(this.w,this.ctx,n,s),this._avoidChromeOverlap(n)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const r=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),s=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!s)break;t.style.top=s.getBoundingClientRect().bottom-r+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let r;if(0===e)r=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);r=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(r,{index:e,depth:this.drilldown.depth}):r}_position(t,e){const i=e.offsetX||0,r=e.offsetY||0;t.style.position="absolute",t.style.top=r+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const x="http://www.w3.org/1999/xhtml",_="apexcharts-drilldown-loading";class m{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!p.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=u.createElementNS(x,"div");i.setAttribute("class",_),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const r=u.createElementNS(x,"div");if(r.setAttribute("class",`${_}-spinner`),r.setAttribute("aria-hidden","true"),i.appendChild(r),t.text){const e=u.createElementNS(x,"span");e.setAttribute("class",`${_}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${_}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const b="__apexDrilldownMarker";c.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new g(t,e,this),this.loading=new m(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const r=this._resolveChild(t);return r?this._drillInto(r,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):(console.warn(`ApexCharts: drilldown id "${t}" not found in chart.drilldown.series, and no onDrillDown resolver is set.`),Promise.resolve(this.ctx))}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],r=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const s=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(r),"up",{from:i,to:s})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return console.warn("ApexCharts: drilldown max depth (32) reached."),Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const r=this.path[this.path.length-1],s={id:t.id,name:t.name,restore:this._snapshot()};return this.stack.push(s),this._apply(this._viewFromChild(t),"down",{from:r,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex}).catch(e=>{throw this.stack[this.stack.length-1]===s&&this.stack.pop(),this._fire("drillDownError",{id:t.id,error:e}),e})}_drillDownAsync(t,e,i){const r=this.w.config.drilldown.onDrillDown,s=this._cacheGet(t);if(s)return this._drillInto(s,e,i);if(this._pending)return this._pending;let n;this.loading.show();try{n=r({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const o=()=>{this._pending=null,this.loading.hide()},l=Promise.resolve(n).then(r=>{if(o(),this._isDead())return this.ctx;if(!r||!r.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const s=null!=r.id?r:d(a({},r),{id:t});return this._cacheSet(t,s),this._drillInto(s,e,i)},e=>(o(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=l,l}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(h.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=h.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=h.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=h.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?h.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=h.clone(t.plotOptions)),e.has("fill")&&(i.fill=h.clone(t.fill)),e.has("legend")&&(i.legend=h.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,r=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!r.length)return t;const s=e.config.chart.type,n=("pie"===s||"donut"===s||"polarArea"===s)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of r){const r=e.index;i.axisCharts?t[r]&&(t[r].data=Array.isArray(e.data)?e.data.slice():e.data):n[r]&&"object"==typeof n[r]?n[r].y=e.data:void 0!==n[r]&&(n[r]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){var r;const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=d(a({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const n=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i),null==(r=this.ctx.highlightFilter)||r.drillView(t);const o=e=>this.ctx.updateOptions(t,!1,e,!1,!1),l=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(n&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>o(!1)).then(l)}return o(n).then(l)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!p.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const r=e.getBoundingClientRect();let s=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(s=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),s&&"function"==typeof s.getBoundingClientRect){const t=s.getBoundingClientRect();return{x:t.left+t.width/2-r.left,y:t.top+t.height/2-r.top}}const n=i.getBoundingClientRect();return{x:n.left+n.width/2-r.left,y:n.top+n.height/2-r.top}}_zoomDrill(t,e,i){return r=this,s=null,n=function*(){const r=this._zoomDuration(),s="down"===e,n=Math.round(.55*r),o=s?"scale(1.03)":"scale(0.97)",l=s?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",a=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},d=this._markGroup();let c=null;if(d){a(d),c=d.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:n,easing:"ease-in",fill:"forwards"});try{yield c.finished}catch(t){}}yield i();const h=this._markGroup();if(h){a(h),h.style.opacity="0",h.style.transform=l,c&&d===h&&c.cancel();const t=h.animate([{transform:l,opacity:0},{transform:"scale(1)",opacity:1}],{duration:r,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(p=h).style.transform="",p.style.opacity="",p.style.transformOrigin="",p.style.transformBox="",t.cancel()}var p},new Promise((t,e)=>{var i=t=>{try{l(n.next(t))}catch(t){e(t)}},o=t=>{try{l(n.throw(t))}catch(t){e(t)}},l=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);l((n=n.apply(r,s)).next())});var r,s,n}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i||this._retired())return;const r=this._pointAt(i.seriesIndex,i.dataPointIndex);return r&&"object"==typeof r&&null!=r.drilldown?this.drillDown(r.drilldown,r,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,r,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const r=i[t];return r&&Array.isArray(r.data)&&null!=r.data[e]?r.data[e]:null}_retired(){return this.ctx.drilldown!==this&&(Promise.resolve().then(()=>{const t=this.ctx.events;t&&(t.removeEventListener("dataPointSelection",this._onPointSelect),t.removeEventListener("mounted",this._afterRender),t.removeEventListener("updated",this._afterRender))}),!0)}_afterRender(){const t=this.w;this._retired()||t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!p.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let r=0;i.forEach((t,i)=>{const s=t&&Array.isArray(t.data)?t.data:null;s&&s.forEach((t,s)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const n=e.querySelectorAll(`[index="${i}"][j="${s}"]`);n.length||r++,n.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),r&&!this._warnedUnreachable&&(this._warnedUnreachable=!0,console.warn(`ApexCharts: ${r} drillable point(s) have no clickable mark, so clicking them cannot do anything. Leave \`drilldown.marker\` on, or give the series markers of its own (\`markers.size > 0\`).`))}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0,console.warn("ApexCharts: `plotOptions.pie.expandOnClick` is not available in a drilldown pie/donut, so it was ignored. A slice click navigates, and a slice that slid out would be discarded by the drill it just triggered."))}_wirePlotClick(){if(!p.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const r=t.target;if(!r||"function"!=typeof r.closest)return;if(r.closest(".apexcharts-drilldown-target"))return;if(r.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const s=e.interact.capturedSeriesIndex,n=e.interact.capturedDataPointIndex;if(null==s||null==n||s<0||n<0)return;if(!this._isPointBasedSeries(e.config.series[s]))return;const o=this._pointAt(s,n);return o&&"object"==typeof o&&null!=o.drilldown?this.drillDown(o.drilldown,o,{seriesIndex:s,dataPointIndex:n}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events")||!t.classList.contains("apexcharts-marker")||"function"==typeof t.closest&&t.closest(".apexcharts-tooltip"))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,r=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[b]):[],s=i&&i.marker||{};if(!1===s.show||!Array.isArray(t))return r;const n=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r={seriesIndex:e,dataPointIndex:i,[b]:!0};void 0!==s.size&&(r.size=s.size),void 0!==s.shape&&(r.shape=s.shape),void 0!==s.fillColor&&(r.fillColor=s.fillColor),void 0!==s.strokeColor&&(r.strokeColor=s.strokeColor),n.push(r)})}),r.concat(n)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,r=Array.isArray(i)?i[t]:i;return!(Number(r)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}}),t.default=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexDrilldown={})});
|
|
5
|
+
!function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/features/drilldown.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/drilldown.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var r={file:"dist/features/drilldown.js",run:t,done:!1},s=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);s.push(r),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!r.done){var i=e.ApexCharts;if(i)if(i.__internals){r.done=!0;var n=s.indexOf(r);-1!==n&&s.splice(n,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/features/drilldown.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/drilldown.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/drilldown.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/drilldown.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r,a=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&l(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&l(t,i,e[i]);return t},d=(t,e)=>i(t,r(e));const c=globalThis.ApexCharts,h=globalThis.ApexCharts.__internals.__apex_Utils,p=globalThis.ApexCharts.__internals.__apex_Environment_Environment,u=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs;function f(t,e,i,r){var s;const n=null==(s=null==e?void 0:e.dimensions)?void 0:s.dimHelpers,o=n?n.getTitleSubtitleCoords("title").height+n.getTitleSubtitleCoords("subtitle").height:0,l=i.getBoundingClientRect().height||18,a=r&&r.offsetY||0,d=function(t,e){const i=t.layout.translateY||0,r=t.dom.elWrap;if(!r)return i;const s=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!s.length)return i;const n=r.getBoundingClientRect().top,o=e.getBoundingClientRect();let l=i;for(let t=0;t<s.length;t++){const e=s[t].getBoundingClientRect();e.height&&(e.left>=o.right||e.right<=o.left||(l=Math.min(l,e.top-n)))}return l}(t,i);if(d-o>=l+1)return i.style.top=`${d-l-1+a}px`,!0;i.style.top=`${o+a}px`;const c="dark"===t.config.theme.mode;return i.style.background=c?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const w="http://www.w3.org/1999/xhtml";class g{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!p.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const r=i.querySelector(".apexcharts-breadcrumb[aria-label^=Drill]");r&&r.parentNode&&r.parentNode.removeChild(r);const s=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!s||!1===s.show)return;if(0===this.drilldown.depth)return;const n=u.createElementNS(w,"nav");n.setAttribute("class","apexcharts-breadcrumb"),n.setAttribute("aria-label","Drilldown breadcrumb"),this._position(n,s);const o=null!=s.separator?s.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=u.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,n.appendChild(t)}const r=this._label(e,i);if(i===t.length-1){const t=u.createElementNS(w,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=r,n.appendChild(t)}else{const t=u.createElementNS(w,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=u.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=u.createElementNS(w,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=r,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),n.appendChild(t)}}),i.appendChild(n),this.w.globals.axisCharts&&f(this.w,this.ctx,n,s),this._avoidChromeOverlap(n)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const r=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),s=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!s)break;t.style.top=s.getBoundingClientRect().bottom-r+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let r;if(0===e)r=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);r=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(r,{index:e,depth:this.drilldown.depth}):r}_position(t,e){const i=e.offsetX||0,r=e.offsetY||0;t.style.position="absolute",t.style.top=r+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const x="http://www.w3.org/1999/xhtml",_="apexcharts-drilldown-loading";class m{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!p.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=u.createElementNS(x,"div");i.setAttribute("class",_),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const r=u.createElementNS(x,"div");if(r.setAttribute("class",`${_}-spinner`),r.setAttribute("aria-hidden","true"),i.appendChild(r),t.text){const e=u.createElementNS(x,"span");e.setAttribute("class",`${_}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${_}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const b="__apexDrilldownMarker";c.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new g(t,e,this),this.loading=new m(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const r=this._resolveChild(t);return r?this._drillInto(r,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):(console.warn(`ApexCharts: drilldown id "${t}" not found in chart.drilldown.series, and no onDrillDown resolver is set.`),Promise.resolve(this.ctx))}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],r=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const s=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(r),"up",{from:i,to:s})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return console.warn("ApexCharts: drilldown max depth (32) reached."),Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const r=this.path[this.path.length-1],s={id:t.id,name:t.name,restore:this._snapshot()};return this.stack.push(s),this._apply(this._viewFromChild(t),"down",{from:r,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex}).catch(e=>{throw this.stack[this.stack.length-1]===s&&this.stack.pop(),this._fire("drillDownError",{id:t.id,error:e}),e})}_drillDownAsync(t,e,i){const r=this.w.config.drilldown.onDrillDown,s=this._cacheGet(t);if(s)return this._drillInto(s,e,i);if(this._pending)return this._pending;let n;this.loading.show();try{n=r({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const o=()=>{this._pending=null,this.loading.hide()},l=Promise.resolve(n).then(r=>{if(o(),this._isDead())return this.ctx;if(!r||!r.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const s=null!=r.id?r:d(a({},r),{id:t});return this._cacheSet(t,s),this._drillInto(s,e,i)},e=>(o(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=l,l}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(h.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=h.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=h.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=h.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?h.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=h.clone(t.plotOptions)),e.has("fill")&&(i.fill=h.clone(t.fill)),e.has("legend")&&(i.legend=h.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,r=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!r.length)return t;const s=e.config.chart.type,n=("pie"===s||"donut"===s||"polarArea"===s)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of r){const r=e.index;i.axisCharts?t[r]&&(t[r].data=Array.isArray(e.data)?e.data.slice():e.data):n[r]&&"object"==typeof n[r]?n[r].y=e.data:void 0!==n[r]&&(n[r]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){var r;const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=d(a({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const n=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i),null==(r=this.ctx.highlightFilter)||r.drillView(t);const o=e=>this.ctx.updateOptions(t,!1,e,!1,!1),l=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(n&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>o(!1)).then(l)}return o(n).then(l)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!p.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const r=e.getBoundingClientRect();let s=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(s=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),s&&"function"==typeof s.getBoundingClientRect){const t=s.getBoundingClientRect();return{x:t.left+t.width/2-r.left,y:t.top+t.height/2-r.top}}const n=i.getBoundingClientRect();return{x:n.left+n.width/2-r.left,y:n.top+n.height/2-r.top}}_zoomDrill(t,e,i){return r=this,s=null,n=function*(){const r=this._zoomDuration(),s="down"===e,n=Math.round(.55*r),o=s?"scale(1.03)":"scale(0.97)",l=s?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",a=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},d=this._markGroup();let c=null;if(d){a(d),c=d.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:n,easing:"ease-in",fill:"forwards"});try{yield c.finished}catch(t){}}yield i();const h=this._markGroup();if(h){a(h),h.style.opacity="0",h.style.transform=l,c&&d===h&&c.cancel();const t=h.animate([{transform:l,opacity:0},{transform:"scale(1)",opacity:1}],{duration:r,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(p=h).style.transform="",p.style.opacity="",p.style.transformOrigin="",p.style.transformBox="",t.cancel()}var p},new Promise((t,e)=>{var i=t=>{try{l(n.next(t))}catch(t){e(t)}},o=t=>{try{l(n.throw(t))}catch(t){e(t)}},l=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);l((n=n.apply(r,s)).next())});var r,s,n}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i||this._retired())return;const r=this._pointAt(i.seriesIndex,i.dataPointIndex);return r&&"object"==typeof r&&null!=r.drilldown?this.drillDown(r.drilldown,r,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,r,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const r=i[t];return r&&Array.isArray(r.data)&&null!=r.data[e]?r.data[e]:null}_retired(){return this.ctx.drilldown!==this&&(Promise.resolve().then(()=>{const t=this.ctx.events;t&&(t.removeEventListener("dataPointSelection",this._onPointSelect),t.removeEventListener("mounted",this._afterRender),t.removeEventListener("updated",this._afterRender))}),!0)}_afterRender(){const t=this.w;this._retired()||t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!p.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let r=0;i.forEach((t,i)=>{const s=t&&Array.isArray(t.data)?t.data:null;s&&s.forEach((t,s)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const n=e.querySelectorAll(`[index="${i}"][j="${s}"]`);n.length||r++,n.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),r&&!this._warnedUnreachable&&(this._warnedUnreachable=!0,console.warn(`ApexCharts: ${r} drillable point(s) have no clickable mark, so clicking them cannot do anything. Leave \`drilldown.marker\` on, or give the series markers of its own (\`markers.size > 0\`).`))}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0,console.warn("ApexCharts: `plotOptions.pie.expandOnClick` is not available in a drilldown pie/donut, so it was ignored. A slice click navigates, and a slice that slid out would be discarded by the drill it just triggered."))}_wirePlotClick(){if(!p.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const r=t.target;if(!r||"function"!=typeof r.closest)return;if(r.closest(".apexcharts-drilldown-target"))return;if(r.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const s=e.interact.capturedSeriesIndex,n=e.interact.capturedDataPointIndex;if(null==s||null==n||s<0||n<0)return;if(!this._isPointBasedSeries(e.config.series[s]))return;const o=this._pointAt(s,n);return o&&"object"==typeof o&&null!=o.drilldown?this.drillDown(o.drilldown,o,{seriesIndex:s,dataPointIndex:n}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events")||!t.classList.contains("apexcharts-marker")||"function"==typeof t.closest&&t.closest(".apexcharts-tooltip"))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,r=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[b]):[],s=i&&i.marker||{};if(!1===s.show||!Array.isArray(t))return r;const n=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r={seriesIndex:e,dataPointIndex:i,[b]:!0};void 0!==s.size&&(r.size=s.size),void 0!==s.shape&&(r.shape=s.shape),void 0!==s.fillColor&&(r.fillColor=s.fillColor),void 0!==s.strokeColor&&(r.strokeColor=s.strokeColor),n.push(r)})}),r.concat(n)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,r=Array.isArray(i)?i[t]:i;return!(Number(r)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}}),t.default=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexDrilldown={})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var e=Object.defineProperty,r=Object.defineProperties,t=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,s=(r,t,n)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,o=(e,r)=>{for(var t in r||(r={}))l.call(r,t)&&s(e,t,r[t]);if(n)for(var t of n(r))a.call(r,t)&&s(e,t,r[t]);return e},i=(e,n)=>r(e,t(n));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function u(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const c=u(require("apexcharts/core")),d=c.__apex_Utils;function f(e,r){const t=(r.collapsedSeries||[]).concat(r.ancillaryCollapsedSeries||[]);return e.map((e,r)=>{const s=e||{},{hidden:u}=s,c=((e,r)=>{var t={};for(var s in e)l.call(e,s)&&r.indexOf(s)<0&&(t[s]=e[s]);if(null!=e&&n)for(var s of n(e))r.indexOf(s)<0&&a.call(e,s)&&(t[s]=e[s]);return t})(s,["hidden"]);let d=c.data;if(Array.isArray(d)&&!d.length){const e=t.find(e=>e.index===r);e&&Array.isArray(e.data)&&(d=e.data)}return i(o({},c),{data:Array.isArray(d)?d.slice():d})})}function p(e,r,t){const n=t&&void 0!==t[r]?t[r]:r+1;return null==e?{x:n,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:n,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:n,y:e.y,rest:e}:{x:n,y:e,rest:{}}}function y(e,r){var t;const n=r.config,l=r.globals;if(!Array.isArray(e))return e;l.dumbbellRawSeries||(l.dumbbellRawSeries=f(e,l));const a=l.dumbbellRawSeries,s=a.some(e=>function(e){for(let r=0;r<e.length;r++){const t=e[r],n=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(Array.isArray(n)&&2===n.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[]));if(s)return r.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},e;const u=null==(t=n.xaxis)?void 0:t.categories,c=function(e){return(e.collapsedSeriesIndices||[]).concat(e.ancillaryCollapsedSeriesIndices||[])}(l),{xs:y,rows:b,byX:h}=function(e,r){var t;const n=[],l=[],a=new Map,s=[];for(let i=0;i<e.length;i++){const u=Array.isArray(null==(t=e[i])?void 0:t.data)?e[i].data:[],c=new Map;for(let e=0;e<u.length;e++){const{x:t,y:s,rest:i}=p(u[e],e,r),f=t instanceof Date?t.getTime():t;a.has(f)||(a.set(f,n.length),n.push(t),l.push(o({},i)));const y=a.get(f);c.set(y,d.parseNumber(s))}s.push(c)}return{xs:n,rows:l,byX:s}}(a,u),g=[],m=[],x=[];for(let e=0;e<a.length;e++)-1===c.indexOf(e)&&x.push(e);const v=[];for(let e=0;e<y.length;e++){const r=[];for(let t=0;t<a.length;t++){const n=h[t].has(e)?h[t].get(e):null;r.push(null!=n&&isFinite(n)?n:null)}g.push(r);let t=null,n=null,l=-1,s=-1;for(let e=0;e<x.length;e++){const a=x[e],o=r[a];null!==o&&((null===t||o<t)&&(t=o,l=a),(null===n||o>n)&&(n=o,s=a))}null!==t&&null!==n?(m.push([l,s]),v.push(i(o({},b[e]),{x:y[e],y:[t,n]}))):(m.push(null),v.push(i(o({},b[e]),{x:y[e],y:null})))}r.dumbbellData={form:"series",names:a.map((e,r)=>{var t;return null!=(t=null==e?void 0:e.name)?t:`Series ${r+1}`}),values:g,order:m,carrier:x.length?x[0]:0,hidden:a.map((e,r)=>r).filter(e=>-1!==c.indexOf(e))};const O=r.dumbbellData.carrier;return a.map((e,r)=>i(o({},e),{data:r===O&&x.length?v:[]}))}const b="__apexcharts_series_transforms__";var h,g;globalThis[b]||(globalThis[b]={}),h="dumbbell","function"==typeof(g=y)?globalThis[b][h]=g:console.warn(`ApexCharts: registerSeriesTransform("${h}") expects a function (series, w) => series.`),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default}),exports.dumbbellTransform=y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e){var r="undefined"!=typeof globalThis?globalThis:self,t=r.ApexCharts;if(t&&t.__internals)return e.call(r);if(t)throw new Error("ApexCharts: dist/features/dumbbell.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return e.call(r);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/dumbbell.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/features/dumbbell.js",run:e,done:!1},a=r.__apexcharts_pending_addons__||(r.__apexcharts_pending_addons__=[]);a.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var t=r.ApexCharts;if(t)if(t.__internals){s.done=!0;var n=a.indexOf(s);-1!==n&&a.splice(n,1);try{e.call(r),t.__drainsAddons||r.console.warn("ApexCharts: dist/features/dumbbell.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(e){r.console.error("ApexCharts: dist/features/dumbbell.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else r.console.error("ApexCharts: dist/features/dumbbell.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else r.console.warn("ApexCharts: dist/features/dumbbell.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var e,r;e=this,r=function(e){"use strict";var r=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,i=(e,r)=>{for(var t in r||(r={}))n.call(r,t)&&l(e,t,r[t]);if(a)for(var t of a(r))o.call(r,t)&&l(e,t,r[t]);return e},d=(e,r)=>t(e,s(r));const c=globalThis.ApexCharts,u=globalThis.ApexCharts.__internals.__apex_Utils;function p(e,r){const t=(r.collapsedSeries||[]).concat(r.ancillaryCollapsedSeries||[]);return e.map((e,r)=>{const s=e||{},{hidden:l}=s,c=((e,r)=>{var t={};for(var s in e)n.call(e,s)&&r.indexOf(s)<0&&(t[s]=e[s]);if(null!=e&&a)for(var s of a(e))r.indexOf(s)<0&&o.call(e,s)&&(t[s]=e[s]);return t})(s,["hidden"]);let u=c.data;if(Array.isArray(u)&&!u.length){const e=t.find(e=>e.index===r);e&&Array.isArray(e.data)&&(u=e.data)}return d(i({},c),{data:Array.isArray(u)?u.slice():u})})}function h(e,r,t){const s=t&&void 0!==t[r]?t[r]:r+1;return null==e?{x:s,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:s,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:s,y:e.y,rest:e}:{x:s,y:e,rest:{}}}function f(e,r){var t;const s=r.config,a=r.globals;if(!Array.isArray(e))return e;a.dumbbellRawSeries||(a.dumbbellRawSeries=p(e,a));const n=a.dumbbellRawSeries,o=n.some(e=>function(e){for(let r=0;r<e.length;r++){const t=e[r],s=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(Array.isArray(s)&&2===s.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[]));if(o)return r.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},e;const l=null==(t=s.xaxis)?void 0:t.categories,c=function(e){return(e.collapsedSeriesIndices||[]).concat(e.ancillaryCollapsedSeriesIndices||[])}(a),{xs:f,rows:b,byX:x}=function(e,r){var t;const s=[],a=[],n=new Map,o=[];for(let l=0;l<e.length;l++){const d=Array.isArray(null==(t=e[l])?void 0:t.data)?e[l].data:[],c=new Map;for(let e=0;e<d.length;e++){const{x:t,y:o,rest:l}=h(d[e],e,r),p=t instanceof Date?t.getTime():t;n.has(p)||(n.set(p,s.length),s.push(t),a.push(i({},l)));const f=n.get(p);c.set(f,u.parseNumber(o))}o.push(c)}return{xs:s,rows:a,byX:o}}(n,l),y=[],g=[],m=[];for(let e=0;e<n.length;e++)-1===c.indexOf(e)&&m.push(e);const A=[];for(let e=0;e<f.length;e++){const r=[];for(let t=0;t<n.length;t++){const s=x[t].has(e)?x[t].get(e):null;r.push(null!=s&&isFinite(s)?s:null)}y.push(r);let t=null,s=null,a=-1,o=-1;for(let e=0;e<m.length;e++){const n=m[e],l=r[n];null!==l&&((null===t||l<t)&&(t=l,a=n),(null===s||l>s)&&(s=l,o=n))}null!==t&&null!==s?(g.push([a,o]),A.push(d(i({},b[e]),{x:f[e],y:[t,s]}))):(g.push(null),A.push(d(i({},b[e]),{x:f[e],y:null})))}r.dumbbellData={form:"series",names:n.map((e,r)=>{var t;return null!=(t=null==e?void 0:e.name)?t:`Series ${r+1}`}),values:y,order:g,carrier:m.length?m[0]:0,hidden:n.map((e,r)=>r).filter(e=>-1!==c.indexOf(e))};const _=r.dumbbellData.carrier;return n.map((e,r)=>d(i({},e),{data:r===_&&m.length?A:[]}))}const b="__apexcharts_series_transforms__";var x,y;globalThis[b]||(globalThis[b]={}),x="dumbbell","function"==typeof(y=f)?globalThis[b][x]=y:console.warn(`ApexCharts: registerSeriesTransform("${x}") expects a function (series, w) => series.`),e.default=c,e.dumbbellTransform=f,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).ApexDumbbell={})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),r=t.__apex_axes_AxesUtils,s=t.__apex_Series,a=t.__apex_Utils,i=t.__apex_Environment_Environment,n=t.__apex_BrowserAPIs_BrowserAPIs,l=t.__apex_math_SVGNS;t.default.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const r=parseFloat(e.getAttributeNS(null,"width")),s=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",r*t),e.setAttributeNS(null,"height",s*t),e.setAttributeNS(null,"viewBox","0 0 "+r+" "+s)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const r=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<r.length;e++){let s;try{s=t[e].toDataURL()}catch(e){continue}const a=r[e],i=document.createElementNS(l,"image");i.setAttribute("x",a.getAttribute("x")||"0"),i.setAttribute("y",a.getAttribute("y")||"0"),i.setAttribute("width",a.getAttribute("width")||"0"),i.setAttribute("height",a.getAttribute("height")||"0"),i.setAttribute("href",s),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),a.parentNode&&a.parentNode.replaceChild(i,a)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(r=>{""===e.style.getPropertyValue(r)&&e.style.setProperty(r,t[r])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,r=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),s=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),r&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),r||s&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):s&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):s&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!i.isBrowser()||!t.dom.elWrap)return e;const r=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...r].forEach(t=>{const r=n.getComputedStyle(t),s=r&&r.fontFamily;s&&s.split(",").forEach(t=>{const r=t.trim().replace(/^['"]|['"]$/g,"");r&&e.add(r.toLowerCase())})}),e}collectFontFaceRules(){if(!i.isBrowser())return Promise.resolve([]);const e=[],t=[],r=(t,r)=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const s=t.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t,base:r})})},s=(e,t)=>{Array.from(e).forEach(e=>{5===e.type?e.cssText&&r(e.cssText,t):e.styleSheet?a(e.styleSheet):e.cssRules&&s(e.cssRules,t)})},a=e=>{let a=null;try{a=e.cssRules}catch(e){}a?s(a,e.href||document.baseURI):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(t=>r(t,e.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(a),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!i.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const r=this.collectFontFamilies();return r.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>r.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css,e.base).catch(()=>null))):Promise.resolve([])}).then(t=>{const r=(t||[]).filter(Boolean).join("\n");if(!r)return;const s=document.createElementNS(l,"style");s.textContent=r,e.insertBefore(s,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e,t){const r=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(e));)a[2].startsWith("data:")||r.push(a[2]);return r.length?Promise.all(r.map(e=>this.fetchAsDataUri(t?new URL(e,t).href:e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let r=e,s=0;return t.forEach(({url:e,dataUri:t})=>{t&&(r=r.split(e).join(t),s++)}),s?r:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const r=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let s="";for(let e=0;e<t.length;e+=32768)s+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${r};base64,${btoa(s)}`})})}getSvgString(e){return new Promise(t=>{var r,s,a;const i=this.w;let n=e||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;n||(n=1);const l=i.globals.svgWidth*n,o=i.globals.svgHeight*n;null==(r=i.globals.layoutTween)||r.finish(),null==(s=i.globals.circleTween)||s.finish(),null==(a=i.globals.highlightTween)||a.finish(),[...i.globals.chromeTweens||[]].forEach(e=>e());const c=i.dom.elWrap.cloneNode(!0);c.style.width=l+"px",c.style.height=o+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let g=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${l}px; height:${o}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(g);1!==n&&this.scaleSvgNode(u,n),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{g=(new XMLSerializer).serializeToString(u),t(g.replace(/ /g," "))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",r=e.getElementsByTagName("image"),s=Array.from(r).map(e=>{const r=e.getAttributeNS(t,"href"),s=e.getAttribute("href"),a=r||s;if(!a||a.startsWith("data:"))return Promise.resolve();const i=a=>{r&&e.setAttributeNS(t,"href",a),!s&&r||e.setAttribute("href",a)};return this.fetchAsDataUri(a).then(i).catch(()=>this.getBase64FromUrl(a).then(i).catch(e=>{console.error("Error converting image to base64:",e)}))});return Promise.all(s)}getBase64FromUrl(e){return i.isSSR()?Promise.resolve(e):new Promise((t,r)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const e=document.createElement("canvas");e.width=s.width,e.height=s.height;const r=e.getContext("2d");r&&r.drawImage(s,0,0),t(e.toDataURL())},s.onerror=r,s.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const r=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(r))})})}dataURI(e){return i.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const r=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),t({imgURI:""})},a=e?e.scale||e.width/r.globals.svgWidth:1,i=document.createElement("canvas");i.width=r.globals.svgWidth*a,i.height=parseInt(r.dom.elWrap.style.height,10)*a;const n=this.resolveExportBackground(),l=i.getContext("2d");if(!l)return s();l.fillStyle=n,l.fillRect(0,0,i.width,i.height),this.getSvgString(a).then(e=>{const r="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{try{l.drawImage(a,0,0);const e=i;if(e.msToBlob){const r=e.msToBlob();t({blob:r})}else{const e=i.toDataURL("image/png");t({imgURI:e})}}catch(e){s()}},a.onerror=s,a.src=r}).catch(s)})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,r=e?{scale:e}:t?{width:t}:void 0;this.dataURI(r).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):e&&this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:i=",",lineDelimiter:n="\n"}){const l=this.w,o=l.globals,c=l.config.chart.toolbar.export.csv,h=!e&&(o.streamgraphRawSeries||o.waterfallRawSeries||o.dumbbellRawSeries);e||(e=h||l.config.series);const g=new Set(h&&h===o.dumbbellRawSeries?l.dumbbellData.hidden:o.collapsedSeriesIndices),u=[],f=[],p="datetime"===l.config.xaxis.type,m=l.config.xaxis.labels.datetimeUTC,d=e=>{if(null==e||a.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)&&isNaN(+t)?`'${t}`:t},x=e=>p&&String(e).length>=10&&!isNaN(new Date(e).getTime()),y=(e,t)=>{const r=new Date(e);if(m||r.setTime(r.getTime()-6e4*r.getTimezoneOffset()),t)return r.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,a,i,n]=r.toUTCString().split(" ");return`${s.slice(0,3)} ${i} ${a} ${n}`},b=(e,t)=>"function"==typeof c.categoryFormatter?c.categoryFormatter(e):null==e?"":x(e)?y(e,t):a.isNumber(e)?e:d(String(e).split(i).join("")),w=e=>"function"==typeof c.valueFormatter?c.valueFormatter(e):d(e),S=new r(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),v=e=>{let t="";if(o.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(o.isBarHorizontal){const r=l.formatters.yLabelFormatters[0],a=new s(this.ctx.w).getActiveConfigSeriesIndex();t=r(l.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:l})}else t=S.getLabel(l.labelData.labels,l.labelData.timescaleLabels,0,e).text;p&&(l.config.xaxis.categories.length?t=l.config.xaxis.categories[e]:l.config.labels.length&&(t=l.config.labels[e]))}else t=l.config.labels[e];return Array.isArray(t)?t.join(" "):t},A=l.candleData,D=l.rangeData,E=l.violinData,C=e.length>1,P=e.map((e,t)=>{const r=h?"":e.type||l.config.chart.type,s="candlestick"===r?{open:A.seriesCandleO,high:A.seriesCandleH,low:A.seriesCandleL,close:A.seriesCandleC}:"boxPlot"===r?{minimum:A.seriesCandleO,q1:A.seriesCandleH,median:A.seriesCandleM,q3:A.seriesCandleL,maximum:A.seriesCandleC}:"rangeBar"===r||"rangeArea"===r?{minimum:D.seriesRangeStart,maximum:D.seriesRangeEnd}:"violin"===r?{minimum:E.seriesViolinMin,maximum:E.seriesViolinMax,observations:E.seriesViolinPoints}:null,a=String(e.name||`series-${t}`).split(i).join("")||`series-${t}`,n=s?Object.keys(s):[a];return{head:s&&C?n.map(e=>`${a} ${e}`):n,cells:r=>{var a;const i=g.has(t);if(!s){const t=i||null==(a=e.data)?void 0:a[r];return[w(t&&"object"==typeof t?Array.isArray(t)?t[1]:t.y:t)]}return Object.values(s).map(e=>{var s;const a=i||null==(s=null==e?void 0:e[t])?void 0:s[r];return w(Array.isArray(a)?a.length:a)})}}});if(o.axisCharts)if(u.push([c.headerCategory,...P.flatMap(e=>e.head)].join(i)),o.allSeriesHasEqualX||l.config.xaxis.categories.length||l.config.labels.length){const t=Math.max(0,...e.map(e=>{var t;return(null==(t=e.data)?void 0:t.length)||0}));for(let r=0;r<t;r++){let t=v(r);if(null!==t){if(!t){const s=e.map(e=>{var t;return null==(t=e.data)?void 0:t[r]}).find(e=>null!=e);t=null==s?"":Array.isArray(s)?s[0]:s.x}f.push([t,...P.flatMap(e=>e.cells(r))])}}}else{const t=new Map;e.forEach((e,r)=>{var s;null==(s=null==e?void 0:e.data)||s.forEach((e,s)=>{if(!e||"object"!=typeof e)return;const a=Array.isArray(e)?e[0]:e.x,i=String(a);let n=t.get(i);n||(n={cat:a,values:P.map(e=>e.head.map(()=>""))},t.set(i,n)),n.values[r]=P[r].cells(s)})}),Array.from(t.values()).sort((e,t)=>{const r="string"==typeof e.cat;return r!==("string"==typeof t.cat)?r?1:-1:r?l.axisFlags.isXNumeric?e.cat<t.cat?-1:1:0:e.cat-t.cat}).forEach(({cat:e,values:t})=>f.push([e,...t.flat()]))}else u.push([c.headerCategory,c.headerValue].join(i)),e.forEach((e,t)=>{u.push([b(l.labelData.labels[t]),w(g.has(t)?"":l.seriesData.series[t])].join(i))});const U=f.map(e=>e[0]).filter(x),j=new Set(U.map(e=>y(e))).size<U.length;f.forEach(e=>u.push([b(e[0],j),...e.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+u.join(n)),t||c.filename,".csv")}triggerDownload(e,t,r){if(i.isSSR())return;const s=document.createElement("a");s.href=e,s.download=(t||this.w.globals.chartID)+r,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
|
|
5
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),r=t.__apex_axes_AxesUtils,s=t.__apex_Series,a=t.__apex_Utils,n=t.__apex_Environment_Environment,i=t.__apex_BrowserAPIs_BrowserAPIs,l=t.__apex_math_SVGNS;t.default.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const r=parseFloat(e.getAttributeNS(null,"width")),s=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",r*t),e.setAttributeNS(null,"height",s*t),e.setAttributeNS(null,"viewBox","0 0 "+r+" "+s)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const r=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<r.length;e++){let s;try{s=t[e].toDataURL()}catch(e){continue}const a=r[e],n=document.createElementNS(l,"image");n.setAttribute("x",a.getAttribute("x")||"0"),n.setAttribute("y",a.getAttribute("y")||"0"),n.setAttribute("width",a.getAttribute("width")||"0"),n.setAttribute("height",a.getAttribute("height")||"0"),n.setAttribute("href",s),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),a.parentNode&&a.parentNode.replaceChild(n,a)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(r=>{""===e.style.getPropertyValue(r)&&e.style.setProperty(r,t[r])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,r=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),s=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),r&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),r||s&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):s&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):s&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!n.isBrowser()||!t.dom.elWrap)return e;const r=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...r].forEach(t=>{const r=i.getComputedStyle(t),s=r&&r.fontFamily;s&&s.split(",").forEach(t=>{const r=t.trim().replace(/^['"]|['"]$/g,"");r&&e.add(r.toLowerCase())})}),e}collectFontFaceRules(){if(!n.isBrowser())return Promise.resolve([]);const e=[],t=[],r=(t,r)=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const s=t.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t,base:r})})},s=(e,t)=>{Array.from(e).forEach(e=>{5===e.type?e.cssText&&r(e.cssText,t):e.styleSheet?a(e.styleSheet):e.cssRules&&s(e.cssRules,t)})},a=e=>{let a=null;try{a=e.cssRules}catch(e){}a?s(a,e.href||document.baseURI):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(t=>r(t,e.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(a),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!n.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const r=this.collectFontFamilies();return r.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>r.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css,e.base).catch(()=>null))):Promise.resolve([])}).then(t=>{const r=(t||[]).filter(Boolean).join("\n");if(!r)return;const s=document.createElementNS(l,"style");s.textContent=r,e.insertBefore(s,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e,t){const r=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(e));)a[2].startsWith("data:")||r.push(a[2]);return r.length?Promise.all(r.map(e=>this.fetchAsDataUri(t?new URL(e,t).href:e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let r=e,s=0;return t.forEach(({url:e,dataUri:t})=>{t&&(r=r.split(e).join(t),s++)}),s?r:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const r=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let s="";for(let e=0;e<t.length;e+=32768)s+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${r};base64,${btoa(s)}`})})}getSvgString(e){return new Promise(t=>{var r,s,a;const n=this.w;let i=e||n.config.chart.toolbar.export.scale||n.config.chart.toolbar.export.width/n.globals.svgWidth;i||(i=1);const l=n.globals.svgWidth*i,o=n.globals.svgHeight*i;null==(r=n.globals.layoutTween)||r.finish(),null==(s=n.globals.circleTween)||s.finish(),null==(a=n.globals.highlightTween)||a.finish(),[...n.globals.chromeTweens||[]].forEach(e=>e());const c=n.dom.elWrap.cloneNode(!0);c.style.width=l+"px",c.style.height=o+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let g=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${n.globals.svgWidth}px" height="${n.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${l}px; height:${o}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(g);1!==i&&this.scaleSvgNode(u,i),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{g=(new XMLSerializer).serializeToString(u),t(g.replace(/ /g," "))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",r=e.getElementsByTagName("image"),s=Array.from(r).map(e=>{const r=e.getAttributeNS(t,"href"),s=e.getAttribute("href"),a=r||s;if(!a||a.startsWith("data:"))return Promise.resolve();const n=a=>{r&&e.setAttributeNS(t,"href",a),!s&&r||e.setAttribute("href",a)};return this.fetchAsDataUri(a).then(n).catch(()=>this.getBase64FromUrl(a).then(n).catch(e=>{console.error("Error converting image to base64:",e)}))});return Promise.all(s)}getBase64FromUrl(e){return n.isSSR()?Promise.resolve(e):new Promise((t,r)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const e=document.createElement("canvas");e.width=s.width,e.height=s.height;const r=e.getContext("2d");r&&r.drawImage(s,0,0),t(e.toDataURL())},s.onerror=r,s.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const r=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(r))})})}dataURI(e){return n.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const r=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),t({imgURI:""})},a=e?e.scale||e.width/r.globals.svgWidth:1,n=document.createElement("canvas");n.width=r.globals.svgWidth*a,n.height=parseInt(r.dom.elWrap.style.height,10)*a;const i=this.resolveExportBackground(),l=n.getContext("2d");if(!l)return s();l.fillStyle=i,l.fillRect(0,0,n.width,n.height),this.getSvgString(a).then(e=>{const r="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{try{l.drawImage(a,0,0);const e=n;if(e.msToBlob){const r=e.msToBlob();t({blob:r})}else{const e=n.toDataURL("image/png");t({imgURI:e})}}catch(e){s()}},a.onerror=s,a.src=r}).catch(s)})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,r=e?{scale:e}:t?{width:t}:void 0;this.dataURI(r).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):e&&this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:n=",",lineDelimiter:i="\n"}){const l=this.w,o=l.globals,c=l.config.chart.toolbar.export.csv,h=!e&&(o.streamgraphRawSeries||o.waterfallRawSeries||o.dumbbellRawSeries);e||(e=h||l.config.series);const g=new Set(h&&h===o.dumbbellRawSeries?l.dumbbellData.hidden:o.collapsedSeriesIndices),u=[],f=[],p="datetime"===l.config.xaxis.type,m=l.config.xaxis.labels.datetimeUTC,d=e=>{if(null==e||a.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)&&isNaN(+t)?`'${t}`:t},x=e=>p&&String(e).length>=10&&!isNaN(new Date(e).getTime()),y=(e,t)=>{const r=new Date(e);if(m||r.setTime(r.getTime()-6e4*r.getTimezoneOffset()),t)return r.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,a,n,i]=r.toUTCString().split(" ");return`${s.slice(0,3)} ${n} ${a} ${i}`},b=(e,t)=>"function"==typeof c.categoryFormatter?c.categoryFormatter(e):null==e?"":x(e)?y(e,t):a.isNumber(e)?e:d(String(e).split(n).join("")),w=e=>"function"==typeof c.valueFormatter?c.valueFormatter(e):d(e),S=new r(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),v=e=>{let t="";if(o.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(o.isBarHorizontal){const r=l.formatters.yLabelFormatters[0],a=new s(this.ctx.w).getActiveConfigSeriesIndex();t=r(l.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:l})}else t=S.getLabel(l.labelData.labels,l.labelData.timescaleLabels,0,e).text;p&&(l.config.xaxis.categories.length?t=l.config.xaxis.categories[e]:l.config.labels.length&&(t=l.config.labels[e]))}else t=l.config.labels[e];return Array.isArray(t)?t.join(" "):t},A=l.candleData,D=l.rangeData,E=l.violinData,C=e.length>1,P=e.map((e,t)=>{const r=h?"":e.type||l.config.chart.type,s="candlestick"===r?{open:A.seriesCandleO,high:A.seriesCandleH,low:A.seriesCandleL,close:A.seriesCandleC}:"boxPlot"===r?{minimum:A.seriesCandleO,q1:A.seriesCandleH,median:A.seriesCandleM,q3:A.seriesCandleL,maximum:A.seriesCandleC}:"rangeBar"===r||"rangeArea"===r?{minimum:D.seriesRangeStart,maximum:D.seriesRangeEnd}:"violin"===r?{minimum:E.seriesViolinMin,maximum:E.seriesViolinMax,observations:E.seriesViolinPoints}:null,a=String(e.name||`series-${t}`).split(n).join("")||`series-${t}`,i=s?Object.keys(s):[a];return{head:s&&C?i.map(e=>`${a} ${e}`):i,cells:r=>{var a;const n=g.has(t);if(!s){const t=n||null==(a=e.data)?void 0:a[r];return[w(t&&"object"==typeof t?Array.isArray(t)?t[1]:t.y:t)]}return Object.values(s).map(e=>{var s;const a=n||null==(s=null==e?void 0:e[t])?void 0:s[r];return w(Array.isArray(a)?a.length:a)})}}});if(o.axisCharts)if(u.push([c.headerCategory,...P.flatMap(e=>e.head)].join(n)),o.allSeriesHasEqualX||l.config.xaxis.categories.length||l.config.labels.length){const t=Math.max(0,...e.map(e=>{var t;return(null==(t=e.data)?void 0:t.length)||0}));for(let r=0;r<t;r++){let t=v(r);if(null!==t){if(!t){const s=e.map(e=>{var t;return null==(t=e.data)?void 0:t[r]}).find(e=>null!=e);t=null==s?"":Array.isArray(s)?s[0]:s.x}f.push([t,...P.flatMap(e=>e.cells(r))])}}}else{const t=new Map;e.forEach((e,r)=>{var s;const a=new Map;null==(s=null==e?void 0:e.data)||s.forEach((e,s)=>{if(!e||"object"!=typeof e)return;const n=Array.isArray(e)?e[0]:e.x,i=String(n),l=a.get(i)||0;a.set(i,l+1);const o=`${l}:${i}`;let c=t.get(o);c||(c={cat:n,values:P.map(e=>e.head.map(()=>""))},t.set(o,c)),c.values[r]=P[r].cells(s)})}),Array.from(t.values()).sort((e,t)=>{const r="string"==typeof e.cat;return r!==("string"==typeof t.cat)?r?1:-1:r?l.axisFlags.isXNumeric?e.cat<t.cat?-1:e.cat>t.cat?1:0:0:e.cat-t.cat}).forEach(({cat:e,values:t})=>f.push([e,...t.flat()]))}else u.push([c.headerCategory,c.headerValue].join(n)),e.forEach((e,t)=>{u.push([b(l.labelData.labels[t]),w(g.has(t)?"":l.seriesData.series[t])].join(n))});const U=f.map(e=>e[0]).filter(x),j=new Set(U.map(e=>+new Date(e))),N=new Set([...j].map(e=>y(e))).size<j.size;f.forEach(e=>u.push([b(e[0],N),...e.slice(1)].join(n))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+u.join(i)),t||c.filename,".csv")}triggerDownload(e,t,r){if(n.isSSR())return;const s=document.createElement("a");s.href=e,s.download=(t||this.w.globals.chartID)+r,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
import * as _core from "apexcharts/core";
|
|
@@ -807,10 +807,14 @@ class Exports {
|
|
|
807
807
|
const byCategory = /* @__PURE__ */ new Map();
|
|
808
808
|
series.forEach((s, sI) => {
|
|
809
809
|
var _a;
|
|
810
|
+
const seen = /* @__PURE__ */ new Map();
|
|
810
811
|
(_a = s == null ? void 0 : s.data) == null ? void 0 : _a.forEach((d, i) => {
|
|
811
812
|
if (!d || typeof d !== "object") return;
|
|
812
813
|
const cat = Array.isArray(d) ? d[0] : d.x;
|
|
813
|
-
const
|
|
814
|
+
const x = String(cat);
|
|
815
|
+
const n = seen.get(x) || 0;
|
|
816
|
+
seen.set(x, n + 1);
|
|
817
|
+
const key = `${n}:${x}`;
|
|
814
818
|
let row = byCategory.get(key);
|
|
815
819
|
if (!row) {
|
|
816
820
|
row = { cat, values: cols.map((c) => c.head.map(() => "")) };
|
|
@@ -824,7 +828,8 @@ class Exports {
|
|
|
824
828
|
const bText = typeof b.cat === "string";
|
|
825
829
|
if (aText !== bText) return aText ? 1 : -1;
|
|
826
830
|
if (!aText) return a.cat - b.cat;
|
|
827
|
-
|
|
831
|
+
if (!w.axisFlags.isXNumeric) return 0;
|
|
832
|
+
return a.cat < b.cat ? -1 : a.cat > b.cat ? 1 : 0;
|
|
828
833
|
}).forEach(({ cat, values }) => body.push([cat, ...values.flat()]));
|
|
829
834
|
} else {
|
|
830
835
|
const len = Math.max(
|
|
@@ -849,7 +854,8 @@ class Exports {
|
|
|
849
854
|
}
|
|
850
855
|
}
|
|
851
856
|
const dates = body.map((r) => r[0]).filter(isDateCat);
|
|
852
|
-
const
|
|
857
|
+
const stamps = new Set(dates.map((c) => +new Date(c)));
|
|
858
|
+
const withTime = new Set([...stamps].map((t) => datetimeText(t))).size < stamps.size;
|
|
853
859
|
body.forEach(
|
|
854
860
|
(r) => rows.push(
|
|
855
861
|
[getFormattedCategory(r[0], withTime), ...r.slice(1)].join(
|
package/dist/features/exports.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
!function(e){var t="undefined"!=typeof globalThis?globalThis:self,s=t.ApexCharts;if(s&&s.__internals)return e.call(t);if(s)throw new Error("ApexCharts: dist/features/exports.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return e.call(t);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/exports.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var r={file:"dist/features/exports.js",run:e,done:!1},a=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);a.push(r),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!r.done){var s=t.ApexCharts;if(s)if(s.__internals){r.done=!0;var n=a.indexOf(r);-1!==n&&a.splice(n,1);try{e.call(t),s.__drainsAddons||t.console.warn("ApexCharts: dist/features/exports.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(e){t.console.error("ApexCharts: dist/features/exports.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/exports.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else t.console.warn("ApexCharts: dist/features/exports.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var e,t;e=this,t=function(e){"use strict";const t=globalThis.ApexCharts,s=globalThis.ApexCharts.__internals.__apex_axes_AxesUtils,r=globalThis.ApexCharts.__internals.__apex_Series,a=globalThis.ApexCharts.__internals.__apex_Utils,n=globalThis.ApexCharts.__internals.__apex_Environment_Environment,i=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,o=globalThis.ApexCharts.__internals,l=o.__apex_math_SVGNS;o.__apex_math_Point,o.__apex_math_Matrix,o.__apex_math_Box,t.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const s=parseFloat(e.getAttributeNS(null,"width")),r=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",s*t),e.setAttributeNS(null,"height",r*t),e.setAttributeNS(null,"viewBox","0 0 "+s+" "+r)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const s=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<s.length;e++){let r;try{r=t[e].toDataURL()}catch(e){continue}const a=s[e],n=document.createElementNS(l,"image");n.setAttribute("x",a.getAttribute("x")||"0"),n.setAttribute("y",a.getAttribute("y")||"0"),n.setAttribute("width",a.getAttribute("width")||"0"),n.setAttribute("height",a.getAttribute("height")||"0"),n.setAttribute("href",r),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),a.parentNode&&a.parentNode.replaceChild(n,a)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(s=>{""===e.style.getPropertyValue(s)&&e.style.setProperty(s,t[s])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,s=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),r=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),s&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),r&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),s||r&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):r&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):r&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!n.isBrowser()||!t.dom.elWrap)return e;const s=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...s].forEach(t=>{const s=i.getComputedStyle(t),r=s&&s.fontFamily;r&&r.split(",").forEach(t=>{const s=t.trim().replace(/^['"]|['"]$/g,"");s&&e.add(s.toLowerCase())})}),e}collectFontFaceRules(){if(!n.isBrowser())return Promise.resolve([]);const e=[],t=[],s=(t,s)=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const r=t.match(/font-family\s*:\s*([^;}]+)/i);if(!r)return;const a=r[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t,base:s})})},r=(e,t)=>{Array.from(e).forEach(e=>{5===e.type?e.cssText&&s(e.cssText,t):e.styleSheet?a(e.styleSheet):e.cssRules&&r(e.cssRules,t)})},a=e=>{let a=null;try{a=e.cssRules}catch(e){}a?r(a,e.href||document.baseURI):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(t=>s(t,e.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(a),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!n.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const s=this.collectFontFamilies();return s.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>s.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css,e.base).catch(()=>null))):Promise.resolve([])}).then(t=>{const s=(t||[]).filter(Boolean).join("\n");if(!s)return;const r=document.createElementNS(l,"style");r.textContent=s,e.insertBefore(r,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e,t){const s=[],r=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=r.exec(e));)a[2].startsWith("data:")||s.push(a[2]);return s.length?Promise.all(s.map(e=>this.fetchAsDataUri(t?new URL(e,t).href:e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let s=e,r=0;return t.forEach(({url:e,dataUri:t})=>{t&&(s=s.split(e).join(t),r++)}),r?s:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const s=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${s};base64,${btoa(r)}`})})}getSvgString(e){return new Promise(t=>{var s,r,a;const n=this.w;let i=e||n.config.chart.toolbar.export.scale||n.config.chart.toolbar.export.width/n.globals.svgWidth;i||(i=1);const o=n.globals.svgWidth*i,l=n.globals.svgHeight*i;null==(s=n.globals.layoutTween)||s.finish(),null==(r=n.globals.circleTween)||r.finish(),null==(a=n.globals.highlightTween)||a.finish(),[...n.globals.chromeTweens||[]].forEach(e=>e());const c=n.dom.elWrap.cloneNode(!0);c.style.width=o+"px",c.style.height=l+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let p=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${n.globals.svgWidth}px" height="${n.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${o}px; height:${l}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const g=this.svgStringToNode(p);1!==i&&this.scaleSvgNode(g,i),Promise.all([this.convertImagesToBase64(g),this.embedFonts(g)]).then(()=>{p=(new XMLSerializer).serializeToString(g),t(p.replace(/ /g," "))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",s=e.getElementsByTagName("image"),r=Array.from(s).map(e=>{const s=e.getAttributeNS(t,"href"),r=e.getAttribute("href"),a=s||r;if(!a||a.startsWith("data:"))return Promise.resolve();const n=a=>{s&&e.setAttributeNS(t,"href",a),!r&&s||e.setAttribute("href",a)};return this.fetchAsDataUri(a).then(n).catch(()=>this.getBase64FromUrl(a).then(n).catch(e=>{console.error("Error converting image to base64:",e)}))});return Promise.all(r)}getBase64FromUrl(e){return n.isSSR()?Promise.resolve(e):new Promise((t,s)=>{const r=new Image;r.crossOrigin="Anonymous",r.onload=()=>{const e=document.createElement("canvas");e.width=r.width,e.height=r.height;const s=e.getContext("2d");s&&s.drawImage(r,0,0),t(e.toDataURL())},r.onerror=s,r.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const s=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(s))})})}dataURI(e){return n.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const s=this.w,r=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),t({imgURI:""})},a=e?e.scale||e.width/s.globals.svgWidth:1,n=document.createElement("canvas");n.width=s.globals.svgWidth*a,n.height=parseInt(s.dom.elWrap.style.height,10)*a;const i=this.resolveExportBackground(),o=n.getContext("2d");if(!o)return r();o.fillStyle=i,o.fillRect(0,0,n.width,n.height),this.getSvgString(a).then(e=>{const s="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{try{o.drawImage(a,0,0);const e=n;if(e.msToBlob){const s=e.msToBlob();t({blob:s})}else{const e=n.toDataURL("image/png");t({imgURI:e})}}catch(e){r()}},a.onerror=r,a.src=s}).catch(r)})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,s=e?{scale:e}:t?{width:t}:void 0;this.dataURI(s).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):e&&this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:n=",",lineDelimiter:i="\n"}){const o=this.w,l=o.globals,c=o.config.chart.toolbar.export.csv,h=!e&&(l.streamgraphRawSeries||l.waterfallRawSeries||l.dumbbellRawSeries);e||(e=h||o.config.series);const p=new Set(h&&h===l.dumbbellRawSeries?o.dumbbellData.hidden:l.collapsedSeriesIndices),g=[],d=[],f="datetime"===o.config.xaxis.type,u=o.config.xaxis.labels.datetimeUTC,m=e=>{if(null==e||a.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)&&isNaN(+t)?`'${t}`:t},x=e=>f&&String(e).length>=10&&!isNaN(new Date(e).getTime()),y=(e,t)=>{const s=new Date(e);if(u||s.setTime(s.getTime()-6e4*s.getTimezoneOffset()),t)return s.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[r,a,n,i]=s.toUTCString().split(" ");return`${r.slice(0,3)} ${n} ${a} ${i}`},b=(e,t)=>"function"==typeof c.categoryFormatter?c.categoryFormatter(e):null==e?"":x(e)?y(e,t):a.isNumber(e)?e:m(String(e).split(n).join("")),w=e=>"function"==typeof c.valueFormatter?c.valueFormatter(e):m(e),S=new s(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),v=e=>{let t="";if(l.axisCharts){if("category"===o.config.xaxis.type||o.config.xaxis.convertedCatToNumeric)if(l.isBarHorizontal){const s=o.formatters.yLabelFormatters[0],a=new r(this.ctx.w).getActiveConfigSeriesIndex();t=s(o.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:o})}else t=S.getLabel(o.labelData.labels,o.labelData.timescaleLabels,0,e).text;f&&(o.config.xaxis.categories.length?t=o.config.xaxis.categories[e]:o.config.labels.length&&(t=o.config.labels[e]))}else t=o.config.labels[e];return Array.isArray(t)?t.join(" "):t},A=o.candleData,_=o.rangeData,C=o.violinData,E=e.length>1,j=e.map((e,t)=>{const s=h?"":e.type||o.config.chart.type,r="candlestick"===s?{open:A.seriesCandleO,high:A.seriesCandleH,low:A.seriesCandleL,close:A.seriesCandleC}:"boxPlot"===s?{minimum:A.seriesCandleO,q1:A.seriesCandleH,median:A.seriesCandleM,q3:A.seriesCandleL,maximum:A.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:_.seriesRangeStart,maximum:_.seriesRangeEnd}:"violin"===s?{minimum:C.seriesViolinMin,maximum:C.seriesViolinMax,observations:C.seriesViolinPoints}:null,a=String(e.name||`series-${t}`).split(n).join("")||`series-${t}`,i=r?Object.keys(r):[a];return{head:r&&E?i.map(e=>`${a} ${e}`):i,cells:s=>{var a;const n=p.has(t);if(!r){const t=n||null==(a=e.data)?void 0:a[s];return[w(t&&"object"==typeof t?Array.isArray(t)?t[1]:t.y:t)]}return Object.values(r).map(e=>{var r;const a=n||null==(r=null==e?void 0:e[t])?void 0:r[s];return w(Array.isArray(a)?a.length:a)})}}});if(l.axisCharts)if(g.push([c.headerCategory,...j.flatMap(e=>e.head)].join(n)),l.allSeriesHasEqualX||o.config.xaxis.categories.length||o.config.labels.length){const t=Math.max(0,...e.map(e=>{var t;return(null==(t=e.data)?void 0:t.length)||0}));for(let s=0;s<t;s++){let t=v(s);if(null!==t){if(!t){const r=e.map(e=>{var t;return null==(t=e.data)?void 0:t[s]}).find(e=>null!=e);t=null==r?"":Array.isArray(r)?r[0]:r.x}d.push([t,...j.flatMap(e=>e.cells(s))])}}}else{const t=new Map;e.forEach((e,s)=>{var r;null==(r=null==e?void 0:e.data)||r.forEach((e,r)=>{if(!e||"object"!=typeof e)return;const a=Array.isArray(e)?e[0]:e.x,n=String(a);let i=t.get(n);i||(i={cat:a,values:j.map(e=>e.head.map(()=>""))},t.set(n,i)),i.values[s]=j[s].cells(r)})}),Array.from(t.values()).sort((e,t)=>{const s="string"==typeof e.cat;return s!==("string"==typeof t.cat)?s?1:-1:s?o.axisFlags.isXNumeric?e.cat<t.cat?-1:1:0:e.cat-t.cat}).forEach(({cat:e,values:t})=>d.push([e,...t.flat()]))}else g.push([c.headerCategory,c.headerValue].join(n)),e.forEach((e,t)=>{g.push([b(o.labelData.labels[t]),w(p.has(t)?"":o.seriesData.series[t])].join(n))});const D=d.map(e=>e[0]).filter(x),T=new Set(D.map(e=>y(e))).size<D.length;d.forEach(e=>g.push([b(e[0],T),...e.slice(1)].join(n))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+g.join(i)),t||c.filename,".csv")}triggerDownload(e,t,s){if(n.isSSR())return;const r=document.createElement("a");r.href=e,r.download=(t||this.w.globals.chartID)+s,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexExports={})});
|
|
5
|
+
!function(e){var t="undefined"!=typeof globalThis?globalThis:self,s=t.ApexCharts;if(s&&s.__internals)return e.call(t);if(s)throw new Error("ApexCharts: dist/features/exports.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return e.call(t);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/exports.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var r={file:"dist/features/exports.js",run:e,done:!1},a=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);a.push(r),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!r.done){var s=t.ApexCharts;if(s)if(s.__internals){r.done=!0;var n=a.indexOf(r);-1!==n&&a.splice(n,1);try{e.call(t),s.__drainsAddons||t.console.warn("ApexCharts: dist/features/exports.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(e){t.console.error("ApexCharts: dist/features/exports.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/exports.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else t.console.warn("ApexCharts: dist/features/exports.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var e,t;e=this,t=function(e){"use strict";const t=globalThis.ApexCharts,s=globalThis.ApexCharts.__internals.__apex_axes_AxesUtils,r=globalThis.ApexCharts.__internals.__apex_Series,a=globalThis.ApexCharts.__internals.__apex_Utils,n=globalThis.ApexCharts.__internals.__apex_Environment_Environment,i=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,o=globalThis.ApexCharts.__internals,l=o.__apex_math_SVGNS;o.__apex_math_Point,o.__apex_math_Matrix,o.__apex_math_Box,t.registerFeatures({exports:class{constructor(e,t){this.w=e,this.ctx=t}svgStringToNode(e){return(new DOMParser).parseFromString(e,"image/svg+xml").documentElement}scaleSvgNode(e,t){const s=parseFloat(e.getAttributeNS(null,"width")),r=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",s*t),e.setAttributeNS(null,"height",r*t),e.setAttributeNS(null,"viewBox","0 0 "+s+" "+r)}inlineCanvasLayers(e){const t=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!t.length)return;const s=e.querySelectorAll(".apexcharts-canvas-series");for(let e=0;e<t.length&&e<s.length;e++){let r;try{r=t[e].toDataURL()}catch(e){continue}const a=s[e],n=document.createElementNS(l,"image");n.setAttribute("x",a.getAttribute("x")||"0"),n.setAttribute("y",a.getAttribute("y")||"0"),n.setAttribute("width",a.getAttribute("width")||"0"),n.setAttribute("height",a.getAttribute("height")||"0"),n.setAttribute("href",r),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),a.parentNode&&a.parentNode.replaceChild(n,a)}}queryStyleable(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}setStyleDefaults(e,t){Object.keys(t).forEach(s=>{""===e.style.getPropertyValue(s)&&e.style.setProperty(s,t[s])})}applyExportStyles(e){const t=this.w;this.queryStyleable(e,"style").forEach(e=>e.remove()),this.queryStyleable(e,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(e=>{e.style.setProperty("display","none","important")}),this.queryStyleable(e,".apexcharts-flip-y").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(e,".apexcharts-flip-x").forEach(e=>{this.setStyleDefaults(e,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),t.config.legend.show&&t.dom.elLegendWrap&&t.dom.elLegendWrap.children.length&&(this.queryStyleable(e,".apexcharts-legend").forEach(e=>{this.setStyleDefaults(e,{display:"flex",overflow:"auto",padding:"0 10px"});const t=e.classList,s=t.contains("apx-legend-position-left")||t.contains("apx-legend-position-right"),r=t.contains("apx-legend-position-top")||t.contains("apx-legend-position-bottom");t.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(e,{"flex-direction":"column"}),s&&this.setStyleDefaults(e,{"flex-direction":"column",bottom:"0"}),r&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),s||r&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):r&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):r&&t.contains("apexcharts-align-right")&&this.setStyleDefaults(e,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(e,".apexcharts-legend-group").forEach(e=>{this.setStyleDefaults(e,{display:"flex"})}),this.queryStyleable(e,".apexcharts-legend-group-vertical").forEach(e=>{this.setStyleDefaults(e,{"flex-direction":"column-reverse"})}),this.queryStyleable(e,".apexcharts-legend-series").forEach(e=>{this.setStyleDefaults(e,{cursor:e.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(e,".apexcharts-legend-text").forEach(e=>{this.setStyleDefaults(e,{position:"relative","font-size":"14px"})}),this.queryStyleable(e,".apexcharts-legend-marker").forEach(e=>{this.setStyleDefaults(e,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(e,".apexcharts-inactive-legend").forEach(e=>{this.setStyleDefaults(e,{opacity:"0.45"})}),this.queryStyleable(e,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(e=>{e.style.setProperty("display","none","important")}))}resolveExportBackground(){const e=this.w,t=e.config.chart.background;return t&&"transparent"!==t?t:"dark"===e.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const e=new Set,t=this.w;if(!n.isBrowser()||!t.dom.elWrap)return e;const s=this.queryStyleable(t.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[t.dom.elWrap,...s].forEach(t=>{const s=i.getComputedStyle(t),r=s&&s.fontFamily;r&&r.split(",").forEach(t=>{const s=t.trim().replace(/^['"]|['"]$/g,"");s&&e.add(s.toLowerCase())})}),e}collectFontFaceRules(){if(!n.isBrowser())return Promise.resolve([]);const e=[],t=[],s=(t,s)=>{(t.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(t=>{const r=t.match(/font-family\s*:\s*([^;}]+)/i);if(!r)return;const a=r[1].trim().replace(/^['"]|['"]$/g,"");e.push({family:a.toLowerCase(),css:t,base:s})})},r=(e,t)=>{Array.from(e).forEach(e=>{5===e.type?e.cssText&&s(e.cssText,t):e.styleSheet?a(e.styleSheet):e.cssRules&&r(e.cssRules,t)})},a=e=>{let a=null;try{a=e.cssRules}catch(e){}a?r(a,e.href||document.baseURI):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(t=>s(t,e.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(a),Promise.all(t).then(()=>e)}embedFonts(e){const t=this.w;if(!n.isBrowser()||!t.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const s=this.collectFontFamilies();return s.size?this.collectFontFaceRules().then(e=>{const t=e.filter(e=>s.has(e.family));return t.length?Promise.all(t.map(e=>this.inlineFontFaceUrls(e.css,e.base).catch(()=>null))):Promise.resolve([])}).then(t=>{const s=(t||[]).filter(Boolean).join("\n");if(!s)return;const r=document.createElementNS(l,"style");r.textContent=s,e.insertBefore(r,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e,t){const s=[],r=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=r.exec(e));)a[2].startsWith("data:")||s.push(a[2]);return s.length?Promise.all(s.map(e=>this.fetchAsDataUri(t?new URL(e,t).href:e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let s=e,r=0;return t.forEach(({url:e,dataUri:t})=>{t&&(s=s.split(e).join(t),r++)}),r?s:null}):Promise.resolve(e.includes("data:")?e:null)}fetchAsDataUri(e){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);const s=t.headers.get("content-type")||"application/octet-stream";return t.arrayBuffer().then(e=>{const t=new Uint8Array(e);let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${s};base64,${btoa(r)}`})})}getSvgString(e){return new Promise(t=>{var s,r,a;const n=this.w;let i=e||n.config.chart.toolbar.export.scale||n.config.chart.toolbar.export.width/n.globals.svgWidth;i||(i=1);const o=n.globals.svgWidth*i,l=n.globals.svgHeight*i;null==(s=n.globals.layoutTween)||s.finish(),null==(r=n.globals.circleTween)||r.finish(),null==(a=n.globals.highlightTween)||a.finish(),[...n.globals.chromeTweens||[]].forEach(e=>e());const c=n.dom.elWrap.cloneNode(!0);c.style.width=o+"px",c.style.height=l+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let p=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${n.globals.svgWidth}px" height="${n.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${o}px; height:${l}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const g=this.svgStringToNode(p);1!==i&&this.scaleSvgNode(g,i),Promise.all([this.convertImagesToBase64(g),this.embedFonts(g)]).then(()=>{p=(new XMLSerializer).serializeToString(g),t(p.replace(/ /g," "))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",s=e.getElementsByTagName("image"),r=Array.from(s).map(e=>{const s=e.getAttributeNS(t,"href"),r=e.getAttribute("href"),a=s||r;if(!a||a.startsWith("data:"))return Promise.resolve();const n=a=>{s&&e.setAttributeNS(t,"href",a),!r&&s||e.setAttribute("href",a)};return this.fetchAsDataUri(a).then(n).catch(()=>this.getBase64FromUrl(a).then(n).catch(e=>{console.error("Error converting image to base64:",e)}))});return Promise.all(r)}getBase64FromUrl(e){return n.isSSR()?Promise.resolve(e):new Promise((t,s)=>{const r=new Image;r.crossOrigin="Anonymous",r.onload=()=>{const e=document.createElement("canvas");e.width=r.width,e.height=r.height;const s=e.getContext("2d");s&&s.drawImage(r,0,0),t(e.toDataURL())},r.onerror=s,r.src=e})}svgUrl(){return new Promise(e=>{this.getSvgString().then(t=>{const s=new Blob([t],{type:"image/svg+xml;charset=utf-8"});e(URL.createObjectURL(s))})})}dataURI(e){return n.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const s=this.w,r=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),t({imgURI:""})},a=e?e.scale||e.width/s.globals.svgWidth:1,n=document.createElement("canvas");n.width=s.globals.svgWidth*a,n.height=parseInt(s.dom.elWrap.style.height,10)*a;const i=this.resolveExportBackground(),o=n.getContext("2d");if(!o)return r();o.fillStyle=i,o.fillRect(0,0,n.width,n.height),this.getSvgString(a).then(e=>{const s="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{try{o.drawImage(a,0,0);const e=n;if(e.msToBlob){const s=e.msToBlob();t({blob:s})}else{const e=n.toDataURL("image/png");t({imgURI:e})}}catch(e){r()}},a.onerror=r,a.src=s}).catch(r)})}exportToSVG(){this.svgUrl().then(e=>{this.triggerDownload(e,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const e=this.w.config.chart.toolbar.export.scale,t=this.w.config.chart.toolbar.export.width,s=e?{scale:e}:t?{width:t}:void 0;this.dataURI(s).then(({imgURI:e,blob:t})=>{t?navigator.msSaveOrOpenBlob(t,this.w.globals.chartID+".png"):e&&this.triggerDownload(e,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:e,fileName:t,columnDelimiter:n=",",lineDelimiter:i="\n"}){const o=this.w,l=o.globals,c=o.config.chart.toolbar.export.csv,h=!e&&(l.streamgraphRawSeries||l.waterfallRawSeries||l.dumbbellRawSeries);e||(e=h||o.config.series);const p=new Set(h&&h===l.dumbbellRawSeries?o.dumbbellData.hidden:l.collapsedSeriesIndices),g=[],d=[],f="datetime"===o.config.xaxis.type,u=o.config.xaxis.labels.datetimeUTC,m=e=>{if(null==e||a.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)&&isNaN(+t)?`'${t}`:t},x=e=>f&&String(e).length>=10&&!isNaN(new Date(e).getTime()),y=(e,t)=>{const s=new Date(e);if(u||s.setTime(s.getTime()-6e4*s.getTimezoneOffset()),t)return s.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[r,a,n,i]=s.toUTCString().split(" ");return`${r.slice(0,3)} ${n} ${a} ${i}`},b=(e,t)=>"function"==typeof c.categoryFormatter?c.categoryFormatter(e):null==e?"":x(e)?y(e,t):a.isNumber(e)?e:m(String(e).split(n).join("")),w=e=>"function"==typeof c.valueFormatter?c.valueFormatter(e):m(e),S=new s(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),v=e=>{let t="";if(l.axisCharts){if("category"===o.config.xaxis.type||o.config.xaxis.convertedCatToNumeric)if(l.isBarHorizontal){const s=o.formatters.yLabelFormatters[0],a=new r(this.ctx.w).getActiveConfigSeriesIndex();t=s(o.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:o})}else t=S.getLabel(o.labelData.labels,o.labelData.timescaleLabels,0,e).text;f&&(o.config.xaxis.categories.length?t=o.config.xaxis.categories[e]:o.config.labels.length&&(t=o.config.labels[e]))}else t=o.config.labels[e];return Array.isArray(t)?t.join(" "):t},A=o.candleData,_=o.rangeData,C=o.violinData,E=e.length>1,j=e.map((e,t)=>{const s=h?"":e.type||o.config.chart.type,r="candlestick"===s?{open:A.seriesCandleO,high:A.seriesCandleH,low:A.seriesCandleL,close:A.seriesCandleC}:"boxPlot"===s?{minimum:A.seriesCandleO,q1:A.seriesCandleH,median:A.seriesCandleM,q3:A.seriesCandleL,maximum:A.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:_.seriesRangeStart,maximum:_.seriesRangeEnd}:"violin"===s?{minimum:C.seriesViolinMin,maximum:C.seriesViolinMax,observations:C.seriesViolinPoints}:null,a=String(e.name||`series-${t}`).split(n).join("")||`series-${t}`,i=r?Object.keys(r):[a];return{head:r&&E?i.map(e=>`${a} ${e}`):i,cells:s=>{var a;const n=p.has(t);if(!r){const t=n||null==(a=e.data)?void 0:a[s];return[w(t&&"object"==typeof t?Array.isArray(t)?t[1]:t.y:t)]}return Object.values(r).map(e=>{var r;const a=n||null==(r=null==e?void 0:e[t])?void 0:r[s];return w(Array.isArray(a)?a.length:a)})}}});if(l.axisCharts)if(g.push([c.headerCategory,...j.flatMap(e=>e.head)].join(n)),l.allSeriesHasEqualX||o.config.xaxis.categories.length||o.config.labels.length){const t=Math.max(0,...e.map(e=>{var t;return(null==(t=e.data)?void 0:t.length)||0}));for(let s=0;s<t;s++){let t=v(s);if(null!==t){if(!t){const r=e.map(e=>{var t;return null==(t=e.data)?void 0:t[s]}).find(e=>null!=e);t=null==r?"":Array.isArray(r)?r[0]:r.x}d.push([t,...j.flatMap(e=>e.cells(s))])}}}else{const t=new Map;e.forEach((e,s)=>{var r;const a=new Map;null==(r=null==e?void 0:e.data)||r.forEach((e,r)=>{if(!e||"object"!=typeof e)return;const n=Array.isArray(e)?e[0]:e.x,i=String(n),o=a.get(i)||0;a.set(i,o+1);const l=`${o}:${i}`;let c=t.get(l);c||(c={cat:n,values:j.map(e=>e.head.map(()=>""))},t.set(l,c)),c.values[s]=j[s].cells(r)})}),Array.from(t.values()).sort((e,t)=>{const s="string"==typeof e.cat;return s!==("string"==typeof t.cat)?s?1:-1:s?o.axisFlags.isXNumeric?e.cat<t.cat?-1:e.cat>t.cat?1:0:0:e.cat-t.cat}).forEach(({cat:e,values:t})=>d.push([e,...t.flat()]))}else g.push([c.headerCategory,c.headerValue].join(n)),e.forEach((e,t)=>{g.push([b(o.labelData.labels[t]),w(p.has(t)?"":o.seriesData.series[t])].join(n))});const D=d.map(e=>e[0]).filter(x),T=new Set(D.map(e=>+new Date(e))),P=new Set([...T].map(e=>y(e))).size<T.size;d.forEach(e=>g.push([b(e[0],P),...e.slice(1)].join(n))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+g.join(i)),t||c.filename,".csv")}triggerDownload(e,t,s){if(n.isSSR())return;const r=document.createElement("a");r.href=e,r.download=(t||this.w.globals.chartID)+s,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexExports={})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),r=t.__apex_Environment_Environment,s=t.__apex_BrowserAPIs_BrowserAPIs;class n{constructor(e,t){if(this.w=e,this.ctx=t,"os"!==e.config.theme.follow||!r.isBrowser())return;const s=this._ensureMedia();s&&(this._applyToConfig(s),this._ensureListeners(s))}_ensureMedia(){if(!this.ctx._osThemeMedia){const e=s.matchMedia("(prefers-color-scheme: dark)"),t=s.matchMedia("(prefers-contrast: more)");if(!e&&!t)return null;this.ctx._osThemeMedia={dark:e,contrast:t,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(e){const t=this.w.config.theme;e.dark&&(t.mode=e.dark.matches?"dark":"light"),e.contrast&&e.contrast.matches&&(t.accessibility=t.accessibility||{},t.accessibility.colorBlindMode="highContrast")}_ensureListeners(e){if(e.handler)return;const t=this.ctx,r=()=>{const e=t._osThemeMedia;if(!e)return;const r={mode:e.dark&&e.dark.matches?"dark":"light"};e.contrast&&e.contrast.matches?r.accessibility={colorBlindMode:"highContrast"}:r.accessibility={colorBlindMode:""},t.updateOptions({theme:r},!1,!0,!1)};n._add(e.dark,r),n._add(e.contrast,r),e.handler=r}teardown(){const e=this.ctx._osThemeMedia;e&&(e.handler&&(n._remove(e.dark,e.handler),n._remove(e.contrast,e.handler)),this.ctx._osThemeMedia=null)}static _add(e,t){e&&("function"==typeof e.addEventListener?e.addEventListener("change",t):"function"==typeof e.addListener&&e.addListener(t))}static _remove(e,t){e&&("function"==typeof e.removeEventListener?e.removeEventListener("change",t):"function"==typeof e.removeListener&&e.removeListener(t))}}t.default.registerFeatures({osThemeWatcher:n}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
|
package/dist/features/facet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e){var t="undefined"!=typeof globalThis?globalThis:self,s=t.ApexCharts;if(s&&s.__internals)return e.call(t);if(s)throw new Error("ApexCharts: dist/features/facet.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return e.call(t);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/facet.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var a={file:"dist/features/facet.js",run:e,done:!1},r=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);r.push(a),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!a.done){var s=t.ApexCharts;if(s)if(s.__internals){a.done=!0;var n=r.indexOf(a);-1!==n&&r.splice(n,1);try{e.call(t),s.__drainsAddons||t.console.warn("ApexCharts: dist/features/facet.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(e){t.console.error("ApexCharts: dist/features/facet.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/facet.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else t.console.warn("ApexCharts: dist/features/facet.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var e,t;e=this,t=function(e){"use strict";const t=globalThis.ApexCharts,s=globalThis.ApexCharts.__internals.__apex_Environment_Environment,a=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs;class r{constructor(e,t){if(this.w=e,this.ctx=t,"os"!==e.config.theme.follow||!s.isBrowser())return;const a=this._ensureMedia();a&&(this._applyToConfig(a),this._ensureListeners(a))}_ensureMedia(){if(!this.ctx._osThemeMedia){const e=a.matchMedia("(prefers-color-scheme: dark)"),t=a.matchMedia("(prefers-contrast: more)");if(!e&&!t)return null;this.ctx._osThemeMedia={dark:e,contrast:t,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(e){const t=this.w.config.theme;e.dark&&(t.mode=e.dark.matches?"dark":"light"),e.contrast&&e.contrast.matches&&(t.accessibility=t.accessibility||{},t.accessibility.colorBlindMode="highContrast")}_ensureListeners(e){if(e.handler)return;const t=this.ctx,s=()=>{const e=t._osThemeMedia;if(!e)return;const s={mode:e.dark&&e.dark.matches?"dark":"light"};e.contrast&&e.contrast.matches?s.accessibility={colorBlindMode:"highContrast"}:s.accessibility={colorBlindMode:""},t.updateOptions({theme:s},!1,!0,!1)};r._add(e.dark,s),r._add(e.contrast,s),e.handler=s}teardown(){const e=this.ctx._osThemeMedia;e&&(e.handler&&(r._remove(e.dark,e.handler),r._remove(e.contrast,e.handler)),this.ctx._osThemeMedia=null)}static _add(e,t){e&&("function"==typeof e.addEventListener?e.addEventListener("change",t):"function"==typeof e.addListener&&e.addListener(t))}static _remove(e,t){e&&("function"==typeof e.removeEventListener?e.removeEventListener("change",t):"function"==typeof e.removeListener&&e.removeListener(t))}}t.registerFeatures({osThemeWatcher:r}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexFacet={})});
|