apexcharts 8.2.0 → 8.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +19793 -19713
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +38 -8
- package/dist/apexcharts.esm.js +1882 -1625
- package/dist/apexcharts.full.js +22044 -21634
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +21414 -21124
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +21413 -21123
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +91 -40
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +478 -406
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +409 -334
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +91 -40
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +409 -334
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +478 -406
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +19793 -19713
- package/dist/donut.common.js +2 -2
- package/dist/donut.esm.js +3 -9
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +478 -406
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +442 -324
- package/dist/features/annotations.common.js +2 -2
- package/dist/features/annotations.esm.js +65 -48
- package/dist/features/annotations.js +2 -2
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +2 -2
- package/dist/features/drilldown.esm.js +4 -2
- package/dist/features/drilldown.js +2 -2
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +10 -4
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +14 -9
- package/dist/features/highlight-filter.js +2 -2
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +97 -145
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +64 -44
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +2 -2
- package/dist/features/morph.esm.js +9 -5
- package/dist/features/morph.js +2 -2
- package/dist/features/perspectives.common.js +2 -2
- package/dist/features/perspectives.esm.js +4 -1
- package/dist/features/perspectives.js +2 -2
- package/dist/features/raincloud.common.js +2 -2
- package/dist/features/raincloud.esm.js +26 -27
- package/dist/features/raincloud.js +2 -2
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +2 -1
- package/dist/features/renderer-canvas.js +2 -2
- package/dist/features/stats.common.js +2 -2
- package/dist/features/stats.esm.js +52 -59
- package/dist/features/stats.js +2 -2
- package/dist/features/storyboard.common.js +2 -2
- package/dist/features/storyboard.esm.js +4 -1
- package/dist/features/storyboard.js +2 -2
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +48 -14
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +148 -18
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +150 -63
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +13 -12
- package/dist/features/weave.js +2 -2
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +1068 -842
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +3 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +529 -464
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +80 -46
- package/dist/icicle.js +2 -2
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +91 -40
- package/dist/line.js +2 -2
- package/dist/locales/en.json +2 -1
- package/dist/locales/ro.json +3 -2
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +2 -2
- package/dist/pie.esm.js +3 -9
- package/dist/pie.js +2 -2
- package/dist/polarArea.common.js +2 -2
- package/dist/polarArea.esm.js +3 -9
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +5 -4
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +2 -2
- package/dist/radialBar.esm.js +5 -12
- package/dist/radialBar.js +2 -2
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +97 -52
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +91 -40
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +478 -406
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +91 -40
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +138 -53
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +116 -94
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +138 -104
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +2 -2
- package/dist/unit.esm.js +280 -202
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +72 -26
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +477 -405
- package/package.json +1 -1
- package/src/apexcharts.js +40 -59
- package/src/assets/apexcharts.css +38 -8
- package/src/charts/Bar.js +62 -55
- package/src/charts/BarStacked.js +80 -88
- package/src/charts/BoxCandleStick.js +28 -31
- package/src/charts/Icicle.js +68 -47
- package/src/charts/Line.js +118 -42
- package/src/charts/Pie.js +2 -8
- package/src/charts/Radar.js +5 -7
- package/src/charts/Radial.js +2 -6
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +150 -88
- package/src/charts/Unit.js +368 -250
- package/src/charts/Violin.js +48 -30
- package/src/charts/common/Breadcrumb.js +2 -2
- package/src/charts/common/Hierarchy.js +32 -11
- package/src/charts/common/Jitter.js +32 -7
- package/src/charts/common/Stats.js +30 -23
- package/src/charts/common/bar/DataLabels.js +76 -81
- package/src/charts/common/bar/Helpers.js +43 -7
- package/src/charts/common/line/Helpers.js +12 -15
- package/src/charts/common/partition/NodeTooltip.js +29 -7
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/charts/common/treemap/Nested.js +2 -3
- package/src/features/raincloud.js +16 -10
- package/src/features/stats.js +67 -62
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Animations.js +102 -95
- package/src/modules/AxisMapping.js +47 -12
- package/src/modules/Core.js +4 -0
- package/src/modules/CoreUtils.js +18 -42
- package/src/modules/Data.js +23 -24
- package/src/modules/DataLabels.js +6 -6
- package/src/modules/Exports.js +12 -5
- package/src/modules/Fill.js +17 -8
- package/src/modules/Filters.js +50 -50
- package/src/modules/Graphics.js +69 -51
- package/src/modules/Markers.js +3 -1
- package/src/modules/MorphTypeChange.js +13 -7
- package/src/modules/Range.js +44 -29
- package/src/modules/RendererController.js +17 -3
- package/src/modules/Scales.js +32 -9
- package/src/modules/Series.js +41 -19
- package/src/modules/Theme.js +1 -1
- package/src/modules/Toolbar.js +3 -2
- package/src/modules/UnitMarkRegistry.js +0 -5
- package/src/modules/ZoomPanSelection.js +123 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/Easing.js +2 -1
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/annotations/Helpers.js +68 -52
- package/src/modules/axes/Grid.js +21 -7
- package/src/modules/axes/YAxis.js +8 -9
- package/src/modules/dimensions/Dimensions.js +9 -3
- package/src/modules/dimensions/Grid.js +2 -2
- package/src/modules/dimensions/XAxis.js +2 -5
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/helpers/UpdateHelpers.js +33 -15
- package/src/modules/highlightFilter/HighlightFilter.js +8 -9
- package/src/modules/highlightFilter/TreemapPart.js +2 -2
- package/src/modules/legend/HeatmapGradientLegend.js +76 -45
- package/src/modules/legend/Helpers.js +8 -1
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/license/LicenseEnforcer.js +5 -0
- package/src/modules/settings/Defaults.js +28 -56
- package/src/modules/settings/Globals.js +5 -0
- package/src/modules/settings/Options.js +7 -7
- package/src/modules/settings/TypeAliases.js +33 -16
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Labels.js +73 -76
- package/src/modules/tooltip/Marker.js +25 -21
- package/src/modules/tooltip/Position.js +88 -51
- package/src/modules/tooltip/Tooltip.js +242 -255
- package/src/modules/tooltip/Utils.js +71 -130
- package/src/modules/tooltip/constants.js +5 -5
- package/src/modules/trellis/Trellis.js +6 -0
- package/src/modules/trellis/TrellisChrome.js +18 -7
- package/src/modules/trellis/TrellisSync.js +2 -0
- package/src/modules/trellis/TrellisTooltip.js +2 -11
- package/src/modules/weave/WeaveHost.js +18 -12
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/svg/SVGFilter.js +26 -17
- package/src/types/internal.d.ts +9 -3
- package/src/utils/Utils.js +0 -14
- package/types/apexcharts.d.ts +33 -12
|
@@ -38,7 +38,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
/*!
|
|
41
|
-
* ApexCharts v8.
|
|
41
|
+
* ApexCharts v8.3.1
|
|
42
42
|
* (c) 2018-2026 ApexCharts
|
|
43
43
|
*/
|
|
44
44
|
import * as _core from "apexcharts/core";
|
|
@@ -277,7 +277,8 @@ class RendererController {
|
|
|
277
277
|
this._activate(desired, this._instances[desired]);
|
|
278
278
|
return this._activeKind;
|
|
279
279
|
}
|
|
280
|
-
if (mode === desired) {
|
|
280
|
+
if (mode === desired && !this._warned) {
|
|
281
|
+
this._warned = 1;
|
|
281
282
|
warnMissingFeature(
|
|
282
283
|
`\`chart.renderer: '${desired}'\``,
|
|
283
284
|
`renderer-${desired}`,
|
|
@@ -286,11 +287,17 @@ class RendererController {
|
|
|
286
287
|
}
|
|
287
288
|
);
|
|
288
289
|
}
|
|
289
|
-
} else if (mode === "canvas" && hasCanvasUnsupportedFeature(this.w)) {
|
|
290
|
+
} else if (mode === "canvas" && !this._warned && hasCanvasUnsupportedFeature(this.w)) {
|
|
291
|
+
this._warned = 1;
|
|
290
292
|
console.warn(
|
|
291
293
|
`[apexcharts] renderer:"canvas" requested but this chart uses a feature the canvas renderer does not render yet (gradient/pattern/image fill or a state color-matrix filter); falling back to SVG.`
|
|
292
294
|
);
|
|
293
295
|
}
|
|
296
|
+
const prev = this._instances[this._activeKind];
|
|
297
|
+
if (prev) {
|
|
298
|
+
prev.destroy();
|
|
299
|
+
delete this._instances[this._activeKind];
|
|
300
|
+
}
|
|
294
301
|
this._activate("svg", this.svg);
|
|
295
302
|
return this._activeKind;
|
|
296
303
|
}
|
|
@@ -1581,9 +1588,11 @@ class HeatmapGradientLegend {
|
|
|
1581
1588
|
this._min = 0;
|
|
1582
1589
|
this._max = 0;
|
|
1583
1590
|
this._geom = null;
|
|
1591
|
+
this._grad = null;
|
|
1584
1592
|
this._bandHitEls = [];
|
|
1585
1593
|
this._activeBandIndex = -1;
|
|
1586
1594
|
this._targetEl = null;
|
|
1595
|
+
this.panelsW = null;
|
|
1587
1596
|
this._onCellEnter = this._onCellEnter.bind(this);
|
|
1588
1597
|
this._onCellLeave = this._onCellLeave.bind(this);
|
|
1589
1598
|
this._onBandEnter = this._onBandEnter.bind(this);
|
|
@@ -1698,15 +1707,8 @@ class HeatmapGradientLegend {
|
|
|
1698
1707
|
linearGrad.setAttribute("x2", "1");
|
|
1699
1708
|
linearGrad.setAttribute("y2", "0");
|
|
1700
1709
|
}
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
this._max = max;
|
|
1704
|
-
stops.forEach((s) => {
|
|
1705
|
-
const stopEl = BrowserAPIs.createElementNS(SVG_NS, "stop");
|
|
1706
|
-
stopEl.setAttribute("offset", `${(s.percent * 100).toFixed(2)}%`);
|
|
1707
|
-
stopEl.setAttribute("stop-color", s.color);
|
|
1708
|
-
linearGrad.appendChild(stopEl);
|
|
1709
|
-
});
|
|
1710
|
+
this._grad = linearGrad;
|
|
1711
|
+
const { min, max, bands } = this._paintStops();
|
|
1710
1712
|
defs.appendChild(linearGrad);
|
|
1711
1713
|
svg.appendChild(defs);
|
|
1712
1714
|
const rect = BrowserAPIs.createElementNS(SVG_NS, "rect");
|
|
@@ -1915,6 +1917,7 @@ class HeatmapGradientLegend {
|
|
|
1915
1917
|
*/
|
|
1916
1918
|
repositionToPlot() {
|
|
1917
1919
|
var _a, _b;
|
|
1920
|
+
if (this._grad) this._paintStops();
|
|
1918
1921
|
if (!Environment.isBrowser()) return;
|
|
1919
1922
|
if (this._targetEl) return;
|
|
1920
1923
|
const w = this.w;
|
|
@@ -2049,14 +2052,25 @@ class HeatmapGradientLegend {
|
|
|
2049
2052
|
if (idx < 0 || idx === this._activeBandIndex) return;
|
|
2050
2053
|
this._activeBandIndex = idx;
|
|
2051
2054
|
(_d = (_c = (_b = this.ctx) == null ? void 0 : _b.events) == null ? void 0 : _c.fireEvent) == null ? void 0 : _d.call(_c, "legendHover", [this.ctx, idx, w]);
|
|
2052
|
-
|
|
2055
|
+
this._highlightRange(idx, "highlight");
|
|
2053
2056
|
}
|
|
2054
2057
|
/** Leaving a band clears the highlight. */
|
|
2055
2058
|
_onBandLeave() {
|
|
2056
2059
|
if (this._activeBandIndex < 0) return;
|
|
2057
2060
|
const idx = this._activeBandIndex;
|
|
2058
2061
|
this._activeBandIndex = -1;
|
|
2059
|
-
|
|
2062
|
+
this._highlightRange(idx, "reset");
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* A shared trellis strip sets `panelsW` so a band reaches every panel.
|
|
2066
|
+
* @param {number} idx
|
|
2067
|
+
* @param {'highlight'|'reset'} action
|
|
2068
|
+
*/
|
|
2069
|
+
_highlightRange(idx, action) {
|
|
2070
|
+
var _a;
|
|
2071
|
+
(((_a = this.panelsW) == null ? void 0 : _a.call(this)) || [this.w]).forEach(
|
|
2072
|
+
(w) => new Series(w).highlightRangeInSeries(idx, action)
|
|
2073
|
+
);
|
|
2060
2074
|
}
|
|
2061
2075
|
_attachHoverListeners() {
|
|
2062
2076
|
var _a, _b;
|
|
@@ -2078,10 +2092,10 @@ class HeatmapGradientLegend {
|
|
|
2078
2092
|
*/
|
|
2079
2093
|
_onCellEnter(...args) {
|
|
2080
2094
|
var _a, _b, _c;
|
|
2081
|
-
const w = this.w;
|
|
2082
2095
|
if (!this.arrowEl) return;
|
|
2083
2096
|
const opts = args[args.length - 1];
|
|
2084
2097
|
if (!opts || typeof opts !== "object") return;
|
|
2098
|
+
const w = opts.w || this.w;
|
|
2085
2099
|
const i = opts.seriesIndex;
|
|
2086
2100
|
const j = opts.dataPointIndex;
|
|
2087
2101
|
if (typeof i !== "number" || typeof j !== "number") return;
|
|
@@ -2193,6 +2207,21 @@ class HeatmapGradientLegend {
|
|
|
2193
2207
|
polygon.setAttribute("pointer-events", "none");
|
|
2194
2208
|
return polygon;
|
|
2195
2209
|
}
|
|
2210
|
+
/** (Re)write the strip's stops; returns `_computeStops()`. */
|
|
2211
|
+
_paintStops() {
|
|
2212
|
+
const r = this._computeStops();
|
|
2213
|
+
const grad = this._grad;
|
|
2214
|
+
this._min = r.min;
|
|
2215
|
+
this._max = r.max;
|
|
2216
|
+
grad.innerHTML = "";
|
|
2217
|
+
r.stops.forEach((s) => {
|
|
2218
|
+
const stopEl = BrowserAPIs.createElementNS(SVG_NS, "stop");
|
|
2219
|
+
stopEl.setAttribute("offset", `${(s.percent * 100).toFixed(2)}%`);
|
|
2220
|
+
stopEl.setAttribute("stop-color", s.color);
|
|
2221
|
+
grad.appendChild(stopEl);
|
|
2222
|
+
});
|
|
2223
|
+
return r;
|
|
2224
|
+
}
|
|
2196
2225
|
/**
|
|
2197
2226
|
* Build gradient stops + return effective min/max.
|
|
2198
2227
|
* - If `colorScale.ranges` is set, stops are placed at each range boundary
|
|
@@ -2234,7 +2263,8 @@ class HeatmapGradientLegend {
|
|
|
2234
2263
|
if (!Number.isFinite(dataMax)) dataMax = 0;
|
|
2235
2264
|
let min = dataMin;
|
|
2236
2265
|
let max = dataMax;
|
|
2237
|
-
|
|
2266
|
+
const csWindow = typeof cs.min !== "undefined" && typeof cs.max !== "undefined" && cs.max > cs.min;
|
|
2267
|
+
if (csWindow) {
|
|
2238
2268
|
min = cs.min;
|
|
2239
2269
|
max = cs.max;
|
|
2240
2270
|
} else {
|
|
@@ -2265,34 +2295,30 @@ class HeatmapGradientLegend {
|
|
|
2265
2295
|
} else {
|
|
2266
2296
|
const baseColor = w.globals.colors[0] || "#008FFB";
|
|
2267
2297
|
const utils = new Utils();
|
|
2268
|
-
const
|
|
2298
|
+
const type = w.config.chart.type;
|
|
2299
|
+
const plot = w.config.plotOptions[type] || {};
|
|
2269
2300
|
const shadeIntensity = (_b = plot.shadeIntensity) != null ? _b : 0.5;
|
|
2270
|
-
const
|
|
2301
|
+
const g = (
|
|
2271
2302
|
/** @type {any} */
|
|
2272
|
-
w.globals
|
|
2303
|
+
w.globals
|
|
2273
2304
|
);
|
|
2305
|
+
const hasNegs = g.hasNegs;
|
|
2306
|
+
const yExt = type === "heatmap" && !plot.distributed && !csWindow && g.maxY >= g.minY;
|
|
2307
|
+
const hi = yExt ? g.maxY : max;
|
|
2308
|
+
const total = Math.abs(hi) + Math.abs(yExt ? cs.min < g.minY ? cs.min : g.minY : min);
|
|
2309
|
+
const k2 = shadeIntensity * 1.25;
|
|
2274
2310
|
const n = Math.max(2, cfg.stops || 16);
|
|
2275
2311
|
for (let s = 0; s < n; s++) {
|
|
2276
2312
|
const t = s / (n - 1);
|
|
2277
|
-
const
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
}
|
|
2287
|
-
} else {
|
|
2288
|
-
colorShadePercent = 1 - percent_v / 100;
|
|
2289
|
-
}
|
|
2290
|
-
if (colorShadePercent > 1) colorShadePercent = 1;
|
|
2291
|
-
if (colorShadePercent < -1) colorShadePercent = -1;
|
|
2292
|
-
const shaded = plot.enableShades ? utils.shadeColor(
|
|
2293
|
-
w.config.theme.mode === "dark" ? colorShadePercent * -1 : colorShadePercent,
|
|
2294
|
-
baseColor
|
|
2295
|
-
) : baseColor;
|
|
2313
|
+
const p = total === 0 ? 0 : Math.min(min + t * (max - min), hi) / total;
|
|
2314
|
+
const c = Math.max(
|
|
2315
|
+
-1,
|
|
2316
|
+
Math.min(
|
|
2317
|
+
1,
|
|
2318
|
+
hasNegs ? plot.reverseNegativeShade ? (p < 0 ? p : 1 - p) * k2 : p <= 0 ? 1 - (1 + p) * shadeIntensity : (1 - p) * shadeIntensity : (1 - p) * (type === "treemap" ? k2 : 1)
|
|
2319
|
+
)
|
|
2320
|
+
);
|
|
2321
|
+
const shaded = plot.enableShades ? utils.shadeColor(w.config.theme.mode === "dark" ? -c : c, baseColor) : baseColor;
|
|
2296
2322
|
stops.push({ percent: t, color: shaded });
|
|
2297
2323
|
}
|
|
2298
2324
|
}
|
|
@@ -2317,6 +2343,7 @@ class TrellisChrome {
|
|
|
2317
2343
|
this.elBreadcrumb = null;
|
|
2318
2344
|
this.gradientLegend = null;
|
|
2319
2345
|
this._gradPending = null;
|
|
2346
|
+
this._gradWire = null;
|
|
2320
2347
|
}
|
|
2321
2348
|
/**
|
|
2322
2349
|
* The per-cell facet header. Built with the cell, before the panel mounts,
|
|
@@ -2547,17 +2574,20 @@ class TrellisChrome {
|
|
|
2547
2574
|
const legend = new HeatmapGradientLegend(chart.w, chart.ctx);
|
|
2548
2575
|
legend.draw(slot);
|
|
2549
2576
|
this.gradientLegend = legend;
|
|
2550
|
-
t.panels.
|
|
2577
|
+
legend.panelsW = () => t.panels.filter((p) => p.chart).map((p) => (
|
|
2578
|
+
/** @type {any} */
|
|
2579
|
+
p.chart.w
|
|
2580
|
+
));
|
|
2581
|
+
const wire = (_, p) => {
|
|
2551
2582
|
var _a;
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
/** @type {any} */
|
|
2555
|
-
(_a = p.chart.ctx) == null ? void 0 : _a.events
|
|
2556
|
-
);
|
|
2557
|
-
if (!(ev == null ? void 0 : ev.addEventListener)) return;
|
|
2583
|
+
const ev = p.chart !== chart && ((_a = p.chart) == null ? void 0 : _a.ctx.events);
|
|
2584
|
+
if (!ev) return;
|
|
2558
2585
|
ev.addEventListener("dataPointMouseEnter", legend._onCellEnter);
|
|
2559
2586
|
ev.addEventListener("dataPointMouseLeave", legend._onCellLeave);
|
|
2560
|
-
}
|
|
2587
|
+
};
|
|
2588
|
+
t.panels.forEach((p) => wire(0, p));
|
|
2589
|
+
t.ctx.events.addEventListener("panelMounted", wire);
|
|
2590
|
+
this._gradWire = wire;
|
|
2561
2591
|
}
|
|
2562
2592
|
/** Tear down the shared gradient strip (P5). */
|
|
2563
2593
|
destroyGradientLegend() {
|
|
@@ -2567,6 +2597,7 @@ class TrellisChrome {
|
|
|
2567
2597
|
(_b = (_a = t.ctx.events).removeEventListener) == null ? void 0 : _b.call(_a, "panelMounted", this._gradPending);
|
|
2568
2598
|
this._gradPending = null;
|
|
2569
2599
|
}
|
|
2600
|
+
t.ctx.events.removeEventListener("panelMounted", this._gradWire);
|
|
2570
2601
|
if (this.gradientLegend) {
|
|
2571
2602
|
try {
|
|
2572
2603
|
this.gradientLegend.destroy();
|
|
@@ -2883,6 +2914,7 @@ class TrellisSync {
|
|
|
2883
2914
|
});
|
|
2884
2915
|
};
|
|
2885
2916
|
const loop = () => {
|
|
2917
|
+
if (elGrid !== this.trellis.elGrid) return raf2 = 0;
|
|
2886
2918
|
apply();
|
|
2887
2919
|
raf2 = hoverTarget ? requestAnimationFrame(loop) : 0;
|
|
2888
2920
|
};
|
|
@@ -3289,33 +3321,84 @@ class AxisMapping {
|
|
|
3289
3321
|
return w.globals.minX + px * AxisMapping.xRatio(w);
|
|
3290
3322
|
}
|
|
3291
3323
|
/**
|
|
3292
|
-
*
|
|
3293
|
-
*
|
|
3294
|
-
*
|
|
3295
|
-
*
|
|
3296
|
-
*
|
|
3324
|
+
* The plot area on screen, in client px: its corner is where the plot's
|
|
3325
|
+
* group is translated to (translateX, translateY into the svg), and it is
|
|
3326
|
+
* gridWidth by gridHeight. The one screen-to-plot measurement: the tooltip,
|
|
3327
|
+
* zoom, selection and every other pointer reader map through it, so x and y
|
|
3328
|
+
* cannot disagree under CSS zoom.
|
|
3329
|
+
*
|
|
3330
|
+
* Never the `.apexcharts-grid` group's box: a group measures to the union
|
|
3331
|
+
* of what it happens to draw (fact 2 above). The plot's outline starts a
|
|
3332
|
+
* pixel down (`Grid.drawGridArea`), so unless gridlines or row bands reach
|
|
3333
|
+
* the top edge the box starts a pixel below the plot, and on a numeric-x bar
|
|
3334
|
+
* chart the horizontal gridlines run `barPadForNumericAxis` out past both
|
|
3335
|
+
* sides.
|
|
3336
|
+
*
|
|
3337
|
+
* `zoom` is the CSS zoom of any container the chart sits in (screen px per
|
|
3338
|
+
* plot px): the measured svg width over `svgWidth`, the unscaled width it
|
|
3339
|
+
* was drawn at. A distance measured on screen from this corner is divided
|
|
3340
|
+
* by it to land in plot px, the space the series are laid out and painted in.
|
|
3341
|
+
* With nothing mounted to measure, screen px are taken as svg px.
|
|
3342
|
+
*
|
|
3343
|
+
* @param {import('../types/internal').ChartStateW} w
|
|
3344
|
+
* @returns {{ left: number, top: number, width: number, height: number, zoom: number }}
|
|
3345
|
+
*/
|
|
3346
|
+
static plotRect(w) {
|
|
3347
|
+
var _a, _b, _c;
|
|
3348
|
+
const svg = ((_a = w.dom.Paper) == null ? void 0 : _a.node) || ((_b = w.dom.baseEl) == null ? void 0 : _b.querySelector(".apexcharts-svg"));
|
|
3349
|
+
const box = ((_c = svg || w.dom.elWrap) == null ? void 0 : _c.getBoundingClientRect()) || {
|
|
3350
|
+
left: 0,
|
|
3351
|
+
top: 0,
|
|
3352
|
+
width: 0
|
|
3353
|
+
};
|
|
3354
|
+
const zoom = (svg && w.globals.svgWidth ? box.width / w.globals.svgWidth : 1) || 1;
|
|
3355
|
+
return {
|
|
3356
|
+
left: box.left + w.layout.translateX * zoom,
|
|
3357
|
+
top: box.top + w.layout.translateY * zoom,
|
|
3358
|
+
width: w.layout.gridWidth * zoom,
|
|
3359
|
+
height: w.layout.gridHeight * zoom,
|
|
3360
|
+
zoom
|
|
3361
|
+
};
|
|
3362
|
+
}
|
|
3363
|
+
/**
|
|
3364
|
+
* Client (screen) x -> pixels from the plot origin of {@link plotRect}.
|
|
3365
|
+
* Pass the rect when the caller has already measured it.
|
|
3297
3366
|
* @param {import('../types/internal').ChartStateW} w
|
|
3298
3367
|
* @param {number} screenX
|
|
3368
|
+
* @param {{ left: number, zoom: number }} [plot]
|
|
3299
3369
|
* @returns {number}
|
|
3300
3370
|
*/
|
|
3301
|
-
static screenXToPlotPx(w, screenX) {
|
|
3302
|
-
|
|
3303
|
-
const svg = baseEl && baseEl.querySelector(".apexcharts-svg");
|
|
3304
|
-
if (!svg) return screenX - w.layout.translateX;
|
|
3305
|
-
const svgRect = svg.getBoundingClientRect();
|
|
3306
|
-
const zoom = w.globals.svgWidth ? svgRect.width / w.globals.svgWidth : 1;
|
|
3307
|
-
return (screenX - svgRect.left) / (zoom || 1) - w.layout.translateX;
|
|
3371
|
+
static screenXToPlotPx(w, screenX, plot = AxisMapping.plotRect(w)) {
|
|
3372
|
+
return (screenX - plot.left) / plot.zoom;
|
|
3308
3373
|
}
|
|
3309
3374
|
}
|
|
3310
|
-
|
|
3311
|
-
|
|
3375
|
+
Object.setPrototypeOf(
|
|
3376
|
+
{
|
|
3377
|
+
funnel: "bar",
|
|
3378
|
+
pyramid: "bar",
|
|
3379
|
+
gauge: "radialBar",
|
|
3380
|
+
waffle: "unit",
|
|
3381
|
+
histogram: "bar",
|
|
3382
|
+
waterfall: "rangeBar",
|
|
3383
|
+
dumbbell: "rangeBar",
|
|
3384
|
+
streamgraph: "rangeArea",
|
|
3385
|
+
raincloud: "violin",
|
|
3386
|
+
// `column` is the name half the world uses for a vertical bar chart, and the
|
|
3387
|
+
// combo path has always accepted it on `series[].type`. On `chart.type` it
|
|
3388
|
+
// used to fall through every dispatch and die inside the renderer (#5325),
|
|
3389
|
+
// so it is spelled out here as what it has always meant.
|
|
3390
|
+
column: "bar"
|
|
3391
|
+
},
|
|
3392
|
+
null
|
|
3393
|
+
);
|
|
3394
|
+
const BAR_PATHWAY_TYPES = [
|
|
3312
3395
|
"bar",
|
|
3313
|
-
"column",
|
|
3314
3396
|
"rangeBar",
|
|
3315
3397
|
"candlestick",
|
|
3316
3398
|
"boxPlot",
|
|
3317
3399
|
"violin"
|
|
3318
3400
|
];
|
|
3401
|
+
const CURSOR_PAD = 14;
|
|
3319
3402
|
class TrellisTooltip {
|
|
3320
3403
|
/**
|
|
3321
3404
|
* @param {import('./Trellis').default} trellis
|
|
@@ -3380,7 +3463,7 @@ class TrellisTooltip {
|
|
|
3380
3463
|
return -1;
|
|
3381
3464
|
}
|
|
3382
3465
|
}
|
|
3383
|
-
const slotted = (
|
|
3466
|
+
const slotted = (BAR_PATHWAY_TYPES.includes(w.config.chart.type) || w.config.xaxis.tickPlacement === "between") && !w.config.xaxis.convertedCatToNumeric;
|
|
3384
3467
|
const j = slotted ? Math.ceil(hoverX / (gridWidth / n)) - 1 : Math.round(hoverX / (gridWidth / Math.max(1, n - 1)));
|
|
3385
3468
|
return Math.max(0, Math.min(n - 1, j));
|
|
3386
3469
|
}
|
|
@@ -4528,8 +4611,12 @@ class Trellis {
|
|
|
4528
4611
|
// gap is the breathing room here).
|
|
4529
4612
|
parentHeightOffset: 0,
|
|
4530
4613
|
toolbar: { show: false },
|
|
4614
|
+
// the shared toolbar owns the one reset (TrellisSync.resetAll); with
|
|
4615
|
+
// toolbar 'none' a panel's own reset is the only way back, unless the
|
|
4616
|
+
// page turned it off
|
|
4531
4617
|
zoom: {
|
|
4532
|
-
enabled: this.cfg.zoom !== "none"
|
|
4618
|
+
enabled: this.cfg.zoom !== "none",
|
|
4619
|
+
resetControl: this.cfg.toolbar == "none" && w.config.chart.zoom.resetControl !== false
|
|
4533
4620
|
}
|
|
4534
4621
|
}, animationsOff ? { animations: { enabled: false } } : {}), this._panelRenderer ? { renderer: this._panelRenderer } : {}), {
|
|
4535
4622
|
events: __spreadProps(__spreadValues({}, userEvents), {
|