highcharts 9.2.2 → 9.3.0

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 (747) 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 +233 -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 +46 -23
  16. package/es-modules/Accessibility/Components/LegendComponent.js +97 -65
  17. package/es-modules/Accessibility/Components/MenuComponent.js +59 -40
  18. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +5 -8
  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 +144 -70
  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 +8 -12
  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 +2 -0
  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 +3 -3
  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 +153 -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 +68 -19
  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/BoostOverrides.js +3 -1
  111. package/es-modules/Extensions/Boost/WGLShader.js +4 -3
  112. package/es-modules/Extensions/BoostCanvas.js +1 -2
  113. package/es-modules/Extensions/CurrentDateIndication.js +2 -3
  114. package/es-modules/Extensions/DataGrouping.js +31 -18
  115. package/es-modules/Extensions/DownloadURL.js +2 -2
  116. package/es-modules/Extensions/DragPanes.js +1 -2
  117. package/es-modules/Extensions/Drilldown.js +2 -3
  118. package/es-modules/Extensions/Exporting/Exporting.js +8 -7
  119. package/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -15
  120. package/es-modules/Extensions/GeoJSON.js +39 -63
  121. package/es-modules/Extensions/MarkerClusters.js +115 -97
  122. package/es-modules/Extensions/NoDataToDisplay.js +1 -2
  123. package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +9 -8
  124. package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
  125. package/es-modules/Extensions/Oldie/Oldie.js +2 -3
  126. package/es-modules/Extensions/Pane.js +5 -6
  127. package/es-modules/Extensions/RangeSelector.js +3 -4
  128. package/es-modules/Extensions/Sonification/ChartSonify.js +247 -637
  129. package/es-modules/Extensions/Sonification/Earcon.js +136 -102
  130. package/es-modules/Extensions/Sonification/Instrument.js +496 -426
  131. package/es-modules/Extensions/Sonification/MusicalFrequencies.js +10 -0
  132. package/es-modules/Extensions/Sonification/Options.js +10 -0
  133. package/es-modules/Extensions/Sonification/PointSonify.js +203 -152
  134. package/es-modules/Extensions/Sonification/SeriesSonify.js +459 -0
  135. package/es-modules/Extensions/Sonification/SignalHandler.js +124 -0
  136. package/es-modules/Extensions/Sonification/Sonification.js +26 -52
  137. package/es-modules/Extensions/Sonification/{Utilities.js → SonificationUtilities.js} +62 -84
  138. package/es-modules/Extensions/Sonification/Timeline.js +255 -567
  139. package/es-modules/Extensions/Sonification/TimelineEvent.js +158 -0
  140. package/es-modules/Extensions/Sonification/TimelinePath.js +311 -0
  141. package/es-modules/Maps/MapNavigation.js +27 -64
  142. package/es-modules/Maps/MapNavigationOptionsDefault.js +3 -0
  143. package/es-modules/Maps/MapPointer.js +7 -5
  144. package/es-modules/Maps/MapView.js +450 -0
  145. package/es-modules/Maps/MapViewOptionsDefault.js +95 -0
  146. package/es-modules/Maps/Projection.js +433 -0
  147. package/es-modules/Maps/ProjectionDefinition.js +9 -0
  148. package/es-modules/Maps/Projections/EqualEarth.js +42 -0
  149. package/es-modules/Maps/Projections/Miller.js +17 -0
  150. package/es-modules/Maps/Projections/Orthographic.js +26 -0
  151. package/es-modules/Maps/Projections/ProjectionRegistry.js +17 -0
  152. package/es-modules/Maps/Projections/WebMercator.js +25 -0
  153. package/es-modules/Series/AreaRange/AreaRangeSeries.js +4 -5
  154. package/es-modules/Series/Bellcurve/BellcurveSeries.js +2 -8
  155. package/es-modules/Series/BoxPlot/BoxPlotSeries.js +1 -2
  156. package/es-modules/Series/Bubble/BubbleLegendDefaults.js +1 -2
  157. package/es-modules/Series/Bubble/BubbleLegendItem.js +3 -3
  158. package/es-modules/Series/Bubble/BubblePoint.js +5 -0
  159. package/es-modules/Series/Bubble/BubbleSeries.js +90 -50
  160. package/es-modules/Series/Candlestick/CandlestickSeries.js +10 -18
  161. package/es-modules/{Mixins/CenteredSeries.js → Series/CenteredUtilities.js} +45 -23
  162. package/es-modules/Series/ColorMapComposition.js +109 -0
  163. package/es-modules/Series/Column/ColumnDataLabel.js +5 -5
  164. package/es-modules/Series/Column/ColumnSeries.js +3 -4
  165. package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +6 -6
  166. package/es-modules/Series/DataModifyComposition.js +539 -0
  167. package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +2 -6
  168. package/es-modules/Series/DerivedComposition.js +137 -0
  169. package/es-modules/Series/DrawPointComposition.js +111 -0
  170. package/es-modules/Series/Dumbbell/DumbbellSeries.js +2 -3
  171. package/es-modules/Series/ErrorBar/ErrorBarSeries.js +1 -2
  172. package/es-modules/Series/Flags/FlagsSeries.js +18 -25
  173. package/es-modules/Series/Funnel/FunnelSeries.js +6 -5
  174. package/es-modules/Series/Gantt/GanttSeries.js +0 -2
  175. package/es-modules/Series/Gauge/GaugePoint.js +1 -1
  176. package/es-modules/Series/Gauge/GaugeSeries.js +7 -7
  177. package/es-modules/Series/HLC/HLCPoint.js +55 -0
  178. package/es-modules/Series/HLC/HLCSeries.js +383 -0
  179. package/es-modules/Series/Heatmap/HeatmapPoint.js +3 -4
  180. package/es-modules/Series/Heatmap/HeatmapSeries.js +19 -6
  181. package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +2 -3
  182. package/es-modules/Series/Histogram/HistogramSeries.js +3 -7
  183. package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +9 -10
  184. package/es-modules/Series/Line/LineSeries.js +1 -2
  185. package/es-modules/Series/Map/MapPoint.js +23 -16
  186. package/es-modules/Series/Map/MapSeries.js +268 -309
  187. package/es-modules/Series/MapBubble/MapBubblePoint.js +0 -3
  188. package/es-modules/Series/MapBubble/MapBubbleSeries.js +10 -1
  189. package/es-modules/Series/MapPoint/MapPointPoint.js +5 -1
  190. package/es-modules/Series/MapPoint/MapPointSeries.js +87 -4
  191. package/es-modules/Series/Networkgraph/Networkgraph.js +5 -5
  192. package/es-modules/{Mixins/Nodes.js → Series/NodesComposition.js} +76 -29
  193. package/es-modules/Series/OHLC/OHLCPoint.js +2 -6
  194. package/es-modules/Series/OHLC/OHLCSeries.js +55 -183
  195. package/es-modules/{Mixins/OnSeries.js → Series/OnSeriesComposition.js} +53 -21
  196. package/es-modules/Series/Organization/OrganizationSeries.js +2 -3
  197. package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +46 -6
  198. package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -7
  199. package/es-modules/Series/Pie/PieDataLabel.js +1 -2
  200. package/es-modules/Series/Pie/PieSeries.js +6 -7
  201. package/es-modules/Series/Sankey/SankeyPoint.js +0 -4
  202. package/es-modules/Series/Sankey/SankeySeries.js +89 -20
  203. package/es-modules/Series/Sunburst/SunburstPoint.js +2 -3
  204. package/es-modules/Series/Sunburst/SunburstSeries.js +4 -4
  205. package/es-modules/Series/Tilemap/TilemapPoint.js +2 -3
  206. package/es-modules/Series/Timeline/TimelineSeries.js +3 -4
  207. package/es-modules/{Mixins/TreeSeries.js → Series/TreeUtilities.js} +86 -76
  208. package/es-modules/Series/Treemap/TreemapPoint.js +2 -2
  209. package/es-modules/Series/Treemap/TreemapSeries.js +8 -8
  210. package/es-modules/Series/Venn/VennPoint.js +16 -7
  211. package/es-modules/Series/Venn/VennSeries.js +5 -8
  212. package/es-modules/Series/Venn/VennUtils.js +550 -439
  213. package/es-modules/Series/Waterfall/WaterfallSeries.js +2 -3
  214. package/es-modules/Series/Windbarb/WindbarbSeries.js +23 -24
  215. package/es-modules/Series/Wordcloud/WordcloudPoint.js +8 -6
  216. package/es-modules/Series/Wordcloud/WordcloudSeries.js +24 -20
  217. package/es-modules/Series/Wordcloud/WordcloudUtils.js +673 -484
  218. package/es-modules/Series/XRange/XRangePoint.js +1 -0
  219. package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +3 -6
  220. package/es-modules/Stock/Indicators/AO/AOIndicator.js +2 -3
  221. package/es-modules/Stock/Indicators/APO/APOIndicator.js +14 -20
  222. package/es-modules/Stock/Indicators/Aroon/AroonIndicator.js +3 -6
  223. package/es-modules/Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js +11 -13
  224. package/es-modules/Stock/Indicators/ArrayUtilities.js +47 -0
  225. package/es-modules/Stock/Indicators/BB/BBIndicator.js +27 -11
  226. package/es-modules/Stock/Indicators/Chaikin/ChaikinIndicator.js +6 -12
  227. package/es-modules/Stock/Indicators/DEMA/DEMAIndicator.js +1 -11
  228. package/es-modules/Stock/Indicators/DMI/DMIIndicator.js +19 -11
  229. package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +17 -11
  230. package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +1 -3
  231. package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +11 -9
  232. package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +8 -16
  233. package/es-modules/Stock/Indicators/LinearRegression/LinearRegression.js +2 -2
  234. package/es-modules/Stock/Indicators/LinearRegressionAngle/LinearRegressionAngle.js +2 -2
  235. package/es-modules/Stock/Indicators/LinearRegressionIntercept/LinearRegressionIntercept.js +2 -2
  236. package/es-modules/Stock/Indicators/LinearRegressionSlopes/LinearRegressionSlopes.js +2 -2
  237. package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +1 -2
  238. package/es-modules/{Mixins/MultipleLines.js → Stock/Indicators/MultipleLinesComposition.js} +136 -87
  239. package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +1 -3
  240. package/es-modules/Stock/Indicators/PC/PCIndicator.js +14 -13
  241. package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +1 -11
  242. package/es-modules/Stock/Indicators/SMA/SMAComposition.js +0 -26
  243. package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +9 -32
  244. package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +0 -8
  245. package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +15 -8
  246. package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +4 -6
  247. package/es-modules/Stock/Indicators/TEMA/TEMAIndicator.js +26 -11
  248. package/es-modules/Stock/Indicators/TRIX/TRIXIndicator.js +6 -12
  249. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +20 -3
  250. package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +2 -3
  251. package/es-modules/Stock/StockToolsBindings.js +144 -42
  252. package/es-modules/Stock/StockToolsGui.js +405 -11
  253. package/es-modules/masters/highcharts-3d.src.js +1 -1
  254. package/es-modules/masters/highcharts-gantt.src.js +1 -1
  255. package/es-modules/masters/highcharts-more.src.js +1 -1
  256. package/es-modules/masters/highcharts.src.js +1 -1
  257. package/es-modules/masters/highmaps.src.js +1 -1
  258. package/es-modules/masters/highstock.src.js +1 -1
  259. package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  260. package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  261. package/es-modules/masters/indicators/ao.src.js +1 -1
  262. package/es-modules/masters/indicators/apo.src.js +1 -1
  263. package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  264. package/es-modules/masters/indicators/aroon.src.js +1 -1
  265. package/es-modules/masters/indicators/atr.src.js +1 -1
  266. package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  267. package/es-modules/masters/indicators/cci.src.js +1 -1
  268. package/es-modules/masters/indicators/chaikin.src.js +1 -1
  269. package/es-modules/masters/indicators/cmf.src.js +1 -1
  270. package/es-modules/masters/indicators/cmo.src.js +1 -1
  271. package/es-modules/masters/indicators/dema.src.js +1 -1
  272. package/es-modules/masters/indicators/disparity-index.src.js +1 -1
  273. package/es-modules/masters/indicators/dmi.src.js +1 -1
  274. package/es-modules/masters/indicators/dpo.src.js +1 -1
  275. package/es-modules/masters/indicators/ema.src.js +4 -10
  276. package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  277. package/es-modules/masters/indicators/indicators-all.src.js +2 -2
  278. package/es-modules/masters/indicators/indicators.src.js +2 -1
  279. package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  280. package/es-modules/masters/indicators/klinger.src.js +1 -1
  281. package/es-modules/masters/indicators/macd.src.js +1 -1
  282. package/es-modules/masters/indicators/mfi.src.js +1 -1
  283. package/es-modules/masters/indicators/momentum.src.js +1 -1
  284. package/es-modules/masters/indicators/natr.src.js +1 -1
  285. package/es-modules/masters/indicators/obv.src.js +1 -1
  286. package/es-modules/masters/indicators/pivot-points.src.js +1 -1
  287. package/es-modules/masters/indicators/ppo.src.js +1 -1
  288. package/es-modules/masters/indicators/price-channel.src.js +1 -1
  289. package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  290. package/es-modules/masters/indicators/psar.src.js +1 -1
  291. package/es-modules/masters/indicators/regressions.src.js +1 -1
  292. package/es-modules/masters/indicators/roc.src.js +1 -1
  293. package/es-modules/masters/indicators/rsi.src.js +1 -1
  294. package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  295. package/es-modules/masters/indicators/stochastic.src.js +1 -1
  296. package/es-modules/masters/indicators/supertrend.src.js +1 -1
  297. package/es-modules/masters/indicators/tema.src.js +1 -1
  298. package/es-modules/masters/indicators/trendline.src.js +1 -1
  299. package/es-modules/masters/indicators/trix.src.js +1 -1
  300. package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  301. package/es-modules/masters/indicators/vwap.src.js +1 -1
  302. package/es-modules/masters/indicators/williams-r.src.js +1 -1
  303. package/es-modules/masters/indicators/wma.src.js +1 -1
  304. package/es-modules/masters/indicators/zigzag.src.js +1 -1
  305. package/es-modules/masters/modules/accessibility.src.js +16 -2
  306. package/es-modules/masters/modules/annotations-advanced.src.js +3 -1
  307. package/es-modules/masters/modules/annotations.src.js +1 -1
  308. package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  309. package/es-modules/masters/modules/boost-canvas.src.js +1 -1
  310. package/es-modules/masters/modules/boost.src.js +1 -1
  311. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  312. package/es-modules/masters/modules/bullet.src.js +1 -1
  313. package/es-modules/masters/modules/coloraxis.src.js +1 -1
  314. package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  315. package/es-modules/masters/modules/cylinder.src.js +1 -1
  316. package/es-modules/masters/modules/data.src.js +6 -3
  317. package/es-modules/masters/modules/datagrouping.src.js +1 -1
  318. package/es-modules/masters/modules/debugger.src.js +1 -1
  319. package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  320. package/es-modules/masters/modules/dotplot.src.js +1 -1
  321. package/es-modules/masters/modules/drag-panes.src.js +1 -1
  322. package/es-modules/masters/modules/draggable-points.src.js +1 -1
  323. package/es-modules/masters/modules/drilldown.src.js +1 -1
  324. package/es-modules/masters/modules/dumbbell.src.js +1 -1
  325. package/es-modules/masters/modules/export-data.src.js +1 -1
  326. package/es-modules/masters/modules/exporting.src.js +1 -1
  327. package/es-modules/masters/modules/full-screen.src.js +1 -1
  328. package/es-modules/masters/modules/funnel.src.js +1 -1
  329. package/es-modules/masters/modules/funnel3d.src.js +1 -1
  330. package/es-modules/masters/modules/gantt.src.js +1 -1
  331. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  332. package/es-modules/masters/modules/heatmap.src.js +1 -2
  333. package/es-modules/masters/modules/heikinashi.src.js +1 -1
  334. package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  335. package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
  336. package/es-modules/masters/modules/item-series.src.js +1 -1
  337. package/es-modules/masters/modules/lollipop.src.js +1 -1
  338. package/es-modules/masters/modules/map.src.js +1 -3
  339. package/es-modules/masters/modules/marker-clusters.src.js +1 -1
  340. package/es-modules/masters/modules/networkgraph.src.js +1 -1
  341. package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  342. package/es-modules/masters/modules/offline-exporting.src.js +1 -1
  343. package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
  344. package/es-modules/masters/modules/oldie.src.js +1 -1
  345. package/es-modules/masters/modules/organization.src.js +1 -1
  346. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  347. package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  348. package/es-modules/masters/modules/pareto.src.js +1 -1
  349. package/es-modules/masters/modules/pathfinder.src.js +1 -1
  350. package/es-modules/masters/modules/pattern-fill.src.js +1 -1
  351. package/es-modules/masters/modules/price-indicator.src.js +1 -1
  352. package/es-modules/masters/modules/pyramid3d.src.js +1 -1
  353. package/es-modules/masters/modules/sankey.src.js +1 -1
  354. package/es-modules/masters/modules/series-label.src.js +1 -1
  355. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  356. package/es-modules/masters/modules/sonification.src.js +33 -2
  357. package/es-modules/masters/modules/static-scale.src.js +1 -1
  358. package/es-modules/masters/modules/stock-tools.src.js +1 -1
  359. package/es-modules/masters/modules/stock.src.js +4 -1
  360. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  361. package/es-modules/masters/modules/sunburst.src.js +1 -1
  362. package/es-modules/masters/modules/tilemap.src.js +1 -1
  363. package/es-modules/masters/modules/timeline.src.js +1 -1
  364. package/es-modules/masters/modules/treegrid.src.js +1 -1
  365. package/es-modules/masters/modules/treemap.src.js +1 -1
  366. package/es-modules/masters/modules/variable-pie.src.js +1 -1
  367. package/es-modules/masters/modules/variwide.src.js +1 -1
  368. package/es-modules/masters/modules/vector.src.js +1 -1
  369. package/es-modules/masters/modules/venn.src.js +1 -1
  370. package/es-modules/masters/modules/windbarb.src.js +1 -1
  371. package/es-modules/masters/modules/wordcloud.src.js +1 -1
  372. package/es-modules/masters/modules/xrange.src.js +1 -1
  373. package/es-modules/masters/themes/avocado.src.js +1 -1
  374. package/es-modules/masters/themes/dark-blue.src.js +1 -1
  375. package/es-modules/masters/themes/dark-green.src.js +1 -1
  376. package/es-modules/masters/themes/dark-unica.src.js +1 -1
  377. package/es-modules/masters/themes/gray.src.js +1 -1
  378. package/es-modules/masters/themes/grid-light.src.js +1 -1
  379. package/es-modules/masters/themes/grid.src.js +1 -1
  380. package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
  381. package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
  382. package/es-modules/masters/themes/sand-signika.src.js +1 -1
  383. package/es-modules/masters/themes/skies.src.js +1 -1
  384. package/es-modules/masters/themes/sunset.src.js +1 -1
  385. package/highcharts-3d.js +1 -1
  386. package/highcharts-3d.src.js +1 -1
  387. package/highcharts-gantt.js +801 -804
  388. package/highcharts-gantt.js.map +1 -1
  389. package/highcharts-gantt.src.js +775 -739
  390. package/highcharts-more.js +194 -193
  391. package/highcharts-more.js.map +1 -1
  392. package/highcharts-more.src.js +207 -119
  393. package/highcharts.d.ts +9670 -4217
  394. package/highcharts.js +585 -588
  395. package/highcharts.js.map +1 -1
  396. package/highcharts.src.d.ts +9670 -4217
  397. package/highcharts.src.js +608 -587
  398. package/highmaps.js +726 -708
  399. package/highmaps.js.map +1 -1
  400. package/highmaps.src.js +2708 -1587
  401. package/highstock.js +788 -783
  402. package/highstock.js.map +1 -1
  403. package/highstock.src.js +1896 -1267
  404. package/indicators/acceleration-bands.js +10 -9
  405. package/indicators/acceleration-bands.js.map +1 -1
  406. package/indicators/acceleration-bands.src.js +156 -112
  407. package/indicators/accumulation-distribution.js +1 -1
  408. package/indicators/accumulation-distribution.src.js +1 -1
  409. package/indicators/ao.js +6 -6
  410. package/indicators/ao.js.map +1 -1
  411. package/indicators/ao.src.js +4 -4
  412. package/indicators/apo.js +5 -6
  413. package/indicators/apo.js.map +1 -1
  414. package/indicators/apo.src.js +16 -84
  415. package/indicators/aroon-oscillator.js +9 -9
  416. package/indicators/aroon-oscillator.js.map +1 -1
  417. package/indicators/aroon-oscillator.src.js +160 -177
  418. package/indicators/aroon.js +9 -9
  419. package/indicators/aroon.js.map +1 -1
  420. package/indicators/aroon.src.js +156 -112
  421. package/indicators/atr.js +1 -1
  422. package/indicators/atr.src.js +1 -1
  423. package/indicators/bollinger-bands.js +10 -9
  424. package/indicators/bollinger-bands.js.map +1 -1
  425. package/indicators/bollinger-bands.src.js +180 -117
  426. package/indicators/cci.js +1 -1
  427. package/indicators/cci.src.js +1 -1
  428. package/indicators/chaikin.js +8 -9
  429. package/indicators/chaikin.js.map +1 -1
  430. package/indicators/chaikin.src.js +8 -76
  431. package/indicators/cmf.js +1 -1
  432. package/indicators/cmf.src.js +1 -1
  433. package/indicators/cmo.js +1 -1
  434. package/indicators/cmo.src.js +1 -1
  435. package/indicators/dema.js +5 -6
  436. package/indicators/dema.js.map +1 -1
  437. package/indicators/dema.src.js +3 -75
  438. package/indicators/disparity-index.js +6 -7
  439. package/indicators/disparity-index.js.map +1 -1
  440. package/indicators/disparity-index.src.js +19 -74
  441. package/indicators/dmi.js +11 -11
  442. package/indicators/dmi.js.map +1 -1
  443. package/indicators/dmi.src.js +173 -116
  444. package/indicators/dpo.js +1 -1
  445. package/indicators/dpo.src.js +1 -1
  446. package/indicators/ema.js +1 -13
  447. package/indicators/ema.js.map +1 -1
  448. package/indicators/ema.src.js +7 -188
  449. package/indicators/ichimoku-kinko-hyo.js +1 -1
  450. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  451. package/indicators/indicators-all.js +197 -203
  452. package/indicators/indicators-all.js.map +1 -1
  453. package/indicators/indicators-all.src.js +649 -720
  454. package/indicators/indicators.js +12 -12
  455. package/indicators/indicators.js.map +1 -1
  456. package/indicators/indicators.src.js +188 -124
  457. package/indicators/keltner-channels.js +10 -10
  458. package/indicators/keltner-channels.js.map +1 -1
  459. package/indicators/keltner-channels.src.js +164 -118
  460. package/indicators/klinger.js +12 -13
  461. package/indicators/klinger.js.map +1 -1
  462. package/indicators/klinger.src.js +161 -184
  463. package/indicators/macd.js +2 -2
  464. package/indicators/macd.js.map +1 -1
  465. package/indicators/macd.src.js +2 -3
  466. package/indicators/mfi.js +1 -1
  467. package/indicators/mfi.src.js +1 -1
  468. package/indicators/momentum.js +1 -1
  469. package/indicators/momentum.src.js +1 -1
  470. package/indicators/natr.js +3 -3
  471. package/indicators/natr.js.map +1 -1
  472. package/indicators/natr.src.js +2 -4
  473. package/indicators/obv.js +1 -1
  474. package/indicators/obv.src.js +1 -1
  475. package/indicators/pivot-points.js +1 -1
  476. package/indicators/pivot-points.src.js +1 -1
  477. package/indicators/ppo.js +5 -6
  478. package/indicators/ppo.js.map +1 -1
  479. package/indicators/ppo.src.js +3 -75
  480. package/indicators/price-channel.js +9 -9
  481. package/indicators/price-channel.js.map +1 -1
  482. package/indicators/price-channel.src.js +207 -168
  483. package/indicators/price-envelopes.js +1 -1
  484. package/indicators/price-envelopes.src.js +1 -1
  485. package/indicators/psar.js +1 -1
  486. package/indicators/psar.src.js +1 -1
  487. package/indicators/regressions.js +1 -1
  488. package/indicators/regressions.src.js +9 -9
  489. package/indicators/roc.js +1 -1
  490. package/indicators/roc.src.js +1 -1
  491. package/indicators/rsi.js +1 -1
  492. package/indicators/rsi.src.js +1 -1
  493. package/indicators/slow-stochastic.js +5 -6
  494. package/indicators/slow-stochastic.js.map +1 -1
  495. package/indicators/slow-stochastic.src.js +2 -72
  496. package/indicators/stochastic.js +10 -10
  497. package/indicators/stochastic.js.map +1 -1
  498. package/indicators/stochastic.src.js +209 -164
  499. package/indicators/supertrend.js +10 -10
  500. package/indicators/supertrend.js.map +1 -1
  501. package/indicators/supertrend.src.js +6 -7
  502. package/indicators/tema.js +6 -7
  503. package/indicators/tema.js.map +1 -1
  504. package/indicators/tema.src.js +28 -75
  505. package/indicators/trendline.js +1 -1
  506. package/indicators/trendline.src.js +1 -1
  507. package/indicators/trix.js +4 -5
  508. package/indicators/trix.js.map +1 -1
  509. package/indicators/trix.src.js +8 -76
  510. package/indicators/volume-by-price.js +16 -16
  511. package/indicators/volume-by-price.js.map +1 -1
  512. package/indicators/volume-by-price.src.js +21 -3
  513. package/indicators/vwap.js +1 -1
  514. package/indicators/vwap.src.js +1 -1
  515. package/indicators/williams-r.js +5 -6
  516. package/indicators/williams-r.js.map +1 -1
  517. package/indicators/williams-r.src.js +41 -51
  518. package/indicators/wma.js +1 -1
  519. package/indicators/wma.src.js +1 -1
  520. package/indicators/zigzag.js +1 -1
  521. package/indicators/zigzag.src.js +1 -1
  522. package/modules/accessibility.d.ts +5 -0
  523. package/modules/accessibility.js +234 -216
  524. package/modules/accessibility.js.map +1 -1
  525. package/modules/accessibility.src.d.ts +5 -0
  526. package/modules/accessibility.src.js +9709 -8608
  527. package/modules/annotations-advanced.d.ts +30 -0
  528. package/modules/annotations-advanced.js +191 -165
  529. package/modules/annotations-advanced.js.map +1 -1
  530. package/modules/annotations-advanced.src.d.ts +30 -0
  531. package/modules/annotations-advanced.src.js +1578 -320
  532. package/modules/annotations.js +121 -107
  533. package/modules/annotations.js.map +1 -1
  534. package/modules/annotations.src.js +958 -229
  535. package/modules/arrow-symbols.js +1 -1
  536. package/modules/arrow-symbols.src.js +1 -1
  537. package/modules/boost-canvas.js +15 -15
  538. package/modules/boost-canvas.js.map +1 -1
  539. package/modules/boost-canvas.src.js +3 -3
  540. package/modules/boost.js +79 -79
  541. package/modules/boost.js.map +1 -1
  542. package/modules/boost.src.js +10 -9
  543. package/modules/broken-axis.js +1 -1
  544. package/modules/broken-axis.src.js +1 -1
  545. package/modules/bullet.js +1 -1
  546. package/modules/bullet.src.js +1 -1
  547. package/modules/coloraxis.js +24 -24
  548. package/modules/coloraxis.js.map +1 -1
  549. package/modules/coloraxis.src.js +69 -98
  550. package/modules/current-date-indicator.js +4 -4
  551. package/modules/current-date-indicator.js.map +1 -1
  552. package/modules/current-date-indicator.src.js +4 -4
  553. package/modules/cylinder.js +1 -1
  554. package/modules/cylinder.src.js +1 -1
  555. package/modules/data.js +19 -19
  556. package/modules/data.js.map +1 -1
  557. package/modules/data.src.js +9 -6
  558. package/modules/datagrouping.js +20 -20
  559. package/modules/datagrouping.js.map +1 -1
  560. package/modules/datagrouping.src.js +33 -19
  561. package/modules/debugger.js +1 -1
  562. package/modules/debugger.src.js +1 -1
  563. package/modules/dependency-wheel.js +11 -11
  564. package/modules/dependency-wheel.js.map +1 -1
  565. package/modules/dependency-wheel.src.js +4 -7
  566. package/modules/dotplot.js +1 -1
  567. package/modules/dotplot.src.js +1 -1
  568. package/modules/drag-panes.js +8 -8
  569. package/modules/drag-panes.js.map +1 -1
  570. package/modules/drag-panes.src.js +3 -3
  571. package/modules/draggable-points.js +1 -1
  572. package/modules/draggable-points.src.js +1 -1
  573. package/modules/drilldown.js +24 -24
  574. package/modules/drilldown.js.map +1 -1
  575. package/modules/drilldown.src.js +4 -4
  576. package/modules/dumbbell.js +17 -17
  577. package/modules/dumbbell.js.map +1 -1
  578. package/modules/dumbbell.src.js +4 -4
  579. package/modules/export-data.js +1 -1
  580. package/modules/export-data.js.map +1 -1
  581. package/modules/export-data.src.js +3 -3
  582. package/modules/exporting.js +39 -38
  583. package/modules/exporting.js.map +1 -1
  584. package/modules/exporting.src.js +98 -67
  585. package/modules/full-screen.js +1 -1
  586. package/modules/full-screen.src.js +1 -1
  587. package/modules/funnel.js +12 -12
  588. package/modules/funnel.js.map +1 -1
  589. package/modules/funnel.src.js +9 -6
  590. package/modules/funnel3d.js +1 -1
  591. package/modules/funnel3d.src.js +1 -1
  592. package/modules/gantt.js +217 -218
  593. package/modules/gantt.js.map +1 -1
  594. package/modules/gantt.src.js +167 -152
  595. package/modules/grid-axis.js +1 -1
  596. package/modules/grid-axis.src.js +1 -1
  597. package/modules/heatmap.js +39 -39
  598. package/modules/heatmap.js.map +1 -1
  599. package/modules/heatmap.src.js +177 -162
  600. package/modules/heikinashi.js +1 -1
  601. package/modules/heikinashi.src.js +4 -4
  602. package/modules/histogram-bellcurve.js +13 -13
  603. package/modules/histogram-bellcurve.js.map +1 -1
  604. package/modules/histogram-bellcurve.src.js +91 -86
  605. package/modules/hollowcandlestick.js +9 -9
  606. package/modules/hollowcandlestick.js.map +1 -1
  607. package/modules/hollowcandlestick.src.js +11 -11
  608. package/modules/item-series.js +1 -1
  609. package/modules/item-series.src.js +1 -1
  610. package/modules/lollipop.js +1 -1
  611. package/modules/lollipop.src.js +1 -1
  612. package/modules/map.d.ts +136 -14
  613. package/modules/map.js +142 -122
  614. package/modules/map.js.map +1 -1
  615. package/modules/map.src.d.ts +136 -14
  616. package/modules/map.src.js +2129 -1029
  617. package/modules/marker-clusters.js +36 -36
  618. package/modules/marker-clusters.js.map +1 -1
  619. package/modules/marker-clusters.src.js +173 -142
  620. package/modules/networkgraph.d.ts +12 -1
  621. package/modules/networkgraph.js +49 -49
  622. package/modules/networkgraph.js.map +1 -1
  623. package/modules/networkgraph.src.d.ts +12 -1
  624. package/modules/networkgraph.src.js +91 -43
  625. package/modules/no-data-to-display.js +5 -5
  626. package/modules/no-data-to-display.js.map +1 -1
  627. package/modules/no-data-to-display.src.js +3 -3
  628. package/modules/offline-exporting.js +17 -17
  629. package/modules/offline-exporting.js.map +1 -1
  630. package/modules/offline-exporting.src.js +13 -13
  631. package/modules/oldie-polyfills.js +1 -1
  632. package/modules/oldie-polyfills.src.js +1 -1
  633. package/modules/oldie.js +26 -26
  634. package/modules/oldie.js.map +1 -1
  635. package/modules/oldie.src.js +4 -4
  636. package/modules/organization.js +13 -13
  637. package/modules/organization.js.map +1 -1
  638. package/modules/organization.src.js +4 -4
  639. package/modules/overlapping-datalabels.js +1 -1
  640. package/modules/overlapping-datalabels.src.js +1 -1
  641. package/modules/parallel-coordinates.js +1 -1
  642. package/modules/parallel-coordinates.src.js +1 -1
  643. package/modules/pareto.js +7 -7
  644. package/modules/pareto.js.map +1 -1
  645. package/modules/pareto.src.js +89 -78
  646. package/modules/pathfinder.js +1 -1
  647. package/modules/pathfinder.src.js +1 -1
  648. package/modules/pattern-fill.js +1 -1
  649. package/modules/pattern-fill.src.js +1 -1
  650. package/modules/price-indicator.js +1 -1
  651. package/modules/price-indicator.src.js +1 -1
  652. package/modules/pyramid3d.js +1 -1
  653. package/modules/pyramid3d.src.js +1 -1
  654. package/modules/sankey.d.ts +12 -1
  655. package/modules/sankey.js +29 -29
  656. package/modules/sankey.js.map +1 -1
  657. package/modules/sankey.src.d.ts +12 -1
  658. package/modules/sankey.src.js +300 -176
  659. package/modules/series-label.js +1 -1
  660. package/modules/series-label.src.js +1 -1
  661. package/modules/solid-gauge.js +1 -1
  662. package/modules/solid-gauge.src.js +1 -1
  663. package/modules/sonification.js +59 -55
  664. package/modules/sonification.js.map +1 -1
  665. package/modules/sonification.src.js +3034 -2553
  666. package/modules/static-scale.js +1 -1
  667. package/modules/static-scale.src.js +1 -1
  668. package/modules/stock-tools.js +177 -164
  669. package/modules/stock-tools.js.map +1 -1
  670. package/modules/stock-tools.src.js +1001 -131
  671. package/modules/stock.d.ts +39 -6
  672. package/modules/stock.js +204 -196
  673. package/modules/stock.js.map +1 -1
  674. package/modules/stock.src.d.ts +39 -6
  675. package/modules/stock.src.js +1689 -1081
  676. package/modules/streamgraph.js +1 -1
  677. package/modules/streamgraph.src.js +1 -1
  678. package/modules/sunburst.js +61 -60
  679. package/modules/sunburst.js.map +1 -1
  680. package/modules/sunburst.src.js +329 -266
  681. package/modules/tilemap.js +17 -17
  682. package/modules/tilemap.js.map +1 -1
  683. package/modules/tilemap.src.js +3 -4
  684. package/modules/timeline.js +18 -18
  685. package/modules/timeline.js.map +1 -1
  686. package/modules/timeline.src.js +5 -5
  687. package/modules/treegrid.js +56 -57
  688. package/modules/treegrid.js.map +1 -1
  689. package/modules/treegrid.src.js +126 -120
  690. package/modules/treemap.js +41 -41
  691. package/modules/treemap.js.map +1 -1
  692. package/modules/treemap.src.js +319 -254
  693. package/modules/variable-pie.js +1 -1
  694. package/modules/variable-pie.src.js +1 -1
  695. package/modules/variwide.js +1 -1
  696. package/modules/variwide.src.js +1 -1
  697. package/modules/vector.js +1 -1
  698. package/modules/vector.src.js +1 -1
  699. package/modules/venn.js +31 -31
  700. package/modules/venn.js.map +1 -1
  701. package/modules/venn.src.js +731 -721
  702. package/modules/windbarb.js +15 -15
  703. package/modules/windbarb.js.map +1 -1
  704. package/modules/windbarb.src.js +90 -62
  705. package/modules/wordcloud.js +23 -24
  706. package/modules/wordcloud.js.map +1 -1
  707. package/modules/wordcloud.src.js +897 -949
  708. package/modules/xrange.js +2 -2
  709. package/modules/xrange.js.map +1 -1
  710. package/modules/xrange.src.js +2 -1
  711. package/package.json +1 -1
  712. package/themes/avocado.js +1 -1
  713. package/themes/avocado.src.js +1 -1
  714. package/themes/dark-blue.js +1 -1
  715. package/themes/dark-blue.src.js +1 -1
  716. package/themes/dark-green.js +1 -1
  717. package/themes/dark-green.src.js +1 -1
  718. package/themes/dark-unica.js +1 -1
  719. package/themes/dark-unica.src.js +1 -1
  720. package/themes/gray.js +1 -1
  721. package/themes/gray.src.js +1 -1
  722. package/themes/grid-light.js +1 -1
  723. package/themes/grid-light.src.js +1 -1
  724. package/themes/grid.js +1 -1
  725. package/themes/grid.src.js +1 -1
  726. package/themes/high-contrast-dark.js +1 -1
  727. package/themes/high-contrast-dark.src.js +1 -1
  728. package/themes/high-contrast-light.js +1 -1
  729. package/themes/high-contrast-light.src.js +1 -1
  730. package/themes/sand-signika.js +1 -1
  731. package/themes/sand-signika.src.js +1 -1
  732. package/themes/skies.js +1 -1
  733. package/themes/skies.src.js +1 -1
  734. package/themes/sunset.js +1 -1
  735. package/themes/sunset.src.js +1 -1
  736. package/es-modules/Core/Axis/MapAxis.js +0 -157
  737. package/es-modules/Core/Color/Palette.js +0 -82
  738. package/es-modules/Extensions/Sonification/InstrumentDefinitions.js +0 -32
  739. package/es-modules/Mixins/ColorMapSeries.js +0 -82
  740. package/es-modules/Mixins/ColorSeries.js +0 -77
  741. package/es-modules/Mixins/DerivedSeries.js +0 -118
  742. package/es-modules/Mixins/DrawPoint.js +0 -81
  743. package/es-modules/Mixins/IndicatorRequired.js +0 -56
  744. package/es-modules/Mixins/Navigation.js +0 -54
  745. package/es-modules/Mixins/NelderMead.js +0 -132
  746. package/es-modules/Mixins/Polygon.js +0 -259
  747. package/es-modules/Mixins/ReduceArray.js +0 -54
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highmaps JS v9.2.2 (2021-08-24)
2
+ * @license Highmaps JS v9.3.0 (2021-10-21)
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,1377 @@
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
+ * * `projection.name`,
2293
+ which as of v9.3 can be `EqualEarth`,
2294
+ `Miller`,
2295
+ * `Orthographic` or `WebMercator`.
2296
+ * * `rotation`,
2297
+ a three-axis rotation of the globe prior to projection,
2298
+ * which in practice can be used for example to render a world map with the
2299
+ * Americas centered (`[90, 0]`),
2300
+ or to rotate an orthographic projection.
2301
+ *
2302
+ * @type {object}
2303
+ * @sample {highmaps} maps/demo/topojson-projection
2304
+ * Orthographic projection
2305
+ */
2306
+ projection: void 0,
2307
+ /**
2308
+ * The zoom level of a map. Higher zoom levels means more zoomed in. An
2309
+ * increase of 1 zooms in to a quarter of the viewed area (half the width
2310
+ * and height). Defaults to fitting to the map bounds.
2311
+ *
2312
+ * In a `WebMercator` projection,
2313
+ a zoom level of 0 represents
2314
+ * the world in a 256x256 pixel square. This is a common concept for WMS
2315
+ * tiling software.
2316
+ *
2317
+ * @type {number|undefined}
2318
+ * @sample {highmaps} maps/mapview/center-zoom
2319
+ * Custom view of a world map
2320
+ * @sample {highmaps} maps/mapview/get-view
2321
+ * Report the current view of a preprojected map
2322
+ */
2323
+ zoom: void 0
2324
+ };
2325
+ /* *
2326
+ *
2327
+ * Default Export
2328
+ *
2329
+ * */
2330
+
2331
+ return defaultOptions;
2332
+ });
2333
+ _registerModule(_modules, 'Maps/Projections/EqualEarth.js', [], function () {
2334
+ /* *
2335
+ *
2336
+ * Equal Earth projection, an equal-area projection designed to minimize
2337
+ * distortion and remain pleasing to the eye.
2338
+ *
2339
+ * Invented by Bojan Šavrič, Bernhard Jenny, and Tom Patterson in 2018. It is
2340
+ * inspired by the widely used Robinson projection.
2341
+ *
2342
+ * */
2343
+ var A1 = 1.340264,
2344
+ A2 = -0.081106,
2345
+ A3 = 0.000893,
2346
+ A4 = 0.003796,
2347
+ M = Math.sqrt(3) / 2.0;
2348
+ var EqualEarth = {
2349
+ forward: function (lonLat) {
2350
+ var d = Math.PI / 180,
2351
+ paramLat = Math.asin(M * Math.sin(lonLat[1] * d)),
2352
+ paramLatSq = paramLat * paramLat,
2353
+ paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;
2354
+ var x = lonLat[0] * d * Math.cos(paramLat) / (M *
2355
+ (A1 +
2356
+ 3 * A2 * paramLatSq +
2357
+ paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq)));
2358
+ var y = paramLat * (A1 + A2 * paramLatSq + paramLatPow6 * (A3 + A4 * paramLatSq));
2359
+ return [x, y];
2360
+ },
2361
+ inverse: function (xy) {
2362
+ var d = 180 / Math.PI,
2363
+ epsilon = 1e-9,
2364
+ iterations = 12;
2365
+ var paramLat = xy[1],
2366
+ paramLatSq,
2367
+ paramLatPow6,
2368
+ fy,
2369
+ fpy,
2370
+ dlat,
2371
+ i;
2372
+ for (i = 0; i < iterations; ++i) {
2373
+ paramLatSq = paramLat * paramLat;
2374
+ paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;
2375
+ fy = paramLat * (A1 + A2 * paramLatSq + paramLatPow6 * (A3 + A4 * paramLatSq)) - xy[1];
2376
+ fpy = A1 + 3 * A2 * paramLatSq + paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq);
2377
+ paramLat -= dlat = fy / fpy;
2378
+ if (Math.abs(dlat) < epsilon) {
2379
+ break;
2380
+ }
2381
+ }
2382
+ paramLatSq = paramLat * paramLat;
2383
+ paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;
2384
+ var lon = d * M * xy[0] * (A1 + 3 * A2 * paramLatSq + paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq)) / Math.cos(paramLat);
2385
+ var lat = d * Math.asin(Math.sin(paramLat) / M);
2386
+ return [lon, lat];
2387
+ }
2388
+ };
2389
+
2390
+ return EqualEarth;
2391
+ });
2392
+ _registerModule(_modules, 'Maps/Projections/Miller.js', [], function () {
2393
+ /* *
2394
+ * Miller projection
2395
+ * */
2396
+ var quarterPI = Math.PI / 4;
2397
+ var deg2rad = Math.PI / 180;
2398
+ var Miller = {
2399
+ forward: function (lonLat) { return [
2400
+ lonLat[0] * deg2rad,
2401
+ 1.25 * Math.log(Math.tan(quarterPI + 0.4 * lonLat[1] * deg2rad))
2402
+ ]; },
2403
+ inverse: function (xy) { return [
2404
+ xy[0] / deg2rad,
2405
+ 2.5 * (Math.atan(Math.exp(0.8 * xy[1])) - quarterPI) / deg2rad
2406
+ ]; }
2407
+ };
2408
+
2409
+ return Miller;
2410
+ });
2411
+ _registerModule(_modules, 'Maps/Projections/Orthographic.js', [], function () {
2412
+ /* *
2413
+ * Orthographic projection
2414
+ * */
2415
+ var deg2rad = Math.PI / 180;
2416
+ var Orthographic = {
2417
+ forward: function (lonLat) {
2418
+ var lonDeg = lonLat[0],
2419
+ latDeg = lonLat[1];
2420
+ if (lonDeg < -90 || lonDeg > 90) {
2421
+ return [NaN, NaN];
2422
+ }
2423
+ var lat = latDeg * deg2rad;
2424
+ return [
2425
+ Math.cos(lat) * Math.sin(lonDeg * deg2rad),
2426
+ Math.sin(lat)
2427
+ ];
2428
+ },
2429
+ inverse: function (xy) {
2430
+ var x = xy[0],
2431
+ y = xy[1],
2432
+ z = Math.sqrt(x * x + y * y),
2433
+ c = Math.asin(z),
2434
+ cSin = Math.sin(c),
2435
+ cCos = Math.cos(c);
2436
+ return [
2437
+ Math.atan2(x * cSin, z * cCos) / deg2rad,
2438
+ Math.asin(z && y * cSin / z) / deg2rad
2439
+ ];
2440
+ }
2441
+ };
2442
+
2443
+ return Orthographic;
2444
+ });
2445
+ _registerModule(_modules, 'Maps/Projections/WebMercator.js', [], function () {
2446
+ /* *
2447
+ * Web Mercator projection, used for most online map tile services
2448
+ * */
2449
+ var maxLatitude = 85.0511287798; // The latitude that defines a square
2450
+ var r = 6378137;
2451
+ var deg2rad = Math.PI / 180;
2452
+ var WebMercator = {
2453
+ forward: function (lonLat) {
2454
+ if (Math.abs(lonLat[1]) > maxLatitude) {
2455
+ return [NaN,
2456
+ NaN];
2457
+ }
2458
+ var sinLat = Math.sin(lonLat[1] * deg2rad);
2459
+ return [
2460
+ r * lonLat[0] * deg2rad,
2461
+ r * Math.log((1 + sinLat) / (1 - sinLat)) / 2
2462
+ ];
2463
+ },
2464
+ inverse: function (xy) { return [
2465
+ xy[0] / (r * deg2rad),
2466
+ (2 * Math.atan(Math.exp(xy[1] / r)) - (Math.PI / 2)) / deg2rad
2467
+ ]; },
2468
+ maxLatitude: maxLatitude
2469
+ };
2470
+
2471
+ return WebMercator;
2472
+ });
2473
+ _registerModule(_modules, 'Maps/Projections/ProjectionRegistry.js', [_modules['Maps/Projections/EqualEarth.js'], _modules['Maps/Projections/Miller.js'], _modules['Maps/Projections/Orthographic.js'], _modules['Maps/Projections/WebMercator.js']], function (EqualEarth, Miller, Orthographic, WebMercator) {
2474
+ /* *
2475
+ *
2476
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2477
+ *
2478
+ * */
2479
+ var registry = {
2480
+ EqualEarth: EqualEarth,
2481
+ Miller: Miller,
2482
+ Orthographic: Orthographic,
2483
+ WebMercator: WebMercator
2484
+ };
2485
+
2486
+ return registry;
2487
+ });
2488
+ _registerModule(_modules, 'Maps/Projection.js', [_modules['Maps/Projections/ProjectionRegistry.js'], _modules['Core/Utilities.js']], function (registry, U) {
2489
+ /* *
2490
+ *
2491
+ * (c) 2021 Torstein Honsi
2492
+ *
2493
+ * License: www.highcharts.com/license
2494
+ *
2495
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2496
+ *
2497
+ * */
2498
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
2499
+ for (var s = 0,
2500
+ i = 0,
2501
+ il = arguments.length; i < il; i++) s += arguments[i].length;
2502
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
2503
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
2504
+ r[k] = a[j];
2505
+ return r;
2506
+ };
2507
+ var erase = U.erase;
2508
+ var deg2rad = Math.PI * 2 / 360;
2509
+ // Safe padding on either side of the antimeridian to avoid points being
2510
+ // projected to the wrong side of the plane
2511
+ var floatCorrection = 0.000001;
2512
+ // Keep longitude within -180 and 180. This is faster than using the modulo
2513
+ // operator, and preserves the distinction between -180 and 180.
2514
+ var wrapLon = function (lon) {
2515
+ // Replacing the if's with while would increase the range, but make it prone
2516
+ // to crashes on bad data
2517
+ if (lon < -180) {
2518
+ lon += 360;
2519
+ }
2520
+ if (lon > 180) {
2521
+ lon -= 360;
2522
+ }
2523
+ return lon;
2524
+ };
2525
+ var Projection = /** @class */ (function () {
2526
+ function Projection(options) {
2527
+ if (options === void 0) { options = {}; }
2528
+ // Whether the chart has points, lines or polygons given as coordinates
2529
+ // with positive up, as opposed to paths in the SVG plane with positive
2530
+ // down.
2531
+ this.hasCoordinates = false;
2532
+ // Whether the chart has true projection as opposed to pre-projected geojson
2533
+ // as in the legacy map collection.
2534
+ this.hasGeoProjection = false;
2535
+ this.maxLatitude = 90;
2536
+ this.options = options;
2537
+ var name = options.name,
2538
+ rotation = options.rotation;
2539
+ this.rotator = rotation ? this.getRotator(rotation) : void 0;
2540
+ this.def = name ? Projection.registry[name] : void 0;
2541
+ var _a = this,
2542
+ def = _a.def,
2543
+ rotator = _a.rotator;
2544
+ if (def) {
2545
+ this.maxLatitude = def.maxLatitude || 90;
2546
+ this.hasGeoProjection = true;
2547
+ }
2548
+ if (rotator && def) {
2549
+ this.forward = function (lonLat) {
2550
+ lonLat = rotator.forward(lonLat);
2551
+ return def.forward(lonLat);
2552
+ };
2553
+ this.inverse = function (xy) {
2554
+ var lonLat = def.inverse(xy);
2555
+ return rotator.inverse(lonLat);
2556
+ };
2557
+ }
2558
+ else if (def) {
2559
+ this.forward = def.forward;
2560
+ this.inverse = def.inverse;
2561
+ }
2562
+ else if (rotator) {
2563
+ this.forward = rotator.forward;
2564
+ this.inverse = rotator.inverse;
2565
+ }
2566
+ }
2567
+ // Add a projection definition to the registry, accessible by its `name`.
2568
+ Projection.add = function (name, definition) {
2569
+ Projection.registry[name] = definition;
2570
+ };
2571
+ // Calculate the great circle between two given coordinates
2572
+ Projection.greatCircle = function (point1, point2, inclusive) {
2573
+ var atan2 = Math.atan2,
2574
+ cos = Math.cos,
2575
+ sin = Math.sin,
2576
+ sqrt = Math.sqrt;
2577
+ var lat1 = point1[1] * deg2rad;
2578
+ var lon1 = point1[0] * deg2rad;
2579
+ var lat2 = point2[1] * deg2rad;
2580
+ var lon2 = point2[0] * deg2rad;
2581
+ var deltaLat = lat2 - lat1;
2582
+ var deltaLng = lon2 - lon1;
2583
+ var calcA = sin(deltaLat / 2) * sin(deltaLat / 2) +
2584
+ cos(lat1) * cos(lat2) * sin(deltaLng / 2) * sin(deltaLng / 2);
2585
+ var calcB = 2 * atan2(sqrt(calcA),
2586
+ sqrt(1 - calcA));
2587
+ var distance = calcB * 6371e3; // in meters
2588
+ var jumps = Math.round(distance / 500000); // 500 km each jump
2589
+ var lineString = [];
2590
+ if (inclusive) {
2591
+ lineString.push(point1);
2592
+ }
2593
+ if (jumps > 1) {
2594
+ var step = 1 / jumps;
2595
+ for (var fraction = step; fraction < 0.999; // Account for float errors
2596
+ fraction += step) {
2597
+ var A = sin((1 - fraction) * calcB) / sin(calcB);
2598
+ var B = sin(fraction * calcB) / sin(calcB);
2599
+ var x = A * cos(lat1) * cos(lon1) + B * cos(lat2) * cos(lon2);
2600
+ var y = A * cos(lat1) * sin(lon1) + B * cos(lat2) * sin(lon2);
2601
+ var z = A * sin(lat1) + B * sin(lat2);
2602
+ var lat3 = atan2(z,
2603
+ sqrt(x * x + y * y));
2604
+ var lon3 = atan2(y,
2605
+ x);
2606
+ lineString.push([lon3 / deg2rad, lat3 / deg2rad]);
2607
+ }
2608
+ }
2609
+ if (inclusive) {
2610
+ lineString.push(point2);
2611
+ }
2612
+ return lineString;
2613
+ };
2614
+ Projection.insertGreatCircles = function (poly) {
2615
+ var i = poly.length - 1;
2616
+ while (i--) {
2617
+ // Distance in degrees, either in lon or lat. Avoid heavy
2618
+ // calculation of true distance.
2619
+ var roughDistance = Math.max(Math.abs(poly[i][0] - poly[i + 1][0]),
2620
+ Math.abs(poly[i][1] - poly[i + 1][1]));
2621
+ if (roughDistance > 10) {
2622
+ var greatCircle = Projection.greatCircle(poly[i],
2623
+ poly[i + 1]);
2624
+ if (greatCircle.length) {
2625
+ poly.splice.apply(poly, __spreadArrays([i + 1, 0], greatCircle));
2626
+ }
2627
+ }
2628
+ }
2629
+ };
2630
+ Projection.toString = function (options) {
2631
+ var _a = options || {},
2632
+ name = _a.name,
2633
+ rotation = _a.rotation;
2634
+ return [name, rotation && rotation.join(',')].join(';');
2635
+ };
2636
+ /*
2637
+ * Take the rotation options and return the appropriate projection functions
2638
+ */
2639
+ Projection.prototype.getRotator = function (rotation) {
2640
+ var deltaLambda = rotation[0] * deg2rad,
2641
+ deltaPhi = (rotation[1] || 0) * deg2rad,
2642
+ deltaGamma = (rotation[2] || 0) * deg2rad;
2643
+ var cosDeltaPhi = Math.cos(deltaPhi),
2644
+ sinDeltaPhi = Math.sin(deltaPhi),
2645
+ cosDeltaGamma = Math.cos(deltaGamma),
2646
+ sinDeltaGamma = Math.sin(deltaGamma);
2647
+ if (deltaLambda === 0 && deltaPhi === 0 && deltaGamma === 0) {
2648
+ // Don't waste processing time
2649
+ return;
2650
+ }
2651
+ return {
2652
+ forward: function (lonLat) {
2653
+ // Lambda (lon) rotation
2654
+ var lon = lonLat[0] * deg2rad + deltaLambda;
2655
+ // Phi (lat) and gamma rotation
2656
+ var lat = lonLat[1] * deg2rad,
2657
+ cosLat = Math.cos(lat),
2658
+ x = Math.cos(lon) * cosLat,
2659
+ y = Math.sin(lon) * cosLat,
2660
+ sinLat = Math.sin(lat),
2661
+ k = sinLat * cosDeltaPhi + x * sinDeltaPhi;
2662
+ return [
2663
+ Math.atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - sinLat * sinDeltaPhi) / deg2rad,
2664
+ Math.asin(k * cosDeltaGamma + y * sinDeltaGamma) / deg2rad
2665
+ ];
2666
+ },
2667
+ inverse: function (rLonLat) {
2668
+ // Lambda (lon) unrotation
2669
+ var lon = rLonLat[0] * deg2rad;
2670
+ // Phi (lat) and gamma unrotation
2671
+ var lat = rLonLat[1] * deg2rad,
2672
+ cosLat = Math.cos(lat),
2673
+ x = Math.cos(lon) * cosLat,
2674
+ y = Math.sin(lon) * cosLat,
2675
+ sinLat = Math.sin(lat),
2676
+ k = sinLat * cosDeltaGamma - y * sinDeltaGamma;
2677
+ return [
2678
+ (Math.atan2(y * cosDeltaGamma + sinLat * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi) - deltaLambda) / deg2rad,
2679
+ Math.asin(k * cosDeltaPhi - x * sinDeltaPhi) / deg2rad
2680
+ ];
2681
+ }
2682
+ };
2683
+ };
2684
+ // Project a lonlat coordinate position to xy. Dynamically overridden when
2685
+ // projection is set.
2686
+ Projection.prototype.forward = function (lonLat) {
2687
+ return lonLat;
2688
+ };
2689
+ // Project an xy chart coordinate position to lonlat. Dynamically overridden
2690
+ // when projection is set.
2691
+ Projection.prototype.inverse = function (xy) {
2692
+ return xy;
2693
+ };
2694
+ Projection.prototype.clipOnAntimeridian = function (poly, isPolygon) {
2695
+ var antimeridian = 180;
2696
+ var intersections = [];
2697
+ var polygons = [poly];
2698
+ poly.forEach(function (lonLat, i) {
2699
+ var previousLonLat = poly[i - 1];
2700
+ if (!i) {
2701
+ if (!isPolygon) {
2702
+ return;
2703
+ }
2704
+ // Else, wrap to beginning
2705
+ previousLonLat = poly[poly.length - 1];
2706
+ }
2707
+ var lon1 = previousLonLat[0],
2708
+ lon2 = lonLat[0];
2709
+ if (
2710
+ // Both points, after rotating for antimeridian, are on the far
2711
+ // side of the Earth
2712
+ (lon1 < -90 || lon1 > 90) &&
2713
+ (lon2 < -90 || lon2 > 90) &&
2714
+ // ... and on either side of the plane
2715
+ (lon1 > 0) !== (lon2 > 0)) {
2716
+ // Interpolate to the intersection latitude
2717
+ var fraction = (antimeridian - previousLonLat[0]) /
2718
+ (lonLat[0] - previousLonLat[0]);
2719
+ var lat = previousLonLat[1] +
2720
+ fraction * (lonLat[1] - previousLonLat[1]);
2721
+ intersections.push({
2722
+ i: i,
2723
+ lat: lat,
2724
+ direction: lon1 < 0 ? 1 : -1,
2725
+ previousLonLat: previousLonLat,
2726
+ lonLat: lonLat
2727
+ });
2728
+ }
2729
+ });
2730
+ var polarIntersection;
2731
+ if (intersections.length) {
2732
+ if (isPolygon) {
2733
+ // Simplified use of the even-odd rule, if there is an odd
2734
+ // amount of intersections between the polygon and the
2735
+ // antimeridian, the pole is inside the polygon. Applies
2736
+ // primarily to Antarctica.
2737
+ if (intersections.length % 2 === 1) {
2738
+ polarIntersection = intersections.slice().sort(function (a, b) { return Math.abs(b.lat) - Math.abs(a.lat); })[0];
2739
+ erase(intersections, polarIntersection);
2740
+ }
2741
+ // Pull out slices of the polygon that is on the opposite side
2742
+ // of the antimeridian compared to the starting point
2743
+ var i = intersections.length - 2;
2744
+ while (i >= 0) {
2745
+ var index = intersections[i].i;
2746
+ var lonPlus = wrapLon(antimeridian +
2747
+ intersections[i].direction * floatCorrection);
2748
+ var lonMinus = wrapLon(antimeridian -
2749
+ intersections[i].direction * floatCorrection);
2750
+ var slice = poly.splice.apply(poly,
2751
+ __spreadArrays([index,
2752
+ intersections[i + 1].i - index],
2753
+ Projection.greatCircle([lonPlus,
2754
+ intersections[i].lat],
2755
+ [lonPlus,
2756
+ intersections[i + 1].lat],
2757
+ true)));
2758
+ // Add interpolated points close to the cut
2759
+ slice.push.apply(slice, Projection.greatCircle([lonMinus, intersections[i + 1].lat], [lonMinus, intersections[i].lat], true));
2760
+ polygons.push(slice);
2761
+ i -= 2;
2762
+ }
2763
+ // Insert dummy points close to the pole
2764
+ if (polarIntersection) {
2765
+ for (var i_1 = 0; i_1 < polygons.length; i_1++) {
2766
+ var poly_1 = polygons[i_1];
2767
+ var indexOf = poly_1.indexOf(polarIntersection.lonLat);
2768
+ if (indexOf > -1) {
2769
+ var polarLatitude = (polarIntersection.lat < 0 ? -1 : 1) *
2770
+ this.maxLatitude;
2771
+ var lon1 = wrapLon(antimeridian +
2772
+ polarIntersection.direction * floatCorrection);
2773
+ var lon2 = wrapLon(antimeridian -
2774
+ polarIntersection.direction * floatCorrection);
2775
+ var polarSegment = Projection.greatCircle([lon1,
2776
+ polarIntersection.lat],
2777
+ [lon1,
2778
+ polarLatitude],
2779
+ true).concat(Projection.greatCircle([lon2,
2780
+ polarLatitude],
2781
+ [lon2,
2782
+ polarIntersection.lat],
2783
+ true));
2784
+ poly_1.splice.apply(poly_1, __spreadArrays([indexOf,
2785
+ 0], polarSegment));
2786
+ break;
2787
+ }
2788
+ }
2789
+ }
2790
+ // Map lines, not closed
2791
+ }
2792
+ else {
2793
+ var i = intersections.length;
2794
+ while (i--) {
2795
+ var index = intersections[i].i;
2796
+ var slice = poly.splice(index,
2797
+ poly.length,
2798
+ // Add interpolated point close to the cut
2799
+ [
2800
+ wrapLon(antimeridian +
2801
+ intersections[i].direction * floatCorrection),
2802
+ intersections[i].lat
2803
+ ]);
2804
+ // Add interpolated point close to the cut
2805
+ slice.unshift([
2806
+ wrapLon(antimeridian -
2807
+ intersections[i].direction * floatCorrection),
2808
+ intersections[i].lat
2809
+ ]);
2810
+ polygons.push(slice);
2811
+ }
2812
+ }
2813
+ }
2814
+ // Insert great circles along the cuts
2815
+ /*
2816
+ if (isPolygon && polygons.length > 1 || polarIntersection) {
2817
+ polygons.forEach(Projection.insertGreatCircles);
2818
+ }
2819
+ */
2820
+ return polygons;
2821
+ };
2822
+ // Take a GeoJSON geometry and return a translated SVGPath
2823
+ Projection.prototype.path = function (geometry) {
2824
+ var _this = this;
2825
+ var _a = this,
2826
+ def = _a.def,
2827
+ rotator = _a.rotator;
2828
+ var antimeridian = 180;
2829
+ var path = [];
2830
+ var isPolygon = geometry.type === 'Polygon' ||
2831
+ geometry.type === 'MultiPolygon';
2832
+ // @todo: It doesn't really have to do with whether north is
2833
+ // positive. It depends on whether the coordinates are
2834
+ // pre-projected.
2835
+ var hasGeoProjection = this.hasGeoProjection;
2836
+ // @todo better test for when to do this
2837
+ var projectingToPlane = this.options.name !== 'Orthographic';
2838
+ // We need to rotate in a separate step before applying antimeridian
2839
+ // clipping
2840
+ var preclip = projectingToPlane ? rotator : void 0;
2841
+ var postclip = projectingToPlane ? (def || this) : this;
2842
+ var addToPath = function (polygon) {
2843
+ // Create a copy of the original coordinates. The copy applies a
2844
+ // correction of points close to the antimeridian in order to
2845
+ // prevent the points to be projected to the wrong side of the
2846
+ // plane. Float errors in topojson or in the projection may cause
2847
+ // that.
2848
+ var poly = polygon.map(function (lonLat) {
2849
+ if (projectingToPlane) {
2850
+ if (preclip) {
2851
+ lonLat = preclip.forward(lonLat);
2852
+ }
2853
+ var lon = lonLat[0];
2854
+ if (Math.abs(lon - antimeridian) < floatCorrection) {
2855
+ if (lon < antimeridian) {
2856
+ lon = antimeridian - floatCorrection;
2857
+ }
2858
+ else {
2859
+ lon = antimeridian + floatCorrection;
2860
+ }
2861
+ }
2862
+ lonLat = [lon, lonLat[1]];
2863
+ }
2864
+ return lonLat;
2865
+ });
2866
+ var polygons = [poly];
2867
+ if (hasGeoProjection) {
2868
+ // Insert great circles into long straight lines
2869
+ Projection.insertGreatCircles(poly);
2870
+ if (projectingToPlane) {
2871
+ polygons = _this.clipOnAntimeridian(poly, isPolygon);
2872
+ }
2873
+ }
2874
+ polygons.forEach(function (poly) {
2875
+ if (poly.length < 2) {
2876
+ return;
2877
+ }
2878
+ var movedTo = false;
2879
+ var firstValidLonLat;
2880
+ var lastValidLonLat;
2881
+ var gap = false;
2882
+ var pushToPath = function (point) {
2883
+ if (!movedTo) {
2884
+ path.push(['M',
2885
+ point[0],
2886
+ point[1]]);
2887
+ movedTo = true;
2888
+ }
2889
+ else {
2890
+ path.push(['L', point[0], point[1]]);
2891
+ }
2892
+ };
2893
+ for (var i = 0; i < poly.length; i++) {
2894
+ var lonLat = poly[i];
2895
+ var point = postclip.forward(lonLat);
2896
+ var valid = (!isNaN(point[0]) &&
2897
+ !isNaN(point[1]) &&
2898
+ (!hasGeoProjection ||
2899
+ // Limited projections like Web Mercator
2900
+ (lonLat[1] <= _this.maxLatitude &&
2901
+ lonLat[1] >= -_this.maxLatitude)));
2902
+ if (valid) {
2903
+ // In order to be able to interpolate if the first or
2904
+ // last point is invalid (on the far side of the globe
2905
+ // in an orthographic projection), we need to push the
2906
+ // first valid point to the end of the polygon.
2907
+ if (isPolygon && !firstValidLonLat) {
2908
+ firstValidLonLat = lonLat;
2909
+ poly.push(lonLat);
2910
+ }
2911
+ // When entering the first valid point after a gap of
2912
+ // invalid points, typically on the far side of the
2913
+ // globe in an orthographic projection.
2914
+ if (gap && lastValidLonLat) {
2915
+ // For areas, in an orthographic projection, the
2916
+ // great circle between two visible points will be
2917
+ // close to the horizon. A possible exception may be
2918
+ // when the two points are on opposite sides of the
2919
+ // globe. It that poses a problem, we may have to
2920
+ // rewrite this to use the small circle related to
2921
+ // the current lon0 and lat0.
2922
+ if (isPolygon && hasGeoProjection) {
2923
+ var greatCircle = Projection.greatCircle(lastValidLonLat,
2924
+ lonLat);
2925
+ greatCircle.forEach(function (lonLat) {
2926
+ return pushToPath(postclip.forward(lonLat));
2927
+ });
2928
+ // For lines, just jump over the gap
2929
+ }
2930
+ else {
2931
+ movedTo = false;
2932
+ }
2933
+ }
2934
+ pushToPath(point);
2935
+ lastValidLonLat = lonLat;
2936
+ gap = false;
2937
+ }
2938
+ else {
2939
+ gap = true;
2940
+ }
2941
+ }
2942
+ });
2943
+ };
2944
+ if (geometry.type === 'LineString') {
2945
+ addToPath(geometry.coordinates);
2946
+ }
2947
+ else if (geometry.type === 'MultiLineString') {
2948
+ geometry.coordinates.forEach(function (c) { return addToPath(c); });
2949
+ }
2950
+ else if (geometry.type === 'Polygon') {
2951
+ geometry.coordinates.forEach(function (c) { return addToPath(c); });
2952
+ if (path.length) {
2953
+ path.push(['Z']);
2954
+ }
2955
+ }
2956
+ else if (geometry.type === 'MultiPolygon') {
2957
+ geometry.coordinates.forEach(function (polygons) {
2958
+ polygons.forEach(function (c) { return addToPath(c); });
2959
+ });
2960
+ if (path.length) {
2961
+ path.push(['Z']);
2962
+ }
2963
+ }
2964
+ return path;
2965
+ };
2966
+ Projection.registry = registry;
2967
+ return Projection;
2968
+ }());
2969
+
2970
+ return Projection;
2971
+ });
2972
+ _registerModule(_modules, 'Maps/MapView.js', [_modules['Maps/MapViewOptionsDefault.js'], _modules['Maps/Projection.js'], _modules['Core/Utilities.js']], function (defaultOptions, Projection, U) {
2973
+ /* *
2974
+ *
2975
+ * (c) 2010-2020 Torstein Honsi
2976
+ *
2977
+ * License: www.highcharts.com/license
2978
+ *
2979
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
2980
+ *
2981
+ * */
2982
+ var addEvent = U.addEvent,
2983
+ clamp = U.clamp,
2984
+ fireEvent = U.fireEvent,
2985
+ isNumber = U.isNumber,
2986
+ merge = U.merge,
2987
+ pick = U.pick,
2988
+ relativeLength = U.relativeLength;
2989
+ /**
2990
+ * The world size equals meters in the Web Mercator projection, to match a
2991
+ * 256 square tile to zoom level 0
2992
+ */
2993
+ var worldSize = 40097932.2;
2994
+ var tileSize = 256;
2995
+ /**
2996
+ * The map view handles zooming and centering on the map, and various
2997
+ * client-side projection capabilities.
2998
+ *
2999
+ * On a chart instance, the map view is available as `chart.mapView`.
3000
+ *
3001
+ * @class
3002
+ * @name Highcharts.MapView
3003
+ *
3004
+ * @param {Highcharts.Chart} chart
3005
+ * The Chart instance
3006
+ * @param {Highcharts.MapViewOptions} options
3007
+ * MapView options
3008
+ */
3009
+ var MapView = /** @class */ (function () {
3010
+ function MapView(chart, options) {
3011
+ var _this = this;
3012
+ this.userOptions = options || {};
3013
+ var o = merge(defaultOptions,
3014
+ options);
3015
+ this.chart = chart;
3016
+ /**
3017
+ * The current center of the view in terms of `[longitude, latitude]`.
3018
+ * @name Highcharts.MapView#center
3019
+ * @readonly
3020
+ * @type {LonLatArray}
3021
+ */
3022
+ this.center = o.center;
3023
+ this.options = o;
3024
+ this.projection = new Projection(o.projection);
3025
+ /**
3026
+ * The current zoom level of the view.
3027
+ * @name Highcharts.MapView#zoom
3028
+ * @readonly
3029
+ * @type {number}
3030
+ */
3031
+ this.zoom = o.zoom || 0;
3032
+ // Initialize and respond to chart size changes
3033
+ addEvent(chart, 'afterSetChartSize', function () {
3034
+ if (_this.minZoom === void 0 || // When initializing the chart
3035
+ _this.minZoom === _this.zoom // When resizing the chart
3036
+ ) {
3037
+ _this.fitToBounds(void 0, void 0, false);
3038
+ if (isNumber(_this.userOptions.zoom)) {
3039
+ _this.zoom = _this.userOptions.zoom;
3040
+ }
3041
+ if (_this.userOptions.center) {
3042
+ merge(true, _this.center, _this.userOptions.center);
3043
+ }
3044
+ }
3045
+ });
3046
+ // Set up panning for maps. In orthographic projections the globe will
3047
+ // rotate, otherwise adjust the map center.
3048
+ var mouseDownCenterProjected;
3049
+ var mouseDownKey;
3050
+ var mouseDownRotation;
3051
+ var onPan = function (e) {
3052
+ var pinchDown = chart.pointer.pinchDown;
3053
+ var mouseDownX = chart.mouseDownX,
3054
+ mouseDownY = chart.mouseDownY;
3055
+ if (pinchDown.length === 1) {
3056
+ mouseDownX = pinchDown[0].chartX;
3057
+ mouseDownY = pinchDown[0].chartY;
3058
+ }
3059
+ if (typeof mouseDownX === 'number' &&
3060
+ typeof mouseDownY === 'number') {
3061
+ var key = mouseDownX + "," + mouseDownY, _a = e.originalEvent, chartX = _a.chartX, chartY = _a.chartY;
3062
+ // Reset starting position
3063
+ if (key !== mouseDownKey) {
3064
+ mouseDownKey = key;
3065
+ mouseDownCenterProjected = _this.projection
3066
+ .forward(_this.center);
3067
+ mouseDownRotation = (_this.projection.options.rotation || [0, 0]).slice();
3068
+ }
3069
+ // Panning rotates the globe
3070
+ if (_this.projection.options.name === 'Orthographic' &&
3071
+ // ... but don't rotate if we're loading only a part of the
3072
+ // world
3073
+ (_this.minZoom || Infinity) < 25.2) {
3074
+ // Empirical ratio where the globe rotates roughly the same
3075
+ // speed as moving the pointer across the center of the
3076
+ // projection
3077
+ var ratio = 28000 / (_this.getScale() * Math.min(chart.plotWidth,
3078
+ chart.plotHeight));
3079
+ if (mouseDownRotation) {
3080
+ var lon = (mouseDownX - chartX) * ratio -
3081
+ mouseDownRotation[0];
3082
+ var lat = clamp(-mouseDownRotation[1] -
3083
+ (mouseDownY - chartY) * ratio, -80, 80);
3084
+ _this.update({
3085
+ projection: {
3086
+ rotation: [-lon, -lat]
3087
+ },
3088
+ center: [lon, lat],
3089
+ zoom: _this.zoom
3090
+ }, true, false);
3091
+ }
3092
+ }
3093
+ else {
3094
+ var scale = _this.getScale();
3095
+ var newCenter = _this.projection.inverse([
3096
+ mouseDownCenterProjected[0] +
3097
+ (mouseDownX - chartX) / scale,
3098
+ mouseDownCenterProjected[1] -
3099
+ (mouseDownY - chartY) / scale
3100
+ ]);
3101
+ _this.setView(newCenter, void 0, true, false);
3102
+ }
3103
+ e.preventDefault();
3104
+ }
3105
+ };
3106
+ addEvent(chart, 'pan', onPan);
3107
+ addEvent(chart, 'touchpan', onPan);
3108
+ // Perform the map zoom by selection
3109
+ addEvent(chart, 'selection', function (evt) {
3110
+ // Zoom in
3111
+ if (!evt.resetSelection) {
3112
+ var x = evt.x - chart.plotLeft;
3113
+ var y = evt.y - chart.plotTop;
3114
+ var _a = _this.pixelsToProjectedUnits({ x: x,
3115
+ y: y }),
3116
+ y1 = _a.y,
3117
+ x1 = _a.x;
3118
+ var _b = _this.pixelsToProjectedUnits({ x: x + evt.width,
3119
+ y: y + evt.height }),
3120
+ y2 = _b.y,
3121
+ x2 = _b.x;
3122
+ _this.fitToBounds({ x1: x1, y1: y1, x2: x2, y2: y2 }, void 0, true, evt.originalEvent.touches ?
3123
+ // On touch zoom, don't animate, since we're already in
3124
+ // transformed zoom preview
3125
+ false :
3126
+ // On mouse zoom, obey the chart-level animation
3127
+ void 0);
3128
+ // Only for mouse. Touch users can pinch out.
3129
+ if (!/^touch/.test((evt.originalEvent.type))) {
3130
+ chart.showResetZoom();
3131
+ }
3132
+ evt.preventDefault();
3133
+ // Reset zoom
3134
+ }
3135
+ else {
3136
+ _this.zoomBy();
3137
+ }
3138
+ });
3139
+ }
3140
+ /**
3141
+ * Fit the view to given bounds
3142
+ *
3143
+ * @function Highcharts.MapView#fitToBounds
3144
+ * @param {Object} bounds
3145
+ * Bounds in terms of projected units given as `{ x1, y1, x2, y2 }`.
3146
+ * If not set, fit to the bounds of the current data set
3147
+ * @param {number|string} [padding=0]
3148
+ * Padding inside the bounds. A number signifies pixels, while a
3149
+ * percentage string (like `5%`) can be used as a fraction of the
3150
+ * plot area size.
3151
+ * @param {boolean} [redraw=true]
3152
+ * Whether to redraw the chart immediately
3153
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3154
+ * What animation to use for redraw
3155
+ */
3156
+ MapView.prototype.fitToBounds = function (bounds, padding, redraw, animation) {
3157
+ if (redraw === void 0) { redraw = true; }
3158
+ var b = bounds || this.getProjectedBounds();
3159
+ if (b) {
3160
+ var _a = this.chart,
3161
+ plotWidth = _a.plotWidth,
3162
+ plotHeight = _a.plotHeight,
3163
+ pad = pick(padding,
3164
+ bounds ? 0 : this.options.padding),
3165
+ paddingX = relativeLength(pad,
3166
+ plotWidth),
3167
+ paddingY = relativeLength(pad,
3168
+ plotHeight);
3169
+ var scaleToPlotArea = Math.max((b.x2 - b.x1) / ((plotWidth - paddingX) / tileSize), (b.y2 - b.y1) / ((plotHeight - paddingY) / tileSize));
3170
+ var zoom = Math.log(worldSize / scaleToPlotArea) / Math.log(2);
3171
+ // Reset minZoom when fitting to natural bounds
3172
+ if (!bounds) {
3173
+ this.minZoom = zoom;
3174
+ }
3175
+ var center = this.projection.inverse([
3176
+ (b.x2 + b.x1) / 2,
3177
+ (b.y2 + b.y1) / 2
3178
+ ]);
3179
+ this.setView(center, zoom, redraw, animation);
3180
+ }
3181
+ };
3182
+ MapView.prototype.getProjectedBounds = function () {
3183
+ var allBounds = this.chart.series.reduce(function (acc,
3184
+ s) {
3185
+ var bounds = s.getProjectedBounds && s.getProjectedBounds();
3186
+ if (bounds) {
3187
+ acc.push(bounds);
3188
+ }
3189
+ return acc;
3190
+ }, []);
3191
+ return MapView.compositeBounds(allBounds);
3192
+ };
3193
+ MapView.prototype.getScale = function () {
3194
+ // A zoom of 0 means the world (360x360 degrees) fits in a 256x256 px
3195
+ // tile
3196
+ return (tileSize / worldSize) * Math.pow(2, this.zoom);
3197
+ };
3198
+ MapView.prototype.redraw = function (animation) {
3199
+ this.chart.series.forEach(function (s) {
3200
+ if (s.useMapGeometry) {
3201
+ s.isDirty = true;
3202
+ }
3203
+ });
3204
+ this.chart.redraw(animation);
3205
+ };
3206
+ /**
3207
+ * Set the view to given center and zoom values.
3208
+ * @function Highcharts.MapView#setView
3209
+ * @param {Highcharts.LonLatArray|undefined} center
3210
+ * The center point
3211
+ * @param {number} zoom
3212
+ * The zoom level
3213
+ * @param {boolean} [redraw=true]
3214
+ * Whether to redraw immediately
3215
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3216
+ * Animation options for the redraw
3217
+ *
3218
+ * @sample maps/mapview/setview
3219
+ * Set the view programmatically
3220
+ */
3221
+ MapView.prototype.setView = function (center, zoom, redraw, animation) {
3222
+ if (redraw === void 0) { redraw = true; }
3223
+ var zoomingIn = false;
3224
+ if (center) {
3225
+ this.center = center;
3226
+ }
3227
+ if (typeof zoom === 'number') {
3228
+ if (typeof this.minZoom === 'number') {
3229
+ zoom = Math.max(zoom, this.minZoom);
3230
+ }
3231
+ if (typeof this.options.maxZoom === 'number') {
3232
+ zoom = Math.min(zoom, this.options.maxZoom);
3233
+ }
3234
+ zoomingIn = zoom > this.zoom;
3235
+ this.zoom = zoom;
3236
+ }
3237
+ // Stay within the data bounds
3238
+ var bounds = this.getProjectedBounds();
3239
+ if (bounds &&
3240
+ // When zooming in, we don't need to adjust to the bounds, as that
3241
+ // could shift the location under the mouse
3242
+ !zoomingIn) {
3243
+ var projectedCenter = this.projection.forward(this.center);
3244
+ var _a = this.chart,
3245
+ plotWidth = _a.plotWidth,
3246
+ plotHeight = _a.plotHeight;
3247
+ var scale = this.getScale();
3248
+ var bottomLeft = this.projectedUnitsToPixels({
3249
+ x: bounds.x1,
3250
+ y: bounds.y1
3251
+ });
3252
+ var topRight = this.projectedUnitsToPixels({
3253
+ x: bounds.x2,
3254
+ y: bounds.y2
3255
+ });
3256
+ var boundsCenterProjected = [
3257
+ (bounds.x1 + bounds.x2) / 2,
3258
+ (bounds.y1 + bounds.y2) / 2
3259
+ ];
3260
+ // Pixel coordinate system is reversed vs projected
3261
+ var x1 = bottomLeft.x;
3262
+ var y1 = topRight.y;
3263
+ var x2 = topRight.x;
3264
+ var y2 = bottomLeft.y;
3265
+ // Map smaller than plot area, center it
3266
+ if (x2 - x1 < plotWidth) {
3267
+ projectedCenter[0] = boundsCenterProjected[0];
3268
+ // Off west
3269
+ }
3270
+ else if (x1 < 0 && x2 < plotWidth) {
3271
+ // Adjust eastwards
3272
+ projectedCenter[0] += Math.max(x1, x2 - plotWidth) / scale;
3273
+ // Off east
3274
+ }
3275
+ else if (x2 > plotWidth && x1 > 0) {
3276
+ // Adjust westwards
3277
+ projectedCenter[0] += Math.min(x2 - plotWidth, x1) / scale;
3278
+ }
3279
+ // Map smaller than plot area, center it
3280
+ if (y2 - y1 < plotHeight) {
3281
+ projectedCenter[1] = boundsCenterProjected[1];
3282
+ // Off north
3283
+ }
3284
+ else if (y1 < 0 && y2 < plotHeight) {
3285
+ // Adjust southwards
3286
+ projectedCenter[1] -= Math.max(y1, y2 - plotHeight) / scale;
3287
+ // Off south
3288
+ }
3289
+ else if (y2 > plotHeight && y1 > 0) {
3290
+ // Adjust northwards
3291
+ projectedCenter[1] -= Math.min(y2 - plotHeight, y1) / scale;
3292
+ }
3293
+ this.center = this.projection.inverse(projectedCenter);
3294
+ }
3295
+ fireEvent(this, 'afterSetView');
3296
+ if (redraw) {
3297
+ this.redraw(animation);
3298
+ }
3299
+ };
3300
+ /**
3301
+ * Convert projected units to pixel position
3302
+ *
3303
+ * @function Highcharts.MapView#projectedUnitsToPixels
3304
+ * @param {Highcharts.PositionObject} pos
3305
+ * The position in projected units
3306
+ * @return {Highcharts.PositionObject} The position in pixels
3307
+ */
3308
+ MapView.prototype.projectedUnitsToPixels = function (pos) {
3309
+ var scale = this.getScale();
3310
+ var projectedCenter = this.projection.forward(this.center);
3311
+ var centerPxX = this.chart.plotWidth / 2;
3312
+ var centerPxY = this.chart.plotHeight / 2;
3313
+ var x = centerPxX - scale * (projectedCenter[0] - pos.x);
3314
+ var y = centerPxY + scale * (projectedCenter[1] - pos.y);
3315
+ return { x: x, y: y };
3316
+ };
3317
+ /**
3318
+ * Convert pixel position to projected units
3319
+ *
3320
+ * @function Highcharts.MapView#pixelsToProjectedUnits
3321
+ * @param {Highcharts.PositionObject} pos
3322
+ * The position in pixels
3323
+ * @return {Highcharts.PositionObject} The position in projected units
3324
+ */
3325
+ MapView.prototype.pixelsToProjectedUnits = function (pos) {
3326
+ var x = pos.x,
3327
+ y = pos.y;
3328
+ var scale = this.getScale();
3329
+ var projectedCenter = this.projection.forward(this.center);
3330
+ var centerPxX = this.chart.plotWidth / 2;
3331
+ var centerPxY = this.chart.plotHeight / 2;
3332
+ var projectedX = projectedCenter[0] + (x - centerPxX) / scale;
3333
+ var projectedY = projectedCenter[1] - (y - centerPxY) / scale;
3334
+ return { x: projectedX, y: projectedY };
3335
+ };
3336
+ /**
3337
+ * Update the view with given options
3338
+ *
3339
+ * @function Highcharts.MapView#update
3340
+ *
3341
+ * @param {Partial<Highcharts.MapViewOptions>} options
3342
+ * The new map view options to apply
3343
+ * @param {boolean} [redraw=true]
3344
+ * Whether to redraw immediately
3345
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3346
+ * The animation to apply to a the redraw
3347
+ */
3348
+ MapView.prototype.update = function (options, redraw, animation) {
3349
+ if (redraw === void 0) { redraw = true; }
3350
+ var newProjection = options.projection;
3351
+ var isDirtyProjection = newProjection && ((Projection.toString(newProjection) !==
3352
+ Projection.toString(this.options.projection)));
3353
+ merge(true, this.userOptions, options);
3354
+ merge(true, this.options, options);
3355
+ if (isDirtyProjection) {
3356
+ this.chart.series.forEach(function (series) {
3357
+ if (series.clearBounds) {
3358
+ series.clearBounds();
3359
+ }
3360
+ series.isDirty = true;
3361
+ series.isDirtyData = true;
3362
+ });
3363
+ this.projection = new Projection(this.options.projection);
3364
+ // Fit to natural bounds if center/zoom are not explicitly given
3365
+ if (!options.center && !isNumber(options.zoom)) {
3366
+ this.fitToBounds(void 0, void 0, false);
3367
+ }
3368
+ }
3369
+ if (options.center || isNumber(options.zoom)) {
3370
+ this.setView(this.options.center, options.zoom, false);
3371
+ }
3372
+ if (redraw) {
3373
+ this.chart.redraw(animation);
3374
+ }
3375
+ };
3376
+ /**
3377
+ * Zoom the map view by a given number
3378
+ *
3379
+ * @function Highcharts.MapView#zoomBy
3380
+ *
3381
+ * @param {number|undefined} [howMuch]
3382
+ * The amount of zoom to apply. 1 zooms in on half the current view,
3383
+ * -1 zooms out. Pass `undefined` to zoom to the full bounds of the
3384
+ * map.
3385
+ * @param {Highcharts.LonLatArray} [coords]
3386
+ * Optional map coordinates to keep fixed
3387
+ * @param {Array<number>} [chartCoords]
3388
+ * Optional chart coordinates to keep fixed, in pixels
3389
+ * @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation]
3390
+ * The animation to apply to a the redraw
3391
+ */
3392
+ MapView.prototype.zoomBy = function (howMuch, coords, chartCoords, animation) {
3393
+ var chart = this.chart;
3394
+ var projectedCenter = this.projection.forward(this.center);
3395
+ // let { x, y } = coords || {};
3396
+ var _a = coords ? this.projection.forward(coords) : [],
3397
+ x = _a[0],
3398
+ y = _a[1];
3399
+ if (typeof howMuch === 'number') {
3400
+ var zoom = this.zoom + howMuch;
3401
+ var center = void 0;
3402
+ // Keep chartX and chartY stationary - convert to lat and lng
3403
+ if (chartCoords) {
3404
+ var chartX = chartCoords[0],
3405
+ chartY = chartCoords[1];
3406
+ var scale = this.getScale();
3407
+ var offsetX = chartX - chart.plotLeft - chart.plotWidth / 2;
3408
+ var offsetY = chartY - chart.plotTop - chart.plotHeight / 2;
3409
+ x = projectedCenter[0] + offsetX / scale;
3410
+ y = projectedCenter[1] + offsetY / scale;
3411
+ }
3412
+ // Keep lon and lat stationary by adjusting the center
3413
+ if (typeof x === 'number' && typeof y === 'number') {
3414
+ var scale = 1 - Math.pow(2,
3415
+ this.zoom) / Math.pow(2,
3416
+ zoom);
3417
+ // const projectedCenter = this.projection.forward(this.center);
3418
+ var offsetX = projectedCenter[0] - x;
3419
+ var offsetY = projectedCenter[1] - y;
3420
+ projectedCenter[0] -= offsetX * scale;
3421
+ projectedCenter[1] += offsetY * scale;
3422
+ center = this.projection.inverse(projectedCenter);
3423
+ }
3424
+ this.setView(center, zoom, void 0, animation);
3425
+ // Undefined howMuch => reset zoom
3426
+ }
3427
+ else {
3428
+ this.fitToBounds(void 0, void 0, void 0, animation);
3429
+ }
3430
+ };
3431
+ /* *
3432
+ * Return the composite bounding box of a collection of bounding boxes
3433
+ */
3434
+ MapView.compositeBounds = function (arrayOfBounds) {
3435
+ if (arrayOfBounds.length) {
3436
+ return arrayOfBounds
3437
+ .slice(1)
3438
+ .reduce(function (acc, cur) {
3439
+ acc.x1 = Math.min(acc.x1, cur.x1);
3440
+ acc.y1 = Math.min(acc.y1, cur.y1);
3441
+ acc.x2 = Math.max(acc.x2, cur.x2);
3442
+ acc.y2 = Math.max(acc.y2, cur.y2);
3443
+ return acc;
3444
+ }, merge(arrayOfBounds[0]));
3445
+ }
3446
+ return;
3447
+ };
3448
+ return MapView;
3449
+ }());
3450
+
3451
+ return MapView;
3452
+ });
3453
+ _registerModule(_modules, 'Maps/MapSymbols.js', [_modules['Core/Renderer/SVG/SVGRenderer.js']], function (SVGRenderer) {
3454
+ /* *
3455
+ *
3456
+ * (c) 2010-2021 Torstein Honsi
3457
+ *
3458
+ * License: www.highcharts.com/license
3459
+ *
3460
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
3461
+ *
3462
+ * */
3463
+ var symbols = SVGRenderer.prototype.symbols;
3464
+ /* *
3465
+ *
3466
+ * Functions
3467
+ *
3468
+ * */
3469
+ /* eslint-disable require-jsdoc, valid-jsdoc */
3470
+ function bottomButton(x, y, w, h, options) {
3471
+ var r = (options && options.r) || 0;
3472
+ return selectiveRoundedRect(x - 1, y - 1, w, h, 0, 0, r, r);
3473
+ }
3474
+ /**
3475
+ * Create symbols for the zoom buttons
3476
+ * @private
3477
+ */
3478
+ function selectiveRoundedRect(x, y, w, h, rTopLeft, rTopRight, rBottomRight, rBottomLeft) {
3479
+ return [
3480
+ ['M', x + rTopLeft, y],
3481
+ // top side
3482
+ ['L', x + w - rTopRight, y],
3483
+ // top right corner
3484
+ ['C', x + w - rTopRight / 2, y, x + w, y + rTopRight / 2, x + w, y + rTopRight],
3485
+ // right side
3486
+ ['L', x + w, y + h - rBottomRight],
3487
+ // bottom right corner
3488
+ ['C', x + w, y + h - rBottomRight / 2, x + w - rBottomRight / 2, y + h, x + w - rBottomRight, y + h],
3489
+ // bottom side
3490
+ ['L', x + rBottomLeft, y + h],
3491
+ // bottom left corner
3492
+ ['C', x + rBottomLeft / 2, y + h, x, y + h - rBottomLeft / 2, x, y + h - rBottomLeft],
3493
+ // left side
3494
+ ['L', x, y + rTopLeft],
3495
+ // top left corner
2482
3496
  ['C', x, y + rTopLeft / 2, x + rTopLeft / 2, y, x + rTopLeft, y],
2483
3497
  ['Z']
2484
3498
  ];
@@ -2497,7 +3511,7 @@
2497
3511
 
2498
3512
  return symbols;
2499
3513
  });
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) {
3514
+ _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
3515
  /* *
2502
3516
  *
2503
3517
  * (c) 2010-2021 Torstein Honsi
@@ -2524,7 +3538,10 @@
2524
3538
  };
2525
3539
  })();
2526
3540
  var getOptions = D.getOptions;
2527
- var merge = U.merge,
3541
+ var addEvent = U.addEvent,
3542
+ clamp = U.clamp,
3543
+ isNumber = U.isNumber,
3544
+ merge = U.merge,
2528
3545
  pick = U.pick;
2529
3546
  /**
2530
3547
  * Map-optimized chart. Use {@link Highcharts.Chart|Chart} for common charts.
@@ -2559,19 +3576,11 @@
2559
3576
  * @fires Highcharts.MapChart#event:afterInit
2560
3577
  */
2561
3578
  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
- // */
3579
+ // Initialize the MapView after initialization, but before firstRender
3580
+ addEvent(this, 'afterInit', function () {
3581
+ this.mapView = new MapView(this, this.options.mapView);
3582
+ });
3583
+ var defaultCreditsOptions = getOptions().credits;
2575
3584
  var options = merge({
2576
3585
  chart: {
2577
3586
  panning: {
@@ -2585,19 +3594,13 @@
2585
3594
  '{geojson.copyrightShort}</a>'),
2586
3595
  mapTextFull: pick(defaultCreditsOptions.mapTextFull, '{geojson.copyright}')
2587
3596
  },
3597
+ mapView: {},
2588
3598
  tooltip: {
2589
3599
  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
3600
  }
2600
- });
3601
+ },
3602
+ userOptions // user's options
3603
+ );
2601
3604
  _super.prototype.init.call(this, options, callback);
