apexcharts 7.2.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +1 -1
- package/dist/apexcharts.core.min.js +1 -1
- package/dist/apexcharts.esm.js +167 -2
- package/dist/apexcharts.js +167 -2
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +167 -2
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +1 -1
- package/dist/bar.esm.js +1 -1
- package/dist/bar.js +1 -1
- package/dist/boxPlot.common.js +1 -1
- package/dist/boxPlot.esm.js +1 -1
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +1 -1
- package/dist/candlestick.esm.js +1 -1
- package/dist/candlestick.js +1 -1
- package/dist/column.common.js +1 -1
- package/dist/column.esm.js +1 -1
- package/dist/core.common.js +1 -1
- package/dist/core.esm.js +1 -1
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +1 -1
- package/dist/dumbbell.esm.js +1 -1
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +167 -2
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/exports.js +1 -1
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/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 +1 -1
- package/dist/features/keyboard.esm.js +1 -1
- package/dist/features/keyboard.js +1 -1
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +1 -1
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +1 -1
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +1 -1
- package/dist/features/toolbar.esm.js +1 -1
- package/dist/features/toolbar.js +1 -1
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +167 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +1 -1
- package/dist/histogram.esm.js +1 -1
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radar.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +1 -1
- package/dist/raincloud.esm.js +1 -1
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +1 -1
- package/dist/rangeBar.esm.js +1 -1
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +1 -1
- package/dist/unit.esm.js +1 -1
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +1 -1
- package/dist/violin.esm.js +1 -1
- package/dist/violin.js +1 -1
- package/dist/waterfall.common.js +1 -1
- package/dist/waterfall.esm.js +1 -1
- package/package.json +1 -1
- package/src/modules/weave/PluginAPI.js +37 -1
- package/src/modules/weave/WeaveHost.js +148 -0
package/dist/features/all.esm.js
CHANGED
|
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
/*!
|
|
42
|
-
* ApexCharts v7.
|
|
42
|
+
* ApexCharts v7.3.0
|
|
43
43
|
* (c) 2018-2026 ApexCharts
|
|
44
44
|
*/
|
|
45
45
|
import * as _core from "apexcharts/core";
|
|
@@ -9318,7 +9318,7 @@ function getRegistry() {
|
|
|
9318
9318
|
function getPlugin(name) {
|
|
9319
9319
|
return getRegistry()[name] || null;
|
|
9320
9320
|
}
|
|
9321
|
-
const WEAVE_API_VERSION =
|
|
9321
|
+
const WEAVE_API_VERSION = 4;
|
|
9322
9322
|
const PLUGIN_CHART_METHODS = [
|
|
9323
9323
|
"updateOptions",
|
|
9324
9324
|
"updateSeries",
|
|
@@ -9616,6 +9616,36 @@ function buildPluginAPI(host, record) {
|
|
|
9616
9616
|
host._reserve(record.def.name, box);
|
|
9617
9617
|
return api;
|
|
9618
9618
|
},
|
|
9619
|
+
/**
|
|
9620
|
+
* Subscribe to the data point a viewer is pointing at.
|
|
9621
|
+
*
|
|
9622
|
+
* The chart already knows this: it resolves the series and point under the
|
|
9623
|
+
* pointer for its own tooltip and fires `dataPointMouseEnter`,
|
|
9624
|
+
* `dataPointMouseLeave` and `dataPointSelection` for the caller. This
|
|
9625
|
+
* forwards the same three, so a plugin gets the host's answer rather than
|
|
9626
|
+
* hit-testing the SVG itself and disagreeing with the tooltip.
|
|
9627
|
+
*
|
|
9628
|
+
* The payload is normalised rather than the chart's own argument list,
|
|
9629
|
+
* which passes `w`. A plugin must not receive `w`, and the three things a
|
|
9630
|
+
* plugin actually wants (which series, which point, what the point is
|
|
9631
|
+
* called) are exactly what the chart has already resolved.
|
|
9632
|
+
*
|
|
9633
|
+
* `category` is the resolved display label, the same string `api.categories`
|
|
9634
|
+
* carries, because a plugin coordinating two charts keys on the label
|
|
9635
|
+
* rather than on an index that means something different on each chart.
|
|
9636
|
+
*
|
|
9637
|
+
* Nothing here gives a plugin the ability to intercept or cancel: the
|
|
9638
|
+
* chart's own tooltip, selection state and caller events are unaffected,
|
|
9639
|
+
* and a handler that throws is contained rather than allowed to break the
|
|
9640
|
+
* interaction it was watching.
|
|
9641
|
+
*
|
|
9642
|
+
* @param {(e: {type: 'enter'|'leave'|'select', seriesIndex: number, dataPointIndex: number, category: string|undefined, seriesName: string|undefined, selected: boolean|undefined}) => void} fn
|
|
9643
|
+
* @returns {() => void} unsubscribe
|
|
9644
|
+
* @since Weave v4
|
|
9645
|
+
*/
|
|
9646
|
+
pointer(fn) {
|
|
9647
|
+
return host._onPointer(record.def.name, fn);
|
|
9648
|
+
},
|
|
9619
9649
|
// ── custom events out to the host app ──
|
|
9620
9650
|
/**
|
|
9621
9651
|
* Fires as `plugin:<pluginName>:<name>` on the chart's event bus. The
|
|
@@ -9653,6 +9683,8 @@ const _WeaveHost = class _WeaveHost {
|
|
|
9653
9683
|
this._derived = null;
|
|
9654
9684
|
this._reserved = null;
|
|
9655
9685
|
this._reserveTimer = null;
|
|
9686
|
+
this._pointerSubs = null;
|
|
9687
|
+
this._pointerWired = null;
|
|
9656
9688
|
this._onUpdated = this._onUpdated.bind(this);
|
|
9657
9689
|
this._init();
|
|
9658
9690
|
}
|
|
@@ -9895,6 +9927,132 @@ const _WeaveHost = class _WeaveHost {
|
|
|
9895
9927
|
}
|
|
9896
9928
|
this._repairInitialSeries();
|
|
9897
9929
|
}
|
|
9930
|
+
/**
|
|
9931
|
+
* Subscribe a plugin to the data point the viewer is pointing at.
|
|
9932
|
+
*
|
|
9933
|
+
* Wired lazily: a chart whose plugins never ask pays nothing, and the chart
|
|
9934
|
+
* fires these three events whether or not anyone is listening, so there is no
|
|
9935
|
+
* cost to the chart either way.
|
|
9936
|
+
*
|
|
9937
|
+
* The chart's own handler signature is `(e, ctx, {seriesIndex,
|
|
9938
|
+
* dataPointIndex, w})`. `w` stops here: what reaches a plugin is the
|
|
9939
|
+
* normalised payload documented on `api.pointer`.
|
|
9940
|
+
*
|
|
9941
|
+
* @param {string} pluginName
|
|
9942
|
+
* @param {Function} fn
|
|
9943
|
+
* @returns {() => void} unsubscribe
|
|
9944
|
+
*/
|
|
9945
|
+
_onPointer(pluginName, fn) {
|
|
9946
|
+
if (typeof fn !== "function") return () => {
|
|
9947
|
+
};
|
|
9948
|
+
if (!this._pointerSubs) this._pointerSubs = /* @__PURE__ */ new Map();
|
|
9949
|
+
const list = this._pointerSubs.get(pluginName) || [];
|
|
9950
|
+
list.push(fn);
|
|
9951
|
+
this._pointerSubs.set(pluginName, list);
|
|
9952
|
+
this._wirePointer();
|
|
9953
|
+
return () => {
|
|
9954
|
+
const current = this._pointerSubs && this._pointerSubs.get(pluginName);
|
|
9955
|
+
if (!current) return;
|
|
9956
|
+
const i = current.indexOf(fn);
|
|
9957
|
+
if (i > -1) current.splice(i, 1);
|
|
9958
|
+
};
|
|
9959
|
+
}
|
|
9960
|
+
/** Attach to the chart's own data point events, once. */
|
|
9961
|
+
_wirePointer() {
|
|
9962
|
+
if (this._pointerWired) return;
|
|
9963
|
+
if (!this.ctx || typeof this.ctx.addEventListener !== "function") return;
|
|
9964
|
+
const map = [
|
|
9965
|
+
["enter", "dataPointMouseEnter"],
|
|
9966
|
+
["leave", "dataPointMouseLeave"],
|
|
9967
|
+
["select", "dataPointSelection"]
|
|
9968
|
+
];
|
|
9969
|
+
this._pointerWired = [];
|
|
9970
|
+
for (const [type, name] of map) {
|
|
9971
|
+
const handler = (_e, _ctx, opts) => {
|
|
9972
|
+
this._emitPointer(type, opts);
|
|
9973
|
+
};
|
|
9974
|
+
this.ctx.addEventListener(name, handler);
|
|
9975
|
+
this._pointerWired.push([name, handler]);
|
|
9976
|
+
}
|
|
9977
|
+
}
|
|
9978
|
+
/**
|
|
9979
|
+
* Hand one pointer event to every subscribed plugin.
|
|
9980
|
+
*
|
|
9981
|
+
* A handler that throws is contained per plugin, on the same terms as every
|
|
9982
|
+
* other plugin callback here: this runs inside the viewer's own hover, and a
|
|
9983
|
+
* plugin breaking the chart's interaction would be the worst failure mode
|
|
9984
|
+
* this facade has.
|
|
9985
|
+
*
|
|
9986
|
+
* @param {'enter'|'leave'|'select'} type
|
|
9987
|
+
* @param {any} opts
|
|
9988
|
+
*/
|
|
9989
|
+
_emitPointer(type, opts) {
|
|
9990
|
+
if (!this._pointerSubs || !this._pointerSubs.size) return;
|
|
9991
|
+
const seriesIndex = opts && typeof opts.seriesIndex === "number" ? opts.seriesIndex : -1;
|
|
9992
|
+
const dataPointIndex = opts && typeof opts.dataPointIndex === "number" ? opts.dataPointIndex : -1;
|
|
9993
|
+
const labels = this._categories() || [];
|
|
9994
|
+
const w = this.w;
|
|
9995
|
+
const config = w && w.config && w.config.series || [];
|
|
9996
|
+
const payload = {
|
|
9997
|
+
type,
|
|
9998
|
+
seriesIndex,
|
|
9999
|
+
dataPointIndex,
|
|
10000
|
+
category: dataPointIndex > -1 ? labels[dataPointIndex] : void 0,
|
|
10001
|
+
// A pie/donut carries bare numbers in `series`, so there is no name to
|
|
10002
|
+
// read: undefined rather than a guess, on the same terms as `category`.
|
|
10003
|
+
seriesName: _WeaveHost._seriesName(config, seriesIndex),
|
|
10004
|
+
// Only meaningful on a select: the chart hands back its whole selection
|
|
10005
|
+
// set, and what a plugin wants to know is whether THIS point is now in
|
|
10006
|
+
// it, so a second click reads as a deselect rather than another select.
|
|
10007
|
+
selected: type === "select" ? _WeaveHost._isSelected(opts, seriesIndex, dataPointIndex) : void 0
|
|
10008
|
+
};
|
|
10009
|
+
for (const [name, handlers] of this._pointerSubs) {
|
|
10010
|
+
for (const fn of handlers.slice()) {
|
|
10011
|
+
try {
|
|
10012
|
+
fn(payload);
|
|
10013
|
+
} catch (e) {
|
|
10014
|
+
console.warn(
|
|
10015
|
+
'[apexcharts] plugin "' + name + '" threw in a pointer handler',
|
|
10016
|
+
e
|
|
10017
|
+
);
|
|
10018
|
+
}
|
|
10019
|
+
}
|
|
10020
|
+
}
|
|
10021
|
+
}
|
|
10022
|
+
/**
|
|
10023
|
+
* The configured name of series `i`, where there is one.
|
|
10024
|
+
*
|
|
10025
|
+
* @param {any[]} config
|
|
10026
|
+
* @param {number} i
|
|
10027
|
+
* @returns {string|undefined}
|
|
10028
|
+
*/
|
|
10029
|
+
static _seriesName(config, i) {
|
|
10030
|
+
if (i < 0) return void 0;
|
|
10031
|
+
const entry = config[i];
|
|
10032
|
+
if (!entry || typeof entry !== "object") return void 0;
|
|
10033
|
+
return typeof entry.name === "string" ? entry.name : void 0;
|
|
10034
|
+
}
|
|
10035
|
+
/**
|
|
10036
|
+
* Whether the chart now counts this point as selected.
|
|
10037
|
+
*
|
|
10038
|
+
* `selectedDataPoints` is an array per series of the indexes selected in it.
|
|
10039
|
+
* Absent on a chart type that does not carry point selection, in which case
|
|
10040
|
+
* the answer is undefined rather than false: "not selected" and "selection
|
|
10041
|
+
* does not apply here" are different, and a plugin keying on it should be
|
|
10042
|
+
* able to tell.
|
|
10043
|
+
*
|
|
10044
|
+
* @param {any} opts
|
|
10045
|
+
* @param {number} seriesIndex
|
|
10046
|
+
* @param {number} dataPointIndex
|
|
10047
|
+
* @returns {boolean|undefined}
|
|
10048
|
+
*/
|
|
10049
|
+
static _isSelected(opts, seriesIndex, dataPointIndex) {
|
|
10050
|
+
const all = opts && opts.selectedDataPoints;
|
|
10051
|
+
if (!Array.isArray(all) || seriesIndex < 0) return void 0;
|
|
10052
|
+
const mine = all[seriesIndex];
|
|
10053
|
+
if (!Array.isArray(mine)) return false;
|
|
10054
|
+
return mine.indexOf(dataPointIndex) > -1;
|
|
10055
|
+
}
|
|
9898
10056
|
/**
|
|
9899
10057
|
* Record a plugin's container reservation and re-render if it changed.
|
|
9900
10058
|
*
|
|
@@ -10119,6 +10277,13 @@ const _WeaveHost = class _WeaveHost {
|
|
|
10119
10277
|
this.active = [];
|
|
10120
10278
|
this._derived = null;
|
|
10121
10279
|
this._reserved = null;
|
|
10280
|
+
this._pointerSubs = null;
|
|
10281
|
+
if (this._pointerWired) {
|
|
10282
|
+
for (const [name, handler] of this._pointerWired) {
|
|
10283
|
+
this.ctx.removeEventListener && this.ctx.removeEventListener(name, handler);
|
|
10284
|
+
}
|
|
10285
|
+
this._pointerWired = null;
|
|
10286
|
+
}
|
|
10122
10287
|
if (this._reserveTimer != null) {
|
|
10123
10288
|
clearTimeout(this._reserveTimer);
|
|
10124
10289
|
this._reserveTimer = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const o in t)if("default"!==o){const a=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>t[o]})}return e.default=t,Object.freeze(e)}const e=t(require("apexcharts/core")),o=e.__apex_Graphics,a=e.__apex_Utils,i=e.__apex_CoreUtils,n=e.__apex_Animations_applyProgressiveReveal;class s{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var o,a;const i=this.w;if("vertical"===t.label.orientation){const n=null!==e?e:0,s=i.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${n}']`);if(null!==s){const e=s.getBBox();s.setAttribute("x",String(parseFloat(null!=(o=s.getAttribute("x"))?o:"0")-e.height+4));const i="top"===t.label.position?e.width:-e.width;s.setAttribute("y",String(parseFloat(null!=(a=s.getAttribute("y"))?a:"0")+i));const{x:n,y:l}=this.annoCtx.graphics.rotateAroundCenter(s);s.setAttribute("transform",`rotate(-90 ${n} ${l})`)}}}addBackgroundToAnno(t,e){const o=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const a=o.dom.baseEl.querySelector(".apexcharts-grid");if(!a)return null;const i=a.getBoundingClientRect(),n=a.getBBox(),s=i.width/n.width||1,l=t.getBoundingClientRect();let{left:r,right:d,top:h,bottom:c}=e.label.style.padding;"vertical"===e.label.orientation&&([h,c,r,d]=[r,d,h,c]);const x=i.left-n.x*s,p=i.top-n.y*s,g=(l.left-x)/s-r,f=(l.top-p)/s-h,b=this.annoCtx.graphics.drawRect(g,f,l.width/s+r+d,l.height/s+h+c,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&b.node.classList.add(e.id),b}annotationsBackground(){const t=this.w,e=(e,o,a)=>{const i=t.dom.baseEl.querySelector(`.apexcharts-${a}-annotations .apexcharts-${a}-annotation-label[rel='${o}']`);if(i){const o=i.parentNode,a=this.addBackgroundToAnno(i,e);if(a){null==o||o.insertBefore(a.node,i);const s=i.getAttribute("x");null!==s&&n(a,parseFloat(s),t),e.label.mouseEnter&&a.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&a.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&a.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,o)=>e(t,o,"xaxis")),t.config.annotations.yaxis.forEach((t,o)=>e(t,o,"yaxis")),t.config.annotations.points.forEach((t,o)=>e(t,o,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?a.isNumber(t.globals.minY)&&a.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:a.isNumber(t.globals.minX)&&a.isNumber(t.globals.xRange)}getY1Y2(t,e){var o,a,n;const s=this.w,l="y1"===t?e.y:e.y2,r="string"==typeof l&&l.includes("px");let d,h=!1;if(this.annoCtx.invertAxis){const t=s.config.xaxis.convertedCatToNumeric?s.labelData.categoryLabels:s.labelData.labels,a=t.indexOf(l);if(!r&&-1===a)return{yP:0,clipped:!0};const i=s.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${a+1})`);d=i?parseFloat(null!=(o=i.getAttribute("y"))?o:"0"):(s.layout.gridHeight/t.length-1)*(a+1)-s.globals.barHeight,void 0!==e.seriesIndex&&s.globals.barHeight&&(d-=s.globals.barHeight/2*(s.seriesData.series.length-1)-s.globals.barHeight*e.seriesIndex)}else{if(!s.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=s.globals.seriesYAxisMap[e.yAxisIndex],o=null!=(a=null==t?void 0:t[0])?a:null;if(null===o&&s.seriesData.series.length)return{yP:0,clipped:!0};const r=null===o?s.globals.minY:s.globals.minYArr[o],c=null===o?s.globals.maxY-s.globals.minY:s.globals.yRange[o],x=s.config.yaxis[e.yAxisIndex].logarithmic&&null!==o?new i(this.w).getLogVal(s.config.yaxis[e.yAxisIndex].logBase,l,o)/s.globals.yLogRatio[o]:(l-r)/(c/s.layout.gridHeight);d=s.layout.gridHeight-Math.min(Math.max(x,0),s.layout.gridHeight),h=x>s.layout.gridHeight||x<0,!e.marker||void 0!==e.y&&null!==e.y||(d=0),(null==(n=s.config.yaxis[e.yAxisIndex])?void 0:n.reversed)&&(d=x)}return r&&(d=parseFloat(l)),{yP:d,clipped:h}}getX1X2(t,e){const o=this.w,a="x1"===t?e.x:e.x2,i=this.annoCtx.invertAxis?o.globals.minY:o.globals.minX,n=this.annoCtx.invertAxis?o.globals.maxY:o.globals.maxX,s=this.annoCtx.invertAxis?o.globals.yRange[0]:o.globals.xRange;let l=!1;const r="string"==typeof a&&a.includes("px"),d=null==a&&e.marker;if(!r&&!d&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(n-a)/(s/o.layout.gridWidth):(a-i)/(s/o.layout.gridWidth);return"category"!==o.config.xaxis.type&&!o.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||o.axisFlags.dataFormatXNumeric||o.config.chart.sparkline.enabled||(h=this.getStringX(a)),"string"==typeof a&&a.includes("px")&&(h=parseFloat(a)),null==a&&e.marker&&(h=o.layout.gridWidth),void 0!==e.seriesIndex&&o.globals.barWidth&&!this.annoCtx.invertAxis&&(h-=o.globals.barWidth/2*(o.seriesData.series.length-1)-o.globals.barWidth*e.seriesIndex),"number"!=typeof h&&(h=0,l=!0),parseFloat(h.toFixed(10))>parseFloat(o.layout.gridWidth.toFixed(10))?(h=o.layout.gridWidth,l=!0):h<0&&(h=0,l=!0),{x:h,clipped:l}}getStringX(t){var e;const o=this.w;let a=t;if(o.config.xaxis.convertedCatToNumeric&&o.labelData.categoryLabels.length){const e=String(t);t=o.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const i=o.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),n=o.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${i+1})`);return n&&(a=parseFloat(null!=(e=n.getAttribute("x"))?e:"0")),a}}class l{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new s(this.annoCtx)}addXaxisAnnotation(t,e,o){const i=this.w,s=this.helpers.getX1X2("x1",t);let l=s.x;const r=s.clipped;let d,h=!0;const c=t.label.text,x=t.strokeDashArray;if(a.isNumber(l)){if(null===t.x2||void 0===t.x2){if(!r){const o=this.annoCtx.graphics.drawLine(l+t.offsetX,0+t.offsetY,l+t.offsetX,i.layout.gridHeight+t.offsetY,t.borderColor,x,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id),n(o,l+t.offsetX,i)}}else{const o=this.helpers.getX1X2("x2",t);if(d=o.x,h=o.clipped,d<l){const t=l;l=d,d=t}const a=this.annoCtx.graphics.drawRect(l+t.offsetX,0+t.offsetY,d-l,i.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,x);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),n(a,l+t.offsetX,i)}if(!r||!h){const a=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),s="top"===t.label.position?4:"center"===t.label.position?i.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):i.layout.gridHeight,r=this.annoCtx.graphics.drawText({x:l+t.label.offsetX,y:s+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:o}),e.appendChild(r.node),n(r,l+t.label.offsetX,i),this.annoCtx.helpers.setOrientations(t,o)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,o)=>{this.addXaxisAnnotation(t,e.node,o)}),e}}const r=e.__apex_axes_AxesUtils;class d{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new s(this.annoCtx),this.axesUtils=new r(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,o){const a=this.w,i=t.strokeDashArray;let n=this.helpers.getY1Y2("y1",t),s=n.yP;const l=n.clipped;let r,d=!0,h=!1;const c=t.label.text;if(null===t.y2||void 0===t.y2){if(!l){h=!0;const o=this.annoCtx.graphics.drawLine(0+t.offsetX,s+t.offsetY,this._getYAxisAnnotationWidth(t),s+t.offsetY,t.borderColor,i,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}else{if(n=this.helpers.getY1Y2("y2",t),r=n.yP,d=n.clipped,r>s){const t=s;s=r,r=t}if(!l||!d){h=!0;const o=this.annoCtx.graphics.drawRect(0+t.offsetX,r+t.offsetY,this._getYAxisAnnotationWidth(t),s-r,0,t.fillColor,t.opacity,1,t.borderColor,i);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}if(h){const i="right"===t.label.position?a.layout.gridWidth:"center"===t.label.position?a.layout.gridWidth/2:0,n=this.annoCtx.graphics.drawText({x:i+t.label.offsetX,y:(null!=r?r:s)+t.label.offsetY-3,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});n.attr({rel:o}),e.appendChild(n.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let o=e.layout.gridWidth;return o=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),o+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,o)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,o)}),e}}const h=e.__apex_BrowserAPIs_BrowserAPIs;class c{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new s(this.annoCtx)}addPointAnnotation(t,e,o){const i=this.w;if(i.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const s=this.helpers.getX1X2("x1",t),l=s.x,r=s.clipped,d=this.helpers.getY1Y2("y1",t),h=d.yP,c=d.clipped;if(a.isNumber(l)&&!c&&!r){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let s=this.annoCtx.graphics.drawMarker(l+t.marker.offsetX,h+t.marker.offsetY,a);e.appendChild(s.node);const r=[s.node];n(s,l,i);const d=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(d,l+t.label.offsetX,t.label),x=this.annoCtx.graphics.drawText({x:c,y:h+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(x.attr({rel:o}),e.appendChild(x.node),n(x,l,i),t.customSVG.SVG){const o=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});o.attr({transform:`translate(${l+t.customSVG.offsetX}, ${h+t.customSVG.offsetY})`}),o.node.innerHTML=t.customSVG.SVG,e.appendChild(o.node),r.push(o.node)}if(t.image.path){const e=t.image.width?t.image.width:20,o=t.image.height?t.image.height:20;s=this.annoCtx.addImage({x:l+t.image.offsetX-e/2,y:h+t.image.offsetY-o/2,width:e,height:o,path:t.image.path,appendTo:".apexcharts-point-annotations"}),r.push(s.node)}t.tooltip&&t.tooltip.enabled&&r.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&s.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&s.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&s.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,o){const a=this.w;if(!t)return e;const{width:i}=this.annoCtx.graphics.getTextRects(t,o.style.fontSize,o.style.fontFamily,void 0,!0,o.style.fontWeight);let n,s;switch(o.textAnchor){case"start":n=e,s=e+i;break;case"end":n=e-i,s=e;break;default:n=e-i/2,s=e+i/2}const l=o.style.padding||{};return n-=l.left||0,s+=l.right||0,n<0?e-n:s>a.layout.gridWidth?e-(s-a.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=h.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,o=t.tooltip||{};if("function"==typeof o.formatter)return o.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let a=null!=o.text?o.text:t.label&&t.label.text;return Array.isArray(a)&&(a=a.join("<br/>")),null==a?"":String(a)}showPointTooltip(t,e){const o=this.w,a=this.getPointTooltipContent(t);if(!a)return;const i=this.getPointTooltipEl();i.innerHTML=a;const n=t.tooltip.theme||o.config.tooltip.theme||"light";i.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),i.classList.add(`apexcharts-theme-${n}`),i.classList.add("apexcharts-active");const s=o.dom.elWrap.getBoundingClientRect(),l=e.getBoundingClientRect(),r=i.getBoundingClientRect(),d=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let c=l.left-s.left+l.width/2-r.width/2,x=l.top-s.top-r.height-10;c=Math.max(0,Math.min(c,s.width-r.width)),x<0&&(x=l.top-s.top+l.height+10),i.style.left=c+d+"px",i.style.top=x+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,o)=>{this.addPointAnnotation(t,e.node,o)}),e}}const x=e.__apex_Options;e.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:a=null}={}){this.w=t,this.theme=e,this.timeScale=a,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new o(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new s(this),this.xAxisAnnotations=new l(this),this.yAxisAnnotations=new d(this),this.pointsAnnotations=new c(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),o=this.xAxisAnnotations.drawXAxisAnnotations(),a=this.pointsAnnotations.drawPointAnnotations(),i=t.config.chart.animations.enabled,n=[e,o,a],s=[o.node,e.node,a.node],l="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,r=[l,!1,l];for(let e=0;e<3;e++)t.dom.elGraphical.add(n[e]),!i||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!r[e]&&s[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:s[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,o){this.xAxisAnnotations.addXaxisAnnotation(t,e,o)}addYaxisAnnotation(t,e,o){this.yAxisAnnotations.addYaxisAnnotation(t,e,o)}addPointAnnotation(t,e,o){this.pointsAnnotations.addPointAnnotation(t,e,o)}addText(t){const{x:e,y:o,text:a,textAnchor:i,foreColor:n,fontSize:s,fontFamily:l,fontWeight:r,cssClass:d,backgroundColor:h,borderWidth:c,strokeDashArray:x,borderRadius:p,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:b=4,paddingRight:u=4,paddingBottom:y=2,paddingTop:m=2}=t,A=this.w,w=this.graphics.drawText({x:e,y:o,text:a,textAnchor:i||"start",fontSize:s||"12px",fontWeight:r||"regular",fontFamily:l||A.config.chart.fontFamily,foreColor:n||A.config.chart.foreColor,cssClass:d}),C=A.dom.baseEl.querySelector(f);C&&C.appendChild(w.node);const v=w.bbox();if(a){const t=this.graphics.drawRect(v.x-b,v.y-m,v.width+b+u,v.height+y+m,p,h||"transparent",1,c,g,x);C.insertBefore(t.node,w.node)}}addImage(t){const e=this.w,{path:o,x:a=0,y:i=0,width:n=20,height:s=20,appendTo:l=".apexcharts-svg"}=t,r=e.dom.Paper.image(o);r.size(n,s).move(a,i);const d=e.dom.baseEl.querySelector(l);return d&&d.appendChild(r.node),r}addXaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"xaxis",contextMethod:o.addXaxisAnnotation}),o}addYaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"yaxis",contextMethod:o.addYaxisAnnotation}),o}addPointAnnotationExternal(t,e,o){return void 0===this.invertAxis&&(this.invertAxis=o.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"point",contextMethod:o.addPointAnnotation}),o}addAnnotationExternal({params:t,pushToMemory:e,context:o,type:i,contextMethod:n}){const s=o,l=s.w,r=l.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),d=r.childNodes.length+1,h=new x,c=Object.assign({},"xaxis"===i?h.xAxisAnnotation:"yaxis"===i?h.yAxisAnnotation:h.pointAnnotation),p=a.extend(c,t);switch(i){case"xaxis":this.addXaxisAnnotation(p,r,d);break;case"yaxis":this.addYaxisAnnotation(p,r,d);break;case"point":this.addPointAnnotation(p,r,d)}const g=l.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${d}']`),f=this.helpers.addBackgroundToAnno(g,p);return f&&r.insertBefore(f.node,g),e&&l.globals.memory.methodsToExec.push({context:s,id:p.id?p.id:a.randomId(),method:n,label:"addAnnotation",params:t}),o}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const o=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(o,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const o=t.w;this._removeAnnotationTooltip(o);const a=o.dom.baseEl.querySelectorAll(`.${e}`);a&&(o.globals.memory.methodsToExec.map((t,a)=>{t.id===e&&o.globals.memory.methodsToExec.splice(a,1)}),Object.keys(o.config.annotations).forEach(t=>{const a=o.config.annotations[t];Array.isArray(a)&&(o.config.annotations[t]=a.filter(t=>t.id!==e))}),Array.prototype.forEach.call(a,t=>{t.parentElement.removeChild(t)}))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>e.default});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexAnnotations={})}(this,function(t){"use strict";const e=globalThis.ApexCharts,o=globalThis.ApexCharts.__internals.__apex_Graphics,a=globalThis.ApexCharts.__internals.__apex_Utils,i=globalThis.ApexCharts.__internals.__apex_CoreUtils,n=globalThis.ApexCharts.__internals;n.__apex_Animations,n.__apex_Animations_computeStagger,n.__apex_Animations_applyAnimationPolicy,n.__apex_Animations_prefersReducedMotion;const s=n.__apex_Animations_applyProgressiveReveal;class l{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var o,a;const i=this.w;if("vertical"===t.label.orientation){const n=null!==e?e:0,s=i.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${n}']`);if(null!==s){const e=s.getBBox();s.setAttribute("x",String(parseFloat(null!=(o=s.getAttribute("x"))?o:"0")-e.height+4));const i="top"===t.label.position?e.width:-e.width;s.setAttribute("y",String(parseFloat(null!=(a=s.getAttribute("y"))?a:"0")+i));const{x:n,y:l}=this.annoCtx.graphics.rotateAroundCenter(s);s.setAttribute("transform",`rotate(-90 ${n} ${l})`)}}}addBackgroundToAnno(t,e){const o=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const a=o.dom.baseEl.querySelector(".apexcharts-grid");if(!a)return null;const i=a.getBoundingClientRect(),n=a.getBBox(),s=i.width/n.width||1,l=t.getBoundingClientRect();let{left:r,right:d,top:h,bottom:c}=e.label.style.padding;"vertical"===e.label.orientation&&([h,c,r,d]=[r,d,h,c]);const x=i.left-n.x*s,p=i.top-n.y*s,g=(l.left-x)/s-r,f=(l.top-p)/s-h,b=this.annoCtx.graphics.drawRect(g,f,l.width/s+r+d,l.height/s+h+c,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&b.node.classList.add(e.id),b}annotationsBackground(){const t=this.w,e=(e,o,a)=>{const i=t.dom.baseEl.querySelector(`.apexcharts-${a}-annotations .apexcharts-${a}-annotation-label[rel='${o}']`);if(i){const o=i.parentNode,a=this.addBackgroundToAnno(i,e);if(a){null==o||o.insertBefore(a.node,i);const n=i.getAttribute("x");null!==n&&s(a,parseFloat(n),t),e.label.mouseEnter&&a.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&a.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&a.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,o)=>e(t,o,"xaxis")),t.config.annotations.yaxis.forEach((t,o)=>e(t,o,"yaxis")),t.config.annotations.points.forEach((t,o)=>e(t,o,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?a.isNumber(t.globals.minY)&&a.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:a.isNumber(t.globals.minX)&&a.isNumber(t.globals.xRange)}getY1Y2(t,e){var o,a,n;const s=this.w,l="y1"===t?e.y:e.y2,r="string"==typeof l&&l.includes("px");let d,h=!1;if(this.annoCtx.invertAxis){const t=s.config.xaxis.convertedCatToNumeric?s.labelData.categoryLabels:s.labelData.labels,a=t.indexOf(l);if(!r&&-1===a)return{yP:0,clipped:!0};const i=s.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${a+1})`);d=i?parseFloat(null!=(o=i.getAttribute("y"))?o:"0"):(s.layout.gridHeight/t.length-1)*(a+1)-s.globals.barHeight,void 0!==e.seriesIndex&&s.globals.barHeight&&(d-=s.globals.barHeight/2*(s.seriesData.series.length-1)-s.globals.barHeight*e.seriesIndex)}else{if(!s.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=s.globals.seriesYAxisMap[e.yAxisIndex],o=null!=(a=null==t?void 0:t[0])?a:null;if(null===o&&s.seriesData.series.length)return{yP:0,clipped:!0};const r=null===o?s.globals.minY:s.globals.minYArr[o],c=null===o?s.globals.maxY-s.globals.minY:s.globals.yRange[o],x=s.config.yaxis[e.yAxisIndex].logarithmic&&null!==o?new i(this.w).getLogVal(s.config.yaxis[e.yAxisIndex].logBase,l,o)/s.globals.yLogRatio[o]:(l-r)/(c/s.layout.gridHeight);d=s.layout.gridHeight-Math.min(Math.max(x,0),s.layout.gridHeight),h=x>s.layout.gridHeight||x<0,!e.marker||void 0!==e.y&&null!==e.y||(d=0),(null==(n=s.config.yaxis[e.yAxisIndex])?void 0:n.reversed)&&(d=x)}return r&&(d=parseFloat(l)),{yP:d,clipped:h}}getX1X2(t,e){const o=this.w,a="x1"===t?e.x:e.x2,i=this.annoCtx.invertAxis?o.globals.minY:o.globals.minX,n=this.annoCtx.invertAxis?o.globals.maxY:o.globals.maxX,s=this.annoCtx.invertAxis?o.globals.yRange[0]:o.globals.xRange;let l=!1;const r="string"==typeof a&&a.includes("px"),d=null==a&&e.marker;if(!r&&!d&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(n-a)/(s/o.layout.gridWidth):(a-i)/(s/o.layout.gridWidth);return"category"!==o.config.xaxis.type&&!o.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||o.axisFlags.dataFormatXNumeric||o.config.chart.sparkline.enabled||(h=this.getStringX(a)),"string"==typeof a&&a.includes("px")&&(h=parseFloat(a)),null==a&&e.marker&&(h=o.layout.gridWidth),void 0!==e.seriesIndex&&o.globals.barWidth&&!this.annoCtx.invertAxis&&(h-=o.globals.barWidth/2*(o.seriesData.series.length-1)-o.globals.barWidth*e.seriesIndex),"number"!=typeof h&&(h=0,l=!0),parseFloat(h.toFixed(10))>parseFloat(o.layout.gridWidth.toFixed(10))?(h=o.layout.gridWidth,l=!0):h<0&&(h=0,l=!0),{x:h,clipped:l}}getStringX(t){var e;const o=this.w;let a=t;if(o.config.xaxis.convertedCatToNumeric&&o.labelData.categoryLabels.length){const e=String(t);t=o.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const i=o.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),n=o.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${i+1})`);return n&&(a=parseFloat(null!=(e=n.getAttribute("x"))?e:"0")),a}}class r{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new l(this.annoCtx)}addXaxisAnnotation(t,e,o){const i=this.w,n=this.helpers.getX1X2("x1",t);let l=n.x;const r=n.clipped;let d,h=!0;const c=t.label.text,x=t.strokeDashArray;if(a.isNumber(l)){if(null===t.x2||void 0===t.x2){if(!r){const o=this.annoCtx.graphics.drawLine(l+t.offsetX,0+t.offsetY,l+t.offsetX,i.layout.gridHeight+t.offsetY,t.borderColor,x,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id),s(o,l+t.offsetX,i)}}else{const o=this.helpers.getX1X2("x2",t);if(d=o.x,h=o.clipped,d<l){const t=l;l=d,d=t}const a=this.annoCtx.graphics.drawRect(l+t.offsetX,0+t.offsetY,d-l,i.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,x);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),s(a,l+t.offsetX,i)}if(!r||!h){const a=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),n="top"===t.label.position?4:"center"===t.label.position?i.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):i.layout.gridHeight,r=this.annoCtx.graphics.drawText({x:l+t.label.offsetX,y:n+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:o}),e.appendChild(r.node),s(r,l+t.label.offsetX,i),this.annoCtx.helpers.setOrientations(t,o)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,o)=>{this.addXaxisAnnotation(t,e.node,o)}),e}}const d=globalThis.ApexCharts.__internals.__apex_axes_AxesUtils;class h{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new l(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,o){const a=this.w,i=t.strokeDashArray;let n=this.helpers.getY1Y2("y1",t),s=n.yP;const l=n.clipped;let r,d=!0,h=!1;const c=t.label.text;if(null===t.y2||void 0===t.y2){if(!l){h=!0;const o=this.annoCtx.graphics.drawLine(0+t.offsetX,s+t.offsetY,this._getYAxisAnnotationWidth(t),s+t.offsetY,t.borderColor,i,t.borderWidth);e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}else{if(n=this.helpers.getY1Y2("y2",t),r=n.yP,d=n.clipped,r>s){const t=s;s=r,r=t}if(!l||!d){h=!0;const o=this.annoCtx.graphics.drawRect(0+t.offsetX,r+t.offsetY,this._getYAxisAnnotationWidth(t),s-r,0,t.fillColor,t.opacity,1,t.borderColor,i);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}}if(h){const i="right"===t.label.position?a.layout.gridWidth:"center"===t.label.position?a.layout.gridWidth/2:0,n=this.annoCtx.graphics.drawText({x:i+t.label.offsetX,y:(null!=r?r:s)+t.label.offsetY-3,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});n.attr({rel:o}),e.appendChild(n.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let o=e.layout.gridWidth;return o=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),o+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,o)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,o)}),e}}const c=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs;class x{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new l(this.annoCtx)}addPointAnnotation(t,e,o){const i=this.w;if(i.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const n=this.helpers.getX1X2("x1",t),l=n.x,r=n.clipped,d=this.helpers.getY1Y2("y1",t),h=d.yP,c=d.clipped;if(a.isNumber(l)&&!c&&!r){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let n=this.annoCtx.graphics.drawMarker(l+t.marker.offsetX,h+t.marker.offsetY,a);e.appendChild(n.node);const r=[n.node];s(n,l,i);const d=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(d,l+t.label.offsetX,t.label),x=this.annoCtx.graphics.drawText({x:c,y:h+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(x.attr({rel:o}),e.appendChild(x.node),s(x,l,i),t.customSVG.SVG){const o=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});o.attr({transform:`translate(${l+t.customSVG.offsetX}, ${h+t.customSVG.offsetY})`}),o.node.innerHTML=t.customSVG.SVG,e.appendChild(o.node),r.push(o.node)}if(t.image.path){const e=t.image.width?t.image.width:20,o=t.image.height?t.image.height:20;n=this.annoCtx.addImage({x:l+t.image.offsetX-e/2,y:h+t.image.offsetY-o/2,width:e,height:o,path:t.image.path,appendTo:".apexcharts-point-annotations"}),r.push(n.node)}t.tooltip&&t.tooltip.enabled&&r.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&n.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&n.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&n.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,o){const a=this.w;if(!t)return e;const{width:i}=this.annoCtx.graphics.getTextRects(t,o.style.fontSize,o.style.fontFamily,void 0,!0,o.style.fontWeight);let n,s;switch(o.textAnchor){case"start":n=e,s=e+i;break;case"end":n=e-i,s=e;break;default:n=e-i/2,s=e+i/2}const l=o.style.padding||{};return n-=l.left||0,s+=l.right||0,n<0?e-n:s>a.layout.gridWidth?e-(s-a.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=c.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,o=t.tooltip||{};if("function"==typeof o.formatter)return o.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let a=null!=o.text?o.text:t.label&&t.label.text;return Array.isArray(a)&&(a=a.join("<br/>")),null==a?"":String(a)}showPointTooltip(t,e){const o=this.w,a=this.getPointTooltipContent(t);if(!a)return;const i=this.getPointTooltipEl();i.innerHTML=a;const n=t.tooltip.theme||o.config.tooltip.theme||"light";i.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),i.classList.add(`apexcharts-theme-${n}`),i.classList.add("apexcharts-active");const s=o.dom.elWrap.getBoundingClientRect(),l=e.getBoundingClientRect(),r=i.getBoundingClientRect(),d=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let c=l.left-s.left+l.width/2-r.width/2,x=l.top-s.top-r.height-10;c=Math.max(0,Math.min(c,s.width-r.width)),x<0&&(x=l.top-s.top+l.height+10),i.style.left=c+d+"px",i.style.top=x+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,o)=>{this.addPointAnnotation(t,e.node,o)}),e}}const p=globalThis.ApexCharts.__internals.__apex_Options;e.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:a=null}={}){this.w=t,this.theme=e,this.timeScale=a,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new o(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new l(this),this.xAxisAnnotations=new r(this),this.yAxisAnnotations=new h(this),this.pointsAnnotations=new x(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),o=this.xAxisAnnotations.drawXAxisAnnotations(),a=this.pointsAnnotations.drawPointAnnotations(),i=t.config.chart.animations.enabled,n=[e,o,a],s=[o.node,e.node,a.node],l="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,r=[l,!1,l];for(let e=0;e<3;e++)t.dom.elGraphical.add(n[e]),!i||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!r[e]&&s[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:s[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,o){this.xAxisAnnotations.addXaxisAnnotation(t,e,o)}addYaxisAnnotation(t,e,o){this.yAxisAnnotations.addYaxisAnnotation(t,e,o)}addPointAnnotation(t,e,o){this.pointsAnnotations.addPointAnnotation(t,e,o)}addText(t){const{x:e,y:o,text:a,textAnchor:i,foreColor:n,fontSize:s,fontFamily:l,fontWeight:r,cssClass:d,backgroundColor:h,borderWidth:c,strokeDashArray:x,borderRadius:p,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:b=4,paddingRight:u=4,paddingBottom:m=2,paddingTop:y=2}=t,A=this.w,C=this.graphics.drawText({x:e,y:o,text:a,textAnchor:i||"start",fontSize:s||"12px",fontWeight:r||"regular",fontFamily:l||A.config.chart.fontFamily,foreColor:n||A.config.chart.foreColor,cssClass:d}),w=A.dom.baseEl.querySelector(f);w&&w.appendChild(C.node);const v=C.bbox();if(a){const t=this.graphics.drawRect(v.x-b,v.y-y,v.width+b+u,v.height+m+y,p,h||"transparent",1,c,g,x);w.insertBefore(t.node,C.node)}}addImage(t){const e=this.w,{path:o,x:a=0,y:i=0,width:n=20,height:s=20,appendTo:l=".apexcharts-svg"}=t,r=e.dom.Paper.image(o);r.size(n,s).move(a,i);const d=e.dom.baseEl.querySelector(l);return d&&d.appendChild(r.node),r}addXaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"xaxis",contextMethod:o.addXaxisAnnotation}),o}addYaxisAnnotationExternal(t,e,o){return this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"yaxis",contextMethod:o.addYaxisAnnotation}),o}addPointAnnotationExternal(t,e,o){return void 0===this.invertAxis&&(this.invertAxis=o.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:o,type:"point",contextMethod:o.addPointAnnotation}),o}addAnnotationExternal({params:t,pushToMemory:e,context:o,type:i,contextMethod:n}){const s=o,l=s.w,r=l.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),d=r.childNodes.length+1,h=new p,c=Object.assign({},"xaxis"===i?h.xAxisAnnotation:"yaxis"===i?h.yAxisAnnotation:h.pointAnnotation),x=a.extend(c,t);switch(i){case"xaxis":this.addXaxisAnnotation(x,r,d);break;case"yaxis":this.addYaxisAnnotation(x,r,d);break;case"point":this.addPointAnnotation(x,r,d)}const g=l.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${d}']`),f=this.helpers.addBackgroundToAnno(g,x);return f&&r.insertBefore(f.node,g),e&&l.globals.memory.methodsToExec.push({context:s,id:x.id?x.id:a.randomId(),method:n,label:"addAnnotation",params:t}),o}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const o=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(o,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const o=t.w;this._removeAnnotationTooltip(o);const a=o.dom.baseEl.querySelectorAll(`.${e}`);a&&(o.globals.memory.methodsToExec.map((t,a)=>{t.id===e&&o.globals.memory.methodsToExec.splice(a,1)}),Object.keys(o.config.annotations).forEach(t=>{const a=o.config.annotations[t];Array.isArray(a)&&(o.config.annotations[t]=a.filter(t=>t.id!==e))}),Array.prototype.forEach.call(a,t=>{t.parentElement.removeChild(t)}))}}}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
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 n in e)if("default"!==n){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),n=t.__apex_Environment_Environment,i=t.__apex_Utils;t.default.registerFeatures({contextMenu:class{constructor(e,t){this.w=e,this.ctx=t,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),t.addEventListener("mounted",this._afterRender),t.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!n.isBrowser())return;const e=this.w.dom.Paper&&this.w.dom.Paper.node;e&&(e.addEventListener("contextmenu",this._onContext),this._trigger=e)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(e){this._enabled()&&(e.preventDefault(),this.open(e.clientX,e.clientY))}_clientToData(e,t){const n=this.w,i=n.dom.baseEl&&n.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const s=i.getBoundingClientRect();if(!s.width||!s.height)return null;const o=e=>e<0?0:e>1?1:e,r=o((e-s.left)/s.width),a=o((t-s.top)/s.height),l=n.globals.minX+r*(n.globals.maxX-n.globals.minX),c=n.globals.yAxisScale&&n.globals.yAxisScale[0],h=c&&isFinite(c.niceMin)?c.niceMin:n.globals.minY,u=c&&isFinite(c.niceMax)?c.niceMax:n.globals.maxY;return{x:l,y:u-a*(u-h)}}_resolveItems(e){const t=this._cfg(),n=Array.isArray(t.items)&&t.items.length?t.items:["annotate","xline","yline","measure"],i=t.labels||{},s=[];return n.forEach(t=>{if("string"==typeof t){if("annotate"===t)s.push({id:"annotate",label:i.annotate||"Add note here",run:()=>this._annotate(e)});else if("xline"===t)s.push({id:"xline",label:i.xline||"Annotate here",run:()=>this._line(e,"x")});else if("yline"===t)s.push({id:"yline",label:i.yline||"Mark this level",run:()=>this._line(e,"y")});else if("measure"===t){const t=this.ctx.measure;t&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&s.push({id:"measure",label:i.measure||"Measure from here",run:()=>t.seedFromClient(e.clientX,e.clientY)})}}else t&&"object"==typeof t&&"function"==typeof t.onClick&&s.push({id:t.id||"custom",label:t.label||"Action",run:()=>t.onClick(this.ctx,e)})}),s}_annotate(e){if(null==e.x||null==e.y)return;const t=this._cfg(),n=this.ctx.ink;n&&"function"==typeof n.createAt?n.createAt(e.x,e.y,{text:t.noteText||"Note"}):this.ctx.addPointAnnotation({x:e.x,y:e.y,marker:{size:5},label:{text:t.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(e,t){const n=this._cfg().line||{},s="x"===t?e.x:e.y;if(null==s)return;const o=this.ctx.ink;if(o&&"function"==typeof o.createLineAt)return void o.createLineAt(t,s,{text:n.text,strokeDashArray:n.strokeDashArray,color:n.color});const r={strokeDashArray:null!=n.strokeDashArray?n.strokeDashArray:4};n.text&&(r.label={text:n.text}),n.color&&(r.borderColor=n.color,r.label=i.extend(r.label||{},{borderColor:n.color})),"x"===t?this.ctx.addXaxisAnnotation(i.extend(r,{x:s}),!0):this.ctx.addYaxisAnnotation(i.extend(r,{y:s}),!0)}open(e,t){this.close();const n=this.w,i=n.dom.elWrap,s=this._doc();if(!i||!s)return;const o=this._clientToData(e,t),r=n.globals,a={x:o?o.x:null,y:o?o.y:null,seriesIndex:r.capturedSeriesIndex>=0?r.capturedSeriesIndex:null,dataPointIndex:r.capturedDataPointIndex>=0?r.capturedDataPointIndex:null,clientX:e,clientY:t},l=this._resolveItems(a);if(!l.length)return;this._items=l;const c=s.createElement("div");c.className="apexcharts-context-menu",c.setAttribute("role","menu"),c.style.position="absolute",c.style.visibility="hidden",l.forEach((e,t)=>{const n=s.createElement("button");n.type="button",n.className="apexcharts-context-menu-item",n.setAttribute("role","menuitem"),n.tabIndex=-1,n.textContent=e.label,n.addEventListener("click",e=>{e.stopPropagation(),this._activate(t)}),n.addEventListener("mouseenter",()=>this._focus(t)),c.appendChild(n)}),i.appendChild(c),this.menu=c;const h=i.getBoundingClientRect();let u=e-h.left,d=t-h.top;const x=c.offsetWidth,f=c.offsetHeight,m=Math.max(0,i.clientWidth-x),_=Math.max(0,i.clientHeight-f);u>m&&(u=m),d>_&&(d=_),c.style.left=Math.max(0,u)+"px",c.style.top=Math.max(0,d)+"px",c.style.visibility="visible",s.addEventListener("mousedown",this._onDocDown,!0),s.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(e){if(!this.menu)return;const t=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&t[this._focusIndex]&&t[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=e,t[e]&&(t[e].classList.add("apexcharts-context-menu-item--active"),"function"==typeof t[e].focus&&t[e].focus())}_activate(e){const t=this._items[e];this.close(),t&&t.run()}_onDocDown(e){this.menu&&this.menu.contains(e.target)||this.close()}_onKey(e){this.menu&&this._items.length&&("Escape"===e.key?(e.preventDefault(),this.close()):"ArrowDown"===e.key?(e.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===e.key?(e.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const e=this._doc();e&&(e.removeEventListener("mousedown",this._onDocDown,!0),e.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexContextMenu={})}(this,function(e){"use strict";const t=globalThis.ApexCharts,n=globalThis.ApexCharts.__internals.__apex_Environment_Environment,i=globalThis.ApexCharts.__internals.__apex_Utils;t.registerFeatures({contextMenu:class{constructor(e,t){this.w=e,this.ctx=t,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),t.addEventListener("mounted",this._afterRender),t.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!n.isBrowser())return;const e=this.w.dom.Paper&&this.w.dom.Paper.node;e&&(e.addEventListener("contextmenu",this._onContext),this._trigger=e)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(e){this._enabled()&&(e.preventDefault(),this.open(e.clientX,e.clientY))}_clientToData(e,t){const n=this.w,i=n.dom.baseEl&&n.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const s=i.getBoundingClientRect();if(!s.width||!s.height)return null;const o=e=>e<0?0:e>1?1:e,r=o((e-s.left)/s.width),a=o((t-s.top)/s.height),l=n.globals.minX+r*(n.globals.maxX-n.globals.minX),h=n.globals.yAxisScale&&n.globals.yAxisScale[0],c=h&&isFinite(h.niceMin)?h.niceMin:n.globals.minY,u=h&&isFinite(h.niceMax)?h.niceMax:n.globals.maxY;return{x:l,y:u-a*(u-c)}}_resolveItems(e){const t=this._cfg(),n=Array.isArray(t.items)&&t.items.length?t.items:["annotate","xline","yline","measure"],i=t.labels||{},s=[];return n.forEach(t=>{if("string"==typeof t){if("annotate"===t)s.push({id:"annotate",label:i.annotate||"Add note here",run:()=>this._annotate(e)});else if("xline"===t)s.push({id:"xline",label:i.xline||"Annotate here",run:()=>this._line(e,"x")});else if("yline"===t)s.push({id:"yline",label:i.yline||"Mark this level",run:()=>this._line(e,"y")});else if("measure"===t){const t=this.ctx.measure;t&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&s.push({id:"measure",label:i.measure||"Measure from here",run:()=>t.seedFromClient(e.clientX,e.clientY)})}}else t&&"object"==typeof t&&"function"==typeof t.onClick&&s.push({id:t.id||"custom",label:t.label||"Action",run:()=>t.onClick(this.ctx,e)})}),s}_annotate(e){if(null==e.x||null==e.y)return;const t=this._cfg(),n=this.ctx.ink;n&&"function"==typeof n.createAt?n.createAt(e.x,e.y,{text:t.noteText||"Note"}):this.ctx.addPointAnnotation({x:e.x,y:e.y,marker:{size:5},label:{text:t.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(e,t){const n=this._cfg().line||{},s="x"===t?e.x:e.y;if(null==s)return;const o=this.ctx.ink;if(o&&"function"==typeof o.createLineAt)return void o.createLineAt(t,s,{text:n.text,strokeDashArray:n.strokeDashArray,color:n.color});const r={strokeDashArray:null!=n.strokeDashArray?n.strokeDashArray:4};n.text&&(r.label={text:n.text}),n.color&&(r.borderColor=n.color,r.label=i.extend(r.label||{},{borderColor:n.color})),"x"===t?this.ctx.addXaxisAnnotation(i.extend(r,{x:s}),!0):this.ctx.addYaxisAnnotation(i.extend(r,{y:s}),!0)}open(e,t){this.close();const n=this.w,i=n.dom.elWrap,s=this._doc();if(!i||!s)return;const o=this._clientToData(e,t),r=n.globals,a={x:o?o.x:null,y:o?o.y:null,seriesIndex:r.capturedSeriesIndex>=0?r.capturedSeriesIndex:null,dataPointIndex:r.capturedDataPointIndex>=0?r.capturedDataPointIndex:null,clientX:e,clientY:t},l=this._resolveItems(a);if(!l.length)return;this._items=l;const h=s.createElement("div");h.className="apexcharts-context-menu",h.setAttribute("role","menu"),h.style.position="absolute",h.style.visibility="hidden",l.forEach((e,t)=>{const n=s.createElement("button");n.type="button",n.className="apexcharts-context-menu-item",n.setAttribute("role","menuitem"),n.tabIndex=-1,n.textContent=e.label,n.addEventListener("click",e=>{e.stopPropagation(),this._activate(t)}),n.addEventListener("mouseenter",()=>this._focus(t)),h.appendChild(n)}),i.appendChild(h),this.menu=h;const c=i.getBoundingClientRect();let u=e-c.left,d=t-c.top;const x=h.offsetWidth,f=h.offsetHeight,_=Math.max(0,i.clientWidth-x),m=Math.max(0,i.clientHeight-f);u>_&&(u=_),d>m&&(d=m),h.style.left=Math.max(0,u)+"px",h.style.top=Math.max(0,d)+"px",h.style.visibility="visible",s.addEventListener("mousedown",this._onDocDown,!0),s.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(e){if(!this.menu)return;const t=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&t[this._focusIndex]&&t[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=e,t[e]&&(t[e].classList.add("apexcharts-context-menu-item--active"),"function"==typeof t[e].focus&&t[e].focus())}_activate(e){const t=this._items[e];this.close(),t&&t.run()}_onDocDown(e){this.menu&&this.menu.contains(e.target)||this.close()}_onKey(e){this.menu&&this._items.length&&("Escape"===e.key?(e.preventDefault(),this.close()):"ArrowDown"===e.key?(e.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===e.key?(e.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const e=this._doc();e&&(e.removeEventListener("mousedown",this._onDocDown,!0),e.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}}),e.default=t,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,o=(e,i,r)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,l=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&o(t,i,e[i]);if(r)for(var i of r(e))n.call(e,i)&&o(t,i,e[i]);return t},a=(t,r)=>e(t,i(r));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const d=c(require("apexcharts/core")),h=d.__apex_Utils,u=d.__apex_Environment_Environment,p=d.__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,c=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(c-o>=l+1)return i.style.top=`${c-l-1+a}px`,!0;i.style.top=`${o+a}px`;const d="dark"===t.config.theme.mode;return i.style.background=d?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const g="http://www.w3.org/1999/xhtml";class w{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!u.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=p.createElementNS(g,"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=p.createElementNS(g,"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=p.createElementNS(g,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=r,n.appendChild(t)}else{const t=p.createElementNS(g,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=p.createElementNS(g,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=p.createElementNS(g,"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 b="http://www.w3.org/1999/xhtml",_="apexcharts-drilldown-loading";class y{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(!u.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=p.createElementNS(b,"div");i.setAttribute("class",_),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const r=p.createElementNS(b,"div");if(r.setAttribute("class",`${_}-spinner`),r.setAttribute("aria-hidden","true"),i.appendChild(r),t.text){const e=p.createElementNS(b,"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 m="__apexDrilldownMarker";d.default.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 w(t,e,this),this.loading=new y(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):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 Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const r=this.path[this.path.length-1];return this.stack.push({id:t.id,name:t.name,restore:this._snapshot()}),this._apply(this._viewFromChild(t),"down",{from:r,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}_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()},c=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:a(l({},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=c,c}_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){const r=this.w;r.interact.selectedDataPoints=[],r.globals.collapsedSeries=[],r.globals.collapsedSeriesIndices=[],r.globals.ancillaryCollapsedSeries=[],r.globals.ancillaryCollapsedSeriesIndices=[],r.globals.allSeriesCollapsed=!1,r.globals.risingSeries=[],t.markers=a(l({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const s=(!r.config.drilldown.animation||!1!==r.config.drilldown.animation.enabled)&&!1!==r.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i);const n=e=>this.ctx.updateOptions(t,!1,e,!1,!1),o=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(s&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>n(!1)).then(o)}return n(s).then(o)}_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(!u.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`},c=this._markGroup();let d=null;if(c){a(c),d=c.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:n,easing:"ease-in",fill:"forwards"});try{yield d.finished}catch(t){}}yield i();const h=this._markGroup();if(h){a(h),h.style.opacity="0",h.style.transform=l,d&&c===h&&d.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){}(u=h).style.transform="",u.style.opacity="",u.style.transformOrigin="",u.style.transformBox="",t.cancel()}var u},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)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}_afterRender(){const t=this.w;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(!u.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)}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0)}_wirePlotClick(){if(!u.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[m]):[],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,[m]:!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}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(t,e){"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={})}(this,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},c=(t,e)=>i(t,r(e));const d=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,c=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(c-o>=l+1)return i.style.top=`${c-l-1+a}px`,!0;i.style.top=`${o+a}px`;const d="dark"===t.config.theme.mode;return i.style.background=d?"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 b="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(b,"div");i.setAttribute("class",_),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const r=u.createElementNS(b,"div");if(r.setAttribute("class",`${_}-spinner`),r.setAttribute("aria-hidden","true"),i.appendChild(r),t.text){const e=u.createElementNS(b,"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 x="__apexDrilldownMarker";d.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];return this.stack.push({id:t.id,name:t.name,restore:this._snapshot()}),this._apply(this._viewFromChild(t),"down",{from:r,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}_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:c(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){const r=this.w;r.interact.selectedDataPoints=[],r.globals.collapsedSeries=[],r.globals.collapsedSeriesIndices=[],r.globals.ancillaryCollapsedSeries=[],r.globals.ancillaryCollapsedSeriesIndices=[],r.globals.allSeriesCollapsed=!1,r.globals.risingSeries=[],t.markers=c(a({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const s=(!r.config.drilldown.animation||!1!==r.config.drilldown.animation.enabled)&&!1!==r.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i);const n=e=>this.ctx.updateOptions(t,!1,e,!1,!1),o=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(s&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>n(!1)).then(o)}return n(s).then(o)}_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`},c=this._markGroup();let d=null;if(c){a(c),d=c.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:n,easing:"ease-in",fill:"forwards"});try{yield d.finished}catch(t){}}yield i();const h=this._markGroup();if(h){a(h),h.style.opacity="0",h.style.transform=l,d&&c===h&&d.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)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}_afterRender(){const t=this.w;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[x]):[],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,[x]:!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=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var e=Object.defineProperty,r=Object.defineProperties,t=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(r,t,l)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[t]=l,s=(e,r)=>{for(var t in r||(r={}))n.call(r,t)&&o(e,t,r[t]);if(l)for(var t of l(r))a.call(r,t)&&o(e,t,r[t]);return e},u=(e,l)=>r(e,t(l));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function i(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 l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const c=i(require("apexcharts/core")),d=c.__apex_Utils;function f(e,r,t){const l=t&&void 0!==t[r]?t[r]:r+1;return null==e?{x:l,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:l,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:l,y:e.y,rest:e}:{x:l,y:e,rest:{}}}function b(e,r){var t;const l=r.config,n=r.globals;if(!Array.isArray(e))return e;n.dumbbellRawSeries||(n.dumbbellRawSeries=e.map(e=>u(s({},e),{data:Array.isArray(null==e?void 0:e.data)?e.data.slice():null==e?void 0:e.data})));const a=n.dumbbellRawSeries,o=a.some(e=>function(e){for(let r=0;r<e.length;r++){const t=e[r],l=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(Array.isArray(l)&&2===l.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 i=null==(t=l.xaxis)?void 0:t.categories,c=n.collapsedSeriesIndices||[],{xs:b,rows:p,byX:y}=function(e,r){var t;const l=[],n=[],a=new Map,o=[];for(let u=0;u<e.length;u++){const i=Array.isArray(null==(t=e[u])?void 0:t.data)?e[u].data:[],c=new Map;for(let e=0;e<i.length;e++){const{x:t,y:o,rest:u}=f(i[e],e,r),b=t instanceof Date?t.getTime():t;a.has(b)||(a.set(b,l.length),l.push(t),n.push(s({},u)));const p=a.get(b);c.set(p,d.parseNumber(o))}o.push(c)}return{xs:l,rows:n,byX:o}}(a,i),g=[],h=[],m=[];for(let e=0;e<a.length;e++)-1===c.indexOf(e)&&m.push(e);const v=[];for(let e=0;e<b.length;e++){const r=[];for(let t=0;t<a.length;t++){const l=y[t].has(e)?y[t].get(e):null;r.push(null!=l&&isFinite(l)?l:null)}g.push(r);let t=null,l=null,n=-1,o=-1;for(let e=0;e<m.length;e++){const a=m[e],s=r[a];null!==s&&((null===t||s<t)&&(t=s,n=a),(null===l||s>l)&&(l=s,o=a))}null!==t&&null!==l?(h.push([n,o]),v.push(u(s({},p[e]),{x:b[e],y:[t,l]}))):(h.push(null),v.push(u(s({},p[e]),{x:b[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:h,carrier:m.length?m[0]:0,hidden:a.map((e,r)=>r).filter(e=>-1!==c.indexOf(e))};const x=r.dumbbellData.carrier;return a.map((e,r)=>u(s({},e),{data:r===x&&m.length?v:[]}))}const p="__apexcharts_series_transforms__";var y,g;globalThis[p]||(globalThis[p]={}),y="dumbbell","function"==typeof(g=b)&&(globalThis[p][y]=g),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default}),exports.dumbbellTransform=b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).ApexDumbbell={})}(this,function(e){"use strict";var r=Object.defineProperty,t=Object.defineProperties,l=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(e,t,l)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,i=(e,r)=>{for(var t in r||(r={}))s.call(r,t)&&o(e,t,r[t]);if(n)for(var t of n(r))a.call(r,t)&&o(e,t,r[t]);return e},u=(e,r)=>t(e,l(r));const c=globalThis.ApexCharts,d=globalThis.ApexCharts.__internals.__apex_Utils;function f(e,r,t){const l=t&&void 0!==t[r]?t[r]:r+1;return null==e?{x:l,y:null,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:l,y:e[1],rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:l,y:e.y,rest:e}:{x:l,y:e,rest:{}}}function p(e,r){var t;const l=r.config,n=r.globals;if(!Array.isArray(e))return e;n.dumbbellRawSeries||(n.dumbbellRawSeries=e.map(e=>u(i({},e),{data:Array.isArray(null==e?void 0:e.data)?e.data.slice():null==e?void 0:e.data})));const s=n.dumbbellRawSeries,a=s.some(e=>function(e){for(let r=0;r<e.length;r++){const t=e[r],l=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(Array.isArray(l)&&2===l.length)return!0}return!1}(Array.isArray(null==e?void 0:e.data)?e.data:[]));if(a)return r.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},e;const o=null==(t=l.xaxis)?void 0:t.categories,c=n.collapsedSeriesIndices||[],{xs:p,rows:b,byX:y}=function(e,r){var t;const l=[],n=[],s=new Map,a=[];for(let o=0;o<e.length;o++){const u=Array.isArray(null==(t=e[o])?void 0:t.data)?e[o].data:[],c=new Map;for(let e=0;e<u.length;e++){const{x:t,y:a,rest:o}=f(u[e],e,r),p=t instanceof Date?t.getTime():t;s.has(p)||(s.set(p,l.length),l.push(t),n.push(i({},o)));const b=s.get(p);c.set(b,d.parseNumber(a))}a.push(c)}return{xs:l,rows:n,byX:a}}(s,o),h=[],g=[],m=[];for(let e=0;e<s.length;e++)-1===c.indexOf(e)&&m.push(e);const x=[];for(let e=0;e<p.length;e++){const r=[];for(let t=0;t<s.length;t++){const l=y[t].has(e)?y[t].get(e):null;r.push(null!=l&&isFinite(l)?l:null)}h.push(r);let t=null,l=null,n=-1,a=-1;for(let e=0;e<m.length;e++){const s=m[e],o=r[s];null!==o&&((null===t||o<t)&&(t=o,n=s),(null===l||o>l)&&(l=o,a=s))}null!==t&&null!==l?(g.push([n,a]),x.push(u(i({},b[e]),{x:p[e],y:[t,l]}))):(g.push(null),x.push(u(i({},b[e]),{x:p[e],y:null})))}r.dumbbellData={form:"series",names:s.map((e,r)=>{var t;return null!=(t=null==e?void 0:e.name)?t:`Series ${r+1}`}),values:h,order:g,carrier:m.length?m[0]:0,hidden:s.map((e,r)=>r).filter(e=>-1!==c.indexOf(e))};const v=r.dumbbellData.carrier;return s.map((e,r)=>u(i({},e),{data:r===v&&m.length?x:[]}))}const b="__apexcharts_series_transforms__";var y,h;globalThis[b]||(globalThis[b]={}),y="dumbbell","function"==typeof(h=p)?globalThis[b][y]=h:console.warn(`ApexCharts: registerSeriesTransform("${y}") expects a function (series, w) => series.`),e.default=c,e.dumbbellTransform=p,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
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 s in e)if("default"!==s){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const t=e(require("apexcharts/core")),s=t.__apex_axes_AxesUtils,a=t.__apex_Data,r=t.__apex_Series,o=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 s=parseFloat(e.getAttributeNS(null,"width")),a=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",s*t),e.setAttributeNS(null,"height",a*t),e.setAttributeNS(null,"viewBox","0 0 "+s+" "+a)}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 a;try{a=t[e].toDataURL()}catch(e){continue}const r=s[e],o=document.createElementNS(l,"image");o.setAttribute("x",r.getAttribute("x")||"0"),o.setAttribute("y",r.getAttribute("y")||"0"),o.setAttribute("width",r.getAttribute("width")||"0"),o.setAttribute("height",r.getAttribute("height")||"0"),o.setAttribute("href",a),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.parentNode&&r.parentNode.replaceChild(o,r)}}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"),a=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"}),a&&this.setStyleDefaults(e,{"flex-wrap":"wrap"}),s||a&&t.contains("apexcharts-align-left")?this.setStyleDefaults(e,{"justify-content":"flex-start","align-items":"flex-start"}):a&&t.contains("apexcharts-align-center")?this.setStyleDefaults(e,{"justify-content":"center","align-items":"center"}):a&&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 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=n.getComputedStyle(t),a=s&&s.fontFamily;a&&a.split(",").forEach(t=>{const s=t.trim().replace(/^['"]|['"]$/g,"");s&&e.add(s.toLowerCase())})}),e}collectFontFaceRules(){if(!i.isBrowser())return Promise.resolve([]);const e=[],t=[],s=t=>{(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})})};return Array.from(document.styleSheets||[]).forEach(e=>{let a=null;try{a=e.cssRules}catch(e){a=null}a?Array.from(a).forEach(e=>{5===e.type&&e.cssText&&s(e.cssText)}):e.href&&t.push(fetch(e.href).then(e=>e.ok?e.text():"").then(s).catch(()=>{}))}),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 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).catch(()=>null))):Promise.resolve([])}).then(t=>{const s=(t||[]).filter(Boolean).join("\n");if(!s)return;const a=document.createElementNS(l,"style");a.textContent=s,e.insertBefore(a,e.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(e){const t=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(e));)a[2].startsWith("data:")||t.push(a[2]);return t.length?Promise.all(t.map(e=>this.fetchAsDataUri(e).then(t=>({url:e,dataUri:t})).catch(()=>({url:e,dataUri:null})))).then(t=>{let s=e,a=0;return t.forEach(({url:e,dataUri:t})=>{t&&(s=s.split(e).join(t),a++)}),a?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 a="";for(let e=0;e<t.length;e+=32768)a+=String.fromCharCode.apply(null,t.subarray(e,e+32768));return`data:${s};base64,${btoa(a)}`})})}getSvgString(e){return new Promise(t=>{const s=this.w;let a=e||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;a||(a=1);const r=s.globals.svgWidth*a,o=s.globals.svgHeight*a,i=s.dom.elWrap.cloneNode(!0);i.style.width=r+"px",i.style.height=o+"px",this.inlineCanvasLayers(i),this.applyExportStyles(i);const n=(new XMLSerializer).serializeToString(i);let l=`\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="${s.globals.svgWidth}px" height="${s.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${r}px; height:${o}px;">\n ${n}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(l);1!==a&&this.scaleSvgNode(c,a),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),t(l.replace(/ /g," "))})})}convertImagesToBase64(e){const t="http://www.w3.org/1999/xlink",s=e.getElementsByTagName("image"),a=Array.from(s).map(e=>{const s=e.getAttributeNS(t,"href"),a=e.getAttribute("href"),r=s||a;if(!r||r.startsWith("data:"))return Promise.resolve();const o=r=>{s&&e.setAttributeNS(t,"href",r),!a&&s||e.setAttribute("href",r)};return this.fetchAsDataUri(r).then(o).catch(()=>this.getBase64FromUrl(r).then(o).catch(e=>{}))});return Promise.all(a)}getBase64FromUrl(e){return i.isSSR()?Promise.resolve(e):new Promise((t,s)=>{const a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{const e=document.createElement("canvas");e.width=a.width,e.height=a.height;const s=e.getContext("2d");s&&s.drawImage(a,0,0),t(e.toDataURL())},a.onerror=s,a.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 i.isSSR()?Promise.resolve({imgURI:""}):new Promise(t=>{const s=this.w,a=e?e.scale||e.width/s.globals.svgWidth:1,r=document.createElement("canvas");r.width=s.globals.svgWidth*a,r.height=parseInt(s.dom.elWrap.style.height,10)*a;const o=this.resolveExportBackground(),i=r.getContext("2d");i&&(i.fillStyle=o,i.fillRect(0,0,r.width,r.height),this.getSvgString(a).then(e=>{const s="data:image/svg+xml,"+encodeURIComponent(e),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{i.drawImage(a,0,0);const e=r;if(e.msToBlob){const s=e.msToBlob();t({blob:s})}else{const e=r.toDataURL("image/png");t({imgURI:e})}},a.src=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,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"):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;e||(e=l.config.series);let c=[];const h=[];let g="";const p=l.seriesData.series.map((e,t)=>-1===l.globals.collapsedSeriesIndices.indexOf(t)?e:[]),u=e=>{if(null==e||o.isNumber(e))return e;const t=String(e);return/^[=+\-@\t\r]/.test(t)?`'${t}`:t},f=e=>"function"==typeof l.config.chart.toolbar.export.csv.categoryFormatter?l.config.chart.toolbar.export.csv.categoryFormatter(e):"datetime"===l.config.xaxis.type&&String(e).length>=10?new Date(e).toDateString():o.isNumber(e)?e:u(e.split(i).join("")),d=e=>"function"==typeof l.config.chart.toolbar.export.csv.valueFormatter?l.config.chart.toolbar.export.csv.valueFormatter(e):u(e),m=Math.max(...e.map(e=>e.data?e.data.length:0)),x=new a(this.w),y=new s(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=e=>{let t="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){const s=l.formatters.yLabelFormatters[0],a=new r(this.ctx.w).getActiveConfigSeriesIndex();t=s(l.labelData.labels[e],{seriesIndex:a,dataPointIndex:e,w:l})}else t=y.getLabel(l.labelData.labels,l.labelData.timescaleLabels,0,e).text;"datetime"===l.config.xaxis.type&&(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 null===t?"nullvalue":(Array.isArray(t)&&(t=t.join(" ")),o.isNumber(t)?t:t.split(i).join(""))},w=(t,s)=>{var a,r,o,n,g,u;if(c.length&&0===s&&h.push(c.join(i)),t.data){const y=t.data.length?t.data:[...Array(m)].map(()=>"");for(let m=0;m<y.length;m++){c=[];let y=b(m);if("nullvalue"!==y){if(y||(x.isFormatXY()?y=e[s].data[m].x:x.isFormat2DArray()&&(y=e[s].data[m]?e[s].data[m][0]:"")),0===s){c.push(f(y));for(let t=0;t<l.seriesData.series.length;t++){const s=x.isFormatXY()?null==(a=e[t].data[m])?void 0:a.y:p[t][m];c.push(d(s))}}("candlestick"===l.config.chart.type||t.type&&"candlestick"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),("boxPlot"===l.config.chart.type||t.type&&"boxPlot"===t.type)&&(c.pop(),c.push(l.candleData.seriesCandleO[s][m]),c.push(l.candleData.seriesCandleH[s][m]),c.push(l.candleData.seriesCandleM[s][m]),c.push(l.candleData.seriesCandleL[s][m]),c.push(l.candleData.seriesCandleC[s][m])),"rangeBar"===l.config.chart.type&&(c.pop(),c.push(l.rangeData.seriesRangeStart[s][m]),c.push(l.rangeData.seriesRangeEnd[s][m])),("violin"===l.config.chart.type||t.type&&"violin"===t.type)&&(c.pop(),c.push(null==(r=l.violinData.seriesViolinMin[s])?void 0:r[m]),c.push(null==(o=l.violinData.seriesViolinMax[s])?void 0:o[m]),c.push(null!=(u=null==(g=null==(n=l.violinData.seriesViolinPoints[s])?void 0:n[m])?void 0:g.length)?u:0)),c.length&&h.push(c.join(i))}}}};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):"violin"===l.config.chart.type?(c.push("minimum"),c.push("maximum"),c.push("observations")):e.map((e,t)=>{const s=(e.name?e.name:`series-${t}`)+"";l.globals.axisCharts&&c.push(s.split(i).join("")?s.split(i).join(""):`series-${t}`)}),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),h.push(c.join(i))),l.globals.allSeriesHasEqualX||!l.globals.axisCharts||l.config.xaxis.categories.length||l.config.labels.length?e.map((e,t)=>{l.globals.axisCharts?w(e,t):(c=[],c.push(f(l.labelData.labels[t])),c.push(d(p[t])),h.push(c.join(i)))}):(()=>{const t=new Set,s={};e.forEach((a,r)=>{null==a||a.data.forEach(a=>{let o,i;if(x.isFormatXY())o=a.x,i=a.y;else{if(!x.isFormat2DArray())return;o=a[0],i=a[1]}s[o]||(s[o]=Array(e.length).fill("")),s[o][r]=d(i),t.add(o)})}),c.length&&h.push(c.join(i)),Array.from(t).sort().forEach(e=>{const t=s[e];h.push([f(e),...t].join(i))})})(),g+=h.join(n),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+g),t||l.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(e,t,s){if(i.isSSR())return;const a=document.createElement("a");a.href=e,a.download=(t||this.w.globals.chartID)+s,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>t.default});
|