Skip to content

Commit

Permalink
v9.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed Jun 4, 2021
1 parent 180cb5a commit e480545
Show file tree
Hide file tree
Showing 685 changed files with 106,801 additions and 107,464 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "highcharts",
"version": "9.1.0",
"version": "9.1.1",
"main": "highcharts.js",
"license": "https://www.highcharts.com/license",
"types": "highcharts.d.ts"
Expand Down
1 change: 1 addition & 0 deletions css/stocktools/gui.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
height: 100%;
position: absolute;
z-index: 10;
top: 0px;
}

.highcharts-stocktools-popup {
Expand Down
1 change: 1 addition & 0 deletions css/stocktools/gui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $button-hover-color: #e6ebf5;
height: 100%;
position: absolute;
z-index: 10;
top: 0px;
}

.highcharts-stocktools-popup {
Expand Down
3 changes: 2 additions & 1 deletion es-modules/Accessibility/A11yI18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* */
'use strict';
import Chart from '../Core/Chart/Chart.js';
import H from '../Core/Globals.js';
import F from '../Core/FormatUtilities.js';
var format = F.format;
Expand Down Expand Up @@ -243,7 +244,7 @@ H.i18nFormat = function (formatString, context, chart) {
* @return {string}
* The formatted string.
*/
H.Chart.prototype.langFormat = function (langKey, context) {
Chart.prototype.langFormat = function (langKey, context) {
var keys = langKey.split('.'), formatString = this.options.lang, i = 0;
for (; i < keys.length; ++i) {
formatString = formatString && formatString[keys[i]];
Expand Down
17 changes: 9 additions & 8 deletions es-modules/Accessibility/Accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
*
* */
'use strict';
import Chart from '../Core/Chart/Chart.js';
import ChartUtilities from './Utils/ChartUtilities.js';
import H from '../Core/Globals.js';
var doc = H.doc;
import KeyboardNavigationHandler from './KeyboardNavigationHandler.js';
import O from '../Core/Options.js';
var defaultOptions = O.defaultOptions;
import D from '../Core/DefaultOptions.js';
var defaultOptions = D.defaultOptions;
import Point from '../Core/Series/Point.js';
import Series from '../Core/Series/Series.js';
import U from '../Core/Utilities.js';
Expand Down Expand Up @@ -192,7 +193,7 @@ Accessibility.prototype = {
/**
* @private
*/
H.Chart.prototype.updateA11yEnabled = function () {
Chart.prototype.updateA11yEnabled = function () {
var a11y = this.accessibility, accessibilityOptions = this.options.accessibility;
if (accessibilityOptions && accessibilityOptions.enabled) {
if (a11y) {
Expand All @@ -215,7 +216,7 @@ H.Chart.prototype.updateA11yEnabled = function () {
}
};
// Handle updates to the module and send render updates to components
addEvent(H.Chart, 'render', function (e) {
addEvent(Chart, 'render', function (e) {
// Update/destroy
if (this.a11yDirty && this.renderTo) {
delete this.a11yDirty;
Expand All @@ -229,7 +230,7 @@ addEvent(H.Chart, 'render', function (e) {
}
});
// Update with chart/series/point updates
addEvent(H.Chart, 'update', function (e) {
addEvent(Chart, 'update', function (e) {
// Merge new options
var newOptions = e.options.accessibility;
if (newOptions) {
Expand All @@ -256,7 +257,7 @@ addEvent(Point, 'update', function () {
}
});
['addSeries', 'init'].forEach(function (event) {
addEvent(H.Chart, event, function () {
addEvent(Chart, event, function () {
this.a11yDirty = true;
});
});
Expand All @@ -271,14 +272,14 @@ addEvent(Point, 'update', function () {
[
'afterDrilldown', 'drillupall'
].forEach(function (event) {
addEvent(H.Chart, event, function () {
addEvent(Chart, event, function () {
if (this.accessibility) {
this.accessibility.update();
}
});
});
// Destroy with chart
addEvent(H.Chart, 'destroy', function () {
addEvent(Chart, 'destroy', function () {
if (this.accessibility) {
this.accessibility.destroy();
}
Expand Down
7 changes: 5 additions & 2 deletions es-modules/Accessibility/AccessibilityComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ AccessibilityComponent.prototype = {
}
});
proxy.className = 'highcharts-a11y-proxy-button';
if (svgElement.hasClass('highcharts-no-tooltip')) {
proxy.className += ' highcharts-no-tooltip';
}
if (preClickEvent) {
this.addEvent(proxy, 'click', preClickEvent);
}
Expand Down Expand Up @@ -273,8 +276,8 @@ AccessibilityComponent.prototype = {
merge(true, proxy.style, {
width: (bBox.width || 1) + 'px',
height: (bBox.height || 1) + 'px',
left: (bBox.x || 0) + 'px',
top: (bBox.y || 0) + 'px'
left: (Math.round(bBox.x) || 0) + 'px',
top: (Math.round(bBox.y) || 0) + 'px'
});
},
/**
Expand Down
4 changes: 3 additions & 1 deletion es-modules/Accessibility/Components/InfoRegionsComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
import AST from '../../Core/Renderer/HTML/AST.js';
import Chart from '../../Core/Chart/Chart.js';
import F from '../../Core/FormatUtilities.js';
var format = F.format;
import H from '../../Core/Globals.js';
Expand Down Expand Up @@ -74,7 +76,7 @@ function getTableSummary(chart) {
* @param {Array<string>} types The series types in this chart.
* @return {string} The text description of the chart type.
*/
H.Chart.prototype.getTypeDescription = function (types) {
Chart.prototype.getTypeDescription = function (types) {
var firstType = types[0], firstSeries = this.series && this.series[0] || {}, formatContext = {
numSeries: this.series.length,
numPoints: firstSeries.points && firstSeries.points.length,
Expand Down
30 changes: 24 additions & 6 deletions es-modules/Accessibility/Components/LegendComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
*
* */
'use strict';
import Chart from '../../Core/Chart/Chart.js';
import H from '../../Core/Globals.js';
import Legend from '../../Core/Legend.js';
import U from '../../Core/Utilities.js';
var addEvent = U.addEvent, extend = U.extend, find = U.find, fireEvent = U.fireEvent;
var addEvent = U.addEvent, extend = U.extend, find = U.find, fireEvent = U.fireEvent, isNumber = U.isNumber;
import AccessibilityComponent from '../AccessibilityComponent.js';
import KeyboardNavigationHandler from '../KeyboardNavigationHandler.js';
import HTMLUtilities from '../Utils/HTMLUtilities.js';
Expand Down Expand Up @@ -47,10 +48,11 @@ function shouldDoLegendA11y(chart) {
*
* @return {boolean}
*/
H.Chart.prototype.highlightLegendItem = function (ix) {
var items = this.legend.allItems, oldIx = this.highlightedLegendItemIx;
Chart.prototype.highlightLegendItem = function (ix) {
var items = this.legend.allItems, oldIx = this.accessibility &&
this.accessibility.components.legend.highlightedLegendItemIx;
if (items[ix]) {
if (items[oldIx]) {
if (isNumber(oldIx) && items[oldIx]) {
fireEvent(items[oldIx].legendGroup.element, 'mouseout');
}
scrollLegendToItem(this.legend, ix);
Expand Down Expand Up @@ -156,6 +158,7 @@ extend(LegendComponent.prototype, /** @lends Highcharts.LegendComponent */ {
this.removeProxies();
if (shouldDoLegendA11y(this.chart)) {
this.addLegendProxyGroup();
this.addLegendListContainer();
this.proxyLegendItems();
this.updateLegendItemProxyVisibility();
}
Expand Down Expand Up @@ -195,6 +198,16 @@ extend(LegendComponent.prototype, /** @lends Highcharts.LegendComponent */ {
role: groupRole
});
},
/**
* @private
*/
addLegendListContainer: function () {
if (this.legendProxyGroup) {
var container = this.legendListContainer = this.createElement('ul');
container.style.listStyle = 'none';
this.legendProxyGroup.appendChild(container);
}
},
/**
* @private
*/
Expand All @@ -212,7 +225,7 @@ extend(LegendComponent.prototype, /** @lends Highcharts.LegendComponent */ {
* @param {Highcharts.BubbleLegend|Point|Highcharts.Series} item
*/
proxyLegendItem: function (item) {
if (!item.legendItem || !item.legendGroup) {
if (!item.legendItem || !item.legendGroup || !this.legendListContainer) {
return;
}
var itemLabel = this.chart.langFormat('accessibility.legend.legendItem', {
Expand All @@ -227,7 +240,9 @@ extend(LegendComponent.prototype, /** @lends Highcharts.LegendComponent */ {
// Considers useHTML
proxyPositioningElement = item.legendGroup.div ?
item.legendItem : item.legendGroup;
item.a11yProxyElement = this.createProxyButton(item.legendItem, this.legendProxyGroup, attribs, proxyPositioningElement);
var listItem = this.createElement('li');
this.legendListContainer.appendChild(listItem);
item.a11yProxyElement = this.createProxyButton(item.legendItem, listItem, attribs, proxyPositioningElement);
this.proxyElementsList.push({
item: item,
element: item.a11yProxyElement,
Expand Down Expand Up @@ -263,6 +278,9 @@ extend(LegendComponent.prototype, /** @lends Highcharts.LegendComponent */ {
},
init: function (direction) {
return component.onKbdNavigationInit(direction);
},
terminate: function () {
chart.legend.allItems.forEach(function (item) { return item.setState('', true); });
}
});
},
Expand Down
10 changes: 5 additions & 5 deletions es-modules/Accessibility/Components/MenuComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* */
'use strict';
import H from '../../Core/Globals.js';
import Chart from '../../Core/Chart/Chart.js';
import U from '../../Core/Utilities.js';
var extend = U.extend;
import AccessibilityComponent from '../AccessibilityComponent.js';
Expand All @@ -36,7 +36,7 @@ function getExportMenuButtonElement(chart) {
* @private
* @function Highcharts.Chart#showExportMenu
*/
H.Chart.prototype.showExportMenu = function () {
Chart.prototype.showExportMenu = function () {
var exportButton = getExportMenuButtonElement(this);
if (exportButton) {
var el = exportButton.element;
Expand All @@ -49,7 +49,7 @@ H.Chart.prototype.showExportMenu = function () {
* @private
* @function Highcharts.Chart#hideExportMenu
*/
H.Chart.prototype.hideExportMenu = function () {
Chart.prototype.hideExportMenu = function () {
var chart = this, exportList = chart.exportDivElements;
if (exportList && chart.exportContextMenu) {
// Reset hover states etc.
Expand All @@ -75,7 +75,7 @@ H.Chart.prototype.hideExportMenu = function () {
*
* @return {boolean}
*/
H.Chart.prototype.highlightExportItem = function (ix) {
Chart.prototype.highlightExportItem = function (ix) {
var listItem = this.exportDivElements && this.exportDivElements[ix], curHighlighted = this.exportDivElements &&
this.exportDivElements[this.highlightedExportItemIx], hasSVGFocusSupport;
if (listItem &&
Expand Down Expand Up @@ -106,7 +106,7 @@ H.Chart.prototype.highlightExportItem = function (ix) {
* @function Highcharts.Chart#highlightLastExportItem
* @return {boolean}
*/
H.Chart.prototype.highlightLastExportItem = function () {
Chart.prototype.highlightLastExportItem = function () {
var chart = this, i;
if (chart.exportDivElements) {
i = chart.exportDivElements.length;
Expand Down
4 changes: 2 additions & 2 deletions es-modules/Accessibility/Components/RangeSelectorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import AccessibilityComponent from '../AccessibilityComponent.js';
import ChartUtilities from '../Utils/ChartUtilities.js';
var unhideChartElementFromAT = ChartUtilities.unhideChartElementFromAT, getAxisRangeDescription = ChartUtilities.getAxisRangeDescription;
import Announcer from '../Utils/Announcer.js';
import H from '../../Core/Globals.js';
import Chart from '../../Core/Chart/Chart.js';
import HTMLUtilities from '../Utils/HTMLUtilities.js';
var setElAttrs = HTMLUtilities.setElAttrs;
import KeyboardNavigationHandler from '../KeyboardNavigationHandler.js';
Expand Down Expand Up @@ -44,7 +44,7 @@ function shouldRunInputNavigation(chart) {
*
* @return {boolean}
*/
H.Chart.prototype.highlightRangeSelectorButton = function (ix) {
Chart.prototype.highlightRangeSelectorButton = function (ix) {
var buttons = (this.rangeSelector &&
this.rangeSelector.buttons ||
[]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Series.prototype.keyboardMoveVertical = true;
* The index in the series.points array of the point.
*/
function getPointIndex(point) {
var index = point.index, points = point.series.points, i = points.length;
var index = point.index, points = point.series.points;
var i = points.length;
if (points[index] !== point) {
while (i--) {
if (points[i] === point) {
Expand Down Expand Up @@ -120,7 +121,8 @@ function isSkipPoint(point) {
* @return {Highcharts.Point|undefined}
*/
function getClosestPoint(point, series, xWeight, yWeight) {
var minDistance = Infinity, dPoint, minIx, distance, i = series.points.length, hasUndefinedPosition = function (point) {
var minDistance = Infinity, dPoint, minIx, distance, i = series.points.length;
var hasUndefinedPosition = function (point) {
return !(defined(point.plotX) && defined(point.plotY));
};
if (hasUndefinedPosition(point)) {
Expand Down Expand Up @@ -188,7 +190,8 @@ Point.prototype.highlight = function () {
*/
Chart.prototype.highlightAdjacentPoint = function (next) {
var chart = this, series = chart.series, curPoint = chart.highlightedPoint, curPointIndex = curPoint && getPointIndex(curPoint) || 0, curPoints = (curPoint && curPoint.series.points), lastSeries = chart.series && chart.series[chart.series.length - 1], lastPoint = lastSeries && lastSeries.points &&
lastSeries.points[lastSeries.points.length - 1], newSeries, newPoint;
lastSeries.points[lastSeries.points.length - 1];
var newSeries, newPoint;
// If no points, return false
if (!series[0] || !series[0].points) {
return false;
Expand Down Expand Up @@ -272,8 +275,9 @@ Series.prototype.highlightFirstValidPoint = function () {
* @return {Highcharts.Point|boolean}
*/
Chart.prototype.highlightAdjacentSeries = function (down) {
var chart = this, newSeries, newPoint, adjacentNewPoint, curPoint = chart.highlightedPoint, lastSeries = chart.series && chart.series[chart.series.length - 1], lastPoint = lastSeries && lastSeries.points &&
var chart = this, curPoint = chart.highlightedPoint, lastSeries = chart.series && chart.series[chart.series.length - 1], lastPoint = lastSeries && lastSeries.points &&
lastSeries.points[lastSeries.points.length - 1];
var newSeries, newPoint, adjacentNewPoint;
// If no point is highlighted, highlight the first/last point
if (!chart.highlightedPoint) {
newSeries = down ? (chart.series && chart.series[0]) : lastSeries;
Expand Down Expand Up @@ -319,7 +323,8 @@ Chart.prototype.highlightAdjacentSeries = function (down) {
* @return {Highcharts.Point|boolean}
*/
Chart.prototype.highlightAdjacentPointVertical = function (down) {
var curPoint = this.highlightedPoint, minDistance = Infinity, bestPoint;
var curPoint = this.highlightedPoint;
var minDistance = Infinity, bestPoint;
if (!defined(curPoint.plotX) || !defined(curPoint.plotY)) {
return false;
}
Expand All @@ -332,7 +337,8 @@ Chart.prototype.highlightAdjacentPointVertical = function (down) {
point === curPoint) {
return;
}
var yDistance = point.plotY - curPoint.plotY, width = Math.abs(point.plotX - curPoint.plotX), distance = Math.abs(yDistance) * Math.abs(yDistance) +
var yDistance = point.plotY - curPoint.plotY;
var width = Math.abs(point.plotX - curPoint.plotX), distance = Math.abs(yDistance) * Math.abs(yDistance) +
width * width * 4; // Weigh horizontal distance highly
// Reverse distance number if axis is reversed
if (series.yAxis && series.yAxis.reversed) {
Expand Down Expand Up @@ -370,7 +376,8 @@ function highlightFirstValidPointInChart(chart) {
* @return {Highcharts.Point|boolean}
*/
function highlightLastValidPointInChart(chart) {
var numSeries = chart.series.length, i = numSeries, res = false;
var numSeries = chart.series.length;
var i = numSeries, res = false;
while (i--) {
chart.highlightedPoint = chart.series[i].points[chart.series[i].points.length - 1];
// Highlight first valid point in the series will also
Expand Down Expand Up @@ -443,7 +450,8 @@ extend(SeriesKeyboardNavigation.prototype, /** @lends Highcharts.SeriesKeyboardN
onDrillupAll: function () {
// After drillup we want to find the point that was drilled down to and
// highlight it.
var last = this.lastDrilledDownPoint, chart = this.chart, series = last && getSeriesFromName(chart, last.seriesName), point;
var last = this.lastDrilledDownPoint, chart = this.chart, series = last && getSeriesFromName(chart, last.seriesName);
var point;
if (last && series && defined(last.x) && defined(last.y)) {
point = getPointFromXY(series, last.x, last.y);
}
Expand Down Expand Up @@ -544,10 +552,13 @@ extend(SeriesKeyboardNavigation.prototype, /** @lends Highcharts.SeriesKeyboardN
*/
onHandlerTerminate: function () {
var chart = this.chart;
var curPoint = chart.highlightedPoint;
if (chart.tooltip) {
chart.tooltip.hide(0);
}
var hoverSeries = chart.highlightedPoint && chart.highlightedPoint.series;
if (hoverSeries && hoverSeries.onMouseOut) {
hoverSeries.onMouseOut();
}
if (chart.highlightedPoint && chart.highlightedPoint.onMouseOut) {
chart.highlightedPoint.onMouseOut();
}
Expand Down
Loading

0 comments on commit e480545

Please sign in to comment.