highcharts 9.2.0 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (755) hide show
  1. package/README.md +13 -6
  2. package/bower.json +1 -1
  3. package/css/annotations/popup.css +48 -8
  4. package/css/annotations/popup.scss +70 -22
  5. package/css/highcharts.css +45 -0
  6. package/css/highcharts.scss +40 -0
  7. package/css/themes/dark-unica.css +45 -0
  8. package/css/themes/grid-light.css +45 -0
  9. package/css/themes/sand-signika.css +45 -0
  10. package/es-modules/Accessibility/A11yI18n.js +273 -224
  11. package/es-modules/Accessibility/Accessibility.js +237 -128
  12. package/es-modules/Accessibility/AccessibilityComponent.js +79 -314
  13. package/es-modules/Accessibility/Components/AnnotationsA11y.js +10 -0
  14. package/es-modules/Accessibility/Components/ContainerComponent.js +52 -27
  15. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +173 -104
  16. package/es-modules/Accessibility/Components/LegendComponent.js +97 -65
  17. package/es-modules/Accessibility/Components/MenuComponent.js +243 -149
  18. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +170 -88
  19. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +152 -115
  20. package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +133 -68
  21. package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +64 -27
  22. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +38 -21
  23. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +380 -325
  24. package/es-modules/Accessibility/Components/ZoomComponent.js +28 -20
  25. package/es-modules/Accessibility/FocusBorder.js +192 -147
  26. package/es-modules/Accessibility/HighContrastMode.js +78 -66
  27. package/es-modules/Accessibility/HighContrastTheme.js +10 -0
  28. package/es-modules/Accessibility/KeyboardNavigation.js +146 -71
  29. package/es-modules/Accessibility/KeyboardNavigationHandler.js +71 -44
  30. package/es-modules/Accessibility/Options/DeprecatedOptions.js +11 -1
  31. package/es-modules/Accessibility/Options/LangOptions.js +1 -2
  32. package/es-modules/Accessibility/Options/Options.js +32 -17
  33. package/es-modules/Accessibility/ProxyElement.js +212 -0
  34. package/es-modules/Accessibility/ProxyProvider.js +305 -0
  35. package/es-modules/Accessibility/Utils/Announcer.js +15 -8
  36. package/es-modules/Accessibility/Utils/ChartUtilities.js +41 -16
  37. package/es-modules/Accessibility/Utils/DOMElementProvider.js +27 -15
  38. package/es-modules/Accessibility/Utils/EventProvider.js +27 -17
  39. package/es-modules/Accessibility/Utils/HTMLUtilities.js +125 -30
  40. package/es-modules/Core/Axis/Axis.js +37 -30
  41. package/es-modules/Core/Axis/AxisDefaults.js +35 -24
  42. package/es-modules/Core/Axis/Color/ColorAxisComposition.js +54 -4
  43. package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +5 -5
  44. package/es-modules/Core/Axis/OrdinalAxis.js +5 -13
  45. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +4 -5
  46. package/es-modules/Core/Axis/ScrollbarAxis.js +10 -3
  47. package/es-modules/Core/Axis/TreeGridAxis.js +2 -2
  48. package/es-modules/Core/Axis/TreeGridTick.js +1 -2
  49. package/es-modules/Core/Chart/Chart.js +2 -3
  50. package/es-modules/Core/Chart/ChartDefaults.js +3 -4
  51. package/es-modules/Core/Chart/ChartNavigationComposition.js +92 -0
  52. package/es-modules/Core/Chart/MapChart.js +10 -22
  53. package/es-modules/Core/Chart/StockChart.js +3 -293
  54. package/es-modules/Core/Color/Palettes.js +22 -0
  55. package/es-modules/Core/DefaultOptions.js +19 -17
  56. package/es-modules/Core/Foundation.js +39 -31
  57. package/es-modules/Core/Globals.js +1 -1
  58. package/es-modules/Core/HttpUtilities.js +3 -3
  59. package/es-modules/Core/Legend/Legend.js +7 -3
  60. package/es-modules/Core/Navigator.js +7 -8
  61. package/es-modules/Core/Pointer.js +39 -36
  62. package/es-modules/Core/Renderer/HTML/AST.js +3 -6
  63. package/es-modules/Core/Renderer/HTML/HTMLElement.js +23 -18
  64. package/es-modules/Core/Renderer/SVG/SVGElement.js +3 -4
  65. package/es-modules/Core/Renderer/SVG/SVGRenderer.js +21 -18
  66. package/es-modules/Core/Renderer/SVG/TextBuilder.js +17 -13
  67. package/es-modules/Core/ScrollbarDefaults.js +10 -9
  68. package/es-modules/Core/Series/DataLabel.js +2 -3
  69. package/es-modules/Core/Series/Point.js +5 -3
  70. package/es-modules/Core/Series/Series.js +156 -162
  71. package/es-modules/Core/Series/SeriesDefaults.js +3 -4
  72. package/es-modules/Core/Series/SeriesRegistry.js +1 -2
  73. package/es-modules/Core/Tooltip.js +44 -17
  74. package/es-modules/Core/Utilities.js +15 -7
  75. package/es-modules/Data/DataConverter.js +489 -0
  76. package/es-modules/Data/DataPromise.js +252 -0
  77. package/es-modules/Data/DataSeriesConverter.js +203 -0
  78. package/es-modules/Data/DataTable.js +1204 -0
  79. package/es-modules/Data/Modifiers/ChainModifier.js +299 -0
  80. package/es-modules/Data/Modifiers/DataModifier.js +303 -0
  81. package/es-modules/Data/Modifiers/GroupModifier.js +144 -0
  82. package/es-modules/Data/Modifiers/InvertModifier.js +254 -0
  83. package/es-modules/Data/Modifiers/RangeModifier.js +143 -0
  84. package/es-modules/Data/Modifiers/SeriesPointsModifier.js +110 -0
  85. package/es-modules/Data/Modifiers/SortModifier.js +249 -0
  86. package/es-modules/Data/Parsers/CSVParser.js +399 -0
  87. package/es-modules/Data/Parsers/DataParser.js +101 -0
  88. package/es-modules/Data/Parsers/GoogleSheetsParser.js +220 -0
  89. package/es-modules/Data/Parsers/HTMLTableParser.js +213 -0
  90. package/es-modules/Data/Stores/CSVStore.js +317 -0
  91. package/es-modules/Data/Stores/DataStore.js +276 -0
  92. package/es-modules/Data/Stores/GoogleSheetsStore.js +167 -0
  93. package/es-modules/Data/Stores/HTMLTableStore.js +351 -0
  94. package/es-modules/Extensions/Annotations/Annotations.js +61 -11
  95. package/es-modules/Extensions/Annotations/ControlPoint.js +1 -1
  96. package/es-modules/Extensions/Annotations/Controllables/ControllableEllipse.js +199 -0
  97. package/es-modules/Extensions/Annotations/Mixins/ControllableMixin.js +7 -1
  98. package/es-modules/Extensions/Annotations/NavigationBindings.js +90 -28
  99. package/es-modules/Extensions/Annotations/Popup.js +479 -141
  100. package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +51 -2
  101. package/es-modules/Extensions/Annotations/Types/CrookedLine.js +1 -1
  102. package/es-modules/Extensions/Annotations/Types/Fibonacci.js +2 -3
  103. package/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +219 -0
  104. package/es-modules/Extensions/Annotations/Types/InfinityLine.js +1 -1
  105. package/es-modules/Extensions/Annotations/Types/Measure.js +14 -8
  106. package/es-modules/Extensions/Annotations/Types/Pitchfork.js +5 -5
  107. package/es-modules/Extensions/Annotations/Types/TimeCycles.js +207 -0
  108. package/es-modules/Extensions/Annotations/Types/Tunnel.js +3 -5
  109. package/es-modules/Extensions/Annotations/Types/VerticalLine.js +1 -1
  110. package/es-modules/Extensions/Boost/BoostOptions.js +2 -2
  111. package/es-modules/Extensions/Boost/BoostOverrides.js +3 -1
  112. package/es-modules/Extensions/Boost/WGLShader.js +4 -3
  113. package/es-modules/Extensions/BoostCanvas.js +1 -2
  114. package/es-modules/Extensions/CurrentDateIndication.js +2 -3
  115. package/es-modules/Extensions/Data.js +73 -67
  116. package/es-modules/Extensions/DataGrouping.js +33 -18
  117. package/es-modules/Extensions/Debugger/ErrorMessages.js +2 -2
  118. package/es-modules/Extensions/DownloadURL.js +2 -2
  119. package/es-modules/Extensions/DragPanes.js +1 -2
  120. package/es-modules/Extensions/Drilldown.js +2 -3
  121. package/es-modules/Extensions/Exporting/Exporting.js +12 -11
  122. package/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -15
  123. package/es-modules/Extensions/GeoJSON.js +39 -63
  124. package/es-modules/Extensions/MarkerClusters.js +115 -97
  125. package/es-modules/Extensions/NoDataToDisplay.js +1 -2
  126. package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +10 -9
  127. package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
  128. package/es-modules/Extensions/Oldie/Oldie.js +2 -3
  129. package/es-modules/Extensions/Pane.js +5 -6
  130. package/es-modules/Extensions/Polar.js +1 -1
  131. package/es-modules/Extensions/RangeSelector.js +3 -4
  132. package/es-modules/Extensions/Sonification/ChartSonify.js +247 -637
  133. package/es-modules/Extensions/Sonification/Earcon.js +136 -102
  134. package/es-modules/Extensions/Sonification/Instrument.js +496 -426
  135. package/es-modules/Extensions/Sonification/MusicalFrequencies.js +10 -0
  136. package/es-modules/Extensions/Sonification/Options.js +10 -0
  137. package/es-modules/Extensions/Sonification/PointSonify.js +203 -152
  138. package/es-modules/Extensions/Sonification/SeriesSonify.js +459 -0
  139. package/es-modules/Extensions/Sonification/SignalHandler.js +124 -0
  140. package/es-modules/Extensions/Sonification/Sonification.js +26 -52
  141. package/es-modules/Extensions/Sonification/{Utilities.js → SonificationUtilities.js} +62 -84
  142. package/es-modules/Extensions/Sonification/Timeline.js +255 -567
  143. package/es-modules/Extensions/Sonification/TimelineEvent.js +158 -0
  144. package/es-modules/Extensions/Sonification/TimelinePath.js +311 -0
  145. package/es-modules/Maps/MapNavigation.js +27 -64
  146. package/es-modules/Maps/MapNavigationOptionsDefault.js +3 -0
  147. package/es-modules/Maps/MapPointer.js +7 -5
  148. package/es-modules/Maps/MapView.js +450 -0
  149. package/es-modules/Maps/MapViewOptionsDefault.js +97 -0
  150. package/es-modules/Maps/Projection.js +436 -0
  151. package/es-modules/Maps/ProjectionDefinition.js +9 -0
  152. package/es-modules/Maps/Projections/EqualEarth.js +42 -0
  153. package/es-modules/Maps/Projections/LambertConformalConic.js +52 -0
  154. package/es-modules/Maps/Projections/Miller.js +16 -0
  155. package/es-modules/Maps/Projections/Orthographic.js +26 -0
  156. package/es-modules/Maps/Projections/ProjectionRegistry.js +19 -0
  157. package/es-modules/Maps/Projections/WebMercator.js +24 -0
  158. package/es-modules/Series/AreaRange/AreaRangeSeries.js +4 -5
  159. package/es-modules/Series/Bellcurve/BellcurveSeries.js +2 -8
  160. package/es-modules/Series/BoxPlot/BoxPlotSeries.js +1 -2
  161. package/es-modules/Series/Bubble/BubbleLegendDefaults.js +1 -2
  162. package/es-modules/Series/Bubble/BubbleLegendItem.js +3 -3
  163. package/es-modules/Series/Bubble/BubblePoint.js +5 -0
  164. package/es-modules/Series/Bubble/BubbleSeries.js +90 -50
  165. package/es-modules/Series/Candlestick/CandlestickSeries.js +10 -18
  166. package/es-modules/{Mixins/CenteredSeries.js → Series/CenteredUtilities.js} +45 -23
  167. package/es-modules/Series/ColorMapComposition.js +109 -0
  168. package/es-modules/Series/Column/ColumnDataLabel.js +5 -5
  169. package/es-modules/Series/Column/ColumnSeries.js +3 -4
  170. package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +6 -6
  171. package/es-modules/Series/DataModifyComposition.js +539 -0
  172. package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +2 -6
  173. package/es-modules/Series/DerivedComposition.js +137 -0
  174. package/es-modules/Series/DrawPointComposition.js +111 -0
  175. package/es-modules/Series/Dumbbell/DumbbellSeries.js +2 -3
  176. package/es-modules/Series/ErrorBar/ErrorBarSeries.js +1 -2
  177. package/es-modules/Series/Flags/FlagsSeries.js +18 -25
  178. package/es-modules/Series/Funnel/FunnelSeries.js +6 -5
  179. package/es-modules/Series/Gantt/GanttSeries.js +0 -2
  180. package/es-modules/Series/Gauge/GaugePoint.js +1 -1
  181. package/es-modules/Series/Gauge/GaugeSeries.js +7 -7
  182. package/es-modules/Series/HLC/HLCPoint.js +55 -0
  183. package/es-modules/Series/HLC/HLCSeries.js +383 -0
  184. package/es-modules/Series/Heatmap/HeatmapPoint.js +3 -4
  185. package/es-modules/Series/Heatmap/HeatmapSeries.js +19 -6
  186. package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +2 -3
  187. package/es-modules/Series/Histogram/HistogramSeries.js +3 -7
  188. package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +2 -2
  189. package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +33 -34
  190. package/es-modules/Series/Line/LineSeries.js +1 -2
  191. package/es-modules/Series/Map/MapPoint.js +23 -16
  192. package/es-modules/Series/Map/MapSeries.js +271 -309
  193. package/es-modules/Series/MapBubble/MapBubblePoint.js +0 -3
  194. package/es-modules/Series/MapBubble/MapBubbleSeries.js +10 -1
  195. package/es-modules/Series/MapLine/MapLineSeries.js +2 -0
  196. package/es-modules/Series/MapPoint/MapPointPoint.js +5 -1
  197. package/es-modules/Series/MapPoint/MapPointSeries.js +99 -14
  198. package/es-modules/Series/Networkgraph/Networkgraph.js +5 -5
  199. package/es-modules/{Mixins/Nodes.js → Series/NodesComposition.js} +76 -29
  200. package/es-modules/Series/OHLC/OHLCPoint.js +2 -6
  201. package/es-modules/Series/OHLC/OHLCSeries.js +55 -183
  202. package/es-modules/{Mixins/OnSeries.js → Series/OnSeriesComposition.js} +53 -21
  203. package/es-modules/Series/Organization/OrganizationSeries.js +2 -3
  204. package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +46 -6
  205. package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -7
  206. package/es-modules/Series/Pie/PieDataLabel.js +1 -2
  207. package/es-modules/Series/Pie/PieSeries.js +6 -7
  208. package/es-modules/Series/Sankey/SankeyPoint.js +0 -4
  209. package/es-modules/Series/Sankey/SankeySeries.js +89 -20
  210. package/es-modules/Series/Sunburst/SunburstPoint.js +2 -3
  211. package/es-modules/Series/Sunburst/SunburstSeries.js +4 -4
  212. package/es-modules/Series/Tilemap/TilemapPoint.js +2 -3
  213. package/es-modules/Series/Timeline/TimelineSeries.js +3 -4
  214. package/es-modules/{Mixins/TreeSeries.js → Series/TreeUtilities.js} +86 -76
  215. package/es-modules/Series/Treemap/TreemapPoint.js +2 -2
  216. package/es-modules/Series/Treemap/TreemapSeries.js +8 -8
  217. package/es-modules/Series/Venn/VennPoint.js +16 -7
  218. package/es-modules/Series/Venn/VennSeries.js +5 -8
  219. package/es-modules/Series/Venn/VennUtils.js +550 -439
  220. package/es-modules/Series/Waterfall/WaterfallSeries.js +2 -3
  221. package/es-modules/Series/Windbarb/WindbarbSeries.js +23 -24
  222. package/es-modules/Series/Wordcloud/WordcloudPoint.js +8 -6
  223. package/es-modules/Series/Wordcloud/WordcloudSeries.js +24 -20
  224. package/es-modules/Series/Wordcloud/WordcloudUtils.js +673 -484
  225. package/es-modules/Series/XRange/XRangePoint.js +1 -0
  226. package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +3 -6
  227. package/es-modules/Stock/Indicators/AO/AOIndicator.js +2 -3
  228. package/es-modules/Stock/Indicators/APO/APOIndicator.js +14 -20
  229. package/es-modules/Stock/Indicators/Aroon/AroonIndicator.js +3 -6
  230. package/es-modules/Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js +11 -13
  231. package/es-modules/Stock/Indicators/ArrayUtilities.js +47 -0
  232. package/es-modules/Stock/Indicators/BB/BBIndicator.js +27 -11
  233. package/es-modules/Stock/Indicators/Chaikin/ChaikinIndicator.js +6 -12
  234. package/es-modules/Stock/Indicators/DEMA/DEMAIndicator.js +1 -11
  235. package/es-modules/Stock/Indicators/DMI/DMIIndicator.js +19 -11
  236. package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +17 -11
  237. package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +1 -3
  238. package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +11 -9
  239. package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +8 -16
  240. package/es-modules/Stock/Indicators/LinearRegression/LinearRegression.js +2 -2
  241. package/es-modules/Stock/Indicators/LinearRegressionAngle/LinearRegressionAngle.js +2 -2
  242. package/es-modules/Stock/Indicators/LinearRegressionIntercept/LinearRegressionIntercept.js +2 -2
  243. package/es-modules/Stock/Indicators/LinearRegressionSlopes/LinearRegressionSlopes.js +2 -2
  244. package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +1 -2
  245. package/es-modules/{Mixins/MultipleLines.js → Stock/Indicators/MultipleLinesComposition.js} +136 -87
  246. package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +1 -3
  247. package/es-modules/Stock/Indicators/PC/PCIndicator.js +14 -13
  248. package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +1 -11
  249. package/es-modules/Stock/Indicators/SMA/SMAComposition.js +0 -26
  250. package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +32 -49
  251. package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +0 -8
  252. package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +15 -8
  253. package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +4 -6
  254. package/es-modules/Stock/Indicators/TEMA/TEMAIndicator.js +26 -11
  255. package/es-modules/Stock/Indicators/TRIX/TRIXIndicator.js +6 -12
  256. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +23 -7
  257. package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +2 -3
  258. package/es-modules/Stock/StockToolsBindings.js +144 -42
  259. package/es-modules/Stock/StockToolsGui.js +409 -15
  260. package/es-modules/masters/highcharts-3d.src.js +1 -1
  261. package/es-modules/masters/highcharts-gantt.src.js +1 -1
  262. package/es-modules/masters/highcharts-more.src.js +1 -1
  263. package/es-modules/masters/highcharts.src.js +1 -1
  264. package/es-modules/masters/highmaps.src.js +1 -1
  265. package/es-modules/masters/highstock.src.js +1 -1
  266. package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  267. package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  268. package/es-modules/masters/indicators/ao.src.js +1 -1
  269. package/es-modules/masters/indicators/apo.src.js +1 -1
  270. package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  271. package/es-modules/masters/indicators/aroon.src.js +1 -1
  272. package/es-modules/masters/indicators/atr.src.js +1 -1
  273. package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  274. package/es-modules/masters/indicators/cci.src.js +1 -1
  275. package/es-modules/masters/indicators/chaikin.src.js +1 -1
  276. package/es-modules/masters/indicators/cmf.src.js +1 -1
  277. package/es-modules/masters/indicators/cmo.src.js +1 -1
  278. package/es-modules/masters/indicators/dema.src.js +1 -1
  279. package/es-modules/masters/indicators/disparity-index.src.js +1 -1
  280. package/es-modules/masters/indicators/dmi.src.js +1 -1
  281. package/es-modules/masters/indicators/dpo.src.js +1 -1
  282. package/es-modules/masters/indicators/ema.src.js +4 -10
  283. package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  284. package/es-modules/masters/indicators/indicators-all.src.js +2 -2
  285. package/es-modules/masters/indicators/indicators.src.js +2 -1
  286. package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  287. package/es-modules/masters/indicators/klinger.src.js +1 -1
  288. package/es-modules/masters/indicators/macd.src.js +1 -1
  289. package/es-modules/masters/indicators/mfi.src.js +1 -1
  290. package/es-modules/masters/indicators/momentum.src.js +1 -1
  291. package/es-modules/masters/indicators/natr.src.js +1 -1
  292. package/es-modules/masters/indicators/obv.src.js +1 -1
  293. package/es-modules/masters/indicators/pivot-points.src.js +1 -1
  294. package/es-modules/masters/indicators/ppo.src.js +1 -1
  295. package/es-modules/masters/indicators/price-channel.src.js +1 -1
  296. package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  297. package/es-modules/masters/indicators/psar.src.js +1 -1
  298. package/es-modules/masters/indicators/regressions.src.js +1 -1
  299. package/es-modules/masters/indicators/roc.src.js +1 -1
  300. package/es-modules/masters/indicators/rsi.src.js +1 -1
  301. package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  302. package/es-modules/masters/indicators/stochastic.src.js +1 -1
  303. package/es-modules/masters/indicators/supertrend.src.js +1 -1
  304. package/es-modules/masters/indicators/tema.src.js +1 -1
  305. package/es-modules/masters/indicators/trendline.src.js +1 -1
  306. package/es-modules/masters/indicators/trix.src.js +1 -1
  307. package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  308. package/es-modules/masters/indicators/vwap.src.js +1 -1
  309. package/es-modules/masters/indicators/williams-r.src.js +1 -1
  310. package/es-modules/masters/indicators/wma.src.js +1 -1
  311. package/es-modules/masters/indicators/zigzag.src.js +1 -1
  312. package/es-modules/masters/modules/accessibility.src.js +16 -2
  313. package/es-modules/masters/modules/annotations-advanced.src.js +3 -1
  314. package/es-modules/masters/modules/annotations.src.js +1 -1
  315. package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  316. package/es-modules/masters/modules/boost-canvas.src.js +1 -1
  317. package/es-modules/masters/modules/boost.src.js +1 -1
  318. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  319. package/es-modules/masters/modules/bullet.src.js +1 -1
  320. package/es-modules/masters/modules/coloraxis.src.js +1 -1
  321. package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  322. package/es-modules/masters/modules/cylinder.src.js +1 -1
  323. package/es-modules/masters/modules/data.src.js +6 -3
  324. package/es-modules/masters/modules/datagrouping.src.js +1 -1
  325. package/es-modules/masters/modules/debugger.src.js +1 -1
  326. package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  327. package/es-modules/masters/modules/dotplot.src.js +1 -1
  328. package/es-modules/masters/modules/drag-panes.src.js +1 -1
  329. package/es-modules/masters/modules/draggable-points.src.js +1 -1
  330. package/es-modules/masters/modules/drilldown.src.js +1 -1
  331. package/es-modules/masters/modules/dumbbell.src.js +1 -1
  332. package/es-modules/masters/modules/export-data.src.js +1 -1
  333. package/es-modules/masters/modules/exporting.src.js +1 -1
  334. package/es-modules/masters/modules/full-screen.src.js +1 -1
  335. package/es-modules/masters/modules/funnel.src.js +1 -1
  336. package/es-modules/masters/modules/funnel3d.src.js +1 -1
  337. package/es-modules/masters/modules/gantt.src.js +1 -1
  338. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  339. package/es-modules/masters/modules/heatmap.src.js +1 -2
  340. package/es-modules/masters/modules/heikinashi.src.js +1 -1
  341. package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  342. package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
  343. package/es-modules/masters/modules/item-series.src.js +1 -1
  344. package/es-modules/masters/modules/lollipop.src.js +1 -1
  345. package/es-modules/masters/modules/map.src.js +1 -3
  346. package/es-modules/masters/modules/marker-clusters.src.js +1 -1
  347. package/es-modules/masters/modules/networkgraph.src.js +1 -1
  348. package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  349. package/es-modules/masters/modules/offline-exporting.src.js +1 -1
  350. package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
  351. package/es-modules/masters/modules/oldie.src.js +1 -1
  352. package/es-modules/masters/modules/organization.src.js +1 -1
  353. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  354. package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  355. package/es-modules/masters/modules/pareto.src.js +1 -1
  356. package/es-modules/masters/modules/pathfinder.src.js +1 -1
  357. package/es-modules/masters/modules/pattern-fill.src.js +1 -1
  358. package/es-modules/masters/modules/price-indicator.src.js +1 -1
  359. package/es-modules/masters/modules/pyramid3d.src.js +1 -1
  360. package/es-modules/masters/modules/sankey.src.js +1 -1
  361. package/es-modules/masters/modules/series-label.src.js +1 -1
  362. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  363. package/es-modules/masters/modules/sonification.src.js +33 -2
  364. package/es-modules/masters/modules/static-scale.src.js +1 -1
  365. package/es-modules/masters/modules/stock-tools.src.js +1 -1
  366. package/es-modules/masters/modules/stock.src.js +4 -1
  367. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  368. package/es-modules/masters/modules/sunburst.src.js +1 -1
  369. package/es-modules/masters/modules/tilemap.src.js +1 -1
  370. package/es-modules/masters/modules/timeline.src.js +1 -1
  371. package/es-modules/masters/modules/treegrid.src.js +1 -1
  372. package/es-modules/masters/modules/treemap.src.js +1 -1
  373. package/es-modules/masters/modules/variable-pie.src.js +1 -1
  374. package/es-modules/masters/modules/variwide.src.js +1 -1
  375. package/es-modules/masters/modules/vector.src.js +1 -1
  376. package/es-modules/masters/modules/venn.src.js +1 -1
  377. package/es-modules/masters/modules/windbarb.src.js +1 -1
  378. package/es-modules/masters/modules/wordcloud.src.js +1 -1
  379. package/es-modules/masters/modules/xrange.src.js +1 -1
  380. package/es-modules/masters/themes/avocado.src.js +1 -1
  381. package/es-modules/masters/themes/dark-blue.src.js +1 -1
  382. package/es-modules/masters/themes/dark-green.src.js +1 -1
  383. package/es-modules/masters/themes/dark-unica.src.js +1 -1
  384. package/es-modules/masters/themes/gray.src.js +1 -1
  385. package/es-modules/masters/themes/grid-light.src.js +1 -1
  386. package/es-modules/masters/themes/grid.src.js +1 -1
  387. package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
  388. package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
  389. package/es-modules/masters/themes/sand-signika.src.js +1 -1
  390. package/es-modules/masters/themes/skies.src.js +1 -1
  391. package/es-modules/masters/themes/sunset.src.js +1 -1
  392. package/highcharts-3d.js +1 -1
  393. package/highcharts-3d.src.js +1 -1
  394. package/highcharts-gantt.js +799 -801
  395. package/highcharts-gantt.js.map +1 -1
  396. package/highcharts-gantt.src.js +793 -755
  397. package/highcharts-more.js +194 -193
  398. package/highcharts-more.js.map +1 -1
  399. package/highcharts-more.src.js +208 -120
  400. package/highcharts.d.ts +9814 -4231
  401. package/highcharts.js +585 -587
  402. package/highcharts.js.map +1 -1
  403. package/highcharts.src.d.ts +9814 -4231
  404. package/highcharts.src.js +626 -603
  405. package/highmaps.js +728 -707
  406. package/highmaps.js.map +1 -1
  407. package/highmaps.src.js +2824 -1613
  408. package/highstock.js +788 -782
  409. package/highstock.js.map +1 -1
  410. package/highstock.src.js +1913 -1284
  411. package/indicators/acceleration-bands.js +10 -9
  412. package/indicators/acceleration-bands.js.map +1 -1
  413. package/indicators/acceleration-bands.src.js +156 -112
  414. package/indicators/accumulation-distribution.js +1 -1
  415. package/indicators/accumulation-distribution.src.js +1 -1
  416. package/indicators/ao.js +6 -6
  417. package/indicators/ao.js.map +1 -1
  418. package/indicators/ao.src.js +4 -4
  419. package/indicators/apo.js +5 -6
  420. package/indicators/apo.js.map +1 -1
  421. package/indicators/apo.src.js +16 -84
  422. package/indicators/aroon-oscillator.js +9 -9
  423. package/indicators/aroon-oscillator.js.map +1 -1
  424. package/indicators/aroon-oscillator.src.js +160 -177
  425. package/indicators/aroon.js +9 -9
  426. package/indicators/aroon.js.map +1 -1
  427. package/indicators/aroon.src.js +156 -112
  428. package/indicators/atr.js +1 -1
  429. package/indicators/atr.src.js +1 -1
  430. package/indicators/bollinger-bands.js +10 -9
  431. package/indicators/bollinger-bands.js.map +1 -1
  432. package/indicators/bollinger-bands.src.js +180 -117
  433. package/indicators/cci.js +1 -1
  434. package/indicators/cci.src.js +1 -1
  435. package/indicators/chaikin.js +8 -9
  436. package/indicators/chaikin.js.map +1 -1
  437. package/indicators/chaikin.src.js +8 -76
  438. package/indicators/cmf.js +1 -1
  439. package/indicators/cmf.src.js +1 -1
  440. package/indicators/cmo.js +1 -1
  441. package/indicators/cmo.src.js +1 -1
  442. package/indicators/dema.js +5 -6
  443. package/indicators/dema.js.map +1 -1
  444. package/indicators/dema.src.js +3 -75
  445. package/indicators/disparity-index.js +6 -7
  446. package/indicators/disparity-index.js.map +1 -1
  447. package/indicators/disparity-index.src.js +19 -74
  448. package/indicators/dmi.js +11 -11
  449. package/indicators/dmi.js.map +1 -1
  450. package/indicators/dmi.src.js +173 -116
  451. package/indicators/dpo.js +1 -1
  452. package/indicators/dpo.src.js +1 -1
  453. package/indicators/ema.js +1 -13
  454. package/indicators/ema.js.map +1 -1
  455. package/indicators/ema.src.js +7 -188
  456. package/indicators/ichimoku-kinko-hyo.js +1 -1
  457. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  458. package/indicators/indicators-all.js +197 -203
  459. package/indicators/indicators-all.js.map +1 -1
  460. package/indicators/indicators-all.src.js +677 -743
  461. package/indicators/indicators.js +12 -12
  462. package/indicators/indicators.js.map +1 -1
  463. package/indicators/indicators.src.js +213 -143
  464. package/indicators/keltner-channels.js +10 -10
  465. package/indicators/keltner-channels.js.map +1 -1
  466. package/indicators/keltner-channels.src.js +164 -118
  467. package/indicators/klinger.js +12 -13
  468. package/indicators/klinger.js.map +1 -1
  469. package/indicators/klinger.src.js +161 -184
  470. package/indicators/macd.js +2 -2
  471. package/indicators/macd.js.map +1 -1
  472. package/indicators/macd.src.js +2 -3
  473. package/indicators/mfi.js +1 -1
  474. package/indicators/mfi.src.js +1 -1
  475. package/indicators/momentum.js +1 -1
  476. package/indicators/momentum.src.js +1 -1
  477. package/indicators/natr.js +3 -3
  478. package/indicators/natr.js.map +1 -1
  479. package/indicators/natr.src.js +2 -4
  480. package/indicators/obv.js +1 -1
  481. package/indicators/obv.src.js +1 -1
  482. package/indicators/pivot-points.js +1 -1
  483. package/indicators/pivot-points.src.js +1 -1
  484. package/indicators/ppo.js +5 -6
  485. package/indicators/ppo.js.map +1 -1
  486. package/indicators/ppo.src.js +3 -75
  487. package/indicators/price-channel.js +9 -9
  488. package/indicators/price-channel.js.map +1 -1
  489. package/indicators/price-channel.src.js +207 -168
  490. package/indicators/price-envelopes.js +1 -1
  491. package/indicators/price-envelopes.src.js +1 -1
  492. package/indicators/psar.js +1 -1
  493. package/indicators/psar.src.js +1 -1
  494. package/indicators/regressions.js +1 -1
  495. package/indicators/regressions.src.js +9 -9
  496. package/indicators/roc.js +1 -1
  497. package/indicators/roc.src.js +1 -1
  498. package/indicators/rsi.js +1 -1
  499. package/indicators/rsi.src.js +1 -1
  500. package/indicators/slow-stochastic.js +5 -6
  501. package/indicators/slow-stochastic.js.map +1 -1
  502. package/indicators/slow-stochastic.src.js +2 -72
  503. package/indicators/stochastic.js +10 -10
  504. package/indicators/stochastic.js.map +1 -1
  505. package/indicators/stochastic.src.js +209 -164
  506. package/indicators/supertrend.js +10 -10
  507. package/indicators/supertrend.js.map +1 -1
  508. package/indicators/supertrend.src.js +6 -7
  509. package/indicators/tema.js +6 -7
  510. package/indicators/tema.js.map +1 -1
  511. package/indicators/tema.src.js +28 -75
  512. package/indicators/trendline.js +1 -1
  513. package/indicators/trendline.src.js +1 -1
  514. package/indicators/trix.js +4 -5
  515. package/indicators/trix.js.map +1 -1
  516. package/indicators/trix.src.js +8 -76
  517. package/indicators/volume-by-price.js +16 -16
  518. package/indicators/volume-by-price.js.map +1 -1
  519. package/indicators/volume-by-price.src.js +24 -7
  520. package/indicators/vwap.js +1 -1
  521. package/indicators/vwap.src.js +1 -1
  522. package/indicators/williams-r.js +5 -6
  523. package/indicators/williams-r.js.map +1 -1
  524. package/indicators/williams-r.src.js +41 -51
  525. package/indicators/wma.js +1 -1
  526. package/indicators/wma.src.js +1 -1
  527. package/indicators/zigzag.js +1 -1
  528. package/indicators/zigzag.src.js +1 -1
  529. package/modules/accessibility.d.ts +5 -0
  530. package/modules/accessibility.js +237 -216
  531. package/modules/accessibility.js.map +1 -1
  532. package/modules/accessibility.src.d.ts +5 -0
  533. package/modules/accessibility.src.js +7400 -6078
  534. package/modules/annotations-advanced.d.ts +30 -0
  535. package/modules/annotations-advanced.js +192 -165
  536. package/modules/annotations-advanced.js.map +1 -1
  537. package/modules/annotations-advanced.src.d.ts +30 -0
  538. package/modules/annotations-advanced.src.js +1604 -332
  539. package/modules/annotations.js +121 -106
  540. package/modules/annotations.js.map +1 -1
  541. package/modules/annotations.src.js +981 -238
  542. package/modules/arrow-symbols.js +1 -1
  543. package/modules/arrow-symbols.src.js +1 -1
  544. package/modules/boost-canvas.js +15 -15
  545. package/modules/boost-canvas.js.map +1 -1
  546. package/modules/boost-canvas.src.js +3 -3
  547. package/modules/boost.js +79 -79
  548. package/modules/boost.js.map +1 -1
  549. package/modules/boost.src.js +10 -9
  550. package/modules/broken-axis.js +1 -1
  551. package/modules/broken-axis.src.js +1 -1
  552. package/modules/bullet.js +1 -1
  553. package/modules/bullet.src.js +1 -1
  554. package/modules/coloraxis.js +24 -24
  555. package/modules/coloraxis.js.map +1 -1
  556. package/modules/coloraxis.src.js +69 -98
  557. package/modules/current-date-indicator.js +4 -4
  558. package/modules/current-date-indicator.js.map +1 -1
  559. package/modules/current-date-indicator.src.js +4 -4
  560. package/modules/cylinder.js +1 -1
  561. package/modules/cylinder.src.js +1 -1
  562. package/modules/data.js +32 -32
  563. package/modules/data.js.map +1 -1
  564. package/modules/data.src.js +85 -88
  565. package/modules/datagrouping.js +20 -20
  566. package/modules/datagrouping.js.map +1 -1
  567. package/modules/datagrouping.src.js +35 -19
  568. package/modules/debugger.js +3 -3
  569. package/modules/debugger.js.map +1 -1
  570. package/modules/debugger.src.js +3 -3
  571. package/modules/dependency-wheel.js +11 -11
  572. package/modules/dependency-wheel.js.map +1 -1
  573. package/modules/dependency-wheel.src.js +4 -7
  574. package/modules/dotplot.js +1 -1
  575. package/modules/dotplot.src.js +1 -1
  576. package/modules/drag-panes.js +8 -8
  577. package/modules/drag-panes.js.map +1 -1
  578. package/modules/drag-panes.src.js +3 -3
  579. package/modules/draggable-points.js +1 -1
  580. package/modules/draggable-points.src.js +1 -1
  581. package/modules/drilldown.js +24 -24
  582. package/modules/drilldown.js.map +1 -1
  583. package/modules/drilldown.src.js +4 -4
  584. package/modules/dumbbell.js +17 -17
  585. package/modules/dumbbell.js.map +1 -1
  586. package/modules/dumbbell.src.js +4 -4
  587. package/modules/export-data.js +1 -1
  588. package/modules/export-data.js.map +1 -1
  589. package/modules/export-data.src.js +3 -3
  590. package/modules/exporting.js +39 -38
  591. package/modules/exporting.js.map +1 -1
  592. package/modules/exporting.src.js +102 -72
  593. package/modules/full-screen.js +1 -1
  594. package/modules/full-screen.src.js +1 -1
  595. package/modules/funnel.js +12 -12
  596. package/modules/funnel.js.map +1 -1
  597. package/modules/funnel.src.js +9 -6
  598. package/modules/funnel3d.js +1 -1
  599. package/modules/funnel3d.src.js +1 -1
  600. package/modules/gantt.js +217 -218
  601. package/modules/gantt.js.map +1 -1
  602. package/modules/gantt.src.js +167 -152
  603. package/modules/grid-axis.js +1 -1
  604. package/modules/grid-axis.src.js +1 -1
  605. package/modules/heatmap.js +39 -39
  606. package/modules/heatmap.js.map +1 -1
  607. package/modules/heatmap.src.js +177 -162
  608. package/modules/heikinashi.js +1 -1
  609. package/modules/heikinashi.src.js +4 -4
  610. package/modules/histogram-bellcurve.js +13 -13
  611. package/modules/histogram-bellcurve.js.map +1 -1
  612. package/modules/histogram-bellcurve.src.js +91 -86
  613. package/modules/hollowcandlestick.js +9 -9
  614. package/modules/hollowcandlestick.js.map +1 -1
  615. package/modules/hollowcandlestick.src.js +37 -37
  616. package/modules/item-series.js +1 -1
  617. package/modules/item-series.src.js +1 -1
  618. package/modules/lollipop.js +1 -1
  619. package/modules/lollipop.src.js +1 -1
  620. package/modules/map.d.ts +136 -14
  621. package/modules/map.js +144 -122
  622. package/modules/map.js.map +1 -1
  623. package/modules/map.src.d.ts +136 -14
  624. package/modules/map.src.js +2227 -1039
  625. package/modules/marker-clusters.js +36 -36
  626. package/modules/marker-clusters.js.map +1 -1
  627. package/modules/marker-clusters.src.js +173 -142
  628. package/modules/networkgraph.d.ts +12 -1
  629. package/modules/networkgraph.js +49 -49
  630. package/modules/networkgraph.js.map +1 -1
  631. package/modules/networkgraph.src.d.ts +12 -1
  632. package/modules/networkgraph.src.js +91 -43
  633. package/modules/no-data-to-display.js +5 -5
  634. package/modules/no-data-to-display.js.map +1 -1
  635. package/modules/no-data-to-display.src.js +3 -3
  636. package/modules/offline-exporting.js +18 -17
  637. package/modules/offline-exporting.js.map +1 -1
  638. package/modules/offline-exporting.src.js +14 -14
  639. package/modules/oldie-polyfills.js +1 -1
  640. package/modules/oldie-polyfills.src.js +1 -1
  641. package/modules/oldie.js +26 -26
  642. package/modules/oldie.js.map +1 -1
  643. package/modules/oldie.src.js +4 -4
  644. package/modules/organization.js +13 -13
  645. package/modules/organization.js.map +1 -1
  646. package/modules/organization.src.js +4 -4
  647. package/modules/overlapping-datalabels.js +1 -1
  648. package/modules/overlapping-datalabels.src.js +1 -1
  649. package/modules/parallel-coordinates.js +1 -1
  650. package/modules/parallel-coordinates.src.js +1 -1
  651. package/modules/pareto.js +7 -7
  652. package/modules/pareto.js.map +1 -1
  653. package/modules/pareto.src.js +89 -78
  654. package/modules/pathfinder.js +1 -1
  655. package/modules/pathfinder.src.js +1 -1
  656. package/modules/pattern-fill.js +1 -1
  657. package/modules/pattern-fill.src.js +1 -1
  658. package/modules/price-indicator.js +1 -1
  659. package/modules/price-indicator.src.js +1 -1
  660. package/modules/pyramid3d.js +1 -1
  661. package/modules/pyramid3d.src.js +1 -1
  662. package/modules/sankey.d.ts +12 -1
  663. package/modules/sankey.js +29 -29
  664. package/modules/sankey.js.map +1 -1
  665. package/modules/sankey.src.d.ts +12 -1
  666. package/modules/sankey.src.js +300 -176
  667. package/modules/series-label.js +1 -1
  668. package/modules/series-label.src.js +1 -1
  669. package/modules/solid-gauge.js +1 -1
  670. package/modules/solid-gauge.src.js +1 -1
  671. package/modules/sonification.js +59 -55
  672. package/modules/sonification.js.map +1 -1
  673. package/modules/sonification.src.js +3034 -2553
  674. package/modules/static-scale.js +1 -1
  675. package/modules/static-scale.src.js +1 -1
  676. package/modules/stock-tools.js +178 -163
  677. package/modules/stock-tools.js.map +1 -1
  678. package/modules/stock-tools.src.js +1028 -144
  679. package/modules/stock.d.ts +39 -6
  680. package/modules/stock.js +204 -196
  681. package/modules/stock.js.map +1 -1
  682. package/modules/stock.src.d.ts +39 -6
  683. package/modules/stock.src.js +1667 -1061
  684. package/modules/streamgraph.js +1 -1
  685. package/modules/streamgraph.src.js +1 -1
  686. package/modules/sunburst.js +61 -60
  687. package/modules/sunburst.js.map +1 -1
  688. package/modules/sunburst.src.js +329 -266
  689. package/modules/tilemap.js +17 -17
  690. package/modules/tilemap.js.map +1 -1
  691. package/modules/tilemap.src.js +3 -4
  692. package/modules/timeline.js +18 -18
  693. package/modules/timeline.js.map +1 -1
  694. package/modules/timeline.src.js +5 -5
  695. package/modules/treegrid.js +56 -57
  696. package/modules/treegrid.js.map +1 -1
  697. package/modules/treegrid.src.js +126 -120
  698. package/modules/treemap.js +41 -41
  699. package/modules/treemap.js.map +1 -1
  700. package/modules/treemap.src.js +319 -254
  701. package/modules/variable-pie.js +1 -1
  702. package/modules/variable-pie.src.js +1 -1
  703. package/modules/variwide.js +1 -1
  704. package/modules/variwide.src.js +1 -1
  705. package/modules/vector.js +1 -1
  706. package/modules/vector.src.js +1 -1
  707. package/modules/venn.js +31 -31
  708. package/modules/venn.js.map +1 -1
  709. package/modules/venn.src.js +731 -721
  710. package/modules/windbarb.js +15 -15
  711. package/modules/windbarb.js.map +1 -1
  712. package/modules/windbarb.src.js +90 -62
  713. package/modules/wordcloud.js +23 -24
  714. package/modules/wordcloud.js.map +1 -1
  715. package/modules/wordcloud.src.js +897 -949
  716. package/modules/xrange.js +2 -2
  717. package/modules/xrange.js.map +1 -1
  718. package/modules/xrange.src.js +2 -1
  719. package/package.json +1 -1
  720. package/themes/avocado.js +1 -1
  721. package/themes/avocado.src.js +1 -1
  722. package/themes/dark-blue.js +1 -1
  723. package/themes/dark-blue.src.js +1 -1
  724. package/themes/dark-green.js +1 -1
  725. package/themes/dark-green.src.js +1 -1
  726. package/themes/dark-unica.js +1 -1
  727. package/themes/dark-unica.src.js +1 -1
  728. package/themes/gray.js +1 -1
  729. package/themes/gray.src.js +1 -1
  730. package/themes/grid-light.js +1 -1
  731. package/themes/grid-light.src.js +1 -1
  732. package/themes/grid.js +1 -1
  733. package/themes/grid.src.js +1 -1
  734. package/themes/high-contrast-dark.js +1 -1
  735. package/themes/high-contrast-dark.src.js +1 -1
  736. package/themes/high-contrast-light.js +1 -1
  737. package/themes/high-contrast-light.src.js +1 -1
  738. package/themes/sand-signika.js +1 -1
  739. package/themes/sand-signika.src.js +1 -1
  740. package/themes/skies.js +1 -1
  741. package/themes/skies.src.js +1 -1
  742. package/themes/sunset.js +1 -1
  743. package/themes/sunset.src.js +1 -1
  744. package/es-modules/Core/Axis/MapAxis.js +0 -157
  745. package/es-modules/Core/Color/Palette.js +0 -82
  746. package/es-modules/Extensions/Sonification/InstrumentDefinitions.js +0 -32
  747. package/es-modules/Mixins/ColorMapSeries.js +0 -82
  748. package/es-modules/Mixins/ColorSeries.js +0 -77
  749. package/es-modules/Mixins/DerivedSeries.js +0 -118
  750. package/es-modules/Mixins/DrawPoint.js +0 -81
  751. package/es-modules/Mixins/IndicatorRequired.js +0 -56
  752. package/es-modules/Mixins/Navigation.js +0 -54
  753. package/es-modules/Mixins/NelderMead.js +0 -132
  754. package/es-modules/Mixins/Polygon.js +0 -259
  755. package/es-modules/Mixins/ReduceArray.js +0 -54
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highmaps JS v9.2.0 (2021-08-18)
2
+ * @license Highmaps JS v9.3.1 (2021-11-05)
3
3
  *
