Skip to content

Commit

Permalink
v12.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed Dec 20, 2024
1 parent e9bb900 commit 2eb7b7a
Show file tree
Hide file tree
Showing 305 changed files with 712 additions and 594 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": "12.1.0",
"version": "12.1.1",
"main": "highcharts.js",
"license": "https://www.highcharts.com/license",
"types": "highcharts.d.ts"
Expand Down
8 changes: 0 additions & 8 deletions es-modules/Core/Defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -2621,14 +2621,6 @@ const defaultOptions = {
text: 'Highcharts.com'
}
};
/* eslint-disable spaced-comment */
/*= if (!build.classic) { =*/
// Legacy build for styled mode, set the styledMode option to true by default.
defaultOptions.chart.styledMode = true;
/*= } else { =*/
defaultOptions.chart.styledMode = false;
/*= } =*/
'';
const defaultTime = new Time(defaultOptions.time);
/**
* Get the updated default options. Until 3.0.7, merely exposing defaultOptions
Expand Down
2 changes: 1 addition & 1 deletion es-modules/Core/Globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var Globals;
{}), // eslint-disable-line node/no-unsupported-features/es-builtins
Globals.doc = Globals.win.document, Globals.svg = (Globals.doc &&
Globals.doc.createElementNS &&
!!Globals.doc.createElementNS(Globals.SVG_NS, 'svg').createSVGRect), Globals.userAgent = (Globals.win.navigator && Globals.win.navigator.userAgent) || '', Globals.isChrome = Globals.win.chrome, Globals.isFirefox = Globals.userAgent.indexOf('Firefox') !== -1, Globals.isMS = /(edge|msie|trident)/i.test(Globals.userAgent) && !Globals.win.opera, Globals.isSafari = !Globals.isChrome && Globals.userAgent.indexOf('Safari') !== -1, Globals.isTouchDevice = /(Mobile|Android|Windows Phone)/.test(Globals.userAgent), Globals.isWebKit = Globals.userAgent.indexOf('AppleWebKit') !== -1, Globals.deg2rad = Math.PI * 2 / 360, Globals.marginNames = [
!!Globals.doc.createElementNS(Globals.SVG_NS, 'svg').createSVGRect), Globals.pageLang = Globals.doc?.body.closest('[lang]')?.lang, Globals.userAgent = (Globals.win.navigator && Globals.win.navigator.userAgent) || '', Globals.isChrome = Globals.win.chrome, Globals.isFirefox = Globals.userAgent.indexOf('Firefox') !== -1, Globals.isMS = /(edge|msie|trident)/i.test(Globals.userAgent) && !Globals.win.opera, Globals.isSafari = !Globals.isChrome && Globals.userAgent.indexOf('Safari') !== -1, Globals.isTouchDevice = /(Mobile|Android|Windows Phone)/.test(Globals.userAgent), Globals.isWebKit = Globals.userAgent.indexOf('AppleWebKit') !== -1, Globals.deg2rad = Math.PI * 2 / 360, Globals.marginNames = [
'plotTop',
'marginRight',
'marginBottom',
Expand Down
4 changes: 3 additions & 1 deletion es-modules/Core/Pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,9 @@ class Pointer {
hoverChart !== chart) {
const relatedTargetObj = { relatedTarget: chart.container };
if (e && !e?.relatedTarget) {
e = { ...relatedTargetObj, ...e };
// #17192, Non-enumerable properties of "e" are dropped with
// spreading (...e). Using Object.assign ensures integrity.
Object.assign({}, e, relatedTargetObj);
}
hoverChart.pointer?.onContainerMouseLeave(e || relatedTargetObj);
}
Expand Down
8 changes: 4 additions & 4 deletions es-modules/Core/Renderer/SVG/SVGElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ class SVGElement {
* @return {Highcharts.SVGElement} Returns the SVGElement for chaining.
*/
align(alignOptions, alignByTranslate, alignTo, redraw = true) {
const attribs = {
'text-align': alignOptions?.align
}, renderer = this.renderer, alignedObjects = renderer.alignedObjects, initialAlignment = Boolean(alignOptions);
const renderer = this.renderer, alignedObjects = renderer.alignedObjects, initialAlignment = Boolean(alignOptions);
// First call on instanciate
if (alignOptions) {
this.alignOptions = alignOptions;
Expand Down Expand Up @@ -247,7 +245,9 @@ class SVGElement {
// Default: top align
y = (alignToBox.y || 0) + (alignOptions.y || 0) +
((alignToBox.height || 0) - (alignOptions.height || 0)) *
getAlignFactor(alignOptions.verticalAlign);
getAlignFactor(alignOptions.verticalAlign), attribs = {
'text-align': alignOptions?.align
};
attribs[alignByTranslate ? 'translateX' : 'x'] = Math.round(x);
attribs[alignByTranslate ? 'translateY' : 'y'] = Math.round(y);
// Animate only if already placed
Expand Down
4 changes: 3 additions & 1 deletion es-modules/Core/Renderer/SVG/SVGLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ class SVGLabel extends SVGElement {
this.boxAttr(key, value);
}
'text-alignSetter'(value) {
this.textAlign = value;
// The text-align variety is for the pre-animation getter. The code
// should be unified to either textAlign or text-align.
this.textAlign = this['text-align'] = value;
this.updateTextPadding();
}
textSetter(text) {
Expand Down
5 changes: 2 additions & 3 deletions es-modules/Core/Series/DataLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ var DataLabel;
(unrotatedbBox.width - bBox.width);
dataLabel.alignAttr.y += getAlignFactor(options.verticalAlign) *
(unrotatedbBox.height - bBox.height);
dataLabel.attr({
'text-align': dataLabel.alignAttr['text-align'] || 'center'
})[dataLabel.placed ? 'animate' : 'attr']({
dataLabel[dataLabel.placed ? 'animate' : 'attr']({
'text-align': dataLabel.alignAttr['text-align'] || 'center',
x: dataLabel.alignAttr.x +
(bBox.width - unrotatedbBox.width) / 2,
y: dataLabel.alignAttr.y +
Expand Down
12 changes: 6 additions & 6 deletions es-modules/Core/Templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import D from './Defaults.js';
const { defaultOptions, defaultTime } = D;
import G from './Globals.js';
const { doc } = G;
const { pageLang } = G;
import U from './Utilities.js';
const { extend, getNestedProperty, isArray, isNumber, isObject, isString, pick, ucfirst } = U;
const helpers = {
Expand Down Expand Up @@ -364,16 +364,16 @@ function numberFormat(number, decimals, decimalPoint, thousandsSep) {
}
const hasSeparators = thousandsSep || decimalPoint, locale = hasSeparators ?
'en' :
(this?.locale ||
lang.locale ||
doc.body.closest('[lang]')?.lang), cacheKey = JSON.stringify(options) + locale, nf = numberFormatCache[cacheKey] ?? (numberFormatCache[cacheKey] = new Intl.NumberFormat(locale, options));
(this?.locale || lang.locale || pageLang), cacheKey = JSON.stringify(options) + locale, nf = numberFormatCache[cacheKey] ?? (numberFormatCache[cacheKey] = new Intl.NumberFormat(locale, options));
ret = nf.format(number);
// If thousandsSep or decimalPoint are set, fall back to using English
// format with string replacement for the separators.
if (hasSeparators) {
ret = ret
.replace(/\,/g, thousandsSep ?? ',')
.replace('.', decimalPoint ?? '.');
// Preliminary step to avoid re-swapping (#22402)
.replace(/([,\.])/g, '_$1')
.replace(/_\,/g, thousandsSep ?? ',')
.replace('_.', decimalPoint ?? '.');
}
if (
// Remove signed zero (#20564)
Expand Down
22 changes: 15 additions & 7 deletions es-modules/Core/Time.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* */
'use strict';
import H from './Globals.js';
const { win } = H;
const { pageLang, win } = H;
import U from './Utilities.js';
const { defined, error, extend, isNumber, isObject, isString, merge, objectEach, pad, splat, timeUnits, ucfirst } = U;
/* *
Expand All @@ -36,9 +36,17 @@ const spanishWeekdayIndex = (weekday) => ['D', 'L', 'M', 'X', 'J', 'V', 'S'].ind
* `Highcharts.setOptions`, or individually for each Chart item through the
* [time](https://api.highcharts.com/highcharts/time) options set.
*
* The Time object is available from {@link Highcharts.Chart#time},
* which refers to `Highcharts.time` if no individual time settings are
* applied.
* The Time object is available from {@link Highcharts.Chart#time}, which refers
* to `Highcharts.time` unless individual time settings are applied for each
* chart.
*
* When configuring time settings for individual chart instances, be aware that
* using `Highcharts.dateFormat` or `Highcharts.time.dateFormat` within
* formatter callbacks relies on the global time object, which applies the
* global language and time zone settings. To ensure charts with local time
* settings function correctly, use `chart.time.dateFormat? instead. However,
* the recommended best practice is to use `setOptions` to define global time
* settings unless specific configurations are needed for each chart.
*
* @example
* // Apply time settings globally
Expand Down Expand Up @@ -76,8 +84,8 @@ const spanishWeekdayIndex = (weekday) => ['D', 'L', 'M', 'X', 'J', 'V', 'S'].ind
* @class
* @name Highcharts.Time
*
* @param {Highcharts.TimeOptions} [options]
* Time options as defined in [chart.options.time](/highcharts/time).
* @param {Highcharts.TimeOptions} [options] Time options as defined in
* [chart.options.time](/highcharts/time).
*/
class Time {
/* *
Expand Down Expand Up @@ -197,7 +205,7 @@ class Time {
/**
* Shorthand to get a cached `Intl.DateTimeFormat` instance.
*/
dateTimeFormat(options, timestamp, locale = this.options.locale) {
dateTimeFormat(options, timestamp, locale = this.options.locale || pageLang) {
const cacheKey = JSON.stringify(options) + locale;
if (isString(options)) {
options = this.str2dtf(options);
Expand Down
24 changes: 16 additions & 8 deletions es-modules/Extensions/Exporting/Exporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import G from '../../Core/Globals.js';
const { doc, SVG_NS, win } = G;
import HU from '../../Core/HttpUtilities.js';
import U from '../../Core/Utilities.js';
const { addEvent, css, createElement, discardElement, extend, find, fireEvent, isObject, merge, objectEach, pick, removeEvent, uniqueKey } = U;
const { addEvent, css, createElement, discardElement, extend, find, fireEvent, isObject, merge, objectEach, pick, removeEvent, splat, uniqueKey } = U;
/* *
*
* Composition
Expand Down Expand Up @@ -757,15 +757,23 @@ var Exporting;
}
// Reflect axis extremes in the export (#5924)
chart.axes.forEach(function (axis) {
const axisCopy = find(chartCopy.axes, function (copy) {
return copy.options.internalKey ===
axis.userOptions.internalKey;
}), extremes = axis.getExtremes(), userMin = extremes.userMin, userMax = extremes.userMax;
if (axisCopy &&
((typeof userMin !== 'undefined' &&
const axisCopy = find(chartCopy.axes, (copy) => copy.options.internalKey === axis.userOptions.internalKey);
if (axisCopy) {
const extremes = axis.getExtremes(),
// Make sure min and max overrides in the
// `exporting.chartOptions.xAxis` settings are reflected.
// These should override user-set extremes via zooming,
// scrollbar etc (#7873).
exportOverride = splat(chartOptions?.[axis.coll] || {})[0], userMin = 'min' in exportOverride ?
exportOverride.min :
extremes.userMin, userMax = 'max' in exportOverride ?
exportOverride.max :
extremes.userMax;
if (((typeof userMin !== 'undefined' &&
userMin !== axisCopy.min) || (typeof userMax !== 'undefined' &&
userMax !== axisCopy.max))) {
axisCopy.setExtremes(userMin, userMax, true, false);
axisCopy.setExtremes(userMin ?? void 0, userMax ?? void 0, true, false);
}
}
});
// Get the SVG from the container's innerHTML
Expand Down
14 changes: 11 additions & 3 deletions es-modules/Stock/RangeSelector/RangeSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ class RangeSelector {
* exporting button
*/
handleCollision(xOffsetForExportButton) {
const { chart, buttonGroup, inputGroup } = this;
const { chart, buttonGroup, inputGroup, initialButtonGroupWidth } = this;
const { buttonPosition, dropdown, inputPosition } = this.options;
const moveInputsDown = () => {
if (inputGroup && buttonGroup) {
Expand All @@ -1316,15 +1316,15 @@ class RangeSelector {
if (inputGroup && buttonGroup) {
if (inputPosition.align === buttonPosition.align) {
moveInputsDown();
if (this.initialButtonGroupWidth >
if (initialButtonGroupWidth >
chart.plotWidth + xOffsetForExportButton - 20) {
this.collapseButtons();
}
else {
this.expandButtons();
}
}
else if (this.initialButtonGroupWidth -
else if (initialButtonGroupWidth -
xOffsetForExportButton +
inputGroup.getBBox().width >
chart.plotWidth) {
Expand All @@ -1339,6 +1339,14 @@ class RangeSelector {
this.expandButtons();
}
}
else if (buttonGroup && dropdown === 'responsive') {
if (initialButtonGroupWidth > chart.plotWidth) {
this.collapseButtons();
}
else {
this.expandButtons();
}
}
// Forced states
if (buttonGroup) {
if (dropdown === 'always') {
Expand Down
2 changes: 1 addition & 1 deletion es-modules/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion highcharts-3d.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion highcharts-3d.src.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v12.1.0 (2024-12-17)
* @license Highcharts JS v12.1.1 (2024-12-20)
* @module highcharts/highcharts-3d
* @requires highcharts
*
Expand Down
10 changes: 5 additions & 5 deletions highcharts-gantt.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2eb7b7a

Please sign in to comment.