apexcharts 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +30 -11
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +545 -463
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +984 -801
- package/dist/apexcharts.js +519 -254
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +519 -254
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +20 -10
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +20 -10
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +20 -10
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +20 -10
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +545 -463
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +20 -10
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +199 -26
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +12 -14
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +14 -1
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +38 -38
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +11 -11
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +11 -11
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +172 -25
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +15 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +20 -10
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radar.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +20 -10
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +20 -10
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +1 -1
- package/dist/unit.esm.js +79 -79
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +20 -10
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +20 -10
- package/package.json +2 -2
- package/src/apexcharts.js +39 -15
- package/src/charts/common/bar/Helpers.js +31 -12
- package/src/modules/Data.js +8 -2
- package/src/modules/Exports.js +14 -12
- package/src/modules/Formatters.js +24 -1
- package/src/modules/Range.js +28 -1
- package/src/modules/Toolbar.js +112 -2
- package/src/modules/ZoomPanSelection.js +85 -7
- package/src/modules/accessibility/KeyboardNavigation.js +14 -0
- package/src/modules/axes/YAxis.js +12 -15
- package/src/modules/helpers/UpdateHelpers.js +25 -8
- package/src/modules/settings/Globals.js +5 -10
- package/src/modules/settings/Options.js +15 -0
- package/src/modules/weave/PluginAPI.js +21 -1
- package/src/ssr/DOMShim.js +50 -0
- package/src/types/internal.d.ts +1 -1
- package/src/utils/Utils.js +6 -9
- package/types/apexcharts.d.ts +17 -0
|
@@ -25,12 +25,17 @@
|
|
|
25
25
|
* tooltip and its `dataPoint*` events; before this a plugin either re-derived
|
|
26
26
|
* it from raw pixels or did without.
|
|
27
27
|
*
|
|
28
|
+
* v5 added `api.info.stroke`, the caller's own `stroke.dashArray`. That option
|
|
29
|
+
* is indexed by series position, so a plugin that wants its own derived series
|
|
30
|
+
* dashed must write the whole array; reporting the current value is what lets
|
|
31
|
+
* it put back what it found instead of flattening the caller's dashed lines.
|
|
32
|
+
*
|
|
28
33
|
* Feature-detect rather than bumping `apiVersion` unless the plugin genuinely
|
|
29
34
|
* cannot work without the new surface: a plugin declaring v3 is SKIPPED
|
|
30
35
|
* outright on a v2 host, so `apiVersion: 2` plus `typeof api.reserve ===
|
|
31
36
|
* 'function'` keeps one build working on both.
|
|
32
37
|
*/
|
|
33
|
-
export const WEAVE_API_VERSION =
|
|
38
|
+
export const WEAVE_API_VERSION = 5
|
|
34
39
|
|
|
35
40
|
/**
|
|
36
41
|
* Public chart methods safe to expose to plugins (each bound to ctx). Excludes
|
|
@@ -307,6 +312,21 @@ export function buildPluginAPI(host, record) {
|
|
|
307
312
|
? w.config.dataLabels.enabledOnSeries.slice()
|
|
308
313
|
: null,
|
|
309
314
|
}),
|
|
315
|
+
// The caller's own dashing, reported for the same reason and against
|
|
316
|
+
// the same trap (v5). `stroke.dashArray` is indexed by series position
|
|
317
|
+
// with no per-series escape hatch, so a plugin that wants ITS OWN
|
|
318
|
+
// computed series dashed has to write the whole array, and writing one
|
|
319
|
+
// without knowing what was there discards the caller's dashed lines
|
|
320
|
+
// with nothing to restore them from.
|
|
321
|
+
//
|
|
322
|
+
// A scalar applies to every series and an array is per series. There is
|
|
323
|
+
// no "unset" to report: the option defaults to 0, and 0 already means
|
|
324
|
+
// no dashing, so restoring it restores exactly what was there.
|
|
325
|
+
stroke: Object.freeze({
|
|
326
|
+
dashArray: Array.isArray(w.config.stroke && w.config.stroke.dashArray)
|
|
327
|
+
? w.config.stroke.dashArray.slice()
|
|
328
|
+
: (w.config.stroke && w.config.stroke.dashArray) || 0,
|
|
329
|
+
}),
|
|
310
330
|
})
|
|
311
331
|
},
|
|
312
332
|
|
package/src/ssr/DOMShim.js
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
* Provides just enough SVG element emulation to create chart structure without full DOM
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
// Approximate sans-serif metrics, in em, used to estimate SVG text bounds when
|
|
8
|
+
// no font engine is available to measure the glyphs.
|
|
9
|
+
const CHAR_WIDTH_EM = 0.55
|
|
10
|
+
const ASCENT_EM = 0.917
|
|
11
|
+
const DESCENT_EM = 0.25
|
|
12
|
+
const LINE_HEIGHT_EM = 1.1
|
|
13
|
+
const DEFAULT_FONT_SIZE = 11
|
|
14
|
+
|
|
7
15
|
/**
|
|
8
16
|
* Mock SVG element for SSR environment
|
|
9
17
|
*/
|
|
@@ -148,6 +156,48 @@ class SSRElement {
|
|
|
148
156
|
}
|
|
149
157
|
}
|
|
150
158
|
|
|
159
|
+
getBBox() {
|
|
160
|
+
if (this.nodeName !== 'text' && this.nodeName !== 'tspan') {
|
|
161
|
+
return { x: 0, y: 0, width: 0, height: 0 }
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const lines = this._textLines()
|
|
165
|
+
const longest = lines.reduce((acc, line) => Math.max(acc, line.length), 0)
|
|
166
|
+
if (!longest) {
|
|
167
|
+
return { x: 0, y: 0, width: 0, height: 0 }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const fontSize =
|
|
171
|
+
parseFloat(this.attributes.get('font-size')) || DEFAULT_FONT_SIZE
|
|
172
|
+
const width = longest * fontSize * CHAR_WIDTH_EM
|
|
173
|
+
const height =
|
|
174
|
+
fontSize * (ASCENT_EM + DESCENT_EM) +
|
|
175
|
+
(lines.length - 1) * fontSize * LINE_HEIGHT_EM
|
|
176
|
+
|
|
177
|
+
const anchor = this.attributes.get('text-anchor')
|
|
178
|
+
const x = parseFloat(this.attributes.get('x')) || 0
|
|
179
|
+
const y = parseFloat(this.attributes.get('y')) || 0
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
x: anchor === 'middle' ? x - width / 2 : anchor === 'end' ? x - width : x,
|
|
183
|
+
y: y - fontSize * ASCENT_EM,
|
|
184
|
+
width,
|
|
185
|
+
height,
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Text of this element, one entry per rendered line
|
|
191
|
+
* @returns {string[]}
|
|
192
|
+
*/
|
|
193
|
+
_textLines() {
|
|
194
|
+
const tspans = this.children.filter((child) => child.nodeName === 'tspan')
|
|
195
|
+
if (tspans.length) {
|
|
196
|
+
return tspans.map((tspan) => String(tspan.textContent ?? ''))
|
|
197
|
+
}
|
|
198
|
+
return [String(this.textContent ?? '')]
|
|
199
|
+
}
|
|
200
|
+
|
|
151
201
|
getRootNode() {
|
|
152
202
|
/** @type {SSRElement} */
|
|
153
203
|
let root = this
|
package/src/types/internal.d.ts
CHANGED
|
@@ -802,7 +802,7 @@ export interface ChartContext {
|
|
|
802
802
|
eventList: string[]
|
|
803
803
|
|
|
804
804
|
// Public methods on the ApexCharts instance
|
|
805
|
-
update(options?: any): Promise<any>
|
|
805
|
+
update(options?: any, overwriteInitialSeries?: boolean): Promise<any>
|
|
806
806
|
getSyncedCharts(): any[]
|
|
807
807
|
getGroupedCharts(): any[]
|
|
808
808
|
fastUpdate(animate?: boolean, prevAxisScaleSig?: string): Promise<any>
|
package/src/utils/Utils.js
CHANGED
|
@@ -75,15 +75,12 @@ class Utils {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// A per-series shallow copy: the series OBJECTS are copied, their data arrays
|
|
78
|
-
// are shared.
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
// this way because the series object was copied at capture time.
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
// note above defineLazyInitialSeries(). This is the same cheap shape
|
|
85
|
-
// `globals.initialSeries` captures, so snapshotting a config stays O(n)
|
|
86
|
-
// instead of deep-cloning every point.
|
|
78
|
+
// are shared. Every internal "mutation" of a series' data is a property
|
|
79
|
+
// REPLACEMENT (`series[i].data = []` on legend collapse, `series[i] = 0` for
|
|
80
|
+
// non-axis charts, appendData's concat), and those cannot reach a copy made
|
|
81
|
+
// this way because the series object was copied at capture time. This is the
|
|
82
|
+
// same cheap shape `globals.initialSeries` captures, so snapshotting a config
|
|
83
|
+
// stays O(n) instead of deep-cloning every point.
|
|
87
84
|
/**
|
|
88
85
|
* @param {any} series
|
|
89
86
|
*/
|
package/types/apexcharts.d.ts
CHANGED
|
@@ -1878,6 +1878,17 @@ type ApexChart = {
|
|
|
1878
1878
|
* @default 'auto'
|
|
1879
1879
|
*/
|
|
1880
1880
|
pinch?: boolean | 'auto'
|
|
1881
|
+
/**
|
|
1882
|
+
* The way back out of a zoom on a chart whose toolbar is hidden. While the
|
|
1883
|
+
* chart is zoomed and nothing else on screen can reset it, one reset
|
|
1884
|
+
* control is drawn where the toolbar would have been, and it goes when the
|
|
1885
|
+
* range does; `Escape` resets the zoom as well. `'auto'` supplies both only
|
|
1886
|
+
* where there is no reset button already, `true` also forces the control on
|
|
1887
|
+
* where `toolbar.tools.reset` is off, and `false` turns both off for a page
|
|
1888
|
+
* that supplies its own reset. Requires `enabled: true`.
|
|
1889
|
+
* @default 'auto'
|
|
1890
|
+
*/
|
|
1891
|
+
resetControl?: boolean | 'auto'
|
|
1881
1892
|
zoomedArea?: {
|
|
1882
1893
|
fill?: {
|
|
1883
1894
|
color?: string
|
|
@@ -2656,6 +2667,12 @@ type ApexPlotOptions = {
|
|
|
2656
2667
|
distributed?: boolean
|
|
2657
2668
|
borderRadius?: number;
|
|
2658
2669
|
borderRadiusApplication?: 'around' | 'end';
|
|
2670
|
+
/**
|
|
2671
|
+
* Which segments of a stack round. 'all' (default) caps both ends of the
|
|
2672
|
+
* stack, the baseline and the far end; 'last' caps only the far end so
|
|
2673
|
+
* the stack sits square on the baseline. Stacked bar/column only.
|
|
2674
|
+
*/
|
|
2675
|
+
borderRadiusWhenStacked?: 'all' | 'last';
|
|
2659
2676
|
hideZeroBarsWhenGrouped?: boolean
|
|
2660
2677
|
rangeBarOverlap?: boolean
|
|
2661
2678
|
rangeBarGroupRows?: boolean
|