highcharts
Version:
JavaScript charting framework
1,456 lines (1,416 loc) • 351 kB
JavaScript
/**
* @license Highmaps JS v12.2.0 (2025-04-07)
* @module highcharts/modules/map
* @requires highcharts
*
* Highmaps as a plugin for Highcharts or Highcharts Stock.
*
* (c) 2011-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*/
import * as __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_8202131d__ from "../highcharts.src.js";
import * as __WEBPACK_EXTERNAL_MODULE__coloraxis_src_js_cdd22a72__ from "./coloraxis.src.js";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
;// external ["../highcharts.src.js","default"]
const external_highcharts_src_js_default_namespaceObject = __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_8202131d__["default"];
var external_highcharts_src_js_default_default = /*#__PURE__*/__webpack_require__.n(external_highcharts_src_js_default_namespaceObject);
;// external "./coloraxis.src.js"
var x = (y) => {
var x = {}; __webpack_require__.d(x,
y); return x
}
var y = (x) => (() => (x))
const external_coloraxis_src_js_namespaceObject = x({ });
;// ./code/es-modules/Maps/MapNavigationDefaults.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
/* *
*
* Constants
*
* */
const lang = {
zoomIn: 'Zoom in',
zoomOut: 'Zoom out'
};
/**
* The `mapNavigation` option handles buttons for navigation in addition to
* `mousewheel` and `doubleclick` handlers for map zooming.
*
* @product highmaps
* @optionparent mapNavigation
*/
const mapNavigation = {
/**
* General options for the map navigation buttons. Individual options
* can be given from the [mapNavigation.buttons](#mapNavigation.buttons)
* option set.
*
* @sample {highmaps} maps/mapnavigation/button-theme/
* Theming the navigation buttons
*/
buttonOptions: {
/**
* What box to align the buttons to. Possible values are `plotBox`
* and `spacingBox`.
*
* @type {Highcharts.ButtonRelativeToValue}
*/
alignTo: 'plotBox',
/**
* The alignment of the navigation buttons.
*
* @type {Highcharts.AlignValue}
*/
align: 'left',
/**
* The vertical alignment of the buttons. Individual alignment can
* be adjusted by each button's `y` offset.
*
* @type {Highcharts.VerticalAlignValue}
*/
verticalAlign: 'top',
/**
* The X offset of the buttons relative to its `align` setting.
*/
x: 0,
/**
* The width of the map navigation buttons.
*/
width: 18,
/**
* The pixel height of the map navigation buttons.
*/
height: 18,
/**
* Padding for the navigation buttons.
*
* @since 5.0.0
*/
padding: 5,
/**
* Text styles for the map navigation buttons.
*
* @type {Highcharts.CSSObject}
* @default {"fontSize": "1em", "fontWeight": "bold"}
*/
style: {
/** @ignore */
color: "#666666" /* Palette.neutralColor60 */,
/** @ignore */
fontSize: '1em',
/** @ignore */
fontWeight: 'bold'
},
/**
* A configuration object for the button theme. The object accepts
* SVG properties like `stroke-width`, `stroke` and `fill`. Tri-state
* button styles are supported by the `states.hover` and `states.select`
* objects.
*
* @sample {highmaps} maps/mapnavigation/button-theme/
* Themed navigation buttons
*
* @type {Highcharts.SVGAttributes}
* @default {"stroke-width": 1, "text-align": "center"}
*/
theme: {
/** @ignore */
fill: "#ffffff" /* Palette.backgroundColor */,
/** @ignore */
stroke: "#e6e6e6" /* Palette.neutralColor10 */,
/** @ignore */
'stroke-width': 1,
/** @ignore */
'text-align': 'center'
}
},
/**
* The individual buttons for the map navigation. This usually includes
* the zoom in and zoom out buttons. Properties for each button is
* inherited from
* [mapNavigation.buttonOptions](#mapNavigation.buttonOptions), while
* individual options can be overridden. But default, the `onclick`, `text`
* and `y` options are individual.
*/
buttons: {
/**
* Options for the zoom in button. Properties for the zoom in and zoom
* out buttons are inherited from
* [mapNavigation.buttonOptions](#mapNavigation.buttonOptions), while
* individual options can be overridden. By default, the `onclick`,
* `text` and `y` options are individual.
*
* @extends mapNavigation.buttonOptions
*/
zoomIn: {
// eslint-disable-next-line valid-jsdoc
/**
* Click handler for the button.
*
* @type {Function}
* @default function () { this.mapZoom(0.5); }
*/
onclick: function () {
this.mapZoom(0.5);
},
/**
* The text for the button. The tooltip (title) is a language option
* given by [lang.zoomIn](#lang.zoomIn).
*/
text: '+',
/**
* The position of the zoomIn button relative to the vertical
* alignment.
*/
y: 0
},
/**
* Options for the zoom out button. Properties for the zoom in and
* zoom out buttons are inherited from
* [mapNavigation.buttonOptions](#mapNavigation.buttonOptions), while
* individual options can be overridden. By default, the `onclick`,
* `text` and `y` options are individual.
*
* @extends mapNavigation.buttonOptions
*/
zoomOut: {
// eslint-disable-next-line valid-jsdoc
/**
* Click handler for the button.
*
* @type {Function}
* @default function () { this.mapZoom(2); }
*/
onclick: function () {
this.mapZoom(2);
},
/**
* The text for the button. The tooltip (title) is a language option
* given by [lang.zoomOut](#lang.zoomIn).
*/
text: '-',
/**
* The position of the zoomOut button relative to the vertical
* alignment.
*/
y: 28
}
},
/**
* Whether to enable navigation buttons. By default it inherits the
* [enabled](#mapNavigation.enabled) setting.
*
* @type {boolean}
* @apioption mapNavigation.enableButtons
*/
/**
* Whether to enable map navigation. The default is not to enable
* navigation, as many choropleth maps are simple and don't need it.
* Additionally, when touch zoom and mouse wheel zoom is enabled, it breaks
* the default behaviour of these interactions in the website, and the
* implementer should be aware of this.
*
* Individual interactions can be enabled separately, namely buttons,
* multitouch zoom, double click zoom, double click zoom to element and
* mouse wheel zoom.
*
* @type {boolean}
* @default false
* @apioption mapNavigation.enabled
*/
/**
* Enables zooming in on an area on double clicking in the map. By default
* it inherits the [enabled](#mapNavigation.enabled) setting.
*
* @type {boolean}
* @apioption mapNavigation.enableDoubleClickZoom
*/
/**
* Whether to zoom in on an area when that area is double clicked.
*
* @sample {highmaps} maps/mapnavigation/doubleclickzoomto/
* Enable double click zoom to
*
* @type {boolean}
* @default false
* @apioption mapNavigation.enableDoubleClickZoomTo
*/
/**
* Enables zooming by mouse wheel. By default it inherits the [enabled](
* #mapNavigation.enabled) setting.
*
* @type {boolean}
* @apioption mapNavigation.enableMouseWheelZoom
*/
/**
* Whether to enable multitouch zooming. Note that if the chart covers the
* viewport, this prevents the user from using multitouch and touchdrag on
* the web page, so you should make sure the user is not trapped inside the
* chart. By default it inherits the [enabled](#mapNavigation.enabled)
* setting.
*
* @type {boolean}
* @apioption mapNavigation.enableTouchZoom
*/
/**
* Sensitivity of mouse wheel or trackpad scrolling. 1 is no sensitivity,
* while with 2, one mouse wheel delta will zoom in 50%.
*
* @since 4.2.4
*/
mouseWheelSensitivity: 1.1
// Enabled: false,
// enableButtons: null, // inherit from enabled
// enableTouchZoom: null, // inherit from enabled
// enableDoubleClickZoom: null, // inherit from enabled
// enableDoubleClickZoomTo: false
// enableMouseWheelZoom: null, // inherit from enabled
};
/* *
*
* Default Export
*
* */
const mapNavigationDefaults = {
lang,
mapNavigation
};
/* harmony default export */ const MapNavigationDefaults = (mapNavigationDefaults);
;// ./code/es-modules/Maps/MapPointer.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
const { defined, extend, pick, wrap } = (external_highcharts_src_js_default_default());
/* *
*
* Composition
*
* */
var MapPointer;
(function (MapPointer) {
/* *
*
* Variables
*
* */
let totalWheelDelta = 0;
let totalWheelDeltaTimer;
/* *
*
* Functions
*
* */
/**
* Extend the Pointer.
* @private
*/
function compose(PointerClass) {
const pointerProto = PointerClass.prototype;
if (!pointerProto.onContainerDblClick) {
extend(pointerProto, {
onContainerDblClick,
onContainerMouseWheel
});
wrap(pointerProto, 'normalize', wrapNormalize);
wrap(pointerProto, 'zoomOption', wrapZoomOption);
}
}
MapPointer.compose = compose;
/**
* The event handler for the doubleclick event.
* @private
*/
function onContainerDblClick(e) {
const chart = this.chart;
e = this.normalize(e);
if (chart.options.mapNavigation.enableDoubleClickZoomTo) {
if (chart.pointer.inClass(e.target, 'highcharts-tracker') &&
chart.hoverPoint) {
chart.hoverPoint.zoomTo();
}
}
else if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
chart.mapZoom(0.5, void 0, void 0, e.chartX, e.chartY);
}
}
/**
* The event handler for the mouse scroll event.
* @private
*/
function onContainerMouseWheel(e) {
const chart = this.chart;
e = this.normalize(e);
// Firefox uses e.deltaY or e.detail, WebKit and IE uses wheelDelta
// try wheelDelta first #15656
const delta = (defined(e.wheelDelta) && -e.wheelDelta / 120) ||
e.deltaY || e.detail;
// Wheel zooming on trackpads have different behaviours in Firefox vs
// WebKit. In Firefox the delta increments in steps by 1, so it is not
// distinguishable from true mouse wheel. Therefore we use this timer
// to avoid trackpad zooming going too fast and out of control. In
// WebKit however, the delta is < 1, so we simply disable animation in
// the `chart.mapZoom` call below.
if (Math.abs(delta) >= 1) {
totalWheelDelta += Math.abs(delta);
if (totalWheelDeltaTimer) {
clearTimeout(totalWheelDeltaTimer);
}
totalWheelDeltaTimer = setTimeout(() => {
totalWheelDelta = 0;
}, 50);
}
if (totalWheelDelta < 10 && chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop) && chart.mapView) {
chart.mapView.zoomBy((chart.options.mapNavigation.mouseWheelSensitivity -
1) * -delta, void 0, [e.chartX, e.chartY],
// Delta less than 1 indicates stepless/trackpad zooming, avoid
// animation delaying the zoom
Math.abs(delta) < 1 ? false : void 0);
}
}
/**
* Add lon and lat information to pointer events
* @private
*/
function wrapNormalize(proceed, e, chartPosition) {
const chart = this.chart;
e = proceed.call(this, e, chartPosition);
if (chart && chart.mapView) {
const lonLat = chart.mapView.pixelsToLonLat({
x: e.chartX - chart.plotLeft,
y: e.chartY - chart.plotTop
});
if (lonLat) {
extend(e, lonLat);
}
}
return e;
}
/**
* The pinchType is inferred from mapNavigation options.
* @private
*/
function wrapZoomOption(proceed) {
const mapNavigation = this.chart.options.mapNavigation;
// Pinch status
if (mapNavigation &&
pick(mapNavigation.enableTouchZoom, mapNavigation.enabled)) {
this.chart.zooming.pinchType = 'xy';
}
proceed.apply(this, [].slice.call(arguments, 1));
}
})(MapPointer || (MapPointer = {}));
/* *
*
* Default Export
*
* */
/* harmony default export */ const Maps_MapPointer = (MapPointer);
;// ./code/es-modules/Maps/MapSymbols.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
/* *
*
* Variables
*
* */
let symbols;
/* *
*
* Functions
*
* */
/**
*
*/
function bottomButton(x, y, w, h, options) {
if (options) {
const r = options?.r || 0;
options.brBoxY = y - r;
options.brBoxHeight = h + r;
}
return symbols.roundedRect(x, y, w, h, options);
}
/**
*
*/
function compose(SVGRendererClass) {
symbols = SVGRendererClass.prototype.symbols;
symbols.bottombutton = bottomButton;
symbols.topbutton = topButton;
}
/**
*
*/
function topButton(x, y, w, h, options) {
if (options) {
const r = options?.r || 0;
options.brBoxHeight = h + r;
}
return symbols.roundedRect(x, y, w, h, options);
}
/* *
*
* Default Export
*
* */
const MapSymbols = {
compose
};
/* harmony default export */ const Maps_MapSymbols = (MapSymbols);
;// ./code/es-modules/Maps/MapNavigation.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
const { setOptions } = (external_highcharts_src_js_default_default());
const { composed } = (external_highcharts_src_js_default_default());
const { addEvent, extend: MapNavigation_extend, merge, objectEach, pick: MapNavigation_pick, pushUnique } = (external_highcharts_src_js_default_default());
/* *
*
* Functions
*
* */
/**
* @private
*/
function stopEvent(e) {
if (e) {
e.preventDefault?.();
e.stopPropagation?.();
e.cancelBubble = true;
}
}
/* *
*
* Class
*
* */
/**
* The MapNavigation handles buttons for navigation in addition to mousewheel
* and doubleclick handlers for chart zooming.
*
* @private
* @class
* @name MapNavigation
*
* @param {Highcharts.Chart} chart
* The Chart instance.
*/
class MapNavigation {
/* *
*
* Static Functions
*
* */
static compose(MapChartClass, PointerClass, SVGRendererClass) {
Maps_MapPointer.compose(PointerClass);
Maps_MapSymbols.compose(SVGRendererClass);
if (pushUnique(composed, 'Map.Navigation')) {
// Extend the Chart.render method to add zooming and panning
addEvent(MapChartClass, 'beforeRender', function () {
// Render the plus and minus buttons. Doing this before the
// shapes makes getBBox much quicker, at least in Chrome.
this.mapNavigation = new MapNavigation(this);
this.mapNavigation.update();
});
setOptions(MapNavigationDefaults);
}
}
/* *
*
* Constructor
*
* */
constructor(chart) {
this.chart = chart;
this.navButtons = [];
}
/* *
*
* Functions
*
* */
/**
* Update the map navigation with new options. Calling this is the same as
* calling `chart.update({ mapNavigation: {} })`.
*
* @function MapNavigation#update
*
* @param {Partial<Highcharts.MapNavigationOptions>} [options]
* New options for the map navigation.
*/
update(options) {
const mapNav = this, chart = mapNav.chart, navButtons = mapNav.navButtons, outerHandler = function (e) {
this.handler.call(chart, e);
stopEvent(e); // Stop default click event (#4444)
};
let navOptions = chart.options.mapNavigation;
// Merge in new options in case of update, and register back to chart
// options.
if (options) {
navOptions = chart.options.mapNavigation =
merge(chart.options.mapNavigation, options);
}
// Destroy buttons in case of dynamic update
while (navButtons.length) {
navButtons.pop()?.destroy();
}
if (!chart.renderer.forExport &&
MapNavigation_pick(navOptions.enableButtons, navOptions.enabled)) {
if (!mapNav.navButtonsGroup) {
mapNav.navButtonsGroup = chart.renderer.g()
.attr({
zIndex: 7 // #4955, #8392, #20476
})
.add();
}
objectEach(navOptions.buttons, (buttonOptions, n) => {
buttonOptions = merge(navOptions.buttonOptions, buttonOptions);
const attr = {
padding: buttonOptions.padding
};
// Presentational
if (!chart.styledMode && buttonOptions.theme) {
MapNavigation_extend(attr, buttonOptions.theme);
attr.style = merge(buttonOptions.theme.style, buttonOptions.style // #3203
);
}
const { text, width = 0, height = 0, padding = 0 } = buttonOptions;
const button = chart.renderer
.button(
// Display the text from options only if it is not plus
// or minus
(text !== '+' && text !== '-' && text) || '', 0, 0, outerHandler, attr, void 0, void 0, void 0, n === 'zoomIn' ? 'topbutton' : 'bottombutton')
.addClass('highcharts-map-navigation highcharts-' + {
zoomIn: 'zoom-in',
zoomOut: 'zoom-out'
}[n])
.attr({
width,
height,
title: chart.options.lang[n],
zIndex: 5
})
.add(mapNav.navButtonsGroup);
// Add SVG paths for the default symbols, because the text
// representation of + and - is not sharp and position is not
// easy to control.
if (text === '+' || text === '-') {
// Mysterious +1 to achieve centering
const w = width + 1, d = [
['M', padding + 3, padding + height / 2],
['L', padding + w - 3, padding + height / 2]
];
if (text === '+') {
d.push(['M', padding + w / 2, padding + 3], ['L', padding + w / 2, padding + height - 3]);
}
chart.renderer
.path(d)
.addClass('highcharts-button-symbol')
.attr(chart.styledMode ? {} : {
stroke: buttonOptions.style?.color,
'stroke-width': 3,
'stroke-linecap': 'round'
})
.add(button);
}
button.handler = buttonOptions.onclick;
// Stop double click event (#4444)
addEvent(button.element, 'dblclick', stopEvent);
navButtons.push(button);
MapNavigation_extend(buttonOptions, {
width: button.width,
height: 2 * (button.height || 0)
});
if (!chart.hasLoaded) {
// Align it after the plotBox is known (#12776)
const unbind = addEvent(chart, 'load', () => {
// #15406: Make sure button hasnt been destroyed
if (button.element) {
button.align(buttonOptions, false, buttonOptions.alignTo);
}
unbind();
});
}
else {
button.align(buttonOptions, false, buttonOptions.alignTo);
}
});
// Borrowed from overlapping-datalabels. Consider a shared module.
const isIntersectRect = (box1, box2) => !(box2.x >= box1.x + box1.width ||
box2.x + box2.width <= box1.x ||
box2.y >= box1.y + box1.height ||
box2.y + box2.height <= box1.y);
// Check the mapNavigation buttons collision with exporting button
// and translate the mapNavigation button if they overlap.
const adjustMapNavBtn = function () {
const expBtnBBox = chart.exportingGroup?.getBBox();
if (expBtnBBox) {
const navBtnsBBox = mapNav.navButtonsGroup.getBBox();
// If buttons overlap
if (isIntersectRect(expBtnBBox, navBtnsBBox)) {
// Adjust the mapNav buttons' position by translating
// them above or below the exporting button
const aboveExpBtn = -navBtnsBBox.y -
navBtnsBBox.height + expBtnBBox.y - 5, belowExpBtn = expBtnBBox.y + expBtnBBox.height -
navBtnsBBox.y + 5, mapNavVerticalAlign = (navOptions.buttonOptions &&
navOptions.buttonOptions.verticalAlign);
// If bottom aligned and adjusting the mapNav button
// would translate it out of the plotBox, translate it
// up instead of down
mapNav.navButtonsGroup.attr({
translateY: mapNavVerticalAlign === 'bottom' ?
aboveExpBtn :
belowExpBtn
});
}
}
};
if (!chart.hasLoaded) {
// Align it after the plotBox is known (#12776) and after the
// hamburger button's position is known so they don't overlap
// (#15782)
addEvent(chart, 'render', adjustMapNavBtn);
}
}
this.updateEvents(navOptions);
}
/**
* Update events, called internally from the update function. Add new event
* handlers, or unbinds events if disabled.
*
* @function MapNavigation#updateEvents
*
* @param {Partial<Highcharts.MapNavigationOptions>} options
* Options for map navigation.
*/
updateEvents(options) {
const chart = this.chart;
// Add the double click event
if (MapNavigation_pick(options.enableDoubleClickZoom, options.enabled) ||
options.enableDoubleClickZoomTo) {
this.unbindDblClick = this.unbindDblClick || addEvent(chart.container, 'dblclick', function (e) {
chart.pointer.onContainerDblClick(e);
});
}
else if (this.unbindDblClick) {
// Unbind and set unbinder to undefined
this.unbindDblClick = this.unbindDblClick();
}
// Add the mousewheel event
if (MapNavigation_pick(options.enableMouseWheelZoom, options.enabled)) {
this.unbindMouseWheel = this.unbindMouseWheel || addEvent(chart.container, 'wheel', function (e) {
// Prevent scrolling when the pointer is over the element
// with that class, for example anotation popup #12100.
if (!chart.pointer.inClass(e.target, 'highcharts-no-mousewheel')) {
const initialZoom = chart.mapView?.zoom;
chart.pointer.onContainerMouseWheel(e);
// If the zoom level changed, prevent the default action
// which is to scroll the page
if (initialZoom !== chart.mapView?.zoom) {
stopEvent(e);
}
}
return false;
});
}
else if (this.unbindMouseWheel) {
// Unbind and set unbinder to undefined
this.unbindMouseWheel = this.unbindMouseWheel();
}
}
}
/* *
*
* Default Export
*
* */
/* harmony default export */ const Maps_MapNavigation = (MapNavigation);
;// external ["../highcharts.src.js","default","SeriesRegistry"]
const external_highcharts_src_js_default_SeriesRegistry_namespaceObject = __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_8202131d__["default"].SeriesRegistry;
var external_highcharts_src_js_default_SeriesRegistry_default = /*#__PURE__*/__webpack_require__.n(external_highcharts_src_js_default_SeriesRegistry_namespaceObject);
;// external ["../highcharts.src.js","default","SVGElement"]
const external_highcharts_src_js_default_SVGElement_namespaceObject = __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_8202131d__["default"].SVGElement;
var external_highcharts_src_js_default_SVGElement_default = /*#__PURE__*/__webpack_require__.n(external_highcharts_src_js_default_SVGElement_namespaceObject);
;// ./code/es-modules/Series/ColorMapComposition.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
const { column: { prototype: columnProto } } = (external_highcharts_src_js_default_SeriesRegistry_default()).seriesTypes;
const { addEvent: ColorMapComposition_addEvent, defined: ColorMapComposition_defined } = (external_highcharts_src_js_default_default());
/* *
*
* Composition
*
* */
var ColorMapComposition;
(function (ColorMapComposition) {
/* *
*
* Constants
*
* */
ColorMapComposition.pointMembers = {
dataLabelOnNull: true,
moveToTopOnHover: true,
isValid: pointIsValid
};
ColorMapComposition.seriesMembers = {
colorKey: 'value',
axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
parallelArrays: ['x', 'y', 'value'],
pointArrayMap: ['value'],
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
colorAttribs: seriesColorAttribs,
pointAttribs: columnProto.pointAttribs
};
/* *
*
* Functions
*
* */
/**
* @private
*/
function compose(SeriesClass) {
const PointClass = SeriesClass.prototype.pointClass;
ColorMapComposition_addEvent(PointClass, 'afterSetState', onPointAfterSetState);
return SeriesClass;
}
ColorMapComposition.compose = compose;
/**
* Move points to the top of the z-index order when hovered.
* @private
*/
function onPointAfterSetState(e) {
const point = this, series = point.series, renderer = series.chart.renderer;
if (point.moveToTopOnHover && point.graphic) {
if (!series.stateMarkerGraphic) {
// Create a `use` element and add it to the end of the group,
// which would make it appear on top of the other elements. This
// deals with z-index without reordering DOM elements (#13049).
series.stateMarkerGraphic = new (external_highcharts_src_js_default_SVGElement_default())(renderer, 'use')
.css({
pointerEvents: 'none'
})
.add(point.graphic.parentGroup);
}
if (e?.state === 'hover') {
// Give the graphic DOM element the same id as the Point
// instance
point.graphic.attr({
id: this.id
});
series.stateMarkerGraphic.attr({
href: `${renderer.url}#${this.id}`,
visibility: 'visible'
});
}
else {
series.stateMarkerGraphic.attr({
href: ''
});
}
}
}
/**
* Color points have a value option that determines whether or not it is
* a null point
* @private
*/
function pointIsValid() {
return (this.value !== null &&
this.value !== Infinity &&
this.value !== -Infinity &&
// Undefined is allowed, but NaN is not (#17279)
(this.value === void 0 || !isNaN(this.value)));
}
/**
* Get the color attributes to apply on the graphic
* @private
* @function Highcharts.colorMapSeriesMixin.colorAttribs
* @param {Highcharts.Point} point
* @return {Highcharts.SVGAttributes}
* The SVG attributes
*/
function seriesColorAttribs(point) {
const ret = {};
if (ColorMapComposition_defined(point.color) &&
(!point.state || point.state === 'normal') // #15746
) {
ret[this.colorProp || 'fill'] = point.color;
}
return ret;
}
})(ColorMapComposition || (ColorMapComposition = {}));
/* *
*
* Default Export
*
* */
/* harmony default export */ const Series_ColorMapComposition = (ColorMapComposition);
;// external ["../highcharts.src.js","default","Series"]
const external_highcharts_src_js_default_Series_namespaceObject = __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_8202131d__["default"].Series;
var external_highcharts_src_js_default_Series_default = /*#__PURE__*/__webpack_require__.n(external_highcharts_src_js_default_Series_namespaceObject);
;// ./code/es-modules/Series/CenteredUtilities.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
const { deg2rad } = (external_highcharts_src_js_default_default());
const { fireEvent, isNumber, pick: CenteredUtilities_pick, relativeLength } = (external_highcharts_src_js_default_default());
/**
* @private
*/
var CenteredUtilities;
(function (CenteredUtilities) {
/* *
*
* Declarations
*
* */
/* *
*
* Functions
*
* */
/* eslint-disable valid-jsdoc */
/**
* Get the center of the pie based on the size and center options relative
* to the plot area. Borrowed by the polar and gauge series types.
*
* @private
* @function Highcharts.CenteredSeriesMixin.getCenter
*/
function getCenter() {
const options = this.options, chart = this.chart, slicingRoom = 2 * (options.slicedOffset || 0), plotWidth = chart.plotWidth - 2 * slicingRoom, plotHeight = chart.plotHeight - 2 * slicingRoom, centerOption = options.center, smallestSize = Math.min(plotWidth, plotHeight), thickness = options.thickness;
let handleSlicingRoom, size = options.size, innerSize = options.innerSize || 0, i, value;
if (typeof size === 'string') {
size = parseFloat(size);
}
if (typeof innerSize === 'string') {
innerSize = parseFloat(innerSize);
}
const positions = [
CenteredUtilities_pick(centerOption?.[0], '50%'),
CenteredUtilities_pick(centerOption?.[1], '50%'),
// Prevent from negative values
CenteredUtilities_pick(size && size < 0 ? void 0 : options.size, '100%'),
CenteredUtilities_pick(innerSize && innerSize < 0 ? void 0 : options.innerSize || 0, '0%')
];
// No need for inner size in angular (gauges) series but still required
// for pie series
if (chart.angular && !(this instanceof (external_highcharts_src_js_default_Series_default()))) {
positions[3] = 0;
}
for (i = 0; i < 4; ++i) {
value = positions[i];
handleSlicingRoom = i < 2 || (i === 2 && /%$/.test(value));
// I == 0: centerX, relative to width
// i == 1: centerY, relative to height
// i == 2: size, relative to smallestSize
// i == 3: innerSize, relative to size
positions[i] = relativeLength(value, [plotWidth, plotHeight, smallestSize, positions[2]][i]) + (handleSlicingRoom ? slicingRoom : 0);
}
// Inner size cannot be larger than size (#3632)
if (positions[3] > positions[2]) {
positions[3] = positions[2];
}
// Thickness overrides innerSize, need to be less than pie size (#6647)
if (isNumber(thickness) &&
thickness * 2 < positions[2] && thickness > 0) {
positions[3] = positions[2] - thickness * 2;
}
fireEvent(this, 'afterGetCenter', { positions });
return positions;
}
CenteredUtilities.getCenter = getCenter;
/**
* GetStartAndEndRadians - Calculates start and end angles in radians.
* Used in series types such as pie and sunburst.
*
* @private
* @function Highcharts.CenteredSeriesMixin.getStartAndEndRadians
*
* @param {number} [start]
* Start angle in degrees.
*
* @param {number} [end]
* Start angle in degrees.
*
* @return {Highcharts.RadianAngles}
* Returns an object containing start and end angles as radians.
*/
function getStartAndEndRadians(start, end) {
const startAngle = isNumber(start) ? start : 0, // Must be a number
endAngle = ((isNumber(end) && // Must be a number
end > startAngle && // Must be larger than the start angle
// difference must be less than 360 degrees
(end - startAngle) < 360) ?
end :
startAngle + 360), correction = -90;
return {
start: deg2rad * (startAngle + correction),
end: deg2rad * (endAngle + correction)
};
}
CenteredUtilities.getStartAndEndRadians = getStartAndEndRadians;
})(CenteredUtilities || (CenteredUtilities = {}));
/* *
*
* Default Export
*
* */
/* harmony default export */ const Series_CenteredUtilities = (CenteredUtilities);
/* *
*
* API Declarations
*
* */
/**
* @private
* @interface Highcharts.RadianAngles
*/ /**
* @name Highcharts.RadianAngles#end
* @type {number}
*/ /**
* @name Highcharts.RadianAngles#start
* @type {number}
*/
''; // Keeps doclets above in JS file
;// external ["../highcharts.src.js","default","Chart"]
const external_highcharts_src_js_default_Chart_namespaceObject = __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_8202131d__["default"].Chart;
var external_highcharts_src_js_default_Chart_default = /*#__PURE__*/__webpack_require__.n(external_highcharts_src_js_default_Chart_namespaceObject);
;// external ["../highcharts.src.js","default","SVGRenderer"]
const external_highcharts_src_js_default_SVGRenderer_namespaceObject = __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_8202131d__["default"].SVGRenderer;
var external_highcharts_src_js_default_SVGRenderer_default = /*#__PURE__*/__webpack_require__.n(external_highcharts_src_js_default_SVGRenderer_namespaceObject);
;// ./code/es-modules/Core/Chart/MapChart.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
const { getOptions } = (external_highcharts_src_js_default_default());
const { isNumber: MapChart_isNumber, merge: MapChart_merge, pick: MapChart_pick } = (external_highcharts_src_js_default_default());
/* *
*
* Class
*
* */
/**
* Map-optimized chart. Use {@link Highcharts.Chart|Chart} for common charts.
*
* @requires modules/map
*
* @class
* @name Highcharts.MapChart
* @extends Highcharts.Chart
*/
class MapChart extends (external_highcharts_src_js_default_Chart_default()) {
/* *
*
* Functions
*
* */
/**
* Initializes the chart. The constructor's arguments are passed on
* directly.
*
* @function Highcharts.MapChart#init
*
* @param {Highcharts.Options} userOptions
* Custom options.
*
* @param {Function} [callback]
* Function to run when the chart has loaded and all external
* images are loaded.
*
*
* @emits Highcharts.MapChart#event:init
* @emits Highcharts.MapChart#event:afterInit
*/
init(userOptions, callback) {
const defaultCreditsOptions = getOptions().credits;
const options = MapChart_merge({
chart: {
panning: {
enabled: true,
type: 'xy'
},
type: 'map'
},
credits: {
mapText: MapChart_pick(defaultCreditsOptions.mapText, ' \u00a9 <a href="{geojson.copyrightUrl}">' +
'{geojson.copyrightShort}</a>'),
mapTextFull: MapChart_pick(defaultCreditsOptions.mapTextFull, '{geojson.copyright}')
},
mapView: {}, // Required to enable Chart.mapView
tooltip: {
followTouchMove: false
}
}, userOptions // User's options
);
super.init(options, callback);
}
/**
* Highcharts Maps only. Zoom in or out of the map. See also
* {@link Point#zoomTo}. See {@link Chart#fromLatLonToPoint} for how to get
* the `centerX` and `centerY` parameters for a geographic location.
*
* Deprecated as of v9.3 in favor of [MapView.zoomBy](https://api.highcharts.com/class-reference/Highcharts.MapView#zoomBy).
*
* @deprecated
* @function Highcharts.Chart#mapZoom
*
* @param {number} [howMuch]
* How much to zoom the map. Values less than 1 zooms in. 0.5 zooms
* in to half the current view. 2 zooms to twice the current view. If
* omitted, the zoom is reset.
*
* @param {number} [xProjected]
* The projected x position to keep stationary when zooming, if
* available space.
*
* @param {number} [yProjected]
* The projected y position to keep stationary when zooming, if
* available space.
*
* @param {number} [chartX]
* Keep this chart position stationary if possible. This is used for
* example in `mousewheel` events, where the area under the mouse
* should be fixed as we zoom in.
*
* @param {number} [chartY]
* Keep this chart position stationary if possible.
*/
mapZoom(howMuch, xProjected, yProjected, chartX, chartY) {
if (this.mapView) {
if (MapChart_isNumber(howMuch)) {
// Compliance, mapView.zoomBy uses different values
howMuch = Math.log(howMuch) / Math.log(0.5);
}
this.mapView.zoomBy(howMuch, MapChart_isNumber(xProjected) && MapChart_isNumber(yProjected) ?
this.mapView.projection.inverse([xProjected, yProjected]) :
void 0, MapChart_isNumber(chartX) && MapChart_isNumber(chartY) ?
[chartX, chartY] :
void 0);
}
}
update(options) {
// Calculate and set the recommended map view if map option is set
if (options.chart && 'map' in options.chart) {
this.mapView?.recommendMapView(this, [
options.chart.map,
...(this.options.series || []).map((s) => s.mapData)
], true);
}
super.update.apply(this, arguments);
}
}
/* *
*
* Class Namespace
*
* */
(function (MapChart) {
/* *
*
* Constants
*
* */
/**
* Contains all loaded map data for Highmaps.
*
* @requires modules/map
*
* @name Highcharts.maps
* @type {Record<string,*>}
*/
MapChart.maps = {};
/* *
*
* Functions
*
* */
/**
* The factory function for creating new map charts. Creates a new {@link
* Highcharts.MapChart|MapChart} object with different default options than
* the basic Chart.
*
* @requires modules/map
*
* @function Highcharts.mapChart
*
* @param {string|Highcharts.HTMLDOMElement} [renderTo]
* The DOM element to render to, or its id.
*
* @param {Highcharts.Options} options
* The chart options structure as described in the
* [options reference](https://api.highcharts.com/highstock).
*
* @param {Highcharts.ChartCallbackFunction} [callback]
* A function to execute when the chart object is finished
* rendering and all external image files (`chart.backgroundImage`,
* `chart.plotBackgroundImage` etc) are loaded. Defining a
* [chart.events.load](https://api.highcharts.com/highstock/chart.events.load)
* handler is equivalent.
*
* @return {Highcharts.MapChart}
* The chart object.
*/
function mapChart(a, b, c) {
return new MapChart(a, b, c);
}
MapChart.mapChart = mapChart;
/**
* Utility for reading SVG paths directly.
*
* @requires modules/map
*
* @function Highcharts.splitPath
*
* @param {string|Array<(string|number)>} path
* Path to split.
*
* @return {Highcharts.SVGPathArray}
* Splitted SVG path
*/
function splitPath(path) {
let arr;
if (typeof path === 'string') {
path = path
// Move letters apart
.replace(/([A-Z])/gi, ' $1 ')
// Trim
.replace(/^\s*/, '').replace(/\s*$/, '');
// Split on spaces and commas. The semicolon is bogus, designed to
// circumvent string replacement in the pre-v7 assembler that built
// specific styled mode files.
const split = path.split(/[ ,;]+/);
arr = split.map((item) => {
if (!/[A-Z]/i.test(item)) {
return parseFloat(item);
}
return item;
});
}
else {
arr = path;
}
return external_highcharts_src_js_default_SVGRenderer_default().prototype.pathToSegments(arr);
}
MapChart.splitPath = splitPath;
})(MapChart || (MapChart = {}));
/* *
*
* Default Export
*
* */
/* harmony default export */ const Chart_MapChart = (MapChart);
;// ./code/es-modules/Maps/MapUtilities.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
// Compute bounds from a path element
const boundsFromPath = function (path) {
let x2 = -Number.MAX_VALUE, x1 = Number.MAX_VALUE, y2 = -Number.MAX_VALUE, y1 = Number.MAX_VALUE, validBounds;
path.forEach((seg) => {
const x = seg[seg.length - 2], y = seg[seg.length - 1];
if (typeof x === 'number' &&
typeof y === 'number') {
x1 = Math.min(x1, x);
x2 = Math.max(x2, x);
y1 = Math.min(y1, y);
y2 = Math.max(y2, y);
validBounds = true;
}
});
if (validBounds) {
return { x1, y1, x2, y2 };
}
};
/* *
*
* Default Export
*
* */
const MapUtilities = {
boundsFromPath
};
/* harmony default export */ const Maps_MapUtilities = (MapUtilities);
;// ./code/es-modules/Series/Map/MapPoint.js
/* *
*
* (c) 2010-2025 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
const { boundsFromPath: MapPoint_boundsFromPath } = Maps_MapUtilities;
const ScatterPoint = (external_highcharts_src_js_default_SeriesRegistry_default()).seriesTypes.scatter.prototype.pointClass;
const { extend: MapPoint_extend, isNumber: MapPoint_isNumber, pick: MapPoint_pick } = (external_highcharts_src_js_default_default());
/* *
*
* Class
*
* */
class MapPoint extends ScatterPoint {
/* *
*
* Static Functions
*
* */
/**
* Get the projected path based on the geometry. May also be called on
* mapData options (not point instances), hence static.
* @private
*/
static getProjectedPath(point, projection) {
if (!point.projectedPath) {
if (projection && point.geometry) {
// Always true when given GeoJSON coordinates
projection.hasCoordinates = true;
point.projectedPath = projection.path(point.geometry);
// SVG path given directly in point options
}
else {
point.projectedPath = point.path;
}
}
return point.projectedPath || [];
}
/* *
*
* Functions
*
* */
/**
* Extend the Point object to split paths.
* @private
*/
applyOptions(options, x) {
const series = this.series, point = super.applyOptions(options, x), joinBy = series.joinBy;
if (series.mapData && series.mapMap) {
const joinKey = joinBy[1], mapKey = super.getNestedProperty(joinKey), mapPoint = typeof mapKey !== 'undefined' &&
series.mapMap[mapKey];
if (mapPoint) {
// Copy over properties; #20231 prioritize point.name
MapPoint_extend(point, {
...mapPoint,
name: point.name ?? mapPoint.name
});
}
else if (series.pointArrayMap.indexOf('value') !== -1) {
point.value = point.value || null;
}
}
return point;
}
/**
* Get the bounds in terms of projected units
* @private
*/
getProjectedBounds(projection) {
const path = MapPoint.getProjectedPath(this, projection), bounds = MapPoint_boundsFromPath(path), properties = this.properties, mapView = this.series.chart.mapView;
if (bounds) {
// Cache point bounding box for use to position data labels, bubbles
// etc
const propMiddleLon = properties?.['hc-middle-lon'], propMiddleLat = properties?.['hc-middle-lat'];
if (mapView && MapPoint_isNumber(propMiddleLon) && MapPoint_isNumber(propMiddleLat)) {
const projectedPoint = projection.forward([propMiddleLon, propMiddleLat]);
bounds.midX = projectedPoint[0];
bounds.midY = projectedPoint[1];
}
else {
const propMiddleX = properties?.['hc-middle-x'], propMiddleY = properties?.['hc-middle-y'];
bounds.midX = (bounds.x1 + (bounds.x2 - bounds.x1) * MapPoint_pick(this.middleX, MapPoint_isNumber(propMiddleX) ? propMiddleX : 0.5));
let middleYFraction = MapPoint_pick(this.middleY, MapPoint_isNumber(propMiddleY) ? propMiddleY : 0.5);
// No geographic geometry, only path given => flip
if (!this.geometry) {
middleYFraction = 1 - middleYFraction;
}
bounds.midY =
bounds.y2 - (bounds.y2 - bo