apexcharts 8.0.1 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +2310 -2274
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +1367 -1110
- package/dist/apexcharts.full.js +3880 -3531
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +3676 -3409
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +4114 -3591
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +25 -67
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +159 -163
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +125 -106
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +25 -67
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +125 -106
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +159 -163
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +2310 -2274
- package/dist/donut.common.js +2 -2
- package/dist/donut.esm.js +100 -78
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +192 -167
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +945 -640
- package/dist/features/annotations.common.js +2 -2
- package/dist/features/annotations.esm.js +46 -21
- 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 +22 -2
- package/dist/features/drilldown.js +2 -2
- package/dist/features/dumbbell.common.js +2 -2
- package/dist/features/dumbbell.esm.js +34 -5
- package/dist/features/dumbbell.js +2 -2
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +203 -204
- 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 +97 -41
- package/dist/features/highlight-filter.js +2 -2
- package/dist/features/history.common.js +2 -2
- package/dist/features/history.esm.js +4 -3
- package/dist/features/history.js +2 -2
- 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 +20 -23
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +61 -41
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +2 -2
- package/dist/features/link.esm.js +8 -8
- package/dist/features/link.js +2 -2
- package/dist/features/marks.common.js +2 -2
- 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 +260 -279
- package/dist/features/morph.js +2 -2
- package/dist/features/perspectives.common.js +2 -2
- package/dist/features/perspectives.esm.js +28 -19
- package/dist/features/perspectives.js +2 -2
- package/dist/features/raincloud.common.js +2 -2
- package/dist/features/raincloud.esm.js +54 -36
- package/dist/features/raincloud.js +2 -2
- 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 +2 -2
- package/dist/features/stats.esm.js +66 -18
- package/dist/features/stats.js +2 -2
- package/dist/features/storyboard.common.js +2 -2
- package/dist/features/storyboard.esm.js +24 -15
- package/dist/features/storyboard.js +2 -2
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +34 -5
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +211 -217
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +31 -19
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +2 -2
- package/dist/features/waterfall.esm.js +34 -5
- package/dist/features/waterfall.js +2 -2
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +290 -48
- package/dist/features/weave.js +2 -2
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +289 -150
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +48 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +224 -180
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +1 -1
- package/dist/icicle.js +1 -1
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +25 -67
- package/dist/line.js +2 -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 +100 -78
- package/dist/pie.js +2 -2
- package/dist/polarArea.common.js +2 -2
- package/dist/polarArea.esm.js +100 -78
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +8 -5
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +2 -2
- package/dist/radialBar.esm.js +166 -133
- package/dist/radialBar.js +2 -2
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +55 -42
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +25 -67
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +159 -163
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +25 -67
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +58 -71
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +28 -90
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +2 -2
- 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 +30 -6
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +2 -7
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +192 -167
- package/package.json +3 -1
- package/src/apexcharts.js +260 -201
- package/src/charts/Bar.js +16 -5
- package/src/charts/BarStacked.js +42 -88
- package/src/charts/BoxCandleStick.js +1 -7
- package/src/charts/HeatMap.js +73 -16
- package/src/charts/Line.js +21 -71
- package/src/charts/Pie.js +142 -89
- package/src/charts/Radar.js +4 -1
- package/src/charts/Radial.js +91 -63
- package/src/charts/RangeBar.js +1 -7
- package/src/charts/Treemap.js +25 -78
- package/src/charts/Unit.js +28 -10
- package/src/charts/Violin.js +1 -7
- package/src/charts/common/Hierarchy.js +0 -22
- package/src/charts/common/OuterLabels.js +12 -5
- package/src/charts/common/Stats.js +55 -28
- package/src/charts/common/bar/DataLabels.js +94 -83
- package/src/charts/common/bar/Helpers.js +34 -57
- package/src/charts/common/circle/Helpers.js +5 -2
- package/src/charts/common/treemap/Helpers.js +1 -1
- package/src/entries/full.js +0 -17
- package/src/features/link.js +9 -10
- package/src/features/perspectives.js +20 -19
- package/src/features/raincloud.js +51 -53
- package/src/features/stats.js +23 -35
- package/src/libs/Treemap-squared.js +7 -47
- package/src/modules/Animations.js +55 -73
- package/src/modules/Base.js +3 -2
- package/src/modules/ChartFactory.js +6 -1
- package/src/modules/Core.js +57 -30
- package/src/modules/CoreUtils.js +32 -33
- package/src/modules/Crosshairs.js +29 -11
- package/src/modules/Data.js +279 -153
- package/src/modules/DataLabels.js +18 -2
- package/src/modules/Events.js +1 -4
- package/src/modules/Exports.js +284 -305
- package/src/modules/Fill.js +23 -10
- package/src/modules/Formatters.js +14 -3
- package/src/modules/Graphics.js +8 -14
- package/src/modules/MorphPieces.js +4 -2
- package/src/modules/MorphTypeChange.js +332 -316
- package/src/modules/Range.js +56 -99
- package/src/modules/Responsive.js +186 -61
- package/src/modules/Scales.js +4 -47
- package/src/modules/Series.js +14 -45
- package/src/modules/Theme.js +108 -57
- package/src/modules/Toolbar.js +7 -13
- package/src/modules/accessibility/KeyboardNavigation.js +29 -28
- package/src/modules/animations/AxisTransition.js +54 -16
- package/src/modules/animations/CircleTransition.js +1 -4
- package/src/modules/animations/DataLabelTransition.js +15 -10
- package/src/modules/animations/StreamScroll.js +6 -4
- package/src/modules/annotations/Annotations.js +18 -17
- package/src/modules/annotations/Helpers.js +41 -17
- package/src/modules/axes/XAxis.js +4 -4
- package/src/modules/axes/YAxis.js +1 -6
- package/src/modules/dimensions/Dimensions.js +12 -7
- package/src/modules/dimensions/Grid.js +15 -3
- package/src/modules/dimensions/YAxis.js +7 -6
- package/src/modules/drilldown/Drilldown.js +22 -1
- package/src/modules/dumbbell/DumbbellData.js +3 -5
- package/src/modules/helpers/Destroy.js +10 -1
- package/src/modules/helpers/InitCtxVariables.js +19 -16
- package/src/modules/helpers/RawStash.js +51 -0
- package/src/modules/helpers/UpdateHelpers.js +95 -30
- package/src/modules/highlightFilter/HighlightFilter.js +107 -52
- package/src/modules/highlightFilter/PiePart.js +1 -1
- package/src/modules/highlightFilter/RadialPart.js +1 -1
- package/src/modules/history/History.js +7 -2
- package/src/modules/legend/Legend.js +100 -62
- package/src/modules/license/LicenseEnforcer.js +6 -1
- package/src/modules/settings/Config.js +60 -153
- package/src/modules/settings/Defaults.js +352 -58
- package/src/modules/settings/Globals.js +23 -5
- package/src/modules/settings/Options.js +19 -5
- package/src/modules/settings/TypeAliases.js +3 -6
- package/src/modules/streamgraph/StreamData.js +3 -5
- package/src/modules/tooltip/AxesTooltip.js +33 -41
- package/src/modules/tooltip/Intersect.js +50 -43
- package/src/modules/tooltip/Labels.js +62 -23
- package/src/modules/tooltip/Marker.js +6 -7
- package/src/modules/tooltip/Position.js +31 -35
- package/src/modules/tooltip/Tooltip.js +107 -119
- package/src/modules/tooltip/Utils.js +94 -159
- package/src/modules/trellis/TrellisExports.js +21 -9
- package/src/modules/trellis/TrellisTooltip.js +18 -8
- package/src/modules/waterfall/WaterfallData.js +3 -5
- package/src/modules/weave/Claims.js +14 -3
- package/src/modules/weave/Highlights.js +209 -0
- package/src/modules/weave/PluginAPI.js +64 -3
- package/src/modules/weave/WeaveHost.js +215 -51
- package/src/ssr/BrowserAPIs.js +5 -3
- package/src/ssr/DOMShim.js +6 -30
- package/src/ssr/Hydration.js +5 -36
- package/src/ssr/RenderShim.js +333 -0
- package/src/ssr/SSRRenderer.js +81 -36
- package/src/svg/SVGAnimation.js +10 -7
- package/src/types/internal.d.ts +37 -7
- package/src/utils/Constants.js +7 -8
- package/src/utils/DateTime.js +21 -195
- package/src/utils/MissingFeature.js +7 -9
- package/src/utils/Resize.js +4 -0
- package/src/utils/Utils.js +102 -171
- package/types/apexcharts.d.ts +57 -7
|
@@ -22,15 +22,16 @@ import { TYPE_ALIASES, BUILTIN_TYPES } from './TypeAliases'
|
|
|
22
22
|
*/
|
|
23
23
|
const TYPE_OWNED = '_apexOwnedByType'
|
|
24
24
|
|
|
25
|
+
/** Marks the % label formatter 100% stacking installs (see stacked100). */
|
|
26
|
+
const STACKED_100 = '_apexStacked100'
|
|
27
|
+
|
|
25
28
|
/**
|
|
26
29
|
* @template {Function} T
|
|
27
|
-
* @param {string[]} types chart types whose data this function can read
|
|
28
30
|
* @param {T} fn
|
|
29
31
|
* @returns {T}
|
|
30
32
|
*/
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
marked[TYPE_OWNED] = types
|
|
33
|
+
const typeOwned = (fn) => {
|
|
34
|
+
/** @type {any} */ (fn)[TYPE_OWNED] = true
|
|
34
35
|
return fn
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -79,6 +80,14 @@ const TYPE_OWNED_PATHS = [
|
|
|
79
80
|
'plotOptions.violin.box.show',
|
|
80
81
|
'plotOptions.violin.box.whiskers',
|
|
81
82
|
'plotOptions.violin.points.position',
|
|
83
|
+
'plotOptions.violin.points.jitter',
|
|
84
|
+
// What an alias draws its base renderer as: a dumbbell's marked ends, a
|
|
85
|
+
// waffle's lattice of squares.
|
|
86
|
+
'plotOptions.bar.isDumbbell',
|
|
87
|
+
'plotOptions.unit.layout',
|
|
88
|
+
'plotOptions.unit.shape',
|
|
89
|
+
// A treemap's tiles are the whole plot, with no grid to read them against.
|
|
90
|
+
'grid.show',
|
|
82
91
|
// Hover and select feedback, off by design on the types that draw their own.
|
|
83
92
|
'states.hover.filter.type',
|
|
84
93
|
'states.active.filter.type',
|
|
@@ -95,6 +104,20 @@ const TYPE_OWNED_PATHS = [
|
|
|
95
104
|
'chart.animations.dynamicAnimation.enabled',
|
|
96
105
|
]
|
|
97
106
|
|
|
107
|
+
/**
|
|
108
|
+
* The label formatter a converted category axis gets when the page has none.
|
|
109
|
+
* @param {any} val
|
|
110
|
+
*/
|
|
111
|
+
const floorLabel = (val) => (Utils.isNumber(val) ? Math.floor(val) : val)
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The base options with a type's defaults laid over them: what a leaf is when
|
|
115
|
+
* no mode preset has touched it.
|
|
116
|
+
* @param {Record<string, any>} config
|
|
117
|
+
*/
|
|
118
|
+
const plainFor = (config) =>
|
|
119
|
+
Utils.extend(new Options().init(), Defaults.forType(config))
|
|
120
|
+
|
|
98
121
|
/**
|
|
99
122
|
* Read a dotted path out of a config-shaped object.
|
|
100
123
|
* @param {Record<string, any> | undefined} obj
|
|
@@ -150,7 +173,12 @@ const typeOpts = (type, config) => {
|
|
|
150
173
|
stacked: config.chart?.stacked,
|
|
151
174
|
},
|
|
152
175
|
plotOptions: {
|
|
153
|
-
bar: {
|
|
176
|
+
bar: {
|
|
177
|
+
isFunnel: type === 'funnel' || type === 'pyramid',
|
|
178
|
+
// Orientation belongs to the chart too: a raincloud lays its layers
|
|
179
|
+
// out by it, so a horizontal one is asked about horizontally.
|
|
180
|
+
horizontal: config.plotOptions?.bar?.horizontal,
|
|
181
|
+
},
|
|
154
182
|
histogram: config.plotOptions?.histogram,
|
|
155
183
|
},
|
|
156
184
|
// The histogram's defaults read the series to decide whether overlaid bins
|
|
@@ -173,7 +201,7 @@ const typeOpts = (type, config) => {
|
|
|
173
201
|
*/
|
|
174
202
|
const isUntouched = (current, fromDefault) => {
|
|
175
203
|
if (typeof current === 'function') {
|
|
176
|
-
if (
|
|
204
|
+
if (/** @type {any} */ (current)[TYPE_OWNED]) return true
|
|
177
205
|
// Unmarked, so it is either the user's or one of the plain formatters
|
|
178
206
|
// Options rebuilds on every read. Those are never `===` across two reads,
|
|
179
207
|
// so the only thing left to compare is the source itself.
|
|
@@ -366,6 +394,10 @@ export default class Defaults {
|
|
|
366
394
|
chartDefaults = defaults.streamgraph()
|
|
367
395
|
} else if (requestedType === 'raincloud') {
|
|
368
396
|
chartDefaults = defaults.raincloud()
|
|
397
|
+
} else if (requestedType === 'waffle') {
|
|
398
|
+
chartDefaults = Utils.extend(defaults.unit(), {
|
|
399
|
+
plotOptions: { unit: { layout: 'grid', shape: 'square' } },
|
|
400
|
+
})
|
|
369
401
|
} else if (chartTypes.indexOf(opts.chart.type) !== -1) {
|
|
370
402
|
chartDefaults = /** @type {any} */ (defaults)[opts.chart.type]()
|
|
371
403
|
} else {
|
|
@@ -378,8 +410,13 @@ export default class Defaults {
|
|
|
378
410
|
chartDefaults = defaults.funnel()
|
|
379
411
|
}
|
|
380
412
|
|
|
413
|
+
// Laid over the type's own defaults rather than replacing them with a
|
|
414
|
+
// plain bar's: a stacked histogram kept neither its touching bins nor its
|
|
415
|
+
// bin-range tooltip.
|
|
381
416
|
if (opts.chart.stacked && opts.chart.type === 'bar') {
|
|
382
|
-
chartDefaults =
|
|
417
|
+
chartDefaults = Utils.extend(chartDefaults, {
|
|
418
|
+
plotOptions: { bar: { borderRadiusApplication: 'end' } },
|
|
419
|
+
})
|
|
383
420
|
}
|
|
384
421
|
|
|
385
422
|
return chartDefaults
|
|
@@ -401,8 +438,41 @@ export default class Defaults {
|
|
|
401
438
|
* @param {Record<string, any>} [options] this update's payload
|
|
402
439
|
*/
|
|
403
440
|
static handOverTypeDefaults(config, fromType, options) {
|
|
441
|
+
// Every update can reach a combination construction settles, whether or
|
|
442
|
+
// not it changes the type.
|
|
443
|
+
Defaults.reconcile(config, true)
|
|
444
|
+
|
|
445
|
+
// 100% stacking is a mode rather than a type, with presets of its own: the
|
|
446
|
+
// % formatter and the 0 to 100 axis. A stackType change by update used to
|
|
447
|
+
// leave them half applied. A formatter in the same update wins.
|
|
448
|
+
const asked = options?.chart
|
|
449
|
+
if (
|
|
450
|
+
asked &&
|
|
451
|
+
('stacked' in asked || 'stackType' in asked) &&
|
|
452
|
+
!options.dataLabels?.formatter
|
|
453
|
+
) {
|
|
454
|
+
const fmt = /** @type {any} */ (config.dataLabels.formatter)
|
|
455
|
+
const plain = new Options().init().dataLabels.formatter
|
|
456
|
+
if (config.chart.stacked && config.chart.stackType === '100%') {
|
|
457
|
+
if (isUntouched(fmt, plain)) {
|
|
458
|
+
config.dataLabels.formatter = undefined
|
|
459
|
+
new Defaults(config).stacked100(config)
|
|
460
|
+
}
|
|
461
|
+
} else if (fmt?.[STACKED_100]) {
|
|
462
|
+
config.dataLabels.formatter = plain
|
|
463
|
+
for (const y of config.yaxis) {
|
|
464
|
+
if (y.min === 0 && y.max === 100) y.min = y.max = undefined
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
404
469
|
const toType = config.chart.requestedType || config.chart.type
|
|
405
|
-
|
|
470
|
+
// A histogram picks its overlay presets by series count, which an update
|
|
471
|
+
// can change without changing the type. Asked as the other count, the
|
|
472
|
+
// outgoing presets hand over like any type default.
|
|
473
|
+
const recount =
|
|
474
|
+
fromType === toType && toType === 'histogram' && options?.series
|
|
475
|
+
if (!fromType || (fromType === toType && !recount)) return
|
|
406
476
|
|
|
407
477
|
// Ask each side separately, through a config that names only that type, so
|
|
408
478
|
// neither answer is contaminated by the other's alias flags. Each answer is
|
|
@@ -413,11 +483,26 @@ export default class Defaults {
|
|
|
413
483
|
const base = new Options().init()
|
|
414
484
|
const from = Utils.extend(
|
|
415
485
|
base,
|
|
416
|
-
Defaults.forType(
|
|
486
|
+
Defaults.forType(
|
|
487
|
+
typeOpts(
|
|
488
|
+
fromType,
|
|
489
|
+
recount
|
|
490
|
+
? { ...config, series: config.series[1] ? [] : [0, 0] }
|
|
491
|
+
: config,
|
|
492
|
+
),
|
|
493
|
+
),
|
|
417
494
|
)
|
|
418
495
|
const to = Utils.extend(base, Defaults.forType(typeOpts(toType, config)))
|
|
419
496
|
|
|
420
|
-
for (const path of
|
|
497
|
+
for (const path of recount
|
|
498
|
+
? [
|
|
499
|
+
'fill.opacity',
|
|
500
|
+
'stroke.show',
|
|
501
|
+
'stroke.width',
|
|
502
|
+
'stroke.colors',
|
|
503
|
+
'tooltip.shared',
|
|
504
|
+
]
|
|
505
|
+
: TYPE_OWNED_PATHS) {
|
|
421
506
|
if (options && readPath(options, path) !== undefined) continue
|
|
422
507
|
const fromDefault = readPath(from, path)
|
|
423
508
|
const toDefault = readPath(to, path)
|
|
@@ -443,6 +528,153 @@ export default class Defaults {
|
|
|
443
528
|
}
|
|
444
529
|
}
|
|
445
530
|
|
|
531
|
+
/**
|
|
532
|
+
* Put on or take off the sparkline preset when an update turns
|
|
533
|
+
* `chart.sparkline.enabled` on or off; construction is the only other place
|
|
534
|
+
* it is applied. A leaf moves only while it still holds what the outgoing
|
|
535
|
+
* mode chose, and never when this update names it.
|
|
536
|
+
*
|
|
537
|
+
* @param {Record<string, any>} config the merged w.config, mutated in place
|
|
538
|
+
* @param {boolean} was whether the sparkline was on before the update
|
|
539
|
+
* @param {Record<string, any>} [options] this update's payload
|
|
540
|
+
*/
|
|
541
|
+
static syncSparkline(config, was, options) {
|
|
542
|
+
const now = !!config.chart.sparkline?.enabled
|
|
543
|
+
if (now === !!was) return
|
|
544
|
+
const d = new Defaults({ yaxis: [{ title: {}, axisBorder: {}, axisTicks: {} }] })
|
|
545
|
+
const plain = plainFor(config)
|
|
546
|
+
/**
|
|
547
|
+
* @param {Record<string, any>} preset
|
|
548
|
+
* @param {Record<string, any>} target
|
|
549
|
+
* @param {Record<string, any>} off what the leaves are without the preset
|
|
550
|
+
* @param {Record<string, any>} [asked]
|
|
551
|
+
* @param {string} [pre]
|
|
552
|
+
*/
|
|
553
|
+
const walk = (preset, target, off, asked, pre = '') => {
|
|
554
|
+
for (const k of Object.keys(preset)) {
|
|
555
|
+
const p = pre + k
|
|
556
|
+
if (Utils.isObject(preset[k])) {
|
|
557
|
+
walk(preset[k], target, off, asked, p + '.')
|
|
558
|
+
} else if (readPath(asked, p) === undefined) {
|
|
559
|
+
const on = preset[k]
|
|
560
|
+
const base = readPath(off, p)
|
|
561
|
+
if (isUntouched(readPath(target, p), now ? base : on)) {
|
|
562
|
+
writePath(target, p, now ? on : base)
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
walk(d.sparkline({}), config, plain, options)
|
|
568
|
+
const asked = options?.yaxis
|
|
569
|
+
walk(
|
|
570
|
+
d.opts.yaxis[0],
|
|
571
|
+
config.yaxis[0],
|
|
572
|
+
new Options().yAxis,
|
|
573
|
+
Array.isArray(asked) ? asked[0] : asked,
|
|
574
|
+
)
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* @param {Record<string, any>} config
|
|
579
|
+
*/
|
|
580
|
+
static isHorizontalBar(config) {
|
|
581
|
+
return config.chart.type === 'bar' && !!config.plotOptions.bar.horizontal
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Hand back what reconcile switched off for a horizontal bar (zoom and the
|
|
586
|
+
* x-axis tooltip; the y-axis one is off by default anyway) when an update
|
|
587
|
+
* turns it vertical or into another type. Same rule as syncSparkline: a
|
|
588
|
+
* leaf moves only while it still holds the preset's false, and never when
|
|
589
|
+
* this update names it.
|
|
590
|
+
*
|
|
591
|
+
* @param {Record<string, any>} config the merged w.config, mutated in place
|
|
592
|
+
* @param {boolean} was whether the chart was a horizontal bar before
|
|
593
|
+
* @param {Record<string, any>} [options] this update's payload
|
|
594
|
+
*/
|
|
595
|
+
static syncHorizontal(config, was, options) {
|
|
596
|
+
if (!was || Defaults.isHorizontalBar(config)) return
|
|
597
|
+
const plain = plainFor(config)
|
|
598
|
+
for (const p of ['chart.zoom.enabled', 'xaxis.tooltip.enabled']) {
|
|
599
|
+
if (readPath(options, p) === undefined && readPath(config, p) === false) {
|
|
600
|
+
writePath(config, p, readPath(plain, p))
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Settle the option combinations the renderers do not support. Runs on a new
|
|
607
|
+
* chart's config and again after every updateOptions, which reaches the same
|
|
608
|
+
* combinations. The two it cannot settle throw on a new chart, and only warn
|
|
609
|
+
* on an update: the config is merged by then, and a throw would leave the
|
|
610
|
+
* chart half updated.
|
|
611
|
+
*
|
|
612
|
+
* @param {Record<string, any>} config the merged config, mutated in place
|
|
613
|
+
* @param {boolean} [isUpdate]
|
|
614
|
+
*/
|
|
615
|
+
static reconcile(config, isUpdate) {
|
|
616
|
+
const refuse = (/** @type {string} */ message) => {
|
|
617
|
+
if (!isUpdate) throw new Error(message)
|
|
618
|
+
console.warn(message)
|
|
619
|
+
}
|
|
620
|
+
// conflicting tooltip option. intersect makes sure to focus on 1 point at a time. Shared cannot be used along with it
|
|
621
|
+
if (config.tooltip.shared && config.tooltip.intersect) {
|
|
622
|
+
refuse(
|
|
623
|
+
'tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.',
|
|
624
|
+
)
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (Defaults.isHorizontalBar(config)) {
|
|
628
|
+
// No multiple yaxis for bars
|
|
629
|
+
if (config.yaxis.length > 1) {
|
|
630
|
+
refuse(
|
|
631
|
+
'Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false',
|
|
632
|
+
)
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
// if yaxis is reversed in horizontal bar chart, you should draw the y-axis on right side
|
|
636
|
+
if (config.yaxis[0].reversed) {
|
|
637
|
+
config.yaxis[0].opposite = true
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
config.xaxis.tooltip.enabled = false // no xaxis tooltip for horizontal bar
|
|
641
|
+
config.yaxis[0].tooltip.enabled = false // no xaxis tooltip for horizontal bar
|
|
642
|
+
config.chart.zoom.enabled = false // no zooming for horz bars
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
if (config.chart.type === 'bar' || config.chart.type === 'rangeBar') {
|
|
646
|
+
if (config.tooltip.shared) {
|
|
647
|
+
if (
|
|
648
|
+
config.xaxis.crosshairs.width === 'barWidth' &&
|
|
649
|
+
config.series.length > 1
|
|
650
|
+
) {
|
|
651
|
+
config.xaxis.crosshairs.width = 'tickWidth'
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (
|
|
657
|
+
config.chart.type === 'candlestick' ||
|
|
658
|
+
config.chart.type === 'boxPlot'
|
|
659
|
+
) {
|
|
660
|
+
if (config.yaxis[0].reversed) {
|
|
661
|
+
console.warn(
|
|
662
|
+
`Reversed y-axis in ${config.chart.type} chart is not supported.`,
|
|
663
|
+
)
|
|
664
|
+
config.yaxis[0].reversed = false
|
|
665
|
+
}
|
|
666
|
+
// Only the box plot has a horizontal form. A horizontal candlestick
|
|
667
|
+
// drew its boxes at garbage positions.
|
|
668
|
+
if (
|
|
669
|
+
config.chart.type === 'candlestick' &&
|
|
670
|
+
config.plotOptions.bar.horizontal
|
|
671
|
+
) {
|
|
672
|
+
console.warn('Horizontal candlestick chart is not supported.')
|
|
673
|
+
config.plotOptions.bar.horizontal = false
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
446
678
|
/**
|
|
447
679
|
* The y-axis leaves a type chooses for itself. Config writes them into the
|
|
448
680
|
* options on the way in, because the y-axis is an array a type's defaults
|
|
@@ -454,8 +686,8 @@ export default class Defaults {
|
|
|
454
686
|
*/
|
|
455
687
|
static typeYAxisDefaults(type) {
|
|
456
688
|
// A streamgraph has no zero line, so an axis of stacking offsets would be
|
|
457
|
-
// read as values nobody gave.
|
|
458
|
-
if (type === 'streamgraph') return { show: false }
|
|
689
|
+
// read as values nobody gave. A treemap has no value axis at all.
|
|
690
|
+
if (type === 'streamgraph' || type === 'treemap') return { show: false }
|
|
459
691
|
return {}
|
|
460
692
|
}
|
|
461
693
|
|
|
@@ -954,8 +1186,7 @@ export default class Defaults {
|
|
|
954
1186
|
},
|
|
955
1187
|
tooltip: {
|
|
956
1188
|
shared: true,
|
|
957
|
-
custom:
|
|
958
|
-
['candlestick'],
|
|
1189
|
+
custom: typeOwned(
|
|
959
1190
|
(/** @type {any} */ { seriesIndex, dataPointIndex, w }) => {
|
|
960
1191
|
return this._getBoxTooltip(
|
|
961
1192
|
w,
|
|
@@ -997,8 +1228,7 @@ export default class Defaults {
|
|
|
997
1228
|
},
|
|
998
1229
|
tooltip: {
|
|
999
1230
|
shared: true,
|
|
1000
|
-
custom:
|
|
1001
|
-
['boxPlot'],
|
|
1231
|
+
custom: typeOwned(
|
|
1002
1232
|
(/** @type {any} */ { seriesIndex, dataPointIndex, w }) => {
|
|
1003
1233
|
return this._getBoxTooltip(
|
|
1004
1234
|
w,
|
|
@@ -1049,8 +1279,7 @@ export default class Defaults {
|
|
|
1049
1279
|
},
|
|
1050
1280
|
tooltip: {
|
|
1051
1281
|
shared: true,
|
|
1052
|
-
custom:
|
|
1053
|
-
['violin'],
|
|
1282
|
+
custom: typeOwned(
|
|
1054
1283
|
(/** @type {any} */ { seriesIndex, dataPointIndex, w }) => {
|
|
1055
1284
|
return this._getViolinTooltip(w, seriesIndex, dataPointIndex)
|
|
1056
1285
|
},
|
|
@@ -1100,8 +1329,7 @@ export default class Defaults {
|
|
|
1100
1329
|
},
|
|
1101
1330
|
tooltip: {
|
|
1102
1331
|
...base.tooltip,
|
|
1103
|
-
custom:
|
|
1104
|
-
['raincloud'],
|
|
1332
|
+
custom: typeOwned(
|
|
1105
1333
|
(/** @type {any} */ { seriesIndex, dataPointIndex, w }) => {
|
|
1106
1334
|
return this._getRaincloudTooltip(w, seriesIndex, dataPointIndex)
|
|
1107
1335
|
},
|
|
@@ -1202,8 +1430,7 @@ export default class Defaults {
|
|
|
1202
1430
|
tooltip: {
|
|
1203
1431
|
shared: false,
|
|
1204
1432
|
followCursor: true,
|
|
1205
|
-
custom:
|
|
1206
|
-
['rangeBar'],
|
|
1433
|
+
custom: typeOwned(
|
|
1207
1434
|
/** @param {Record<string, any>} opts */
|
|
1208
1435
|
(opts) => {
|
|
1209
1436
|
if (
|
|
@@ -1336,6 +1563,9 @@ export default class Defaults {
|
|
|
1336
1563
|
// the eye lands on, thick enough to read as a join at a glance.
|
|
1337
1564
|
barHeight: 6,
|
|
1338
1565
|
columnWidth: 6,
|
|
1566
|
+
// A default rather than written into the options, so it hands over
|
|
1567
|
+
// with the type: a dumbbell made a range bar stayed a dumbbell.
|
|
1568
|
+
isDumbbell: true,
|
|
1339
1569
|
dumbbell: {
|
|
1340
1570
|
dataLabels: {
|
|
1341
1571
|
// The two values ARE the comparison, so they are written at the
|
|
@@ -1367,7 +1597,7 @@ export default class Defaults {
|
|
|
1367
1597
|
shared: false,
|
|
1368
1598
|
intersect: true,
|
|
1369
1599
|
followCursor: false,
|
|
1370
|
-
custom:
|
|
1600
|
+
custom: typeOwned(handleDumbbellTooltip),
|
|
1371
1601
|
},
|
|
1372
1602
|
}
|
|
1373
1603
|
}
|
|
@@ -1472,8 +1702,7 @@ export default class Defaults {
|
|
|
1472
1702
|
intersect: false,
|
|
1473
1703
|
shared: true,
|
|
1474
1704
|
followCursor: true,
|
|
1475
|
-
custom:
|
|
1476
|
-
['rangeArea'],
|
|
1705
|
+
custom: typeOwned(
|
|
1477
1706
|
/** @param {Record<string, any>} opts */
|
|
1478
1707
|
(opts) => handleRangeAreaTooltip(opts),
|
|
1479
1708
|
),
|
|
@@ -1687,8 +1916,7 @@ export default class Defaults {
|
|
|
1687
1916
|
intersect: false,
|
|
1688
1917
|
shared: false,
|
|
1689
1918
|
followCursor: true,
|
|
1690
|
-
custom:
|
|
1691
|
-
['streamgraph'],
|
|
1919
|
+
custom: typeOwned(
|
|
1692
1920
|
/** @param {Record<string, any>} opts */
|
|
1693
1921
|
(opts) => handleStreamTooltip(opts),
|
|
1694
1922
|
),
|
|
@@ -1803,7 +2031,7 @@ export default class Defaults {
|
|
|
1803
2031
|
* @param {any} val
|
|
1804
2032
|
* @param {{ seriesIndex?: number, w?: any }} [ctx]
|
|
1805
2033
|
*/
|
|
1806
|
-
|
|
2034
|
+
const format = (val, ctx) => {
|
|
1807
2035
|
const barIndices = ctx?.w?.globals?.columnSeries?.i
|
|
1808
2036
|
const isBarLabel = barIndices
|
|
1809
2037
|
? barIndices.includes(ctx?.seriesIndex)
|
|
@@ -1811,31 +2039,97 @@ export default class Defaults {
|
|
|
1811
2039
|
if (isBarLabel) return percent(val)
|
|
1812
2040
|
return plain(val)
|
|
1813
2041
|
}
|
|
2042
|
+
// Marked, so a later stackType change can tell it from the user's.
|
|
2043
|
+
/** @type {any} */
|
|
2044
|
+
const marked = format
|
|
2045
|
+
marked[STACKED_100] = true
|
|
2046
|
+
opts.dataLabels.formatter = marked
|
|
1814
2047
|
return opts
|
|
1815
2048
|
}
|
|
1816
2049
|
|
|
1817
|
-
stackedBars() {
|
|
1818
|
-
const barDefaults = this.bar()
|
|
1819
|
-
return {
|
|
1820
|
-
...barDefaults,
|
|
1821
|
-
plotOptions: {
|
|
1822
|
-
...barDefaults.plotOptions,
|
|
1823
|
-
bar: {
|
|
1824
|
-
...barDefaults.plotOptions.bar,
|
|
1825
|
-
borderRadiusApplication: 'end',
|
|
1826
|
-
},
|
|
1827
|
-
},
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
// This function removes the left and right spacing in chart for line/area/scatter if xaxis type = category for those charts by converting xaxis = numeric. Numeric/Datetime xaxis prevents the unnecessary spacing in the left/right of the chart area
|
|
1832
2050
|
/**
|
|
2051
|
+
* Whether a category x axis is drawn as numbers, which removes the edge
|
|
2052
|
+
* spacing a line, area or scatter would otherwise get. Not for the types
|
|
2053
|
+
* that draw names along it (a horizontal bar, a heatmap) or have none.
|
|
2054
|
+
*
|
|
2055
|
+
* @param {string} chartType
|
|
1833
2056
|
* @param {Record<string, any>} opts
|
|
2057
|
+
* @param {Record<string, any>} chartDefaults
|
|
2058
|
+
* @returns {boolean}
|
|
1834
2059
|
*/
|
|
1835
|
-
|
|
1836
|
-
|
|
2060
|
+
static catToNumeric(chartType, opts, chartDefaults) {
|
|
2061
|
+
const isBarHorizontal =
|
|
2062
|
+
(chartType === 'bar' ||
|
|
2063
|
+
chartType === 'boxPlot' ||
|
|
2064
|
+
chartType === 'violin') &&
|
|
2065
|
+
opts.plotOptions?.bar?.horizontal
|
|
2066
|
+
|
|
2067
|
+
const unsupportedZoom =
|
|
2068
|
+
chartType === 'pie' ||
|
|
2069
|
+
chartType === 'polarArea' ||
|
|
2070
|
+
chartType === 'donut' ||
|
|
2071
|
+
chartType === 'radar' ||
|
|
2072
|
+
chartType === 'radialBar' ||
|
|
2073
|
+
chartType === 'heatmap' ||
|
|
2074
|
+
chartType === 'unit' ||
|
|
2075
|
+
chartType === 'sunburst' ||
|
|
2076
|
+
chartType === 'icicle'
|
|
2077
|
+
|
|
2078
|
+
// The type's own axis counts as much as the user's: a histogram asks for a
|
|
2079
|
+
// numeric axis through Defaults.histogram, not by writing it into opts.
|
|
2080
|
+
const xaxisType = opts.xaxis.type ?? chartDefaults.xaxis?.type
|
|
2081
|
+
|
|
2082
|
+
// Scatter jitter (strip plots) owns its own numeric band axis in
|
|
2083
|
+
// Data.expandScatterJitterData, so the auto category→numeric conversion
|
|
2084
|
+
// (and its default floor-based label formatter) must not run for it.
|
|
2085
|
+
const isScatterJitter =
|
|
2086
|
+
(chartType === 'scatter' || chartType === 'bubble') &&
|
|
2087
|
+
opts.plotOptions?.scatter?.jitter?.enabled
|
|
2088
|
+
|
|
2089
|
+
const tickPlacement =
|
|
2090
|
+
opts.xaxis.tickPlacement || chartDefaults.xaxis?.tickPlacement
|
|
2091
|
+
return (
|
|
2092
|
+
!isBarHorizontal &&
|
|
2093
|
+
!unsupportedZoom &&
|
|
2094
|
+
!isScatterJitter &&
|
|
2095
|
+
xaxisType !== 'datetime' &&
|
|
2096
|
+
xaxisType !== 'numeric' &&
|
|
2097
|
+
tickPlacement !== 'between'
|
|
2098
|
+
)
|
|
2099
|
+
}
|
|
1837
2100
|
|
|
1838
|
-
|
|
2101
|
+
/**
|
|
2102
|
+
* Re-decide the conversion after an update merged into the config: a type
|
|
2103
|
+
* or orientation change can move the chart to the other side of it. When it
|
|
2104
|
+
* turns off, the axis gets back what the conversion took (its names, type,
|
|
2105
|
+
* formatter and tick count); when it turns on, the next render converts.
|
|
2106
|
+
*
|
|
2107
|
+
* @param {Record<string, any>} config the merged w.config, mutated in place
|
|
2108
|
+
* @param {Record<string, any>} [options] this update's payload
|
|
2109
|
+
*/
|
|
2110
|
+
static syncCatToNumeric(config, options) {
|
|
2111
|
+
const x = config.xaxis
|
|
2112
|
+
const was = !!x.convertedCatToNumeric
|
|
2113
|
+
// A converted axis reads 'numeric' because the conversion wrote it.
|
|
2114
|
+
let asked = options?.xaxis?.type
|
|
2115
|
+
if (was && asked === 'numeric') asked = undefined
|
|
2116
|
+
const cd = Defaults.forType(config)
|
|
2117
|
+
const now = Defaults.catToNumeric(
|
|
2118
|
+
config.chart.type,
|
|
2119
|
+
{ ...config, xaxis: { ...x, type: was ? asked : x.type } },
|
|
2120
|
+
cd,
|
|
2121
|
+
)
|
|
2122
|
+
if (now === was) return
|
|
2123
|
+
x.convertedCatToNumeric = now
|
|
2124
|
+
if (now) return
|
|
2125
|
+
const f = x.labels.formatter
|
|
2126
|
+
const base = f?.baseFormatter || f
|
|
2127
|
+
x.labels.formatter = base === floorLabel ? undefined : base
|
|
2128
|
+
if (f?.categoryNames && !x.categories?.length) x.categories = f.categoryNames
|
|
2129
|
+
x.type = asked || cd.xaxis?.type || 'category'
|
|
2130
|
+
if (x.tickAmount === 'dataPoints' && !options?.xaxis?.tickAmount) {
|
|
2131
|
+
x.tickAmount = undefined
|
|
2132
|
+
}
|
|
1839
2133
|
}
|
|
1840
2134
|
|
|
1841
2135
|
/**
|
|
@@ -1845,16 +2139,12 @@ export default class Defaults {
|
|
|
1845
2139
|
convertCatToNumericXaxis(opts, cats) {
|
|
1846
2140
|
opts.xaxis.type = 'numeric'
|
|
1847
2141
|
opts.xaxis.labels = opts.xaxis.labels || {}
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
return Utils.isNumber(val) ? Math.floor(val) : val
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
const defaultFormatter = opts.xaxis.labels.formatter
|
|
2142
|
+
// Every parse converts again, and the formatter in the config is by then
|
|
2143
|
+
// the wrapper an earlier one installed. Wrapping that grew the chain by one
|
|
2144
|
+
// closure per render, so wrap the formatter it wrapped instead.
|
|
2145
|
+
opts.xaxis.labels.formatter = opts.xaxis.labels.formatter || floorLabel
|
|
2146
|
+
const current = /** @type {any} */ (opts.xaxis.labels.formatter)
|
|
2147
|
+
const defaultFormatter = current.baseFormatter || current
|
|
1858
2148
|
let labels =
|
|
1859
2149
|
opts.xaxis.categories && opts.xaxis.categories.length
|
|
1860
2150
|
? opts.xaxis.categories
|
|
@@ -1890,6 +2180,7 @@ export default class Defaults {
|
|
|
1890
2180
|
// (`categories` is emptied below). An update that brings a new
|
|
1891
2181
|
// formatter but no categories reads them back from here.
|
|
1892
2182
|
format.categoryNames = names
|
|
2183
|
+
format.baseFormatter = defaultFormatter
|
|
1893
2184
|
opts.xaxis.labels.formatter = format
|
|
1894
2185
|
}
|
|
1895
2186
|
|
|
@@ -2032,6 +2323,7 @@ export default class Defaults {
|
|
|
2032
2323
|
},
|
|
2033
2324
|
},
|
|
2034
2325
|
grid: {
|
|
2326
|
+
show: false,
|
|
2035
2327
|
padding: {
|
|
2036
2328
|
left: 0,
|
|
2037
2329
|
right: 0,
|
|
@@ -2477,8 +2769,10 @@ export default class Defaults {
|
|
|
2477
2769
|
`<div>${labels[1]}: <span class="value">` +
|
|
2478
2770
|
h +
|
|
2479
2771
|
'</span></div>' +
|
|
2480
|
-
(
|
|
2481
|
-
|
|
2772
|
+
// A median of 0 is a median: zero-centred data (residuals, deltas)
|
|
2773
|
+
// lost the row to a truthiness test. Candlesticks name no third row.
|
|
2774
|
+
(labels[2] && m != null && !Number.isNaN(m)
|
|
2775
|
+
? `<div>${labels[2]}:<span class="value">` + m + '</span></div>'
|
|
2482
2776
|
: '') +
|
|
2483
2777
|
`<div>${labels[3]}: <span class="value">` +
|
|
2484
2778
|
l +
|
|
@@ -33,7 +33,6 @@ export default class Globals {
|
|
|
33
33
|
gl.seriesXvalues = [] // x positions used by tooltip when x values are unequal
|
|
34
34
|
gl.seriesYvalues = [] // y positions used to identify which series the user hovered
|
|
35
35
|
gl.dataWasParsed = false
|
|
36
|
-
gl.originalSeries = null
|
|
37
36
|
gl.maxValsInArrayIndex = 0 // index of the series with the most data points
|
|
38
37
|
gl.yValueDecimal = 0 // decimal precision of y values (0 = integers only)
|
|
39
38
|
gl.allSeriesHasEqualX = true // false when series have differing x value sets
|
|
@@ -69,6 +68,10 @@ export default class Globals {
|
|
|
69
68
|
// an {x, y} series it kept a later plain-array series from being given
|
|
70
69
|
// index x values, and a line or area drew from an empty seriesX.
|
|
71
70
|
gl.dataFormatXNumeric = false
|
|
71
|
+
// Raised by the parse only for range data, so a rangeBar -> bar update
|
|
72
|
+
// kept clipping bars to the old range.
|
|
73
|
+
gl.isRangeData = false
|
|
74
|
+
gl.isRangeBar = false
|
|
72
75
|
gl.skipLastTimelinelabel = false
|
|
73
76
|
gl.skipFirstTimelinelabel = false
|
|
74
77
|
gl.isDataXYZ = false
|
|
@@ -113,6 +116,9 @@ export default class Globals {
|
|
|
113
116
|
// circle this render: set by the renderer, read by CircleTransition.
|
|
114
117
|
// Reset here so a render that draws no circle leaves none behind.
|
|
115
118
|
gl.circleGeometry = null
|
|
119
|
+
// Only Pie writes this, so a pie with outer labels switched to sunburst
|
|
120
|
+
// padded its auto height by the old band.
|
|
121
|
+
gl.pieExternalLabelMarginY = 0
|
|
116
122
|
// Note: formatter properties (xLabelFormatter, yLabelFormatters, etc.) live on
|
|
117
123
|
// w.formatters — not on gl. See Base.js for backward-compat shims.
|
|
118
124
|
|
|
@@ -138,8 +144,8 @@ export default class Globals {
|
|
|
138
144
|
gl.morphBatch = { pending: 0, onDone: null, series: new Map() }
|
|
139
145
|
|
|
140
146
|
// ── Caches (ephemeral — cleared so stale DOM refs/measurements don't persist) ──
|
|
141
|
-
|
|
142
|
-
|
|
147
|
+
// resizeTimer / selectionResizeTimer are persistent (see globalVars):
|
|
148
|
+
// nulling a live handle here left nothing able to cancel it.
|
|
143
149
|
gl.delayedElements = []
|
|
144
150
|
gl.pointsArray = []
|
|
145
151
|
gl.barCanvasCoords = null // Strata (#2): per-render bar/candle center cache (canvas tooltip position)
|
|
@@ -227,7 +233,6 @@ export default class Globals {
|
|
|
227
233
|
'barGroups',
|
|
228
234
|
'lineGroups',
|
|
229
235
|
'areaGroups',
|
|
230
|
-
'originalSeries',
|
|
231
236
|
'collapsedSeries',
|
|
232
237
|
'collapsedSeriesIndices',
|
|
233
238
|
'ancillaryCollapsedSeries',
|
|
@@ -413,6 +418,14 @@ export default class Globals {
|
|
|
413
418
|
radialNeedleRAF: null,
|
|
414
419
|
unitGatherRAF: null,
|
|
415
420
|
unitExitRAF: null,
|
|
421
|
+
// The gauge needle's last angle (the next tween starts there) and its
|
|
422
|
+
// tick fade-in timer, which Destroy.clear() clears.
|
|
423
|
+
radialNeedleAngle: undefined,
|
|
424
|
+
radialTickTimer: null,
|
|
425
|
+
// Debounce handles (container resize, selection-rect emit). Persistent
|
|
426
|
+
// so a re-render cannot orphan a pending one; Destroy.clear() clears them.
|
|
427
|
+
resizeTimer: null,
|
|
428
|
+
selectionResizeTimer: null,
|
|
416
429
|
stroke: { colors: [] },
|
|
417
430
|
dataLabels: { style: { colors: [] } },
|
|
418
431
|
radarPolygons: { fill: { colors: [] } },
|
|
@@ -434,7 +447,6 @@ export default class Globals {
|
|
|
434
447
|
|
|
435
448
|
// ── Chart-type flags (derived from config, set during Core.mount) ─────────
|
|
436
449
|
axisCharts: true, // false for pie/radial/treemap etc.
|
|
437
|
-
isSlopeChart: config.plotOptions.line.isSlopeChart,
|
|
438
450
|
comboCharts: false, // true when mixing line + column series
|
|
439
451
|
|
|
440
452
|
// ── Config snapshots (backups for zoom-reset / updateOptions) ────────────
|
|
@@ -445,6 +457,12 @@ export default class Globals {
|
|
|
445
457
|
// update it (see Theme.applyTokenChrome). Persistent: a re-render must
|
|
446
458
|
// not forget it.
|
|
447
459
|
tokenSurface: undefined,
|
|
460
|
+
// The tokens the last render applied to fore and grid, for the same
|
|
461
|
+
// reason (see Theme.applyTokenChrome).
|
|
462
|
+
tokenChrome: undefined,
|
|
463
|
+
// What the named theme (theme.name) wrote into config.theme, so a switch
|
|
464
|
+
// to another named theme can take it back (see Theme._applyNamedThemeMode).
|
|
465
|
+
namedThemeApplied: undefined,
|
|
448
466
|
lastXAxis: [],
|
|
449
467
|
lastYAxis: [],
|
|
450
468
|
|