2602
3605
  };
2603
3606
  return MapChart;
@@ -2691,7 +3694,7 @@
2691
3694
 
2692
3695
  return MapChart;
2693
3696
  });
2694
- _registerModule(_modules, 'Series/Map/MapPoint.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, SeriesRegistry, U) {
3697
+ _registerModule(_modules, 'Series/Map/MapPoint.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
2695
3698
  /* *
2696
3699
  *
2697
3700
  * (c) 2010-2021 Torstein Honsi
@@ -2717,7 +3720,6 @@
2717
3720
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2718
3721
  };
2719
3722
  })();
2720
- var colorMapPointMixin = ColorMapMixin.colorMapPointMixin;
2721
3723
  var ScatterSeries = SeriesRegistry.seriesTypes.scatter;
2722
3724
  var extend = U.extend;
2723
3725
  /* *
@@ -2747,6 +3749,22 @@
2747
3749
  *
2748
3750
  * */
2749
3751
  /* eslint-disable valid-jsdoc */
3752
+ // Get the projected path based on the geometry. May also be called on
3753
+ // mapData options (not point instances), hence static.
3754
+ MapPoint.getProjectedPath = function (point, projection) {
3755
+ if (!point.projectedPath) {
3756
+ if (projection && point.geometry) {
3757
+ // Always true when given GeoJSON coordinates
3758
+ projection.hasCoordinates = true;
3759
+ point.projectedPath = projection.path(point.geometry);
3760
+ // SVG path given directly in point options
3761
+ }
3762
+ else {
3763
+ point.projectedPath = point.path;
3764
+ }
3765
+ }
3766
+ return point.projectedPath || [];
3767
+ };
2750
3768
  /**
2751
3769
  * Extend the Point object to split paths.
2752
3770
  * @private
@@ -2765,11 +3783,6 @@
2765
3783
  mapPoint = typeof mapKey !== 'undefined' &&
2766
3784
  series.mapMap[mapKey];
2767
3785
  if (mapPoint) {
2768
- // This applies only to bubbles
2769
- if (series.xyFromShape) {
2770
- point.x = mapPoint._midX;
2771
- point.y = mapPoint._midY;
2772
- }
2773
3786
  extend(point, mapPoint); // copy over properties
2774
3787
  }
2775
3788
  else {
@@ -2803,19 +3816,16 @@
2803
3816
  * @function Highcharts.Point#zoomTo
2804
3817
  */
2805
3818
  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();
3819
+ var point = this;
3820
+ var chart = point.series.chart;
3821
+ if (chart.mapView && point.bounds) {
3822
+ chart.mapView.fitToBounds(point.bounds, void 0, false);
3823
+ point.series.isDirty = true;
3824
+ chart.redraw();
3825
+ }
2811
3826
  };
2812
3827
  return MapPoint;
2813
3828
  }(ScatterSeries.prototype.pointClass));
