highcharts 12.0.1 → 12.0.2
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/bower.json +1 -1
- package/es-modules/Core/Axis/Axis.js +1 -1
- package/es-modules/Core/Renderer/SVG/SVGElement.js +8 -2
- package/es-modules/Core/Renderer/SVG/TextBuilder.js +1 -1
- package/es-modules/Core/Tooltip.js +2 -1
- package/es-modules/Core/Utilities.js +53 -53
- package/es-modules/Extensions/Boost/WGLRenderer.js +12 -4
- package/es-modules/Extensions/Drilldown/Drilldown.js +3 -3
- package/es-modules/Series/Line/LineSeries.js +2 -4
- package/es-modules/Stock/RangeSelector/RangeSelector.js +1 -1
- package/es-modules/tsconfig.tsbuildinfo +1 -1
- package/highcharts-3d.js +2 -2
- package/highcharts-3d.src.js +5 -5
- package/highcharts-gantt.js +5 -5
- package/highcharts-gantt.src.js +30 -25
- package/highcharts-more.js +2 -2
- package/highcharts-more.src.js +5 -5
- package/highcharts.js +3 -3
- package/highcharts.src.js +24 -19
- package/highmaps.js +5 -5
- package/highmaps.src.js +27 -22
- package/highstock.js +5 -5
- package/highstock.src.js +30 -25
- package/indicators/acceleration-bands.js +2 -2
- package/indicators/acceleration-bands.src.js +5 -5
- package/indicators/accumulation-distribution.js +2 -2
- package/indicators/accumulation-distribution.src.js +5 -5
- package/indicators/ao.js +2 -2
- package/indicators/ao.src.js +5 -5
- package/indicators/apo.js +2 -2
- package/indicators/apo.src.js +5 -5
- package/indicators/aroon-oscillator.js +2 -2
- package/indicators/aroon-oscillator.src.js +5 -5
- package/indicators/aroon.js +2 -2
- package/indicators/aroon.src.js +5 -5
- package/indicators/atr.js +2 -2
- package/indicators/atr.src.js +5 -5
- package/indicators/bollinger-bands.js +2 -2
- package/indicators/bollinger-bands.src.js +5 -5
- package/indicators/cci.js +2 -2
- package/indicators/cci.src.js +5 -5
- package/indicators/chaikin.js +2 -2
- package/indicators/chaikin.src.js +5 -5
- package/indicators/cmf.js +2 -2
- package/indicators/cmf.src.js +5 -5
- package/indicators/cmo.js +2 -2
- package/indicators/cmo.src.js +5 -5
- package/indicators/dema.js +2 -2
- package/indicators/dema.src.js +5 -5
- package/indicators/disparity-index.js +2 -2
- package/indicators/disparity-index.src.js +5 -5
- package/indicators/dmi.js +2 -2
- package/indicators/dmi.src.js +5 -5
- package/indicators/dpo.js +2 -2
- package/indicators/dpo.src.js +5 -5
- package/indicators/ema.js +1 -1
- package/indicators/ema.src.js +4 -4
- package/indicators/ichimoku-kinko-hyo.js +2 -2
- package/indicators/ichimoku-kinko-hyo.src.js +5 -5
- package/indicators/indicators-all.js +2 -2
- package/indicators/indicators-all.src.js +5 -5
- package/indicators/indicators.js +2 -2
- package/indicators/indicators.src.js +5 -5
- package/indicators/keltner-channels.js +2 -2
- package/indicators/keltner-channels.src.js +5 -5
- package/indicators/klinger.js +2 -2
- package/indicators/klinger.src.js +5 -5
- package/indicators/macd.js +2 -2
- package/indicators/macd.src.js +5 -5
- package/indicators/mfi.js +2 -2
- package/indicators/mfi.src.js +5 -5
- package/indicators/momentum.js +2 -2
- package/indicators/momentum.src.js +5 -5
- package/indicators/natr.js +2 -2
- package/indicators/natr.src.js +5 -5
- package/indicators/obv.js +2 -2
- package/indicators/obv.src.js +5 -5
- package/indicators/pivot-points.js +2 -2
- package/indicators/pivot-points.src.js +5 -5
- package/indicators/ppo.js +2 -2
- package/indicators/ppo.src.js +5 -5
- package/indicators/price-channel.js +2 -2
- package/indicators/price-channel.src.js +5 -5
- package/indicators/price-envelopes.js +2 -2
- package/indicators/price-envelopes.src.js +5 -5
- package/indicators/psar.js +2 -2
- package/indicators/psar.src.js +5 -5
- package/indicators/regressions.js +2 -2
- package/indicators/regressions.src.js +5 -5
- package/indicators/roc.js +2 -2
- package/indicators/roc.src.js +5 -5
- package/indicators/rsi.js +2 -2
- package/indicators/rsi.src.js +5 -5
- package/indicators/slow-stochastic.js +2 -2
- package/indicators/slow-stochastic.src.js +5 -5
- package/indicators/stochastic.js +2 -2
- package/indicators/stochastic.src.js +5 -5
- package/indicators/supertrend.js +2 -2
- package/indicators/supertrend.src.js +5 -5
- package/indicators/tema.js +2 -2
- package/indicators/tema.src.js +5 -5
- package/indicators/trendline.js +2 -2
- package/indicators/trendline.src.js +5 -5
- package/indicators/trix.js +2 -2
- package/indicators/trix.src.js +5 -5
- package/indicators/volume-by-price.js +2 -2
- package/indicators/volume-by-price.src.js +5 -5
- package/indicators/vwap.js +2 -2
- package/indicators/vwap.src.js +5 -5
- package/indicators/williams-r.js +2 -2
- package/indicators/williams-r.src.js +5 -5
- package/indicators/wma.js +2 -2
- package/indicators/wma.src.js +5 -5
- package/indicators/zigzag.js +2 -2
- package/indicators/zigzag.src.js +5 -5
- package/modules/accessibility.js +2 -2
- package/modules/accessibility.src.js +5 -5
- package/modules/annotations-advanced.js +4 -4
- package/modules/annotations-advanced.src.js +8 -8
- package/modules/annotations.js +2 -2
- package/modules/annotations.src.js +7 -7
- package/modules/arc-diagram.js +2 -2
- package/modules/arc-diagram.src.js +5 -5
- package/modules/arrow-symbols.js +2 -2
- package/modules/arrow-symbols.src.js +5 -5
- package/modules/boost-canvas.js +2 -2
- package/modules/boost-canvas.src.js +21 -10
- package/modules/boost.js +2 -2
- package/modules/boost.src.js +21 -10
- package/modules/broken-axis.js +2 -2
- package/modules/broken-axis.src.js +5 -5
- package/modules/bullet.js +2 -2
- package/modules/bullet.src.js +5 -5
- package/modules/coloraxis.js +2 -2
- package/modules/coloraxis.src.js +5 -5
- package/modules/current-date-indicator.js +2 -2
- package/modules/current-date-indicator.src.js +5 -5
- package/modules/cylinder.js +2 -2
- package/modules/cylinder.src.js +5 -5
- package/modules/data-tools.js +2 -2
- package/modules/data-tools.src.js +5 -5
- package/modules/data.js +2 -2
- package/modules/data.src.js +5 -5
- package/modules/datagrouping.js +2 -2
- package/modules/datagrouping.src.js +5 -5
- package/modules/debugger.js +2 -2
- package/modules/debugger.src.js +5 -5
- package/modules/dependency-wheel.js +2 -2
- package/modules/dependency-wheel.src.js +5 -5
- package/modules/dotplot.js +2 -2
- package/modules/dotplot.src.js +5 -5
- package/modules/drag-panes.js +2 -2
- package/modules/drag-panes.src.js +5 -5
- package/modules/draggable-points.js +2 -2
- package/modules/draggable-points.src.js +5 -5
- package/modules/drilldown.js +2 -2
- package/modules/drilldown.src.js +8 -8
- package/modules/dumbbell.js +2 -2
- package/modules/dumbbell.src.js +5 -5
- package/modules/export-data.js +2 -2
- package/modules/export-data.src.js +5 -5
- package/modules/exporting.js +2 -2
- package/modules/exporting.src.js +5 -5
- package/modules/flowmap.js +2 -2
- package/modules/flowmap.src.js +5 -5
- package/modules/full-screen.js +2 -2
- package/modules/full-screen.src.js +5 -5
- package/modules/funnel.js +2 -2
- package/modules/funnel.src.js +5 -5
- package/modules/funnel3d.js +2 -2
- package/modules/funnel3d.src.js +5 -5
- package/modules/gantt.js +5 -5
- package/modules/gantt.src.js +9 -9
- package/modules/geoheatmap.js +2 -2
- package/modules/geoheatmap.src.js +5 -5
- package/modules/grid-axis.js +2 -2
- package/modules/grid-axis.src.js +5 -5
- package/modules/heatmap.js +3 -3
- package/modules/heatmap.src.js +6 -6
- package/modules/heikinashi.js +2 -2
- package/modules/heikinashi.src.js +5 -5
- package/modules/histogram-bellcurve.js +2 -2
- package/modules/histogram-bellcurve.src.js +5 -5
- package/modules/hollowcandlestick.js +2 -2
- package/modules/hollowcandlestick.src.js +5 -5
- package/modules/item-series.js +2 -2
- package/modules/item-series.src.js +5 -5
- package/modules/lollipop.js +2 -2
- package/modules/lollipop.src.js +5 -5
- package/modules/map.js +4 -4
- package/modules/map.src.js +6 -6
- package/modules/marker-clusters.js +2 -2
- package/modules/marker-clusters.src.js +5 -5
- package/modules/mouse-wheel-zoom.js +2 -2
- package/modules/mouse-wheel-zoom.src.js +5 -5
- package/modules/navigator.js +2 -2
- package/modules/navigator.src.js +5 -5
- package/modules/networkgraph.js +2 -2
- package/modules/networkgraph.src.js +5 -5
- package/modules/no-data-to-display.js +2 -2
- package/modules/no-data-to-display.src.js +5 -5
- package/modules/offline-exporting.js +2 -2
- package/modules/offline-exporting.src.js +6 -6
- package/modules/organization.js +2 -2
- package/modules/organization.src.js +5 -5
- package/modules/overlapping-datalabels.js +2 -2
- package/modules/overlapping-datalabels.src.js +5 -5
- package/modules/parallel-coordinates.js +2 -2
- package/modules/parallel-coordinates.src.js +5 -5
- package/modules/pareto.js +2 -2
- package/modules/pareto.src.js +5 -5
- package/modules/pathfinder.js +2 -2
- package/modules/pathfinder.src.js +5 -5
- package/modules/pattern-fill.js +2 -2
- package/modules/pattern-fill.src.js +5 -5
- package/modules/pictorial.js +2 -2
- package/modules/pictorial.src.js +5 -5
- package/modules/pointandfigure.js +2 -2
- package/modules/pointandfigure.src.js +5 -5
- package/modules/price-indicator.js +2 -2
- package/modules/price-indicator.src.js +5 -5
- package/modules/pyramid3d.js +2 -2
- package/modules/pyramid3d.src.js +5 -5
- package/modules/renko.js +2 -2
- package/modules/renko.src.js +5 -5
- package/modules/sankey.js +2 -2
- package/modules/sankey.src.js +5 -5
- package/modules/series-label.js +2 -2
- package/modules/series-label.src.js +5 -5
- package/modules/series-on-point.js +2 -2
- package/modules/series-on-point.src.js +5 -5
- package/modules/solid-gauge.js +2 -2
- package/modules/solid-gauge.src.js +5 -5
- package/modules/sonification.js +2 -2
- package/modules/sonification.src.js +5 -5
- package/modules/static-scale.js +2 -2
- package/modules/static-scale.src.js +5 -5
- package/modules/stock-tools.js +2 -2
- package/modules/stock-tools.src.js +7 -7
- package/modules/stock.js +5 -5
- package/modules/stock.src.js +9 -9
- package/modules/streamgraph.js +2 -2
- package/modules/streamgraph.src.js +5 -5
- package/modules/sunburst.js +2 -2
- package/modules/sunburst.src.js +5 -5
- package/modules/textpath.js +2 -2
- package/modules/textpath.src.js +5 -5
- package/modules/tiledwebmap.js +2 -2
- package/modules/tiledwebmap.src.js +5 -5
- package/modules/tilemap.js +2 -2
- package/modules/tilemap.src.js +5 -5
- package/modules/timeline.js +2 -2
- package/modules/timeline.src.js +5 -5
- package/modules/treegraph.js +2 -2
- package/modules/treegraph.src.js +5 -5
- package/modules/treegrid.js +2 -2
- package/modules/treegrid.src.js +5 -5
- package/modules/treemap.js +2 -2
- package/modules/treemap.src.js +5 -5
- package/modules/variable-pie.js +2 -2
- package/modules/variable-pie.src.js +5 -5
- package/modules/variwide.js +2 -2
- package/modules/variwide.src.js +5 -5
- package/modules/vector.js +2 -2
- package/modules/vector.src.js +5 -5
- package/modules/venn.js +2 -2
- package/modules/venn.src.js +5 -5
- package/modules/windbarb.js +2 -2
- package/modules/windbarb.src.js +5 -5
- package/modules/wordcloud.js +2 -2
- package/modules/wordcloud.src.js +5 -5
- package/modules/xrange.js +2 -2
- package/modules/xrange.src.js +5 -5
- package/package.json +1 -1
- package/standalone-navigator.js +3 -3
- package/standalone-navigator.src.js +25 -20
- package/themes/avocado.js +2 -2
- package/themes/avocado.src.js +5 -5
- package/themes/brand-dark.js +2 -2
- package/themes/brand-dark.src.js +5 -5
- package/themes/brand-light.js +2 -2
- package/themes/brand-light.src.js +5 -5
- package/themes/dark-blue.js +2 -2
- package/themes/dark-blue.src.js +5 -5
- package/themes/dark-green.js +2 -2
- package/themes/dark-green.src.js +5 -5
- package/themes/dark-unica.js +2 -2
- package/themes/dark-unica.src.js +5 -5
- package/themes/gray.js +2 -2
- package/themes/gray.src.js +5 -5
- package/themes/grid-light.js +2 -2
- package/themes/grid-light.src.js +5 -5
- package/themes/grid.js +2 -2
- package/themes/grid.src.js +5 -5
- package/themes/high-contrast-dark.js +2 -2
- package/themes/high-contrast-dark.src.js +5 -5
- package/themes/high-contrast-light.js +2 -2
- package/themes/high-contrast-light.src.js +5 -5
- package/themes/sand-signika.js +2 -2
- package/themes/sand-signika.src.js +5 -5
- package/themes/skies.js +2 -2
- package/themes/skies.src.js +5 -5
- package/themes/sunset.js +2 -2
- package/themes/sunset.src.js +5 -5
package/bower.json
CHANGED
|
@@ -556,7 +556,7 @@ class Axis {
|
|
|
556
556
|
* Pixel position of the value on the chart or axis.
|
|
557
557
|
*/
|
|
558
558
|
toPixels(value, paneCoordinates) {
|
|
559
|
-
return this.translate(this.chart
|
|
559
|
+
return this.translate(this.chart?.time.parse(value) ?? NaN, false, !this.horiz, void 0, true) + (paneCoordinates ? 0 : this.pos);
|
|
560
560
|
}
|
|
561
561
|
/**
|
|
562
562
|
* Translate a pixel position along the axis to a value in terms of axis
|
|
@@ -12,9 +12,9 @@ import A from '../../Animation/AnimationUtilities.js';
|
|
|
12
12
|
const { animate, animObject, stop } = A;
|
|
13
13
|
import Color from '../../Color/Color.js';
|
|
14
14
|
import H from '../../Globals.js';
|
|
15
|
-
const { deg2rad, doc, svg, SVG_NS, win } = H;
|
|
15
|
+
const { deg2rad, doc, svg, SVG_NS, win, isFirefox } = H;
|
|
16
16
|
import U from '../../Utilities.js';
|
|
17
|
-
const { addEvent, attr, createElement, crisp, css, defined, erase, extend, fireEvent, getAlignFactor, isArray, isFunction, isObject, isString, merge, objectEach, pick, pInt, pushUnique, replaceNested, syncTimeout, uniqueKey } = U;
|
|
17
|
+
const { addEvent, attr, createElement, crisp, css, defined, erase, extend, fireEvent, getAlignFactor, isArray, isFunction, isNumber, isObject, isString, merge, objectEach, pick, pInt, pushUnique, replaceNested, syncTimeout, uniqueKey } = U;
|
|
18
18
|
/* *
|
|
19
19
|
*
|
|
20
20
|
* Class
|
|
@@ -730,6 +730,12 @@ class SVGElement {
|
|
|
730
730
|
if (textWidth && (!svg && this.renderer.forExport)) {
|
|
731
731
|
delete styles.width;
|
|
732
732
|
}
|
|
733
|
+
const fontSize = isFirefox && styles.fontSize || null;
|
|
734
|
+
// Necessary in firefox to be able to set font-size, #22124
|
|
735
|
+
if (fontSize && (isNumber(fontSize) ||
|
|
736
|
+
/^\d+$/.test(fontSize))) {
|
|
737
|
+
styles.fontSize += 'px';
|
|
738
|
+
}
|
|
733
739
|
const stylesToApply = merge(styles);
|
|
734
740
|
if (elem.namespaceURI === this.SVG_NS) {
|
|
735
741
|
// These CSS properties are interpreted internally by the SVG
|
|
@@ -45,7 +45,7 @@ const { charts, doc, win } = H;
|
|
|
45
45
|
*
|
|
46
46
|
* @return {void}
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
function error(code, stop, chart, params) {
|
|
49
49
|
const severity = stop ? 'Highcharts error' : 'Highcharts warning';
|
|
50
50
|
if (code === 32) {
|
|
51
51
|
code = `${severity}: Deprecated member`;
|
|
@@ -103,7 +103,7 @@ export function error(code, stop, chart, params) {
|
|
|
103
103
|
* The merged object. If the first argument is true, the return is the
|
|
104
104
|
* same as the second argument.
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
function merge(extendOrSource, ...sources) {
|
|
107
107
|
let i, args = [extendOrSource, ...sources], ret = {};
|
|
108
108
|
const doCopy = function (copy, original) {
|
|
109
109
|
// An object is replacing a primitive
|
|
@@ -150,7 +150,7 @@ export function merge(extendOrSource, ...sources) {
|
|
|
150
150
|
* @param {number} max The upper threshold
|
|
151
151
|
* @return {number} Returns a number value within min and max.
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
function clamp(value, min, max) {
|
|
154
154
|
return value > min ? value < max ? value : max : min;
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
@@ -164,7 +164,7 @@ export function clamp(value, min, max) {
|
|
|
164
164
|
* is flipped (scaleY is -1)
|
|
165
165
|
* @return {number} The pixel position to use for a crisp display
|
|
166
166
|
*/
|
|
167
|
-
|
|
167
|
+
function crisp(value, lineWidth = 0, inverted) {
|
|
168
168
|
const mod = lineWidth % 2 / 2, inverter = inverted ? -1 : 1;
|
|
169
169
|
return (Math.round(value * inverter - mod) + mod) * inverter;
|
|
170
170
|
}
|
|
@@ -174,7 +174,7 @@ export function crisp(value, lineWidth = 0, inverted) {
|
|
|
174
174
|
* properties, or optionally return the old values of new properties.
|
|
175
175
|
* @private
|
|
176
176
|
*/
|
|
177
|
-
|
|
177
|
+
function diffObjects(newer, older, keepOlder, collectionsWithUpdate) {
|
|
178
178
|
const ret = {};
|
|
179
179
|
/**
|
|
180
180
|
* Recurse over a set of options and its current values, and store the
|
|
@@ -250,7 +250,7 @@ export function diffObjects(newer, older, keepOlder, collectionsWithUpdate) {
|
|
|
250
250
|
* @return {number}
|
|
251
251
|
* number
|
|
252
252
|
*/
|
|
253
|
-
|
|
253
|
+
function pInt(s, mag) {
|
|
254
254
|
return parseInt(s, mag || 10);
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
@@ -264,7 +264,7 @@ export function pInt(s, mag) {
|
|
|
264
264
|
* @return {boolean}
|
|
265
265
|
* True if the argument is a string.
|
|
266
266
|
*/
|
|
267
|
-
|
|
267
|
+
function isString(s) {
|
|
268
268
|
return typeof s === 'string';
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
@@ -278,7 +278,7 @@ export function isString(s) {
|
|
|
278
278
|
* @return {boolean}
|
|
279
279
|
* True if the argument is an array.
|
|
280
280
|
*/
|
|
281
|
-
|
|
281
|
+
function isArray(obj) {
|
|
282
282
|
const str = Object.prototype.toString.call(obj);
|
|
283
283
|
return str === '[object Array]' || str === '[object Array Iterator]';
|
|
284
284
|
}
|
|
@@ -296,7 +296,7 @@ export function isArray(obj) {
|
|
|
296
296
|
* @return {boolean}
|
|
297
297
|
* True if the argument is an object.
|
|
298
298
|
*/
|
|
299
|
-
|
|
299
|
+
function isObject(obj, strict) {
|
|
300
300
|
return (!!obj &&
|
|
301
301
|
typeof obj === 'object' &&
|
|
302
302
|
(!strict || !isArray(obj))); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
@@ -312,7 +312,7 @@ export function isObject(obj, strict) {
|
|
|
312
312
|
* @return {boolean}
|
|
313
313
|
* True if the argument is a HTML Element.
|
|
314
314
|
*/
|
|
315
|
-
|
|
315
|
+
function isDOMElement(obj) {
|
|
316
316
|
return isObject(obj) && typeof obj.nodeType === 'number';
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
@@ -326,7 +326,7 @@ export function isDOMElement(obj) {
|
|
|
326
326
|
* @return {boolean}
|
|
327
327
|
* True if the argument is a class.
|
|
328
328
|
*/
|
|
329
|
-
|
|
329
|
+
function isClass(obj) {
|
|
330
330
|
const c = obj && obj.constructor;
|
|
331
331
|
return !!(isObject(obj, true) &&
|
|
332
332
|
!isDOMElement(obj) &&
|
|
@@ -344,7 +344,7 @@ export function isClass(obj) {
|
|
|
344
344
|
* @return {boolean}
|
|
345
345
|
* True if the item is a finite number
|
|
346
346
|
*/
|
|
347
|
-
|
|
347
|
+
function isNumber(n) {
|
|
348
348
|
return typeof n === 'number' && !isNaN(n) && n < Infinity && n > -Infinity;
|
|
349
349
|
}
|
|
350
350
|
/**
|
|
@@ -360,7 +360,7 @@ export function isNumber(n) {
|
|
|
360
360
|
*
|
|
361
361
|
* @return {void}
|
|
362
362
|
*/
|
|
363
|
-
|
|
363
|
+
function erase(arr, item) {
|
|
364
364
|
let i = arr.length;
|
|
365
365
|
while (i--) {
|
|
366
366
|
if (arr[i] === item) {
|
|
@@ -383,7 +383,7 @@ export function erase(arr, item) {
|
|
|
383
383
|
* A collection of items, like `chart.series` or `xAxis.series`.
|
|
384
384
|
* @return {number} The index of the series in the collection.
|
|
385
385
|
*/
|
|
386
|
-
|
|
386
|
+
function insertItem(item, collection) {
|
|
387
387
|
const indexOption = item.options.index, length = collection.length;
|
|
388
388
|
let i;
|
|
389
389
|
for (
|
|
@@ -419,7 +419,7 @@ export function insertItem(item, collection) {
|
|
|
419
419
|
* @return {boolean}
|
|
420
420
|
* Returns true, if the item was not present and has been added.
|
|
421
421
|
*/
|
|
422
|
-
|
|
422
|
+
function pushUnique(array, item) {
|
|
423
423
|
return array.indexOf(item) < 0 && !!array.push(item);
|
|
424
424
|
}
|
|
425
425
|
/**
|
|
@@ -433,7 +433,7 @@ export function pushUnique(array, item) {
|
|
|
433
433
|
* @return {boolean}
|
|
434
434
|
* False if the object is null or undefined, otherwise true.
|
|
435
435
|
*/
|
|
436
|
-
|
|
436
|
+
function defined(obj) {
|
|
437
437
|
return typeof obj !== 'undefined' && obj !== null;
|
|
438
438
|
}
|
|
439
439
|
/**
|
|
@@ -459,7 +459,7 @@ export function defined(obj) {
|
|
|
459
459
|
* @return {string|null|undefined}
|
|
460
460
|
* When used as a getter, return the value.
|
|
461
461
|
*/
|
|
462
|
-
|
|
462
|
+
function attr(elem, keyOrAttribs, value) {
|
|
463
463
|
const isGetter = isString(keyOrAttribs) && !defined(value);
|
|
464
464
|
let ret;
|
|
465
465
|
const attrSingle = (value, key) => {
|
|
@@ -501,7 +501,7 @@ export function attr(elem, keyOrAttribs, value) {
|
|
|
501
501
|
* @return {Array}
|
|
502
502
|
* The produced or original array.
|
|
503
503
|
*/
|
|
504
|
-
|
|
504
|
+
function splat(obj) {
|
|
505
505
|
return isArray(obj) ? obj : [obj];
|
|
506
506
|
}
|
|
507
507
|
/**
|
|
@@ -523,7 +523,7 @@ export function splat(obj) {
|
|
|
523
523
|
* An identifier for the timeout that can later be cleared with
|
|
524
524
|
* Highcharts.clearTimeout. Returns -1 if there is no timeout.
|
|
525
525
|
*/
|
|
526
|
-
|
|
526
|
+
function syncTimeout(fn, delay, context) {
|
|
527
527
|
if (delay > 0) {
|
|
528
528
|
return setTimeout(fn, delay, context);
|
|
529
529
|
}
|
|
@@ -540,7 +540,7 @@ export function syncTimeout(fn, delay, context) {
|
|
|
540
540
|
* @param {number|undefined} id
|
|
541
541
|
* Id of a timeout.
|
|
542
542
|
*/
|
|
543
|
-
|
|
543
|
+
function internalClearTimeout(id) {
|
|
544
544
|
if (defined(id)) {
|
|
545
545
|
clearTimeout(id);
|
|
546
546
|
}
|
|
@@ -560,7 +560,7 @@ export function internalClearTimeout(id) {
|
|
|
560
560
|
* @return {T}
|
|
561
561
|
* Object a, the original object.
|
|
562
562
|
*/
|
|
563
|
-
|
|
563
|
+
function extend(a, b) {
|
|
564
564
|
/* eslint-enable valid-jsdoc */
|
|
565
565
|
let n;
|
|
566
566
|
if (!a) {
|
|
@@ -583,7 +583,7 @@ export function extend(a, b) {
|
|
|
583
583
|
* @return {T}
|
|
584
584
|
* The value of the first argument that is not null or undefined.
|
|
585
585
|
*/
|
|
586
|
-
|
|
586
|
+
function pick() {
|
|
587
587
|
const args = arguments;
|
|
588
588
|
const length = args.length;
|
|
589
589
|
for (let i = 0; i < length; i++) {
|
|
@@ -606,7 +606,7 @@ export function pick() {
|
|
|
606
606
|
*
|
|
607
607
|
* @return {void}
|
|
608
608
|
*/
|
|
609
|
-
|
|
609
|
+
function css(el, styles) {
|
|
610
610
|
extend(el.style, styles);
|
|
611
611
|
}
|
|
612
612
|
/**
|
|
@@ -632,7 +632,7 @@ export function css(el, styles) {
|
|
|
632
632
|
* @return {Highcharts.HTMLDOMElement}
|
|
633
633
|
* The created DOM element.
|
|
634
634
|
*/
|
|
635
|
-
|
|
635
|
+
function createElement(tag, attribs, styles, parent, nopad) {
|
|
636
636
|
const el = doc.createElement(tag);
|
|
637
637
|
if (attribs) {
|
|
638
638
|
extend(el, attribs);
|
|
@@ -665,7 +665,7 @@ export function createElement(tag, attribs, styles, parent, nopad) {
|
|
|
665
665
|
* @return {Highcharts.Class<T>}
|
|
666
666
|
* A new prototype.
|
|
667
667
|
*/
|
|
668
|
-
|
|
668
|
+
function extendClass(parent, members) {
|
|
669
669
|
const obj = (function () { });
|
|
670
670
|
obj.prototype = new parent(); // eslint-disable-line new-cap
|
|
671
671
|
extend(obj.prototype, members);
|
|
@@ -688,7 +688,7 @@ export function extendClass(parent, members) {
|
|
|
688
688
|
* @return {string}
|
|
689
689
|
* The padded string.
|
|
690
690
|
*/
|
|
691
|
-
|
|
691
|
+
function pad(number, length, padder) {
|
|
692
692
|
return new Array((length || 2) +
|
|
693
693
|
1 -
|
|
694
694
|
String(number)
|
|
@@ -713,7 +713,7 @@ export function pad(number, length, padder) {
|
|
|
713
713
|
* @return {number}
|
|
714
714
|
* The computed length.
|
|
715
715
|
*/
|
|
716
|
-
|
|
716
|
+
function relativeLength(value, base, offset) {
|
|
717
717
|
return (/%$/).test(value) ?
|
|
718
718
|
(base * parseFloat(value) / 100) + (offset || 0) :
|
|
719
719
|
parseFloat(value);
|
|
@@ -734,7 +734,7 @@ export function relativeLength(value, base, offset) {
|
|
|
734
734
|
* @return {string}
|
|
735
735
|
* Text with replacements.
|
|
736
736
|
*/
|
|
737
|
-
|
|
737
|
+
function replaceNested(text, ...replacements) {
|
|
738
738
|
let previous, replacement;
|
|
739
739
|
do {
|
|
740
740
|
previous = text;
|
|
@@ -761,7 +761,7 @@ export function replaceNested(text, ...replacements) {
|
|
|
761
761
|
* arguments as the original function, except that the original function
|
|
762
762
|
* is unshifted and passed as the first argument.
|
|
763
763
|
*/
|
|
764
|
-
|
|
764
|
+
function wrap(obj, method, func) {
|
|
765
765
|
const proceed = obj[method];
|
|
766
766
|
obj[method] = function () {
|
|
767
767
|
const outerArgs = arguments, scope = this;
|
|
@@ -783,7 +783,7 @@ export function wrap(obj, method, func) {
|
|
|
783
783
|
* @return {number}
|
|
784
784
|
* The magnitude, where 1-9 are magnitude 1, 10-99 magnitude 2 etc.
|
|
785
785
|
*/
|
|
786
|
-
|
|
786
|
+
function getMagnitude(num) {
|
|
787
787
|
return Math.pow(10, Math.floor(Math.log(num) / Math.LN10));
|
|
788
788
|
}
|
|
789
789
|
/**
|
|
@@ -815,7 +815,7 @@ export function getMagnitude(num) {
|
|
|
815
815
|
* Move this function to the Axis prototype. It is here only for historical
|
|
816
816
|
* reasons.
|
|
817
817
|
*/
|
|
818
|
-
|
|
818
|
+
function normalizeTickInterval(interval, multiples, magnitude, allowDecimals, hasTickAmount) {
|
|
819
819
|
let i, retInterval = interval;
|
|
820
820
|
// Round to a tenfold of 1, 2, 2.5 or 5
|
|
821
821
|
magnitude = pick(magnitude, getMagnitude(interval));
|
|
@@ -870,7 +870,7 @@ export function normalizeTickInterval(interval, multiples, magnitude, allowDecim
|
|
|
870
870
|
* @param {Function} sortFunction
|
|
871
871
|
* The function to sort it with, like with regular Array.prototype.sort.
|
|
872
872
|
*/
|
|
873
|
-
|
|
873
|
+
function stableSort(arr, sortFunction) {
|
|
874
874
|
// @todo It seems like Chrome since v70 sorts in a stable way internally,
|
|
875
875
|
// plus all other browsers do it, so over time we may be able to remove this
|
|
876
876
|
// function
|
|
@@ -902,7 +902,7 @@ export function stableSort(arr, sortFunction) {
|
|
|
902
902
|
* @return {number}
|
|
903
903
|
* The lowest number.
|
|
904
904
|
*/
|
|
905
|
-
|
|
905
|
+
function arrayMin(data) {
|
|
906
906
|
let i = data.length, min = data[0];
|
|
907
907
|
while (i--) {
|
|
908
908
|
if (data[i] < min) {
|
|
@@ -924,7 +924,7 @@ export function arrayMin(data) {
|
|
|
924
924
|
* @return {number}
|
|
925
925
|
* The highest number.
|
|
926
926
|
*/
|
|
927
|
-
|
|
927
|
+
function arrayMax(data) {
|
|
928
928
|
let i = data.length, max = data[0];
|
|
929
929
|
while (i--) {
|
|
930
930
|
if (data[i] > max) {
|
|
@@ -946,7 +946,7 @@ export function arrayMax(data) {
|
|
|
946
946
|
* @param {*} [except]
|
|
947
947
|
* Exception, do not destroy this property, only delete it.
|
|
948
948
|
*/
|
|
949
|
-
|
|
949
|
+
function destroyObjectProperties(obj, except, destructablesOnly) {
|
|
950
950
|
objectEach(obj, function (val, n) {
|
|
951
951
|
// If the object is non-null and destroy is defined
|
|
952
952
|
if (val !== except && val?.destroy) {
|
|
@@ -967,7 +967,7 @@ export function destroyObjectProperties(obj, except, destructablesOnly) {
|
|
|
967
967
|
* @param {Highcharts.HTMLDOMElement} element
|
|
968
968
|
* The HTML node to discard.
|
|
969
969
|
*/
|
|
970
|
-
|
|
970
|
+
function discardElement(element) {
|
|
971
971
|
if (element && element.parentElement) {
|
|
972
972
|
element.parentElement.removeChild(element);
|
|
973
973
|
}
|
|
@@ -986,7 +986,7 @@ export function discardElement(element) {
|
|
|
986
986
|
* @return {number}
|
|
987
987
|
* The corrected float number.
|
|
988
988
|
*/
|
|
989
|
-
|
|
989
|
+
function correctFloat(num, prec) {
|
|
990
990
|
// When the number is higher than 1e14 use the number (#16275)
|
|
991
991
|
return num > 1e14 ? num : parseFloat(num.toPrecision(prec || 14));
|
|
992
992
|
}
|
|
@@ -995,7 +995,7 @@ export function correctFloat(num, prec) {
|
|
|
995
995
|
*
|
|
996
996
|
* @ignore
|
|
997
997
|
*/
|
|
998
|
-
|
|
998
|
+
const timeUnits = {
|
|
999
999
|
millisecond: 1,
|
|
1000
1000
|
second: 1000,
|
|
1001
1001
|
minute: 60000,
|
|
@@ -1042,7 +1042,7 @@ const getAlignFactor = (align = '') => ({
|
|
|
1042
1042
|
* @return {number | undefined}
|
|
1043
1043
|
* The closest distance between values
|
|
1044
1044
|
*/
|
|
1045
|
-
|
|
1045
|
+
function getClosestDistance(arrays, onError) {
|
|
1046
1046
|
const allowNegative = !onError;
|
|
1047
1047
|
let closest, loopLength, distance, i;
|
|
1048
1048
|
arrays.forEach((xData) => {
|
|
@@ -1078,7 +1078,7 @@ export function getClosestDistance(arrays, onError) {
|
|
|
1078
1078
|
* @return {unknown}
|
|
1079
1079
|
* The unknown property value.
|
|
1080
1080
|
*/
|
|
1081
|
-
|
|
1081
|
+
function getNestedProperty(path, parent) {
|
|
1082
1082
|
const pathElements = path.split('.');
|
|
1083
1083
|
while (pathElements.length && defined(parent)) {
|
|
1084
1084
|
const pathElement = pathElements.shift();
|
|
@@ -1126,7 +1126,7 @@ export function getNestedProperty(path, parent) {
|
|
|
1126
1126
|
* @return {number|string|undefined}
|
|
1127
1127
|
* The style value.
|
|
1128
1128
|
*/
|
|
1129
|
-
|
|
1129
|
+
function getStyle(el, prop, toInt) {
|
|
1130
1130
|
let style;
|
|
1131
1131
|
// For width and height, return the actual inner pixel size (#4913)
|
|
1132
1132
|
if (prop === 'width') {
|
|
@@ -1179,7 +1179,7 @@ export function getStyle(el, prop, toInt) {
|
|
|
1179
1179
|
* @return {T|undefined}
|
|
1180
1180
|
* The value of the element.
|
|
1181
1181
|
*/
|
|
1182
|
-
|
|
1182
|
+
const find = Array.prototype.find ?
|
|
1183
1183
|
function (arr, callback) {
|
|
1184
1184
|
return arr.find(callback);
|
|
1185
1185
|
} :
|
|
@@ -1205,7 +1205,7 @@ export const find = Array.prototype.find ?
|
|
|
1205
1205
|
* An object containing `left` and `top` properties for the position in
|
|
1206
1206
|
* the page.
|
|
1207
1207
|
*/
|
|
1208
|
-
|
|
1208
|
+
function offset(el) {
|
|
1209
1209
|
const docElem = doc.documentElement, box = (el.parentElement || el.parentNode) ?
|
|
1210
1210
|
el.getBoundingClientRect() :
|
|
1211
1211
|
{ top: 0, left: 0, width: 0, height: 0 };
|
|
@@ -1236,7 +1236,7 @@ export function offset(el) {
|
|
|
1236
1236
|
* @param {T} [ctx]
|
|
1237
1237
|
* The context.
|
|
1238
1238
|
*/
|
|
1239
|
-
|
|
1239
|
+
function objectEach(obj, fn, ctx) {
|
|
1240
1240
|
/* eslint-enable valid-jsdoc */
|
|
1241
1241
|
for (const key in obj) {
|
|
1242
1242
|
if (Object.hasOwnProperty.call(obj, key)) {
|
|
@@ -1269,7 +1269,7 @@ export function objectEach(obj, fn, ctx) {
|
|
|
1269
1269
|
* @return {Function}
|
|
1270
1270
|
* A callback function to remove the added event.
|
|
1271
1271
|
*/
|
|
1272
|
-
|
|
1272
|
+
function addEvent(el, type, fn, options = {}) {
|
|
1273
1273
|
/* eslint-enable valid-jsdoc */
|
|
1274
1274
|
// Add hcEvents to either the prototype (in case we're running addEvent on a
|
|
1275
1275
|
// class) or the instance. If hasOwnProperty('hcEvents') is false, it is
|
|
@@ -1333,7 +1333,7 @@ export function addEvent(el, type, fn, options = {}) {
|
|
|
1333
1333
|
*
|
|
1334
1334
|
* @return {void}
|
|
1335
1335
|
*/
|
|
1336
|
-
|
|
1336
|
+
function removeEvent(el, type, fn) {
|
|
1337
1337
|
/* eslint-enable valid-jsdoc */
|
|
1338
1338
|
/**
|
|
1339
1339
|
* @private
|
|
@@ -1413,7 +1413,7 @@ export function removeEvent(el, type, fn) {
|
|
|
1413
1413
|
*
|
|
1414
1414
|
* @return {void}
|
|
1415
1415
|
*/
|
|
1416
|
-
|
|
1416
|
+
function fireEvent(el, type, eventArguments, defaultFunction) {
|
|
1417
1417
|
/* eslint-enable valid-jsdoc */
|
|
1418
1418
|
eventArguments = eventArguments || {};
|
|
1419
1419
|
if (doc.createEvent &&
|
|
@@ -1485,7 +1485,7 @@ export function fireEvent(el, type, eventArguments, defaultFunction) {
|
|
|
1485
1485
|
defaultFunction.call(el, eventArguments);
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
|
-
|
|
1488
|
+
let serialMode;
|
|
1489
1489
|
/**
|
|
1490
1490
|
* Get a unique key for using in internal element id's and pointers. The key is
|
|
1491
1491
|
* composed of a random hash specific to this Highcharts instance, and a
|
|
@@ -1499,7 +1499,7 @@ export let serialMode;
|
|
|
1499
1499
|
* @return {string}
|
|
1500
1500
|
* A unique key.
|
|
1501
1501
|
*/
|
|
1502
|
-
|
|
1502
|
+
const uniqueKey = (function () {
|
|
1503
1503
|
const hash = Math.random().toString(36).substring(2, 9) + '-';
|
|
1504
1504
|
let id = 0;
|
|
1505
1505
|
return function () {
|
|
@@ -1530,13 +1530,13 @@ export const uniqueKey = (function () {
|
|
|
1530
1530
|
* @return {boolean|undefined}
|
|
1531
1531
|
* State of the serial mode.
|
|
1532
1532
|
*/
|
|
1533
|
-
|
|
1533
|
+
function useSerialIds(mode) {
|
|
1534
1534
|
return (serialMode = pick(mode, serialMode));
|
|
1535
1535
|
}
|
|
1536
|
-
|
|
1536
|
+
function isFunction(obj) {
|
|
1537
1537
|
return typeof obj === 'function';
|
|
1538
1538
|
}
|
|
1539
|
-
|
|
1539
|
+
function ucfirst(s) {
|
|
1540
1540
|
return ((isString(s) ?
|
|
1541
1541
|
s.substring(0, 1).toUpperCase() + s.substring(1) :
|
|
1542
1542
|
String(s)));
|
|
@@ -1604,7 +1604,7 @@ if (win.jQuery) {
|
|
|
1604
1604
|
*
|
|
1605
1605
|
* */
|
|
1606
1606
|
// TODO use named exports when supported.
|
|
1607
|
-
|
|
1607
|
+
const Utilities = {
|
|
1608
1608
|
addEvent,
|
|
1609
1609
|
arrayMax,
|
|
1610
1610
|
arrayMin,
|
|
@@ -117,7 +117,10 @@ class WGLRenderer {
|
|
|
117
117
|
*
|
|
118
118
|
* */
|
|
119
119
|
constructor(postRenderCallback) {
|
|
120
|
-
|
|
120
|
+
/**
|
|
121
|
+
* The data to render - array of coordinates.
|
|
122
|
+
* Repeating sequence of [x, y, checkThreshold, pointSize].
|
|
123
|
+
*/
|
|
121
124
|
this.data = [];
|
|
122
125
|
// Height of our viewport in pixels
|
|
123
126
|
this.height = 0;
|
|
@@ -541,6 +544,10 @@ class WGLRenderer {
|
|
|
541
544
|
typeof yMax !== 'undefined') {
|
|
542
545
|
isYInside = y >= yMin && y <= yMax;
|
|
543
546
|
}
|
|
547
|
+
// Do not render points outside the zoomed range (#19701)
|
|
548
|
+
if (!sorted && !isYInside) {
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
544
551
|
if (x > xMax && closestRight.x < xMax) {
|
|
545
552
|
closestRight.x = x;
|
|
546
553
|
closestRight.y = y;
|
|
@@ -559,9 +566,10 @@ class WGLRenderer {
|
|
|
559
566
|
}
|
|
560
567
|
// The first point before and first after extremes should be
|
|
561
568
|
// rendered (#9962, 19701)
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
(px <= xMax || x <= xMax))
|
|
569
|
+
// Make sure series with a single point are rendered (#21897)
|
|
570
|
+
if (sorted && ((nx >= xMin || x >= xMin) &&
|
|
571
|
+
(px <= xMax || x <= xMax)) ||
|
|
572
|
+
!sorted && ((x >= xMin) && (x <= xMax))) {
|
|
565
573
|
isXInside = true;
|
|
566
574
|
}
|
|
567
575
|
if (!isXInside && !nextInside && !prevInside) {
|
|
@@ -217,7 +217,7 @@ class ChartAdditions {
|
|
|
217
217
|
const chart = (this.chart ||
|
|
218
218
|
this), oldSeries = point.series, xAxis = oldSeries.xAxis, yAxis = oldSeries.yAxis, colorProp = chart.styledMode ?
|
|
219
219
|
{ colorIndex: pick(point.colorIndex, oldSeries.colorIndex) } :
|
|
220
|
-
{ color: point.color || oldSeries.color }, levelNumber = oldSeries.options._levelNumber || 0
|
|
220
|
+
{ color: point.color || oldSeries.color }, levelNumber = oldSeries.options._levelNumber || 0;
|
|
221
221
|
if (!chart.drilldownLevels) {
|
|
222
222
|
chart.drilldownLevels = [];
|
|
223
223
|
}
|
|
@@ -268,8 +268,8 @@ class ChartAdditions {
|
|
|
268
268
|
Color.parse(colorProp.color).setOpacity(0).get() :
|
|
269
269
|
colorProp.color,
|
|
270
270
|
lowerSeriesOptions: ddOptions,
|
|
271
|
-
pointOptions:
|
|
272
|
-
pointIndex:
|
|
271
|
+
pointOptions: point.options,
|
|
272
|
+
pointIndex: point.index,
|
|
273
273
|
oldExtremes: {
|
|
274
274
|
xMin: xAxis && xAxis.userMin,
|
|
275
275
|
xMax: xAxis && xAxis.userMax,
|
|
@@ -90,10 +90,8 @@ class LineSeries extends Series {
|
|
|
90
90
|
attribs['stroke-linejoin'] = 'round';
|
|
91
91
|
}
|
|
92
92
|
graph[verb](attribs)
|
|
93
|
-
// Add shadow to normal series
|
|
94
|
-
|
|
95
|
-
.shadow((i < 2) &&
|
|
96
|
-
options.shadow &&
|
|
93
|
+
// Add shadow to normal series as well as zones
|
|
94
|
+
.shadow(options.shadow &&
|
|
97
95
|
// If shadow is defined, call function with
|
|
98
96
|
// `filterUnits: 'userSpaceOnUse'` to avoid known
|
|
99
97
|
// SVG filter bug (#19093)
|
|
@@ -1065,8 +1065,8 @@ class RangeSelector {
|
|
|
1065
1065
|
}, true, chart.spacingBox);
|
|
1066
1066
|
// Skip animation
|
|
1067
1067
|
inputGroup.placed = chart.hasLoaded;
|
|
1068
|
-
this.handleCollision(xOffsetForExportButton);
|
|
1069
1068
|
}
|
|
1069
|
+
this.handleCollision(xOffsetForExportButton);
|
|
1070
1070
|
// Vertical align
|
|
1071
1071
|
group.align({
|
|
1072
1072
|
verticalAlign
|