UNPKG

highcharts

Version:
900 lines (886 loc) 24.7 kB
/** * @license Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/highcharts-autoload * * (c) 2009-2024 Torstein Honsi * * License: www.highcharts.com/license */ import { default as __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_c57973fa_default__ } from "./highcharts.src.js"; import * as __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_c57973fa__ from "./highcharts.src.js"; /******/ // The require scope /******/ const __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ const getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter/value functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ if(Array.isArray(definition)) { /******/ var i = 0; /******/ while(i < definition.length) { /******/ var key = definition[i++]; /******/ var binding = definition[i++]; /******/ if(!__webpack_require__.o(exports, key)) { /******/ if(binding === 0) { /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] }); /******/ } else { /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding }); /******/ } /******/ } else if(binding === 0) { i++; } /******/ } /******/ } else { /******/ 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" ;// external ["./highcharts.src.js","default"] const external_highcharts_src_js_default_namespaceObject = __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_c57973fa__["default"]; var external_highcharts_src_js_default_default = /*#__PURE__*/__webpack_require__.n(external_highcharts_src_js_default_namespaceObject); ;// ./code/es-modules/Extensions/Autoload/DependencyMapping.js /** * Dependencies for the autoload feature. * * DO NOT EDIT THIS FILE. This file is generated using the * 'gulp dependency-mapping' task. */ const DependencyMapping = { 'accessibility': [ 'modules/accessibility' ], 'annotations': [ 'modules/annotations' ], 'annotations.labelOptions.accessibility': [ 'modules/accessibility' ], 'annotations.labelOptions.includeInDataExport': [ 'modules/export-data' ], 'annotations.labels.point': [ 'modules/annotations' ], 'annotations.shapes.point': [ 'modules/annotations' ], 'annotations.type': [ 'modules/annotations-advanced' ], 'annotations.types': [ 'modules/annotations-advanced' ], 'boost': [ 'modules/boost' ], 'chart.displayErrors': [ 'modules/debugger' ], 'chart.events.afterPrint': [ 'modules/exporting' ], 'chart.events.beforePrint': [ 'modules/exporting' ], 'chart.events.drilldown': [ 'modules/drilldown' ], 'chart.events.drillup': [ 'modules/drilldown' ], 'chart.events.drillupall': [ 'modules/drilldown' ], 'chart.events.exportData': [ 'modules/exporting', 'modules/export-data' ], 'chart.events.fullscreenClose': [ 'modules/full-screen' ], 'chart.events.fullscreenOpen': [ 'modules/full-screen' ], 'chart.options3d': [ 'highcharts-3d' ], 'chart.parallelAxes': [ 'modules/parallel-coordinates' ], 'chart.parallelCoordinates': [ 'modules/parallel-coordinates' ], 'chart.polar': [ 'highcharts-more' ], 'chart.zoomKey': [ 'modules/draggable-points' ], 'chart.zooming.key': [ 'modules/draggable-points' ], 'chart.zooming.mouseWheel': [ 'modules/mouse-wheel-zoom' ], 'colorAxis': [ 'modules/coloraxis' ], 'data': [ 'modules/data' ], 'drilldown': [ 'modules/drilldown' ], 'exporting': [ 'modules/exporting' ], 'exporting.accessibility': [ 'modules/accessibility' ], 'exporting.csv': [ 'modules/exporting', 'modules/export-data' ], 'exporting.csv.annotations': [ 'modules/exporting', 'modules/export-data', 'modules/annotations' ], 'exporting.error': [ 'modules/exporting', 'modules/offline-exporting' ], 'exporting.fallbackToExportServer': [ 'modules/exporting', 'modules/offline-exporting' ], 'exporting.menuItemDefinitions.downloadCSV': [ 'modules/export-data' ], 'exporting.menuItemDefinitions.downloadXLS': [ 'modules/export-data' ], 'exporting.menuItemDefinitions.viewData': [ 'modules/export-data' ], 'exporting.pdfFont': [ 'modules/offline-exporting' ], 'exporting.showExportInProgress': [ 'modules/export-data' ], 'exporting.showTable': [ 'modules/exporting', 'modules/export-data' ], 'exporting.tableCaption': [ 'modules/exporting', 'modules/export-data' ], 'exporting.useMultiLevelHeaders': [ 'modules/exporting', 'modules/export-data' ], 'exporting.useRowspanHeaders': [ 'modules/exporting', 'modules/export-data' ], 'legend.accessibility': [ 'modules/accessibility' ], 'legend.bubbleLegend': [ 'highcharts-more' ], 'navigation': [ 'modules/exporting' ], 'navigation.annotationsOptions': [ 'modules/annotations' ], 'navigation.bindings': [ 'modules/annotations' ], 'navigator.accessibility': [ 'modules/accessibility' ], 'noData': [ 'modules/no-data-to-display' ], 'pane': [ 'highcharts-more' ], 'plotOptions.series.data.connect': [ 'highcharts-gantt' ], 'plotOptions.series.data.description': [ 'modules/accessibility' ], 'plotOptions.series.data.dragDrop': [ 'modules/draggable-points' ], 'plotOptions.series.data.drilldown': [ 'modules/drilldown' ], 'series.abands': [ 'indicators/indicators', 'indicators/acceleration-bands' ], 'series.ad': [ 'indicators/indicators', 'indicators/accumulation-distribution' ], 'series.ao': [ 'indicators/indicators', 'indicators/ao' ], 'series.apo': [ 'indicators/indicators', 'indicators/apo' ], 'series.arcdiagram': [ 'modules/sankey', 'modules/arc-diagram' ], 'series.arearange': [ 'highcharts-more' ], 'series.areasplinerange': [ 'highcharts-more' ], 'series.aroon': [ 'indicators/indicators', 'indicators/aroon' ], 'series.aroonoscillator': [ 'indicators/indicators', 'indicators/aroon', 'indicators/aroon-oscillator' ], 'series.atr': [ 'indicators/indicators', 'indicators/atr' ], 'series.bb': [ 'indicators/indicators', 'indicators/bollinger-bands' ], 'series.bellcurve': [ 'modules/histogram-bellcurve' ], 'series.boxplot': [ 'highcharts-more' ], 'series.bubble': [ 'highcharts-more' ], 'series.bullet': [ 'modules/bullet' ], 'series.cci': [ 'indicators/indicators', 'indicators/cci' ], 'series.chaikin': [ 'indicators/indicators', 'indicators/chaikin' ], 'series.cmf': [ 'indicators/indicators', 'indicators/cmf' ], 'series.cmo': [ 'indicators/indicators', 'indicators/cmo' ], 'series.columnpyramid': [ 'highcharts-more' ], 'series.columnrange': [ 'highcharts-more' ], 'series.cylinder': [ 'highcharts-3d', 'modules/cylinder' ], 'series.dema': [ 'indicators/indicators', 'indicators/dema' ], 'series.dependencywheel': [ 'modules/sankey', 'modules/dependency-wheel' ], 'series.disparityindex': [ 'indicators/indicators', 'indicators/disparity-index' ], 'series.dmi': [ 'indicators/indicators', 'indicators/dmi' ], 'series.dpo': [ 'indicators/indicators', 'indicators/dpo' ], 'series.dumbbell': [ 'highcharts-more', 'modules/dumbbell' ], 'series.ema': [ 'indicators/indicators' ], 'series.errorbar': [ 'highcharts-more' ], 'series.flowmap': [ 'modules/flowmap' ], 'series.funnel': [ 'modules/funnel' ], 'series.funnel3d': [ 'highcharts-3d', 'modules/cylinder', 'modules/funnel3d' ], 'series.gantt': [ 'highcharts-gantt' ], 'series.gauge': [ 'highcharts-more' ], 'series.geoheatmap': [ 'modules/geoheatmap' ], 'series.heatmap': [ 'modules/heatmap' ], 'series.heikinashi': [ 'modules/heikinashi' ], 'series.histogram': [ 'modules/histogram-bellcurve' ], 'series.hollowcandlestick': [ 'modules/hollowcandlestick' ], 'series.ikh': [ 'indicators/indicators', 'indicators/ichimoku-kinko-hyo' ], 'series.item': [ 'modules/item-series' ], 'series.keltnerchannels': [ 'indicators/indicators', 'indicators/keltner-channels' ], 'series.klinger': [ 'indicators/indicators', 'indicators/klinger' ], 'series.linearregression': [ 'indicators/indicators', 'indicators/regressions' ], 'series.linearregressionangle': [ 'indicators/indicators', 'indicators/regressions' ], 'series.linearregressionintercept': [ 'indicators/indicators', 'indicators/regressions' ], 'series.linearregressionslope': [ 'indicators/indicators', 'indicators/regressions' ], 'series.lollipop': [ 'highcharts-more', 'modules/dumbbell', 'modules/lollipop' ], 'series.macd': [ 'indicators/indicators', 'indicators/macd' ], 'series.mfi': [ 'indicators/indicators', 'indicators/mfi' ], 'series.momentum': [ 'indicators/indicators', 'indicators/momentum' ], 'series.natr': [ 'indicators/indicators', 'indicators/atr', 'indicators/natr' ], 'series.networkgraph': [ 'modules/networkgraph' ], 'series.obv': [ 'indicators/indicators', 'indicators/obv' ], 'series.organization': [ 'modules/sankey', 'modules/organization' ], 'series.packedbubble': [ 'highcharts-more' ], 'series.pareto': [ 'modules/pareto' ], 'series.pc': [ 'indicators/indicators', 'indicators/price-channel' ], 'series.pictorial': [ 'modules/pictorial' ], 'series.pivotpoints': [ 'indicators/indicators', 'indicators/pivot-points' ], 'series.pointandfigure': [ 'modules/pointandfigure' ], 'series.polygon': [ 'highcharts-more' ], 'series.ppo': [ 'indicators/indicators', 'indicators/ppo' ], 'series.priceenvelopes': [ 'indicators/indicators', 'indicators/price-envelopes' ], 'series.psar': [ 'indicators/indicators', 'indicators/psar' ], 'series.pyramid': [ 'modules/funnel' ], 'series.pyramid3d': [ 'highcharts-3d', 'modules/cylinder', 'modules/funnel3d', 'modules/pyramid3d' ], 'series.renko': [ 'modules/renko' ], 'series.roc': [ 'indicators/indicators', 'indicators/roc' ], 'series.rsi': [ 'indicators/indicators', 'indicators/rsi' ], 'series.sankey': [ 'modules/sankey' ], 'series.scatter3d': [ 'highcharts-3d' ], 'series.slowstochastic': [ 'indicators/indicators', 'indicators/stochastic', 'indicators/slow-stochastic' ], 'series.sma': [ 'indicators/indicators' ], 'series.solidgauge': [ 'highcharts-more', 'modules/solid-gauge' ], 'series.stochastic': [ 'indicators/indicators', 'indicators/stochastic' ], 'series.streamgraph': [ 'modules/streamgraph' ], 'series.sunburst': [ 'modules/sunburst' ], 'series.supertrend': [ 'indicators/indicators', 'indicators/supertrend' ], 'series.tema': [ 'indicators/indicators', 'indicators/tema' ], 'series.tiledwebmap': [ 'modules/tiledwebmap' ], 'series.tilemap': [ 'modules/tilemap' ], 'series.timeline': [ 'modules/timeline' ], 'series.treegraph': [ 'modules/treemap', 'modules/treegraph' ], 'series.treemap': [ 'modules/treemap' ], 'series.trendline': [ 'indicators/indicators', 'indicators/trendline' ], 'series.trix': [ 'indicators/indicators', 'indicators/tema', 'indicators/trix' ], 'series.variablepie': [ 'modules/variable-pie' ], 'series.variwide': [ 'modules/variwide' ], 'series.vbp': [ 'indicators/indicators', 'indicators/volume-by-price' ], 'series.vector': [ 'modules/vector' ], 'series.venn': [ 'modules/venn' ], 'series.vwap': [ 'indicators/indicators', 'indicators/vwap' ], 'series.waterfall': [ 'highcharts-more' ], 'series.williamsr': [ 'indicators/indicators', 'indicators/williams-r' ], 'series.windbarb': [ 'modules/windbarb' ], 'series.wma': [ 'indicators/indicators', 'indicators/wma' ], 'series.wordcloud': [ 'modules/wordcloud' ], 'series.xrange': [ 'modules/xrange' ], 'series.zigzag': [ 'indicators/indicators', 'indicators/zigzag' ], 'sonification': [ 'modules/sonification' ], 'stockTools': [ 'modules/stock-tools' ], 'xAxis.accessibility': [ 'modules/accessibility' ], 'xAxis.labels.position3d': [ 'highcharts-3d' ], 'xAxis.labels.skew3d': [ 'highcharts-3d' ], 'xAxis.title.position3d': [ 'highcharts-3d' ], 'xAxis.title.skew3d': [ 'highcharts-3d' ], 'yAxis.maxLength': [ 'modules/drag-panes' ], 'yAxis.minLength': [ 'modules/drag-panes' ], 'yAxis.resize': [ 'modules/drag-panes' ], 'yAxis.stackShadow': [ 'modules/pictorial' ], 'yAxis.tooltipValueFormat': [ 'modules/parallel-coordinates' ] }; /* harmony default export */ const Autoload_DependencyMapping = (DependencyMapping); ;// ./code/es-modules/Extensions/Autoload/Loader.js /* * * * (c) 2010-2024 Torstein Honsi * * License: www.highcharts.com/license * * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! * * */ const H = (external_highcharts_src_js_default_default()); const addedFiles = []; const loaded = []; // Default to root and extension that supports ESM imports. let root = './', // In compiled scripts, this gets replaced with .js by the scripts-compile // task. extension = '.src.js'; const addStyleSheets = (options, files) => { // Styled mode if (options.chart?.styledMode) { (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(files, 'css/highcharts.css'); } // Stock Tools if (options.stockTools) { (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(files, 'css/stocktools/gui.css'); (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(files, 'css/annotations/popup.css'); } }; const setRootFromURL = (url) => { const regex = /\/highcharts-autoload(\.src\.js|\.js)$/, match = url.match(regex); if (match) { root = url.replace(regex, '/'); extension = match[1]; return root; } }; const guessRoot = () => { const scripts = document.getElementsByTagName('script'); for (let i = 0; i < scripts.length; i++) { if (setRootFromURL(scripts[i].src)) { return; } } }; // Override the factories to load script files on demand ['chart', 'ganttChart', 'mapChart', 'stockChart'].forEach((factory) => { H[factory] = async function (container, options, callback) { guessRoot(); // Load the required files const files = Loader.getFiles(options); if (factory === 'stockChart') { files.unshift('modules/stock'); } else if (factory === 'ganttChart') { files.unshift('modules/gantt'); } else if (factory === 'mapChart') { files.unshift('modules/map'); } for (const file of files) { await loadFile(file); } const constructorName = { chart: 'Chart', ganttChart: 'GanttChart', mapChart: 'MapChart', stockChart: 'StockChart' }[factory]; return new H[constructorName](container, options, callback); }; }); const loadFile = async (file) => { if (loaded.includes(file)) { return; } const isCss = file.endsWith('.css'); // Relative root => ES modules if (root === '' || root.charAt(0) === '.') { try { if (!isCss) { await import( // eslint-disable-next-line capitalized-comments /* webpackIgnore: true */ `${root}${file}${extension}`); (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(loaded, file); } } catch (e) { /* eslint-disable-next-line no-console */ console.error(e); } return; } return new Promise((resolve, reject) => { const onload = () => { (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(loaded, file); resolve(void 0); }; const el = document.createElement(isCss ? 'link' : 'script'); if (isCss) { el.rel = 'stylesheet'; el.href = `${root}${file}`; } else { el.src = `${root}${file}${extension}`; } el.onload = onload; el.onerror = reject; document.head.appendChild(el); }); }; /** * The Loader class for autoloading of Highcharts modules. This class is part of * the `highcharts-autoload.js` bundle, and is used for dynamically loading * Highcharts modules on demand based on the chart configuration options. * * The Loader analyzes the chart options for features that require additional * modules. The Loader will load the required modules asynchronously before * instantiating the chart. * * For styled mode and Stock Tools, the Loader also adds the required CSS files. * An exception is when using ESM modules, where you need to define the CSS in * link tags. * * No extra configuration is required to use the Loader, the static class * methods below are for advanced use cases. * * @example * const chart = await Highcharts.chart({ * chart: { * type: 'arearange' * }, * series: [[0, 2], [4, 3]] * }, true) ; * * @sample highcharts/global/autoload-esm ESM setup with bubble chart and * modules * @sample highcharts/global/autoload UMD setup with stock chart and modules * * @class * @name Highcharts.Loader */ class Loader { } /** * Given a Highcharts configuration object, this function will return an * array of the required script files. Can be used for preloading files * before instanciating the chart. * * @function Highcharts.Loader#getFiles * * @param {Partial<Options>} options The Highcharts configuration object. * @return {Array<string>} An array of file names. */ Loader.getFiles = (options) => { const files = addedFiles.slice(); const recurse = (opts, path = []) => { Object.entries(opts).forEach(([key, value]) => { if (path.length === 1 && path[0] === 'series') { key = value.type || options.chart?.type || 'line'; } const fullKey = path.concat(key).join('.'), // Pick up properties that are set on series items, like // `dragDrop` or `label` seriesKey = fullKey.replace(/^series\.[a-zA-Z]+/, 'plotOptions.series'), fullKeys = [fullKey]; // Add special cases if (seriesKey !== fullKey) { fullKeys.push(seriesKey); } fullKeys.forEach((fullKey) => { if (fullKey in Autoload_DependencyMapping) { Autoload_DependencyMapping[fullKey].forEach((file) => (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(files, file)); } }); if (value && typeof value === 'object' && key !== 'data') { path.push(key); recurse(value, path); path.pop(); } }); }; recurse(options); // Advanced annotations if (options.annotations) { (0,external_highcharts_src_js_default_namespaceObject.splat)(options.annotations).forEach((annotation) => { ((annotation.type && (Autoload_DependencyMapping[`annotations.${annotation.type}`] || Autoload_DependencyMapping['annotations.type'])) || []).forEach((file) => (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(files, file)); }); } addStyleSheets(options, files); return Array.from(files); }; /** * Set the root URL and extension for script files. By default, the root and * extension are guessed from the script tag that loads * `highcharts-autoload.js`, or from the current script if running in ESM * mode. * * @function Highcharts.Loader#setRoot * * @param {string} [userRoot] * The root URL for script files. When loading from * `code.highcharts.com`, this defaults to * `https://code.highcharts.com/`. * @param {string} [userExtension] * The extension for script files. This defaults to `.js` when * invoked from `highcharts-autoload.js`, and `.src.js` when invoked * from `highcharts-autoload.src.js`. */ Loader.setRoot = (userRoot = root, userExtension = extension) => { root = userRoot; extension = userExtension; }; /** * Add script files to the list of modules to load. This is useful for * dynamically loading modules that have no reference in the options * structure. * * @example * // Load the accessibility and exporting modules without having to set * // `accessibility.enabled` and `exporting.enabled` in the chart options. * Highcharts.Loader.use(['modules/accessibility', 'modules/exporting']); * * @function Highcharts.Loader#use * * @param {Array<string>} files An array of files to add. */ Loader.use = (files) => { files.forEach((file) => (0,external_highcharts_src_js_default_namespaceObject.pushUnique)(addedFiles, file)); }; /* harmony default export */ const Autoload_Loader = (Loader); ;// ./code/es-modules/masters/highcharts-autoload.src.js __WEBPACK_EXTERNAL_MODULE__highcharts_src_js_c57973fa_default__.Loader = Autoload_Loader; /* harmony default export */ const highcharts_autoload_src = (__WEBPACK_EXTERNAL_MODULE__highcharts_src_js_c57973fa_default__); export { highcharts_autoload_src as default };