Skip to content

Commit 9ed30d2

Browse files
committed
v10.3.2
1 parent bf44896 commit 9ed30d2

File tree

625 files changed

+11574
-58323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

625 files changed

+11574
-58323
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "highcharts",
3-
"version": "10.3.1",
3+
"version": "10.3.2",
44
"main": "highcharts.js",
55
"license": "https://www.highcharts.com/license",
66
"types": "highcharts.d.ts"

es-modules/Accessibility/Accessibility.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ var Accessibility = /** @class */ (function () {
323323
/**
324324
* @private
325325
*/
326-
function compose(AxisClass, ChartClass, LegendClass, PointClass, SeriesClass, SVGElementClass, RangeSelectorClass) {
326+
function compose(ChartClass, LegendClass, PointClass, SeriesClass, SVGElementClass, RangeSelectorClass) {
327327
// ordered:
328328
KeyboardNavigation.compose(ChartClass);
329329
NewDataAnnouncer.compose(SeriesClass);

es-modules/Accessibility/Components/ZoomComponent.js

+26-32
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ var __extends = (this && this.__extends) || (function () {
2828
import AccessibilityComponent from '../AccessibilityComponent.js';
2929
import CU from '../Utils/ChartUtilities.js';
3030
var unhideChartElementFromAT = CU.unhideChartElementFromAT;
31+
import HU from '../Utils/HTMLUtilities.js';
32+
var getFakeMouseEvent = HU.getFakeMouseEvent;
3133
import KeyboardNavigationHandler from '../KeyboardNavigationHandler.js';
3234
import U from '../../Core/Utilities.js';
3335
var attr = U.attr, pick = U.pick;
@@ -36,33 +38,11 @@ var attr = U.attr, pick = U.pick;
3638
* Functions
3739
*
3840
* */
39-
/**
40-
* Pan along axis in a direction (1 or -1), optionally with a defined
41-
* granularity (number of steps it takes to walk across current view)
42-
* @private
43-
*/
44-
function axisPanStep(axis, direction, granularity) {
45-
var gran = granularity || 3;
46-
var extremes = axis.getExtremes();
47-
var step = (extremes.max - extremes.min) / gran * direction;
48-
var newMax = extremes.max + step;
49-
var newMin = extremes.min + step;
50-
var size = newMax - newMin;
51-
if (direction < 0 && newMin < extremes.dataMin) {
52-
newMin = extremes.dataMin;
53-
newMax = newMin + size;
54-
}
55-
else if (direction > 0 && newMax > extremes.dataMax) {
56-
newMax = extremes.dataMax;
57-
newMin = newMax - size;
58-
}
59-
axis.setExtremes(newMin, newMax);
60-
}
6141
/**
6242
* @private
6343
*/
6444
function chartHasMapZoom(chart) {
65-
return !!((chart.mapZoom) &&
45+
return !!((chart.mapView) &&
6646
chart.mapNavigation &&
6747
chart.mapNavigation.navButtons.length);
6848
}
@@ -213,16 +193,27 @@ var ZoomComponent = /** @class */ (function (_super) {
213193
});
214194
};
215195
/**
196+
* Arrow key panning for maps.
216197
* @private
217-
* @param {Highcharts.KeyboardNavigationHandler} keyboardNavigationHandler
218-
* @param {number} keyCode
198+
* @param {Highcharts.KeyboardNavigationHandler} keyboardNavigationHandler The handler context.
199+
* @param {number} keyCode Key pressed.
219200
* @return {number} Response code
220201
*/
221202
ZoomComponent.prototype.onMapKbdArrow = function (keyboardNavigationHandler, keyCode) {
222-
var keys = this.keyCodes, panAxis = (keyCode === keys.up || keyCode === keys.down) ?
223-
'yAxis' : 'xAxis', stepDirection = (keyCode === keys.left || keyCode === keys.up) ?
224-
-1 : 1;
225-
axisPanStep(this.chart[panAxis][0], stepDirection);
203+
var chart = this.chart, keys = this.keyCodes, target = chart.container, isY = keyCode === keys.up || keyCode === keys.down, stepDirection = (keyCode === keys.left || keyCode === keys.up) ?
204+
1 : -1, granularity = 10, diff = (isY ? chart.plotHeight : chart.plotWidth) /
205+
granularity * stepDirection,
206+
// Randomize since same mousedown coords twice is ignored in MapView
207+
r = Math.random() * 10, startPos = {
208+
x: target.offsetLeft + chart.plotLeft + chart.plotWidth / 2 + r,
209+
y: target.offsetTop + chart.plotTop + chart.plotHeight / 2 + r
210+
}, endPos = isY ? { x: startPos.x, y: startPos.y + diff } :
211+
{ x: startPos.x + diff, y: startPos.y };
212+
[
213+
getFakeMouseEvent('mousedown', startPos),
214+
getFakeMouseEvent('mousemove', endPos),
215+
getFakeMouseEvent('mouseup', endPos)
216+
].forEach(function (e) { return target.dispatchEvent(e); });
226217
return keyboardNavigationHandler.response.success;
227218
};
228219
/**
@@ -240,7 +231,9 @@ var ZoomComponent = /** @class */ (function (_super) {
240231
// Deselect old
241232
chart.mapNavigation.navButtons[this.focusedMapNavButtonIx].setState(0);
242233
if (isMoveOutOfRange) {
243-
chart.mapZoom(); // Reset zoom
234+
if (chart.mapView) {
235+
chart.mapView.zoomBy(); // Reset zoom
236+
}
244237
return response[isBackwards ? 'prev' : 'next'];
245238
}
246239
// Select other button
@@ -251,12 +244,13 @@ var ZoomComponent = /** @class */ (function (_super) {
251244
return response.success;
252245
};
253246
/**
247+
* Called on map button click.
254248
* @private
255-
* @param {Highcharts.KeyboardNavigationHandler} keyboardNavigationHandler
249+
* @param {Highcharts.KeyboardNavigationHandler} keyboardNavigationHandler The handler context object
256250
* @return {number} Response code
257251
*/
258252
ZoomComponent.prototype.onMapKbdClick = function (keyboardNavigationHandler) {
259-
var el = this.chart.mapNavButtons[this.focusedMapNavButtonIx].element;
253+
var el = this.chart.mapNavigation.navButtons[this.focusedMapNavButtonIx].element;
260254
this.fakeClickEvent(el);
261255
return keyboardNavigationHandler.response.success;
262256
};

es-modules/Accessibility/KeyboardNavigation.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import U from '../Core/Utilities.js';
1717
var addEvent = U.addEvent, fireEvent = U.fireEvent;
1818
import EventProvider from './Utils/EventProvider.js';
1919
import HTMLUtilities from './Utils/HTMLUtilities.js';
20-
var getElement = HTMLUtilities.getElement;
20+
var getElement = HTMLUtilities.getElement, simulatedEventTarget = HTMLUtilities.simulatedEventTarget;
2121
/* *
2222
*
2323
* Class
@@ -83,7 +83,7 @@ var KeyboardNavigation = /** @class */ (function () {
8383
ep.addEvent(this.tabindexContainer, 'keydown', function (e) { return _this.onKeydown(e); });
8484
ep.addEvent(this.tabindexContainer, 'focus', function (e) { return _this.onFocus(e); });
8585
['mouseup', 'touchend'].forEach(function (eventName) {
86-
return ep.addEvent(doc, eventName, function () { return _this.onMouseUp(); });
86+
return ep.addEvent(doc, eventName, function (e) { return _this.onMouseUp(e); });
8787
});
8888
['mousedown', 'touchstart'].forEach(function (eventName) {
8989
return ep.addEvent(chart.renderTo, eventName, function () {
@@ -209,9 +209,10 @@ var KeyboardNavigation = /** @class */ (function () {
209209
* indicator.
210210
* @private
211211
*/
212-
KeyboardNavigation.prototype.onMouseUp = function () {
212+
KeyboardNavigation.prototype.onMouseUp = function (e) {
213213
delete this.isClickingChart;
214-
if (!this.keyboardReset) {
214+
if (!this.keyboardReset &&
215+
e.relatedTarget !== simulatedEventTarget) {
215216
var chart = this.chart;
216217
if (!this.pointerIsOverChart) {
217218
var curMod = this.modules &&

es-modules/Accessibility/Utils/HTMLUtilities.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ import H from '../../Core/Globals.js';
1414
var doc = H.doc, win = H.win;
1515
import U from '../../Core/Utilities.js';
1616
var css = U.css;
17+
/* *
18+
*
19+
* Constants
20+
*
21+
* */
22+
var simulatedEventTarget = win.EventTarget && new win.EventTarget() || 'none';
1723
/* *
1824
*
1925
* Functions
@@ -133,10 +139,12 @@ function getElement(id) {
133139
return doc.getElementById(id);
134140
}
135141
/**
136-
* Get a fake mouse event of a given type
142+
* Get a fake mouse event of a given type. If relatedTarget is not given,
143+
* it will point to simulatedEventTarget, as an indicator that the event
144+
* is fake.
137145
* @private
138146
*/
139-
function getFakeMouseEvent(type, position) {
147+
function getFakeMouseEvent(type, position, relatedTarget) {
140148
var pos = position || {
141149
x: 0,
142150
y: 0
@@ -146,6 +154,9 @@ function getFakeMouseEvent(type, position) {
146154
bubbles: true,
147155
cancelable: true,
148156
composed: true,
157+
button: 0,
158+
buttons: 1,
159+
relatedTarget: relatedTarget || simulatedEventTarget,
149160
view: win,
150161
detail: type === 'click' ? 1 : 0,
151162
screenX: pos.x,
@@ -299,6 +310,7 @@ var HTMLUtilities = {
299310
removeClass: removeClass,
300311
removeElement: removeElement,
301312
reverseChildNodes: reverseChildNodes,
313+
simulatedEventTarget: simulatedEventTarget,
302314
stripHTMLTagsFromString: stripHTMLTagsFromString,
303315
visuallyHideElement: visuallyHideElement
304316
};

es-modules/Core/Axis/Stacking/StackingAxis.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,14 @@ function seriesSetGroupedPoints() {
182182
* @function Highcharts.Series#setStackedPoints
183183
*/
184184
function seriesSetStackedPoints(stackingParam) {
185-
var stacking = stackingParam || this.options.stacking;
185+
var chart = this.chart, stacking = stackingParam || this.options.stacking;
186186
if (!stacking || (this.visible !== true &&
187-
this.chart.options.chart.ignoreHiddenSeries !== false)) {
187+
chart.options.chart.ignoreHiddenSeries !== false)) {
188188
return;
189189
}
190-
var series = this, xData = series.processedXData, yData = series.processedYData, stackedYData = [], yDataLength = yData.length, seriesOptions = series.options, threshold = seriesOptions.threshold, stackThreshold = pick(seriesOptions.startFromThreshold && threshold, 0), stackOption = seriesOptions.stack, stackKey = stackingParam ? "".concat(series.type, ",").concat(stacking) : series.stackKey, negKey = '-' + stackKey, negStacks = series.negStacks, yAxis = series.yAxis, stacks = yAxis.stacking.stacks, oldStacks = yAxis.stacking.oldStacks;
190+
var series = this, xData = series.processedXData, yData = series.processedYData, stackedYData = [], yDataLength = yData.length, seriesOptions = series.options, threshold = seriesOptions.threshold, stackThreshold = pick(seriesOptions.startFromThreshold && threshold, 0), stackOption = seriesOptions.stack, stackKey = stackingParam ? "".concat(series.type, ",").concat(stacking) : series.stackKey, negKey = '-' + stackKey, negStacks = series.negStacks, yAxis = stacking === 'group' ?
191+
chart.yAxis[0] :
192+
series.yAxis, stacks = yAxis.stacking.stacks, oldStacks = yAxis.stacking.oldStacks;
191193
var stackIndicator, isNegative, stack, other, key, pointKey, i, x, y;
192194
yAxis.stacking.stacksTouched += 1;
193195
// loop over the non-null y values and read them into a local array

es-modules/Core/Axis/WaterfallAxis.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,23 @@ var WaterfallAxis;
5858
* @function Highcharts.Axis#renderWaterfallStackTotals
5959
*/
6060
Composition.prototype.renderStackTotals = function () {
61-
var yAxis = this.axis, waterfallStacks = yAxis.waterfall.stacks, stackTotalGroup = (yAxis.stacking && yAxis.stacking.stackTotalGroup), dummyStackItem = new StackItem(yAxis, yAxis.options.stackLabels, false, 0, void 0);
61+
var yAxis = this.axis, waterfallStacks = yAxis.waterfall.stacks, stackTotalGroup = (yAxis.stacking && yAxis.stacking.stackTotalGroup), dummyStackItem = new StackItem(yAxis, yAxis.options.stackLabels || {}, false, 0, void 0);
6262
this.dummyStackItem = dummyStackItem;
6363
// Render each waterfall stack total
64-
objectEach(waterfallStacks, function (type) {
65-
objectEach(type, function (stackItem) {
66-
dummyStackItem.total = stackItem.stackTotal;
67-
if (stackItem.label) {
68-
dummyStackItem.label = stackItem.label;
69-
}
70-
StackItem.prototype.render.call(dummyStackItem, stackTotalGroup);
71-
stackItem.label = dummyStackItem.label;
72-
delete dummyStackItem.label;
64+
if (stackTotalGroup) {
65+
objectEach(waterfallStacks, function (type) {
66+
objectEach(type, function (stackItem, key) {
67+
dummyStackItem.total = stackItem.stackTotal;
68+
dummyStackItem.x = +key;
69+
if (stackItem.label) {
70+
dummyStackItem.label = stackItem.label;
71+
}
72+
StackItem.prototype.render.call(dummyStackItem, stackTotalGroup);
73+
stackItem.label = dummyStackItem.label;
74+
delete dummyStackItem.label;
75+
});
7376
});
74-
});
77+
}
7578
dummyStackItem.total = null;
7679
};
7780
return Composition;

es-modules/Core/Chart/Chart.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,9 @@ var Chart = /** @class */ (function () {
19671967
// Make chart behave as an image with the title as alt text
19681968
this.renderer.boxWrapper.attr({
19691969
role: 'img',
1970-
'aria-label': (title && title.element.textContent) || ''
1970+
'aria-label': ((title && title.element.textContent) || ''
1971+
// #17753, < is not allowed in SVG attributes
1972+
).replace(/</g, '&lt;')
19711973
});
19721974
if (!(options.accessibility && options.accessibility.enabled === false)) {
19731975
error('Highcharts warning: Consider including the ' +

es-modules/Core/Chart/ChartDefaults.js

+2
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ var ChartDefaults = {
851851
* Additional CSS styles to apply inline to the container `div`. Note
852852
* that since the default font styles are applied in the renderer, it
853853
* is ignorant of the individual chart options and must be set globally.
854+
* Also note that changing the font size in the `chart.style` options only
855+
* applies to those elements that do not have a specific `fontSize` setting.
854856
*
855857
* @see In styled mode, general chart styles can be set with the
856858
* `.highcharts-root` class.

es-modules/Core/Globals.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var Globals;
2424
* Constants
2525
*
2626
* */
27-
Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '10.3.1', Globals.win = (typeof window !== 'undefined' ?
27+
Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '10.3.2', Globals.win = (typeof window !== 'undefined' ?
2828
window :
2929
{}), // eslint-disable-line node/no-unsupported-features/es-builtins
3030
Globals.doc = Globals.win.document, Globals.svg = (Globals.doc &&

es-modules/Core/Pointer.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ var Pointer = /** @class */ (function () {
11691169
* @emits Highcharts.Point#event:mouseOut
11701170
* @emits Highcharts.Point#event:mouseOver
11711171
*/
1172-
Pointer.prototype.runPointActions = function (e, p) {
1172+
Pointer.prototype.runPointActions = function (e, p, force) {
11731173
var pointer = this, chart = pointer.chart, series = chart.series, tooltip = (chart.tooltip && chart.tooltip.options.enabled ?
11741174
chart.tooltip :
11751175
void 0), shared = (tooltip ?
@@ -1190,8 +1190,9 @@ var Pointer = /** @class */ (function () {
11901190
// Refresh tooltip for kdpoint if new hover point or tooltip was hidden
11911191
// #3926, #4200
11921192
if (hoverPoint &&
1193-
// !(hoverSeries && hoverSeries.directTouch) &&
1194-
(hoverPoint !== chart.hoverPoint || (tooltip && tooltip.isHidden))) {
1193+
(force ||
1194+
hoverPoint !== chart.hoverPoint ||
1195+
(tooltip && tooltip.isHidden))) {
11951196
(chart.hoverPoints || []).forEach(function (p) {
11961197
if (points.indexOf(p) === -1) {
11971198
p.setState();

es-modules/Core/Renderer/HTML/AST.js

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ var AST = /** @class */ (function () {
9696
});
9797
delete attributes[key];
9898
}
99+
// #17753, < is not allowed in SVG attributes
100+
if (isString(val) && attributes[key]) {
101+
attributes[key] = val.replace(/</g, '&lt;');
102+
}
99103
});
100104
return attributes;
101105
};
@@ -374,6 +378,7 @@ var AST = /** @class */ (function () {
374378
'x',
375379
'x1',
376380
'x2',
381+
'xlink:href',
377382
'y',
378383
'y1',
379384
'y2',
@@ -467,6 +472,7 @@ var AST = /** @class */ (function () {
467472
'text',
468473
'textPath',
469474
'thead',
475+
'title',
470476
'tbody',
471477
'tspan',
472478
'td',

0 commit comments

Comments
 (0)