highcharts 6.1.4 → 6.2.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 (695) hide show
  1. package/bower.json +1 -1
  2. package/css/highcharts.css +17 -0
  3. package/css/highcharts.scss +14 -0
  4. package/css/themes/dark-unica.css +17 -0
  5. package/css/themes/grid-light.css +17 -0
  6. package/css/themes/sand-signika.css +17 -0
  7. package/es-modules/indicators/momentum.src.js +1 -1
  8. package/es-modules/indicators/pivot-points.src.js +6 -1
  9. package/es-modules/masters/highcharts-gantt.src.js +11 -0
  10. package/es-modules/masters/modules/annotations.src.js +1 -1
  11. package/es-modules/masters/modules/arrow-symbols.src.js +12 -0
  12. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  13. package/es-modules/masters/modules/current-date-indicator.src.js +12 -0
  14. package/es-modules/masters/modules/data.src.js +1 -1
  15. package/es-modules/masters/modules/draggable-points.src.js +9 -0
  16. package/es-modules/masters/modules/export-data.src.js +1 -1
  17. package/es-modules/masters/modules/exporting.src.js +1 -1
  18. package/es-modules/masters/modules/funnel.src.js +1 -1
  19. package/es-modules/masters/modules/gantt.src.js +2 -1
  20. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  21. package/es-modules/masters/modules/heatmap.src.js +1 -1
  22. package/es-modules/masters/modules/item-series.src.js +1 -1
  23. package/es-modules/masters/modules/map.src.js +1 -1
  24. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  25. package/es-modules/masters/modules/pathfinder.src.js +12 -0
  26. package/es-modules/masters/modules/sankey.src.js +1 -1
  27. package/es-modules/masters/modules/series-label.src.js +1 -1
  28. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  29. package/es-modules/masters/modules/stock.src.js +1 -1
  30. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  31. package/es-modules/masters/modules/treegrid.src.js +12 -0
  32. package/es-modules/masters/modules/variwide.src.js +1 -1
  33. package/es-modules/masters/modules/vector.src.js +1 -1
  34. package/es-modules/masters/modules/windbarb.src.js +1 -1
  35. package/es-modules/masters/modules/xrange.src.js +1 -1
  36. package/es-modules/masters/themes/dark-blue.src.js +1 -1
  37. package/es-modules/masters/themes/dark-green.src.js +1 -1
  38. package/es-modules/masters/themes/dark-unica.src.js +1 -1
  39. package/es-modules/masters/themes/gray.src.js +1 -1
  40. package/es-modules/masters/themes/grid-light.src.js +1 -1
  41. package/es-modules/masters/themes/grid.src.js +1 -1
  42. package/es-modules/masters/themes/sand-signika.src.js +1 -1
  43. package/es-modules/masters/themes/skies.src.js +1 -1
  44. package/es-modules/mixins/centered-series.js +1 -1
  45. package/es-modules/mixins/on-series.js +1 -1
  46. package/es-modules/modules/boost.src.js +22 -14
  47. package/es-modules/modules/broken-axis.src.js +169 -134
  48. package/es-modules/modules/data.src.js +2 -2
  49. package/es-modules/modules/draggable-points.src.js +2257 -0
  50. package/es-modules/modules/drilldown.src.js +1 -0
  51. package/es-modules/modules/export-data.src.js +1 -1
  52. package/es-modules/modules/exporting.src.js +1 -1
  53. package/es-modules/modules/funnel.src.js +1 -1
  54. package/es-modules/modules/item-series.src.js +1 -1
  55. package/es-modules/modules/no-data-to-display.src.js +5 -5
  56. package/es-modules/modules/oldie.src.js +1 -1
  57. package/es-modules/modules/overlapping-datalabels.src.js +38 -22
  58. package/es-modules/modules/parallel-coordinates.src.js +3 -2
  59. package/es-modules/modules/sankey.src.js +1 -1
  60. package/es-modules/modules/series-label.src.js +2 -2
  61. package/es-modules/modules/solid-gauge.src.js +1 -1
  62. package/es-modules/modules/static-scale.src.js +67 -28
  63. package/es-modules/modules/streamgraph.src.js +1 -1
  64. package/es-modules/modules/tilemap.src.js +231 -134
  65. package/es-modules/modules/variwide.src.js +1 -1
  66. package/es-modules/modules/vector.src.js +92 -22
  67. package/es-modules/modules/windbarb.src.js +1 -1
  68. package/es-modules/modules/xrange.src.js +257 -77
  69. package/es-modules/parts/AreaSeries.js +77 -77
  70. package/es-modules/parts/AreaSplineSeries.js +64 -27
  71. package/es-modules/parts/Axis.js +160 -67
  72. package/es-modules/parts/BarSeries.js +68 -51
  73. package/es-modules/parts/CandlestickSeries.js +1 -1
  74. package/es-modules/parts/Chart.js +31 -55
  75. package/es-modules/parts/Color.js +29 -18
  76. package/es-modules/parts/ColumnSeries.js +264 -142
  77. package/es-modules/parts/DataGrouping.js +9 -6
  78. package/es-modules/parts/DataLabels.js +261 -210
  79. package/es-modules/parts/DateTimeAxis.js +26 -7
  80. package/es-modules/parts/Dynamics.js +5 -2
  81. package/es-modules/parts/FlagsSeries.js +1 -1
  82. package/es-modules/parts/Globals.js +1 -1
  83. package/es-modules/parts/Html.js +64 -12
  84. package/es-modules/parts/Interaction.js +187 -63
  85. package/es-modules/parts/Legend.js +7 -3
  86. package/es-modules/parts/LogarithmicAxis.js +35 -4
  87. package/es-modules/parts/MSPointer.js +1 -1
  88. package/es-modules/parts/Navigator.js +27 -5
  89. package/es-modules/parts/OHLCSeries.js +1 -1
  90. package/es-modules/parts/Options.js +15 -13
  91. package/es-modules/parts/OrdinalAxis.js +1 -1
  92. package/es-modules/parts/PieSeries.js +256 -140
  93. package/es-modules/parts/PlotBandSeries.experimental.js +1 -1
  94. package/es-modules/parts/PlotLineOrBand.js +7 -40
  95. package/es-modules/parts/Point.js +28 -4
  96. package/es-modules/parts/Pointer.js +8 -6
  97. package/es-modules/parts/RangeSelector.js +1 -1
  98. package/es-modules/parts/Responsive.js +82 -36
  99. package/es-modules/parts/ScatterSeries.js +57 -25
  100. package/es-modules/parts/ScrollablePlotArea.js +17 -7
  101. package/es-modules/parts/Scrollbar.js +9 -2
  102. package/es-modules/parts/Series.js +22 -9
  103. package/es-modules/parts/SplineSeries.js +51 -29
  104. package/es-modules/parts/Stacking.js +100 -6
  105. package/es-modules/parts/StockChart.js +9 -3
  106. package/es-modules/parts/SvgRenderer.js +15 -10
  107. package/es-modules/parts/Tick.js +150 -30
  108. package/es-modules/parts/Time.js +23 -5
  109. package/es-modules/parts/Tooltip.js +2 -2
  110. package/es-modules/parts/TouchPointer.js +1 -1
  111. package/es-modules/parts/Utilities.js +16 -1
  112. package/es-modules/parts-3d/Axis.js +1 -1
  113. package/es-modules/parts-3d/Chart.js +1 -1
  114. package/es-modules/parts-3d/Column.js +1 -1
  115. package/es-modules/parts-3d/Math.js +1 -1
  116. package/es-modules/parts-3d/Pie.js +1 -1
  117. package/es-modules/parts-3d/SVGRenderer.js +1 -1
  118. package/es-modules/parts-3d/Scatter.js +1 -1
  119. package/es-modules/parts-3d/Series.js +1 -1
  120. package/es-modules/parts-3d/VMLRenderer.js +1 -1
  121. package/es-modules/parts-gantt/ArrowSymbols.js +110 -0
  122. package/es-modules/parts-gantt/CurrentDateIndicator.js +92 -0
  123. package/es-modules/parts-gantt/GanttChart.js +111 -0
  124. package/es-modules/parts-gantt/GanttSeries.js +376 -0
  125. package/es-modules/parts-gantt/GridAxis.js +965 -0
  126. package/es-modules/parts-gantt/Pathfinder.js +1247 -0
  127. package/es-modules/parts-gantt/PathfinderAlgorithms.js +746 -0
  128. package/es-modules/parts-gantt/Tree.js +146 -0
  129. package/es-modules/parts-gantt/TreeGrid.js +917 -0
  130. package/es-modules/parts-map/ColorAxis.js +1 -1
  131. package/es-modules/parts-map/ColorSeriesMixin.js +1 -1
  132. package/es-modules/parts-map/GeoJSON.js +1 -1
  133. package/es-modules/parts-map/HeatmapSeries.js +124 -53
  134. package/es-modules/parts-map/Map.js +1 -1
  135. package/es-modules/parts-map/MapAxis.js +1 -1
  136. package/es-modules/parts-map/MapBubbleSeries.js +1 -1
  137. package/es-modules/parts-map/MapLineSeries.js +1 -1
  138. package/es-modules/parts-map/MapNavigation.js +1 -1
  139. package/es-modules/parts-map/MapPointSeries.js +1 -1
  140. package/es-modules/parts-map/MapPointer.js +1 -1
  141. package/es-modules/parts-map/MapSeries.js +2 -2
  142. package/es-modules/parts-more/AreaRangeSeries.js +80 -38
  143. package/es-modules/parts-more/AreaSplineRangeSeries.js +1 -1
  144. package/es-modules/parts-more/BoxPlotSeries.js +1 -1
  145. package/es-modules/parts-more/BubbleSeries.js +1 -1
  146. package/es-modules/parts-more/ColumnRangeSeries.js +1 -1
  147. package/es-modules/parts-more/ErrorBarSeries.js +1 -1
  148. package/es-modules/parts-more/GaugeSeries.js +1 -1
  149. package/es-modules/parts-more/Pane.js +2 -1
  150. package/es-modules/parts-more/Polar.js +1 -1
  151. package/es-modules/parts-more/PolygonSeries.js +1 -1
  152. package/es-modules/parts-more/RadialAxis.js +5 -4
  153. package/es-modules/parts-more/WaterfallSeries.js +1 -1
  154. package/es-modules/supplemental.docs.js +0 -1955
  155. package/es-modules/themes/dark-blue.js +1 -1
  156. package/es-modules/themes/dark-green.js +1 -1
  157. package/es-modules/themes/dark-unica.js +1 -1
  158. package/es-modules/themes/gray.js +1 -1
  159. package/es-modules/themes/grid-light.js +1 -1
  160. package/es-modules/themes/grid.js +1 -1
  161. package/es-modules/themes/sand-signika.js +1 -1
  162. package/es-modules/themes/skies.js +1 -1
  163. package/highcharts-3d.js +1 -1
  164. package/highcharts-3d.src.js +10 -10
  165. package/highcharts-gantt.js +503 -0
  166. package/highcharts-gantt.js.map +1 -0
  167. package/highcharts-gantt.src.js +49289 -0
  168. package/highcharts-more.js +65 -64
  169. package/highcharts-more.js.map +1 -1
  170. package/highcharts-more.src.js +97 -53
  171. package/highcharts.js +415 -410
  172. package/highcharts.js.map +1 -1
  173. package/highcharts.src.js +2170 -1128
  174. package/highmaps.js +443 -438
  175. package/highmaps.js.map +1 -1
  176. package/highmaps.src.js +1647 -849
  177. package/highstock.js +553 -548
  178. package/highstock.js.map +1 -1
  179. package/highstock.src.js +2398 -1283
  180. package/indicators/accumulation-distribution.js +1 -1
  181. package/indicators/accumulation-distribution.src.js +1 -1
  182. package/indicators/atr.js +1 -1
  183. package/indicators/atr.src.js +1 -1
  184. package/indicators/bollinger-bands.js +1 -1
  185. package/indicators/bollinger-bands.src.js +1 -1
  186. package/indicators/cci.js +1 -1
  187. package/indicators/cci.src.js +1 -1
  188. package/indicators/cmf.js +1 -1
  189. package/indicators/cmf.src.js +1 -1
  190. package/indicators/ema.js +1 -1
  191. package/indicators/ema.src.js +1 -1
  192. package/indicators/ichimoku-kinko-hyo.js +1 -1
  193. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  194. package/indicators/indicators.js +1 -1
  195. package/indicators/indicators.src.js +1 -1
  196. package/indicators/macd.js +1 -1
  197. package/indicators/macd.src.js +1 -1
  198. package/indicators/mfi.js +1 -1
  199. package/indicators/mfi.src.js +1 -1
  200. package/indicators/momentum.js +1 -1
  201. package/indicators/momentum.src.js +2 -2
  202. package/indicators/pivot-points.js +4 -4
  203. package/indicators/pivot-points.js.map +1 -1
  204. package/indicators/pivot-points.src.js +7 -2
  205. package/indicators/price-envelopes.js +1 -1
  206. package/indicators/price-envelopes.src.js +1 -1
  207. package/indicators/psar.js +1 -1
  208. package/indicators/psar.src.js +1 -1
  209. package/indicators/roc.js +1 -1
  210. package/indicators/roc.src.js +1 -1
  211. package/indicators/rsi.js +1 -1
  212. package/indicators/rsi.src.js +1 -1
  213. package/indicators/stochastic.js +1 -1
  214. package/indicators/stochastic.src.js +1 -1
  215. package/indicators/volume-by-price.js +1 -1
  216. package/indicators/volume-by-price.src.js +1 -1
  217. package/indicators/vwap.js +1 -1
  218. package/indicators/vwap.src.js +1 -1
  219. package/indicators/wma.js +1 -1
  220. package/indicators/wma.src.js +1 -1
  221. package/indicators/zigzag.js +1 -1
  222. package/indicators/zigzag.src.js +1 -1
  223. package/js/es-modules/indicators/momentum.src.js +1 -1
  224. package/js/es-modules/indicators/pivot-points.src.js +6 -1
  225. package/js/es-modules/masters/highcharts-gantt.src.js +11 -0
  226. package/js/es-modules/masters/modules/annotations.src.js +1 -1
  227. package/js/es-modules/masters/modules/arrow-symbols.src.js +12 -0
  228. package/js/es-modules/masters/modules/broken-axis.src.js +1 -1
  229. package/js/es-modules/masters/modules/current-date-indicator.src.js +12 -0
  230. package/js/es-modules/masters/modules/data.src.js +1 -1
  231. package/js/es-modules/masters/modules/draggable-points.src.js +9 -0
  232. package/js/es-modules/masters/modules/export-data.src.js +1 -1
  233. package/js/es-modules/masters/modules/exporting.src.js +1 -1
  234. package/js/es-modules/masters/modules/funnel.src.js +1 -1
  235. package/js/es-modules/masters/modules/gantt.src.js +2 -1
  236. package/js/es-modules/masters/modules/grid-axis.src.js +1 -1
  237. package/js/es-modules/masters/modules/heatmap.src.js +1 -1
  238. package/js/es-modules/masters/modules/item-series.src.js +1 -1
  239. package/js/es-modules/masters/modules/map.src.js +1 -1
  240. package/js/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  241. package/js/es-modules/masters/modules/pathfinder.src.js +12 -0
  242. package/js/es-modules/masters/modules/sankey.src.js +1 -1
  243. package/js/es-modules/masters/modules/series-label.src.js +1 -1
  244. package/js/es-modules/masters/modules/solid-gauge.src.js +1 -1
  245. package/js/es-modules/masters/modules/stock.src.js +1 -1
  246. package/js/es-modules/masters/modules/streamgraph.src.js +1 -1
  247. package/js/es-modules/masters/modules/treegrid.src.js +12 -0
  248. package/js/es-modules/masters/modules/variwide.src.js +1 -1
  249. package/js/es-modules/masters/modules/vector.src.js +1 -1
  250. package/js/es-modules/masters/modules/windbarb.src.js +1 -1
  251. package/js/es-modules/masters/modules/xrange.src.js +1 -1
  252. package/js/es-modules/masters/themes/dark-blue.src.js +1 -1
  253. package/js/es-modules/masters/themes/dark-green.src.js +1 -1
  254. package/js/es-modules/masters/themes/dark-unica.src.js +1 -1
  255. package/js/es-modules/masters/themes/gray.src.js +1 -1
  256. package/js/es-modules/masters/themes/grid-light.src.js +1 -1
  257. package/js/es-modules/masters/themes/grid.src.js +1 -1
  258. package/js/es-modules/masters/themes/sand-signika.src.js +1 -1
  259. package/js/es-modules/masters/themes/skies.src.js +1 -1
  260. package/js/es-modules/mixins/centered-series.js +1 -1
  261. package/js/es-modules/mixins/on-series.js +1 -1
  262. package/js/es-modules/modules/boost.src.js +22 -14
  263. package/js/es-modules/modules/broken-axis.src.js +169 -134
  264. package/js/es-modules/modules/data.src.js +2 -2
  265. package/js/es-modules/modules/draggable-points.src.js +2257 -0
  266. package/js/es-modules/modules/drilldown.src.js +1 -0
  267. package/js/es-modules/modules/export-data.src.js +1 -1
  268. package/js/es-modules/modules/exporting.src.js +1 -1
  269. package/js/es-modules/modules/funnel.src.js +1 -1
  270. package/js/es-modules/modules/item-series.src.js +1 -1
  271. package/js/es-modules/modules/no-data-to-display.src.js +5 -5
  272. package/js/es-modules/modules/oldie.src.js +1 -1
  273. package/js/es-modules/modules/overlapping-datalabels.src.js +38 -22
  274. package/js/es-modules/modules/parallel-coordinates.src.js +3 -2
  275. package/js/es-modules/modules/sankey.src.js +1 -1
  276. package/js/es-modules/modules/series-label.src.js +2 -2
  277. package/js/es-modules/modules/solid-gauge.src.js +1 -1
  278. package/js/es-modules/modules/static-scale.src.js +67 -28
  279. package/js/es-modules/modules/streamgraph.src.js +1 -1
  280. package/js/es-modules/modules/tilemap.src.js +231 -134
  281. package/js/es-modules/modules/variwide.src.js +1 -1
  282. package/js/es-modules/modules/vector.src.js +92 -22
  283. package/js/es-modules/modules/windbarb.src.js +1 -1
  284. package/js/es-modules/modules/xrange.src.js +255 -68
  285. package/js/es-modules/parts/AreaSeries.js +77 -77
  286. package/js/es-modules/parts/AreaSplineSeries.js +64 -27
  287. package/js/es-modules/parts/Axis.js +160 -67
  288. package/js/es-modules/parts/BarSeries.js +68 -51
  289. package/js/es-modules/parts/CandlestickSeries.js +1 -1
  290. package/js/es-modules/parts/Chart.js +31 -55
  291. package/js/es-modules/parts/Color.js +29 -18
  292. package/js/es-modules/parts/ColumnSeries.js +231 -123
  293. package/js/es-modules/parts/DataGrouping.js +9 -6
  294. package/js/es-modules/parts/DataLabels.js +230 -182
  295. package/js/es-modules/parts/DateTimeAxis.js +26 -7
  296. package/js/es-modules/parts/Dynamics.js +5 -2
  297. package/js/es-modules/parts/FlagsSeries.js +1 -1
  298. package/js/es-modules/parts/Globals.js +1 -1
  299. package/js/es-modules/parts/Html.js +64 -12
  300. package/js/es-modules/parts/Interaction.js +178 -61
  301. package/js/es-modules/parts/Legend.js +7 -3
  302. package/js/es-modules/parts/LogarithmicAxis.js +35 -4
  303. package/js/es-modules/parts/MSPointer.js +1 -1
  304. package/js/es-modules/parts/Navigator.js +27 -5
  305. package/js/es-modules/parts/OHLCSeries.js +1 -1
  306. package/js/es-modules/parts/Options.js +13 -12
  307. package/js/es-modules/parts/OrdinalAxis.js +1 -1
  308. package/js/es-modules/parts/PieSeries.js +245 -132
  309. package/js/es-modules/parts/PlotBandSeries.experimental.js +1 -1
  310. package/js/es-modules/parts/PlotLineOrBand.js +7 -40
  311. package/js/es-modules/parts/Point.js +28 -4
  312. package/js/es-modules/parts/Pointer.js +8 -6
  313. package/js/es-modules/parts/RangeSelector.js +1 -1
  314. package/js/es-modules/parts/Responsive.js +82 -36
  315. package/js/es-modules/parts/ScatterSeries.js +56 -25
  316. package/js/es-modules/parts/ScrollablePlotArea.js +17 -7
  317. package/js/es-modules/parts/Scrollbar.js +9 -2
  318. package/js/es-modules/parts/Series.js +22 -9
  319. package/js/es-modules/parts/SplineSeries.js +51 -29
  320. package/js/es-modules/parts/Stacking.js +100 -6
  321. package/js/es-modules/parts/StockChart.js +9 -3
  322. package/js/es-modules/parts/SvgRenderer.js +15 -10
  323. package/js/es-modules/parts/Tick.js +150 -30
  324. package/js/es-modules/parts/Time.js +23 -5
  325. package/js/es-modules/parts/Tooltip.js +2 -2
  326. package/js/es-modules/parts/TouchPointer.js +1 -1
  327. package/js/es-modules/parts/Utilities.js +16 -1
  328. package/js/es-modules/parts-3d/Axis.js +1 -1
  329. package/js/es-modules/parts-3d/Chart.js +1 -1
  330. package/js/es-modules/parts-3d/Column.js +1 -1
  331. package/js/es-modules/parts-3d/Math.js +1 -1
  332. package/js/es-modules/parts-3d/Pie.js +1 -1
  333. package/js/es-modules/parts-3d/SVGRenderer.js +1 -1
  334. package/js/es-modules/parts-3d/Scatter.js +1 -1
  335. package/js/es-modules/parts-3d/Series.js +1 -1
  336. package/js/es-modules/parts-3d/VMLRenderer.js +1 -1
  337. package/js/es-modules/parts-gantt/ArrowSymbols.js +110 -0
  338. package/js/es-modules/parts-gantt/CurrentDateIndicator.js +92 -0
  339. package/js/es-modules/parts-gantt/GanttChart.js +111 -0
  340. package/js/es-modules/parts-gantt/GanttSeries.js +371 -0
  341. package/js/es-modules/parts-gantt/GridAxis.js +962 -0
  342. package/js/es-modules/parts-gantt/Pathfinder.js +1225 -0
  343. package/js/es-modules/parts-gantt/PathfinderAlgorithms.js +746 -0
  344. package/js/es-modules/parts-gantt/Tree.js +146 -0
  345. package/js/es-modules/parts-gantt/TreeGrid.js +891 -0
  346. package/js/es-modules/parts-map/ColorAxis.js +1 -1
  347. package/js/es-modules/parts-map/ColorSeriesMixin.js +1 -1
  348. package/js/es-modules/parts-map/GeoJSON.js +1 -1
  349. package/js/es-modules/parts-map/HeatmapSeries.js +122 -52
  350. package/js/es-modules/parts-map/Map.js +1 -1
  351. package/js/es-modules/parts-map/MapAxis.js +1 -1
  352. package/js/es-modules/parts-map/MapBubbleSeries.js +1 -1
  353. package/js/es-modules/parts-map/MapLineSeries.js +1 -1
  354. package/js/es-modules/parts-map/MapNavigation.js +1 -1
  355. package/js/es-modules/parts-map/MapPointSeries.js +1 -1
  356. package/js/es-modules/parts-map/MapPointer.js +1 -1
  357. package/js/es-modules/parts-map/MapSeries.js +2 -2
  358. package/js/es-modules/parts-more/AreaRangeSeries.js +80 -38
  359. package/js/es-modules/parts-more/AreaSplineRangeSeries.js +1 -1
  360. package/js/es-modules/parts-more/BoxPlotSeries.js +1 -1
  361. package/js/es-modules/parts-more/BubbleSeries.js +1 -1
  362. package/js/es-modules/parts-more/ColumnRangeSeries.js +1 -1
  363. package/js/es-modules/parts-more/ErrorBarSeries.js +1 -1
  364. package/js/es-modules/parts-more/GaugeSeries.js +1 -1
  365. package/js/es-modules/parts-more/Pane.js +2 -1
  366. package/js/es-modules/parts-more/Polar.js +1 -1
  367. package/js/es-modules/parts-more/PolygonSeries.js +1 -1
  368. package/js/es-modules/parts-more/RadialAxis.js +5 -4
  369. package/js/es-modules/parts-more/WaterfallSeries.js +1 -1
  370. package/js/es-modules/supplemental.docs.js +0 -1955
  371. package/js/es-modules/themes/dark-blue.js +1 -1
  372. package/js/es-modules/themes/dark-green.js +1 -1
  373. package/js/es-modules/themes/dark-unica.js +1 -1
  374. package/js/es-modules/themes/gray.js +1 -1
  375. package/js/es-modules/themes/grid-light.js +1 -1
  376. package/js/es-modules/themes/grid.js +1 -1
  377. package/js/es-modules/themes/sand-signika.js +1 -1
  378. package/js/es-modules/themes/skies.js +1 -1
  379. package/js/highcharts-3d.js +1 -1
  380. package/js/highcharts-3d.src.js +10 -10
  381. package/js/highcharts-gantt.js +480 -0
  382. package/js/highcharts-gantt.js.map +1 -0
  383. package/js/highcharts-gantt.src.js +47011 -0
  384. package/js/highcharts-more.js +62 -61
  385. package/js/highcharts-more.js.map +1 -1
  386. package/js/highcharts-more.src.js +97 -53
  387. package/js/highcharts.js +394 -390
  388. package/js/highcharts.js.map +1 -1
  389. package/js/highcharts.src.js +2083 -1070
  390. package/js/highmaps.js +420 -416
  391. package/js/highmaps.js.map +1 -1
  392. package/js/highmaps.src.js +1569 -798
  393. package/js/highstock.js +526 -520
  394. package/js/highstock.js.map +1 -1
  395. package/js/highstock.src.js +2311 -1225
  396. package/js/indicators/accumulation-distribution.js +1 -1
  397. package/js/indicators/accumulation-distribution.src.js +1 -1
  398. package/js/indicators/atr.js +1 -1
  399. package/js/indicators/atr.src.js +1 -1
  400. package/js/indicators/bollinger-bands.js +1 -1
  401. package/js/indicators/bollinger-bands.src.js +1 -1
  402. package/js/indicators/cci.js +1 -1
  403. package/js/indicators/cci.src.js +1 -1
  404. package/js/indicators/cmf.js +1 -1
  405. package/js/indicators/cmf.src.js +1 -1
  406. package/js/indicators/ema.js +1 -1
  407. package/js/indicators/ema.src.js +1 -1
  408. package/js/indicators/ichimoku-kinko-hyo.js +1 -1
  409. package/js/indicators/ichimoku-kinko-hyo.src.js +1 -1
  410. package/js/indicators/indicators.js +1 -1
  411. package/js/indicators/indicators.src.js +1 -1
  412. package/js/indicators/macd.js +1 -1
  413. package/js/indicators/macd.src.js +1 -1
  414. package/js/indicators/mfi.js +1 -1
  415. package/js/indicators/mfi.src.js +1 -1
  416. package/js/indicators/momentum.js +1 -1
  417. package/js/indicators/momentum.src.js +2 -2
  418. package/js/indicators/pivot-points.js +4 -4
  419. package/js/indicators/pivot-points.js.map +1 -1
  420. package/js/indicators/pivot-points.src.js +7 -2
  421. package/js/indicators/price-envelopes.js +1 -1
  422. package/js/indicators/price-envelopes.src.js +1 -1
  423. package/js/indicators/psar.js +1 -1
  424. package/js/indicators/psar.src.js +1 -1
  425. package/js/indicators/roc.js +1 -1
  426. package/js/indicators/roc.src.js +1 -1
  427. package/js/indicators/rsi.js +1 -1
  428. package/js/indicators/rsi.src.js +1 -1
  429. package/js/indicators/stochastic.js +1 -1
  430. package/js/indicators/stochastic.src.js +1 -1
  431. package/js/indicators/volume-by-price.js +1 -1
  432. package/js/indicators/volume-by-price.src.js +1 -1
  433. package/js/indicators/vwap.js +1 -1
  434. package/js/indicators/vwap.src.js +1 -1
  435. package/js/indicators/wma.js +1 -1
  436. package/js/indicators/wma.src.js +1 -1
  437. package/js/indicators/zigzag.js +1 -1
  438. package/js/indicators/zigzag.src.js +1 -1
  439. package/js/modules/accessibility.js +1 -1
  440. package/js/modules/accessibility.src.js +1 -1
  441. package/js/modules/annotations.js +2 -2
  442. package/js/modules/annotations.src.js +2 -2
  443. package/js/modules/arrow-symbols.js +13 -0
  444. package/js/modules/arrow-symbols.js.map +1 -0
  445. package/js/modules/arrow-symbols.src.js +138 -0
  446. package/js/modules/boost-canvas.js +1 -1
  447. package/js/modules/boost-canvas.src.js +1 -1
  448. package/js/modules/boost.js +43 -43
  449. package/js/modules/boost.js.map +1 -1
  450. package/js/modules/boost.src.js +23 -15
  451. package/js/modules/broken-axis.js +11 -10
  452. package/js/modules/broken-axis.js.map +1 -1
  453. package/js/modules/broken-axis.src.js +171 -136
  454. package/js/modules/bullet.js +1 -1
  455. package/js/modules/bullet.src.js +1 -1
  456. package/js/modules/current-date-indicator.js +13 -0
  457. package/js/modules/current-date-indicator.js.map +1 -0
  458. package/js/modules/current-date-indicator.src.js +120 -0
  459. package/js/modules/data.js +2 -2
  460. package/js/modules/data.src.js +4 -4
  461. package/js/modules/drag-panes.js +1 -1
  462. package/js/modules/drag-panes.src.js +1 -1
  463. package/js/modules/draggable-points.js +38 -0
  464. package/js/modules/draggable-points.js.map +1 -0
  465. package/js/modules/draggable-points.src.js +2281 -0
  466. package/js/modules/drilldown.js +1 -1
  467. package/js/modules/drilldown.js.map +1 -1
  468. package/js/modules/drilldown.src.js +2 -1
  469. package/js/modules/export-data.js +2 -2
  470. package/js/modules/export-data.src.js +3 -3
  471. package/js/modules/exporting.js +2 -2
  472. package/js/modules/exporting.src.js +3 -3
  473. package/js/modules/funnel.js +2 -2
  474. package/js/modules/funnel.src.js +3 -3
  475. package/js/modules/gantt.js +80 -18
  476. package/js/modules/gantt.js.map +1 -1
  477. package/js/modules/gantt.src.js +5490 -372
  478. package/js/modules/grid-axis.js +15 -11
  479. package/js/modules/grid-axis.js.map +1 -1
  480. package/js/modules/grid-axis.src.js +731 -293
  481. package/js/modules/heatmap.js +2 -2
  482. package/js/modules/heatmap.js.map +1 -1
  483. package/js/modules/heatmap.src.js +126 -56
  484. package/js/modules/histogram-bellcurve.js +1 -1
  485. package/js/modules/histogram-bellcurve.src.js +1 -1
  486. package/js/modules/item-series.js +2 -2
  487. package/js/modules/item-series.src.js +3 -3
  488. package/js/modules/map.js +2 -2
  489. package/js/modules/map.js.map +1 -1
  490. package/js/modules/map.src.js +137 -67
  491. package/js/modules/no-data-to-display.js +1 -1
  492. package/js/modules/no-data-to-display.src.js +6 -6
  493. package/js/modules/offline-exporting.js +2 -2
  494. package/js/modules/offline-exporting.src.js +2 -2
  495. package/js/modules/oldie.js +2 -2
  496. package/js/modules/oldie.src.js +3 -3
  497. package/js/modules/overlapping-datalabels.js +2 -2
  498. package/js/modules/overlapping-datalabels.src.js +2 -2
  499. package/js/modules/parallel-coordinates.js +9 -9
  500. package/js/modules/parallel-coordinates.js.map +1 -1
  501. package/js/modules/parallel-coordinates.src.js +4 -3
  502. package/js/modules/pareto.js +1 -1
  503. package/js/modules/pareto.src.js +1 -1
  504. package/js/modules/pathfinder.js +34 -0
  505. package/js/modules/pathfinder.js.map +1 -0
  506. package/js/modules/pathfinder.src.js +2106 -0
  507. package/js/modules/pattern-fill.js +1 -1
  508. package/js/modules/pattern-fill.src.js +1 -1
  509. package/js/modules/sankey.js +2 -2
  510. package/js/modules/sankey.src.js +3 -3
  511. package/js/modules/series-label.js +2 -2
  512. package/js/modules/series-label.src.js +4 -4
  513. package/js/modules/solid-gauge.js +2 -2
  514. package/js/modules/solid-gauge.src.js +3 -3
  515. package/js/modules/static-scale.js +3 -3
  516. package/js/modules/static-scale.js.map +1 -1
  517. package/js/modules/static-scale.src.js +65 -26
  518. package/js/modules/stock.js +135 -134
  519. package/js/modules/stock.js.map +1 -1
  520. package/js/modules/stock.src.js +230 -157
  521. package/js/modules/streamgraph.js +2 -2
  522. package/js/modules/streamgraph.src.js +3 -3
  523. package/js/modules/sunburst.js +1 -1
  524. package/js/modules/sunburst.src.js +1 -1
  525. package/js/modules/tilemap.js +1 -1
  526. package/js/modules/tilemap.js.map +1 -1
  527. package/js/modules/tilemap.src.js +355 -188
  528. package/js/modules/treegrid.js +51 -0
  529. package/js/modules/treegrid.js.map +1 -0
  530. package/js/modules/treegrid.src.js +2759 -0
  531. package/js/modules/treemap.js +1 -1
  532. package/js/modules/treemap.src.js +1 -1
  533. package/js/modules/variable-pie.js +1 -1
  534. package/js/modules/variable-pie.src.js +1 -1
  535. package/js/modules/variwide.js +2 -2
  536. package/js/modules/variwide.src.js +3 -3
  537. package/js/modules/vector.js +2 -2
  538. package/js/modules/vector.js.map +1 -1
  539. package/js/modules/vector.src.js +94 -24
  540. package/js/modules/windbarb.js +2 -2
  541. package/js/modules/windbarb.src.js +4 -4
  542. package/js/modules/wordcloud.js +1 -1
  543. package/js/modules/wordcloud.src.js +1 -1
  544. package/js/modules/xrange.js +11 -10
  545. package/js/modules/xrange.js.map +1 -1
  546. package/js/modules/xrange.src.js +257 -70
  547. package/js/themes/avocado.js +1 -1
  548. package/js/themes/avocado.src.js +1 -1
  549. package/js/themes/dark-blue.js +2 -2
  550. package/js/themes/dark-blue.src.js +3 -3
  551. package/js/themes/dark-green.js +2 -2
  552. package/js/themes/dark-green.src.js +3 -3
  553. package/js/themes/dark-unica.js +2 -2
  554. package/js/themes/dark-unica.src.js +3 -3
  555. package/js/themes/gray.js +2 -2
  556. package/js/themes/gray.src.js +3 -3
  557. package/js/themes/grid-light.js +2 -2
  558. package/js/themes/grid-light.src.js +3 -3
  559. package/js/themes/grid.js +2 -2
  560. package/js/themes/grid.src.js +3 -3
  561. package/js/themes/sand-signika.js +2 -2
  562. package/js/themes/sand-signika.src.js +3 -3
  563. package/js/themes/skies.js +2 -2
  564. package/js/themes/skies.src.js +3 -3
  565. package/js/themes/sunset.js +1 -1
  566. package/js/themes/sunset.src.js +1 -1
  567. package/modules/accessibility.js +1 -1
  568. package/modules/accessibility.src.js +1 -1
  569. package/modules/annotations.js +2 -2
  570. package/modules/annotations.src.js +2 -2
  571. package/modules/arrow-symbols.js +13 -0
  572. package/modules/arrow-symbols.js.map +1 -0
  573. package/modules/arrow-symbols.src.js +138 -0
  574. package/modules/boost-canvas.js +1 -1
  575. package/modules/boost-canvas.src.js +1 -1
  576. package/modules/boost.js +36 -36
  577. package/modules/boost.js.map +1 -1
  578. package/modules/boost.src.js +23 -15
  579. package/modules/broken-axis.js +11 -10
  580. package/modules/broken-axis.js.map +1 -1
  581. package/modules/broken-axis.src.js +171 -136
  582. package/modules/bullet.js +1 -1
  583. package/modules/bullet.src.js +1 -1
  584. package/modules/current-date-indicator.js +13 -0
  585. package/modules/current-date-indicator.js.map +1 -0
  586. package/modules/current-date-indicator.src.js +120 -0
  587. package/modules/data.js +2 -2
  588. package/modules/data.src.js +4 -4
  589. package/modules/drag-panes.js +1 -1
  590. package/modules/drag-panes.src.js +1 -1
  591. package/modules/draggable-points.js +38 -0
  592. package/modules/draggable-points.js.map +1 -0
  593. package/modules/draggable-points.src.js +2281 -0
  594. package/modules/drilldown.js +1 -1
  595. package/modules/drilldown.js.map +1 -1
  596. package/modules/drilldown.src.js +2 -1
  597. package/modules/export-data.js +2 -2
  598. package/modules/export-data.src.js +3 -3
  599. package/modules/exporting.js +2 -2
  600. package/modules/exporting.src.js +3 -3
  601. package/modules/funnel.js +2 -2
  602. package/modules/funnel.src.js +3 -3
  603. package/modules/gantt.js +83 -19
  604. package/modules/gantt.js.map +1 -1
  605. package/modules/gantt.src.js +5553 -379
  606. package/modules/grid-axis.js +16 -11
  607. package/modules/grid-axis.js.map +1 -1
  608. package/modules/grid-axis.src.js +732 -293
  609. package/modules/heatmap.js +2 -2
  610. package/modules/heatmap.js.map +1 -1
  611. package/modules/heatmap.src.js +128 -57
  612. package/modules/histogram-bellcurve.js +1 -1
  613. package/modules/histogram-bellcurve.src.js +1 -1
  614. package/modules/item-series.js +2 -2
  615. package/modules/item-series.src.js +3 -3
  616. package/modules/map.js +2 -2
  617. package/modules/map.js.map +1 -1
  618. package/modules/map.src.js +139 -68
  619. package/modules/no-data-to-display.js +1 -1
  620. package/modules/no-data-to-display.src.js +6 -6
  621. package/modules/offline-exporting.js +2 -2
  622. package/modules/offline-exporting.src.js +2 -2
  623. package/modules/oldie.js +2 -2
  624. package/modules/oldie.src.js +3 -3
  625. package/modules/overlapping-datalabels.js +2 -2
  626. package/modules/overlapping-datalabels.src.js +2 -2
  627. package/modules/parallel-coordinates.js +8 -8
  628. package/modules/parallel-coordinates.js.map +1 -1
  629. package/modules/parallel-coordinates.src.js +4 -3
  630. package/modules/pareto.js +1 -1
  631. package/modules/pareto.src.js +1 -1
  632. package/modules/pathfinder.js +35 -0
  633. package/modules/pathfinder.js.map +1 -0
  634. package/modules/pathfinder.src.js +2128 -0
  635. package/modules/pattern-fill.js +1 -1
  636. package/modules/pattern-fill.src.js +1 -1
  637. package/modules/sankey.js +2 -2
  638. package/modules/sankey.src.js +3 -3
  639. package/modules/series-label.js +2 -2
  640. package/modules/series-label.src.js +4 -4
  641. package/modules/solid-gauge.js +2 -2
  642. package/modules/solid-gauge.src.js +3 -3
  643. package/modules/static-scale.js +3 -3
  644. package/modules/static-scale.js.map +1 -1
  645. package/modules/static-scale.src.js +65 -26
  646. package/modules/stock.js +142 -142
  647. package/modules/stock.js.map +1 -1
  648. package/modules/stock.src.js +230 -157
  649. package/modules/streamgraph.js +2 -2
  650. package/modules/streamgraph.src.js +3 -3
  651. package/modules/sunburst.js +1 -1
  652. package/modules/sunburst.src.js +1 -1
  653. package/modules/tilemap.js +1 -1
  654. package/modules/tilemap.js.map +1 -1
  655. package/modules/tilemap.src.js +357 -189
  656. package/modules/treegrid.js +52 -0
  657. package/modules/treegrid.js.map +1 -0
  658. package/modules/treegrid.src.js +2797 -0
  659. package/modules/treemap.js +1 -1
  660. package/modules/treemap.src.js +1 -1
  661. package/modules/variable-pie.js +1 -1
  662. package/modules/variable-pie.src.js +1 -1
  663. package/modules/variwide.js +2 -2
  664. package/modules/variwide.src.js +3 -3
  665. package/modules/vector.js +2 -2
  666. package/modules/vector.js.map +1 -1
  667. package/modules/vector.src.js +94 -24
  668. package/modules/windbarb.js +2 -2
  669. package/modules/windbarb.src.js +4 -4
  670. package/modules/wordcloud.js +1 -1
  671. package/modules/wordcloud.src.js +1 -1
  672. package/modules/xrange.js +12 -11
  673. package/modules/xrange.js.map +1 -1
  674. package/modules/xrange.src.js +259 -79
  675. package/package.json +1 -1
  676. package/themes/avocado.js +1 -1
  677. package/themes/avocado.src.js +1 -1
  678. package/themes/dark-blue.js +2 -2
  679. package/themes/dark-blue.src.js +3 -3
  680. package/themes/dark-green.js +2 -2
  681. package/themes/dark-green.src.js +3 -3
  682. package/themes/dark-unica.js +2 -2
  683. package/themes/dark-unica.src.js +3 -3
  684. package/themes/gray.js +2 -2
  685. package/themes/gray.src.js +3 -3
  686. package/themes/grid-light.js +2 -2
  687. package/themes/grid-light.src.js +3 -3
  688. package/themes/grid.js +2 -2
  689. package/themes/grid.src.js +3 -3
  690. package/themes/sand-signika.js +2 -2
  691. package/themes/sand-signika.src.js +3 -3
  692. package/themes/skies.js +2 -2
  693. package/themes/skies.src.js +3 -3
  694. package/themes/sunset.js +1 -1
  695. package/themes/sunset.src.js +1 -1