2814
- extend(MapPoint.prototype, {
2815
- dataLabelOnNull: colorMapPointMixin.dataLabelOnNull,
2816
- isValid: colorMapPointMixin.isValid,
2817
- moveToTopOnHover: colorMapPointMixin.moveToTopOnHover
2818
- });
2819
3829
  /* *
2820
3830
  *
2821
3831
  * Default Export
@@ -2824,7 +3834,7 @@
2824
3834
 
2825
3835
  return MapPoint;
2826
3836
  });
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) {
3837
+ _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
3838
  /* *
2829
3839
  *
2830
3840
  * (c) 2010-2021 Torstein Honsi
@@ -2850,7 +3860,8 @@
2850
3860
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2851
3861
  };
2852
3862
  })();
2853
- var colorMapSeriesMixin = ColorMapMixin.colorMapSeriesMixin;
3863
+ var animObject = A.animObject;
3864
+ var colorMapSeriesMixin = ColorMapComposition.colorMapSeriesMixin;
2854
3865
  var noop = H.noop;
2855
3866
  var maps = MapChart.maps,
2856
3867
  splitPath = MapChart.splitPath;
@@ -2890,12 +3901,6 @@
2890
3901
  * */
2891
3902
  var _this = _super !== null && _super.apply(this,
2892
3903
  arguments) || this;