4
4
  * Highmaps as a plugin for Highcharts or Highcharts Stock.
5
5
  *
@@ -28,259 +28,7 @@
28
28
  obj[path] = fn.apply(null, args);
29
29
  }
30
30
  }
31
- _registerModule(_modules, 'Core/Axis/MapAxis.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Utilities.js']], function (Axis, U) {
32
- /* *
33
- *
34
- * (c) 2010-2021 Torstein Honsi
35
- *
36
- * License: www.highcharts.com/license
37
- *
38
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
39
- *
40
- * */
41
- var addEvent = U.addEvent,
42
- pick = U.pick;
43
- /**
44
- * Map support for axes.
45
- * @private
46
- * @class
47
- */
48
- var MapAxisAdditions = /** @class */ (function () {
49
- /* *
50
- *
51
- * Constructors
52
- *
53
- * */
54
- function MapAxisAdditions(axis) {
55
- this.axis = axis;
56
- }
57
- return MapAxisAdditions;
58
- }());
59
- /**
60
- * Axis with map support.
61
- * @private
62
- * @class
63
- */
64
- var MapAxis = /** @class */ (function () {
65
- function MapAxis() {
66
- }
67
- /**
68
- * Extends axes with map support.
69
- * @private
70
- *
71
- * @param {Highcharts.Axis} AxisClass
72
- * Axis class to extend.
73
- */
74
- MapAxis.compose = function (AxisClass) {
75
- AxisClass.keepProps.push('mapAxis');
76
- /* eslint-disable no-invalid-this */
77
- addEvent(AxisClass, 'init', function () {
78
- var axis = this;
79
- if (!axis.mapAxis) {
80
- axis.mapAxis = new MapAxisAdditions(axis);
81
- }
82
- });
83
- // Override to use the extreme coordinates from the SVG shape, not the
84
- // data values
85
- addEvent(AxisClass, 'getSeriesExtremes', function () {
86
- if (!this.mapAxis) {
87
- return;
88
- }
89
- var axis = this;
90
- var xData = [];
91
- // Remove the xData array and cache it locally so that the proceed
92
- // method doesn't use it
93
- if (axis.isXAxis) {
94
- axis.series.forEach(function (series, i) {
95
- if (series.useMapGeometry) {
96
- xData[i] = series.xData;
97
- series.xData = [];
98
- }
99
- });
100
- axis.mapAxis.seriesXData = xData;
101
- }
102
- });
103
- addEvent(AxisClass, 'afterGetSeriesExtremes', function () {
104
- if (!this.mapAxis) {
105
- return;
106
- }
107
- var axis = this;
108
- var xData = axis.mapAxis.seriesXData || [];
109
- var dataMin,
110
- dataMax,
111
- useMapGeometry;
112
- // Run extremes logic for map and mapline
113
- if (axis.isXAxis) {
114
- dataMin = pick(axis.dataMin, Number.MAX_VALUE);
115
- dataMax = pick(axis.dataMax, -Number.MAX_VALUE);
116
- axis.series.forEach(function (series, i) {
117
- if (series.useMapGeometry) {
118
- dataMin = Math.min(dataMin, pick(series.minX, dataMin));
119
- dataMax = Math.max(dataMax, pick(series.maxX, dataMax));
120
- series.xData = xData[i]; // Reset xData array
121
- useMapGeometry = true;
122
- }
123
- });
124
- if (useMapGeometry) {
125
- axis.dataMin = dataMin;
126
- axis.dataMax = dataMax;
127
- }
128
- axis.mapAxis.seriesXData = void 0;
129
- }
130
- });
131
- // Override axis translation to make sure the aspect ratio is always
132
- // kept
133
- addEvent(AxisClass, 'afterSetAxisTranslation', function () {
134
- if (!this.mapAxis) {
135
- return;
136
- }
137
- var axis = this;
138
- var chart = axis.chart;
139
- var plotRatio = chart.plotWidth / chart.plotHeight;
140
- var xAxis = chart.xAxis[0];
141
- var mapRatio,
142
- adjustedAxisLength,
143
- padAxis,
144
- fixTo,
145
- fixDiff,
146
- preserveAspectRatio;
147
- // Check for map-like series
148
- if (axis.coll === 'yAxis' && typeof xAxis.transA !== 'undefined') {
149
- axis.series.forEach(function (series) {
150
- if (series.preserveAspectRatio) {
151
- preserveAspectRatio = true;
152
- }
153
- });
154
- }
155
- // On Y axis, handle both
156
- if (preserveAspectRatio) {
157
- // Use the same translation for both axes
158
- axis.transA = xAxis.transA = Math.min(axis.transA, xAxis.transA);
159
- mapRatio = plotRatio / ((xAxis.max - xAxis.min) /
160
- (axis.max - axis.min));
161
- // What axis to pad to put the map in the middle
162
- padAxis = mapRatio < 1 ? axis : xAxis;
163
- // Pad it
164
- adjustedAxisLength =
165
- (padAxis.max - padAxis.min) * padAxis.transA;
166
- padAxis.mapAxis.pixelPadding = padAxis.len - adjustedAxisLength;
167
- padAxis.minPixelPadding = padAxis.mapAxis.pixelPadding / 2;
168
- fixTo = padAxis.mapAxis.fixTo;
169
- if (fixTo) {
170
- fixDiff = fixTo[1] - padAxis.toValue(fixTo[0], true);
171
- fixDiff *= padAxis.transA;
172
- if (Math.abs(fixDiff) > padAxis.minPixelPadding ||
173
- (padAxis.min === padAxis.dataMin &&
174
- padAxis.max === padAxis.dataMax)) { // zooming out again, keep within restricted area
175
- fixDiff = 0;
176
- }
177
- padAxis.minPixelPadding -= fixDiff;
178
- }
179
- }
180
- });
181
- // Override Axis.render in order to delete the fixTo prop
182
- addEvent(AxisClass, 'render', function () {
183
- var axis = this;
184
- if (axis.mapAxis) {
185
- axis.mapAxis.fixTo = void 0;
186
- }
187
- });
188
- /* eslint-enable no-invalid-this */
189
- };
190
- return MapAxis;
191
- }());
192
- MapAxis.compose(Axis); // @todo move to factory functions
193
-
194
- return MapAxis;
195
- });
196
- _registerModule(_modules, 'Mixins/ColorSeries.js', [], function () {
197
- /* *
198
- *
199
- * (c) 2010-2021 Torstein Honsi
200
- *
201
- * License: www.highcharts.com/license
202
- *
203
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
204
- *
205
- * */
206
- /**
207
- * Mixin for maps and heatmaps
208
- *
209
- * @private
210
- * @mixin Highcharts.colorPointMixin
211
- */
212
- var colorPointMixin = {
213
- /* eslint-disable valid-jsdoc */
214
- /**
215
- * Set the visibility of a single point
216
- * @private
217
- * @function Highcharts.colorPointMixin.setVisible
218
- * @param {boolean} visible
219
- * @return {void}
220
- */
221
- setVisible: function (vis) {
222
- var point = this,
223
- method = vis ? 'show' : 'hide';
224
- point.visible = point.options.visible = Boolean(vis);
225
- // Show and hide associated elements
226
- ['graphic', 'dataLabel'].forEach(function (key) {
227
- if (point[key]) {
228
- point[key][method]();
229
- }
230
- });
231
- this.series.buildKDTree(); // rebuild kdtree #13195
232
- }
233
- /* eslint-enable valid-jsdoc */
234
- };
235
- /**
236
- * @private
237
- * @mixin Highcharts.colorSeriesMixin
238
- */
239
- var colorSeriesMixin = {
240
- optionalAxis: 'colorAxis',
241
- /* eslint-disable valid-jsdoc */
242
- /**
243
- * In choropleth maps,
244
- the color is a result of the value,
245
- so this needs
246
- * translation too
247
- * @private
248
- * @function Highcharts.colorSeriesMixin.translateColors
249
- * @return {void}
250
- */
251
- translateColors: function () {
252
- var series = this,
253
- points = this.data.length ? this.data : this.points,
254
- nullColor = this.options.nullColor,
255
- colorAxis = this.colorAxis,
256
- colorKey = this.colorKey;
257
- points.forEach(function (point) {
258
- var value = point.getNestedProperty(colorKey),
259
- color;
260
- color = point.options.color ||
261
- (point.isNull || point.value === null ?
262
- nullColor :
263
- (colorAxis && typeof value !== 'undefined') ?
264
- colorAxis.toColor(value, point) :
265
- point.color || series.color);
266
- if (color && point.color !== color) {
267
- point.color = color;
268
- if (series.options.legendType === 'point' && point.legendItem) {
269
- series.chart.legend.colorizeItem(point, point.visible);
270
- }
271
- }
272
- });
273
- }
274
- /* eslint-enable valid-jsdoc */
275
- };
276
- var exports = {
277
- colorPointMixin: colorPointMixin,
278
- colorSeriesMixin: colorSeriesMixin
279
- };
280
-
281
- return exports;
282
- });
283
- _registerModule(_modules, 'Core/Axis/Color/ColorAxisComposition.js', [_modules['Core/Color/Color.js'], _modules['Mixins/ColorSeries.js'], _modules['Core/Utilities.js']], function (Color, ColorSeriesMixins, U) {
31
+ _registerModule(_modules, 'Core/Axis/Color/ColorAxisComposition.js', [_modules['Core/Color/Color.js'], _modules['Core/Utilities.js']], function (Color, U) {
284
32
  /* *
285
33
  *
286
34
  * (c) 2010-2021 Torstein Honsi
@@ -291,8 +39,6 @@
291
39
  *
292
40
  * */
293
41
  var color = Color.parse;
294
- var colorPointMixin = ColorSeriesMixins.colorPointMixin,
295
- colorSeriesMixin = ColorSeriesMixins.colorSeriesMixin;
296
42
  var addEvent = U.addEvent,
297
43
  extend = U.extend,
298
44
  merge = U.merge,
@@ -305,6 +51,11 @@
305
51
  * */
306
52
  var ColorAxisComposition;
307
53
  (function (ColorAxisComposition) {
54
+ /* *
55
+ *
56
+ * Declarations
57
+ *
58
+ * */
308
59
  /* *
309
60
  *
310
61
  * Constants
@@ -352,8 +103,13 @@
352
103
  }
353
104
  if (composedClasses.indexOf(SeriesClass) === -1) {
354
105
  composedClasses.push(SeriesClass);
355
- extend(SeriesClass.prototype, colorSeriesMixin);
356
- extend(SeriesClass.prototype.pointClass.prototype, colorPointMixin);
106
+ extend(SeriesClass.prototype, {
107
+ optionalAxis: 'colorAxis',
108
+ translateColors: seriesTranslateColors
109
+ });
110
+ extend(SeriesClass.prototype.pointClass.prototype, {
111
+ setVisible: pointSetVisible
112
+ });
357
113
  addEvent(SeriesClass, 'afterTranslate', onSeriesAfterTranslate);
358
114
  addEvent(SeriesClass, 'bindAxes', onSeriesBindAxes);
359
115
  }
@@ -473,6 +229,55 @@
473
229
  axisTypes.push('colorAxis');
474
230
  }
475
231
  }
232
+ /**
233
+ * Set the visibility of a single point
234
+ * @private
235
+ * @function Highcharts.colorPointMixin.setVisible
236
+ * @param {boolean} visible
237
+ * @return {void}
238
+ */
239
+ function pointSetVisible(vis) {
240
+ var point = this,
241
+ method = vis ? 'show' : 'hide';
242
+ point.visible = point.options.visible = Boolean(vis);
243
+ // Show and hide associated elements
244
+ ['graphic', 'dataLabel'].forEach(function (key) {
245
+ if (point[key]) {
246
+ point[key][method]();
247
+ }
248
+ });
249
+ this.series.buildKDTree(); // rebuild kdtree #13195
250
+ }
251
+ ColorAxisComposition.pointSetVisible = pointSetVisible;
252
+ /**
253
+ * In choropleth maps, the color is a result of the value, so this needs
254
+ * translation too
255
+ * @private
256
+ * @function Highcharts.colorSeriesMixin.translateColors
257
+ * @return {void}
258
+ */
259
+ function seriesTranslateColors() {
260
+ var series = this,
261
+ points = this.data.length ? this.data : this.points,
262
+ nullColor = this.options.nullColor,
263
+ colorAxis = this.colorAxis,
264
+ colorKey = this.colorKey;
265
+ points.forEach(function (point) {
266
+ var value = point.getNestedProperty(colorKey),
267
+ color = point.options.color || (point.isNull || point.value === null ?
268
+ nullColor :
269
+ (colorAxis && typeof value !== 'undefined') ?
270
+ colorAxis.toColor(value,
271
+ point) :
272
+ point.color || series.color);
273
+ if (color && point.color !== color) {
274
+ point.color = color;
275
+ if (series.options.legendType === 'point' && point.legendItem) {
276
+ series.chart.legend.colorizeItem(point, point.visible);
277
+ }
278
+ }
279
+ });
280
+ }
476
281
  /**
477
282
  * @private
478
283
  */
@@ -525,7 +330,7 @@
525
330
 
526
331
  return ColorAxisComposition;
527
332
  });
528
- _registerModule(_modules, 'Core/Axis/Color/ColorAxisDefaults.js', [_modules['Core/Color/Palette.js']], function (Palette) {
333
+ _registerModule(_modules, 'Core/Axis/Color/ColorAxisDefaults.js', [], function () {
529
334
  /* *
530
335
  *
531
336
  * (c) 2010-2021 Torstein Honsi
@@ -588,7 +393,8 @@
588
393
  * categories, crosshair, dateTimeLabelFormats, height, left,
589
394
  * lineWidth, linkedTo, maxZoom, minRange, minTickInterval,
590
395
  * offset, opposite, pane, plotBands, plotLines,
591
- * reversedStacks, showEmpty, title, top, width, zoomEnabled
396
+ * reversedStacks, scrollbar, showEmpty, title, top, width,
397
+ * zoomEnabled
592
398
  * @product highcharts highstock highmaps
593
399
  * @type {*|Array<*>}
594
400
  * @optionparent colorAxis
@@ -823,7 +629,7 @@
823
629
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
824
630
  * @product highcharts highstock highmaps
825
631
  */
826
- color: Palette.neutralColor40
632
+ color: "#999999" /* neutralColor40 */
827
633
  },
828
634
  /**
829
635
  * The axis labels show the number for each tick.
@@ -865,7 +671,7 @@
865
671
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
866
672
  * @product highcharts highstock highmaps
867
673
  */
868
- minColor: Palette.highlightColor10,
674
+ minColor: "#e6ebf5" /* highlightColor10 */,
869
675
  /**
870
676
  * The color to represent the maximum of the color axis. Unless
871
677
  * [dataClasses](#colorAxis.dataClasses) or
@@ -884,7 +690,7 @@
884
690
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
885
691
  * @product highcharts highstock highmaps
886
692
  */
887
- maxColor: Palette.highlightColor100,
693
+ maxColor: "#003399" /* highlightColor100 */,
888
694
  /**
889
695
  * Color stops for the gradient of a scalar color axis. Use this in
890
696
  * cases where a linear gradient between a `minColor` and `maxColor`
@@ -1665,89 +1471,6 @@
1665
1471
 
1666
1472
  return ColorAxis;
1667
1473
  });
1668
- _registerModule(_modules, 'Mixins/ColorMapSeries.js', [_modules['Core/Globals.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js']], function (H, Point, U) {
1669
- /* *
1670
- *
1671
- * (c) 2010-2021 Torstein Honsi
1672
- *
1673
- * License: www.highcharts.com/license
1674
- *
1675
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1676
- *
1677
- * */
1678
- var defined = U.defined,
1679
- addEvent = U.addEvent;
1680
- var noop = H.noop,
1681
- seriesTypes = H.seriesTypes;
1682
- // Move points to the top of the z-index order when hovered
1683
- addEvent(Point, 'afterSetState', function (e) {
1684
- var point = this; // eslint-disable-line no-invalid-this
1685
- if (point.moveToTopOnHover && point.graphic) {
1686
- point.graphic.attr({
1687
- zIndex: e && e.state === 'hover' ? 1 : 0
1688
- });
1689
- }
1690
- });
1691
- /**
1692
- * Mixin for maps and heatmaps
1693
- *
1694
- * @private
1695
- * @mixin Highcharts.colorMapPointMixin
1696
- */
1697
- var colorMapPointMixin = {
1698
- dataLabelOnNull: true,
1699
- moveToTopOnHover: true,
1700
- /* eslint-disable valid-jsdoc */
1701
- /**
1702
- * Color points have a value option that determines whether or not it is
1703
- * a null point
1704
- * @private
1705
- */
1706
- isValid: function () {
1707
- // undefined is allowed
1708
- return (this.value !== null &&
1709
- this.value !== Infinity &&
1710
- this.value !== -Infinity);
1711
- }
1712
- /* eslint-enable valid-jsdoc */
1713
- };
1714
- /**
1715
- * @private
1716
- * @mixin Highcharts.colorMapSeriesMixin
1717
- */
1718
- var colorMapSeriesMixin = {
1719
- pointArrayMap: ['value'],
1720
- axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
1721
- trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
1722
- getSymbol: noop,
1723
- parallelArrays: ['x', 'y', 'value'],
1724
- colorKey: 'value',
1725
- pointAttribs: seriesTypes.column.prototype.pointAttribs,
1726
- /* eslint-disable valid-jsdoc */
1727
- /**
1728
- * Get the color attibutes to apply on the graphic
1729
- * @private
1730
- * @function Highcharts.colorMapSeriesMixin.colorAttribs
1731
- * @param {Highcharts.Point} point
1732
- * @return {Highcharts.SVGAttributes}
1733
- */
1734
- colorAttribs: function (point) {
1735
- var ret = {};
1736
- if (defined(point.color) &&
1737
- (!point.state || point.state === 'normal') // #15746
1738
- ) {
1739
- ret[this.colorProp || 'fill'] = point.color;
1740
- }
1741
- return ret;
1742
- }
1743
- };
1744
- var exports = {
1745
- colorMapPointMixin: colorMapPointMixin,
1746
- colorMapSeriesMixin: colorMapSeriesMixin
1747
- };
1748
-
1749
- return exports;
1750
- });
1751
1474
  _registerModule(_modules, 'Maps/MapNavigationOptionsDefault.js', [_modules['Core/DefaultOptions.js'], _modules['Core/Utilities.js']], function (D, U) {
1752
1475
  /* *
1753
1476
  *
@@ -1765,6 +1488,9 @@
1765
1488
  *
1766
1489
  * */
1767
1490
  /**
1491
+ * The `mapNavigation` option handles buttons for navigation in addition to
1492
+ * mousewheel and doubleclick handlers for map zooming.
1493
+ *
1768
1494
  * @product highmaps
1769
1495
  * @optionparent mapNavigation
1770
1496
  */
@@ -2245,9 +1971,11 @@
2245
1971
  return inner;
2246
1972
  },
2247
1973
  /**
2248
- * Highmaps only. Zoom in or out of the map. See also {@link Point#zoomTo}.
2249
- * See {@link Chart#fromLatLonToPoint} for how to get the `centerX` and
2250
- * `centerY` parameters for a geographic location.
1974
+ * Highcharts Maps only. Zoom in or out of the map. See also
1975
+ * {@link Point#zoomTo}. See {@link Chart#fromLatLonToPoint} for how to get
1976
+ * the `centerX` and `centerY` parameters for a geographic location.
1977
+ *
1978
+ * Deprecated as of v9.3 in favor of [MapView.zoomBy](https://api.highcharts.com/class-reference/Highcharts.MapView#zoomBy).
2251
1979
  *
2252
1980
  * @function Highcharts.Chart#mapZoom
2253
1981
  *
@@ -2256,92 +1984,37 @@
2256
1984
  * in to half the current view. 2 zooms to twice the current view. If
2257
1985
  * omitted, the zoom is reset.
2258
1986
  *
2259
- * @param {number} [centerX]
2260
- * The X axis position to center around if available space.
1987
+ * @param {number} [xProjected]
1988
+ * The projected x position to keep stationary when zooming, if
1989
+ * available space.
2261
1990
  *
2262
- * @param {number} [centerY]
2263
- * The Y axis position to center around if available space.
1991
+ * @param {number} [yProjected]
1992
+ * The projected y position to keep stationary when zooming, if
1993
+ * available space.
2264
1994
  *
2265
- * @param {number} [mouseX]
2266
- * Fix the zoom to this position if possible. This is used for
1995
+ * @param {number} [chartX]
1996
+ * Keep this chart position stationary if possible. This is used for
2267
1997
  * example in mousewheel events, where the area under the mouse
2268
1998
  * should be fixed as we zoom in.
2269
1999
  *
2270
- * @param {number} [mouseY]
2271
- * Fix the zoom to this position if possible.
2000
+ * @param {number} [chartY]
2001
+ * Keep this chart position stationary if possible.
2272
2002
  *
2003
+ * @deprecated
2273
2004
  * @return {void}
2274
2005
  */
2275
- mapZoom: function (howMuch, centerXArg, centerYArg, mouseX, mouseY, animation) {
2276
- var chart = this,
2277
- xAxis = chart.xAxis[0],
2278
- xRange = xAxis.max - xAxis.min,
2279
- centerX = pick(centerXArg,
2280
- xAxis.min + xRange / 2),
2281
- newXRange = xRange * howMuch,
2282
- yAxis = chart.yAxis[0],
2283
- yRange = yAxis.max - yAxis.min,
2284
- centerY = pick(centerYArg,
2285
- yAxis.min + yRange / 2),
2286
- newYRange = yRange * howMuch,
2287
- fixToX = mouseX ? ((mouseX - xAxis.pos) / xAxis.len) : 0.5,
2288
- fixToY = mouseY ? ((mouseY - yAxis.pos) / yAxis.len) : 0.5,
2289
- newXMin = centerX - newXRange * fixToX,
2290
- newYMin = centerY - newYRange * fixToY,
2291
- newExt = chart.fitToBox({
2292
- x: newXMin,
2293
- y: newYMin,
2294
- width: newXRange,
2295
- height: newYRange
2296
- }, {
2297
- x: xAxis.dataMin,
2298
- y: yAxis.dataMin,
2299
- width: xAxis.dataMax - xAxis.dataMin,
2300
- height: yAxis.dataMax - yAxis.dataMin
2301
- }),
2302
- zoomOut = (newExt.x <= xAxis.dataMin &&
2303
- newExt.width >=
2304
- xAxis.dataMax - xAxis.dataMin &&
2305
- newExt.y <= yAxis.dataMin &&
2306
- newExt.height >= yAxis.dataMax - yAxis.dataMin);
2307
- // When mousewheel zooming, fix the point under the mouse
2308
- if (mouseX && xAxis.mapAxis) {
2309
- xAxis.mapAxis.fixTo = [mouseX - xAxis.pos, centerXArg];
2310
- }
2311
- if (mouseY && yAxis.mapAxis) {
2312
- yAxis.mapAxis.fixTo = [mouseY - yAxis.pos, centerYArg];
2313
- }
2314
- // Zoom
2315
- if (typeof howMuch !== 'undefined' && !zoomOut) {
2316
- xAxis.setExtremes(newExt.x, newExt.x + newExt.width, false);
2317
- yAxis.setExtremes(newExt.y, newExt.y + newExt.height, false);
2318
- // Reset zoom
2319
- }
2320
- else {
2321
- xAxis.setExtremes(void 0, void 0, false);
2322
- yAxis.setExtremes(void 0, void 0, false);
2323
- }
2324
- // Prevent zooming until this one is finished animating
2325
- /*
2326
- chart.holdMapZoom = true;
2327
- setTimeout(function () {
2328
- chart.holdMapZoom = false;
2329
- }, 200);
2330
- */
2331
- /*
2332
- delay = animation ? animation.duration || 500 : 0;
2333
- if (delay) {
2334
- chart.isMapZooming = true;
2335
- setTimeout(function () {
2336
- chart.isMapZooming = false;
2337
- if (chart.mapZoomQueue) {
2338
- chart.mapZoom.apply(chart, chart.mapZoomQueue);
2339
- }
2340
- chart.mapZoomQueue = null;
2341
- }, delay);
2006
+ mapZoom: function (howMuch, xProjected, yProjected, chartX, chartY) {
2007
+ if (this.mapView) {
2008
+ if (typeof howMuch === 'number') {
2009
+ // Compliance, mapView.zoomBy uses different values
2010
+ howMuch = Math.log(howMuch) / Math.log(0.5);
2011
+ }
2012
+ this.mapView.zoomBy(howMuch, typeof xProjected === 'number' && typeof yProjected === 'number' ?
2013
+ this.mapView.projection.inverse([xProjected, yProjected]) :
2014
+ void 0, typeof chartX === 'number' && typeof chartY === 'number' ?
2015
+ [chartX, chartY] :
2016
+ void 0);
2342
2017
  }
2343
- */
2344
- chart.redraw(animation);
2345
2018
  }
2346
2019
  });
2347
2020
  // Extend the Chart.render method to add zooming and panning
@@ -2364,7 +2037,8 @@
2364
2037
  * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2365
2038
  *
2366
2039
  * */
2367
- var extend = U.extend,
2040
+ var defined = U.defined,
2041
+ extend = U.extend,
2368
2042
  pick = U.pick,
2369
2043
  wrap = U.wrap;
2370
2044
  /* eslint-disable no-invalid-this */
@@ -2383,7 +2057,7 @@
2383
2057
  }
2384
2058
  }
2385
2059
  else if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
2386
- chart.mapZoom(0.5, chart.xAxis[0].toValue(e.chartX), chart.yAxis[0].toValue(e.chartY), e.chartX, e.chartY);
2060
+ chart.mapZoom(0.5, void 0, void 0, e.chartX, e.chartY);
2387
2061
  }
2388
2062
  },
