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,1225 @@
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
+ .add(pathfinder.group);
488
+ }
489
+
490
+ // Set path attribs and animate to the new path
491
+ pathGraphic.attr(attribs);
492
+ pathGraphic[animate ? 'animate' : 'attr']({
493
+
494
+ d: path
495
+ }, animation);
496
+
497
+ // Store reference on connection
498
+ this.graphics = this.graphics || {};
499
+ this.graphics.path = pathGraphic;
500
+ },
501
+
502
+ /**
503
+ * Calculate and add marker graphics for connection to the chart. The
504
+ * created/updated elements are stored on this.graphics.start and
505
+ * this.graphics.end.
506
+ *
507
+ * @function Highcharts.Connection#addMarker
508
+ *
509
+ * @param {string} type
510
+ * Marker type, either 'start' or 'end'.
511
+ *
512
+ * @param {object} options
513
+ * All options for this marker. Not calculated or merged with other
514
+ * options.
515
+ *
516
+ * @param {Array} path
517
+ * Connection path in array format. This is used to calculate the
518
+ * rotation angle of the markers.
519
+ *
520
+ * @return {void}
521
+ */
522
+ addMarker: function (type, options, path) {
523
+ var connection = this,
524
+ chart = connection.fromPoint.series.chart,
525
+ pathfinder = chart.pathfinder,
526
+ renderer = chart.renderer,
527
+ point = (
528
+ type === 'start' ?
529
+ connection.fromPoint :
530
+ connection.toPoint
531
+ ),
532
+ anchor = point.getPathfinderAnchorPoint(options),
533
+ markerVector,
534
+ radians,
535
+ rotation,
536
+ box,
537
+ width,
538
+ height,
539
+ pathVector;
540
+
541
+
542
+ if (!options.enabled) {
543
+ return;
544
+ }
545
+
546
+ // Last vector before start/end of path, used to get angle
547
+ if (type === 'start') {
548
+ pathVector = {
549
+ x: path[4],
550
+ y: path[5]
551
+ };
552
+ } else { // 'end'
553
+ pathVector = {
554
+ x: path[path.length - 5],
555
+ y: path[path.length - 4]
556
+ };
557
+ }
558
+
559
+ // Get angle between pathVector and anchor point and use it to create
560
+ // marker position.
561
+ radians = point.getRadiansToVector(pathVector, anchor);
562
+ markerVector = point.getMarkerVector(
563
+ radians,
564
+ options.radius,
565
+ anchor
566
+ );
567
+
568
+ // Rotation of marker is calculated from angle between pathVector and
569
+ // markerVector.
570
+ // (Note:
571
+ // Used to recalculate radians between markerVector and pathVector,
572
+ // but this should be the same as between pathVector and anchor.)
573
+ rotation = -radians / deg2rad;
574
+
575
+ if (options.width && options.height) {
576
+ width = options.width;
577
+ height = options.height;
578
+ } else {
579
+ width = height = options.radius * 2;
580
+ }
581
+
582
+ // Add graphics object if it does not exist
583
+ connection.graphics = connection.graphics || {};
584
+ box = {
585
+ x: markerVector.x - (width / 2),
586
+ y: markerVector.y - (height / 2),
587
+ width: width,
588
+ height: height,
589
+ rotation: rotation,
590
+ rotationOriginX: markerVector.x,
591
+ rotationOriginY: markerVector.y
592
+ };
593
+
594
+ if (!connection.graphics[type]) {
595
+
596
+ // Create new marker element
597
+ connection.graphics[type] = renderer.symbol(
598
+ options.symbol
599
+ )
600
+ .addClass(
601
+ 'highcharts-point-connecting-path-' + type + '-marker'
602
+ )
603
+ .attr(box)
604
+
605
+
606
+ .add(pathfinder.group);
607
+ } else {
608
+ connection.graphics[type].animate(box);
609
+ }
610
+ },
611
+
612
+ /**
613
+ * Calculate and return connection path.
614
+ * Note: Recalculates chart obstacles on demand if they aren't calculated.
615
+ *
616
+ * @function Highcharts.Connection#getPath
617
+ *
618
+ * @param {object} options
619
+ * Pathfinder options. Not calculated or merged with other options.
620
+ *
621
+ * @return {Array}
622
+ * Calculated SVG path data in array format.
623
+ */
624
+ getPath: function (options) {
625
+ var pathfinder = this.pathfinder,
626
+ chart = this.chart,
627
+ algorithm = pathfinder.algorithms[options.type],
628
+ chartObstacles = pathfinder.chartObstacles;
629
+
630
+ if (typeof algorithm !== 'function') {
631
+ H.error(
632
+ '"' + options.type + '" is not a Pathfinder algorithm.'
633
+ );
634
+ return;
635
+ }
636
+
637
+ // This function calculates obstacles on demand if they don't exist
638
+ if (algorithm.requiresObstacles && !chartObstacles) {
639
+ chartObstacles =
640
+ pathfinder.chartObstacles =
641
+ pathfinder.getChartObstacles(options);
642
+
643
+ // If the algorithmMargin was computed, store the result in default
644
+ // options.
645
+ chart.options.pathfinder.algorithmMargin = options.algorithmMargin;
646
+
647
+ // Cache some metrics too
648
+ pathfinder.chartObstacleMetrics =
649
+ pathfinder.getObstacleMetrics(chartObstacles);
650
+ }
651
+
652
+ // Get the SVG path
653
+ return algorithm(
654
+ // From
655
+ this.fromPoint.getPathfinderAnchorPoint(options.startMarker),
656
+ // To
657
+ this.toPoint.getPathfinderAnchorPoint(options.endMarker),
658
+ merge({
659
+ chartObstacles: chartObstacles,
660
+ lineObstacles: pathfinder.lineObstacles || [],
661
+ obstacleMetrics: pathfinder.chartObstacleMetrics,
662
+ hardBounds: {
663
+ xMin: 0,
664
+ xMax: chart.plotWidth,
665
+ yMin: 0,
666
+ yMax: chart.plotHeight
667
+ },
668
+ obstacleOptions: {
669
+ margin: options.algorithmMargin
670
+ },
671
+ startDirectionX: pathfinder.getAlgorithmStartDirection(
672
+ options.startMarker
673
+ )
674
+ }, options)
675
+ );
676
+ },
677
+
678
+ /**
679
+ * (re)Calculate and (re)draw the connection.
680
+ *
681
+ * @function Highcharts.Connection#render
682
+ */
683
+ render: function () {
684
+ var connection = this,
685
+ fromPoint = connection.fromPoint,
686
+ series = fromPoint.series,
687
+ chart = series.chart,
688
+ pathfinder = chart.pathfinder,
689
+ pathResult,
690
+ path,
691
+ options = merge(
692
+ chart.options.pathfinder, series.options.pathfinder,
693
+ fromPoint.options.pathfinder, connection.options
694
+ ),
695
+ attribs = {};
696
+
697
+ // Set path attribs
698
+
699
+
700
+ attribs.class = 'highcharts-point-connecting-path ' +
701
+ 'highcharts-color-' + fromPoint.colorIndex;
702
+ options = merge(attribs, options);
703
+
704
+ // Set common marker options
705
+ if (!defined(options.marker.radius)) {
706
+ options.marker.radius = min(max(
707
+ Math.ceil((options.algorithmMargin || 8) / 2) - 1, 1
708
+ ), 5);
709
+ }
710
+ // Get the path
711
+ pathResult = connection.getPath(options);
712
+ path = pathResult.path;
713
+
714
+ // Always update obstacle storage with obstacles from this path.
715
+ // We don't know if future calls will need this for their algorithm.
716
+ if (pathResult.obstacles) {
717
+ pathfinder.lineObstacles = pathfinder.lineObstacles || [];
718
+ pathfinder.lineObstacles =
719
+ pathfinder.lineObstacles.concat(pathResult.obstacles);
720
+ }
721
+
722
+ // Add the calculated path to the pathfinder group
723
+ connection.renderPath(path, attribs, series.options.animation);
724
+
725
+ // Render the markers
726
+ connection.addMarker(
727
+ 'start',
728
+ merge(options.marker, options.startMarker),
729
+ path
730
+ );
731
+ connection.addMarker(
732
+ 'end',
733
+ merge(options.marker, options.endMarker),
734
+ path
735
+ );
736
+ },
737
+
738
+ /**
739
+ * Destroy connection by destroying the added graphics elements.
740
+ *
741
+ * @function Highcharts.Connection#destroy
742
+ */
743
+ destroy: function () {
744
+ if (this.graphics) {
745
+ H.objectEach(this.graphics, function (val) {
746
+ val.destroy();
747
+ });
748
+ delete this.graphics;
749
+ }
750
+ }
751
+ };
752
+
753
+
754
+ /**
755
+ * The Pathfinder class.
756
+ *
757
+ * @private
758
+ * @class Pathfinder
759
+ *
760
+ * @param {Highcharts.Chart} chart
761
+ * The chart to operate on.
762
+ */
763
+ function Pathfinder(chart) {
764
+ this.init(chart);
765
+ }
766
+ Pathfinder.prototype = {
767
+
768
+ algorithms: pathfinderAlgorithms,
769
+
770
+ /**
771
+ * Initialize the Pathfinder object.
772
+ *
773
+ * @function Highcharts.Pathfinder#init
774
+ *
775
+ * @param {Highcharts.Chart} chart
776
+ * The chart context.
777
+ *
778
+ * @return {void}
779
+ */
780
+ init: function (chart) {
781
+ // Initialize pathfinder with chart context
782
+ this.chart = chart;
783
+
784
+ // Init connection reference list
785
+ this.connections = [];
786
+
787
+ // Recalculate paths/obstacles on chart redraw
788
+ addEvent(chart, 'redraw', function () {
789
+ this.pathfinder.update();
790
+ });
791
+ },
792
+
793
+ /**
794
+ * Update Pathfinder connections from scratch.
795
+ *
796
+ * @function Highcharts.Pathfinder#update
797
+ *
798
+ * @param {boolean} deferRender Whether or not to defer rendering of
799
+ * connections until series.afterAnimate event has fired. Used on first
800
+ * render.
801
+ */
802
+ update: function (deferRender) {
803
+ var chart = this.chart,
804
+ pathfinder = this,
805
+ oldConnections = pathfinder.connections;
806
+
807
+ // Rebuild pathfinder connections from options
808
+ pathfinder.connections = [];
809
+ each(chart.series, function (series) {
810
+ if (series.visible) {
811
+ each(series.points, function (point) {
812
+ var to,
813
+ connects = (
814
+ point.options &&
815
+ point.options.connect &&
816
+ H.splat(point.options.connect)
817
+ );
818
+ if (point.visible && point.isInside !== false && connects) {
819
+ each(connects, function (connect) {
820
+ to = chart.get(typeof connect === 'string' ?
821
+ connect : connect.to
822
+ );
823
+ if (
824
+ to instanceof H.Point &&
825
+ to.series.visible &&
826
+ to.visible &&
827
+ to.isInside !== false
828
+ ) {
829
+ // Add new connection
830
+ pathfinder.connections.push(new Connection(
831
+ point, // from
832
+ to,
833
+ typeof connect === 'string' ? {} : connect
834
+ ));
835
+ }
836
+ });
837
+ }
838
+ });
839
+ }
840
+ });
841
+
842
+ // Clear connections that should not be updated, and move old info over
843
+ // to new connections.
844
+ for (
845
+ var j = 0, k, found, lenOld = oldConnections.length,
846
+ lenNew = pathfinder.connections.length;
847
+ j < lenOld;
848
+ ++j
849
+ ) {
850
+ found = false;
851
+ for (k = 0; k < lenNew; ++k) {
852
+ if (
853
+ oldConnections[j].fromPoint ===
854
+ pathfinder.connections[k].fromPoint &&
855
+ oldConnections[j].toPoint ===
856
+ pathfinder.connections[k].toPoint
857
+ ) {
858
+ pathfinder.connections[k].graphics =
859
+ oldConnections[j].graphics;
860
+ found = true;
861
+ break;
862
+ }
863
+ }
864
+ if (!found) {
865
+ oldConnections[j].destroy();
866
+ }
867
+ }
868
+
869
+ // Clear obstacles to force recalculation. This must be done on every
870
+ // redraw in case positions have changed. Recalculation is handled in
871
+ // Connection.getPath on demand.
872
+ delete this.chartObstacles;
873
+ delete this.lineObstacles;
874
+
875
+ // Draw the pending connections
876
+ pathfinder.renderConnections(deferRender);
877
+ },
878
+
879
+ /**
880
+ * Draw the chart's connecting paths.
881
+ *
882
+ * @function Highcharts.Pathfinder#renderConnections
883
+ *
884
+ * @param {boolean} deferRender Whether or not to defer render until series
885
+ * animation is finished. Used on first render.
886
+ */
887
+ renderConnections: function (deferRender) {
888
+ if (deferRender) {
889
+ // Render after series are done animating
890
+ each(this.chart.series, function (series) {
891
+ var render = function () {
892
+ // Find pathfinder connections belonging to this series
893
+ // that haven't rendered, and render them now.
894
+ var pathfinder = series.chart.pathfinder,
895
+ conns = pathfinder && pathfinder.connections || [];
896
+ each(conns, function (connection) {
897
+ if (
898
+ connection.fromPoint &&
899
+ connection.fromPoint.series === series
900
+ ) {
901
+ connection.render();
902
+ }
903
+ });
904
+ if (series.pathfinderRemoveRenderEvent) {
905
+ series.pathfinderRemoveRenderEvent();
906
+ delete series.pathfinderRemoveRenderEvent;
907
+ }
908
+ };
909
+ if (series.options.animation === false) {
910
+ render();
911
+ } else {
912
+ series.pathfinderRemoveRenderEvent = addEvent(
913
+ series, 'afterAnimate', render
914
+ );
915
+ }
916
+ });
917
+ } else {
918
+ // Go through connections and render them
919
+ each(this.connections, function (connection) {
920
+ connection.render();
921
+ });
922
+ }
923
+ },
924
+
925
+ /**
926
+ * Get obstacles for the points in the chart. Does not include connecting
927
+ * lines from Pathfinder. Applies algorithmMargin to the obstacles.
928
+ *
929
+ * @function Highcharts.Pathfinder#getChartObstacles
930
+ *
931
+ * @param {object} options
932
+ * Options for the calculation. Currenlty only
933
+ * options.algorithmMargin.
934
+ *
935
+ * @return {Array}
936
+ * An array of calculated obstacles. Each obstacle is defined as
937
+ * an object with xMin, xMax, yMin and yMax properties.
938
+ */
939
+ getChartObstacles: function (options) {
940
+ var obstacles = [],
941
+ series = this.chart.series,
942
+ margin = pick(options.algorithmMargin, 0),
943
+ calculatedMargin;
944
+ for (var i = 0, sLen = series.length; i < sLen; ++i) {
945
+ if (series[i].visible) {
946
+ for (
947
+ var j = 0, pLen = series[i].points.length, bb, point;
948
+ j < pLen;
949
+ ++j
950
+ ) {
951
+ point = series[i].points[j];
952
+ if (point.visible) {
953
+ bb = getPointBB(point);
954
+ if (bb) {
955
+ obstacles.push({
956
+ xMin: bb.xMin - margin,
957
+ xMax: bb.xMax + margin,
958
+ yMin: bb.yMin - margin,
959
+ yMax: bb.yMax + margin
960
+ });
961
+ }
962
+ }
963
+ }
964
+ }
965
+ }
966
+
967
+ // Sort obstacles by xMin for optimization
968
+ obstacles = obstacles.sort(function (a, b) {
969
+ return a.xMin - b.xMin;
970
+ });
971
+
972
+ // Add auto-calculated margin if the option is not defined
973
+ if (!defined(options.algorithmMargin)) {
974
+ calculatedMargin =
975
+ options.algorithmMargin =
976
+ calculateObstacleMargin(obstacles);
977
+ each(obstacles, function (obstacle) {
978
+ obstacle.xMin -= calculatedMargin;
979
+ obstacle.xMax += calculatedMargin;
980
+ obstacle.yMin -= calculatedMargin;
981
+ obstacle.yMax += calculatedMargin;
982
+ });
983
+ }
984
+
985
+ return obstacles;
986
+ },
987
+
988
+ /**
989
+ * Utility function to get metrics for obstacles:
990
+ * - Widest obstacle width
991
+ * - Tallest obstacle height
992
+ *
993
+ * @function Highcharts.Pathfinder#getObstacleMetrics
994
+ *
995
+ * @param {Array} obstacles
996
+ * An array of obstacles to inspect.
997
+ *
998
+ * @return {object}
999
+ * The calculated metrics, as an object with maxHeight and maxWidth
1000
+ * properties.
1001
+ */
1002
+ getObstacleMetrics: function (obstacles) {
1003
+ var maxWidth = 0,
1004
+ maxHeight = 0,
1005
+ width,
1006
+ height,
1007
+ i = obstacles.length;
1008
+
1009
+ while (i--) {
1010
+ width = obstacles[i].xMax - obstacles[i].xMin;
1011
+ height = obstacles[i].yMax - obstacles[i].yMin;
1012
+ if (maxWidth < width) {
1013
+ maxWidth = width;
1014
+ }
1015
+ if (maxHeight < height) {
1016
+ maxHeight = height;
1017
+ }
1018
+ }
1019
+
1020
+ return {
1021
+ maxHeight: maxHeight,
1022
+ maxWidth: maxWidth
1023
+ };
1024
+ },
1025
+
1026
+ /**
1027
+ * Utility to get which direction to start the pathfinding algorithm
1028
+ * (X vs Y), calculated from a set of marker options.
1029
+ *
1030
+ * @function Highcharts.Pathfinder#getAlgorithmStartDirection
1031
+ *
1032
+ * @param {object} markerOptions
1033
+ * Marker options to calculate from.
1034
+ *
1035
+ * @return {boolean}
1036
+ * Returns true for X, false for Y, and undefined for
1037
+ * autocalculate.
1038
+ */
1039
+ getAlgorithmStartDirection: function (markerOptions) {
1040
+ var xCenter = markerOptions.align !== 'left' &&
1041
+ markerOptions.align !== 'right',
1042
+ yCenter = markerOptions.verticalAlign !== 'top' &&
1043
+ markerOptions.verticalAlign !== 'bottom',
1044
+ undef;
1045
+
1046
+ return xCenter ?
1047
+ (yCenter ? undef : false) : // x is centered
1048
+ (yCenter ? true : undef); // x is off-center
1049
+ }
1050
+ };
1051
+
1052
+ // Add to Highcharts namespace
1053
+ H.Connection = Connection;
1054
+ H.Pathfinder = Pathfinder;
1055
+
1056
+
1057
+ // Add pathfinding capabilities to Points
1058
+ extend(H.Point.prototype, /** @lends Point.prototype */ {
1059
+
1060
+ /**
1061
+ * Get coordinates of anchor point for pathfinder connection.
1062
+ *
1063
+ * @private
1064
+ * @function Highcharts.Point#getPathfinderAnchorPoint
1065
+ *
1066
+ * @param {object} markerOptions
1067
+ * Connection options for position on point.
1068
+ *
1069
+ * @return {object}
1070
+ * An object with x/y properties for the position. Coordinates are
1071
+ * in plot values, not relative to point.
1072
+ */
1073
+ getPathfinderAnchorPoint: function (markerOptions) {
1074
+ var bb = getPointBB(this),
1075
+ x,
1076
+ y;
1077
+
1078
+ switch (markerOptions.align) { // eslint-disable-line default-case
1079
+ case 'right':
1080
+ x = 'xMax';
1081
+ break;
1082
+ case 'left':
1083
+ x = 'xMin';
1084
+ }
1085
+
1086
+ switch (markerOptions.verticalAlign) { // eslint-disable-line default-case
1087
+ case 'top':
1088
+ y = 'yMin';
1089
+ break;
1090
+ case 'bottom':
1091
+ y = 'yMax';
1092
+ }
1093
+
1094
+ return {
1095
+ x: x ? bb[x] : (bb.xMin + bb.xMax) / 2,
1096
+ y: y ? bb[y] : (bb.yMin + bb.yMax) / 2
1097
+ };
1098
+ },
1099
+
1100
+ /**
1101
+ * Utility to get the angle from one point to another.
1102
+ *
1103
+ * @private
1104
+ * @function Highcharts.Point#getRadiansToVector
1105
+ *
1106
+ * @param {object} v1
1107
+ * The first vector, as an object with x/y properties.
1108
+ *
1109
+ * @param {object} v2
1110
+ * The second vector, as an object with x/y properties.
1111
+ *
1112
+ * @return {number}
1113
+ * The angle in degrees
1114
+ */
1115
+ getRadiansToVector: function (v1, v2) {
1116
+ var box;
1117
+ if (!defined(v2)) {
1118
+ box = getPointBB(this);
1119
+ v2 = {
1120
+ x: (box.xMin + box.xMax) / 2,
1121
+ y: (box.yMin + box.yMax) / 2
1122
+ };
1123
+ }
1124
+ return Math.atan2(v2.y - v1.y, v1.x - v2.x);
1125
+ },
1126
+
1127
+ /**
1128
+ * Utility to get the position of the marker, based on the path angle and
1129
+ * the marker's radius.
1130
+ *
1131
+ * @private
1132
+ * @function Highcharts.Point#getMarkerVector
1133
+ *
1134
+ * @param {number} radians
1135
+ * The angle in radians from the point center to another vector.
1136
+ *
1137
+ * @param {number} markerRadius
1138
+ * The radius of the marker, to calculate the additional distance
1139
+ * to the center of the marker.
1140
+ *
1141
+ * @param {object} anchor
1142
+ * The anchor point of the path and marker as an object with x/y
1143
+ * properties.
1144
+ *
1145
+ * @return {object}
1146
+ * The marker vector as an object with x/y properties.
1147
+ */
1148
+ getMarkerVector: function (radians, markerRadius, anchor) {
1149
+ var twoPI = Math.PI * 2.0,
1150
+ theta = radians,
1151
+ bb = getPointBB(this),
1152
+ rectWidth = bb.xMax - bb.xMin,
1153
+ rectHeight = bb.yMax - bb.yMin,
1154
+ rAtan = Math.atan2(rectHeight, rectWidth),
1155
+ tanTheta = 1,
1156
+ leftOrRightRegion = false,
1157
+ rectHalfWidth = rectWidth / 2.0,
1158
+ rectHalfHeight = rectHeight / 2.0,
1159
+ rectHorizontalCenter = bb.xMin + rectHalfWidth,
1160
+ rectVerticalCenter = bb.yMin + rectHalfHeight,
1161
+ edgePoint = {
1162
+ x: rectHorizontalCenter,
1163
+ y: rectVerticalCenter
1164
+ },
1165
+ markerPoint = {},
1166
+ xFactor = 1,
1167
+ yFactor = 1;
1168
+
1169
+ while (theta < -Math.PI) {
1170
+ theta += twoPI;
1171
+ }
1172
+
1173
+ while (theta > Math.PI) {
1174
+ theta -= twoPI;
1175
+ }
1176
+
1177
+ tanTheta = Math.tan(theta);
1178
+
1179
+ if ((theta > -rAtan) && (theta <= rAtan)) {
1180
+ // Right side
1181
+ yFactor = -1;
1182
+ leftOrRightRegion = true;
1183
+ } else if (theta > rAtan && theta <= (Math.PI - rAtan)) {
1184
+ // Top side
1185
+ yFactor = -1;
1186
+ } else if (theta > (Math.PI - rAtan) || theta <= -(Math.PI - rAtan)) {
1187
+ // Left side
1188
+ xFactor = -1;
1189
+ leftOrRightRegion = true;
1190
+ } else {
1191
+ // Bottom side
1192
+ xFactor = -1;
1193
+ }
1194
+
1195
+ // Correct the edgePoint according to the placement of the marker
1196
+ if (leftOrRightRegion) {
1197
+ edgePoint.x += xFactor * (rectHalfWidth);
1198
+ edgePoint.y += yFactor * (rectHalfWidth) * tanTheta;
1199
+ } else {
1200
+ edgePoint.x += xFactor * (rectHeight / (2.0 * tanTheta));
1201
+ edgePoint.y += yFactor * (rectHalfHeight);
1202
+ }
1203
+
1204
+ if (anchor.x !== rectHorizontalCenter) {
1205
+ edgePoint.x = anchor.x;
1206
+ }
1207
+ if (anchor.y !== rectVerticalCenter) {
1208
+ edgePoint.y = anchor.y;
1209
+ }
1210
+
1211
+ markerPoint.x = edgePoint.x + (markerRadius * Math.cos(theta));
1212
+ markerPoint.y = edgePoint.y - (markerRadius * Math.sin(theta));
1213
+
1214
+ return markerPoint;
1215
+ }
1216
+ });
1217
+
1218
+ // Initialize Pathfinder for charts
1219
+ H.Chart.prototype.callbacks.push(function (chart) {
1220
+ var options = chart.options;
1221
+ if (options.pathfinder.enabled !== false) {
1222
+ this.pathfinder = new Pathfinder(this);
1223
+ this.pathfinder.update(true); // First draw, defer render
1224
+ }
1225
+ });