2893
- /* *
2894
- *
2895
- * Properties
2896
- *
2897
- * */
2898
- _this.baseTrans = void 0;
2899
3904
  _this.chart = void 0;
2900
3905
  _this.data = void 0;
2901
3906
  _this.group = void 0;
@@ -2919,25 +3924,17 @@
2919
3924
  * @private
2920
3925
  */
2921
3926
  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;
3927
+ var _a = this,
3928
+ chart = _a.chart,
3929
+ group = _a.group,
3930
+ animation = animObject(this.options.animation);
2929
3931
  if (chart.renderer.isSVG) {
2930
- if (animation === true) {
2931
- animation = {
2932
- duration: 1000
2933
- };
2934
- }
2935
3932
  // Initialize the animation
2936
3933
  if (init) {
2937
3934
  // Scale down the group and place it in the center
2938
3935
  group.attr({
2939
- translateX: left + xAxis.len / 2,
2940
- translateY: top + yAxis.len / 2,
3936
+ translateX: chart.plotLeft + chart.plotWidth / 2,
3937
+ translateY: chart.plotTop + chart.plotHeight / 2,
2941
3938
  scaleX: 0.001,
2942
3939
  scaleY: 0.001
2943
3940
  });
@@ -2945,8 +3942,8 @@
2945
3942
  }
2946
3943
  else {
2947
3944
  group.animate({
2948
- translateX: left,
2949
- translateY: top,
3945
+ translateX: chart.plotLeft,
3946
+ translateY: chart.plotTop,
2950
3947
  scaleX: 1,
2951
3948
  scaleY: 1
2952
3949
  }, animation);
@@ -2954,36 +3951,35 @@
2954
3951
  }
2955
3952
  };