2389
2063
  // The event handler for the mouse scroll event
@@ -2391,7 +2065,9 @@
2391
2065
  var chart = this.chart;
2392
2066
  e = this.normalize(e);
2393
2067
  // Firefox uses e.deltaY or e.detail, WebKit and IE uses wheelDelta
2394
- var delta = e.deltaY || e.detail || -(e.wheelDelta / 120);
2068
+ // try wheelDelta first #15656
2069
+ var delta = (defined(e.wheelDelta) && -e.wheelDelta / 120) ||
2070
+ e.deltaY || e.detail;
2395
2071
  // Wheel zooming on trackpads have different behaviours in Firefox vs
2396
2072
  // WebKit. In Firefox the delta increments in steps by 1, so it is not
2397
2073
  // distinguishable from true mouse wheel. Therefore we use this timer
@@ -2407,8 +2083,8 @@
2407
2083
  totalWheelDelta = 0;
2408
2084
  }, 50);
2409
2085
  }
2410
- if (totalWheelDelta < 10 && chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
2411
- chart.mapZoom(Math.pow(chart.options.mapNavigation.mouseWheelSensitivity, delta), chart.xAxis[0].toValue(e.chartX), chart.yAxis[0].toValue(e.chartY), e.chartX, e.chartY,
2086
+ if (totalWheelDelta < 10 && chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop) && chart.mapView) {
2087
+ chart.mapView.zoomBy((chart.options.mapNavigation.mouseWheelSensitivity - 1) * -delta, void 0, [e.chartX, e.chartY],
2412
2088
  // Delta less than 1 indicates stepless/trackpad zooming, avoid
2413
2089
  // animation delaying the zoom
2414
2090
  Math.abs(delta) < 1 ? false : void 0);
@@ -2436,7 +2112,7 @@
2436
2112
  });
2437
2113
 
2438
2114
  });