@@ -0,0 +1,1247 @@
1
+ /**
2
+ * (c) 2016 Highsoft AS
3
+ * Authors: Øystein Moseng, Lars A. V. Cabrera
4
+ *
5
+ * License: www.highcharts.com/license
6
+ */
7
+ 'use strict';
8
+ import H from '../parts/Globals.js';
9
+ import '../parts/Point.js';
10
+ import '../parts/Utilities.js';
11
+ import pathfinderAlgorithms from 'PathfinderAlgorithms.js';
12
+ import 'ArrowSymbols.js';
13
+
14
+ var defined = H.defined,
15
+ deg2rad = H.deg2rad,
16
+ extend = H.extend,
17
+ each = H.each,
18
+ addEvent = H.addEvent,
19
+ merge = H.merge,
20
+ pick = H.pick,
21
+ max = Math.max,
22
+ min = Math.min;
23
+
24
+ /*
25
+ TODO:
26
+ - Test dynamics, hiding/adding/removing/updating chart/series/points/axes
27
+ - Test connecting to multiple points
28
+ - Add demos/samples
29
+ - Document how to write your own algorithms
30
+ - Consider adding a Point.pathTo method that wraps creating a connection
31
+ and rendering it
32
+ */
33
+
34
+
35
+ // Set default Pathfinder options
36
+ extend(H.defaultOptions, {
37
+ /**
38
+ * The Pathfinder allows you to define connections between any two points,
39
+ * represented as lines - optionally with markers for the start and/or end
40
+ * points. Multiple algorithms are available for calculating how the
41
+ * connecting lines are drawn.
42
+ *
43
+ * Pathfinder functionality requires Highcharts Gantt to be loaded. In Gantt
44
+ * charts, the Pathfinder is used to draw dependencies between tasks.
45
+ *
46
+ * @product gantt
47
+ * @see [dependency](series.gantt.data.dependency)
48
+ * @optionparent pathfinder
49
+ */
50
+ pathfinder: {
51
+ /**
52
+ * Enable the pathfinder for this chart. Requires Highcharts Gantt.
53
+ *
54
+ * @type {boolean}
55
+ * @default true
56
+ * @since 6.2.0
57
+ * @apioption pathfinder.enabled
58
+ */
59
+
60
+ /**
61
+ * Set the default dash style for this chart's Pathfinder connecting
62
+ * lines.
63
+ *
64
+ * @type {string}
65
+ * @default solid
66
+ * @since 6.2.0
67
+ * @apioption pathfinder.dashStyle
68
+ */
69
+
70
+ /**
71
+ * Set the default color for this chart's Pathfinder connecting lines.
72
+ * Defaults to the color of the point being connected.
73
+ *
74
+ * @type {Color}
75
+ * @default null
76
+ * @since 6.2.0
77
+ * @apioption pathfinder.lineColor
78
+ */
79
+
80
+ /**
81
+ * Set the default pathfinder margin to use, in pixels. Some Pathfinder
82
+ * algorithms attempt to avoid obstacles, such as other points in the
83
+ * chart. These algorithms use this margin to determine how close lines
84
+ * can be to an obstacle. The default is to compute this automatically
85
+ * from the size of the obstacles in the chart.
86
+ *
87
+ * To draw connecting lines close to existing points, set this to a low
88
+ * number. For more space around existing points, set this number
89
+ * higher.
90
+ *
91
+ * @type {number}
92
+ * @default null
93
+ * @since 6.2.0
94
+ * @apioption pathfinder.algorithmMargin
95
+ */
96
+
97
+ /**
98
+ * Set the default pathfinder algorithm to use for this chart. It is
99
+ * possible to define your own algorithms by adding them to the
100
+ * Highcharts.Pathfinder.prototype.algorithms object after the chart
101
+ * has been created.
102
+ *
103
+ * The default algorithms are as follows:
104
+ *
105
+ * straight: Draws a straight line between the connecting points.
106
+ * Does not avoid other points when drawing.
107
+ *
108
+ * simpleConnect: Finds a path between the points using right angles
109
+ * only. Takes only starting/ending points into
110
+ * account, and will not avoid other points.
111
+ *
112
+ * fastAvoid: Finds a path between the points using right angles
113
+ * only. Will attempt to avoid other points, but its
114
+ * focus is performance over accuracy. Works well with
115
+ * less dense datasets.
116
+ *
117
+ * @type {string}
118
+ * @default straight
119
+ * @since 6.2.0
120
+ * @apioption pathfinder.type
121
+ */
122
+ type: 'straight',
123
+
124
+ /**
125
+ * Set the default pixel width for this chart's Pathfinder connecting
126
+ * lines.
127
+ *
128
+ * @type {number}
129
+ * @default 1
130
+ * @since 6.2.0
131
+ * @apioption pathfinder.lineWidth
132
+ */
133
+ lineWidth: 1,
134
+
135
+ /**
136
+ * Marker options for this chart's Pathfinder connectors.
137
+ *
138
+ * @type {object}
139
+ * @since 6.2.0
140
+ * @apioption pathfinder.marker
141
+ */
142
+ marker: {
143
+ /**
144
+ * Set the radius of the pathfinder markers. The default is
145
+ * automatically computed based on the algorithmMargin setting.
146
+ *
147
+ * Setting marker.width and marker.height will override this
148
+ * setting.
149
+ *
150
+ * @type {number}
151
+ * @default null
152
+ * @since 6.2.0
153
+ * @apioption pathfinder.marker.radius
154
+ */
155
+
156
+ /**
157
+ * Set the width of the pathfinder markers. If not supplied, this
158
+ * is inferred from the marker radius.
159
+ *
160
+ * @type {number}
161
+ * @default null
162
+ * @since 6.2.0
163
+ * @apioption pathfinder.marker.width
164
+ */
165
+
166
+ /**
167
+ * Set the height of the pathfinder markers. If not supplied, this
168
+ * is inferred from the marker radius.
169
+ *
170
+ * @type {number}
171
+ * @default null
172
+ * @since 6.2.0
173
+ * @apioption pathfinder.marker.height
174
+ */
175
+
176
+ /**
177
+ * Set the color of the pathfinder markers. By default this is the
178
+ * same as the connector color.
179
+ *
180
+ * @type {Color}
181
+ * @default null
182
+ * @since 6.2.0
183
+ * @apioption pathfinder.marker.color
184
+ */
185
+
186
+ /**
187
+ * Set the line/border color of the pathfinder markers. By default
188
+ * this is the same as the marker color.
189
+ *
190
+ * @type {Color}
191
+ * @default null
192
+ * @since 6.2.0
193
+ * @apioption pathfinder.marker.lineColor
194
+ */
195
+
196
+ /**
197
+ * Enable markers for the connectors.
198
+ */
199
+ enabled: false,
200
+
201
+ /**
202
+ * Horizontal alignment of the markers relative to the points.
203
+ */
204
+ align: 'center',
205
+
206
+ /**
207
+ * Vertical alignment of the markers relative to the points.
208
+ */
209
+ verticalAlign: 'middle',
210
+
211
+ /**
212
+ * Whether or not to draw the markers inside the points.
213
+ */
214
+ inside: false,
215
+
216
+ /**
217
+ * Set the line/border width of the pathfinder markers.
218
+ */
219
+ lineWidth: 1
220
+ },
221
+
222
+ /**
223
+ * Marker options specific to the start markers for this chart's
224
+ * Pathfinder connectors. Overrides the generic marker options.
225
+ *
226
+ * @type {object}
227
+ * @since 6.2.0
228
+ * @extends pathfinder.marker
229
+ * @apioption pathfinder.startMarker
230
+ */
231
+ startMarker: {
232
+ /**
233
+ * Set the symbol of the pathfinder start markers.
234
+ */
235
+ symbol: 'diamond'
236
+ },
237
+
238
+ /**
239
+ * Marker options specific to the end markers for this chart's
240
+ * Pathfinder connectors. Overrides the generic marker options.
241
+ *
242
+ * @type {object}
243
+ * @since 6.2.0
244
+ * @extends pathfinder.marker
245
+ * @apioption pathfinder.endMarker
246
+ */
247
+ endMarker: {
248
+ /**
249
+ * Set the symbol of the pathfinder end markers.
250
+ */
251
+ symbol: 'arrow-filled'
252
+ }
253
+ }
254
+ });
255
+
256
+ /**
257
+ * Override Pathfinder options for a series. Requires Highcharts Gantt or the
258
+ * Pathfinder module.
259
+ *
260
+ * @since 6.2.0
261
+ * @extends pathfinder
262
+ * @product gantt
263
+ * @apioption plotOptions.series.pathfinder
264
+ * @excluding enabled,algorithmMargin
265
+ */
266
+
267
+ /**
268
+ * Connect to a point. Requires Highcharts Gantt to be loaded. This option can
269
+ * be either a string, referring to the ID of another point, or an object.
270
+ *
271
+ * @type {string|object}
272
+ * @since 6.2.0
273
+ * @extends plotOptions.series.pathfinder
274
+ * @product gantt
275
+ * @apioption series.xrange.data.connect
276
+ */
277
+
278
+ /**
279
+ * The ID of the point to connect to.
280
+ *
281
+ * @type {string}
282
+ * @since 6.2.0
283
+ * @product gantt
284
+ * @apioption series.xrange.data.connect.to
285
+ */
286
+
287
+
288
+ /**
289
+ * Get point bounding box using plotX/plotY and shapeArgs. If using
290
+ * graphic.getBBox() directly, the bbox will be affected by animation.
291
+ *
292
+ * @param {Highcharts.Point} point
293
+ * The point to get BB of.
294
+ *
295
+ * @return {object}
296
+ * Result xMax, xMin, yMax, yMin.
297
+ */
298
+ function getPointBB(point) {
299
+ var shapeArgs = point.shapeArgs,
300
+ bb;
301
+
302
+ // Prefer using shapeArgs (columns)
303
+ if (shapeArgs) {
304
+ return {
305
+ xMin: shapeArgs.x,
306
+ xMax: shapeArgs.x + shapeArgs.width,
307
+ yMin: shapeArgs.y,
308
+ yMax: shapeArgs.y + shapeArgs.height
309
+ };
310
+ }
311
+
312
+ // Otherwise use plotX/plotY and bb
313
+ bb = point.graphic && point.graphic.getBBox();
314
+ return bb ? {
315
+ xMin: point.plotX - bb.width / 2,
316
+ xMax: point.plotX + bb.width / 2,
317
+ yMin: point.plotY - bb.height / 2,
318
+ yMax: point.plotY + bb.height / 2
319
+ } : null;
320
+ }
321
+
322
+
323
+ /**
324
+ * Calculate margin to place around obstacles for the pathfinder in pixels.
325
+ * Returns a minimum of 1 pixel margin.
326
+ *
327
+ * @param {Array} obstacles
328
+ * Obstacles to calculate margin from.
329
+ *
330
+ * @return {number}
331
+ * The calculated margin in pixels. At least 1.
332
+ */
333
+ function calculateObstacleMargin(obstacles) {
334
+ var len = obstacles.length,
335
+ i = 0,
336
+ j,
337
+ obstacleDistance,
338
+ distances = [],
339
+ // Compute smallest distance between two rectangles
340
+ distance = function (a, b, bbMargin) {
341
+ // Count the distance even if we are slightly off
342
+ var margin = pick(bbMargin, 10),
343
+ yOverlap = a.yMax + margin > b.yMin - margin &&
344
+ a.yMin - margin < b.yMax + margin,
345
+ xOverlap = a.xMax + margin > b.xMin - margin &&
346
+ a.xMin - margin < b.xMax + margin,
347
+ xDistance = yOverlap ? (
348
+ a.xMin > b.xMax ? a.xMin - b.xMax : b.xMin - a.xMax
349
+ ) : Infinity,
350
+ yDistance = xOverlap ? (
351
+ a.yMin > b.yMax ? a.yMin - b.yMax : b.yMin - a.yMax
352
+ ) : Infinity;
353
+
354
+ // If the rectangles collide, try recomputing with smaller margin.
355
+ // If they collide anyway, discard the obstacle.
356
+ if (xOverlap && yOverlap) {
357
+ return (
358
+ margin ?
359
+ distance(a, b, Math.floor(margin / 2)) :
360
+ Infinity
361
+ );
362
+ }
363
+
364
+ return min(xDistance, yDistance);
365
+ };
366
+
367
+ // Go over all obstacles and compare them to the others.
368
+ for (; i < len; ++i) {
369
+ // Compare to all obstacles ahead. We will already have compared this
370
+ // obstacle to the ones before.
371
+ for (j = i + 1; j < len; ++j) {
372
+ obstacleDistance = distance(obstacles[i], obstacles[j]);
373
+ // TODO: Magic number 80
374
+ if (obstacleDistance < 80) { // Ignore large distances
375
+ distances.push(obstacleDistance);
376
+ }
377
+ }
378
+ }
379
+ // Ensure we always have at least one value, even in very spaceous charts
380
+ distances.push(80);
381
+
382
+ return max(
383
+ Math.floor(
384
+ distances.sort(function (a, b) {
385
+ return a - b;
386
+ })[
387
+ // Discard first 10% of the relevant distances, and then grab
388
+ // the smallest one.
389
+ Math.floor(distances.length / 10)
390
+ ] / 2 - 1 // Divide the distance by 2 and subtract 1.
391
+ ),
392
+ 1 // 1 is the minimum margin
393
+ );
394
+ }
395
+
396
+
397
+ /**
398
+ * The Connection class. Used internally to represent a connection between two
399
+ * points.
400
+ *
401
+ * @private
402
+ * @class Connection
403
+ *
404
+ * @param {Highcharts.Point} from
405
+ * Connection runs from this Point.
406
+ *
407
+ * @param {Highcharts.Point} to
408
+ * Connection runs to this Point.
409
+ *
410
+ * @param {object} [options]
411
+ * Connection options.
412
+ */
413
+ function Connection(from, to, options) {
414
+ this.init(from, to, options);
415
+ }
416
+ Connection.prototype = {
417
+
418
+ /**
419
+ * Initialize the Connection object. Used as constructor only.
420
+ *
421
+ * @function Highcharts.Connection#init
422
+ *
423
+ * @param {Highcharts.Point} from
424
+ * Connection runs from this Point.
425
+ *
426
+ * @param {Highcharts.Point} to
427
+ * Connection runs to this Point.
428
+ *
429
+ * @param {object} [options]
430
+ * Connection options.
431
+ *
432
+ * @return {void}
433
+ */
434
+ init: function (from, to, options) {
435
+ this.fromPoint = from;
436
+ this.toPoint = to;
437
+ this.options = options;
438
+ this.chart = from.series.chart;
439
+ this.pathfinder = this.chart.pathfinder;
440
+ },
441
+
442
+ /**
443
+ * Add (or update) this connection's path on chart. Stores reference to the
444
+ * created element on this.graphics.path.
445
+ *
446
+ * @function Highcharts.Connection#renderPath
447
+ *
448
+ * @param {Array} path
449
+ * Path to render, in array format. E.g. ['M', 0, 0, 'L', 10, 10]
450
+ *
451
+ * @param {object} [attribs]
452
+ * SVG attributes for the path.
453
+ *
454
+ * @param {object} [animation]
455
+ * Animation options for the rendering.
456
+ *
457
+ * @param {Function} [complete]
458
+ * Callback function when the path has been rendered and animation
459
+ * is complete.
460
+ *
461
+ * @return {void}
462
+ */
463
+ renderPath: function (path, attribs, animation) {
464
+ var connection = this,
465
+ chart = this.chart,
466
+ pathfinder = chart.pathfinder,
467
+ animate = !chart.options.chart.forExport && animation !== false,
468
+ pathGraphic = connection.graphics && connection.graphics.path;
469
+
470
+ // Add the SVG element of the pathfinder group if it doesn't exist
471
+ if (!pathfinder.group) {
472
+ pathfinder.group = chart.renderer.g()
473
+ .addClass('highcharts-pathfinder-group')
474
+ .attr({ zIndex: -1 })
475
+ .add(chart.seriesGroup);
476
+ }
477
+
478
+ // Shift the group to compensate for plot area.
479
+ // Note: Do this always (even when redrawing a path) to avoid issues
480
+ // when updating chart in a way that changes plot metrics.
481
+ pathfinder.group.translate(chart.plotLeft, chart.plotTop);
482
+
483
+ // Create path if does not exist
484
+ if (!(pathGraphic && pathGraphic.renderer)) {
485
+ pathGraphic = chart.renderer.path()
486
+
487
+ .attr({
488
+ opacity: 0
489
+ })
490
+
491
+ .add(pathfinder.group);
492
+ }
493
+
494
+ // Set path attribs and animate to the new path
495
+ pathGraphic.attr(attribs);
496
+ pathGraphic[animate ? 'animate' : 'attr']({
497
+
498
+ opacity: 1,
499
+
500
+ d: path
501
+ }, animation);
502
+
503
+ // Store reference on connection
504
+ this.graphics = this.graphics || {};
505
+ this.graphics.path = pathGraphic;
506
+ },
507
+
508
+ /**
509
+ * Calculate and add marker graphics for connection to the chart. The
510
+ * created/updated elements are stored on this.graphics.start and
511
+ * this.graphics.end.
512
+ *
513
+ * @function Highcharts.Connection#addMarker
514
+ *
515
+ * @param {string} type
516
+ * Marker type, either 'start' or 'end'.
517
+ *
518
+ * @param {object} options
519
+ * All options for this marker. Not calculated or merged with other
520
+ * options.
521
+ *
522
+ * @param {Array} path
523
+ * Connection path in array format. This is used to calculate the
524
+ * rotation angle of the markers.
525
+ *
526
+ * @return {void}
527
+ */
528
+ addMarker: function (type, options, path) {
529
+ var connection = this,
530
+ chart = connection.fromPoint.series.chart,
531
+ pathfinder = chart.pathfinder,
532
+ renderer = chart.renderer,
533
+ point = (
534
+ type === 'start' ?
535
+ connection.fromPoint :
536
+ connection.toPoint
537
+ ),
538
+ anchor = point.getPathfinderAnchorPoint(options),
539
+ markerVector,
540
+ radians,
541
+ rotation,
542
+ box,
543
+ width,
544
+ height,
545
+ pathVector;
546
+
547
+
548
+ if (!options.enabled) {
549
+ return;
550
+ }
551
+
552
+ // Last vector before start/end of path, used to get angle
553
+ if (type === 'start') {
554
+ pathVector = {
555
+ x: path[4],
556
+ y: path[5]
557
+ };
558
+ } else { // 'end'
559
+ pathVector = {
560
+ x: path[path.length - 5],
561
+ y: path[path.length - 4]
562
+ };
563
+ }
564
+
565
+ // Get angle between pathVector and anchor point and use it to create
566
+ // marker position.
567
+ radians = point.getRadiansToVector(pathVector, anchor);
568
+ markerVector = point.getMarkerVector(
569
+ radians,
570
+ options.radius,
571
+ anchor
572
+ );
573
+
574
+ // Rotation of marker is calculated from angle between pathVector and
575
+ // markerVector.
576
+ // (Note:
577
+ // Used to recalculate radians between markerVector and pathVector,
578
+ // but this should be the same as between pathVector and anchor.)
579
+ rotation = -radians / deg2rad;
580
+
581
+ if (options.width && options.height) {
582
+ width = options.width;
583
+ height = options.height;
584
+ } else {
585
+ width = height = options.radius * 2;
586
+ }
587
+
588
+ // Add graphics object if it does not exist
589
+ connection.graphics = connection.graphics || {};
590
+ box = {
591
+ x: markerVector.x - (width / 2),
592
+ y: markerVector.y - (height / 2),
593
+ width: width,
594
+ height: height,
595
+ rotation: rotation,
596
+ rotationOriginX: markerVector.x,
597
+ rotationOriginY: markerVector.y
598
+ };
599
+
600
+ if (!connection.graphics[type]) {
601
+
602
+ // Create new marker element
603
+ connection.graphics[type] = renderer.symbol(
604
+ options.symbol
605
+ )
606
+ .addClass(
607
+ 'highcharts-point-connecting-path-' + type + '-marker'
608
+ )
609
+ .attr(box)
610
+
611
+
612
+ .attr({
613
+ fill: options.color || connection.fromPoint.color,
614
+ stroke: options.lineColor,
615
+ 'stroke-width': options.lineWidth,
616
+ opacity: 0
617
+ })
618
+ .animate({
619
+ opacity: 1
620
+ }, point.series.options.animation)
621
+
622
+ .add(pathfinder.group);
623
+ } else {
624
+ connection.graphics[type].animate(box);
625
+ }
626
+ },
627
+
628
+ /**
629
+ * Calculate and return connection path.
630
+ * Note: Recalculates chart obstacles on demand if they aren't calculated.
631
+ *
632
+ * @function Highcharts.Connection#getPath
633
+ *
634
+ * @param {object} options
635
+ * Pathfinder options. Not calculated or merged with other options.
636
+ *
637
+ * @return {Array}
638
+ * Calculated SVG path data in array format.
639
+ */
640
+ getPath: function (options) {
641
+ var pathfinder = this.pathfinder,
642
+ chart = this.chart,
643
+ algorithm = pathfinder.algorithms[options.type],
644
+ chartObstacles = pathfinder.chartObstacles;
645
+
646
+ if (typeof algorithm !== 'function') {
647
+ H.error(
648
+ '"' + options.type + '" is not a Pathfinder algorithm.'
649
+ );
650
+ return;
651
+ }
652
+
653
+ // This function calculates obstacles on demand if they don't exist
654
+ if (algorithm.requiresObstacles && !chartObstacles) {
655
+ chartObstacles =
656
+ pathfinder.chartObstacles =
657
+ pathfinder.getChartObstacles(options);
658
+
659
+ // If the algorithmMargin was computed, store the result in default
660
+ // options.
661
+ chart.options.pathfinder.algorithmMargin = options.algorithmMargin;
662
+
663
+ // Cache some metrics too
664
+ pathfinder.chartObstacleMetrics =
665
+ pathfinder.getObstacleMetrics(chartObstacles);
666
+ }
667
+
668
+ // Get the SVG path
669
+ return algorithm(
670
+ // From
671
+ this.fromPoint.getPathfinderAnchorPoint(options.startMarker),
672
+ // To
673
+ this.toPoint.getPathfinderAnchorPoint(options.endMarker),
674
+ merge({
675
+ chartObstacles: chartObstacles,
676
+ lineObstacles: pathfinder.lineObstacles || [],
677
+ obstacleMetrics: pathfinder.chartObstacleMetrics,
678
+ hardBounds: {
679
+ xMin: 0,
680
+ xMax: chart.plotWidth,
681
+ yMin: 0,
682
+ yMax: chart.plotHeight
683
+ },
684
+ obstacleOptions: {
685
+ margin: options.algorithmMargin
686
+ },
687
+ startDirectionX: pathfinder.getAlgorithmStartDirection(
688
+ options.startMarker
689
+ )
690
+ }, options)
691
+ );
692
+ },
693
+
694
+ /**
695
+ * (re)Calculate and (re)draw the connection.
696
+ *
697
+ * @function Highcharts.Connection#render
698
+ */
699
+ render: function () {
700
+ var connection = this,
701
+ fromPoint = connection.fromPoint,
702
+ series = fromPoint.series,
703
+ chart = series.chart,
704
+ pathfinder = chart.pathfinder,
705
+ pathResult,
706
+ path,
707
+ options = merge(
708
+ chart.options.pathfinder, series.options.pathfinder,
709
+ fromPoint.options.pathfinder, connection.options
710
+ ),
711
+ attribs = {};
712
+
713
+ // Set path attribs
714
+
715
+ attribs.stroke = options.lineColor || fromPoint.color;
716
+ attribs['stroke-width'] = options.lineWidth;
717
+ if (options.dashStyle) {
718
+ attribs.dashstyle = options.dashStyle;
719
+ }
720
+
721
+
722
+ attribs.class = 'highcharts-point-connecting-path ' +
723
+ 'highcharts-color-' + fromPoint.colorIndex;
724
+ options = merge(attribs, options);
725
+
726
+ // Set common marker options
727
+ if (!defined(options.marker.radius)) {
728
+ options.marker.radius = min(max(
729
+ Math.ceil((options.algorithmMargin || 8) / 2) - 1, 1
730
+ ), 5);
731
+ }
732
+ // Get the path
733
+ pathResult = connection.getPath(options);
734
+ path = pathResult.path;
735
+
736
+ // Always update obstacle storage with obstacles from this path.
737
+ // We don't know if future calls will need this for their algorithm.
738
+ if (pathResult.obstacles) {
739
+ pathfinder.lineObstacles = pathfinder.lineObstacles || [];
740
+ pathfinder.lineObstacles =
741
+ pathfinder.lineObstacles.concat(pathResult.obstacles);
742
+ }
743
+
744
+ // Add the calculated path to the pathfinder group
745
+ connection.renderPath(path, attribs, series.options.animation);
746
+
747
+ // Render the markers
748
+ connection.addMarker(
749
+ 'start',
750
+ merge(options.marker, options.startMarker),
751
+ path
752
+ );
753
+ connection.addMarker(
754
+ 'end',
755
+ merge(options.marker, options.endMarker),
756
+ path
757
+ );
758
+ },
759
+
760
+ /**
761
+ * Destroy connection by destroying the added graphics elements.
762
+ *
763
+ * @function Highcharts.Connection#destroy
764
+ */
765
+ destroy: function () {
766
+ if (this.graphics) {
767
+ H.objectEach(this.graphics, function (val) {
768
+ val.destroy();
769
+ });
770
+ delete this.graphics;
771
+ }
772
+ }
773
+ };
774
+
775
+
776
+ /**
777
+ * The Pathfinder class.
778
+ *
779
+ * @private
780
+ * @class Pathfinder
781
+ *
782
+ * @param {Highcharts.Chart} chart
783
+ * The chart to operate on.
784
+ */
785
+ function Pathfinder(chart) {
786
+ this.init(chart);
787
+ }
788
+ Pathfinder.prototype = {
789
+
790
+ algorithms: pathfinderAlgorithms,
791
+
792
+ /**
793
+ * Initialize the Pathfinder object.
794
+ *
795
+ * @function Highcharts.Pathfinder#init
796
+ *
797
+ * @param {Highcharts.Chart} chart
798
+ * The chart context.
799
+ *
800
+ * @return {void}
801
+ */
802
+ init: function (chart) {
803
+ // Initialize pathfinder with chart context
804
+ this.chart = chart;
805
+
806
+ // Init connection reference list
807
+ this.connections = [];
808
+
809
+ // Recalculate paths/obstacles on chart redraw
810
+ addEvent(chart, 'redraw', function () {
811
+ this.pathfinder.update();
812
+ });
813
+ },
814
+
815
+ /**
816
+ * Update Pathfinder connections from scratch.
817
+ *
818
+ * @function Highcharts.Pathfinder#update
819
+ *
820
+ * @param {boolean} deferRender Whether or not to defer rendering of
821
+ * connections until series.afterAnimate event has fired. Used on first
822
+ * render.
823
+ */
824
+ update: function (deferRender) {
825
+ var chart = this.chart,
826
+ pathfinder = this,
827
+ oldConnections = pathfinder.connections;
828
+
829
+ // Rebuild pathfinder connections from options
830
+ pathfinder.connections = [];
831
+ each(chart.series, function (series) {
832
+ if (series.visible) {
833
+ each(series.points, function (point) {
834
+ var to,
835
+ connects = (
836
+ point.options &&
837
+ point.options.connect &&
838
+ H.splat(point.options.connect)
839
+ );
840
+ if (point.visible && point.isInside !== false && connects) {
841
+ each(connects, function (connect) {
842
+ to = chart.get(typeof connect === 'string' ?
843
+ connect : connect.to
844
+ );
845
+ if (
846
+ to instanceof H.Point &&
847
+ to.series.visible &&
848
+ to.visible &&
849
+ to.isInside !== false
850
+ ) {
851
+ // Add new connection
852
+ pathfinder.connections.push(new Connection(
853
+ point, // from
854
+ to,
855
+ typeof connect === 'string' ? {} : connect
856
+ ));
857
+ }
858
+ });
859
+ }
860
+ });
861
+ }
862
+ });
863
+
864
+ // Clear connections that should not be updated, and move old info over
865
+ // to new connections.
866
+ for (
867
+ var j = 0, k, found, lenOld = oldConnections.length,
868
+ lenNew = pathfinder.connections.length;
869
+ j < lenOld;
870
+ ++j
871
+ ) {
872
+ found = false;
873
+ for (k = 0; k < lenNew; ++k) {
874
+ if (
875
+ oldConnections[j].fromPoint ===
876
+ pathfinder.connections[k].fromPoint &&
877
+ oldConnections[j].toPoint ===
878
+ pathfinder.connections[k].toPoint
879
+ ) {
880
+ pathfinder.connections[k].graphics =
881
+ oldConnections[j].graphics;
882
+ found = true;
883
+ break;
884
+ }
885
+ }
886
+ if (!found) {
887
+ oldConnections[j].destroy();
888
+ }
889
+ }
890
+
891
+ // Clear obstacles to force recalculation. This must be done on every
892
+ // redraw in case positions have changed. Recalculation is handled in
893
+ // Connection.getPath on demand.
894
+ delete this.chartObstacles;
895
+ delete this.lineObstacles;
896
+
897
+ // Draw the pending connections
898
+ pathfinder.renderConnections(deferRender);
899
+ },
900
+
901
+ /**
902
+ * Draw the chart's connecting paths.
903
+ *
904
+ * @function Highcharts.Pathfinder#renderConnections
905
+ *
906
+ * @param {boolean} deferRender Whether or not to defer render until series
907
+ * animation is finished. Used on first render.
908
+ */
909
+ renderConnections: function (deferRender) {
910
+ if (deferRender) {
911
+ // Render after series are done animating
912
+ each(this.chart.series, function (series) {
913
+ var render = function () {
914
+ // Find pathfinder connections belonging to this series
915
+ // that haven't rendered, and render them now.
916
+ var pathfinder = series.chart.pathfinder,
917
+ conns = pathfinder && pathfinder.connections || [];
918
+ each(conns, function (connection) {
919
+ if (
920
+ connection.fromPoint &&
921
+ connection.fromPoint.series === series
922
+ ) {
923
+ connection.render();
924
+ }
925
+ });
926
+ if (series.pathfinderRemoveRenderEvent) {
927
+ series.pathfinderRemoveRenderEvent();
928
+ delete series.pathfinderRemoveRenderEvent;
929
+ }
930
+ };
931
+ if (series.options.animation === false) {
932
+ render();
933
+ } else {
934
+ series.pathfinderRemoveRenderEvent = addEvent(
935
+ series, 'afterAnimate', render
936
+ );
937
+ }
938
+ });
939
+ } else {
940
+ // Go through connections and render them
941
+ each(this.connections, function (connection) {
942
+ connection.render();
943
+ });
944
+ }
945
+ },
946
+
947
+ /**
948
+ * Get obstacles for the points in the chart. Does not include connecting
949
+ * lines from Pathfinder. Applies algorithmMargin to the obstacles.
950
+ *
951
+ * @function Highcharts.Pathfinder#getChartObstacles
952
+ *
953
+ * @param {object} options
954
+ * Options for the calculation. Currenlty only
955
+ * options.algorithmMargin.
956
+ *
957
+ * @return {Array}
958
+ * An array of calculated obstacles. Each obstacle is defined as
959
+ * an object with xMin, xMax, yMin and yMax properties.
960
+ */
961
+ getChartObstacles: function (options) {
962
+ var obstacles = [],
963
+ series = this.chart.series,
964
+ margin = pick(options.algorithmMargin, 0),
965
+ calculatedMargin;
966
+ for (var i = 0, sLen = series.length; i < sLen; ++i) {
967
+ if (series[i].visible) {
968
+ for (
969
+ var j = 0, pLen = series[i].points.length, bb, point;
970
+ j < pLen;
971
+ ++j
972
+ ) {
973
+ point = series[i].points[j];
974
+ if (point.visible) {
975
+ bb = getPointBB(point);
976
+ if (bb) {
977
+ obstacles.push({
978
+ xMin: bb.xMin - margin,
979
+ xMax: bb.xMax + margin,
980
+ yMin: bb.yMin - margin,
981
+ yMax: bb.yMax + margin
982
+ });
983
+ }
984
+ }
985
+ }
986
+ }
987
+ }
988
+
989
+ // Sort obstacles by xMin for optimization
990
+ obstacles = obstacles.sort(function (a, b) {
991
+ return a.xMin - b.xMin;
992
+ });
993
+
994
+ // Add auto-calculated margin if the option is not defined
995
+ if (!defined(options.algorithmMargin)) {
996
+ calculatedMargin =
997
+ options.algorithmMargin =
998
+ calculateObstacleMargin(obstacles);
999
+ each(obstacles, function (obstacle) {
1000
+ obstacle.xMin -= calculatedMargin;
1001
+ obstacle.xMax += calculatedMargin;
1002
+ obstacle.yMin -= calculatedMargin;
1003
+ obstacle.yMax += calculatedMargin;
1004
+ });
1005
+ }
1006
+
1007
+ return obstacles;
1008
+ },
1009
+
1010
+ /**
1011
+ * Utility function to get metrics for obstacles:
1012
+ * - Widest obstacle width
1013
+ * - Tallest obstacle height
1014
+ *
1015
+ * @function Highcharts.Pathfinder#getObstacleMetrics
1016
+ *
1017
+ * @param {Array} obstacles
1018
+ * An array of obstacles to inspect.
1019
+ *
1020
+ * @return {object}
1021
+ * The calculated metrics, as an object with maxHeight and maxWidth
1022
+ * properties.
1023
+ */
1024
+ getObstacleMetrics: function (obstacles) {
1025
+ var maxWidth = 0,
1026
+ maxHeight = 0,
1027
+ width,
1028
+ height,
1029
+ i = obstacles.length;
1030
+
1031
+ while (i--) {
1032
+ width = obstacles[i].xMax - obstacles[i].xMin;
1033
+ height = obstacles[i].yMax - obstacles[i].yMin;
1034
+ if (maxWidth < width) {
1035
+ maxWidth = width;
1036
+ }
1037
+ if (maxHeight < height) {
1038
+ maxHeight = height;
1039
+ }
1040
+ }
1041
+
1042
+ return {
1043
+ maxHeight: maxHeight,
1044
+ maxWidth: maxWidth
1045
+ };
1046
+ },
1047
+
1048
+ /**
1049
+ * Utility to get which direction to start the pathfinding algorithm
1050
+ * (X vs Y), calculated from a set of marker options.
1051
+ *
1052
+ * @function Highcharts.Pathfinder#getAlgorithmStartDirection
1053
+ *
1054
+ * @param {object} markerOptions
1055
+ * Marker options to calculate from.
1056
+ *
1057
+ * @return {boolean}
1058
+ * Returns true for X, false for Y, and undefined for
1059
+ * autocalculate.
1060
+ */
1061
+ getAlgorithmStartDirection: function (markerOptions) {
1062
+ var xCenter = markerOptions.align !== 'left' &&
1063
+ markerOptions.align !== 'right',
1064
+ yCenter = markerOptions.verticalAlign !== 'top' &&
1065
+ markerOptions.verticalAlign !== 'bottom',
1066
+ undef;
1067
+
1068
+ return xCenter ?
1069
+ (yCenter ? undef : false) : // x is centered
1070
+ (yCenter ? true : undef); // x is off-center
1071
+ }
1072
+ };
1073
+
1074
+ // Add to Highcharts namespace
1075
+ H.Connection = Connection;
1076
+ H.Pathfinder = Pathfinder;
1077
+
1078
+
1079
+ // Add pathfinding capabilities to Points
1080
+ extend(H.Point.prototype, /** @lends Point.prototype */ {
1081
+
1082
+ /**
1083
+ * Get coordinates of anchor point for pathfinder connection.
1084
+ *
1085
+ * @private
1086
+ * @function Highcharts.Point#getPathfinderAnchorPoint
1087
+ *
1088
+ * @param {object} markerOptions
1089
+ * Connection options for position on point.
1090
+ *
1091
+ * @return {object}
1092
+ * An object with x/y properties for the position. Coordinates are
1093
+ * in plot values, not relative to point.
1094
+ */
1095
+ getPathfinderAnchorPoint: function (markerOptions) {
1096
+ var bb = getPointBB(this),
1097
+ x,
1098
+ y;
1099
+
1100
+ switch (markerOptions.align) { // eslint-disable-line default-case
1101
+ case 'right':
1102
+ x = 'xMax';
1103
+ break;
1104
+ case 'left':
1105
+ x = 'xMin';
1106
+ }
1107
+
1108
+ switch (markerOptions.verticalAlign) { // eslint-disable-line default-case
1109
+ case 'top':
1110
+ y = 'yMin';
1111
+ break;
1112
+ case 'bottom':
1113
+ y = 'yMax';
1114
+ }
1115
+
1116
+ return {
1117
+ x: x ? bb[x] : (bb.xMin + bb.xMax) / 2,
1118
+ y: y ? bb[y] : (bb.yMin + bb.yMax) / 2
1119
+ };
1120
+ },
1121
+
1122
+ /**
1123
+ * Utility to get the angle from one point to another.
1124
+ *
1125
+ * @private
1126
+ * @function Highcharts.Point#getRadiansToVector
1127
+ *
1128
+ * @param {object} v1
1129
+ * The first vector, as an object with x/y properties.
1130
+ *
1131
+ * @param {object} v2
1132
+ * The second vector, as an object with x/y properties.
1133
+ *
1134
+ * @return {number}
1135
+ * The angle in degrees
1136
+ */
1137
+ getRadiansToVector: function (v1, v2) {
1138
+ var box;
1139
+ if (!defined(v2)) {
1140
+ box = getPointBB(this);
1141
+ v2 = {
1142
+ x: (box.xMin + box.xMax) / 2,
1143
+ y: (box.yMin + box.yMax) / 2
1144
+ };
1145
+ }
1146
+ return Math.atan2(v2.y - v1.y, v1.x - v2.x);
1147
+ },
1148
+
1149
+ /**
1150
+ * Utility to get the position of the marker, based on the path angle and
1151
+ * the marker's radius.
1152
+ *
1153
+ * @private
1154
+ * @function Highcharts.Point#getMarkerVector
1155
+ *
1156
+ * @param {number} radians
1157
+ * The angle in radians from the point center to another vector.
1158
+ *
1159
+ * @param {number} markerRadius
1160
+ * The radius of the marker, to calculate the additional distance
1161
+ * to the center of the marker.
1162
+ *
1163
+ * @param {object} anchor
1164
+ * The anchor point of the path and marker as an object with x/y
1165
+ * properties.
1166
+ *
1167
+ * @return {object}
1168
+ * The marker vector as an object with x/y properties.
1169
+ */
1170
+ getMarkerVector: function (radians, markerRadius, anchor) {
1171
+ var twoPI = Math.PI * 2.0,
1172
+ theta = radians,
1173
+ bb = getPointBB(this),
1174
+ rectWidth = bb.xMax - bb.xMin,
1175
+ rectHeight = bb.yMax - bb.yMin,
1176
+ rAtan = Math.atan2(rectHeight, rectWidth),
1177
+ tanTheta = 1,
1178
+ leftOrRightRegion = false,
1179
+ rectHalfWidth = rectWidth / 2.0,
1180
+ rectHalfHeight = rectHeight / 2.0,
1181
+ rectHorizontalCenter = bb.xMin + rectHalfWidth,
1182
+ rectVerticalCenter = bb.yMin + rectHalfHeight,
1183
+ edgePoint = {
1184
+ x: rectHorizontalCenter,
1185
+ y: rectVerticalCenter
1186
+ },
1187
+ markerPoint = {},
1188
+ xFactor = 1,
1189
+ yFactor = 1;
1190
+
1191
+ while (theta < -Math.PI) {
1192
+ theta += twoPI;
1193
+ }
1194
+
1195
+ while (theta > Math.PI) {
1196
+ theta -= twoPI;
1197
+ }
1198
+
1199
+ tanTheta = Math.tan(theta);
1200
+
1201
+ if ((theta > -rAtan) && (theta <= rAtan)) {
1202
+ // Right side
1203
+ yFactor = -1;
1204
+ leftOrRightRegion = true;
1205
+ } else if (theta > rAtan && theta <= (Math.PI - rAtan)) {
1206
+ // Top side
1207
+ yFactor = -1;
1208
+ } else if (theta > (Math.PI - rAtan) || theta <= -(Math.PI - rAtan)) {
1209
+ // Left side
1210
+ xFactor = -1;
1211
+ leftOrRightRegion = true;
1212
+ } else {
1213
+ // Bottom side
1214
+ xFactor = -1;
1215
+ }
1216
+
1217
+ // Correct the edgePoint according to the placement of the marker
1218
+ if (leftOrRightRegion) {
1219
+ edgePoint.x += xFactor * (rectHalfWidth);
1220
+ edgePoint.y += yFactor * (rectHalfWidth) * tanTheta;
1221
+ } else {
1222
+ edgePoint.x += xFactor * (rectHeight / (2.0 * tanTheta));
1223
+ edgePoint.y += yFactor * (rectHalfHeight);
1224
+ }
1225
+
1226
+ if (anchor.x !== rectHorizontalCenter) {
1227
+ edgePoint.x = anchor.x;
1228
+ }
1229
+ if (anchor.y !== rectVerticalCenter) {
1230
+ edgePoint.y = anchor.y;
1231
+ }
1232
+
1233
+ markerPoint.x = edgePoint.x + (markerRadius * Math.cos(theta));
1234
+ markerPoint.y = edgePoint.y - (markerRadius * Math.sin(theta));
1235
+
1236
+ return markerPoint;
1237
+ }
1238
+ });
1239
+
1240
+ // Initialize Pathfinder for charts
1241
+ H.Chart.prototype.callbacks.push(function (chart) {
1242
+ var options = chart.options;
1243
+ if (options.pathfinder.enabled !== false) {
1244
+ this.pathfinder = new Pathfinder(this);
1245
+ this.pathfinder.update(true); // First draw, defer render
1246
+ }
1247
+ });