2956
3953
  /**
2957
- * Animate in the new series from the clicked point in the old series.
2958
- * Depends on the drilldown.js module
3954
+ * Animate in the new series. Depends on the drilldown.js module.
2959
3955
  * @private
2960
3956
  */
2961
3957
  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
- });
3958
+ var chart = this.chart,
3959
+ group = this.group;
3960
+ if (chart.renderer.isSVG) {
3961
+ // Initialize the animation
3962
+ if (init) {
3963
+ // Scale down the group and place it in the center. This is a
3964
+ // regression from <= v9.2, when it animated from the old point.
3965
+ group.attr({
3966
+ translateX: chart.plotLeft + chart.plotWidth / 2,
3967
+ translateY: chart.plotTop + chart.plotHeight / 2,
3968
+ scaleX: 0.1,
3969
+ scaleY: 0.1,
3970
+ opacity: 0.01
3971
+ });
3972
+ // Run the animation
3973
+ }
3974
+ else {
3975
+ group.animate({
3976
+ translateX: chart.plotLeft,
3977
+ translateY: chart.plotTop,
3978
+ scaleX: 1,
3979
+ scaleY: 1,
3980
+ opacity: 1
3981
+ });
3982
+ }
2987
3983
  }
2988
3984
  };
2989
3985
  /**
@@ -2991,8 +3987,17 @@
2991
3987
  * series and animate them into the origin point in the upper series.
2992
3988
  * @private
2993
3989
  */
