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,746 @@
1
+ /**
2
+ * (c) 2016 Highsoft AS
3
+ * Author: Øystein Moseng
4
+ *
5
+ * License: www.highcharts.com/license
6
+ */
7
+ 'use strict';
8
+ import H from '../parts/Globals.js';
9
+ import '../parts/Utilities.js';
10
+
11
+ var min = Math.min,
12
+ max = Math.max,
13
+ abs = Math.abs,
14
+ pick = H.pick;
15
+
16
+ /**
17
+ * Get index of last obstacle before xMin. Employs a type of binary search, and
18
+ * thus requires that obstacles are sorted by xMin value.
19
+ *
20
+ * @param {Array} obstacles Array of obstacles to search in.
21
+ * @param {Number} xMin The xMin threshold.
22
+ * @param {Number} startIx Starting index to search from. Must be within array
23
+ * range.
24
+ *
25
+ * @return {Number} result The index of the last obstacle element before xMin.
26
+ */
27
+ function findLastObstacleBefore(obstacles, xMin, startIx) {
28
+ var left = startIx || 0, // left limit
29
+ right = obstacles.length - 1, // right limit
30
+ min = xMin - 0.0000001, // Make sure we include all obstacles at xMin
31
+ cursor,
32
+ cmp;
33
+ while (left <= right) {
34
+ cursor = (right + left) >> 1;
35
+ cmp = min - obstacles[cursor].xMin;
36
+ if (cmp > 0) {
37
+ left = cursor + 1;
38
+ } else if (cmp < 0) {
39
+ right = cursor - 1;
40
+ } else {
41
+ return cursor;
42
+ }
43
+ }
44
+ return left > 0 ? left - 1 : 0;
45
+ }
46
+
47
+ /**
48
+ * Test if a point lays within an obstacle.
49
+ *
50
+ * @param {Object} obstacle Obstacle to test.
51
+ * @param {Object} point Point with x/y props.
52
+ *
53
+ * @return {Boolean} result Whether point is within the obstacle or not.
54
+ */
55
+ function pointWithinObstacle(obstacle, point) {
56
+ return (
57
+ point.x <= obstacle.xMax &&
58
+ point.x >= obstacle.xMin &&
59
+ point.y <= obstacle.yMax &&
60
+ point.y >= obstacle.yMin
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Find the index of an obstacle that wraps around a point.
66
+ * Returns -1 if not found.
67
+ *
68
+ * @param {Array} obstacles Obstacles to test.
69
+ * @param {Object} point Point with x/y props.
70
+ *
71
+ * @return {Number} result Ix of the obstacle in the array, or -1 if not found.
72
+ */
73
+ function findObstacleFromPoint(obstacles, point) {
74
+ var i = findLastObstacleBefore(obstacles, point.x + 1) + 1;
75
+ while (i--) {
76
+ if (obstacles[i].xMax >= point.x &&
77
+ // optimization using lazy evaluation
78
+ pointWithinObstacle(obstacles[i], point)) {
79
+ return i;
80
+ }
81
+ }
82
+ return -1;
83
+ }
84
+
85
+ /**
86
+ * Get SVG path array from array of line segments.
87
+ *
88
+ * @param {Array} segments The segments to build the path from.
89
+ *
90
+ * @return {Array} result SVG path array as accepted by the SVG Renderer.
91
+ */
92
+ function pathFromSegments(segments) {
93
+ var path = [];
94
+ if (segments.length) {
95
+ path.push('M', segments[0].start.x, segments[0].start.y);
96
+ for (var i = 0; i < segments.length; ++i) {
97
+ path.push('L', segments[i].end.x, segments[i].end.y);
98
+ }
99
+ }
100
+ return path;
101
+ }
102
+
103
+ /**
104
+ * Limits obstacle max/mins in all directions to bounds. Modifies input
105
+ * obstacle.
106
+ *
107
+ * @param {Object} obstacle Obstacle to limit.
108
+ * @param {Object} bounds Bounds to use as limit.
109
+ */
110
+ function limitObstacleToBounds(obstacle, bounds) {
111
+ obstacle.yMin = max(obstacle.yMin, bounds.yMin);
112
+ obstacle.yMax = min(obstacle.yMax, bounds.yMax);
113
+ obstacle.xMin = max(obstacle.xMin, bounds.xMin);
114
+ obstacle.xMax = min(obstacle.xMax, bounds.xMax);
115
+ }
116
+
117
+
118
+
119
+ // Define the available pathfinding algorithms.
120
+ // Algorithms take up to 3 arguments: starting point, ending point, and an
121
+ // options object.
122
+ var algorithms = {
123
+
124
+ /**
125
+ * Get an SVG path from a starting coordinate to an ending coordinate.
126
+ * Draws a straight line.
127
+ *
128
+ * @param {Object} start Starting coordinate, object with x/y props.
129
+ * @param {Object} end Ending coordinate, object with x/y props.
130
+ *
131
+ * @return {Object} result An object with the SVG path in Array form as
132
+ * accepted by the SVG renderer, as well as an array of new obstacles
133
+ * making up this path.
134
+ */
135
+ straight: function (start, end) {
136
+ return {
137
+ path: ['M', start.x, start.y, 'L', end.x, end.y],
138
+ obstacles: [{ start: start, end: end }]
139
+ };
140
+ },
141
+
142
+ /**
143
+ * Find a path from a starting coordinate to an ending coordinate, using
144
+ * right angles only, and taking only starting/ending obstacle into
145
+ * consideration.
146
+ *
147
+ * Options
148
+ * - chartObstacles: Array of chart obstacles to avoid
149
+ * - startDirectionX: Optional. True if starting in the X direction.
150
+ * If not provided, the algorithm starts in the
151
+ * direction that is the furthest between
152
+ * start/end.
153
+ *
154
+ * @param {Object} start Starting coordinate, object with x/y props.
155
+ * @param {Object} end Ending coordinate, object with x/y props.
156
+ * @param {Object} options Options for the algorithm.
157
+ *
158
+ * @return {Object} result An object with the SVG path in Array form as
159
+ * accepted by the SVG renderer, as well as an array of new obstacles
160
+ * making up this path.
161
+ */
162
+ simpleConnect: H.extend(function (start, end, options) {
163
+ var segments = [],
164
+ endSegment,
165
+ dir = pick(
166
+ options.startDirectionX,
167
+ abs(end.x - start.x) > abs(end.y - start.y)
168
+ ) ? 'x' : 'y',
169
+ chartObstacles = options.chartObstacles,
170
+ startObstacleIx = findObstacleFromPoint(chartObstacles, start),
171
+ endObstacleIx = findObstacleFromPoint(chartObstacles, end),
172
+ startObstacle,
173
+ endObstacle,
174
+ prevWaypoint,
175
+ waypoint,
176
+ waypoint2,
177
+ useMax,
178
+ endPoint;
179
+
180
+ // Return a clone of a point with a property set from a target object,
181
+ // optionally with an offset
182
+ function copyFromPoint(from, fromKey, to, toKey, offset) {
183
+ var point = {
184
+ x: from.x,
185
+ y: from.y
186
+ };
187
+ point[fromKey] = to[toKey || fromKey] + (offset || 0);
188
+ return point;
189
+ }
190
+
191
+ // Return waypoint outside obstacle
192
+ function getMeOut(obstacle, point, direction) {
193
+ var useMax = abs(point[direction] - obstacle[direction + 'Min']) >
194
+ abs(point[direction] - obstacle[direction + 'Max']);
195
+ return copyFromPoint(
196
+ point,
197
+ direction,
198
+ obstacle,
199
+ direction + (useMax ? 'Max' : 'Min'),
200
+ useMax ? 1 : -1
201
+ );
202
+ }
203
+
204
+ // Pull out end point
205
+ if (endObstacleIx > -1) {
206
+ endObstacle = chartObstacles[endObstacleIx];
207
+ waypoint = getMeOut(endObstacle, end, dir);
208
+ endSegment = {
209
+ start: waypoint,
210
+ end: end
211
+ };
212
+ endPoint = waypoint;
213
+ } else {
214
+ endPoint = end;
215
+ }
216
+
217
+ // If an obstacle envelops the start point, add a segment to get out,
218
+ // and around it.
219
+ if (startObstacleIx > -1) {
220
+ startObstacle = chartObstacles[startObstacleIx];
221
+ waypoint = getMeOut(startObstacle, start, dir);
222
+ segments.push({
223
+ start: start,
224
+ end: waypoint
225
+ });
226
+
227
+ // If we are going back again, switch direction to get around start
228
+ // obstacle.
229
+ if (
230
+ waypoint[dir] > start[dir] === // Going towards max from start
231
+ waypoint[dir] > endPoint[dir] // Going towards min to end
232
+ ) {
233
+ dir = dir === 'y' ? 'x' : 'y';
234
+ useMax = start[dir] < end[dir];
235
+ segments.push({
236
+ start: waypoint,
237
+ end: copyFromPoint(
238
+ waypoint,
239
+ dir,
240
+ startObstacle,
241
+ dir + (useMax ? 'Max' : 'Min'),
242
+ useMax ? 1 : -1
243
+ )
244
+ });
245
+
246
+ // Switch direction again
247
+ dir = dir === 'y' ? 'x' : 'y';
248
+ }
249
+ }
250
+
251
+ // We are around the start obstacle. Go towards the end in one
252
+ // direction.
253
+ prevWaypoint = segments.length ?
254
+ segments[segments.length - 1].end :
255
+ start;
256
+ waypoint = copyFromPoint(prevWaypoint, dir, endPoint);
257
+ segments.push({
258
+ start: prevWaypoint,
259
+ end: waypoint
260
+ });
261
+
262
+ // Final run to end point in the other direction
263
+ dir = dir === 'y' ? 'x' : 'y';
264
+ waypoint2 = copyFromPoint(waypoint, dir, endPoint);
265
+ segments.push({
266
+ start: waypoint,
267
+ end: waypoint2
268
+ });
269
+
270
+ // Finally add the endSegment
271
+ segments.push(endSegment);
272
+
273
+ return {
274
+ path: pathFromSegments(segments),
275
+ obstacles: segments
276
+ };
277
+ }, {
278
+ requiresObstacles: true
279
+ }),
280
+
281
+ /**
282
+ * Find a path from a starting coordinate to an ending coordinate, taking
283
+ * obstacles into consideration. Might not always find the optimal path,
284
+ * but is fast, and usually good enough.
285
+ *
286
+ * Options
287
+ * - chartObstacles: Array of chart obstacles to avoid
288
+ * - lineObstacles: Array of line obstacles to jump over
289
+ * - obstacleMetrics: Object with metrics of chartObstacles cached
290
+ * - hardBounds: Hard boundaries to not cross
291
+ * - obstacleOptions: Options for the obstacles, including margin
292
+ * - startDirectionX: Optional. True if starting in the X direction.
293
+ * If not provided, the algorithm starts in the
294
+ * direction that is the furthest between
295
+ * start/end.
296
+ *
297
+ * @param {Object} start Starting coordinate, object with x/y props.
298
+ * @param {Object} end Ending coordinate, object with x/y props.
299
+ * @param {Object} options Options for the algorithm.
300
+ *
301
+ * @return {Object} result An object with the SVG path in Array form as
302
+ * accepted by the SVG renderer, as well as an array of new obstacles
303
+ * making up this path.
304
+ */
305
+ fastAvoid: H.extend(function (start, end, options) {
306
+ /*
307
+ Algorithm rules/description
308
+ - Find initial direction
309
+ - Determine soft/hard max for each direction.
310
+ - Move along initial direction until obstacle.
311
+ - Change direction.
312
+ - If hitting obstacle, first try to change length of previous line
313
+ before changing direction again.
314
+
315
+ Soft min/max x = start/destination x +/- widest obstacle + margin
316
+ Soft min/max y = start/destination y +/- tallest obstacle + margin
317
+
318
+ TODO:
319
+ - Make retrospective, try changing prev segment to reduce
320
+ corners
321
+ - Fix logic for breaking out of end-points - not always picking
322
+ the best direction currently
323
+ - When going around the end obstacle we should not always go the
324
+ shortest route, rather pick the one closer to the end point
325
+ */
326
+ var dirIsX = pick(
327
+ options.startDirectionX,
328
+ abs(end.x - start.x) > abs(end.y - start.y)
329
+ ),
330
+ dir = dirIsX ? 'x' : 'y',
331
+ segments,
332
+ useMax,
333
+ extractedEndPoint,
334
+ endSegments = [],
335
+ forceObstacleBreak = false, // Used in clearPathTo to keep track of
336
+ // when to force break through an obstacle.
337
+
338
+ // Boundaries to stay within. If beyond soft boundary, prefer to
339
+ // change direction ASAP. If at hard max, always change immediately.
340
+ metrics = options.obstacleMetrics,
341
+ softMinX = min(start.x, end.x) - metrics.maxWidth - 10,
342
+ softMaxX = max(start.x, end.x) + metrics.maxWidth + 10,
343
+ softMinY = min(start.y, end.y) - metrics.maxHeight - 10,
344
+ softMaxY = max(start.y, end.y) + metrics.maxHeight + 10,
345
+
346
+ // Obstacles
347
+ chartObstacles = options.chartObstacles,
348
+ startObstacleIx = findLastObstacleBefore(chartObstacles, softMinX),
349
+ endObstacleIx = findLastObstacleBefore(chartObstacles, softMaxX);
350
+
351
+ // How far can you go between two points before hitting an obstacle?
352
+ // Does not work for diagonal lines (because it doesn't have to).
353
+ function pivotPoint(fromPoint, toPoint, directionIsX) {
354
+ var firstPoint,
355
+ lastPoint,
356
+ highestPoint,
357
+ lowestPoint,
358
+ i,
359
+ searchDirection = fromPoint.x < toPoint.x ? 1 : -1;
360
+
361
+ if (fromPoint.x < toPoint.x) {
362
+ firstPoint = fromPoint;
363
+ lastPoint = toPoint;
364
+ } else {
365
+ firstPoint = toPoint;
366
+ lastPoint = fromPoint;
367
+ }
368
+
369
+ if (fromPoint.y < toPoint.y) {
370
+ lowestPoint = fromPoint;
371
+ highestPoint = toPoint;
372
+ } else {
373
+ lowestPoint = toPoint;
374
+ highestPoint = fromPoint;
375
+ }
376
+
377
+ // Go through obstacle range in reverse if toPoint is before
378
+ // fromPoint in the X-dimension.
379
+ i = searchDirection < 0 ?
380
+ // Searching backwards, start at last obstacle before last point
381
+ min(findLastObstacleBefore(chartObstacles, lastPoint.x),
382
+ chartObstacles.length - 1) :
383
+ // Forwards. Since we're not sorted by xMax, we have to look
384
+ // at all obstacles.
385
+ 0;
386
+
387
+ // Go through obstacles in this X range
388
+ while (chartObstacles[i] && (
389
+ searchDirection > 0 && chartObstacles[i].xMin <= lastPoint.x ||
390
+ searchDirection < 0 && chartObstacles[i].xMax >= firstPoint.x
391
+ )) {
392
+ // If this obstacle is between from and to points in a straight
393
+ // line, pivot at the intersection.
394
+ if (
395
+ chartObstacles[i].xMin <= lastPoint.x &&
396
+ chartObstacles[i].xMax >= firstPoint.x &&
397
+ chartObstacles[i].yMin <= highestPoint.y &&
398
+ chartObstacles[i].yMax >= lowestPoint.y
399
+ ) {
400
+ if (directionIsX) {
401
+ return {
402
+ y: fromPoint.y,
403
+ x: fromPoint.x < toPoint.x ?
404
+ chartObstacles[i].xMin - 1 :
405
+ chartObstacles[i].xMax + 1,
406
+ obstacle: chartObstacles[i]
407
+ };
408
+ }
409
+ // else ...
410
+ return {
411
+ x: fromPoint.x,
412
+ y: fromPoint.y < toPoint.y ?
413
+ chartObstacles[i].yMin - 1 :
414
+ chartObstacles[i].yMax + 1,
415
+ obstacle: chartObstacles[i]
416
+ };
417
+ }
418
+
419
+ i += searchDirection;
420
+ }
421
+
422
+ return toPoint;
423
+ }
424
+
425
+ /**
426
+ * Decide in which direction to dodge or get out of an obstacle.
427
+ * Considers desired direction, which way is shortest, soft and hard
428
+ * bounds.
429
+ *
430
+ * Returns a string, either xMin, xMax, yMin or yMax.
431
+ *
432
+ * @param {Object} obstacle Obstacle to dodge/escape.
433
+ * @param {Object} fromPoint Point with x/y props that's
434
+ * dodging/escaping.
435
+ * @param {Object} toPoint Goal point.
436
+ * @param {Boolean} dirIsX Dodge in X dimension.
437
+ * @param {Object} bounds Hard and soft boundaries.
438
+ *
439
+ * @return {Boolean} result Use max or not.
440
+ */
441
+ function getDodgeDirection(
442
+ obstacle,
443
+ fromPoint,
444
+ toPoint,
445
+ dirIsX,
446
+ bounds
447
+ ) {
448
+ var softBounds = bounds.soft,
449
+ hardBounds = bounds.hard,
450
+ dir = dirIsX ? 'x' : 'y',
451
+ toPointMax = { x: fromPoint.x, y: fromPoint.y },
452
+ toPointMin = { x: fromPoint.x, y: fromPoint.y },
453
+ minPivot,
454
+ maxPivot,
455
+ maxOutOfSoftBounds = obstacle[dir + 'Max'] >=
456
+ softBounds[dir + 'Max'],
457
+ minOutOfSoftBounds = obstacle[dir + 'Min'] <=
458
+ softBounds[dir + 'Min'],
459
+ maxOutOfHardBounds = obstacle[dir + 'Max'] >=
460
+ hardBounds[dir + 'Max'],
461
+ minOutOfHardBounds = obstacle[dir + 'Min'] <=
462
+ hardBounds[dir + 'Min'],
463
+ // Find out if we should prefer one direction over the other if
464
+ // we can choose freely
465
+ minDistance = abs(obstacle[dir + 'Min'] - fromPoint[dir]),
466
+ maxDistance = abs(obstacle[dir + 'Max'] - fromPoint[dir]),
467
+ // If it's a small difference, pick the one leading towards dest
468
+ // point. Otherwise pick the shortest distance
469
+ useMax = abs(minDistance - maxDistance) < 10 ?
470
+ fromPoint[dir] < toPoint[dir] :
471
+ maxDistance < minDistance;
472
+
473
+ // Check if we hit any obstacles trying to go around in either
474
+ // direction.
475
+ toPointMin[dir] = obstacle[dir + 'Min'];
476
+ toPointMax[dir] = obstacle[dir + 'Max'];
477
+ minPivot = pivotPoint(fromPoint, toPointMin, dirIsX)[dir] !==
478
+ toPointMin[dir];
479
+ maxPivot = pivotPoint(fromPoint, toPointMax, dirIsX)[dir] !==
480
+ toPointMax[dir];
481
+ useMax = minPivot ?
482
+ (maxPivot ? useMax : true) :
483
+ (maxPivot ? false : useMax);
484
+
485
+ // useMax now contains our preferred choice, bounds not taken into
486
+ // account. If both or neither direction is out of bounds we want to
487
+ // use this.
488
+
489
+ // Deal with soft bounds
490
+ useMax = minOutOfSoftBounds ?
491
+ (maxOutOfSoftBounds ? useMax : true) : // Out on min
492
+ (maxOutOfSoftBounds ? false : useMax); // Not out on min
493
+
494
+ // Deal with hard bounds
495
+ useMax = minOutOfHardBounds ?
496
+ (maxOutOfHardBounds ? useMax : true) : // Out on min
497
+ (maxOutOfHardBounds ? false : useMax); // Not out on min
498
+
499
+ return useMax;
500
+ }
501
+
502
+ // Find a clear path between point
503
+ function clearPathTo(fromPoint, toPoint, dirIsX) {
504
+ // Don't waste time if we've hit goal
505
+ if (fromPoint.x === toPoint.x && fromPoint.y === toPoint.y) {
506
+ return [];
507
+ }
508
+
509
+ var dir = dirIsX ? 'x' : 'y',
510
+ pivot,
511
+ segments,
512
+ waypoint,
513
+ waypointUseMax,
514
+ envelopingObstacle,
515
+ secondEnvelopingObstacle,
516
+ envelopWaypoint,
517
+ obstacleMargin = options.obstacleOptions.margin,
518
+ bounds = {
519
+ soft: {
520
+ xMin: softMinX,
521
+ xMax: softMaxX,
522
+ yMin: softMinY,
523
+ yMax: softMaxY
524
+ },
525
+ hard: options.hardBounds
526
+ };
527
+
528
+ // If fromPoint is inside an obstacle we have a problem. Break out
529
+ // by just going to the outside of this obstacle. We prefer to go to
530
+ // the nearest edge in the chosen direction.
531
+ envelopingObstacle =
532
+ findObstacleFromPoint(chartObstacles, fromPoint);
533
+ if (envelopingObstacle > -1) {
534
+ envelopingObstacle = chartObstacles[envelopingObstacle];
535
+ waypointUseMax = getDodgeDirection(
536
+ envelopingObstacle, fromPoint, toPoint, dirIsX, bounds
537
+ );
538
+
539
+ // Cut obstacle to hard bounds to make sure we stay within
540
+ limitObstacleToBounds(envelopingObstacle, options.hardBounds);
541
+
542
+ envelopWaypoint = dirIsX ? {
543
+ y: fromPoint.y,
544
+ x: envelopingObstacle[waypointUseMax ? 'xMax' : 'xMin'] +
545
+ (waypointUseMax ? 1 : -1)
546
+ } : {
547
+ x: fromPoint.x,
548
+ y: envelopingObstacle[waypointUseMax ? 'yMax' : 'yMin'] +
549
+ (waypointUseMax ? 1 : -1)
550
+ };
551
+
552
+ // If we crashed into another obstacle doing this, we put the
553
+ // waypoint between them instead
554
+ secondEnvelopingObstacle = findObstacleFromPoint(
555
+ chartObstacles, envelopWaypoint);
556
+ if (secondEnvelopingObstacle > -1) {
557
+ secondEnvelopingObstacle = chartObstacles[
558
+ secondEnvelopingObstacle
559
+ ];
560
+
561
+ // Cut obstacle to hard bounds
562
+ limitObstacleToBounds(
563
+ secondEnvelopingObstacle,
564
+ options.hardBounds
565
+ );
566
+
567
+ // Modify waypoint to lay between obstacles
568
+ envelopWaypoint[dir] = waypointUseMax ? max(
569
+ envelopingObstacle[dir + 'Max'] - obstacleMargin + 1,
570
+ (
571
+ secondEnvelopingObstacle[dir + 'Min'] +
572
+ envelopingObstacle[dir + 'Max']
573
+ ) / 2
574
+ ) :
575
+ min(
576
+ envelopingObstacle[dir + 'Min'] + obstacleMargin - 1,
577
+ (
578
+ secondEnvelopingObstacle[dir + 'Max'] +
579
+ envelopingObstacle[dir + 'Min']
580
+ ) / 2
581
+ );
582
+
583
+ // We are not going anywhere. If this happens for the first
584
+ // time, do nothing. Otherwise, try to go to the extreme of
585
+ // the obstacle pair in the current direction.
586
+ if (fromPoint.x === envelopWaypoint.x &&
587
+ fromPoint.y === envelopWaypoint.y) {
588
+ if (forceObstacleBreak) {
589
+ envelopWaypoint[dir] = waypointUseMax ?
590
+ max(
591
+ envelopingObstacle[dir + 'Max'],
592
+ secondEnvelopingObstacle[dir + 'Max']
593
+ ) + 1 :
594
+ min(
595
+ envelopingObstacle[dir + 'Min'],
596
+ secondEnvelopingObstacle[dir + 'Min']
597
+ ) - 1;
598
+ }
599
+ // Toggle on if off, and the opposite
600
+ forceObstacleBreak = !forceObstacleBreak;
601
+ } else {
602
+ // This point is not identical to previous.
603
+ // Clear break trigger.
604
+ forceObstacleBreak = false;
605
+ }
606
+ }
607
+
608
+ segments = [{
609
+ start: fromPoint,
610
+ end: envelopWaypoint
611
+ }];
612
+
613
+ } else { // If not enveloping, use standard pivot calculation
614
+
615
+ pivot = pivotPoint(fromPoint, {
616
+ x: dirIsX ? toPoint.x : fromPoint.x,
617
+ y: dirIsX ? fromPoint.y : toPoint.y
618
+ }, dirIsX);
619
+
620
+ segments = [{
621
+ start: fromPoint,
622
+ end: {
623
+ x: pivot.x,
624
+ y: pivot.y
625
+ }
626
+ }];
627
+
628
+ // Pivot before goal, use a waypoint to dodge obstacle
629
+ if (pivot[dirIsX ? 'x' : 'y'] !== toPoint[dirIsX ? 'x' : 'y']) {
630
+ // Find direction of waypoint
631
+ waypointUseMax = getDodgeDirection(
632
+ pivot.obstacle, pivot, toPoint, !dirIsX, bounds
633
+ );
634
+
635
+ // Cut waypoint to hard bounds
636
+ limitObstacleToBounds(pivot.obstacle, options.hardBounds);
637
+
638
+ waypoint = {
639
+ x: dirIsX ?
640
+ pivot.x :
641
+ pivot.obstacle[waypointUseMax ? 'xMax' : 'xMin'] +
642
+ (waypointUseMax ? 1 : -1),
643
+ y: dirIsX ?
644
+ pivot.obstacle[waypointUseMax ? 'yMax' : 'yMin'] +
645
+ (waypointUseMax ? 1 : -1) :
646
+ pivot.y
647
+ };
648
+
649
+ // We're changing direction here, store that to make sure we
650
+ // also change direction when adding the last segment array
651
+ // after handling waypoint.
652
+ dirIsX = !dirIsX;
653
+
654
+ segments = segments.concat(clearPathTo({
655
+ x: pivot.x,
656
+ y: pivot.y
657
+ }, waypoint, dirIsX));
658
+ }
659
+ }
660
+
661
+ // Get segments for the other direction too
662
+ // Recursion is our friend
663
+ segments = segments.concat(clearPathTo(
664
+ segments[segments.length - 1].end, toPoint, !dirIsX
665
+ ));
666
+
667
+ return segments;
668
+ }
669
+
670
+ // Extract point to outside of obstacle in whichever direction is
671
+ // closest. Returns new point outside obstacle.
672
+ function extractFromObstacle(obstacle, point, goalPoint) {
673
+ var dirIsX = min(obstacle.xMax - point.x, point.x - obstacle.xMin) <
674
+ min(obstacle.yMax - point.y, point.y - obstacle.yMin),
675
+ bounds = {
676
+ soft: options.hardBounds,
677
+ hard: options.hardBounds
678
+ },
679
+ useMax = getDodgeDirection(
680
+ obstacle, point, goalPoint, dirIsX, bounds
681
+ );
682
+
683
+ return dirIsX ? {
684
+ y: point.y,
685
+ x: obstacle[useMax ? 'xMax' : 'xMin'] + (useMax ? 1 : -1)
686
+ } : {
687
+ x: point.x,
688
+ y: obstacle[useMax ? 'yMax' : 'yMin'] + (useMax ? 1 : -1)
689
+ };
690
+ }
691
+
692
+ // Cut the obstacle array to soft bounds for optimization in large
693
+ // datasets.
694
+ chartObstacles =
695
+ chartObstacles.slice(startObstacleIx, endObstacleIx + 1);
696
+
697
+ // If an obstacle envelops the end point, move it out of there and add
698
+ // a little segment to where it was.
699
+ if ((endObstacleIx = findObstacleFromPoint(chartObstacles, end)) > -1) {
700
+ extractedEndPoint = extractFromObstacle(
701
+ chartObstacles[endObstacleIx],
702
+ end,
703
+ start
704
+ );
705
+ endSegments.push({
706
+ end: end,
707
+ start: extractedEndPoint
708
+ });
709
+ end = extractedEndPoint;
710
+ }
711
+ // If it's still inside one or more obstacles, get out of there by
712
+ // force-moving towards the start point.
713
+ while (
714
+ (endObstacleIx = findObstacleFromPoint(chartObstacles, end)) > -1
715
+ ) {
716
+ useMax = end[dir] - start[dir] < 0;
717
+ extractedEndPoint = {
718
+ x: end.x,
719
+ y: end.y
720
+ };
721
+ extractedEndPoint[dir] = chartObstacles[endObstacleIx][
722
+ useMax ? dir + 'Max' : dir + 'Min'
723
+ ] + (useMax ? 1 : -1);
724
+ endSegments.push({
725
+ end: end,
726
+ start: extractedEndPoint
727
+ });
728
+ end = extractedEndPoint;
729
+ }
730
+
731
+ // Find the path
732
+ segments = clearPathTo(start, end, dirIsX);
733
+
734
+ // Add the end-point segments
735
+ segments = segments.concat(endSegments.reverse());
736
+
737
+ return {
738
+ path: pathFromSegments(segments),
739
+ obstacles: segments
740
+ };
741
+ }, {
742
+ requiresObstacles: true
743
+ })
744
+ };
745
+
746
+ export default algorithms;