2439
- _registerModule(_modules, 'Maps/MapSymbols.js', [_modules['Core/Renderer/SVG/SVGRenderer.js']], function (SVGRenderer) {
2115
+ _registerModule(_modules, 'Series/ColorMapComposition.js', [_modules['Core/Utilities.js']], function (U) {
2440
2116
  /* *
2441
2117
  *
2442
2118
  * (c) 2010-2021 Torstein Honsi
@@ -2446,39 +2122,1458 @@
2446
2122
  * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2447
2123
  *
2448
2124
  * */
2449
- var symbols = SVGRenderer.prototype.symbols;
2125
+ var defined = U.defined,
2126
+ wrap = U.wrap;
2127
+ /**
2128
+ * @private
2129
+ * @mixin Highcharts.colorMapSeriesMixin
2130
+ */
2131
+ var colorMapSeriesMixinOld = {
2132
+ pointArrayMap: ['value'],
2133
+ axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
2134
+ trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
2135
+ // getSymbol: noop,
2136
+ parallelArrays: ['x', 'y', 'value'],
2137
+ colorKey: 'value'
2138
+ // pointAttribs: seriesTypes.column.prototype.pointAttribs,
2139
+ /* eslint-disable valid-jsdoc */
2140
+ };
2450
2141
  /* *
2451
2142
  *
2452
- * Functions
2143
+ * Composition
2453
2144
  *
2454
2145
  * */
2455
- /* eslint-disable require-jsdoc, valid-jsdoc */
2456
- function bottomButton(x, y, w, h, options) {
2457
- var r = (options && options.r) || 0;
2458
- return selectiveRoundedRect(x - 1, y - 1, w, h, 0, 0, r, r);
2459
- }
2460
- /**
2461
- * Create symbols for the zoom buttons
2462
- * @private
2463
- */
2464
- function selectiveRoundedRect(x, y, w, h, rTopLeft, rTopRight, rBottomRight, rBottomLeft) {
2465
- return [
2466
- ['M', x + rTopLeft, y],
2467
- // top side
2468
- ['L', x + w - rTopRight, y],
2469
- // top right corner
2470
- ['C', x + w - rTopRight / 2, y, x + w, y + rTopRight / 2, x + w, y + rTopRight],
2471
- // right side
2472
- ['L', x + w, y + h - rBottomRight],
2473
- // bottom right corner
2474
- ['C', x + w, y + h - rBottomRight / 2, x + w - rBottomRight / 2, y + h, x + w - rBottomRight, y + h],
2475
- // bottom side
2476
- ['L', x + rBottomLeft, y + h],
2477
- // bottom left corner
2478
- ['C', x + rBottomLeft / 2, y + h, x, y + h - rBottomLeft / 2, x, y + h - rBottomLeft],
2479
- // left side
2480
- ['L', x, y + rTopLeft],
2481
- // top left corner
2146
+ var ColorMapComposition;
2147
+ (function (ColorMapComposition) {
2148
+ ColorMapComposition.colorMapSeriesMixin = colorMapSeriesMixinOld;
2149
+ /* *
2150
+ *
2151
+ * Constants
2152
+ *
2153
+ * */
2154
+ var composedClasses = [];
2155
+ /* *
2156
+ *
2157
+ * Functions
2158
+ *
2159
+ * */
2160
+ /* eslint-disable valid-jsdoc */
2161
+ /**
2162
+ * @private
2163
+ */
2164
+ function compose(SeriesClass, PointClass) {
2165
+ if (PointClass && composedClasses.indexOf(PointClass) === -1) {
2166
+ composedClasses.push(PointClass);
2167
+ var pointProto = PointClass.prototype;
2168
+ pointProto.dataLabelOnNull = true;
2169
+ pointProto.moveToTopOnHover = true;
2170
+ pointProto.isValid = pointIsValid;
2171
+ }
2172
+ if (composedClasses.indexOf(SeriesClass) === -1) {
2173
+ composedClasses.push(SeriesClass);
2174
+ var seriesProto = SeriesClass.prototype;
2175
+ seriesProto.colorAttribs = seriesColorAttribs;
2176
+ wrap(seriesProto, 'pointAttribs', seriesWrapPointAttribs);
2177
+ }
2178
+ return SeriesClass;
2179
+ }
2180
+ ColorMapComposition.compose = compose;
2181
+ /**
2182
+ * Color points have a value option that determines whether or not it is
2183
+ * a null point
2184
+ * @private
2185
+ */
2186
+ function pointIsValid() {
2187
+ // undefined is allowed
2188
+ return (this.value !== null &&
2189
+ this.value !== Infinity &&
2190
+ this.value !== -Infinity);
2191
+ }
2192
+ /**
2193
+ * Get the color attibutes to apply on the graphic
2194
+ * @private
2195
+ */
2196
+ function seriesColorAttribs(point) {
2197
+ var ret = {};
2198
+ if (defined(point.color) &&
2199
+ (!point.state || point.state === 'normal') // #15746
2200
+ ) {
2201
+ ret[this.colorProp || 'fill'] = point.color;
2202
+ }
2203
+ return ret;
2204
+ }
2205
+ ColorMapComposition.seriesColorAttribs = seriesColorAttribs;
2206
+ /**
2207
+ * Move points to the top of the z-index order when hovered
2208
+ * @private
2209
+ */
2210
+ function seriesWrapPointAttribs(original, point, state) {
2211
+ var attribs = original.call(this,
2212
+ point,
2213
+ state);
2214
+ if (point.moveToTopOnHover) {
2215
+ attribs.zIndex = state === 'hover' ? 1 : 0;
2216
+ }
2217
+ return attribs;
2218
+ }
2219
+ })(ColorMapComposition || (ColorMapComposition = {}));
2220
+ /* *
2221
+ *
2222
+ * Default Export
2223
+ *
2224
+ * */
2225
+
2226
+ return ColorMapComposition;
2227
+ });
2228
+ _registerModule(_modules, 'Maps/MapViewOptionsDefault.js', [], function () {
2229
+ /* *
2230
+ *
2231
+ * (c) 2010-2021 Torstein Honsi
2232
+ *
2233
+ * License: www.highcharts.com/license
2234
+ *
2235
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2236
+ *
2237
+ * */
2238
+ /**
2239
+ * The `mapView` options control the initial view of the chart, and how
2240
+ * projection is set up for raw geoJSON maps (beta as of v9.3).
2241
+ *
2242
+ * To set the view dynamically after chart generation, see
2243
+ * [mapView.setView](/class-reference/Highcharts.MapView#setView).
2244
+ *
2245
+ * @since 9.3.0
2246
+ * @product highmaps
2247
+ * @optionparent mapView
2248
+ */
2249
+ var defaultOptions = {
2250
+ /**
2251
+ * The center of the map in terms of longitude and latitude. For
2252
+ * preprojected maps (like in Map Collection v1.x),
2253
+ the units are projected
2254
+ * x and y units.
2255
+ *
2256
+ * @default [0, 0]
2257
+ * @type {Highcharts.LonLatArray}
2258
+ *
2259
+ * @sample {highmaps} maps/mapview/center-zoom
2260
+ * Custom view of a world map
2261
+ * @sample {highmaps} maps/mapview/get-view
2262
+ * Report the current view of a preprojected map
2263
+ */
2264
+ center: [0, 0],
2265
+ /**
2266
+ * Prevents the end user from zooming too far in on the map. See
2267
+ * [zoom](#mapView.zoom).
2268
+ *
2269
+ * @type {number|undefined}
2270
+ *
2271
+ * @sample {highmaps} maps/mapview/maxzoom
2272
+ * Prevent zooming in too far
2273
+ */
2274
+ maxZoom: void 0,
2275
+ /**
2276
+ * The padding inside the plot area when auto fitting to the map bounds. A
2277
+ * number signifies pixels,
2278
+ and a percentage is relative to the plot area
2279
+ * size.
2280
+ *
2281
+ * @sample {highmaps} maps/chart/plotbackgroundcolor-color
2282
+ * Visible plot area and percentage padding
2283
+ */
2284
+ padding: 0,
2285
+ /**
2286
+ * Beta feature in v9.3. The projection options allow applying client side
2287
+ * projection to a map given in coordinates,
2288
+ typically from TopoJSON or
2289
+ * GeoJSON.
2290
+ *
2291
+ * Sub-options are:
2292
+ * * `name`,
2293
+ which as of v9.3 can be `EqualEarth`,
2294
+ * `LambertConformalConic`,
2295
+ `Miller`,
2296
+ `Orthographic` or `WebMercator`.
2297
+ * * `parallels`,
2298
+ the standard parallels for the LambertConformalConic
2299
+ * projection.
2300
+ * * `rotation`,
2301
+ a three-axis rotation of the globe prior to projection,
2302
+ * which in practice can be used for example to render a world map with the
2303
+ * Americas centered (`[90, 0]`),
2304
+ or to rotate an orthographic projection.
2305
+ *
2306
+ * @type {object}
2307
+ * @sample {highmaps} maps/demo/topojson-projection
2308
+ * Orthographic projection
2309
+ */
2310
+ projection: void 0,
2311
+ /**
2312
+ * The zoom level of a map. Higher zoom levels means more zoomed in. An
2313
+ * increase of 1 zooms in to a quarter of the viewed area (half the width
2314
+ * and height). Defaults to fitting to the map bounds.
2315
+ *
2316
+ * In a `WebMercator` projection,
2317
+ a zoom level of 0 represents
2318
+ * the world in a 256x256 pixel square. This is a common concept for WMS
2319
+ * tiling software.
2320
+ *
2321
+ * @type {number|undefined}
2322
+ * @sample {highmaps} maps/mapview/center-zoom
2323
+ * Custom view of a world map
2324
+ * @sample {highmaps} maps/mapview/get-view
2325
+ * Report the current view of a preprojected map
2326
+ */
2327
+ zoom: void 0
2328
+ };
2329
+ /* *
2330
+ *
2331
+ * Default Export
2332
+ *
2333
+ * */
2334
+
2335
+ return defaultOptions;
2336
+ });
2337
+ _registerModule(_modules, 'Maps/Projections/LambertConformalConic.js', [], function () {
2338
+ /* *
2339
+ * Lambert Conformal Conic projection
2340
+ * */
2341
+ var sign = Math.sign ||
2342
+ (function (n) { return (n === 0 ? 0 : n > 0 ? 1 : -1); }),
2343
+ scale = 63.78137,
2344
+ deg2rad = Math.PI / 180,
2345
+ halfPI = Math.PI / 2,
2346
+ eps10 = 1e-6,
2347
+ tany = function (y) { return Math.tan((halfPI + y) / 2); };
2348
+ var n = 0,
2349
+ c = 0;
2350
+ var LambertConformalConic = {
2351
+ init: function (options) {
2352
+ var parallels = (options.parallels || [])
2353
+ .map(function (n) { return n * deg2rad; }),
2354
+ lat1 = parallels[0] || 0,
2355
+ lat2 = parallels[1] || lat1,
2356
+ cosLat1 = Math.cos(lat1);
2357
+ // Apply the global variables
2358
+ n = lat1 === lat2 ?
2359
+ Math.sin(lat1) :
2360
+ Math.log(cosLat1 / Math.cos(lat2)) / Math.log(tany(lat2) / tany(lat1));
2361
+ if (Math.abs(n) < 1e-10) {
2362
+ n = (sign(n) || 1) * 1e-10;
2363
+ }
2364
+ c = cosLat1 * Math.pow(tany(lat1), n) / n;
2365
+ },
2366
+ forward: function (lonLat) {
2367
+ var lon = lonLat[0] * deg2rad;
2368
+ var lat = lonLat[1] * deg2rad;
2369
+ if (c > 0) {
2370
+ if (lat < -halfPI + eps10) {
2371
+ lat = -halfPI + eps10;
2372
+ }
2373
+ }
2374
+ else {
2375
+ if (lat > halfPI - eps10) {
2376
+ lat = halfPI - eps10;
2377
+ }
2378
+ }
2379
+ var r = c / Math.pow(tany(lat),
2380
+ n);
2381
+ return [
2382
+ r * Math.sin(n * lon) * scale,
2383
+ (c - r * Math.cos(n * lon)) * scale
2384
+ ];
2385
+ },
2386
+ inverse: function (xy) {
2387
+ var x = xy[0] / scale,
2388
+ y = xy[1] / scale,
2389
+ cy = c - y,
2390
+ rho = sign(n) * Math.sqrt(x * x + cy * cy);
2391
+ var l = Math.atan2(x,
2392
+ Math.abs(cy)) * sign(cy);
2393
+ if (cy * n < 0) {
2394
+ l -= Math.PI * sign(x) * sign(cy);
2395
+ }
2396
+ return [
2397
+ (l / n) / deg2rad,
2398
+ (2 * Math.atan(Math.pow(c / rho, 1 / n)) - halfPI) / deg2rad
2399
+ ];
2400
+ }
2401
+ };
2402
+
2403
+ return LambertConformalConic;
2404
+ });
2405
+ _registerModule(_modules, 'Maps/Projections/EqualEarth.js', [], function () {
2406
+ /* *
2407
+ *
2408
+ * Equal Earth projection, an equal-area projection designed to minimize
2409
+ * distortion and remain pleasing to the eye.
2410
+ *
2411
+ * Invented by Bojan Šavrič, Bernhard Jenny, and Tom Patterson in 2018. It is
2412
+ * inspired by the widely used Robinson projection.
2413
+ *
2414
+ * */
2415
+ var A1 = 1.340264,
2416
+ A2 = -0.081106,
2417
+ A3 = 0.000893,
2418
+ A4 = 0.003796,
2419
+ M = Math.sqrt(3) / 2.0,
2420
+ scale = 74.03120656864502;
2421
+ var EqualEarth = {
2422
+ forward: function (lonLat) {
2423
+ var d = Math.PI / 180,
2424
+ paramLat = Math.asin(M * Math.sin(lonLat[1] * d)),
2425
+ paramLatSq = paramLat * paramLat,
2426
+ paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;
2427
+ var x = lonLat[0] * d * Math.cos(paramLat) * scale / (M *
2428
+ (A1 +
2429
+ 3 * A2 * paramLatSq +
2430
+ paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq)));
2431
+ var y = paramLat * scale * (A1 + A2 * paramLatSq + paramLatPow6 * (A3 + A4 * paramLatSq));
2432
+ return [x, y];
2433
+ },
2434
+ inverse: function (xy) {
2435
+ var x = xy[0] / scale,
2436
+ y = xy[1] / scale,
2437
+ d = 180 / Math.PI,
2438
+ epsilon = 1e-9,
2439
+ iterations = 12;
2440
+ var paramLat = y,
2441
+ paramLatSq,
2442
+ paramLatPow6,
2443
+ fy,
2444
+ fpy,
2445
+ dlat,
2446
+ i;
2447
+ for (i = 0; i < iterations; ++i) {
2448
+ paramLatSq = paramLat * paramLat;
2449
+ paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;
2450
+ fy = paramLat * (A1 + A2 * paramLatSq + paramLatPow6 * (A3 + A4 * paramLatSq)) - y;
2451
+ fpy = A1 + 3 * A2 * paramLatSq + paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq);
2452
+ paramLat -= dlat = fy / fpy;
2453
+ if (Math.abs(dlat) < epsilon) {
2454
+ break;
2455
+ }
2456
+ }
2457
+ paramLatSq = paramLat * paramLat;
2458
+ paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;
2459
+ var lon = d * M * x * (A1 + 3 * A2 * paramLatSq + paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq)) / Math.cos(paramLat);
2460
+ var lat = d * Math.asin(Math.sin(paramLat) / M);
2461
+ return [lon, lat];
2462
+ }
2463
+ };
2464
+
2465
+ return EqualEarth;
2466
+ });
2467
+ _registerModule(_modules, 'Maps/Projections/Miller.js', [], function () {
2468
+ /* *
2469
+ * Miller projection
2470
+ * */
2471
+ var quarterPI = Math.PI / 4,
2472
+ deg2rad = Math.PI / 180,
2473
+ scale = 63.78137;
2474
+ var Miller = {
2475
+ forward: function (lonLat) { return [
2476
+ lonLat[0] * deg2rad * scale,
2477
+ 1.25 * scale * Math.log(Math.tan(quarterPI + 0.4 * lonLat[1] * deg2rad))
2478
+ ]; },
2479
+ inverse: function (xy) { return [
2480
+ (xy[0] / scale) / deg2rad,
2481
+ 2.5 * (Math.atan(Math.exp(0.8 * (xy[1] / scale))) - quarterPI) / deg2rad
2482
+ ]; }
2483
+ };
2484
+
2485
+ return Miller;
2486
+ });
2487
+ _registerModule(_modules, 'Maps/Projections/Orthographic.js', [], function () {
2488
+ /* *
2489
+ * Orthographic projection
2490
+ * */
2491
+ var deg2rad = Math.PI / 180,
2492
+ scale = 63.78460826781007;
2493
+ var Orthographic = {
2494
+ forward: function (lonLat) {
2495
+ var lonDeg = lonLat[0],
2496
+ latDeg = lonLat[1];
2497
+ if (lonDeg < -90 || lonDeg > 90) {
2498
+ return [NaN, NaN];
2499
+ }
2500
+ var lat = latDeg * deg2rad;
2501
+ return [
2502
+ Math.cos(lat) * Math.sin(lonDeg * deg2rad) * scale,
2503
+ Math.sin(lat) * scale
2504
+ ];
2505
+ },
2506
+ inverse: function (xy) {
2507
+ var x = xy[0] / scale,
2508
+ y = xy[1] / scale,
2509
+ z = Math.sqrt(x * x + y * y),
2510
+ c = Math.asin(z),
2511
+ cSin = Math.sin(c),
2512
+ cCos = Math.cos(c);
2513
+ return [
2514
+ Math.atan2(x * cSin, z * cCos) / deg2rad,
2515
+ Math.asin(z && y * cSin / z) / deg2rad
2516
+ ];
2517
+ }
2518
+ };
2519
+
2520
+ return Orthographic;
2521
+ });
2522
+ _registerModule(_modules, 'Maps/Projections/WebMercator.js', [], function () {
2523
+ /* *
2524
+ * Web Mercator projection, used for most online map tile services
2525
+ * */
2526
+ var maxLatitude = 85.0511287798, // The latitude that defines a square
2527
+ r = 63.78137,
2528
+ deg2rad = Math.PI / 180;
2529
+ var WebMercator = {
2530
+ forward: function (lonLat) {
2531
+ if (Math.abs(lonLat[1]) > maxLatitude) {
2532
+ return [NaN,
2533
+ NaN];
2534
+ }
2535
+ var sinLat = Math.sin(lonLat[1] * deg2rad);
2536
+ return [
2537
+ r * lonLat[0] * deg2rad,
2538
+ r * Math.log((1 + sinLat) / (1 - sinLat)) / 2
2539
+ ];
2540
+ },
2541
+ inverse: function (xy) { return [
2542
+ xy[0] / (r * deg2rad),
2543
+ (2 * Math.atan(Math.exp(xy[1] / r)) - (Math.PI / 2)) / deg2rad
2544
+ ]; },
2545
+ maxLatitude: maxLatitude
2546
+ };
2547
+
2548
+ return WebMercator;
2549
+ });
2550
+ _registerModule(_modules, 'Maps/Projections/ProjectionRegistry.js', [_modules['Maps/Projections/LambertConformalConic.js'], _modules['Maps/Projections/EqualEarth.js'], _modules['Maps/Projections/Miller.js'], _modules['Maps/Projections/Orthographic.js'], _modules['Maps/Projections/WebMercator.js']], function (LambertConformalConic, EqualEarth, Miller, Orthographic, WebMercator) {
2551
+ /* *
2552
+ *
2553
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2554
+ *
2555
+ * */
2556
+ var registry = {
2557
+ EqualEarth: EqualEarth,
2558
+ LambertConformalConic: LambertConformalConic,
2559
+ Miller: Miller,
2560
+ Orthographic: Orthographic,
2561
+ WebMercator: WebMercator
2562
+ };
2563
+
2564
+ return registry;
2565
+ });
2566
+ _registerModule(_modules, 'Maps/Projection.js', [_modules['Maps/Projections/ProjectionRegistry.js'], _modules['Core/Utilities.js']], function (registry, U) {
2567
+ /* *
2568
+ *
2569
+ * (c) 2021 Torstein Honsi
2570
+ *
2571
+ * License: www.highcharts.com/license
2572
+ *
2573
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2574
+ *
2575
+ * */
2576
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
2577
+ for (var s = 0,
2578
+ i = 0,
2579
+ il = arguments.length; i < il; i++) s += arguments[i].length;
2580
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
2581
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
2582
+ r[k] = a[j];
2583
+ return r;
2584
+ };
2585
+ var erase = U.erase;
2586
+ var deg2rad = Math.PI * 2 / 360;
2587
+ // Safe padding on either side of the antimeridian to avoid points being
2588
+ // projected to the wrong side of the plane
2589
+ var floatCorrection = 0.000001;
2590
+ // Keep longitude within -180 and 180. This is faster than using the modulo
2591
+ // operator, and preserves the distinction between -180 and 180.
2592
+ var wrapLon = function (lon) {
2593
+ // Replacing the if's with while would increase the range, but make it prone
2594
+ // to crashes on bad data
2595
+ if (lon < -180) {
2596
+ lon += 360;
2597
+ }
2598
+ if (lon > 180) {
2599
+ lon -= 360;
2600
+ }
2601
+ return lon;
2602
+ };
2603
+ var Projection = /** @class */ (function () {
2604
+ function Projection(options) {
2605
+ if (options === void 0) { options = {}; }
2606
+ // Whether the chart has points, lines or polygons given as coordinates
2607
+ // with positive up, as opposed to paths in the SVG plane with positive
2608
+ // down.
2609
+ this.hasCoordinates = false;
2610
+ // Whether the chart has true projection as opposed to pre-projected geojson
2611
+ // as in the legacy map collection.
2612
+ this.hasGeoProjection = false;
2613
+ this.maxLatitude = 90;
2614
+ this.options = options;
2615
+ var name = options.name,
2616
+ rotation = options.rotation;
2617
+ this.rotator = rotation ? this.getRotator(rotation) : void 0;
2618
+ this.def = name ? Projection.registry[name] : void 0;
2619
+ var _a = this,
2620
+ def = _a.def,
2621
+ rotator = _a.rotator;
2622
+ if (def) {
2623
+ if (def.init) {
2624
+ def.init(options);
2625
+ }
2626
+ this.maxLatitude = def.maxLatitude || 90;
2627
+ this.hasGeoProjection = true;
2628
+ }
2629
+ if (rotator && def) {
2630
+ this.forward = function (lonLat) {
2631
+ lonLat = rotator.forward(lonLat);
2632
+ return def.forward(lonLat);
2633
+ };
2634
+ this.inverse = function (xy) {
2635
+ var lonLat = def.inverse(xy);
2636
+ return rotator.inverse(lonLat);
2637
+ };
2638
+ }
2639
+ else if (def) {
2640
+ this.forward = def.forward;
2641
+ this.inverse = def.inverse;
2642
+ }
2643
+ else if (rotator) {
2644
+ this.forward = rotator.forward;
2645
+ this.inverse = rotator.inverse;
2646
+ }
2647
+ }
2648
+ // Add a projection definition to the registry, accessible by its `name`.
2649
+ Projection.add = function (name, definition) {
2650
+ Projection.registry[name] = definition;
2651
+ };
2652
+ // Calculate the great circle between two given coordinates
2653
+ Projection.greatCircle = function (point1, point2, inclusive) {
2654
+ var atan2 = Math.atan2,
2655
+ cos = Math.cos,
2656
+ sin = Math.sin,
2657
+ sqrt = Math.sqrt;
2658
+ var lat1 = point1[1] * deg2rad;
2659
+ var lon1 = point1[0] * deg2rad;
2660
+ var lat2 = point2[1] * deg2rad;
2661
+ var lon2 = point2[0] * deg2rad;
2662
+ var deltaLat = lat2 - lat1;
2663
+ var deltaLng = lon2 - lon1;
2664
+ var calcA = sin(deltaLat / 2) * sin(deltaLat / 2) +
2665
+ cos(lat1) * cos(lat2) * sin(deltaLng / 2) * sin(deltaLng / 2);
2666
+ var calcB = 2 * atan2(sqrt(calcA),
2667
+ sqrt(1 - calcA));
2668
+ var distance = calcB * 6371e3; // in meters
2669
+ var jumps = Math.round(distance / 500000); // 500 km each jump
2670
+ var lineString = [];
2671
+ if (inclusive) {
2672
+ lineString.push(point1);
2673
+ }
2674
+ if (jumps > 1) {
2675
+ var step = 1 / jumps;
2676
+ for (var fraction = step; fraction < 0.999; // Account for float errors
2677
+ fraction += step) {
2678
+ var A = sin((1 - fraction) * calcB) / sin(calcB);
2679
+ var B = sin(fraction * calcB) / sin(calcB);
2680
+ var x = A * cos(lat1) * cos(lon1) + B * cos(lat2) * cos(lon2);
2681
+ var y = A * cos(lat1) * sin(lon1) + B * cos(lat2) * sin(lon2);
2682
+ var z = A * sin(lat1) + B * sin(lat2);
2683
+ var lat3 = atan2(z,
2684
+ sqrt(x * x + y * y));
2685
+ var lon3 = atan2(y,
2686
+ x);
2687
+ lineString.push([lon3 / deg2rad, lat3 / deg2rad]);
2688
+ }
2689
+ }
2690
+ if (inclusive) {
2691
+ lineString.push(point2);
2692
+ }
2693
+ return lineString;
2694
+ };
2695
+ Projection.insertGreatCircles = function (poly) {
2696
+ var i = poly.length - 1;
2697
+ while (i--) {
2698
+ // Distance in degrees, either in lon or lat. Avoid heavy
2699
+ // calculation of true distance.
2700
+ var roughDistance = Math.max(Math.abs(poly[i][0] - poly[i + 1][0]),
2701
+ Math.abs(poly[i][1] - poly[i + 1][1]));
2702
+ if (roughDistance > 10) {
2703
+ var greatCircle = Projection.greatCircle(poly[i],
2704
+ poly[i + 1]);
2705
+ if (greatCircle.length) {
2706
+ poly.splice.apply(poly, __spreadArrays([i + 1, 0], greatCircle));
2707
+ }
2708
+ }
2709
+ }
2710
+ };
2711
+ Projection.toString = function (options) {
2712
+ var _a = options || {},
2713
+ name = _a.name,
2714
+ rotation = _a.rotation;
2715
+ return [name, rotation && rotation.join(',')].join(';');
2716
+ };
2717
+ /*
2718
+ * Take the rotation options and return the appropriate projection functions
2719
+ */
2720
+ Projection.prototype.getRotator = function (rotation) {
2721
+ var deltaLambda = rotation[0] * deg2rad,
2722
+ deltaPhi = (rotation[1] || 0) * deg2rad,
2723
+ deltaGamma = (rotation[2] || 0) * deg2rad;
2724
+ var cosDeltaPhi = Math.cos(deltaPhi),
2725
+ sinDeltaPhi = Math.sin(deltaPhi),
2726
+ cosDeltaGamma = Math.cos(deltaGamma),
2727
+ sinDeltaGamma = Math.sin(deltaGamma);
2728
+ if (deltaLambda === 0 && deltaPhi === 0 && deltaGamma === 0) {
2729
+ // Don't waste processing time
2730
+ return;
2731
+ }
2732
+ return {
2733
+ forward: function (lonLat) {
2734
+ // Lambda (lon) rotation
2735
+ var lon = lonLat[0] * deg2rad + deltaLambda;
2736
+ // Phi (lat) and gamma rotation
2737
+ var lat = lonLat[1] * deg2rad,
2738
+ cosLat = Math.cos(lat),
2739
+ x = Math.cos(lon) * cosLat,
2740
+ y = Math.sin(lon) * cosLat,
2741
+ sinLat = Math.sin(lat),
2742
+ k = sinLat * cosDeltaPhi + x * sinDeltaPhi;
2743
+ return [
2744
+ Math.atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - sinLat * sinDeltaPhi) / deg2rad,
2745
+ Math.asin(k * cosDeltaGamma + y * sinDeltaGamma) / deg2rad
2746
+ ];
2747
+ },
2748
+ inverse: function (rLonLat) {
2749
+ // Lambda (lon) unrotation
2750
+ var lon = rLonLat[0] * deg2rad;
2751
+ // Phi (lat) and gamma unrotation
2752
+ var lat = rLonLat[1] * deg2rad,
2753
+ cosLat = Math.cos(lat),
2754
+ x = Math.cos(lon) * cosLat,
2755
+ y = Math.sin(lon) * cosLat,
2756
+ sinLat = Math.sin(lat),
2757
+ k = sinLat * cosDeltaGamma - y * sinDeltaGamma;
2758
+ return [
2759
+ (Math.atan2(y * cosDeltaGamma + sinLat * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi) - deltaLambda) / deg2rad,
2760
+ Math.asin(k * cosDeltaPhi - x * sinDeltaPhi) / deg2rad
2761
+ ];
2762
+ }
2763
+ };
2764
+ };
2765
+ // Project a lonlat coordinate position to xy. Dynamically overridden when
2766
+ // projection is set.
2767
+ Projection.prototype.forward = function (lonLat) {
2768
+ return lonLat;
2769
+ };
2770
+ // Project an xy chart coordinate position to lonlat. Dynamically overridden
2771
+ // when projection is set.
2772
+ Projection.prototype.inverse = function (xy) {
2773
+ return xy;
2774
+ };
2775
+ Projection.prototype.clipOnAntimeridian = function (poly, isPolygon) {
2776
+ var antimeridian = 180;
2777
+ var intersections = [];
2778
+ var polygons = [poly];
2779
+ poly.forEach(function (lonLat, i) {
2780
+ var previousLonLat = poly[i - 1];
2781
+ if (!i) {
2782
+ if (!isPolygon) {
2783
+ return;
2784
+ }
2785
+ // Else, wrap to beginning
2786
+ previousLonLat = poly[poly.length - 1];
2787
+ }
2788
+ var lon1 = previousLonLat[0],
2789
+ lon2 = lonLat[0];
2790
+ if (
2791
+ // Both points, after rotating for antimeridian, are on the far
2792
+ // side of the Earth
2793
+ (lon1 < -90 || lon1 > 90) &&
2794
+ (lon2 < -90 || lon2 > 90) &&
2795
+ // ... and on either side of the plane
2796
+ (lon1 > 0) !== (lon2 > 0)) {
2797
+ // Interpolate to the intersection latitude
2798
+ var fraction = (antimeridian - previousLonLat[0]) /
2799
+ (lonLat[0] - previousLonLat[0]);
2800
+ var lat = previousLonLat[1] +
2801
+ fraction * (lonLat[1] - previousLonLat[1]);
2802
+ intersections.push({
2803
+ i: i,
2804
+ lat: lat,
2805
+ direction: lon1 < 0 ? 1 : -1,
2806
+ previousLonLat: previousLonLat,
2807
+ lonLat: lonLat
2808
+ });
2809
+ }
2810
+ });
2811
+ var polarIntersection;
2812
+ if (intersections.length) {
2813
+ if (isPolygon) {
2814
+ // Simplified use of the even-odd rule, if there is an odd
2815
+ // amount of intersections between the polygon and the
2816
+ // antimeridian, the pole is inside the polygon. Applies
2817
+ // primarily to Antarctica.
2818
+ if (intersections.length % 2 === 1) {
2819
+ polarIntersection = intersections.slice().sort(function (a, b) { return Math.abs(b.lat) - Math.abs(a.lat); })[0];
2820
+ erase(intersections, polarIntersection);
2821
+ }
2822
+ // Pull out slices of the polygon that is on the opposite side
2823
+ // of the antimeridian compared to the starting point
2824
+ var i = intersections.length - 2;
2825
+ while (i >= 0) {
2826
+ var index = intersections[i].i;
2827
+ var lonPlus = wrapLon(antimeridian +
2828
+ intersections[i].direction * floatCorrection);
2829
+ var lonMinus = wrapLon(antimeridian -
2830
+ intersections[i].direction * floatCorrection);
2831
+ var slice = poly.splice.apply(poly,
2832
+ __spreadArrays([index,
2833
+ intersections[i + 1].i - index],
2834
+ Projection.greatCircle([lonPlus,
2835
+ intersections[i].lat],
2836
+ [lonPlus,
2837
+ intersections[i + 1].lat],
2838
+ true)));
2839
+ // Add interpolated points close to the cut
2840
+ slice.push.apply(slice, Projection.greatCircle([lonMinus, intersections[i + 1].lat], [lonMinus, intersections[i].lat], true));
2841
+ polygons.push(slice);
2842
+ i -= 2;
2843
+ }
2844
+ // Insert dummy points close to the pole
2845
+ if (polarIntersection) {
2846
+ for (var i_1 = 0; i_1 < polygons.length; i_1++) {
2847
+ var poly_1 = polygons[i_1];
2848
+ var indexOf = poly_1.indexOf(polarIntersection.lonLat);
2849
+ if (indexOf > -1) {
2850
+ var polarLatitude = (polarIntersection.lat < 0 ? -1 : 1) *
2851
+ this.maxLatitude;
2852
+ var lon1 = wrapLon(antimeridian +
2853
+ polarIntersection.direction * floatCorrection);
2854
+ var lon2 = wrapLon(antimeridian -
2855
+ polarIntersection.direction * floatCorrection);
2856
+ var polarSegment = Projection.greatCircle([lon1,
2857
+ polarIntersection.lat],
2858
+ [lon1,
2859
+ polarLatitude],
2860
+ true).concat(Projection.greatCircle([lon2,
2861
+ polarLatitude],
2862
+ [lon2,
2863
+ polarIntersection.lat],
2864
+ true));
2865
+ poly_1.splice.apply(poly_1, __spreadArrays([indexOf,
2866
+ 0], polarSegment));
2867
+ break;
2868
+ }
2869
+ }
2870
+ }
2871
+ // Map lines, not closed
2872
+ }
2873
+ else {
2874
+ var i = intersections.length;
2875
+ while (i--) {
2876
+ var index = intersections[i].i;
2877
+ var slice = poly.splice(index,
2878
+ poly.length,
2879
+ // Add interpolated point close to the cut
2880
+ [
2881
+ wrapLon(antimeridian +
2882
+ intersections[i].direction * floatCorrection),
2883
+ intersections[i].lat
2884
+ ]);
2885
+ // Add interpolated point close to the cut
2886
+ slice.unshift([
2887
+ wrapLon(antimeridian -
2888
+ intersections[i].direction * floatCorrection),
2889
+ intersections[i].lat
2890
+ ]);
2891
+ polygons.push(slice);
2892
+ }
2893
+ }
2894
+ }
2895
+ // Insert great circles along the cuts
2896
+ /*
2897
+ if (isPolygon && polygons.length > 1 || polarIntersection) {
2898
+ polygons.forEach(Projection.insertGreatCircles);
2899
+ }
2900
+ */
2901
+ return polygons;
2902
+ };
2903
+ // Take a GeoJSON geometry and return a translated SVGPath
2904
+ Projection.prototype.path = function (geometry) {
2905
+ var _this = this;
2906
+ var _a = this,
2907
+ def = _a.def,
2908
+ rotator = _a.rotator;
2909
+ var antimeridian = 180;
2910
+ var path = [];
2911
+ var isPolygon = geometry.type === 'Polygon' ||
2912
+ geometry.type === 'MultiPolygon';
2913
+ // @todo: It doesn't really have to do with whether north is
2914
+ // positive. It depends on whether the coordinates are
2915
+ // pre-projected.
2916
+ var hasGeoProjection = this.hasGeoProjection;
2917
+ // @todo better test for when to do this
2918
+ var projectingToPlane = this.options.name !== 'Orthographic';
2919
+ // We need to rotate in a separate step before applying antimeridian
2920
+ // clipping
2921
+ var preclip = projectingToPlane ? rotator : void 0;
2922
+ var postclip = projectingToPlane ? (def || this) : this;
2923
+ var addToPath = function (polygon) {
2924
+ // Create a copy of the original coordinates. The copy applies a
2925
+ // correction of points close to the antimeridian in order to
2926
+ // prevent the points to be projected to the wrong side of the
2927
+ // plane. Float errors in topojson or in the projection may cause
2928
+ // that.
2929
+ var poly = polygon.map(function (lonLat) {
2930
+ if (projectingToPlane) {
2931
+ if (preclip) {
2932
+ lonLat = preclip.forward(lonLat);
2933
+ }
2934
+ var lon = lonLat[0];
2935
+ if (Math.abs(lon - antimeridian) < floatCorrection) {
2936
+ if (lon < antimeridian) {
2937
+ lon = antimeridian - floatCorrection;
2938
+ }
2939
+ else {
2940
+ lon = antimeridian + floatCorrection;
2941
+ }
2942
+ }
2943
+ lonLat = [lon, lonLat[1]];
2944
+ }
2945
+ return lonLat;
2946
+ });
2947
+ var polygons = [poly];
2948
+ if (hasGeoProjection) {
2949
+ // Insert great circles into long straight lines
2950
+ Projection.insertGreatCircles(poly);
2951
+ if (projectingToPlane) {
2952
+ polygons = _this.clipOnAntimeridian(poly, isPolygon);
2953
+ }
2954
+ }
2955
+ polygons.forEach(function (poly) {
2956
+ if (poly.length < 2) {
2957
+ return;
2958
+ }
2959
+ var movedTo = false;
2960
+ var firstValidLonLat;
2961
+ var lastValidLonLat;
2962
+ var gap = false;
2963
+ var pushToPath = function (point) {
2964
+ if (!movedTo) {
2965
+ path.push(['M',
2966
+ point[0],
2967
+ point[1]]);
2968
+ movedTo = true;
2969
+ }
2970
+ else {
2971
+ path.push(['L', point[0], point[1]]);
2972
+ }
2973
+ };
2974
+ for (var i = 0; i < poly.length; i++) {
2975
+ var lonLat = poly[i];
2976
+ var point = postclip.forward(lonLat);
2977
+ var valid = (!isNaN(point[0]) &&
2978
+ !isNaN(point[1]) &&
2979
+ (!hasGeoProjection ||
2980
+ // Limited projections like Web Mercator
2981
+ (lonLat[1] <= _this.maxLatitude &&
2982
+ lonLat[1] >= -_this.maxLatitude)));
2983
+ if (valid) {
2984
+ // In order to be able to interpolate if the first or
2985
+ // last point is invalid (on the far side of the globe
2986
+ // in an orthographic projection), we need to push the
2987
+ // first valid point to the end of the polygon.
2988
+ if (isPolygon && !firstValidLonLat) {
2989
+ firstValidLonLat = lonLat;
2990
+ poly.push(lonLat);
2991
+ }
2992
+ // When entering the first valid point after a gap of
2993
+ // invalid points, typically on the far side of the
2994
+ // globe in an orthographic projection.
2995
+ if (gap && lastValidLonLat) {
2996
+ // For areas, in an orthographic projection, the
2997
+ // great circle between two visible points will be
2998
+ // close to the horizon. A possible exception may be
2999
+ // when the two points are on opposite sides of the
3000
+ // globe. It that poses a problem, we may have to
3001
+ // rewrite this to use the small circle related to
3002
+ // the current lon0 and lat0.
3003
+ if (isPolygon && hasGeoProjection) {
3004
+ var greatCircle = Projection.greatCircle(lastValidLonLat,
3005
+ lonLat);
3006
+ greatCircle.forEach(function (lonLat) {
3007
+ return pushToPath(postclip.forward(lonLat));
3008
+ });
3009
+ // For lines, just jump over the gap
3010
+ }
3011
+ else {
3012
+ movedTo = false;
3013
+ }
3014
+ }
3015
+ pushToPath(point);
3016
+ lastValidLonLat = lonLat;
3017
+ gap = false;
3018
+ }
3019
+ else {
3020
+ gap = true;
3021
+ }
3022
+ }
3023
+ });
3024
+ };
3025
+ if (geometry.type === 'LineString') {
3026
+ addToPath(geometry.coordinates);
3027
+ }
3028
+ else if (geometry.type === 'MultiLineString') {
3029
+ geometry.coordinates.forEach(function (c) { return addToPath(c); });
3030
+ }
3031
+ else if (geometry.type === 'Polygon') {
3032
+ geometry.coordinates.forEach(function (c) { return addToPath(c); });
3033
+ if (path.length) {
3034
+ path.push(['Z']);
3035
+ }
3036
+ }
3037
+ else if (geometry.type === 'MultiPolygon') {
3038
+ geometry.coordinates.forEach(function (polygons) {
3039
+ polygons.forEach(function (c) { return addToPath(c); });
3040
+ });
3041
+ if (path.length) {
3042
+ path.push(['Z']);
3043
+ }
3044
+ }
3045
+ return path;
3046
+ };
3047
+ Projection.registry = registry;
3048
+ return Projection;
3049
+ }());
3050
+
3051
+ return Projection;
3052
+ });
3053
+ _registerModule(_modules, 'Maps/MapView.js', [_modules['Maps/MapViewOptionsDefault.js'], _modules['Maps/Projection.js'], _modules['Core/Utilities.js']], function (defaultOptions, Projection, U) {
3054
+ /* *
3055
+ *
3056
+ * (c) 2010-2020 Torstein Honsi
3057
+ *
3058
+ * License: www.highcharts.com/license
3059
+ *
3060
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
3061
+ *
3062
+ * */
3063
+ var addEvent = U.addEvent,
3064
+ clamp = U.clamp,
3065
+ fireEvent = U.fireEvent,
3066
+ isNumber = U.isNumber,
3067
+ merge = U.merge,
3068
+ pick = U.pick,
3069
+ relativeLength = U.relativeLength;
3070
+ /**
3071
+ * The world size in terms of 10k meters in the Web Mercator projection, to
3072
+ * match a 256 square tile to zoom level 0
3073
+ */
3074
+ var worldSize = 400.979322;
3075
+ var tileSize = 256;
3076
+ /**
3077
+ * The map view handles zooming and centering on the map, and various
3078
+ * client-side projection capabilities.
3079
+ *
3080
+ * On a chart instance, the map view is available as `chart.mapView`.
3081
+ *
3082
+ * @class
3083
+ * @name Highcharts.MapView
3084
+ *
3085
+ * @param {Highcharts.Chart} chart
3086
+ * The Chart instance
3087
+ * @param {Highcharts.MapViewOptions} options
3088
+ * MapView options
3089
+ */
3090
+ var MapView = /** @class */ (function () {
3091
+ function MapView(chart, options) {
3092
+ var _this = this;
3093
+ this.userOptions = options || {};
3094
+ var o = merge(defaultOptions,
3095
+ options);
3096
+ this.chart = chart;
3097
+ /**
3098
+ * The current center of the view in terms of `[longitude, latitude]`.
3099
+ * @name Highcharts.MapView#center
3100
+ * @readonly
3101
+ * @type {LonLatArray}
3102
+ */
3103
+ this.center = o.center;
3104
+ this.options = o;
3105
+ this.projection = new Projection(o.projection);
3106
+ /**
3107
+ * The current zoom level of the view.
3108
+ * @name Highcharts.MapView#zoom
3109
+ * @readonly
3110
+ * @type {number}
3111
+ */
3112
+ this.zoom = o.zoom || 0;
3113
+ // Initialize and respond to chart size changes
3114
+ addEvent(chart, 'afterSetChartSize', function () {
3115
+ if (_this.minZoom === void 0 || // When initializing the chart
3116
+ _this.minZoom === _this.zoom // When resizing the chart
3117
+ ) {
3118
+ _this.fitToBounds(void 0, void 0, false);
3119
+ if (isNumber(_this.userOptions.zoom)) {
3120
+ _this.zoom = _this.userOptions.zoom;
3121
+ }
3122
+ if (_this.userOptions.center) {
3123
+ merge(true, _this.center, _this.userOptions.center);
3124
+ }
3125
+ }
3126
+ });
3127
+ // Set up panning for maps. In orthographic projections the globe will
3128
+ // rotate, otherwise adjust the map center.
3129
+ var mouseDownCenterProjected;
3130
+ var mouseDownKey;
3131
+ var mouseDownRotation;
3132
+ var onPan = function (e) {
3133
+ var pinchDown = chart.pointer.pinchDown;
3134
+ var mouseDownX = chart.mouseDownX,
3135
+ mouseDownY = chart.mouseDownY;
3136
+ if (pinchDown.length === 1) {
3137
+ mouseDownX = pinchDown[0].chartX;
3138
+ mouseDownY = pinchDown[0].chartY;
3139
+ }
3140
+ if (typeof mouseDownX === 'number' &&
3141
+ typeof mouseDownY === 'number') {
3142
+ var key = mouseDownX + "," + mouseDownY, _a = e.originalEvent, chartX = _a.chartX, chartY = _a.chartY;
3143
+ // Reset starting position
3144
+ if (key !== mouseDownKey) {
3145
+ mouseDownKey = key;
3146
+ mouseDownCenterProjected = _this.projection
3147
+ .forward(_this.center);
3148
+ mouseDownRotation = (_this.projection.options.rotation || [0, 0]).slice();
3149
+ }
3150
+ // Panning rotates the globe
3151
+ if (_this.projection.options.name === 'Orthographic' &&
3152
+ // ... but don't rotate if we're loading only a part of the
3153
+ // world
3154
+ (_this.minZoom || Infinity) < 3) {
3155
+ // Empirical ratio where the globe rotates roughly the same
3156
+ // speed as moving the pointer across the center of the
3157
+ // projection
3158
+ var ratio = 440 / (_this.getScale() * Math.min(chart.plotWidth,
3159
+ chart.plotHeight));
3160
+ if (mouseDownRotation) {
3161
+ var lon = (mouseDownX - chartX) * ratio -
3162
+ mouseDownRotation[0];
3163
+ var lat = clamp(-mouseDownRotation[1] -
3164
+ (mouseDownY - chartY) * ratio, -80, 80);
3165
+ _this.update({
3166
+ projection: {
3167
+ rotation: [-lon, -lat]
3168
+ },
3169
+ center: [lon, lat],
3170
+ zoom: _this.zoom
3171
+ }, true, false);
3172
+ }
3173
+ }
3174
+ else {
3175
+ var scale = _this.getScale();
3176
+ var newCenter = _this.projection.inverse([
3177
+ mouseDownCenterProjected[0] +
3178
+ (mouseDownX - chartX) / scale,
3179
+ mouseDownCenterProjected[1] -
3180
+ (mouseDownY - chartY) / scale
3181
+ ]);
3182
+ _this.setView(newCenter, void 0, true, false);
3183
+ }
3184
+ e.preventDefault();
3185
+ }
3186
+ };
3187
+ addEvent(chart, 'pan', onPan);
3188
+ addEvent(chart, 'touchpan', onPan);
3189
+ // Perform the map zoom by selection
3190
+ addEvent(chart, 'selection', function (evt) {
3191
+ // Zoom in
3192
+ if (!evt.resetSelection) {
3193
+ var x = evt.x - chart.plotLeft;
3194
+ var y = evt.y - chart.plotTop;
3195
+ var _a = _this.pixelsToProjectedUnits({ x: x,
3196
+ y: y }),
3197
+ y1 = _a.y,
3198
+ x1 = _a.x;
3199
+ var _b = _this.pixelsToProjectedUnits({ x: x + evt.width,
3200
+ y: y + evt.height }),
3201
+ y2 = _b.y,
3202
+ x2 = _b.x;
3203
+ _this.fitToBounds({ x1: x1, y1: y1, x2: x2, y2: y2 }, void 0, true, evt.originalEvent.touches ?
3204
+ // On touch zoom, don't animate, since we're already in
3205
+ // transformed zoom preview
3206
+ false :
3207
+ // On mouse zoom, obey the chart-level animation
3208
+ void 0);
3209
+ // Only for mouse. Touch users can pinch out.
3210
+ if (!/^touch/.test((evt.originalEvent.type))) {
3211
+ chart.showResetZoom();
3212
+ }
3213
+ evt.preventDefault();
3214
+ // Reset zoom
3215
+ }
3216
+ else {
3217
+ _this.zoomBy();
3218
+ }
3219
+ });
3220
+ }
3221
+ /**
3222
+ * Fit the view to given bounds
3223
+ *
3224
+ * @function Highcharts.MapView#fitToBounds
3225
+ * @param {Object} bounds
3226
+ * Bounds in terms of projected units given as `{ x1, y1, x2, y2 }`.
3227
+ * If not set, fit to the bounds of the current data set
3228
+ * @param {number|string} [padding=0]
3229
+ * Padding inside the bounds. A number signifies pixels, while a
3230
+ * percentage string (like `5%`) can be used as a fraction of the
3231
+ * plot area size.
3232
+ * @param {boolean} [redraw=true]
3233
+ * Whether to redraw the chart immediately
3234
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3235
+ * What animation to use for redraw
3236
+ */
3237
+ MapView.prototype.fitToBounds = function (bounds, padding, redraw, animation) {
3238
+ if (redraw === void 0) { redraw = true; }
3239
+ var b = bounds || this.getProjectedBounds();
3240
+ if (b) {
3241
+ var _a = this.chart,
3242
+ plotWidth = _a.plotWidth,
3243
+ plotHeight = _a.plotHeight,
3244
+ pad = pick(padding,
3245
+ bounds ? 0 : this.options.padding),
3246
+ paddingX = relativeLength(pad,
3247
+ plotWidth),
3248
+ paddingY = relativeLength(pad,
3249
+ plotHeight);
3250
+ var scaleToPlotArea = Math.max((b.x2 - b.x1) / ((plotWidth - paddingX) / tileSize), (b.y2 - b.y1) / ((plotHeight - paddingY) / tileSize));
3251
+ var zoom = Math.log(worldSize / scaleToPlotArea) / Math.log(2);
3252
+ // Reset minZoom when fitting to natural bounds
3253
+ if (!bounds) {
3254
+ this.minZoom = zoom;
3255
+ }
3256
+ var center = this.projection.inverse([
3257
+ (b.x2 + b.x1) / 2,
3258
+ (b.y2 + b.y1) / 2
3259
+ ]);
3260
+ this.setView(center, zoom, redraw, animation);
3261
+ }
3262
+ };
3263
+ MapView.prototype.getProjectedBounds = function () {
3264
+ var allBounds = this.chart.series.reduce(function (acc,
3265
+ s) {
3266
+ var bounds = s.getProjectedBounds && s.getProjectedBounds();
3267
+ if (bounds) {
3268
+ acc.push(bounds);
3269
+ }
3270
+ return acc;
3271
+ }, []);
3272
+ return MapView.compositeBounds(allBounds);
3273
+ };
3274
+ MapView.prototype.getScale = function () {
3275
+ // A zoom of 0 means the world (360x360 degrees) fits in a 256x256 px
3276
+ // tile
3277
+ return (tileSize / worldSize) * Math.pow(2, this.zoom);
3278
+ };
3279
+ MapView.prototype.redraw = function (animation) {
3280
+ this.chart.series.forEach(function (s) {
3281
+ if (s.useMapGeometry) {
3282
+ s.isDirty = true;
3283
+ }
3284
+ });
3285
+ this.chart.redraw(animation);
3286
+ };
3287
+ /**
3288
+ * Set the view to given center and zoom values.
3289
+ * @function Highcharts.MapView#setView
3290
+ * @param {Highcharts.LonLatArray|undefined} center
3291
+ * The center point
3292
+ * @param {number} zoom
3293
+ * The zoom level
3294
+ * @param {boolean} [redraw=true]
3295
+ * Whether to redraw immediately
3296
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3297
+ * Animation options for the redraw
3298
+ *
3299
+ * @sample maps/mapview/setview
3300
+ * Set the view programmatically
3301
+ */
3302
+ MapView.prototype.setView = function (center, zoom, redraw, animation) {
3303
+ if (redraw === void 0) { redraw = true; }
3304
+ var zoomingIn = false;
3305
+ if (center) {
3306
+ this.center = center;
3307
+ }
3308
+ if (typeof zoom === 'number') {
3309
+ if (typeof this.minZoom === 'number') {
3310
+ zoom = Math.max(zoom, this.minZoom);
3311
+ }
3312
+ if (typeof this.options.maxZoom === 'number') {
3313
+ zoom = Math.min(zoom, this.options.maxZoom);
3314
+ }
3315
+ zoomingIn = zoom > this.zoom;
3316
+ this.zoom = zoom;
3317
+ }
3318
+ // Stay within the data bounds
3319
+ var bounds = this.getProjectedBounds();
3320
+ if (bounds &&
3321
+ // When zooming in, we don't need to adjust to the bounds, as that
3322
+ // could shift the location under the mouse
3323
+ !zoomingIn) {
3324
+ var projectedCenter = this.projection.forward(this.center);
3325
+ var _a = this.chart,
3326
+ plotWidth = _a.plotWidth,
3327
+ plotHeight = _a.plotHeight;
3328
+ var scale = this.getScale();
3329
+ var bottomLeft = this.projectedUnitsToPixels({
3330
+ x: bounds.x1,
3331
+ y: bounds.y1
3332
+ });
3333
+ var topRight = this.projectedUnitsToPixels({
3334
+ x: bounds.x2,
3335
+ y: bounds.y2
3336
+ });
3337
+ var boundsCenterProjected = [
3338
+ (bounds.x1 + bounds.x2) / 2,
3339
+ (bounds.y1 + bounds.y2) / 2
3340
+ ];
3341
+ // Pixel coordinate system is reversed vs projected
3342
+ var x1 = bottomLeft.x;
3343
+ var y1 = topRight.y;
3344
+ var x2 = topRight.x;
3345
+ var y2 = bottomLeft.y;
3346
+ // Map smaller than plot area, center it
3347
+ if (x2 - x1 < plotWidth) {
3348
+ projectedCenter[0] = boundsCenterProjected[0];
3349
+ // Off west
3350
+ }
3351
+ else if (x1 < 0 && x2 < plotWidth) {
3352
+ // Adjust eastwards
3353
+ projectedCenter[0] += Math.max(x1, x2 - plotWidth) / scale;
3354
+ // Off east
3355
+ }
3356
+ else if (x2 > plotWidth && x1 > 0) {
3357
+ // Adjust westwards
3358
+ projectedCenter[0] += Math.min(x2 - plotWidth, x1) / scale;
3359
+ }
3360
+ // Map smaller than plot area, center it
3361
+ if (y2 - y1 < plotHeight) {
3362
+ projectedCenter[1] = boundsCenterProjected[1];
3363
+ // Off north
3364
+ }
3365
+ else if (y1 < 0 && y2 < plotHeight) {
3366
+ // Adjust southwards
3367
+ projectedCenter[1] -= Math.max(y1, y2 - plotHeight) / scale;
3368
+ // Off south
3369
+ }
3370
+ else if (y2 > plotHeight && y1 > 0) {
3371
+ // Adjust northwards
3372
+ projectedCenter[1] -= Math.min(y2 - plotHeight, y1) / scale;
3373
+ }
3374
+ this.center = this.projection.inverse(projectedCenter);
3375
+ }
3376
+ fireEvent(this, 'afterSetView');
3377
+ if (redraw) {
3378
+ this.redraw(animation);
3379
+ }
3380
+ };
3381
+ /**
3382
+ * Convert projected units to pixel position
3383
+ *
3384
+ * @function Highcharts.MapView#projectedUnitsToPixels
3385
+ * @param {Highcharts.PositionObject} pos
3386
+ * The position in projected units
3387
+ * @return {Highcharts.PositionObject} The position in pixels
3388
+ */
3389
+ MapView.prototype.projectedUnitsToPixels = function (pos) {
3390
+ var scale = this.getScale();
3391
+ var projectedCenter = this.projection.forward(this.center);
3392
+ var centerPxX = this.chart.plotWidth / 2;
3393
+ var centerPxY = this.chart.plotHeight / 2;
3394
+ var x = centerPxX - scale * (projectedCenter[0] - pos.x);
3395
+ var y = centerPxY + scale * (projectedCenter[1] - pos.y);
3396
+ return { x: x, y: y };
3397
+ };
3398
+ /**
3399
+ * Convert pixel position to projected units
3400
+ *
3401
+ * @function Highcharts.MapView#pixelsToProjectedUnits
3402
+ * @param {Highcharts.PositionObject} pos
3403
+ * The position in pixels
3404
+ * @return {Highcharts.PositionObject} The position in projected units
3405
+ */
3406
+ MapView.prototype.pixelsToProjectedUnits = function (pos) {
3407
+ var x = pos.x,
3408
+ y = pos.y;
3409
+ var scale = this.getScale();
3410
+ var projectedCenter = this.projection.forward(this.center);
3411
+ var centerPxX = this.chart.plotWidth / 2;
3412
+ var centerPxY = this.chart.plotHeight / 2;
3413
+ var projectedX = projectedCenter[0] + (x - centerPxX) / scale;
3414
+ var projectedY = projectedCenter[1] - (y - centerPxY) / scale;
3415
+ return { x: projectedX, y: projectedY };
3416
+ };
3417
+ /**
3418
+ * Update the view with given options
3419
+ *
3420
+ * @function Highcharts.MapView#update
3421
+ *
3422
+ * @param {Partial<Highcharts.MapViewOptions>} options
3423
+ * The new map view options to apply
3424
+ * @param {boolean} [redraw=true]
3425
+ * Whether to redraw immediately
3426
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3427
+ * The animation to apply to a the redraw
3428
+ */
3429
+ MapView.prototype.update = function (options, redraw, animation) {
3430
+ if (redraw === void 0) { redraw = true; }
3431
+ var newProjection = options.projection;
3432
+ var isDirtyProjection = newProjection && ((Projection.toString(newProjection) !==
3433
+ Projection.toString(this.options.projection)));
3434
+ merge(true, this.userOptions, options);
3435
+ merge(true, this.options, options);
3436
+ if (isDirtyProjection) {
3437
+ this.chart.series.forEach(function (series) {
3438
+ if (series.clearBounds) {
3439
+ series.clearBounds();
3440
+ }
3441
+ series.isDirty = true;
3442
+ series.isDirtyData = true;
3443
+ });
3444
+ this.projection = new Projection(this.options.projection);
3445
+ // Fit to natural bounds if center/zoom are not explicitly given
3446
+ if (!options.center && !isNumber(options.zoom)) {
3447
+ this.fitToBounds(void 0, void 0, false);
3448
+ }
3449
+ }
3450
+ if (options.center || isNumber(options.zoom)) {
3451
+ this.setView(this.options.center, options.zoom, false);
3452
+ }
3453
+ if (redraw) {
3454
+ this.chart.redraw(animation);
3455
+ }
3456
+ };
3457
+ /**
3458
+ * Zoom the map view by a given number
3459
+ *
3460
+ * @function Highcharts.MapView#zoomBy
3461
+ *
3462
+ * @param {number|undefined} [howMuch]
3463
+ * The amount of zoom to apply. 1 zooms in on half the current view,
3464
+ * -1 zooms out. Pass `undefined` to zoom to the full bounds of the
3465
+ * map.
3466
+ * @param {Highcharts.LonLatArray} [coords]
3467
+ * Optional map coordinates to keep fixed
3468
+ * @param {Array<number>} [chartCoords]
3469
+ * Optional chart coordinates to keep fixed, in pixels
3470
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3471
+ * The animation to apply to a the redraw
3472
+ */
3473
+ MapView.prototype.zoomBy = function (howMuch, coords, chartCoords, animation) {
3474
+ var chart = this.chart;
3475
+ var projectedCenter = this.projection.forward(this.center);
3476
+ // let { x, y } = coords || {};
3477
+ var _a = coords ? this.projection.forward(coords) : [],
3478
+ x = _a[0],
3479
+ y = _a[1];
3480
+ if (typeof howMuch === 'number') {
3481
+ var zoom = this.zoom + howMuch;
3482
+ var center = void 0;
3483
+ // Keep chartX and chartY stationary - convert to lat and lng
3484
+ if (chartCoords) {
3485
+ var chartX = chartCoords[0],
3486
+ chartY = chartCoords[1];
3487
+ var scale = this.getScale();
3488
+ var offsetX = chartX - chart.plotLeft - chart.plotWidth / 2;
3489
+ var offsetY = chartY - chart.plotTop - chart.plotHeight / 2;
3490
+ x = projectedCenter[0] + offsetX / scale;
3491
+ y = projectedCenter[1] + offsetY / scale;
3492
+ }
3493
+ // Keep lon and lat stationary by adjusting the center
3494
+ if (typeof x === 'number' && typeof y === 'number') {
3495
+ var scale = 1 - Math.pow(2,
3496
+ this.zoom) / Math.pow(2,
3497
+ zoom);
3498
+ // const projectedCenter = this.projection.forward(this.center);
3499
+ var offsetX = projectedCenter[0] - x;
3500
+ var offsetY = projectedCenter[1] - y;
3501
+ projectedCenter[0] -= offsetX * scale;
3502
+ projectedCenter[1] += offsetY * scale;
3503
+ center = this.projection.inverse(projectedCenter);
3504
+ }
3505
+ this.setView(center, zoom, void 0, animation);
3506
+ // Undefined howMuch => reset zoom
3507
+ }
3508
+ else {
3509
+ this.fitToBounds(void 0, void 0, void 0, animation);
3510
+ }
3511
+ };
3512
+ /* *
3513
+ * Return the composite bounding box of a collection of bounding boxes
3514
+ */
3515
+ MapView.compositeBounds = function (arrayOfBounds) {
3516
+ if (arrayOfBounds.length) {
3517
+ return arrayOfBounds
3518
+ .slice(1)
3519
+ .reduce(function (acc, cur) {
3520
+ acc.x1 = Math.min(acc.x1, cur.x1);
3521
+ acc.y1 = Math.min(acc.y1, cur.y1);
3522
+ acc.x2 = Math.max(acc.x2, cur.x2);
3523
+ acc.y2 = Math.max(acc.y2, cur.y2);
3524
+ return acc;
3525
+ }, merge(arrayOfBounds[0]));
3526
+ }
3527
+ return;
3528
+ };
3529
+ return MapView;
3530
+ }());
3531
+
3532
+ return MapView;
3533
+ });
3534
+ _registerModule(_modules, 'Maps/MapSymbols.js', [_modules['Core/Renderer/SVG/SVGRenderer.js']], function (SVGRenderer) {
3535
+ /* *
3536
+ *
3537
+ * (c) 2010-2021 Torstein Honsi
3538
+ *
3539
+ * License: www.highcharts.com/license
3540
+ *
3541
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
3542
+ *
3543
+ * */
3544
+ var symbols = SVGRenderer.prototype.symbols;
3545
+ /* *
3546
+ *
3547
+ * Functions
3548
+ *
3549
+ * */
3550
+ /* eslint-disable require-jsdoc, valid-jsdoc */
3551
+ function bottomButton(x, y, w, h, options) {
3552
+ var r = (options && options.r) || 0;
3553
+ return selectiveRoundedRect(x - 1, y - 1, w, h, 0, 0, r, r);
3554
+ }
3555
+ /**
3556
+ * Create symbols for the zoom buttons
3557
+ * @private
3558
+ */
3559
+ function selectiveRoundedRect(x, y, w, h, rTopLeft, rTopRight, rBottomRight, rBottomLeft) {
3560
+ return [
3561
+ ['M', x + rTopLeft, y],
3562
+ // top side
3563
+ ['L', x + w - rTopRight, y],
3564
+ // top right corner
3565
+ ['C', x + w - rTopRight / 2, y, x + w, y + rTopRight / 2, x + w, y + rTopRight],
3566
+ // right side
3567
+ ['L', x + w, y + h - rBottomRight],
3568
+ // bottom right corner
3569
+ ['C', x + w, y + h - rBottomRight / 2, x + w - rBottomRight / 2, y + h, x + w - rBottomRight, y + h],
3570
+ // bottom side
3571
+ ['L', x + rBottomLeft, y + h],
3572
+ // bottom left corner
3573
+ ['C', x + rBottomLeft / 2, y + h, x, y + h - rBottomLeft / 2, x, y + h - rBottomLeft],
3574
+ // left side
3575
+ ['L', x, y + rTopLeft],
3576
+ // top left corner
2482
3577
  ['C', x, y + rTopLeft / 2, x + rTopLeft / 2, y, x + rTopLeft, y],
2483
3578
  ['Z']
2484
3579
  ];
@@ -2497,7 +3592,7 @@
2497
3592
 
2498
3593
  return symbols;
2499
3594
  });
2500
- _registerModule(_modules, 'Core/Chart/MapChart.js', [_modules['Core/Chart/Chart.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Chart, D, SVGRenderer, U) {
3595
+ _registerModule(_modules, 'Core/Chart/MapChart.js', [_modules['Core/Chart/Chart.js'], _modules['Core/DefaultOptions.js'], _modules['Maps/MapView.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Chart, D, MapView, SVGRenderer, U) {
2501
3596
  /* *
2502
3597
  *
2503
3598
  * (c) 2010-2021 Torstein Honsi
@@ -2524,7 +3619,10 @@
2524
3619
  };
2525
3620
  })();
2526
3621
  var getOptions = D.getOptions;
2527
- var merge = U.merge,
3622
+ var addEvent = U.addEvent,
3623
+ clamp = U.clamp,
3624
+ isNumber = U.isNumber,
3625
+ merge = U.merge,
2528
3626
  pick = U.pick;
2529
3627
  /**
2530
3628
  * Map-optimized chart. Use {@link Highcharts.Chart|Chart} for common charts.
@@ -2559,19 +3657,11 @@
2559
3657
  * @fires Highcharts.MapChart#event:afterInit
2560
3658
  */
2561
3659
  MapChart.prototype.init = function (userOptions, callback) {
2562
- var hiddenAxis = {
2563
- endOnTick: false,
2564
- visible: false,
2565
- minPadding: 0,
2566
- maxPadding: 0,
2567
- startOnTick: false
2568
- },
2569
- defaultCreditsOptions = getOptions().credits;
2570
- /* For visual testing
2571
- hiddenAxis.gridLineWidth = 1;
2572
- hiddenAxis.gridZIndex = 10;
2573
- hiddenAxis.tickPositions = undefined;
2574
- // */
3660
+ // Initialize the MapView after initialization, but before firstRender
3661
+ addEvent(this, 'afterInit', function () {
3662
+ this.mapView = new MapView(this, this.options.mapView);
3663
+ });
3664
+ var defaultCreditsOptions = getOptions().credits;
2575
3665
  var options = merge({
2576
3666
  chart: {
2577
3667
  panning: {
@@ -2585,19 +3675,13 @@
2585
3675
  '{geojson.copyrightShort}</a>'),
2586
3676
  mapTextFull: pick(defaultCreditsOptions.mapTextFull, '{geojson.copyright}')
2587
3677
  },
3678
+ mapView: {},
2588
3679
  tooltip: {
2589
3680
  followTouchMove: false
2590
- },
2591
- xAxis: hiddenAxis,
2592
- yAxis: merge(hiddenAxis, { reversed: true })
2593
- },
2594
- userOptions, // user's options
2595
- {
2596
- chart: {
2597
- inverted: false,
2598
- alignTicks: false
2599
3681
  }
2600
- });
3682
+ },
3683
+ userOptions // user's options
3684
+ );
2601
3685
  _super.prototype.init.call(this, options, callback);
2602
3686
  };
2603
3687
  return MapChart;
@@ -2691,7 +3775,7 @@
2691
3775
 
2692
3776
  return MapChart;
2693
3777
  });
2694
- _registerModule(_modules, 'Series/Map/MapPoint.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, SeriesRegistry, U) {
3778
+ _registerModule(_modules, 'Series/Map/MapPoint.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
2695
3779
  /* *
2696
3780
  *
2697
3781
  * (c) 2010-2021 Torstein Honsi
@@ -2717,7 +3801,6 @@
2717
3801
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2718
3802
  };
2719
3803
  })();
2720
- var colorMapPointMixin = ColorMapMixin.colorMapPointMixin;
2721
3804
  var ScatterSeries = SeriesRegistry.seriesTypes.scatter;
2722
3805
  var extend = U.extend;
2723
3806
  /* *
@@ -2747,6 +3830,22 @@
2747
3830
  *
2748
3831
  * */
2749
3832
  /* eslint-disable valid-jsdoc */
3833
+ // Get the projected path based on the geometry. May also be called on
3834
+ // mapData options (not point instances), hence static.
3835
+ MapPoint.getProjectedPath = function (point, projection) {
3836
+ if (!point.projectedPath) {
3837
+ if (projection && point.geometry) {
3838
+ // Always true when given GeoJSON coordinates
3839
+ projection.hasCoordinates = true;
3840
+ point.projectedPath = projection.path(point.geometry);
3841
+ // SVG path given directly in point options
3842
+ }
3843
+ else {
3844
+ point.projectedPath = point.path;
3845
+ }
3846
+ }
3847
+ return point.projectedPath || [];
3848
+ };
2750
3849
  /**
2751
3850
  * Extend the Point object to split paths.
2752
3851
  * @private
@@ -2765,11 +3864,6 @@
2765
3864
  mapPoint = typeof mapKey !== 'undefined' &&
2766
3865
  series.mapMap[mapKey];
2767
3866
  if (mapPoint) {
2768
- // This applies only to bubbles
2769
- if (series.xyFromShape) {
2770
- point.x = mapPoint._midX;
2771
- point.y = mapPoint._midY;
2772
- }
2773
3867
  extend(point, mapPoint); // copy over properties
2774
3868
  }
2775
3869
  else {
@@ -2803,19 +3897,16 @@
2803
3897
  * @function Highcharts.Point#zoomTo
2804
3898
  */
2805
3899
  MapPoint.prototype.zoomTo = function () {
2806
- var point = this,
2807
- series = point.series;
2808
- series.xAxis.setExtremes(point._minX, point._maxX, false);
2809
- series.yAxis.setExtremes(point._minY, point._maxY, false);
2810
- series.chart.redraw();
3900
+ var point = this;
3901
+ var chart = point.series.chart;
3902
+ if (chart.mapView && point.bounds) {
3903
+ chart.mapView.fitToBounds(point.bounds, void 0, false);
3904
+ point.series.isDirty = true;
3905
+ chart.redraw();
3906
+ }
2811
3907
  };
2812
3908
  return MapPoint;
2813
3909
  }(ScatterSeries.prototype.pointClass));
2814
- extend(MapPoint.prototype, {
2815
- dataLabelOnNull: colorMapPointMixin.dataLabelOnNull,
2816
- isValid: colorMapPointMixin.isValid,
2817
- moveToTopOnHover: colorMapPointMixin.moveToTopOnHover
2818
- });
2819
3910
  /* *
2820
3911
  *
2821
3912
  * Default Export
@@ -2824,7 +3915,7 @@
2824
3915
 
2825
3916
  return MapPoint;
2826
3917
  });
2827
- _registerModule(_modules, 'Series/Map/MapSeries.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Globals.js'], _modules['Core/Legend/LegendSymbol.js'], _modules['Core/Chart/MapChart.js'], _modules['Series/Map/MapPoint.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, H, LegendSymbol, MapChart, MapPoint, palette, Series, SeriesRegistry, SVGRenderer, U) {
3918
+ _registerModule(_modules, 'Series/Map/MapSeries.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Series/ColorMapComposition.js'], _modules['Series/CenteredUtilities.js'], _modules['Core/Globals.js'], _modules['Core/Legend/LegendSymbol.js'], _modules['Core/Chart/MapChart.js'], _modules['Series/Map/MapPoint.js'], _modules['Maps/MapView.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (A, ColorMapComposition, CU, H, LegendSymbol, MapChart, MapPoint, MapView, Series, SeriesRegistry, SVGRenderer, U) {
2828
3919
  /* *
2829
3920
  *
2830
3921
  * (c) 2010-2021 Torstein Honsi
@@ -2850,7 +3941,8 @@
2850
3941
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2851
3942
  };
2852
3943
  })();
2853
- var colorMapSeriesMixin = ColorMapMixin.colorMapSeriesMixin;
3944
+ var animObject = A.animObject;
3945
+ var colorMapSeriesMixin = ColorMapComposition.colorMapSeriesMixin;
2854
3946
  var noop = H.noop;
2855
3947
  var maps = MapChart.maps,
2856
3948
  splitPath = MapChart.splitPath;
@@ -2890,12 +3982,6 @@
2890
3982
  * */
2891
3983
  var _this = _super !== null && _super.apply(this,
2892
3984
  arguments) || this;
2893
- /* *
2894
- *
2895
- * Properties
2896
- *
2897
- * */
2898
- _this.baseTrans = void 0;
2899
3985
  _this.chart = void 0;
2900
3986
  _this.data = void 0;
2901
3987
  _this.group = void 0;
@@ -2919,25 +4005,17 @@
2919
4005
  * @private
2920
4006
  */
2921
4007
  MapSeries.prototype.animate = function (init) {
2922
- var chart = this.chart,
2923
- animation = this.options.animation,
2924
- group = this.group,
2925
- xAxis = this.xAxis,
2926
- yAxis = this.yAxis,
2927
- left = xAxis.pos,
2928
- top = yAxis.pos;
4008
+ var _a = this,
4009
+ chart = _a.chart,
4010
+ group = _a.group,
4011
+ animation = animObject(this.options.animation);
2929
4012
  if (chart.renderer.isSVG) {
2930
- if (animation === true) {
2931
- animation = {
2932
- duration: 1000
2933
- };
2934
- }
2935
4013
  // Initialize the animation
2936
4014
  if (init) {
2937
4015
  // Scale down the group and place it in the center
2938
4016
  group.attr({
2939
- translateX: left + xAxis.len / 2,
2940
- translateY: top + yAxis.len / 2,
4017
+ translateX: chart.plotLeft + chart.plotWidth / 2,
4018
+ translateY: chart.plotTop + chart.plotHeight / 2,
2941
4019
  scaleX: 0.001,
2942
4020
  scaleY: 0.001
2943
4021
  });
@@ -2945,8 +4023,8 @@
2945
4023
  }
2946
4024
  else {
2947
4025
  group.animate({
2948
- translateX: left,
2949
- translateY: top,
4026
+ translateX: chart.plotLeft,
4027
+ translateY: chart.plotTop,
2950
4028
  scaleX: 1,
2951
4029
  scaleY: 1
2952
4030
  }, animation);
@@ -2954,36 +4032,35 @@
2954
4032
  }
2955
4033
  };
2956
4034
  /**
2957
- * Animate in the new series from the clicked point in the old series.
2958
- * Depends on the drilldown.js module
4035
+ * Animate in the new series. Depends on the drilldown.js module.
2959
4036
  * @private
2960
4037
  */
2961
4038
  MapSeries.prototype.animateDrilldown = function (init) {
2962
- var toBox = this.chart.plotBox,
2963
- level = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1],
2964
- fromBox = level.bBox,
2965
- animationOptions = this.chart.options.drilldown.animation,
2966
- scale;
2967
- if (!init) {
2968
- scale = Math.min(fromBox.width / toBox.width, fromBox.height / toBox.height);
2969
- level.shapeArgs = {
2970
- scaleX: scale,
2971
- scaleY: scale,
2972
- translateX: fromBox.x,
2973
- translateY: fromBox.y
2974
- };
2975
- this.points.forEach(function (point) {
2976
- if (point.graphic) {
2977
- point.graphic
2978
- .attr(level.shapeArgs)
2979
- .animate({
2980
- scaleX: 1,
2981
- scaleY: 1,
2982
- translateX: 0,
2983
- translateY: 0
2984
- }, animationOptions);
2985
- }
2986
- });
4039
+ var chart = this.chart,
4040
+ group = this.group;
4041
+ if (chart.renderer.isSVG) {
4042
+ // Initialize the animation
4043
+ if (init) {
4044
+ // Scale down the group and place it in the center. This is a
4045
+ // regression from <= v9.2, when it animated from the old point.
4046
+ group.attr({
4047
+ translateX: chart.plotLeft + chart.plotWidth / 2,
4048
+ translateY: chart.plotTop + chart.plotHeight / 2,
4049
+ scaleX: 0.1,
4050
+ scaleY: 0.1,
4051
+ opacity: 0.01
4052
+ });
4053
+ // Run the animation
4054
+ }
4055
+ else {
4056
+ group.animate({
4057
+ translateX: chart.plotLeft,
4058
+ translateY: chart.plotTop,
4059
+ scaleX: 1,
4060
+ scaleY: 1,
4061
+ opacity: 1
4062
+ });
4063
+ }
2987
4064
  }
2988
4065
  };
2989
4066
  /**
@@ -2991,8 +4068,17 @@
2991
4068
  * series and animate them into the origin point in the upper series.
2992
4069
  * @private
2993
4070
  */
2994
- MapSeries.prototype.animateDrillupFrom = function (level) {
2995
- ColumnSeries.prototype.animateDrillupFrom.call(this, level);
4071
+ MapSeries.prototype.animateDrillupFrom = function () {
4072
+ var chart = this.chart;
4073
+ if (chart.renderer.isSVG) {
4074
+ this.group.animate({
4075
+ translateX: chart.plotLeft + chart.plotWidth / 2,
4076
+ translateY: chart.plotTop + chart.plotHeight / 2,
4077
+ scaleX: 0.1,
4078
+ scaleY: 0.1,
4079
+ opacity: 0.01
4080
+ });
4081
+ }
2996
4082
  };
2997
4083
  /**
2998
4084
  * When drilling up, keep the upper series invisible until the lower series
@@ -3002,16 +4088,23 @@
3002
4088
  MapSeries.prototype.animateDrillupTo = function (init) {
3003
4089
  ColumnSeries.prototype.animateDrillupTo.call(this, init);
3004
4090
  };
4091
+ MapSeries.prototype.clearBounds = function () {
4092
+ this.points.forEach(function (point) {
4093
+ delete point.bounds;
4094
+ delete point.projectedPath;
4095
+ });
4096
+ delete this.bounds;
4097
+ };
3005
4098
  /**
3006
4099
  * Allow a quick redraw by just translating the area group. Used for zooming
3007
4100
  * and panning in capable browsers.
3008
4101
  * @private
3009
4102
  */
3010
4103
  MapSeries.prototype.doFullTranslate = function () {
3011
- return (this.isDirtyData ||
4104
+ return Boolean(this.isDirtyData ||
3012
4105
  this.chart.isResizing ||
3013
4106
  this.chart.renderer.isVML ||
3014
- !this.baseTrans);
4107
+ !this.hasRendered);
3015
4108
  };
3016
4109
  /**
3017
4110
  * Draw the data labels. Special for maps is the time that the data labels
@@ -3030,50 +4123,36 @@
3030
4123
  * @private
3031
4124
  */
3032
4125
  MapSeries.prototype.drawPoints = function () {
3033
- var series = this,
3034
- xAxis = series.xAxis,
3035
- yAxis = series.yAxis,
3036
- group = series.group,
3037
- chart = series.chart,
3038
- renderer = chart.renderer,
3039
- scaleX,
3040
- scaleY,
3041
- translateX,
3042
- translateY,
3043
- baseTrans = this.baseTrans,
3044
- transformGroup,
3045
- startTranslateX,
3046
- startTranslateY,
3047
- startScaleX,
3048
- startScaleY;
4126
+ var _this = this;
4127
+ var _a = this,
4128
+ chart = _a.chart,
4129
+ group = _a.group,
4130
+ svgTransform = _a.svgTransform;
4131
+ var mapView = chart.mapView,
4132
+ renderer = chart.renderer;
3049
4133
  // Set a group that handles transform during zooming and panning in
3050
4134
  // order to preserve clipping on series.group
3051
- if (!series.transformGroup) {
3052
- series.transformGroup = renderer.g()
3053
- .attr({
3054
- scaleX: 1,
3055
- scaleY: 1
3056
- })
3057
- .add(group);
3058
- series.transformGroup.survive = true;
4135
+ if (!this.transformGroup) {
4136
+ this.transformGroup = renderer.g().add(group);
4137
+ this.transformGroup.survive = true;
3059
4138
  }
3060
4139
  // Draw the shapes again
3061
- if (series.doFullTranslate()) {
4140
+ if (this.doFullTranslate()) {
3062
4141
  // Individual point actions.
3063
4142
  if (chart.hasRendered && !chart.styledMode) {
3064
- series.points.forEach(function (point) {
4143
+ this.points.forEach(function (point) {
3065
4144
  // Restore state color on update/redraw (#3529)
3066
4145
  if (point.shapeArgs) {
3067
- point.shapeArgs.fill = series.pointAttribs(point, point.state).fill;
4146
+ point.shapeArgs.fill = _this.pointAttribs(point, point.state).fill;
3068
4147
  }
3069
4148
  });
3070
4149
  }
3071
4150
  // Draw them in transformGroup
3072
- series.group = series.transformGroup;
3073
- ColumnSeries.prototype.drawPoints.apply(series);
3074
- series.group = group; // Reset
4151
+ this.group = this.transformGroup;
4152
+ ColumnSeries.prototype.drawPoints.apply(this);
4153
+ this.group = group; // Reset
3075
4154
  // Add class names
3076
- series.points.forEach(function (point) {
4155
+ this.points.forEach(function (point) {
3077
4156
  if (point.graphic) {
3078
4157
  var className = '';
3079
4158
  if (point.name) {
@@ -3092,47 +4171,16 @@
3092
4171
  }
3093
4172
  // In styled mode, apply point colors by CSS
3094
4173
  if (chart.styledMode) {
3095
- point.graphic.css(series.pointAttribs(point, point.selected && 'select' || void 0));
4174
+ point.graphic.css(_this.pointAttribs(point, point.selected && 'select' || void 0));
3096
4175
  }
3097
4176
  }
3098
4177
  });
3099
- // Set the base for later scale-zooming. The originX and originY
3100
- // properties are the axis values in the plot area's upper left
3101
- // corner.
3102
- this.baseTrans = {
3103
- originX: (xAxis.min -
3104
- xAxis.minPixelPadding / xAxis.transA),
3105
- originY: (yAxis.min -
3106
- yAxis.minPixelPadding / yAxis.transA +
3107
- (yAxis.reversed ? 0 : yAxis.len / yAxis.transA)),
3108
- transAX: xAxis.transA,
3109
- transAY: yAxis.transA
3110
- };
3111
- // Reset transformation in case we're doing a full translate
3112
- // (#3789)
3113
- this.transformGroup.animate({
3114
- translateX: 0,
3115
- translateY: 0,
3116
- scaleX: 1,
3117
- scaleY: 1
3118
- });
3119
- // Just update the scale and transform for better performance
3120
4178
  }
3121
- else {
3122
- scaleX = xAxis.transA / baseTrans.transAX;
3123
- scaleY = yAxis.transA / baseTrans.transAY;
3124
- translateX = xAxis.toPixels(baseTrans.originX, true);
3125
- translateY = yAxis.toPixels(baseTrans.originY, true);
3126
- // Handle rounding errors in normal view (#3789)
3127
- if (scaleX > 0.99 &&
3128
- scaleX < 1.01 &&
3129
- scaleY > 0.99 &&
3130
- scaleY < 1.01) {
3131
- scaleX = 1;
3132
- scaleY = 1;
3133
- translateX = Math.round(translateX);
3134
- translateY = Math.round(translateY);
3135
- }
4179
+ // Apply the SVG transform
4180
+ if (mapView && svgTransform) {
4181
+ var strokeWidth_1 = pick(this.options[(this.pointAttrToOptions &&
4182
+ this.pointAttrToOptions['stroke-width']) || 'borderWidth'], 1 // Styled mode
4183
+ );
3136
4184
  /* Animate or move to the new zoom level. In order to prevent
3137
4185
  flickering as the different transform components are set out
3138
4186
  of sync (#5991), we run a fake animator attribute and set
@@ -3144,151 +4192,113 @@
3144
4192
  step for each property is performed in the same step. Also,
3145
4193
  for symbols and for transform properties, it should induce a
3146
4194
  single updateTransform and symbolAttr call. */
3147
- transformGroup = this.transformGroup;
3148
- if (chart.renderer.globalAnimation) {
3149
- startTranslateX = transformGroup.attr('translateX');
3150
- startTranslateY = transformGroup.attr('translateY');
3151
- startScaleX = transformGroup.attr('scaleX');
3152
- startScaleY = transformGroup.attr('scaleY');
3153
- transformGroup
4195
+ var scale_1 = svgTransform.scaleX;
4196
+ var flipFactor_1 = svgTransform.scaleY > 0 ? 1 : -1;
4197
+ var transformGroup_1 = this.transformGroup;
4198
+ if (renderer.globalAnimation && chart.hasRendered) {
4199
+ var startTranslateX_1 = Number(transformGroup_1.attr('translateX'));
4200
+ var startTranslateY_1 = Number(transformGroup_1.attr('translateY'));
4201
+ var startScale_1 = Number(transformGroup_1.attr('scaleX'));
4202
+ var step = function (now,
4203
+ fx) {
4204
+ var scaleStep = startScale_1 +
4205
+ (scale_1 - startScale_1) * fx.pos;
4206
+ transformGroup_1.attr({
4207
+ translateX: (startTranslateX_1 +
4208
+ (svgTransform.translateX - startTranslateX_1) * fx.pos),
4209
+ translateY: (startTranslateY_1 +
4210
+ (svgTransform.translateY - startTranslateY_1) * fx.pos),
4211
+ scaleX: scaleStep,
4212
+ scaleY: scaleStep * flipFactor_1
4213
+ });
4214
+ group.element.setAttribute('stroke-width', strokeWidth_1 / scaleStep);
4215
+ };
4216
+ transformGroup_1
3154
4217
  .attr({ animator: 0 })
3155
- .animate({
3156
- animator: 1
3157
- }, {
3158
- step: function (now, fx) {
3159
- transformGroup.attr({
3160
- translateX: (startTranslateX +
3161
- (translateX - startTranslateX) * fx.pos),
3162
- translateY: (startTranslateY +
3163
- (translateY - startTranslateY) * fx.pos),
3164
- scaleX: (startScaleX +
3165
- (scaleX - startScaleX) *
3166
- fx.pos),
3167
- scaleY: (startScaleY +
3168
- (scaleY - startScaleY) * fx.pos)
3169
- });
3170
- }
3171
- });
3172
- // When dragging, animation is off.
4218
+ .animate({ animator: 1 }, { step: step });
4219
+ // When dragging or first rendering, animation is off
3173
4220
  }
3174
4221
  else {
3175
- transformGroup.attr({
3176
- translateX: translateX,
3177
- translateY: translateY,
3178
- scaleX: scaleX,
3179
- scaleY: scaleY
3180
- });
4222
+ transformGroup_1.attr(svgTransform);
4223
+ // Set the stroke-width directly on the group element so the
4224
+ // children inherit it. We need to use setAttribute directly,
4225
+ // because the stroke-widthSetter method expects a stroke color
4226
+ // also to be set.
4227
+ group.element.setAttribute('stroke-width', strokeWidth_1 / scale_1);
3181
4228
  }
3182
4229
  }
3183
- /* Set the stroke-width directly on the group element so the
3184
- children inherit it. We need to use setAttribute directly,
3185
- because the stroke-widthSetter method expects a stroke color also
3186
- to be set. */
3187
- if (!chart.styledMode) {
3188
- group.element.setAttribute('stroke-width', (pick(series.options[(series.pointAttrToOptions &&
3189
- series.pointAttrToOptions['stroke-width']) || 'borderWidth'], 1 // Styled mode
3190
- ) / (scaleX || 1)));
3191
- }
3192
4230
  this.drawMapDataLabels();
3193
4231
  };
3194
4232
  /**
3195
4233
  * Get the bounding box of all paths in the map combined.
3196
- * @private
4234
+ *
3197
4235
  */
3198
- MapSeries.prototype.getBox = function (paths) {
3199
- var MAX_VALUE = Number.MAX_VALUE,
3200
- maxX = -MAX_VALUE,
3201
- minX = MAX_VALUE,
3202
- maxY = -MAX_VALUE,
3203
- minY = MAX_VALUE,
3204
- minRange = MAX_VALUE,
3205
- xAxis = this.xAxis,
3206
- yAxis = this.yAxis,
3207
- hasBox;
3208
- // Find the bounding box
3209
- (paths || []).forEach(function (point) {
3210
- if (point.path) {
3211
- if (typeof point.path === 'string') {
3212
- point.path = splitPath(point.path);
3213
- // Legacy one-dimensional array
3214
- }
3215
- else if (point.path[0] === 'M') {
3216
- point.path = SVGRenderer.prototype.pathToSegments(point.path);
3217
- }
3218
- var path = point.path || [],
3219
- pointMaxX_1 = -MAX_VALUE,
3220
- pointMinX_1 = MAX_VALUE,
3221
- pointMaxY_1 = -MAX_VALUE,
3222
- pointMinY_1 = MAX_VALUE,
3223
- properties = point.properties;
3224
- // The first time a map point is used, analyze its box
3225
- if (!point._foundBox) {
3226
- path.forEach(function (seg) {
3227
- var x = seg[seg.length - 2];
3228
- var y = seg[seg.length - 1];
3229
- if (typeof x === 'number' && typeof y === 'number') {
3230
- pointMinX_1 = Math.min(pointMinX_1, x);
3231
- pointMaxX_1 = Math.max(pointMaxX_1, x);
3232
- pointMinY_1 = Math.min(pointMinY_1, y);
3233
- pointMaxY_1 = Math.max(pointMaxY_1, y);
4236
+ MapSeries.prototype.getProjectedBounds = function () {
4237
+ if (!this.bounds) {
4238
+ var MAX_VALUE_1 = Number.MAX_VALUE,
4239
+ projection_1 = this.chart.mapView &&
4240
+ this.chart.mapView.projection,
4241
+ allBounds_1 = [];
4242
+ // Find the bounding box of each point
4243
+ (this.points || []).forEach(function (point) {
4244
+ if (point.path || point.geometry) {
4245
+ // @todo Try to puth these two conversions in
4246
+ // MapPoint.applyOptions
4247
+ if (typeof point.path === 'string') {
4248
+ point.path = splitPath(point.path);
4249
+ // Legacy one-dimensional array
4250
+ }
4251
+ else if (isArray(point.path) &&
4252
+ point.path[0] === 'M') {
4253
+ point.path = SVGRenderer.prototype.pathToSegments(point.path);
4254
+ }
4255
+ // The first time a map point is used, analyze its box
4256
+ if (!point.bounds) {
4257
+ var path = MapPoint.getProjectedPath(point,
4258
+ projection_1),
4259
+ properties = point.properties;
4260
+ var x2_1 = -MAX_VALUE_1,
4261
+ x1_1 = MAX_VALUE_1,
4262
+ y2_1 = -MAX_VALUE_1,
4263
+ y1_1 = MAX_VALUE_1,
4264
+ validBounds_1;
4265
+ path.forEach(function (seg) {
4266
+ var x = seg[seg.length - 2];
4267
+ var y = seg[seg.length - 1];
4268
+ if (typeof x === 'number' &&
4269
+ typeof y === 'number') {
4270
+ x1_1 = Math.min(x1_1, x);
4271
+ x2_1 = Math.max(x2_1, x);
4272
+ y1_1 = Math.min(y1_1, y);
4273
+ y2_1 = Math.max(y2_1, y);
4274
+ validBounds_1 = true;
4275
+ }
4276
+ });
4277
+ if (validBounds_1) {
4278
+ // Cache point bounding box for use to position data
4279
+ // labels, bubbles etc
4280
+ var propMiddleX = properties && properties['hc-middle-x'], midX = (x1_1 + (x2_1 - x1_1) * pick(point.middleX, isNumber(propMiddleX) ? propMiddleX : 0.5)), propMiddleY = properties && properties['hc-middle-y'];
4281
+ var middleYFraction = pick(point.middleY,
4282
+ isNumber(propMiddleY) ? propMiddleY : 0.5);
4283
+ // No geographic geometry, only path given => flip
4284
+ if (!point.geometry) {
4285
+ middleYFraction = 1 - middleYFraction;
4286
+ }
4287
+ var midY = y2_1 - (y2_1 - y1_1) * middleYFraction;
4288
+ point.bounds = { midX: midX, midY: midY, x1: x1_1, y1: y1_1, x2: x2_1, y2: y2_1 };
4289
+ point.labelrank = pick(point.labelrank,
4290
+ // Bigger shape, higher rank
4291
+ (x2_1 - x1_1) * (y2_1 - y1_1));
3234
4292
  }
3235
- });
3236
- // Cache point bounding box for use to position data
3237
- // labels, bubbles etc
3238
- point._midX = (pointMinX_1 + (pointMaxX_1 - pointMinX_1) * pick(point.middleX, properties &&
3239
- properties['hc-middle-x'], 0.5));
3240
- point._midY = (pointMinY_1 + (pointMaxY_1 - pointMinY_1) * pick(point.middleY, properties &&
3241
- properties['hc-middle-y'], 0.5));
3242
- point._maxX = pointMaxX_1;
3243
- point._minX = pointMinX_1;
3244
- point._maxY = pointMaxY_1;
3245
- point._minY = pointMinY_1;
3246
- point.labelrank = pick(point.labelrank, (pointMaxX_1 - pointMinX_1) * (pointMaxY_1 - pointMinY_1));
3247
- point._foundBox = true;
4293
+ }
4294
+ if (point.bounds) {
4295
+ allBounds_1.push(point.bounds);
4296
+ }
3248
4297
  }
3249
- maxX = Math.max(maxX, point._maxX);
3250
- minX = Math.min(minX, point._minX);
3251
- maxY = Math.max(maxY, point._maxY);
3252
- minY = Math.min(minY, point._minY);
3253
- minRange = Math.min(point._maxX - point._minX, point._maxY - point._minY, minRange);
3254
- hasBox = true;
3255
- }
3256
- });
3257
- // Set the box for the whole series
3258
- if (hasBox) {
3259
- this.minY = Math.min(minY, pick(this.minY, MAX_VALUE));
3260
- this.maxY = Math.max(maxY, pick(this.maxY, -MAX_VALUE));
3261
- this.minX = Math.min(minX, pick(this.minX, MAX_VALUE));
3262
- this.maxX = Math.max(maxX, pick(this.maxX, -MAX_VALUE));
3263
- // If no minRange option is set, set the default minimum zooming
3264
- // range to 5 times the size of the smallest element
3265
- if (xAxis && typeof xAxis.options.minRange === 'undefined') {
3266
- xAxis.minRange = Math.min(5 * minRange, (this.maxX - this.minX) / 5, xAxis.minRange || MAX_VALUE);
3267
- }
3268
- if (yAxis && typeof yAxis.options.minRange === 'undefined') {
3269
- yAxis.minRange = Math.min(5 * minRange, (this.maxY - this.minY) / 5, yAxis.minRange || MAX_VALUE);
3270
- }
3271
- }
3272
- };
3273
- MapSeries.prototype.getExtremes = function () {
3274
- // Get the actual value extremes for colors
3275
- var _a = Series.prototype.getExtremes
3276
- .call(this,
3277
- this.valueData),
3278
- dataMin = _a.dataMin,
3279
- dataMax = _a.dataMax;
3280
- // Recalculate box on updated data
3281
- if (this.chart.hasRendered && this.isDirtyData) {
3282
- this.getBox(this.options.data);
3283
- }
3284
- if (isNumber(dataMin)) {
3285
- this.valueMin = dataMin;
3286
- }
3287
- if (isNumber(dataMax)) {
3288
- this.valueMax = dataMax;
4298
+ });
4299
+ this.bounds = MapView.compositeBounds(allBounds_1);
3289
4300
  }
3290
- // Extremes for the mock Y axis
3291
- return { dataMin: this.minY, dataMax: this.maxY };
4301
+ return this.bounds;
3292
4302
  };
3293
4303
  /**
3294
4304
  * Define hasData function for non-cartesian series. Returns true if the
@@ -3305,35 +4315,31 @@
3305
4315
  * @private
3306
4316
  */
3307
4317
  MapSeries.prototype.pointAttribs = function (point, state) {
3308
- var attr = point.series.chart.styledMode ?
4318
+ var _a = point.series.chart,
4319
+ mapView = _a.mapView,
4320
+ styledMode = _a.styledMode;
4321
+ var attr = styledMode ?
3309
4322
  this.colorAttribs(point) :
3310
4323
  ColumnSeries.prototype.pointAttribs.call(this,
3311
4324
  point,
3312
4325
  state);
3313
- // Set the stroke-width on the group element and let all point
3314
- // graphics inherit. That way we don't have to iterate over all
3315
- // points to update the stroke-width on zooming.
3316
- attr['stroke-width'] = pick(point.options[(this.pointAttrToOptions &&
3317
- this.pointAttrToOptions['stroke-width']) || 'borderWidth'], 'inherit');
3318
- return attr;
3319
- };
3320
- /**
3321
- * Override render to throw in an async call in IE8. Otherwise it chokes on
3322
- * the US counties demo.
3323
- * @private
3324
- */
3325
- MapSeries.prototype.render = function () {
3326
- var series = this,
3327
- render = Series.prototype.render;
3328
- // Give IE8 some time to breathe.
3329
- if (series.chart.renderer.isVML && series.data.length > 3000) {
3330
- setTimeout(function () {
3331
- render.call(series);
3332
- });
4326
+ // Individual stroke width
4327
+ var pointStrokeWidth = point.options[(this.pointAttrToOptions &&
4328
+ this.pointAttrToOptions['stroke-width']) || 'borderWidth'];
4329
+ if (pointStrokeWidth && mapView) {
4330
+ pointStrokeWidth /= mapView.getScale();
3333
4331
  }
3334
- else {
3335
- render.call(series);
4332
+ // In order for dash style to avoid being scaled, set the transformed
4333
+ // stroke width on the item
4334
+ if (attr.dashstyle && mapView && this.options.borderWidth) {
4335
+ pointStrokeWidth = this.options.borderWidth / mapView.getScale();
3336
4336
  }
4337
+ attr['stroke-width'] = pick(pointStrokeWidth,
4338
+ // By default set the stroke-width on the group element and let all
4339
+ // point graphics inherit. That way we don't have to iterate over
4340
+ // all points to update the stroke-width on zooming.
4341
+ 'inherit');
4342
+ return attr;
3337
4343
  };
3338
4344
  /**
3339
4345
  * Extend setData to join in mapData. If the allAreas option is true, all
@@ -3400,7 +4406,7 @@
3400
4406
  }
3401
4407
  });
3402
4408
  }
3403
- this.getBox(data);
4409
+ // this.getBox(data as any);
3404
4410
  // Pick up transform definitions for chart
3405
4411
  this.chart.mapTransforms = mapTransforms =
3406
4412
  chartOptions.mapTransforms ||
@@ -3445,7 +4451,7 @@
3445
4451
  });
3446
4452
  }
3447
4453
  if (options.allAreas) {
3448
- this.getBox(mapData);
4454
+ // this.getBox(mapData);
3449
4455
  data = data || [];
3450
4456
  // Registered the point codes that actually hold data
3451
4457
  if (joinBy[1]) {
@@ -3469,12 +4475,13 @@
3469
4475
  updatePoints = false;
3470
4476
  }
3471
4477
  });
3472
- }
3473
- else {
4478
+ } /* else {
3474
4479
  this.getBox(dataUsed); // Issue #4784
3475
- }
4480
+ } */
3476
4481
  }
3477
4482
  Series.prototype.setData.call(this, data, redraw, animation, updatePoints);
4483
+ this.processData();
4484
+ this.generatePoints();
3478
4485
  };
3479
4486
  /**
3480
4487
  * Extend setOptions by picking up the joinBy option and applying it to a
@@ -3502,85 +4509,56 @@
3502
4509
  */
3503
4510
  MapSeries.prototype.translate = function () {
3504
4511
  var series = this,
3505
- xAxis = series.xAxis,
3506
- yAxis = series.yAxis,
3507
- doFullTranslate = series.doFullTranslate();
3508
- series.generatePoints();
3509
- series.data.forEach(function (point) {
4512
+ doFullTranslate = series.doFullTranslate(),
4513
+ mapView = this.chart.mapView,
4514
+ projection = mapView && mapView.projection;
4515
+ // Recalculate box on updated data
4516
+ if (this.chart.hasRendered && (this.isDirtyData || !this.hasRendered)) {
4517
+ this.processData();
4518
+ this.generatePoints();
4519
+ delete this.bounds;
4520
+ this.getProjectedBounds();
4521
+ }
4522
+ // Calculate the SVG transform
4523
+ var svgTransform;
4524
+ if (mapView) {
4525
+ var scale = mapView.getScale();
4526
+ var _a = mapView.projection.forward(mapView.center),
4527
+ x = _a[0],
4528
+ y = _a[1];
4529
+ // When dealing with unprojected coordinates, y axis is flipped.
4530
+ var flipFactor = mapView.projection.hasCoordinates ? -1 : 1;
4531
+ var translateX = this.chart.plotWidth / 2 - x * scale;
4532
+ var translateY = this.chart.plotHeight / 2 - y * scale * flipFactor;
4533
+ svgTransform = {
4534
+ scaleX: scale,
4535
+ scaleY: scale * flipFactor,
4536
+ translateX: translateX,
4537
+ translateY: translateY
4538
+ };
4539
+ this.svgTransform = svgTransform;
4540
+ }
4541
+ series.points.forEach(function (point) {
3510
4542
  // Record the middle point (loosely based on centroid),
3511
4543
  // determined by the middleX and middleY options.
3512
- if (isNumber(point._midX) && isNumber(point._midY)) {
3513
- point.plotX = xAxis.toPixels(point._midX, true);
3514
- point.plotY = yAxis.toPixels(point._midY, true);
4544
+ if (svgTransform &&
4545
+ point.bounds &&
4546
+ isNumber(point.bounds.midX) &&
4547
+ isNumber(point.bounds.midY)) {
4548
+ point.plotX = point.bounds.midX * svgTransform.scaleX +
4549
+ svgTransform.translateX;
4550
+ point.plotY = point.bounds.midY * svgTransform.scaleY +
4551
+ svgTransform.translateY;
3515
4552
  }
3516
4553
  if (doFullTranslate) {
3517
4554
  point.shapeType = 'path';
3518
4555
  point.shapeArgs = {
3519
- d: series.translatePath(point.path)
4556
+ d: MapPoint.getProjectedPath(point, projection)
3520
4557
  };
3521
4558
  }
3522
4559
  });
3523
4560
  fireEvent(series, 'afterTranslate');
3524
4561
  };
3525
- /**
3526
- * Translate the path, so it automatically fits into the plot area box.
3527
- * @private
3528
- */
3529
- MapSeries.prototype.translatePath = function (path) {
3530
- var series = this,
3531
- xAxis = series.xAxis,
3532
- yAxis = series.yAxis,
3533
- xMin = xAxis.min,
3534
- xTransA = xAxis.transA,
3535
- xMinPixelPadding = xAxis.minPixelPadding,
3536
- yMin = yAxis.min,
3537
- yTransA = yAxis.transA,
3538
- yMinPixelPadding = yAxis.minPixelPadding,
3539
- ret = []; // Preserve the original
3540
- // Do the translation
3541
- if (path) {
3542
- path.forEach(function (seg) {
3543
- if (seg[0] === 'M') {
3544
- ret.push([
3545
- 'M',
3546
- (seg[1] - (xMin || 0)) * xTransA + xMinPixelPadding,
3547
- (seg[2] - (yMin || 0)) * yTransA + yMinPixelPadding
3548
- ]);
3549
- }
3550
- else if (seg[0] === 'L') {
3551
- ret.push([
3552
- 'L',
3553
- (seg[1] - (xMin || 0)) * xTransA + xMinPixelPadding,
3554
- (seg[2] - (yMin || 0)) * yTransA + yMinPixelPadding
3555
- ]);
3556
- }
3557
- else if (seg[0] === 'C') {
3558
- ret.push([
3559
- 'C',
3560
- (seg[1] - (xMin || 0)) * xTransA + xMinPixelPadding,
3561
- (seg[2] - (yMin || 0)) * yTransA + yMinPixelPadding,
3562
- (seg[3] - (xMin || 0)) * xTransA + xMinPixelPadding,
3563
- (seg[4] - (yMin || 0)) * yTransA + yMinPixelPadding,
3564
- (seg[5] - (xMin || 0)) * xTransA + xMinPixelPadding,
3565
- (seg[6] - (yMin || 0)) * yTransA + yMinPixelPadding
3566
- ]);
3567
- }
3568
- else if (seg[0] === 'Q') {
3569
- ret.push([
3570
- 'Q',
3571
- (seg[1] - (xMin || 0)) * xTransA + xMinPixelPadding,
3572
- (seg[2] - (yMin || 0)) * yTransA + yMinPixelPadding,
3573
- (seg[3] - (xMin || 0)) * xTransA + xMinPixelPadding,
3574
- (seg[4] - (yMin || 0)) * yTransA + yMinPixelPadding
3575
- ]);
3576
- }
3577
- else if (seg[0] === 'Z') {
3578
- ret.push(['Z']);
3579
- }
3580
- });
3581
- }
3582
- return ret;
3583
- };
3584
4562
  /**
3585
4563
  * The map series is used for basic choropleth maps, where each map area has
3586
4564
  * a color based on its value.
@@ -3626,7 +4604,7 @@
3626
4604
  *
3627
4605
  * @private
3628
4606
  */
3629
- nullColor: palette.neutralColor3,
4607
+ nullColor: "#f7f7f7" /* neutralColor3 */,
3630
4608
  /**
3631
4609
  * Whether to allow pointer interaction like tooltips and mouse events
3632
4610
  * on null points.
@@ -3680,7 +4658,7 @@
3680
4658
  *
3681
4659
  * @private
3682
4660
  */
3683
- borderColor: palette.neutralColor20,
4661
+ borderColor: "#cccccc" /* neutralColor20 */,
3684
4662
  /**
3685
4663
  * The border width of each map area.
3686
4664
  *
@@ -3811,11 +4789,11 @@
3811
4789
  select: {
3812
4790
  /**
3813
4791
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
3814
- * @default ${palette.neutralColor20}
4792
+ * @default #cccccc
3815
4793
  * @product highmaps
3816
4794
  * @apioption plotOptions.series.states.select.color
3817
4795
  */
3818
- color: palette.neutralColor20
4796
+ color: "#cccccc" /* neutralColor20 */
3819
4797
  },
3820
4798
  inactive: {
3821
4799
  opacity: 1
@@ -3826,9 +4804,8 @@
3826
4804
  }(ScatterSeries));
3827
4805
  extend(MapSeries.prototype, {
3828
4806
  type: 'map',
3829
- axisTypes: colorMapSeriesMixin.axisTypes,
3830
- colorAttribs: colorMapSeriesMixin.colorAttribs,
3831
- colorKey: colorMapSeriesMixin.colorKey,
4807
+ axisTypes: ['colorAxis'],
4808
+ colorKey: 'value',
3832
4809
  // When tooltip is not shared, this series (and derivatives) requires
3833
4810
  // direct touch/hover. KD-tree does not apply.
3834
4811
  directTouch: true,
@@ -3839,8 +4816,10 @@
3839
4816
  drawGraph: noop,
3840
4817
  drawLegendSymbol: LegendSymbol.drawRectangle,
3841
4818
  forceDL: true,
4819
+ getCenter: CU.getCenter,
3842
4820
  getExtremesFromAll: true,
3843
- getSymbol: colorMapSeriesMixin.getSymbol,
4821
+ getSymbol: noop,
4822
+ isCartesian: false,
3844
4823
  parallelArrays: colorMapSeriesMixin.parallelArrays,
3845
4824
  pointArrayMap: colorMapSeriesMixin.pointArrayMap,
3846
4825
  pointClass: MapPoint,
@@ -3851,6 +4830,7 @@
3851
4830
  // Get axis extremes from paths, not values
3852
4831
  useMapGeometry: true
3853
4832
  });
4833
+ ColorMapComposition.compose(MapSeries, MapPoint);
3854
4834
  SeriesRegistry.registerSeriesType('map', MapSeries);
3855
4835
  /* *
3856
4836
  *
@@ -3863,8 +4843,8 @@
3863
4843
  *
3864
4844
  * */
3865
4845
  /**
3866
- * A map data object containing a `path` definition and optionally additional
3867
- * properties to join in the data as per the `joinBy` option.
4846
+ * A map data object containing a `geometry` or `path` definition and optionally
4847
+ * additional properties to join in the `data` as per the `joinBy` option.
3868
4848
  *
3869
4849
  * @sample maps/demo/category-map/
3870
4850
  * Map data and joinBy
@@ -3955,6 +4935,45 @@
3955
4935
  * @product highmaps
3956
4936
  * @apioption series.map.data.drilldown
3957
4937
  */
4938
+ /**
4939
+ * For map and mapline series types, the geometry of a point.
4940
+ *
4941
+ * To achieve a better separation between the structure and the data,
4942
+ * it is recommended to use `mapData` to define the geometry instead
4943
+ * of defining it on the data points themselves.
4944
+ *
4945
+ * The geometry object is compatible to that of a `feature` in geoJSON, so
4946
+ * features of geoJSON can be passed directly into the `data`, optionally
4947
+ * after first filtering and processing it.
4948
+ *
4949
+ * @sample maps/series/data-geometry/
4950
+ * Geometry defined in data
4951
+ *
4952
+ * @type {Object}
4953
+ * @since 9.3.0
4954
+ * @product highmaps
4955
+ * @apioption series.map.data.geometry
4956
+ */
4957
+ /**
4958
+ * The geometry type. Can be one of `LineString`, `Polygon`, `MultiLineString`
4959
+ * or `MultiPolygon`.
4960
+ *
4961
+ * @type {string}
4962
+ * @since 9.3.0
4963
+ * @product highmaps
4964
+ * @validvalue ["LineString", "Polygon", "MultiLineString", "MultiPolygon"]
4965
+ * @apioption series.map.data.geometry.type
4966
+ */
4967
+ /**
4968
+ * The geometry coordinates in terms of arrays of `[longitude, latitude]`, or
4969
+ * a two dimensional array of the same. The dimensionality must comply with the
4970
+ * `type`.
4971
+ *
4972
+ * @type {Array<LonLatArray>|Array<Array<LonLatArray>>}
4973
+ * @since 9.3.0
4974
+ * @product highmaps
4975
+ * @apioption series.map.data.geometry.coordinates
4976
+ */
3958
4977
  /**
3959
4978
  * An id for the point. This can be used after render time to get a
3960
4979
  * pointer to the point object through `chart.get()`.
@@ -4016,6 +5035,9 @@
4016
5035
  * it is recommended to use `mapData` to define that paths instead
4017
5036
  * of defining them on the data points themselves.
4018
5037
  *
5038
+ * For providing true geographical shapes based on longitude and latitude, use
5039
+ * the `geometry` option instead.
5040
+ *
4019
5041
  * @sample maps/series/data-path/
4020
5042
  * Paths defined in data
4021
5043
  *
@@ -4223,6 +5245,8 @@
4223
5245
  * ```
4224
5246
  *
4225
5247
  * @type {Array<number|Array<string,(number|null)>|null|*>}
5248
+ * @extends series.map.data
5249
+ * @excluding drilldown
4226
5250
  * @product highmaps
4227
5251
  * @apioption series.mapline.data
4228
5252
  */
@@ -4257,7 +5281,8 @@
4257
5281
  };
4258
5282
  })();
4259
5283
  var ScatterSeries = SeriesRegistry.seriesTypes.scatter;
4260
- var merge = U.merge;
5284
+ var isNumber = U.isNumber,
5285
+ merge = U.merge;
4261
5286
  /* *
4262
5287
  *
4263
5288
  * Class
@@ -4292,6 +5317,10 @@
4292
5317
  options);
4293
5318
  return _super.prototype.applyOptions.call(this, mergedOptions, x);
4294
5319
  };
5320
+ MapPointPoint.prototype.isValid = function () {
5321
+ return Boolean(this.options.geometry ||
5322
+ (isNumber(this.x) && isNumber(this.y)));
5323
+ };
4295
5324
  return MapPointPoint;
4296
5325
  }(ScatterSeries.prototype.pointClass));
4297
5326
  /* *
@@ -4302,7 +5331,7 @@
4302
5331
 
4303
5332
  return MapPointPoint;
4304
5333
  });
4305
- _registerModule(_modules, 'Series/MapPoint/MapPointSeries.js', [_modules['Series/MapPoint/MapPointPoint.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (MapPointPoint, palette, SeriesRegistry, U) {
5334
+ _registerModule(_modules, 'Series/MapPoint/MapPointSeries.js', [_modules['Core/Globals.js'], _modules['Series/MapPoint/MapPointPoint.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (H, MapPointPoint, SeriesRegistry, U) {
4306
5335
  /* *
4307
5336
  *
4308
5337
  * (c) 2010-2021 Torstein Honsi
@@ -4328,8 +5357,11 @@
4328
5357
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4329
5358
  };
4330
5359
  })();
5360
+ var noop = H.noop;
4331
5361
  var ScatterSeries = SeriesRegistry.seriesTypes.scatter;
4332
5362
  var extend = U.extend,
5363
+ fireEvent = U.fireEvent,
5364
+ isNumber = U.isNumber,
4333
5365
  merge = U.merge;
4334
5366
  /* *
4335
5367
  *
@@ -4376,6 +5408,56 @@
4376
5408
  this.dataLabelsGroup.clip(this.chart.clipRect);
4377
5409
  }
4378
5410
  };
5411
+ MapPointSeries.prototype.translate = function () {
5412
+ var _this = this;
5413
+ var mapView = this.chart.mapView;
5414
+ if (!this.processedXData) {
5415
+ this.processData();
5416
+ }
5417
+ this.generatePoints();
5418
+ // Create map based translation
5419
+ if (mapView) {
5420
+ var _a = mapView.projection,
5421
+ forward_1 = _a.forward,
5422
+ hasCoordinates_1 = _a.hasCoordinates;
5423
+ this.points.forEach(function (p) {
5424
+ var _a = p.x,
5425
+ x = _a === void 0 ? void 0 : _a,
5426
+ _b = p.y,
5427
+ y = _b === void 0 ? void 0 : _b;
5428
+ var geometry = p.options.geometry,
5429
+ coordinates = (geometry &&
5430
+ geometry.type === 'Point' &&
5431
+ geometry.coordinates);
5432
+ if (coordinates) {
5433
+ var xy = forward_1(coordinates);
5434
+ x = xy[0];
5435
+ y = xy[1];
5436
+ // Map bubbles getting geometry from shape
5437
+ }
5438
+ else if (p.bounds) {
5439
+ x = p.bounds.midX;
5440
+ y = p.bounds.midY;
5441
+ }
5442
+ if (isNumber(x) && isNumber(y)) {
5443
+ var plotCoords = mapView.projectedUnitsToPixels({ x: x,
5444
+ y: y });
5445
+ p.plotX = plotCoords.x;
5446
+ p.plotY = hasCoordinates_1 ?
5447
+ plotCoords.y :
5448
+ _this.chart.plotHeight - plotCoords.y;
5449
+ }
5450
+ else {
5451
+ p.plotX = void 0;
5452
+ p.plotY = void 0;
5453
+ }
5454
+ p.isInside = _this.isPointInside(p);
5455
+ // Find point zone
5456
+ p.zone = _this.zones.length ? p.getZone() : void 0;
5457
+ });
5458
+ }
5459
+ fireEvent(this, 'afterTranslate');
5460
+ };
4379
5461
  /**
4380
5462
  * A mappoint series is a special form of scatter series where the points
4381
5463
  * can be laid out in map coordinates on top of a map.
@@ -4398,7 +5480,7 @@
4398
5480
  overflow: false,
4399
5481
  style: {
4400
5482
  /** @internal */
4401
- color: palette.neutralColor100
5483
+ color: "#000000" /* neutralColor100 */
4402
5484
  }
4403
5485
  }
4404
5486
  });
@@ -4406,8 +5488,12 @@
4406
5488
  }(ScatterSeries));
4407
5489
  extend(MapPointSeries.prototype, {
4408
5490
  type: 'mappoint',
5491
+ axisTypes: ['colorAxis'],
4409
5492
  forceDL: true,
4410
- pointClass: MapPointPoint
5493
+ isCartesian: false,
5494
+ pointClass: MapPointPoint,
5495
+ searchPoint: noop,
5496
+ useMapGeometry: true // #16534
4411
5497
  });
4412
5498
  SeriesRegistry.registerSeriesType('mappoint', MapPointSeries);
4413
5499
  /* *
@@ -4443,16 +5529,17 @@
4443
5529
  * data: [0, 5, 3, 5]
4444
5530
  * ```
4445
5531
  *
4446
- * 2. An array of arrays with 2 values. In this case, the values correspond to
4447
- * `x,y`. If the first value is a string, it is applied as the name of the
4448
- * point, and the `x` value is inferred.
4449
- * ```js
4450
- * data: [
4451
- * [0, 1],
4452
- * [1, 8],
4453
- * [2, 7]
4454
- * ]
4455
- * ```
5532
+ * 2. An array of arrays with 2 values. In this case, the values correspond
5533
+ * to `[hc-key, value]`. Example:
5534
+ *
5535
+ * ```js
5536
+ * data: [
5537
+ * ['us-ny', 0],
5538
+ * ['us-mi', 5],
5539
+ * ['us-tx', 3],
5540
+ * ['us-ak', 5]
5541
+ * ]
5542
+ * ```
4456
5543
  *
4457
5544
  * 3. An array of objects with named values. The following snippet shows only a
4458
5545
  * few settings, see the complete options set below. If the total number of
@@ -4479,6 +5566,42 @@
4479
5566
  * @product highmaps
4480
5567
  * @apioption series.mappoint.data
4481
5568
  */
5569
+ /**
5570
+ * The geometry of a point.
5571
+ *
5572
+ * To achieve a better separation between the structure and the data,
5573
+ * it is recommended to use `mapData` to define the geometry instead
5574
+ * of defining it on the data points themselves.
5575
+ *
5576
+ * The geometry object is compatible to that of a `feature` in geoJSON, so
5577
+ * features of geoJSON can be passed directly into the `data`, optionally
5578
+ * after first filtering and processing it.
5579
+ *
5580
+ * @sample maps/series/data-geometry/
5581
+ * geometry defined in data
5582
+ *
5583
+ * @type {Object}
5584
+ * @since 9.3.0
5585
+ * @product highmaps
5586
+ * @apioption series.mappoint.data.geometry
5587
+ */
5588
+ /**
5589
+ * The geometry type, which in case of the `mappoint` series is always `Point`.
5590
+ *
5591
+ * @type {string}
5592
+ * @since 9.3.0
5593
+ * @product highmaps
5594
+ * @validvalue ["Point"]
5595
+ * @apioption series.mappoint.data.geometry.type
5596
+ */
5597
+ /**
5598
+ * The geometry coordinates in terms of `[longitude, latitude]`.
5599
+ *
5600
+ * @type {Highcharts.LonLatArray}
5601
+ * @since 9.3.0
5602
+ * @product highmaps
5603
+ * @apioption series.mappoint.data.geometry.coordinates
5604
+ */
4482
5605
  /**
4483
5606
  * The latitude of the point. Must be combined with the `lon` option
4484
5607
  * to work. Overrides `x` and `y` values.
@@ -4527,7 +5650,7 @@
4527
5650
 
4528
5651
  return MapPointSeries;
4529
5652
  });
4530
- _registerModule(_modules, 'Series/Bubble/BubbleLegendDefaults.js', [_modules['Core/Color/Palette.js']], function (Palette) {
5653
+ _registerModule(_modules, 'Series/Bubble/BubbleLegendDefaults.js', [], function () {
4531
5654
  /* *
4532
5655
  *
4533
5656
  * (c) 2010-2021 Highsoft AS
@@ -4700,7 +5823,7 @@
4700
5823
  /** @ignore-option */
4701
5824
  fontSize: '10px',
4702
5825
  /** @ignore-option */
4703
- color: Palette.neutralColor100
5826
+ color: "#000000" /* neutralColor100 */
4704
5827
  },
4705
5828
  /**
4706
5829
  * The x position offset of the label relative to the
@@ -5286,8 +6409,9 @@
5286
6409
  plotSizeX = chart.plotSizeX,
5287
6410
  plotSizeY = chart.plotSizeY,
5288
6411
  bubbleSeries = chart.series[this.options.seriesIndex],
5289
- minSize = Math.ceil(bubbleSeries.minPxSize),
5290
- maxPxSize = Math.ceil(bubbleSeries.maxPxSize),
6412
+ pxSizes = bubbleSeries.getPxExtremes(),
6413
+ minSize = Math.ceil(pxSizes.minPxSize),
6414
+ maxPxSize = Math.ceil(pxSizes.maxPxSize),
5291
6415
  plotSize = Math.min(plotSizeY,
5292
6416
  plotSizeX);
5293
6417
  var calculatedSize,
@@ -5338,11 +6462,12 @@
5338
6462
  var legend = this.legend,
5339
6463
  chart = this.chart,
5340
6464
  bubbleSeries = chart.series[this.options.seriesIndex],
5341
- bubbleSeriesSize = bubbleSeries.maxPxSize,
6465
+ pxSizes = bubbleSeries.getPxExtremes(),
6466
+ bubbleSeriesSize = pxSizes.maxPxSize,
5342
6467
  bubbleLegendSize = this.options.maxSize;
5343
6468
  if (Math.abs(Math.ceil(bubbleSeriesSize) - bubbleLegendSize) >
5344
6469
  1) {
5345
- this.updateRanges(this.options.minSize, bubbleSeries.maxPxSize);
6470
+ this.updateRanges(this.options.minSize, pxSizes.maxPxSize);
5346
6471
  legend.render();
5347
6472
  }
5348
6473
  };
@@ -5717,6 +6842,11 @@
5717
6842
  };
5718
6843
  return BubblePoint;
5719
6844
  }(ScatterPoint));
6845
+ /* *
6846
+ *
6847
+ * Class Prototype
6848
+ *
6849
+ * */
5720
6850
  extend(BubblePoint.prototype, {
5721
6851
  ttBelow: false
5722
6852
  });
@@ -5759,14 +6889,14 @@
5759
6889
  var _a = SeriesRegistry.seriesTypes,
5760
6890
  ColumnSeries = _a.column,
5761
6891
  ScatterSeries = _a.scatter;
5762
- var arrayMax = U.arrayMax,
6892
+ var addEvent = U.addEvent,
6893
+ arrayMax = U.arrayMax,
5763
6894
  arrayMin = U.arrayMin,
5764
6895
  clamp = U.clamp,
5765
6896
  extend = U.extend,
5766
6897
  isNumber = U.isNumber,
5767
6898
  merge = U.merge,
5768
- pick = U.pick,
5769
- pInt = U.pInt;
6899
+ pick = U.pick;
5770
6900
  /* *
5771
6901
  *
5772
6902
  * Class
@@ -5836,20 +6966,49 @@
5836
6966
  * the axis needs to add padding in accordance with the point sizes.
5837
6967
  * @private
5838
6968
  */
5839
- BubbleSeries.prototype.getRadii = function (zMin, zMax, series) {
6969
+ BubbleSeries.prototype.getRadii = function () {
6970
+ var _this = this;
5840
6971
  var len,
5841
6972
  i,
5842
6973
  zData = this.zData,
5843
6974
  yData = this.yData,
5844
- minSize = series.minPxSize,
5845
- maxSize = series.maxPxSize,
5846
6975
  radii = [],
5847
- value;
6976
+ value,
6977
+ zExtremes = this.chart.bubbleZExtremes;
6978
+ var _a = this.getPxExtremes(),
6979
+ minPxSize = _a.minPxSize,
6980
+ maxPxSize = _a.maxPxSize;
6981
+ // Get the collective Z extremes of all bubblish series. The chart-level
6982
+ // `bubbleZExtremes` are only computed once, and reset on `updatedData`
6983
+ // in any member series.
6984
+ if (!zExtremes) {
6985
+ var zMin_1 = Number.MAX_VALUE;
6986
+ var zMax_1 = -Number.MAX_VALUE;
6987
+ var valid_1;
6988
+ this.chart.series.forEach(function (otherSeries) {
6989
+ if (otherSeries.bubblePadding && (otherSeries.visible ||
6990
+ !_this.chart.options.chart.ignoreHiddenSeries)) {
6991
+ var zExtremes_1 = otherSeries.getZExtremes();
6992
+ if (zExtremes_1) {
6993
+ zMin_1 = Math.min(zMin_1 || zExtremes_1.zMin, zExtremes_1.zMin);
6994
+ zMax_1 = Math.max(zMax_1 || zExtremes_1.zMax, zExtremes_1.zMax);
6995
+ valid_1 = true;
6996
+ }
6997
+ }
6998
+ });
6999
+ if (valid_1) {
7000
+ zExtremes = { zMin: zMin_1, zMax: zMax_1 };
7001
+ this.chart.bubbleZExtremes = zExtremes;
7002
+ }
7003
+ else {
7004
+ zExtremes = { zMin: 0, zMax: 0 };
7005
+ }
7006
+ }
5848
7007
  // Set the shape type and arguments to be picked up in drawPoints
5849
7008
  for (i = 0, len = zData.length; i < len; i++) {
5850
7009
  value = zData[i];
5851
7010
  // Separate method to get individual radius for bubbleLegend
5852
- radii.push(this.getRadius(zMin, zMax, minSize, maxSize, value, yData[i]));
7011
+ radii.push(this.getRadius(zExtremes.zMin, zExtremes.zMax, minPxSize, maxPxSize, value, yData[i]));
5853
7012
  }
5854
7013
  this.radii = radii;
5855
7014
  };
@@ -5919,25 +7078,28 @@
5919
7078
  * @private
5920
7079
  */
5921
7080
  BubbleSeries.prototype.translate = function () {
5922
- var i,
5923
- data = this.data,
5924
- point,
5925
- radius,
5926
- radii = this.radii;
5927
7081
  // Run the parent method
5928
7082
  _super.prototype.translate.call(this);
7083
+ this.getRadii();
7084
+ this.translateBubble();
7085
+ };
7086
+ BubbleSeries.prototype.translateBubble = function () {
7087
+ var _a = this,
7088
+ data = _a.data,
7089
+ radii = _a.radii;
7090
+ var minPxSize = this.getPxExtremes().minPxSize;
5929
7091
  // Set the shape type and arguments to be picked up in drawPoints
5930
- i = data.length;
7092
+ var i = data.length;
5931
7093
  while (i--) {
5932
- point = data[i];
5933
- radius = radii ? radii[i] : 0; // #1737
5934
- if (isNumber(radius) && radius >= this.minPxSize / 2) {
5935
- // Shape arguments
5936
- point.marker = extend(point.marker, {
5937
- radius: radius,
5938
- width: 2 * radius,
5939
- height: 2 * radius
5940
- });
7094
+ var point = data[i];
7095
+ var radius = radii ? radii[i] : 0; // #1737
7096
+ if (isNumber(radius) && radius >= minPxSize / 2) {
7097
+ // Shape arguments
7098
+ point.marker = extend(point.marker, {
7099
+ radius: radius,
7100
+ width: 2 * radius,
7101
+ height: 2 * radius
7102
+ });
5941
7103
  // Alignment box for the data label
5942
7104
  point.dlBox = {
5943
7105
  x: point.plotX - radius,
@@ -5952,6 +7114,41 @@
5952
7114
  }
5953
7115
  }
5954
7116
  };
7117
+ BubbleSeries.prototype.getPxExtremes = function () {
7118
+ var smallestSize = Math.min(this.chart.plotWidth,
7119
+ this.chart.plotHeight);
7120
+ var getPxSize = function (length) {
7121
+ var isPercent;
7122
+ if (typeof length === 'string') {
7123
+ isPercent = /%$/.test(length);
7124
+ length = parseInt(length, 10);
7125
+ }
7126
+ return isPercent ? smallestSize * length / 100 : length;
7127
+ };
7128
+ var minPxSize = getPxSize(pick(this.options.minSize, 8));
7129
+ // Prioritize min size if conflict to make sure bubbles are
7130
+ // always visible. #5873
7131
+ var maxPxSize = Math.max(getPxSize(pick(this.options.maxSize, '20%')),
7132
+ minPxSize);
7133
+ return { minPxSize: minPxSize, maxPxSize: maxPxSize };
7134
+ };
7135
+ BubbleSeries.prototype.getZExtremes = function () {
7136
+ var options = this.options,
7137
+ zData = (this.zData || []).filter(isNumber);
7138
+ if (zData.length) {
7139
+ var zMin = pick(options.zMin,
7140
+ clamp(arrayMin(zData),
7141
+ options.displayNegative === false ?
7142
+ (options.zThreshold || 0) :
7143
+ -Number.MAX_VALUE,
7144
+ Number.MAX_VALUE));
7145
+ var zMax = pick(options.zMax,
7146
+ arrayMax(zData));
7147
+ if (isNumber(zMin) && isNumber(zMax)) {
7148
+ return { zMin: zMin, zMax: zMax };
7149
+ }
7150
+ }
7151
+ };
5955
7152
  BubbleSeries.compose = BubbleLegendComposition.compose;
5956
7153
  /**
5957
7154
  * A bubble series is a three dimensional series type where each point
@@ -6204,6 +7401,10 @@
6204
7401
  specialGroup: 'group',
6205
7402
  zoneAxis: 'z'
6206
7403
  });
7404
+ // On updated data in any series, delete the chart-level Z extremes cache
7405
+ addEvent(BubbleSeries, 'updatedData', function (e) {
7406
+ delete e.target.chart.bubbleZExtremes;
7407
+ });
6207
7408
  /* *
6208
7409
  *
6209
7410
  * Axis ?
@@ -6220,70 +7421,36 @@
6220
7421
  isXAxis = this.isXAxis,
6221
7422
  dataKey = isXAxis ? 'xData' : 'yData',
6222
7423
  min = this.min,
6223
- extremes = {},
6224
- smallestSize = Math.min(chart.plotWidth,
6225
- chart.plotHeight),
6226
- zMin = Number.MAX_VALUE,
6227
- zMax = -Number.MAX_VALUE,
6228
7424
  range = this.max - min,
6229
7425
  transA = axisLength / range,
6230
- activeSeries = [];
7426
+ hasActiveSeries;
6231
7427
  // Handle padding on the second pass, or on redraw
6232
7428
  this.series.forEach(function (series) {
6233
- var seriesOptions = series.options,
6234
- zData;
6235
7429
  if (series.bubblePadding &&
6236
7430
  (series.visible || !chart.options.chart.ignoreHiddenSeries)) {
6237
7431
  // Correction for #1673
6238
7432
  axis.allowZoomOutside = true;
6239
- // Cache it
6240
- activeSeries.push(series);
6241
- if (isXAxis) { // because X axis is evaluated first
6242
- // For each series, translate the size extremes to pixel values
6243
- ['minSize', 'maxSize'].forEach(function (prop) {
6244
- var length = seriesOptions[prop],
6245
- isPercent = /%$/.test(length);
6246
- length = pInt(length);
6247
- extremes[prop] = isPercent ?
6248
- smallestSize * length / 100 :
6249
- length;
6250
- });
6251
- series.minPxSize = extremes.minSize;
6252
- // Prioritize min size if conflict to make sure bubbles are
6253
- // always visible. #5873
6254
- series.maxPxSize = Math.max(extremes.maxSize, extremes.minSize);
6255
- // Find the min and max Z
6256
- zData = series.zData.filter(isNumber);
6257
- if (zData.length) { // #1735
6258
- zMin = pick(seriesOptions.zMin, clamp(arrayMin(zData), seriesOptions.displayNegative === false ?
6259
- seriesOptions.zThreshold :
6260
- -Number.MAX_VALUE, zMin));
6261
- zMax = pick(seriesOptions.zMax, Math.max(zMax, arrayMax(zData)));
6262
- }
7433
+ hasActiveSeries = true;
7434
+ var data = series[dataKey];
7435
+ if (isXAxis) {
7436
+ series.getRadii(0, 0, series);
6263
7437
  }
6264
- }
6265
- });
6266
- activeSeries.forEach(function (series) {
6267
- var data = series[dataKey],
6268
- i = data.length,
6269
- radius;
6270
- if (isXAxis) {
6271
- series.getRadii(zMin, zMax, series);
6272
- }
6273
- if (range > 0) {
6274
- while (i--) {
6275
- if (isNumber(data[i]) &&
6276
- axis.dataMin <= data[i] &&
6277
- data[i] <= axis.max) {
6278
- radius = series.radii ? series.radii[i] : 0;
6279
- pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);
6280
- pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);
7438
+ if (range > 0) {
7439
+ var i = data.length;
7440
+ while (i--) {
7441
+ if (isNumber(data[i]) &&
7442
+ axis.dataMin <= data[i] &&
7443
+ data[i] <= axis.max) {
7444
+ var radius = series.radii && series.radii[i] || 0;
7445
+ pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);
7446
+ pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);
7447
+ }
6281
7448
  }
6282
7449
  }
6283
7450
  }
6284
7451
  });
6285
7452
  // Apply the padding to the min and max properties
6286
- if (activeSeries.length && range > 0 && !this.logarithmic) {
7453
+ if (hasActiveSeries && range > 0 && !this.logarithmic) {
6287
7454
  pxMax -= axisLength;
6288
7455
  transA *= (axisLength +
6289
7456
  Math.max(0, pxMin) - // #8901
@@ -6477,9 +7644,6 @@
6477
7644
  };
6478
7645
  return MapBubblePoint;
6479
7646
  }(BubbleSeries.prototype.pointClass));
6480
- extend(MapBubblePoint.prototype, {
6481
- ttBelow: false
6482
- });
6483
7647
  /* *
6484
7648
  *
6485
7649
  * Default Export
@@ -6514,6 +7678,7 @@
6514
7678
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6515
7679
  };
6516
7680
  })();
7681
+ var MapPointSeries = SeriesRegistry.seriesTypes.mappoint;
6517
7682
  var extend = U.extend,
6518
7683
  merge = U.merge;
6519
7684
  /* *
@@ -6543,6 +7708,11 @@
6543
7708
  _this.points = void 0;
6544
7709
  return _this;
6545
7710
  }
7711
+ MapBubbleSeries.prototype.translate = function () {
7712
+ MapPointSeries.prototype.translate.call(this);
7713
+ this.getRadii();
7714
+ this.translateBubble();
7715
+ };
6546
7716
  /* *
6547
7717
  *
6548
7718
  * Static Properties
@@ -6678,12 +7848,15 @@
6678
7848
  }(BubbleSeries));
6679
7849
  extend(MapBubbleSeries.prototype, {
6680
7850
  type: 'mapbubble',
6681
- getBox: MapSeries.prototype.getBox,
7851
+ axisTypes: ['colorAxis'],
7852
+ getProjectedBounds: MapSeries.prototype.getProjectedBounds,
7853
+ isCartesian: false,
6682
7854
  // If one single value is passed, it is interpreted as z
6683
7855
  pointArrayMap: ['z'],
6684
7856
  pointClass: MapBubblePoint,
6685
7857
  setData: MapSeries.prototype.setData,
6686
7858
  setOptions: MapSeries.prototype.setOptions,
7859
+ useMapGeometry: true,
6687
7860
  xyFromShape: true
6688
7861
  });
6689
7862
  SeriesRegistry.registerSeriesType('mapbubble', MapBubbleSeries);
@@ -6761,7 +7934,7 @@
6761
7934
 
6762
7935
  return MapBubbleSeries;
6763
7936
  });
6764
- _registerModule(_modules, 'Series/Heatmap/HeatmapPoint.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, SeriesRegistry, U) {
7937
+ _registerModule(_modules, 'Series/Heatmap/HeatmapPoint.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
6765
7938
  /* *
6766
7939
  *
6767
7940
  * (c) 2010-2021 Torstein Honsi
@@ -6787,7 +7960,6 @@
6787
7960
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6788
7961
  };
6789
7962
  })();
6790
- var colorMapPointMixin = ColorMapMixin.colorMapPointMixin;
6791
7963
  var ScatterPoint = SeriesRegistry.seriesTypes.scatter.prototype.pointClass;
6792
7964
  var clamp = U.clamp,
6793
7965
  extend = U.extend,
@@ -6931,8 +8103,9 @@
6931
8103
  return HeatmapPoint;
6932
8104
  }(ScatterPoint));
6933
8105
  extend(HeatmapPoint.prototype, {
6934
- dataLabelOnNull: colorMapPointMixin.dataLabelOnNull,
6935
- moveToTopOnHover: colorMapPointMixin.moveToTopOnHover
8106
+ dataLabelOnNull: true,
8107
+ moveToTopOnHover: true,
8108
+ ttBelow: false
6936
8109
  });
6937
8110
  /* *
6938
8111
  *
@@ -6942,7 +8115,7 @@
6942
8115
 
6943
8116
  return HeatmapPoint;
6944
8117
  });
6945
- _registerModule(_modules, 'Series/Heatmap/HeatmapSeries.js', [_modules['Core/Color/Color.js'], _modules['Mixins/ColorMapSeries.js'], _modules['Series/Heatmap/HeatmapPoint.js'], _modules['Core/Legend/LegendSymbol.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Color, ColorMapMixin, HeatmapPoint, LegendSymbol, palette, SeriesRegistry, SVGRenderer, U) {
8118
+ _registerModule(_modules, 'Series/Heatmap/HeatmapSeries.js', [_modules['Core/Color/Color.js'], _modules['Series/ColorMapComposition.js'], _modules['Series/Heatmap/HeatmapPoint.js'], _modules['Core/Legend/LegendSymbol.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Color, ColorMapComposition, HeatmapPoint, LegendSymbol, SeriesRegistry, SVGRenderer, U) {
6946
8119
  /* *
6947
8120
  *
6948
8121
  * (c) 2010-2021 Torstein Honsi
@@ -6968,7 +8141,7 @@
6968
8141
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6969
8142
  };
6970
8143
  })();
6971
- var colorMapSeriesMixin = ColorMapMixin.colorMapSeriesMixin;
8144
+ var colorMapSeriesMixin = ColorMapComposition.colorMapSeriesMixin;
6972
8145
  var Series = SeriesRegistry.series,
6973
8146
  _a = SeriesRegistry.seriesTypes,
6974
8147
  ColumnSeries = _a.column,
@@ -7034,11 +8207,25 @@
7034
8207
  this.points.forEach(function (point) {
7035
8208
  if (point.graphic) {
7036
8209
  point.graphic[_this.chart.styledMode ? 'css' : 'animate'](_this.colorAttribs(point));
8210
+ // @todo
8211
+ // Applying the border radius here is not optimal. It should
8212
+ // be set in the shapeArgs or returned from `markerAttribs`.
8213
+ // However, Series.drawPoints does not pick up markerAttribs
8214
+ // to be passed over to `renderer.symbol`. Also, image
8215
+ // symbols are not positioned by their top left corner like
8216
+ // other symbols are. This should be refactored, then we
8217
+ // could save ourselves some tests for .hasImage etc. And
8218
+ // the evaluation of borderRadius would be moved to
8219
+ // `markerAttribs`.
7037
8220
  if (_this.options.borderRadius) {
7038
8221
  point.graphic.attr({
7039
8222
  r: _this.options.borderRadius
7040
8223
  });
7041
8224
  }
8225
+ // Saving option for reapplying later
8226
+ // when changing point's states (#16165)
8227
+ (point.shapeArgs || {}).r = _this.options.borderRadius;
8228
+ (point.shapeArgs || {}).d = point.graphic.pathArray;
7042
8229
  if (point.value === null) { // #15708
7043
8230
  point.graphic.addClass('highcharts-null-point');
7044
8231
  }
@@ -7334,7 +8521,7 @@
7334
8521
  *
7335
8522
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
7336
8523
  */
7337
- nullColor: palette.neutralColor3,
8524
+ nullColor: "#f7f7f7" /* neutralColor3 */,
7338
8525
  dataLabels: {
7339
8526
  formatter: function () {
7340
8527
  var numberFormatter = this.series.chart.numberFormatter;
@@ -7520,8 +8707,7 @@
7520
8707
  */
7521
8708
  alignDataLabel: ColumnSeries.prototype.alignDataLabel,
7522
8709
  axisTypes: colorMapSeriesMixin.axisTypes,
7523
- colorAttribs: colorMapSeriesMixin.colorAttribs,
7524
- colorKey: colorMapSeriesMixin.colorKey,
8710
+ colorKey: 'value',
7525
8711
  directTouch: true,
7526
8712
  /**
7527
8713
  * @private
@@ -7534,6 +8720,7 @@
7534
8720
  pointClass: HeatmapPoint,
7535
8721
  trackerGroups: colorMapSeriesMixin.trackerGroups
7536
8722
  });
8723
+ ColorMapComposition.compose(HeatmapSeries);
7537
8724
  SeriesRegistry.registerSeriesType('heatmap', HeatmapSeries);
7538
8725
  /* *
7539
8726
  *
@@ -8051,6 +9238,11 @@
8051
9238
  * @name Highcharts.MapLatLonObject#lon
8052
9239
  * @type {number}
8053
9240
  */
9241
+ /**
9242
+ * An array of longitude, latitude.
9243
+ *
9244
+ * @typedef {Array<number>} Highcharts.LonLatArray
9245
+ */
8054
9246
  ''; // detach doclets above
8055
9247
  /* eslint-disable no-invalid-this, valid-jsdoc */
8056
9248
  /**
@@ -8110,9 +9302,7 @@
8110
9302
  * @product highmaps
8111
9303
  * @apioption chart.proj4
8112
9304
  */
8113
- var proj4 = (this.userOptions.chart &&
8114
- this.userOptions.chart.proj4 ||
8115
- win.proj4);
9305
+ var proj4 = this.options.chart.proj4 || win.proj4;
8116
9306
  if (!proj4) {
8117
9307
  error(21, false, this);
8118
9308
  return {
@@ -8120,6 +9310,22 @@
8120
9310
  y: null
8121
9311
  };
8122
9312
  }
9313
+ var _a = transform.jsonmarginX,
9314
+ jsonmarginX = _a === void 0 ? 0 : _a,
9315
+ _b = transform.jsonmarginY,
9316
+ jsonmarginY = _b === void 0 ? 0 : _b,
9317
+ _c = transform.jsonres,
9318
+ jsonres = _c === void 0 ? 1 : _c,
9319
+ _d = transform.scale,
9320
+ scale = _d === void 0 ? 1 : _d,
9321
+ _e = transform.xoffset,
9322
+ xoffset = _e === void 0 ? 0 : _e,
9323
+ _f = transform.xpan,
9324
+ xpan = _f === void 0 ? 0 : _f,
9325
+ _g = transform.yoffset,
9326
+ yoffset = _g === void 0 ? 0 : _g,
9327
+ _h = transform.ypan,
9328
+ ypan = _h === void 0 ? 0 : _h;
8123
9329
  var projected = proj4(transform.crs,
8124
9330
  [latLon.lon,
8125
9331
  latLon.lat]),
@@ -8132,12 +9338,8 @@
8132
9338
  -projected[0] * sinAngle + projected[1] * cosAngle
8133
9339
  ] : projected;
8134
9340
  return {
8135
- x: ((rotated[0] - (transform.xoffset || 0)) * (transform.scale || 1) +
8136
- (transform.xpan || 0)) * (transform.jsonres || 1) +
8137
- (transform.jsonmarginX || 0),
8138
- y: (((transform.yoffset || 0) - rotated[1]) * (transform.scale || 1) +
8139
- (transform.ypan || 0)) * (transform.jsonres || 1) -
8140
- (transform.jsonmarginY || 0)
9341
+ x: ((rotated[0] - xoffset) * scale + xpan) * jsonres + jsonmarginX,
9342
+ y: -(((yoffset - rotated[1]) * scale + ypan) * jsonres - jsonmarginY)
8141
9343
  };
8142
9344
  };
8143
9345
  /**
@@ -8163,18 +9365,33 @@
8163
9365
  * An object with `lat` and `lon` properties.
8164
9366
  */
8165
9367
  Chart.prototype.transformToLatLon = function (point, transform) {
8166
- if (typeof win.proj4 === 'undefined') {
9368
+ var proj4 = this.options.chart.proj4 || win.proj4;
9369
+ if (!proj4) {
8167
9370
  error(21, false, this);
8168
9371
  return;
8169
9372
  }
9373
+ if (point.y === null) {
9374
+ return;
9375
+ }
9376
+ var _a = transform.jsonmarginX,
9377
+ jsonmarginX = _a === void 0 ? 0 : _a,
9378
+ _b = transform.jsonmarginY,
9379
+ jsonmarginY = _b === void 0 ? 0 : _b,
9380
+ _c = transform.jsonres,
9381
+ jsonres = _c === void 0 ? 1 : _c,
9382
+ _d = transform.scale,
9383
+ scale = _d === void 0 ? 1 : _d,
9384
+ _e = transform.xoffset,
9385
+ xoffset = _e === void 0 ? 0 : _e,
9386
+ _f = transform.xpan,
9387
+ xpan = _f === void 0 ? 0 : _f,
9388
+ _g = transform.yoffset,
9389
+ yoffset = _g === void 0 ? 0 : _g,
9390
+ _h = transform.ypan,
9391
+ ypan = _h === void 0 ? 0 : _h;
8170
9392
  var normalized = {
8171
- x: ((point.x -
8172
- (transform.jsonmarginX || 0)) / (transform.jsonres || 1) -
8173
- (transform.xpan || 0)) / (transform.scale || 1) +
8174
- (transform.xoffset || 0),
8175
- y: ((-point.y - (transform.jsonmarginY || 0)) / (transform.jsonres || 1) +
8176
- (transform.ypan || 0)) / (transform.scale || 1) +
8177
- (transform.yoffset || 0)
9393
+ x: ((point.x - jsonmarginX) / jsonres - xpan) / scale + xoffset,
9394
+ y: ((point.y - jsonmarginY) / jsonres + ypan) / scale + yoffset
8178
9395
  },
8179
9396
  cosAngle = transform.cosAngle ||
8180
9397
  (transform.rotation && Math.cos(transform.rotation)),
@@ -8207,16 +9424,15 @@
8207
9424
  * An object with `lat` and `lon` properties.
8208
9425
  */
8209
9426
  Chart.prototype.fromPointToLatLon = function (point) {
8210
- var transforms = this.mapTransforms,
8211
- transform;
9427
+ var transforms = this.mapTransforms;
8212
9428
  if (!transforms) {
8213
9429
  error(22, false, this);
8214
9430
  return;
8215
9431
  }
8216
- for (transform in transforms) {
9432
+ for (var transform in transforms) {
8217
9433
  if (Object.hasOwnProperty.call(transforms, transform) &&
8218
9434
  transforms[transform].hitZone &&
8219
- pointInPolygon({ x: point.x, y: -point.y }, transforms[transform].hitZone.coordinates[0])) {
9435
+ pointInPolygon(point, transforms[transform].hitZone.coordinates[0])) {
8220
9436
  return this.transformToLatLon(point, transforms[transform]);
8221
9437
  }
8222
9438
  }
@@ -8255,7 +9471,7 @@
8255
9471
  if (Object.hasOwnProperty.call(transforms, transform) &&
8256
9472
  transforms[transform].hitZone) {
8257
9473
  coords = this.transformFromLatLon(latLon, transforms[transform]);
8258
- if (pointInPolygon({ x: coords.x, y: -coords.y }, transforms[transform].hitZone.coordinates[0])) {
9474
+ if (pointInPolygon(coords, transforms[transform].hitZone.coordinates[0])) {
8259
9475
  return coords;
8260
9476
  }
8261
9477
  }
@@ -8294,64 +9510,36 @@
8294
9510
  * An object ready for the `mapData` option.
8295
9511
  */
8296
9512
  H.geojson = function (geojson, hType, series) {
8297
- var mapData = [],
8298
- path = [],
8299
- polygonToPath = function (polygon) {
8300
- polygon.forEach(function (point,
8301
- i) {
8302
- if (i === 0) {
8303
- path.push(['M',
8304
- point[0], -point[1]]);
8305
- }
8306
- else {
8307
- path.push(['L', point[0], -point[1]]);
8308
- }
8309
- });
8310
- };
8311
- hType = hType || 'map';
9513
+ if (hType === void 0) { hType = 'map'; }
9514
+ var mapData = [];
9515
+ var path = [];
8312
9516
  geojson.features.forEach(function (feature) {
8313
- var geometry = feature.geometry,
9517
+ var geometry = feature.geometry || {},
8314
9518
  type = geometry.type,
8315
9519
  coordinates = geometry.coordinates,
8316
9520
  properties = feature.properties,
8317
- point;
9521
+ pointOptions;
8318
9522
  path = [];
8319
- if (hType === 'map' || hType === 'mapbubble') {
8320
- if (type === 'Polygon') {
8321
- coordinates.forEach(polygonToPath);
8322
- path.push(['Z']);
8323
- }
8324
- else if (type === 'MultiPolygon') {
8325
- coordinates.forEach(function (items) {
8326
- items.forEach(polygonToPath);
8327
- });
8328
- path.push(['Z']);
8329
- }
8330
- if (path.length) {
8331
- point = { path: path };
9523
+ if ((hType === 'map' || hType === 'mapbubble') &&
9524
+ (type === 'Polygon' || type === 'MultiPolygon')) {
9525
+ if (coordinates.length) {
9526
+ pointOptions = { geometry: { coordinates: coordinates, type: type } };
8332
9527
  }
8333
9528
  }
8334
- else if (hType === 'mapline') {
8335
- if (type === 'LineString') {
8336
- polygonToPath(coordinates);
8337
- }
8338
- else if (type === 'MultiLineString') {
8339
- coordinates.forEach(polygonToPath);
8340
- }
8341
- if (path.length) {
8342
- point = { path: path };
9529
+ else if (hType === 'mapline' &&
9530
+ (type === 'LineString' ||
9531
+ type === 'MultiLineString')) {
9532
+ if (coordinates.length) {
9533
+ pointOptions = { geometry: { coordinates: coordinates, type: type } };
8343
9534
  }
8344
9535
  }
8345
- else if (hType === 'mappoint') {
8346
- if (type === 'Point') {
8347
- point = {
8348
- x: coordinates[0],
8349
- y: -coordinates[1]
8350
- };
9536
+ else if (hType === 'mappoint' && type === 'Point') {
9537
+ if (coordinates.length) {
9538
+ pointOptions = { geometry: { coordinates: coordinates, type: type } };
8351
9539
  }
8352
9540
  }
8353
- if (point) {
8354
- mapData.push(extend(point, {
9541
+ if (pointOptions) {
9542
+ mapData.push(extend(pointOptions, {
8355
9543
  name: properties.name || properties.NAME,
8356
9544
  /**
8357
9545
  * In Highmaps, when data is loaded from GeoJSON, the GeoJSON