2994
- MapSeries.prototype.animateDrillupFrom = function (level) {
2995
- ColumnSeries.prototype.animateDrillupFrom.call(this, level);
3990
+ MapSeries.prototype.animateDrillupFrom = function () {
3991
+ var chart = this.chart;
3992
+ if (chart.renderer.isSVG) {
3993
+ this.group.animate({
3994
+ translateX: chart.plotLeft + chart.plotWidth / 2,
3995
+ translateY: chart.plotTop + chart.plotHeight / 2,
3996
+ scaleX: 0.1,
3997
+ scaleY: 0.1,
3998
+ opacity: 0.01
3999
+ });
4000
+ }
2996
4001
  };
2997
4002
  /**
2998
4003
  * When drilling up, keep the upper series invisible until the lower series
@@ -3002,16 +4007,23 @@
3002
4007
  MapSeries.prototype.animateDrillupTo = function (init) {
3003
4008
  ColumnSeries.prototype.animateDrillupTo.call(this, init);
3004
4009
  };
4010
+ MapSeries.prototype.clearBounds = function () {
4011
+ this.points.forEach(function (point) {
4012
+ delete point.bounds;
4013
+ delete point.projectedPath;
4014
+ });
4015
+ delete this.bounds;
4016
+ };
3005
4017
  /**
3006
4018
  * Allow a quick redraw by just translating the area group. Used for zooming
3007
4019
  * and panning in capable browsers.
3008
4020
  * @private
3009
4021
  */
3010
4022
  MapSeries.prototype.doFullTranslate = function () {
3011
- return (this.isDirtyData ||
4023
+ return Boolean(this.isDirtyData ||
3012
4024
  this.chart.isResizing ||
3013
4025
  this.chart.renderer.isVML ||
3014
- !this.baseTrans);
4026
+ !this.hasRendered);
3015
4027
  };
3016
4028
  /**
3017
4029
  * Draw the data labels. Special for maps is the time that the data labels
@@ -3030,50 +4042,36 @@
3030
4042
  * @private
3031
4043
  */
3032
4044
  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;
4045
+ var _this = this;
4046
+ var _a = this,
4047
+ chart = _a.chart,
4048
+ group = _a.group,
4049
+ svgTransform = _a.svgTransform;
4050
+ var mapView = chart.mapView,
4051
+ renderer = chart.renderer;
3049
4052
  // Set a group that handles transform during zooming and panning in
3050
4053
  // 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;
4054
+ if (!this.transformGroup) {
4055
+ this.transformGroup = renderer.g().add(group);
4056
+ this.transformGroup.survive = true;
3059
4057
  }
3060
4058
  // Draw the shapes again
3061
- if (series.doFullTranslate()) {
4059
+ if (this.doFullTranslate()) {
3062
4060
  // Individual point actions.
3063
4061
  if (chart.hasRendered && !chart.styledMode) {
3064
- series.points.forEach(function (point) {
4062
+ this.points.forEach(function (point) {
3065
4063
  // Restore state color on update/redraw (#3529)
3066
4064
  if (point.shapeArgs) {
3067
- point.shapeArgs.fill = series.pointAttribs(point, point.state).fill;
4065
+ point.shapeArgs.fill = _this.pointAttribs(point, point.state).fill;
3068
4066
  }
3069
4067
  });
3070
4068
  }
3071
4069
  // Draw them in transformGroup
3072
- series.group = series.transformGroup;
3073
- ColumnSeries.prototype.drawPoints.apply(series);
3074
- series.group = group; // Reset
4070
+ this.group = this.transformGroup;
4071
+ ColumnSeries.prototype.drawPoints.apply(this);
4072
+ this.group = group; // Reset
3075
4073
  // Add class names
3076
- series.points.forEach(function (point) {
4074
+ this.points.forEach(function (point) {
3077
4075
  if (point.graphic) {
3078
4076
  var className = '';
3079
4077
  if (point.name) {
@@ -3092,47 +4090,16 @@
3092
4090
  }
3093
4091
  // In styled mode, apply point colors by CSS
3094
4092
  if (chart.styledMode) {
3095
- point.graphic.css(series.pointAttribs(point, point.selected && 'select' || void 0));
4093
+ point.graphic.css(_this.pointAttribs(point, point.selected && 'select' || void 0));
3096
4094
  }
3097
4095
  }
3098
4096
  });
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
4097
  }
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
- }
4098
+ // Apply the SVG transform
4099
+ if (mapView && svgTransform) {
4100
+ var strokeWidth_1 = pick(this.options[(this.pointAttrToOptions &&
4101
+ this.pointAttrToOptions['stroke-width']) || 'borderWidth'], 1 // Styled mode
4102
+ );
3136
4103
  /* Animate or move to the new zoom level. In order to prevent
3137
4104
  flickering as the different transform components are set out
3138
4105
  of sync (#5991), we run a fake animator attribute and set
@@ -3144,151 +4111,113 @@
3144
4111
  step for each property is performed in the same step. Also,
3145
4112
  for symbols and for transform properties, it should induce a
3146
4113
  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
4114
+ var scale_1 = svgTransform.scaleX;
4115
+ var flipFactor_1 = svgTransform.scaleY > 0 ? 1 : -1;
4116
+ var transformGroup_1 = this.transformGroup;
4117
+ if (renderer.globalAnimation && chart.hasRendered) {
4118
+ var startTranslateX_1 = Number(transformGroup_1.attr('translateX'));
4119
+ var startTranslateY_1 = Number(transformGroup_1.attr('translateY'));
4120
+ var startScale_1 = Number(transformGroup_1.attr('scaleX'));
4121
+ var step = function (now,
4122
+ fx) {
4123
+ var scaleStep = startScale_1 +
4124
+ (scale_1 - startScale_1) * fx.pos;
4125
+ transformGroup_1.attr({
4126
+ translateX: (startTranslateX_1 +
4127
+ (svgTransform.translateX - startTranslateX_1) * fx.pos),
4128
+ translateY: (startTranslateY_1 +
4129
+ (svgTransform.translateY - startTranslateY_1) * fx.pos),
4130
+ scaleX: scaleStep,
4131
+ scaleY: scaleStep * flipFactor_1
4132
+ });
4133
+ group.element.setAttribute('stroke-width', strokeWidth_1 / scaleStep);
4134
+ };
4135
+ transformGroup_1
3154
4136
  .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.
4137
+ .animate({ animator: 1 }, { step: step });
4138
+ // When dragging or first rendering, animation is off
3173
4139
  }
3174
4140
  else {
3175
- transformGroup.attr({
3176
- translateX: translateX,
3177
- translateY: translateY,
3178
- scaleX: scaleX,
3179
- scaleY: scaleY
3180
- });
4141
+ transformGroup_1.attr(svgTransform);
4142
+ // Set the stroke-width directly on the group element so the
4143
+ // children inherit it. We need to use setAttribute directly,
4144
+ // because the stroke-widthSetter method expects a stroke color
4145
+ // also to be set.
4146
+ group.element.setAttribute('stroke-width', strokeWidth_1 / scale_1);
3181
4147
  }
3182
4148
  }
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
4149
  this.drawMapDataLabels();
3193
4150
  };
3194
4151
  /**
3195
4152
  * Get the bounding box of all paths in the map combined.
3196
- * @private
4153
+ *
3197
4154
  */
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);
4155
+ MapSeries.prototype.getProjectedBounds = function () {
4156
+ if (!this.bounds) {
4157
+ var MAX_VALUE_1 = Number.MAX_VALUE,
4158
+ projection_1 = this.chart.mapView &&
4159
+ this.chart.mapView.projection,
4160
+ allBounds_1 = [];
4161
+ // Find the bounding box of each point
4162
+ (this.points || []).forEach(function (point) {
4163
+ if (point.path || point.geometry) {
4164
+ // @todo Try to puth these two conversions in
4165
+ // MapPoint.applyOptions
4166
+ if (typeof point.path === 'string') {
4167
+ point.path = splitPath(point.path);
4168
+ // Legacy one-dimensional array
4169
+ }
4170
+ else if (isArray(point.path) &&
4171
+ point.path[0] === 'M') {
4172
+ point.path = SVGRenderer.prototype.pathToSegments(point.path);
4173
+ }
4174
+ // The first time a map point is used, analyze its box
4175
+ if (!point.bounds) {
4176
+ var path = MapPoint.getProjectedPath(point,
4177
+ projection_1),
4178
+ properties = point.properties;
4179
+ var x2_1 = -MAX_VALUE_1,
4180
+ x1_1 = MAX_VALUE_1,
4181
+ y2_1 = -MAX_VALUE_1,
4182
+ y1_1 = MAX_VALUE_1,
4183
+ validBounds_1;
4184
+ path.forEach(function (seg) {
4185
+ var x = seg[seg.length - 2];
4186
+ var y = seg[seg.length - 1];
4187
+ if (typeof x === 'number' &&
4188
+ typeof y === 'number') {
4189
+ x1_1 = Math.min(x1_1, x);
4190
+ x2_1 = Math.max(x2_1, x);
4191
+ y1_1 = Math.min(y1_1, y);
4192
+ y2_1 = Math.max(y2_1, y);
4193
+ validBounds_1 = true;
4194
+ }
4195
+ });
4196
+ if (validBounds_1) {
4197
+ // Cache point bounding box for use to position data
4198
+ // labels, bubbles etc
4199
+ 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'];
4200
+ var middleYFraction = pick(point.middleY,
4201
+ isNumber(propMiddleY) ? propMiddleY : 0.5);
4202
+ // No geographic geometry, only path given => flip
4203
+ if (!point.geometry) {
4204
+ middleYFraction = 1 - middleYFraction;
4205
+ }
4206
+ var midY = y2_1 - (y2_1 - y1_1) * middleYFraction;
4207
+ point.bounds = { midX: midX, midY: midY, x1: x1_1, y1: y1_1, x2: x2_1, y2: y2_1 };
4208
+ point.labelrank = pick(point.labelrank,
4209
+ // Bigger shape, higher rank
4210
+ (x2_1 - x1_1) * (y2_1 - y1_1));
3234
4211
  }
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;
4212
+ }
4213
+ if (point.bounds) {
4214
+ allBounds_1.push(point.bounds);
4215
+ }
3248
4216
  }
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;
4217
+ });
4218
+ this.bounds = MapView.compositeBounds(allBounds_1);
3289
4219
  }
3290
- // Extremes for the mock Y axis
3291
- return { dataMin: this.minY, dataMax: this.maxY };
4220
+ return this.bounds;
3292
4221
  };
3293
4222
  /**
3294
4223
  * Define hasData function for non-cartesian series. Returns true if the
@@ -3305,35 +4234,31 @@
3305
4234
  * @private
3306
4235
  */
3307
4236
  MapSeries.prototype.pointAttribs = function (point, state) {
3308
- var attr = point.series.chart.styledMode ?
4237
+ var _a = point.series.chart,
4238
+ mapView = _a.mapView,
4239
+ styledMode = _a.styledMode;
4240
+ var attr = styledMode ?
3309
4241
  this.colorAttribs(point) :
3310
4242
  ColumnSeries.prototype.pointAttribs.call(this,
3311
4243
  point,
3312
4244
  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
- });
4245
+ // Individual stroke width
4246
+ var pointStrokeWidth = point.options[(this.pointAttrToOptions &&
4247
+ this.pointAttrToOptions['stroke-width']) || 'borderWidth'];
4248
+ if (pointStrokeWidth && mapView) {
4249
+ pointStrokeWidth /= mapView.getScale();
3333
4250
  }
3334
- else {
3335
- render.call(series);
4251
+ // In order for dash style to avoid being scaled, set the transformed
4252
+ // stroke width on the item
4253
+ if (attr.dashstyle && mapView && this.options.borderWidth) {
4254
+ pointStrokeWidth = this.options.borderWidth / mapView.getScale();
3336
4255
  }
4256
+ attr['stroke-width'] = pick(pointStrokeWidth,
4257
+ // By default set the stroke-width on the group element and let all
4258
+ // point graphics inherit. That way we don't have to iterate over
4259
+ // all points to update the stroke-width on zooming.
4260
+ 'inherit');
4261
+ return attr;
3337
4262
  };
3338
4263
  /**
3339
4264
  * Extend setData to join in mapData. If the allAreas option is true, all
@@ -3400,7 +4325,7 @@
3400
4325
  }
3401
4326
  });
3402
4327
  }
3403
- this.getBox(data);
4328
+ // this.getBox(data as any);
3404
4329
  // Pick up transform definitions for chart
3405
4330
  this.chart.mapTransforms = mapTransforms =
3406
4331
  chartOptions.mapTransforms ||
@@ -3445,7 +4370,7 @@
3445
4370
  });
3446
4371
  }
3447
4372
  if (options.allAreas) {
3448
- this.getBox(mapData);
4373
+ // this.getBox(mapData);
3449
4374
  data = data || [];
3450
4375
  // Registered the point codes that actually hold data
3451
4376
  if (joinBy[1]) {
@@ -3469,12 +4394,13 @@
3469
4394
  updatePoints = false;
3470
4395
  }
3471
4396
  });
3472
- }
3473
- else {
4397
+ } /* else {
3474
4398
  this.getBox(dataUsed); // Issue #4784
3475
- }
4399
+ } */
3476
4400
  }
3477
4401
  Series.prototype.setData.call(this, data, redraw, animation, updatePoints);
4402
+ this.processData();
4403
+ this.generatePoints();
3478
4404
  };
3479
4405
  /**
3480
4406
  * Extend setOptions by picking up the joinBy option and applying it to a
@@ -3502,85 +4428,56 @@
3502
4428
  */
3503
4429
  MapSeries.prototype.translate = function () {
3504
4430
  var series = this,
3505
- xAxis = series.xAxis,
3506
- yAxis = series.yAxis,
3507
- doFullTranslate = series.doFullTranslate();
3508
- series.generatePoints();
3509
- series.data.forEach(function (point) {
4431
+ doFullTranslate = series.doFullTranslate(),
4432
+ mapView = this.chart.mapView,
4433
+ projection = mapView && mapView.projection;
4434
+ // Recalculate box on updated data
4435
+ if (this.chart.hasRendered && (this.isDirtyData || !this.hasRendered)) {
4436
+ this.processData();
4437
+ this.generatePoints();
4438
+ delete this.bounds;
4439
+ this.getProjectedBounds();
4440
+ }
4441
+ // Calculate the SVG transform
4442
+ var svgTransform;
4443
+ if (mapView) {
4444
+ var scale = mapView.getScale();
4445
+ var _a = mapView.projection.forward(mapView.center),
4446
+ x = _a[0],
4447
+ y = _a[1];
4448
+ // When dealing with unprojected coordinates, y axis is flipped.
4449
+ var flipFactor = mapView.projection.hasCoordinates ? -1 : 1;
4450
+ var translateX = this.chart.plotWidth / 2 - x * scale;
4451
+ var translateY = this.chart.plotHeight / 2 - y * scale * flipFactor;
4452
+ svgTransform = {
4453
+ scaleX: scale,
4454
+ scaleY: scale * flipFactor,
4455
+ translateX: translateX,
4456
+ translateY: translateY
4457
+ };
4458
+ this.svgTransform = svgTransform;
4459
+ }
4460
+ series.points.forEach(function (point) {
3510
4461
  // Record the middle point (loosely based on centroid),
3511
4462
  // 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);
4463
+ if (svgTransform &&
4464
+ point.bounds &&
4465
+ isNumber(point.bounds.midX) &&
4466
+ isNumber(point.bounds.midY)) {
4467
+ point.plotX = point.bounds.midX * svgTransform.scaleX +
4468
+ svgTransform.translateX;
4469
+ point.plotY = point.bounds.midY * svgTransform.scaleY +
4470
+ svgTransform.translateY;
3515
4471
  }
3516
4472
  if (doFullTranslate) {
3517
4473
  point.shapeType = 'path';
3518
4474
  point.shapeArgs = {
3519
- d: series.translatePath(point.path)
4475
+ d: MapPoint.getProjectedPath(point, projection)
3520
4476
  };
3521
4477
  }
3522
4478
  });
3523
4479
  fireEvent(series, 'afterTranslate');
3524
4480
  };
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
4481
  /**
3585
4482
  * The map series is used for basic choropleth maps, where each map area has
3586
4483
  * a color based on its value.
@@ -3626,7 +4523,7 @@
3626
4523
  *
3627
4524
  * @private
3628
4525
  */
3629
- nullColor: palette.neutralColor3,
4526
+ nullColor: "#f7f7f7" /* neutralColor3 */,
3630
4527
  /**
3631
4528
  * Whether to allow pointer interaction like tooltips and mouse events
3632
4529
  * on null points.
@@ -3680,7 +4577,7 @@
3680
4577
  *
3681
4578
  * @private
3682
4579
  */
3683
- borderColor: palette.neutralColor20,
4580
+ borderColor: "#cccccc" /* neutralColor20 */,
3684
4581
  /**
3685
4582
  * The border width of each map area.
3686
4583
  *
@@ -3811,11 +4708,11 @@
3811
4708
  select: {
3812
4709
  /**
3813
4710
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
3814
- * @default ${palette.neutralColor20}
4711
+ * @default #cccccc
3815
4712
  * @product highmaps
3816
4713
  * @apioption plotOptions.series.states.select.color
3817
4714
  */
3818
- color: palette.neutralColor20
4715
+ color: "#cccccc" /* neutralColor20 */
3819
4716
  },
3820
4717
  inactive: {
3821
4718
  opacity: 1
@@ -3826,9 +4723,8 @@
3826
4723
  }(ScatterSeries));
3827
4724
  extend(MapSeries.prototype, {
3828
4725
  type: 'map',
3829
- axisTypes: colorMapSeriesMixin.axisTypes,
3830
- colorAttribs: colorMapSeriesMixin.colorAttribs,
3831
- colorKey: colorMapSeriesMixin.colorKey,
4726
+ axisTypes: ['colorAxis'],
4727
+ colorKey: 'value',
3832
4728
  // When tooltip is not shared, this series (and derivatives) requires
3833
4729
  // direct touch/hover. KD-tree does not apply.
3834
4730
  directTouch: true,
@@ -3839,8 +4735,10 @@
3839
4735
  drawGraph: noop,
3840
4736
  drawLegendSymbol: LegendSymbol.drawRectangle,
3841
4737
  forceDL: true,
4738
+ getCenter: CU.getCenter,
3842
4739
  getExtremesFromAll: true,
3843
- getSymbol: colorMapSeriesMixin.getSymbol,
4740
+ getSymbol: noop,
4741
+ isCartesian: false,
3844
4742
  parallelArrays: colorMapSeriesMixin.parallelArrays,
3845
4743
  pointArrayMap: colorMapSeriesMixin.pointArrayMap,
3846
4744
  pointClass: MapPoint,
@@ -3851,6 +4749,7 @@
3851
4749
  // Get axis extremes from paths, not values
3852
4750
  useMapGeometry: true
3853
4751
  });
4752
+ ColorMapComposition.compose(MapSeries, MapPoint);
3854
4753
  SeriesRegistry.registerSeriesType('map', MapSeries);
3855
4754
  /* *
3856
4755
  *
@@ -3863,8 +4762,8 @@
3863
4762
  *
3864
4763
  * */
3865
4764
  /**
3866
- * A map data object containing a `path` definition and optionally additional
3867
- * properties to join in the data as per the `joinBy` option.
4765
+ * A map data object containing a `geometry` or `path` definition and optionally
4766
+ * additional properties to join in the `data` as per the `joinBy` option.
3868
4767
  *
3869
4768
  * @sample maps/demo/category-map/
3870
4769
  * Map data and joinBy
@@ -3955,6 +4854,45 @@
3955
4854
  * @product highmaps
3956
4855
  * @apioption series.map.data.drilldown
3957
4856
  */
4857
+ /**
4858
+ * For map and mapline series types, the geometry of a point.
4859
+ *
4860
+ * To achieve a better separation between the structure and the data,
4861
+ * it is recommended to use `mapData` to define the geometry instead
4862
+ * of defining it on the data points themselves.
4863
+ *
4864
+ * The geometry object is compatible to that of a `feature` in geoJSON, so
4865
+ * features of geoJSON can be passed directly into the `data`, optionally
4866
+ * after first filtering and processing it.
4867
+ *
4868
+ * @sample maps/series/data-geometry/
4869
+ * Geometry defined in data
4870
+ *
4871
+ * @type {Object}
4872
+ * @since 9.3.0
4873
+ * @product highmaps
4874
+ * @apioption series.map.data.geometry
4875
+ */
4876
+ /**
4877
+ * The geometry type. Can be one of `LineString`, `Polygon`, `MultiLineString`
4878
+ * or `MultiPolygon`.
4879
+ *
4880
+ * @type {string}
4881
+ * @since 9.3.0
4882
+ * @product highmaps
4883
+ * @validvalue ["LineString", "Polygon", "MultiLineString", "MultiPolygon"]
4884
+ * @apioption series.map.data.geometry.type
4885
+ */
4886
+ /**
4887
+ * The geometry coordinates in terms of arrays of `[longitude, latitude]`, or
4888
+ * a two dimensional array of the same. The dimensionality must comply with the
4889
+ * `type`.
4890
+ *
4891
+ * @type {Array<LonLatArray>|Array<Array<LonLatArray>>}
4892
+ * @since 9.3.0
4893
+ * @product highmaps
4894
+ * @apioption series.map.data.geometry.coordinates
4895
+ */
3958
4896
  /**
3959
4897
  * An id for the point. This can be used after render time to get a
3960
4898
  * pointer to the point object through `chart.get()`.
@@ -4257,7 +5195,8 @@
4257
5195
  };
4258
5196
  })();
4259
5197
  var ScatterSeries = SeriesRegistry.seriesTypes.scatter;
4260
- var merge = U.merge;
5198
+ var isNumber = U.isNumber,
5199
+ merge = U.merge;
4261
5200
  /* *
4262
5201
  *
4263
5202
  * Class
@@ -4292,6 +5231,10 @@
4292
5231
  options);
4293
5232
  return _super.prototype.applyOptions.call(this, mergedOptions, x);
4294
5233
  };
5234
+ MapPointPoint.prototype.isValid = function () {
5235
+ return Boolean(this.options.geometry ||
5236
+ (isNumber(this.x) && isNumber(this.y)));
5237
+ };
4295
5238
  return MapPointPoint;
4296
5239
  }(ScatterSeries.prototype.pointClass));
4297
5240
  /* *
@@ -4302,7 +5245,7 @@
4302
5245
 
4303
5246
  return MapPointPoint;
4304
5247
  });
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) {
5248
+ _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
5249
  /* *
4307
5250
  *
4308
5251
  * (c) 2010-2021 Torstein Honsi
@@ -4328,8 +5271,11 @@
4328
5271
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4329
5272
  };
4330
5273
  })();
5274
+ var noop = H.noop;
4331
5275
  var ScatterSeries = SeriesRegistry.seriesTypes.scatter;
4332
5276
  var extend = U.extend,
5277
+ fireEvent = U.fireEvent,
5278
+ isNumber = U.isNumber,
4333
5279
  merge = U.merge;
4334
5280
  /* *
4335
5281
  *
@@ -4376,6 +5322,56 @@
4376
5322
  this.dataLabelsGroup.clip(this.chart.clipRect);
4377
5323
  }
4378
5324
  };
5325
+ MapPointSeries.prototype.translate = function () {
5326
+ var _this = this;
5327
+ var mapView = this.chart.mapView;
5328
+ if (!this.processedXData) {
5329
+ this.processData();
5330
+ }
5331
+ this.generatePoints();
5332
+ // Create map based translation
5333
+ if (mapView) {
5334
+ var _a = mapView.projection,
5335
+ forward_1 = _a.forward,
5336
+ hasCoordinates_1 = _a.hasCoordinates;
5337
+ this.points.forEach(function (p) {
5338
+ var _a = p.x,
5339
+ x = _a === void 0 ? void 0 : _a,
5340
+ _b = p.y,
5341
+ y = _b === void 0 ? void 0 : _b;
5342
+ var geometry = p.options.geometry,
5343
+ coordinates = (geometry &&
5344
+ geometry.type === 'Point' &&
5345
+ geometry.coordinates);
5346
+ if (coordinates) {
5347
+ var xy = forward_1(coordinates);
5348
+ x = xy[0];
5349
+ y = xy[1];
5350
+ // Map bubbles getting geometry from shape
5351
+ }
5352
+ else if (p.bounds) {
5353
+ x = p.bounds.midX;
5354
+ y = p.bounds.midY;
5355
+ }
5356
+ if (isNumber(x) && isNumber(y)) {
5357
+ var plotCoords = mapView.projectedUnitsToPixels({ x: x,
5358
+ y: y });
5359
+ p.plotX = plotCoords.x;
5360
+ p.plotY = hasCoordinates_1 ?
5361
+ plotCoords.y :
5362
+ _this.chart.plotHeight - plotCoords.y;
5363
+ }
5364
+ else {
5365
+ p.plotX = void 0;
5366
+ p.plotY = void 0;
5367
+ }
5368
+ p.isInside = _this.isPointInside(p);
5369
+ // Find point zone
5370
+ p.zone = _this.zones.length ? p.getZone() : void 0;
5371
+ });
5372
+ }
5373
+ fireEvent(this, 'afterTranslate');
5374
+ };
4379
5375
  /**
4380
5376
  * A mappoint series is a special form of scatter series where the points
4381
5377
  * can be laid out in map coordinates on top of a map.
@@ -4398,7 +5394,7 @@
4398
5394
  overflow: false,
4399
5395
  style: {
4400
5396
  /** @internal */
4401
- color: palette.neutralColor100
5397
+ color: "#000000" /* neutralColor100 */
4402
5398
  }
4403
5399
  }
4404
5400
  });
@@ -4406,8 +5402,11 @@
4406
5402
  }(ScatterSeries));
4407
5403
  extend(MapPointSeries.prototype, {
4408
5404
  type: 'mappoint',
5405
+ axisTypes: ['colorAxis'],
4409
5406
  forceDL: true,
4410
- pointClass: MapPointPoint
5407
+ isCartesian: false,
5408
+ pointClass: MapPointPoint,
5409
+ searchPoint: noop
4411
5410
  });
4412
5411
  SeriesRegistry.registerSeriesType('mappoint', MapPointSeries);
4413
5412
  /* *
@@ -4479,6 +5478,42 @@
4479
5478
  * @product highmaps
4480
5479
  * @apioption series.mappoint.data
4481
5480
  */
5481
+ /**
5482
+ * The geometry of a point.
5483
+ *
5484
+ * To achieve a better separation between the structure and the data,
5485
+ * it is recommended to use `mapData` to define the geometry instead
5486
+ * of defining it on the data points themselves.
5487
+ *
5488
+ * The geometry object is compatible to that of a `feature` in geoJSON, so
5489
+ * features of geoJSON can be passed directly into the `data`, optionally
5490
+ * after first filtering and processing it.
5491
+ *
5492
+ * @sample maps/series/data-geometry/
5493
+ * geometry defined in data
5494
+ *
5495
+ * @type {Object}
5496
+ * @since 9.3.0
5497
+ * @product highmaps
5498
+ * @apioption series.mappoint.data.geometry
5499
+ */
5500
+ /**
5501
+ * The geometry type, which in case of the `mappoint` series is always `Point`.
5502
+ *
5503
+ * @type {string}
5504
+ * @since 9.3.0
5505
+ * @product highmaps
5506
+ * @validvalue ["Point"]
5507
+ * @apioption series.mappoint.data.geometry.type
5508
+ */
5509
+ /**
5510
+ * The geometry coordinates in terms of `[longitude, latitude]`.
5511
+ *
5512
+ * @type {Highcharts.LonLatArray}
5513
+ * @since 9.3.0
5514
+ * @product highmaps
5515
+ * @apioption series.mappoint.data.geometry.coordinates
5516
+ */
4482
5517
  /**
4483
5518
  * The latitude of the point. Must be combined with the `lon` option
4484
5519
  * to work. Overrides `x` and `y` values.
@@ -4527,7 +5562,7 @@
4527
5562
 
4528
5563
  return MapPointSeries;
4529
5564
  });
4530
- _registerModule(_modules, 'Series/Bubble/BubbleLegendDefaults.js', [_modules['Core/Color/Palette.js']], function (Palette) {
5565
+ _registerModule(_modules, 'Series/Bubble/BubbleLegendDefaults.js', [], function () {
4531
5566
  /* *
4532
5567
  *
4533
5568
  * (c) 2010-2021 Highsoft AS
@@ -4700,7 +5735,7 @@
4700
5735
  /** @ignore-option */
4701
5736
  fontSize: '10px',
4702
5737
  /** @ignore-option */
4703
- color: Palette.neutralColor100
5738
+ color: "#000000" /* neutralColor100 */
4704
5739
  },
4705
5740
  /**
4706
5741
  * The x position offset of the label relative to the
@@ -5286,8 +6321,9 @@
5286
6321
  plotSizeX = chart.plotSizeX,
5287
6322
  plotSizeY = chart.plotSizeY,
5288
6323
  bubbleSeries = chart.series[this.options.seriesIndex],
5289
- minSize = Math.ceil(bubbleSeries.minPxSize),
5290
- maxPxSize = Math.ceil(bubbleSeries.maxPxSize),
6324
+ pxSizes = bubbleSeries.getPxExtremes(),
6325
+ minSize = Math.ceil(pxSizes.minPxSize),
6326
+ maxPxSize = Math.ceil(pxSizes.maxPxSize),
5291
6327
  plotSize = Math.min(plotSizeY,
5292
6328
  plotSizeX);
5293
6329
  var calculatedSize,
@@ -5338,11 +6374,12 @@
5338
6374
  var legend = this.legend,
5339
6375
  chart = this.chart,
5340
6376
  bubbleSeries = chart.series[this.options.seriesIndex],
5341
- bubbleSeriesSize = bubbleSeries.maxPxSize,
6377
+ pxSizes = bubbleSeries.getPxExtremes(),
6378
+ bubbleSeriesSize = pxSizes.maxPxSize,
5342
6379
  bubbleLegendSize = this.options.maxSize;
5343
6380
  if (Math.abs(Math.ceil(bubbleSeriesSize) - bubbleLegendSize) >
5344
6381
  1) {
5345
- this.updateRanges(this.options.minSize, bubbleSeries.maxPxSize);
6382
+ this.updateRanges(this.options.minSize, pxSizes.maxPxSize);
5346
6383
  legend.render();
5347
6384
  }
5348
6385
  };
@@ -5717,6 +6754,11 @@
5717
6754
  };
5718
6755
  return BubblePoint;
5719
6756
  }(ScatterPoint));
6757
+ /* *
6758
+ *
6759
+ * Class Prototype
6760
+ *
6761
+ * */
5720
6762
  extend(BubblePoint.prototype, {
5721
6763
  ttBelow: false
5722
6764
  });
@@ -5759,14 +6801,14 @@
5759
6801
  var _a = SeriesRegistry.seriesTypes,
5760
6802
  ColumnSeries = _a.column,
5761
6803
  ScatterSeries = _a.scatter;
5762
- var arrayMax = U.arrayMax,
6804
+ var addEvent = U.addEvent,
6805
+ arrayMax = U.arrayMax,
5763
6806
  arrayMin = U.arrayMin,
5764
6807
  clamp = U.clamp,
5765
6808
  extend = U.extend,
5766
6809
  isNumber = U.isNumber,
5767
6810
  merge = U.merge,
5768
- pick = U.pick,
5769
- pInt = U.pInt;
6811
+ pick = U.pick;
5770
6812
  /* *
5771
6813
  *
5772
6814
  * Class
@@ -5836,20 +6878,49 @@
5836
6878
  * the axis needs to add padding in accordance with the point sizes.
5837
6879
  * @private
5838
6880
  */
5839
- BubbleSeries.prototype.getRadii = function (zMin, zMax, series) {
6881
+ BubbleSeries.prototype.getRadii = function () {
6882
+ var _this = this;
5840
6883
  var len,
5841
6884
  i,
5842
6885
  zData = this.zData,
5843
6886
  yData = this.yData,
5844
- minSize = series.minPxSize,
5845
- maxSize = series.maxPxSize,
5846
6887
  radii = [],
5847
- value;
6888
+ value,
6889
+ zExtremes = this.chart.bubbleZExtremes;
6890
+ var _a = this.getPxExtremes(),
6891
+ minPxSize = _a.minPxSize,
6892
+ maxPxSize = _a.maxPxSize;
6893
+ // Get the collective Z extremes of all bubblish series. The chart-level
6894
+ // `bubbleZExtremes` are only computed once, and reset on `updatedData`
6895
+ // in any member series.
6896
+ if (!zExtremes) {
6897
+ var zMin_1 = Number.MAX_VALUE;
6898
+ var zMax_1 = -Number.MAX_VALUE;
6899
+ var valid_1;
6900
+ this.chart.series.forEach(function (otherSeries) {
6901
+ if (otherSeries.bubblePadding && (otherSeries.visible ||
6902
+ !_this.chart.options.chart.ignoreHiddenSeries)) {
6903
+ var zExtremes_1 = otherSeries.getZExtremes();
6904
+ if (zExtremes_1) {
6905
+ zMin_1 = Math.min(zMin_1 || zExtremes_1.zMin, zExtremes_1.zMin);
6906
+ zMax_1 = Math.max(zMax_1 || zExtremes_1.zMax, zExtremes_1.zMax);
6907
+ valid_1 = true;
6908
+ }
6909
+ }
6910
+ });
6911
+ if (valid_1) {
6912
+ zExtremes = { zMin: zMin_1, zMax: zMax_1 };
6913
+ this.chart.bubbleZExtremes = zExtremes;
6914
+ }
6915
+ else {
6916
+ zExtremes = { zMin: 0, zMax: 0 };
6917
+ }
6918
+ }
5848
6919
  // Set the shape type and arguments to be picked up in drawPoints
5849
6920
  for (i = 0, len = zData.length; i < len; i++) {
5850
6921
  value = zData[i];
5851
6922
  // Separate method to get individual radius for bubbleLegend
5852
- radii.push(this.getRadius(zMin, zMax, minSize, maxSize, value, yData[i]));
6923
+ radii.push(this.getRadius(zExtremes.zMin, zExtremes.zMax, minPxSize, maxPxSize, value, yData[i]));
5853
6924
  }
5854
6925
  this.radii = radii;
5855
6926
  };
@@ -5919,25 +6990,28 @@
5919
6990
  * @private
5920
6991
  */
5921
6992
  BubbleSeries.prototype.translate = function () {
5922
- var i,
5923
- data = this.data,
5924
- point,
5925
- radius,
5926
- radii = this.radii;
5927
6993
  // Run the parent method
5928
6994
  _super.prototype.translate.call(this);
6995
+ this.getRadii();
6996
+ this.translateBubble();
6997
+ };
6998
+ BubbleSeries.prototype.translateBubble = function () {
6999
+ var _a = this,
7000
+ data = _a.data,
7001
+ radii = _a.radii;
7002
+ var minPxSize = this.getPxExtremes().minPxSize;
5929
7003
  // Set the shape type and arguments to be picked up in drawPoints
5930
- i = data.length;
7004
+ var i = data.length;
5931
7005
  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
- });
7006
+ var point = data[i];
7007
+ var radius = radii ? radii[i] : 0; // #1737
7008
+ if (isNumber(radius) && radius >= minPxSize / 2) {
7009
+ // Shape arguments
7010
+ point.marker = extend(point.marker, {
7011
+ radius: radius,
7012
+ width: 2 * radius,
7013
+ height: 2 * radius
7014
+ });
5941
7015
  // Alignment box for the data label
5942
7016
  point.dlBox = {
5943
7017
  x: point.plotX - radius,
@@ -5952,6 +7026,41 @@
5952
7026
  }
5953
7027
  }
5954
7028
  };
7029
+ BubbleSeries.prototype.getPxExtremes = function () {
7030
+ var smallestSize = Math.min(this.chart.plotWidth,
7031
+ this.chart.plotHeight);
7032
+ var getPxSize = function (length) {
7033
+ var isPercent;
7034
+ if (typeof length === 'string') {
7035
+ isPercent = /%$/.test(length);
7036
+ length = parseInt(length, 10);
7037
+ }
7038
+ return isPercent ? smallestSize * length / 100 : length;
7039
+ };
7040
+ var minPxSize = getPxSize(pick(this.options.minSize, 8));
7041
+ // Prioritize min size if conflict to make sure bubbles are
7042
+ // always visible. #5873
7043
+ var maxPxSize = Math.max(getPxSize(pick(this.options.maxSize, '20%')),
7044
+ minPxSize);
7045
+ return { minPxSize: minPxSize, maxPxSize: maxPxSize };
7046
+ };
7047
+ BubbleSeries.prototype.getZExtremes = function () {
7048
+ var options = this.options,
7049
+ zData = (this.zData || []).filter(isNumber);
7050
+ if (zData.length) {
7051
+ var zMin = pick(options.zMin,
7052
+ clamp(arrayMin(zData),
7053
+ options.displayNegative === false ?
7054
+ (options.zThreshold || 0) :
7055
+ -Number.MAX_VALUE,
7056
+ Number.MAX_VALUE));
7057
+ var zMax = pick(options.zMax,
7058
+ arrayMax(zData));
7059
+ if (isNumber(zMin) && isNumber(zMax)) {
7060
+ return { zMin: zMin, zMax: zMax };
7061
+ }
7062
+ }
7063
+ };
5955
7064
  BubbleSeries.compose = BubbleLegendComposition.compose;
5956
7065
  /**
5957
7066
  * A bubble series is a three dimensional series type where each point
@@ -6204,6 +7313,10 @@
6204
7313
  specialGroup: 'group',
6205
7314
  zoneAxis: 'z'
6206
7315
  });
7316
+ // On updated data in any series, delete the chart-level Z extremes cache
7317
+ addEvent(BubbleSeries, 'updatedData', function (e) {
7318
+ delete e.target.chart.bubbleZExtremes;
7319
+ });
6207
7320
  /* *
6208
7321
  *
6209
7322
  * Axis ?
@@ -6220,70 +7333,36 @@
6220
7333
  isXAxis = this.isXAxis,
6221
7334
  dataKey = isXAxis ? 'xData' : 'yData',
6222
7335
  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
7336
  range = this.max - min,
6229
7337
  transA = axisLength / range,
6230
- activeSeries = [];
7338
+ hasActiveSeries;
6231
7339
  // Handle padding on the second pass, or on redraw
6232
7340
  this.series.forEach(function (series) {
6233
- var seriesOptions = series.options,
6234
- zData;
6235
7341
  if (series.bubblePadding &&
6236
7342
  (series.visible || !chart.options.chart.ignoreHiddenSeries)) {
6237
7343
  // Correction for #1673
6238
7344
  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
- }
7345
+ hasActiveSeries = true;
7346
+ var data = series[dataKey];
7347
+ if (isXAxis) {
7348
+ series.getRadii(0, 0, series);
6263
7349
  }
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);
7350
+ if (range > 0) {
7351
+ var i = data.length;
7352
+ while (i--) {
7353
+ if (isNumber(data[i]) &&
7354
+ axis.dataMin <= data[i] &&
7355
+ data[i] <= axis.max) {
7356
+ var radius = series.radii && series.radii[i] || 0;
7357
+ pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);
7358
+ pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);
7359
+ }
6281
7360
  }
6282
7361
  }
6283
7362
  }
6284
7363
  });
6285
7364
  // Apply the padding to the min and max properties
6286
- if (activeSeries.length && range > 0 && !this.logarithmic) {
7365
+ if (hasActiveSeries && range > 0 && !this.logarithmic) {
6287
7366
  pxMax -= axisLength;
6288
7367
  transA *= (axisLength +
6289
7368
  Math.max(0, pxMin) - // #8901
@@ -6477,9 +7556,6 @@
6477
7556
  };
6478
7557
  return MapBubblePoint;
6479
7558
  }(BubbleSeries.prototype.pointClass));
6480
- extend(MapBubblePoint.prototype, {
6481
- ttBelow: false
6482
- });
6483
7559
  /* *
6484
7560
  *
6485
7561
  * Default Export
@@ -6514,6 +7590,7 @@
6514
7590
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6515
7591
  };
6516
7592
  })();
7593
+ var MapPointSeries = SeriesRegistry.seriesTypes.mappoint;
6517
7594
  var extend = U.extend,
6518
7595
  merge = U.merge;
6519
7596
  /* *
@@ -6543,6 +7620,11 @@
6543
7620
  _this.points = void 0;
6544
7621
  return _this;
6545
7622
  }
7623
+ MapBubbleSeries.prototype.translate = function () {
7624
+ MapPointSeries.prototype.translate.call(this);
7625
+ this.getRadii();
7626
+ this.translateBubble();
7627
+ };
6546
7628
  /* *
6547
7629
  *
6548
7630
  * Static Properties
@@ -6678,12 +7760,15 @@
6678
7760
  }(BubbleSeries));
6679
7761
  extend(MapBubbleSeries.prototype, {
6680
7762
  type: 'mapbubble',
6681
- getBox: MapSeries.prototype.getBox,
7763
+ axisTypes: ['colorAxis'],
7764
+ getProjectedBounds: MapSeries.prototype.getProjectedBounds,
7765
+ isCartesian: false,
6682
7766
  // If one single value is passed, it is interpreted as z
6683
7767
  pointArrayMap: ['z'],
6684
7768
  pointClass: MapBubblePoint,
6685
7769
  setData: MapSeries.prototype.setData,
6686
7770
  setOptions: MapSeries.prototype.setOptions,
7771
+ useMapGeometry: true,
6687
7772
  xyFromShape: true
6688
7773
  });
6689
7774
  SeriesRegistry.registerSeriesType('mapbubble', MapBubbleSeries);
@@ -6761,7 +7846,7 @@
6761
7846
 
6762
7847
  return MapBubbleSeries;
6763
7848
  });
6764
- _registerModule(_modules, 'Series/Heatmap/HeatmapPoint.js', [_modules['Mixins/ColorMapSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (ColorMapMixin, SeriesRegistry, U) {
7849
+ _registerModule(_modules, 'Series/Heatmap/HeatmapPoint.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
6765
7850
  /* *
6766
7851
  *
6767
7852
  * (c) 2010-2021 Torstein Honsi
@@ -6787,7 +7872,6 @@
6787
7872
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6788
7873
  };
6789
7874
  })();
6790
- var colorMapPointMixin = ColorMapMixin.colorMapPointMixin;
6791
7875
  var ScatterPoint = SeriesRegistry.seriesTypes.scatter.prototype.pointClass;
6792
7876
  var clamp = U.clamp,
6793
7877
  extend = U.extend,
@@ -6931,8 +8015,9 @@
6931
8015
  return HeatmapPoint;
6932
8016
  }(ScatterPoint));
6933
8017
  extend(HeatmapPoint.prototype, {
6934
- dataLabelOnNull: colorMapPointMixin.dataLabelOnNull,
6935
- moveToTopOnHover: colorMapPointMixin.moveToTopOnHover
8018
+ dataLabelOnNull: true,
8019
+ moveToTopOnHover: true,
8020
+ ttBelow: false
6936
8021
  });
6937
8022
  /* *
6938
8023
  *
@@ -6942,7 +8027,7 @@
6942
8027
 
6943
8028
  return HeatmapPoint;
6944
8029
  });
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) {
8030
+ _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
8031
  /* *
6947
8032
  *
6948
8033
  * (c) 2010-2021 Torstein Honsi
@@ -6968,7 +8053,7 @@
6968
8053
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6969
8054
  };
6970
8055
  })();
6971
- var colorMapSeriesMixin = ColorMapMixin.colorMapSeriesMixin;
8056
+ var colorMapSeriesMixin = ColorMapComposition.colorMapSeriesMixin;
6972
8057
  var Series = SeriesRegistry.series,
6973
8058
  _a = SeriesRegistry.seriesTypes,
6974
8059
  ColumnSeries = _a.column,
@@ -7034,11 +8119,25 @@
7034
8119
  this.points.forEach(function (point) {
7035
8120
  if (point.graphic) {
7036
8121
  point.graphic[_this.chart.styledMode ? 'css' : 'animate'](_this.colorAttribs(point));
8122
+ // @todo
8123
+ // Applying the border radius here is not optimal. It should
8124
+ // be set in the shapeArgs or returned from `markerAttribs`.
8125
+ // However, Series.drawPoints does not pick up markerAttribs
8126
+ // to be passed over to `renderer.symbol`. Also, image
8127
+ // symbols are not positioned by their top left corner like
8128
+ // other symbols are. This should be refactored, then we
8129
+ // could save ourselves some tests for .hasImage etc. And
8130
+ // the evaluation of borderRadius would be moved to
8131
+ // `markerAttribs`.
7037
8132
  if (_this.options.borderRadius) {
7038
8133
  point.graphic.attr({
7039
8134
  r: _this.options.borderRadius
7040
8135
  });
7041
8136
  }
8137
+ // Saving option for reapplying later
8138
+ // when changing point's states (#16165)
8139
+ (point.shapeArgs || {}).r = _this.options.borderRadius;
8140
+ (point.shapeArgs || {}).d = point.graphic.pathArray;
7042
8141
  if (point.value === null) { // #15708
7043
8142
  point.graphic.addClass('highcharts-null-point');
7044
8143
  }
@@ -7334,7 +8433,7 @@
7334
8433
  *
7335
8434
  * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
7336
8435
  */
7337
- nullColor: palette.neutralColor3,
8436
+ nullColor: "#f7f7f7" /* neutralColor3 */,
7338
8437
  dataLabels: {
7339
8438
  formatter: function () {
7340
8439
  var numberFormatter = this.series.chart.numberFormatter;
@@ -7520,8 +8619,7 @@
7520
8619
  */
7521
8620
  alignDataLabel: ColumnSeries.prototype.alignDataLabel,
7522
8621
  axisTypes: colorMapSeriesMixin.axisTypes,
7523
- colorAttribs: colorMapSeriesMixin.colorAttribs,
7524
- colorKey: colorMapSeriesMixin.colorKey,
8622
+ colorKey: 'value',
7525
8623
  directTouch: true,
7526
8624
  /**
7527
8625
  * @private
@@ -7534,6 +8632,7 @@
7534
8632
  pointClass: HeatmapPoint,
7535
8633
  trackerGroups: colorMapSeriesMixin.trackerGroups
7536
8634
  });
8635
+ ColorMapComposition.compose(HeatmapSeries);
7537
8636
  SeriesRegistry.registerSeriesType('heatmap', HeatmapSeries);
7538
8637
  /* *
7539
8638
  *
@@ -8051,6 +9150,11 @@
8051
9150
  * @name Highcharts.MapLatLonObject#lon
8052
9151
  * @type {number}
8053
9152
  */
9153
+ /**
9154
+ * An array of longitude, latitude.
9155
+ *
9156
+ * @typedef {Array<number>} Highcharts.LonLatArray
9157
+ */
8054
9158
  ''; // detach doclets above
8055
9159
  /* eslint-disable no-invalid-this, valid-jsdoc */
8056
9160
  /**
@@ -8110,9 +9214,7 @@
8110
9214
  * @product highmaps
8111
9215
  * @apioption chart.proj4
8112
9216
  */
8113
- var proj4 = (this.userOptions.chart &&
8114
- this.userOptions.chart.proj4 ||
8115
- win.proj4);
9217
+ var proj4 = this.options.chart.proj4 || win.proj4;
8116
9218
  if (!proj4) {
8117
9219
  error(21, false, this);
8118
9220
  return {
@@ -8120,6 +9222,22 @@
8120
9222
  y: null
8121
9223
  };
8122
9224
  }
9225
+ var _a = transform.jsonmarginX,
9226
+ jsonmarginX = _a === void 0 ? 0 : _a,
9227
+ _b = transform.jsonmarginY,
9228
+ jsonmarginY = _b === void 0 ? 0 : _b,
9229
+ _c = transform.jsonres,
9230
+ jsonres = _c === void 0 ? 1 : _c,
9231
+ _d = transform.scale,
9232
+ scale = _d === void 0 ? 1 : _d,
9233
+ _e = transform.xoffset,
9234
+ xoffset = _e === void 0 ? 0 : _e,
9235
+ _f = transform.xpan,
9236
+ xpan = _f === void 0 ? 0 : _f,
9237
+ _g = transform.yoffset,
9238
+ yoffset = _g === void 0 ? 0 : _g,
9239
+ _h = transform.ypan,
9240
+ ypan = _h === void 0 ? 0 : _h;
8123
9241
  var projected = proj4(transform.crs,
8124
9242
  [latLon.lon,
8125
9243
  latLon.lat]),
@@ -8132,12 +9250,8 @@
8132
9250
  -projected[0] * sinAngle + projected[1] * cosAngle
8133
9251
  ] : projected;
8134
9252
  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)
9253
+ x: ((rotated[0] - xoffset) * scale + xpan) * jsonres + jsonmarginX,
9254
+ y: -(((yoffset - rotated[1]) * scale + ypan) * jsonres - jsonmarginY)
8141
9255
  };
8142
9256
  };
8143
9257
  /**
@@ -8163,18 +9277,33 @@
8163
9277
  * An object with `lat` and `lon` properties.
8164
9278
  */
8165
9279
  Chart.prototype.transformToLatLon = function (point, transform) {
8166
- if (typeof win.proj4 === 'undefined') {
9280
+ var proj4 = this.options.chart.proj4 || win.proj4;
9281
+ if (!proj4) {
8167
9282
  error(21, false, this);
8168
9283
  return;
8169
9284
  }
9285
+ if (point.y === null) {
9286
+ return;
9287
+ }
9288
+ var _a = transform.jsonmarginX,
9289
+ jsonmarginX = _a === void 0 ? 0 : _a,
9290
+ _b = transform.jsonmarginY,
9291
+ jsonmarginY = _b === void 0 ? 0 : _b,
9292
+ _c = transform.jsonres,
9293
+ jsonres = _c === void 0 ? 1 : _c,
9294
+ _d = transform.scale,
9295
+ scale = _d === void 0 ? 1 : _d,
9296
+ _e = transform.xoffset,
9297
+ xoffset = _e === void 0 ? 0 : _e,
9298
+ _f = transform.xpan,
9299
+ xpan = _f === void 0 ? 0 : _f,
9300
+ _g = transform.yoffset,
9301
+ yoffset = _g === void 0 ? 0 : _g,
9302
+ _h = transform.ypan,
9303
+ ypan = _h === void 0 ? 0 : _h;
8170
9304
  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)
9305
+ x: ((point.x - jsonmarginX) / jsonres - xpan) / scale + xoffset,
9306
+ y: ((point.y - jsonmarginY) / jsonres + ypan) / scale + yoffset
8178
9307
  },
8179
9308
  cosAngle = transform.cosAngle ||
8180
9309
  (transform.rotation && Math.cos(transform.rotation)),
@@ -8207,16 +9336,15 @@
8207
9336
  * An object with `lat` and `lon` properties.
8208
9337
  */
8209
9338
  Chart.prototype.fromPointToLatLon = function (point) {
8210
- var transforms = this.mapTransforms,
8211
- transform;
9339
+ var transforms = this.mapTransforms;
8212
9340
  if (!transforms) {
8213
9341
  error(22, false, this);
8214
9342
  return;
8215
9343
  }
8216
- for (transform in transforms) {
9344
+ for (var transform in transforms) {
8217
9345
  if (Object.hasOwnProperty.call(transforms, transform) &&
8218
9346
  transforms[transform].hitZone &&
8219
- pointInPolygon({ x: point.x, y: -point.y }, transforms[transform].hitZone.coordinates[0])) {
9347
+ pointInPolygon(point, transforms[transform].hitZone.coordinates[0])) {
8220
9348
  return this.transformToLatLon(point, transforms[transform]);
8221
9349
  }
8222
9350
  }
@@ -8255,7 +9383,7 @@
8255
9383
  if (Object.hasOwnProperty.call(transforms, transform) &&
8256
9384
  transforms[transform].hitZone) {
8257
9385
  coords = this.transformFromLatLon(latLon, transforms[transform]);
8258
- if (pointInPolygon({ x: coords.x, y: -coords.y }, transforms[transform].hitZone.coordinates[0])) {
9386
+ if (pointInPolygon(coords, transforms[transform].hitZone.coordinates[0])) {
8259
9387
  return coords;
8260
9388
  }
8261
9389
  }
@@ -8294,64 +9422,36 @@
8294
9422
  * An object ready for the `mapData` option.
8295
9423
  */
8296
9424
  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';
9425
+ if (hType === void 0) { hType = 'map'; }
9426
+ var mapData = [];
9427
+ var path = [];
8312
9428
  geojson.features.forEach(function (feature) {
8313
- var geometry = feature.geometry,
9429
+ var geometry = feature.geometry || {},
8314
9430
  type = geometry.type,
8315
9431
  coordinates = geometry.coordinates,
8316
9432
  properties = feature.properties,
8317
- point;
9433
+ pointOptions;
8318
9434
  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 };
9435
+ if ((hType === 'map' || hType === 'mapbubble') &&
9436
+ (type === 'Polygon' || type === 'MultiPolygon')) {
9437
+ if (coordinates.length) {
9438
+ pointOptions = { geometry: { coordinates: coordinates, type: type } };
8332
9439
  }
8333
9440
  }
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 };
9441
+ else if (hType === 'mapline' &&
9442
+ (type === 'LineString' ||
9443
+ type === 'MultiLineString')) {
9444
+ if (coordinates.length) {
9445
+ pointOptions = { geometry: { coordinates: coordinates, type: type } };
8343
9446
  }
8344
9447
  }
8345
- else if (hType === 'mappoint') {
8346
- if (type === 'Point') {
8347
- point = {
8348
- x: coordinates[0],
8349
- y: -coordinates[1]
8350
- };
9448
+ else if (hType === 'mappoint' && type === 'Point') {
9449
+ if (coordinates.length) {
9450
+ pointOptions = { geometry: { coordinates: coordinates, type: type } };
8351
9451
  }
8352
9452
  }
8353
- if (point) {
8354
- mapData.push(extend(point, {
9453
+ if (pointOptions) {
9454
+ mapData.push(extend(pointOptions, {
8355
9455
  name: properties.name || properties.NAME,
8356
9456
  /**
8357
9457
  * In Highmaps, when data is loaded from GeoJSON, the GeoJSON