highcharts 9.2.0 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (755) hide show
  1. package/README.md +13 -6
  2. package/bower.json +1 -1
  3. package/css/annotations/popup.css +48 -8
  4. package/css/annotations/popup.scss +70 -22
  5. package/css/highcharts.css +45 -0
  6. package/css/highcharts.scss +40 -0
  7. package/css/themes/dark-unica.css +45 -0
  8. package/css/themes/grid-light.css +45 -0
  9. package/css/themes/sand-signika.css +45 -0
  10. package/es-modules/Accessibility/A11yI18n.js +273 -224
  11. package/es-modules/Accessibility/Accessibility.js +237 -128
  12. package/es-modules/Accessibility/AccessibilityComponent.js +79 -314
  13. package/es-modules/Accessibility/Components/AnnotationsA11y.js +10 -0
  14. package/es-modules/Accessibility/Components/ContainerComponent.js +52 -27
  15. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +173 -104
  16. package/es-modules/Accessibility/Components/LegendComponent.js +97 -65
  17. package/es-modules/Accessibility/Components/MenuComponent.js +243 -149
  18. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +170 -88
  19. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +152 -115
  20. package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +133 -68
  21. package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +64 -27
  22. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +38 -21
  23. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +380 -325
  24. package/es-modules/Accessibility/Components/ZoomComponent.js +28 -20
  25. package/es-modules/Accessibility/FocusBorder.js +192 -147
  26. package/es-modules/Accessibility/HighContrastMode.js +78 -66
  27. package/es-modules/Accessibility/HighContrastTheme.js +10 -0
  28. package/es-modules/Accessibility/KeyboardNavigation.js +146 -71
  29. package/es-modules/Accessibility/KeyboardNavigationHandler.js +71 -44
  30. package/es-modules/Accessibility/Options/DeprecatedOptions.js +11 -1
  31. package/es-modules/Accessibility/Options/LangOptions.js +1 -2
  32. package/es-modules/Accessibility/Options/Options.js +32 -17
  33. package/es-modules/Accessibility/ProxyElement.js +212 -0
  34. package/es-modules/Accessibility/ProxyProvider.js +305 -0
  35. package/es-modules/Accessibility/Utils/Announcer.js +15 -8
  36. package/es-modules/Accessibility/Utils/ChartUtilities.js +41 -16
  37. package/es-modules/Accessibility/Utils/DOMElementProvider.js +27 -15
  38. package/es-modules/Accessibility/Utils/EventProvider.js +27 -17
  39. package/es-modules/Accessibility/Utils/HTMLUtilities.js +125 -30
  40. package/es-modules/Core/Axis/Axis.js +37 -30
  41. package/es-modules/Core/Axis/AxisDefaults.js +35 -24
  42. package/es-modules/Core/Axis/Color/ColorAxisComposition.js +54 -4
  43. package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +5 -5
  44. package/es-modules/Core/Axis/OrdinalAxis.js +5 -13
  45. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +4 -5
  46. package/es-modules/Core/Axis/ScrollbarAxis.js +10 -3
  47. package/es-modules/Core/Axis/TreeGridAxis.js +2 -2
  48. package/es-modules/Core/Axis/TreeGridTick.js +1 -2
  49. package/es-modules/Core/Chart/Chart.js +2 -3
  50. package/es-modules/Core/Chart/ChartDefaults.js +3 -4
  51. package/es-modules/Core/Chart/ChartNavigationComposition.js +92 -0
  52. package/es-modules/Core/Chart/MapChart.js +10 -22
  53. package/es-modules/Core/Chart/StockChart.js +3 -293
  54. package/es-modules/Core/Color/Palettes.js +22 -0
  55. package/es-modules/Core/DefaultOptions.js +19 -17
  56. package/es-modules/Core/Foundation.js +39 -31
  57. package/es-modules/Core/Globals.js +1 -1
  58. package/es-modules/Core/HttpUtilities.js +3 -3
  59. package/es-modules/Core/Legend/Legend.js +7 -3
  60. package/es-modules/Core/Navigator.js +7 -8
  61. package/es-modules/Core/Pointer.js +39 -36
  62. package/es-modules/Core/Renderer/HTML/AST.js +3 -6
  63. package/es-modules/Core/Renderer/HTML/HTMLElement.js +23 -18
  64. package/es-modules/Core/Renderer/SVG/SVGElement.js +3 -4
  65. package/es-modules/Core/Renderer/SVG/SVGRenderer.js +21 -18
  66. package/es-modules/Core/Renderer/SVG/TextBuilder.js +17 -13
  67. package/es-modules/Core/ScrollbarDefaults.js +10 -9
  68. package/es-modules/Core/Series/DataLabel.js +2 -3
  69. package/es-modules/Core/Series/Point.js +5 -3
  70. package/es-modules/Core/Series/Series.js +156 -162
  71. package/es-modules/Core/Series/SeriesDefaults.js +3 -4
  72. package/es-modules/Core/Series/SeriesRegistry.js +1 -2
  73. package/es-modules/Core/Tooltip.js +44 -17
  74. package/es-modules/Core/Utilities.js +15 -7
  75. package/es-modules/Data/DataConverter.js +489 -0
  76. package/es-modules/Data/DataPromise.js +252 -0
  77. package/es-modules/Data/DataSeriesConverter.js +203 -0
  78. package/es-modules/Data/DataTable.js +1204 -0
  79. package/es-modules/Data/Modifiers/ChainModifier.js +299 -0
  80. package/es-modules/Data/Modifiers/DataModifier.js +303 -0
  81. package/es-modules/Data/Modifiers/GroupModifier.js +144 -0
  82. package/es-modules/Data/Modifiers/InvertModifier.js +254 -0
  83. package/es-modules/Data/Modifiers/RangeModifier.js +143 -0
  84. package/es-modules/Data/Modifiers/SeriesPointsModifier.js +110 -0
  85. package/es-modules/Data/Modifiers/SortModifier.js +249 -0
  86. package/es-modules/Data/Parsers/CSVParser.js +399 -0
  87. package/es-modules/Data/Parsers/DataParser.js +101 -0
  88. package/es-modules/Data/Parsers/GoogleSheetsParser.js +220 -0
  89. package/es-modules/Data/Parsers/HTMLTableParser.js +213 -0
  90. package/es-modules/Data/Stores/CSVStore.js +317 -0
  91. package/es-modules/Data/Stores/DataStore.js +276 -0
  92. package/es-modules/Data/Stores/GoogleSheetsStore.js +167 -0
  93. package/es-modules/Data/Stores/HTMLTableStore.js +351 -0
  94. package/es-modules/Extensions/Annotations/Annotations.js +61 -11
  95. package/es-modules/Extensions/Annotations/ControlPoint.js +1 -1
  96. package/es-modules/Extensions/Annotations/Controllables/ControllableEllipse.js +199 -0
  97. package/es-modules/Extensions/Annotations/Mixins/ControllableMixin.js +7 -1
  98. package/es-modules/Extensions/Annotations/NavigationBindings.js +90 -28
  99. package/es-modules/Extensions/Annotations/Popup.js +479 -141
  100. package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +51 -2
  101. package/es-modules/Extensions/Annotations/Types/CrookedLine.js +1 -1
  102. package/es-modules/Extensions/Annotations/Types/Fibonacci.js +2 -3
  103. package/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +219 -0
  104. package/es-modules/Extensions/Annotations/Types/InfinityLine.js +1 -1
  105. package/es-modules/Extensions/Annotations/Types/Measure.js +14 -8
  106. package/es-modules/Extensions/Annotations/Types/Pitchfork.js +5 -5
  107. package/es-modules/Extensions/Annotations/Types/TimeCycles.js +207 -0
  108. package/es-modules/Extensions/Annotations/Types/Tunnel.js +3 -5
  109. package/es-modules/Extensions/Annotations/Types/VerticalLine.js +1 -1
  110. package/es-modules/Extensions/Boost/BoostOptions.js +2 -2
  111. package/es-modules/Extensions/Boost/BoostOverrides.js +3 -1
  112. package/es-modules/Extensions/Boost/WGLShader.js +4 -3
  113. package/es-modules/Extensions/BoostCanvas.js +1 -2
  114. package/es-modules/Extensions/CurrentDateIndication.js +2 -3
  115. package/es-modules/Extensions/Data.js +73 -67
  116. package/es-modules/Extensions/DataGrouping.js +33 -18
  117. package/es-modules/Extensions/Debugger/ErrorMessages.js +2 -2
  118. package/es-modules/Extensions/DownloadURL.js +2 -2
  119. package/es-modules/Extensions/DragPanes.js +1 -2
  120. package/es-modules/Extensions/Drilldown.js +2 -3
  121. package/es-modules/Extensions/Exporting/Exporting.js +12 -11
  122. package/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -15
  123. package/es-modules/Extensions/GeoJSON.js +39 -63
  124. package/es-modules/Extensions/MarkerClusters.js +115 -97
  125. package/es-modules/Extensions/NoDataToDisplay.js +1 -2
  126. package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +10 -9
  127. package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
  128. package/es-modules/Extensions/Oldie/Oldie.js +2 -3
  129. package/es-modules/Extensions/Pane.js +5 -6
  130. package/es-modules/Extensions/Polar.js +1 -1
  131. package/es-modules/Extensions/RangeSelector.js +3 -4
  132. package/es-modules/Extensions/Sonification/ChartSonify.js +247 -637
  133. package/es-modules/Extensions/Sonification/Earcon.js +136 -102
  134. package/es-modules/Extensions/Sonification/Instrument.js +496 -426
  135. package/es-modules/Extensions/Sonification/MusicalFrequencies.js +10 -0
  136. package/es-modules/Extensions/Sonification/Options.js +10 -0
  137. package/es-modules/Extensions/Sonification/PointSonify.js +203 -152
  138. package/es-modules/Extensions/Sonification/SeriesSonify.js +459 -0
  139. package/es-modules/Extensions/Sonification/SignalHandler.js +124 -0
  140. package/es-modules/Extensions/Sonification/Sonification.js +26 -52
  141. package/es-modules/Extensions/Sonification/{Utilities.js → SonificationUtilities.js} +62 -84
  142. package/es-modules/Extensions/Sonification/Timeline.js +255 -567
  143. package/es-modules/Extensions/Sonification/TimelineEvent.js +158 -0
  144. package/es-modules/Extensions/Sonification/TimelinePath.js +311 -0
  145. package/es-modules/Maps/MapNavigation.js +27 -64
  146. package/es-modules/Maps/MapNavigationOptionsDefault.js +3 -0
  147. package/es-modules/Maps/MapPointer.js +7 -5
  148. package/es-modules/Maps/MapView.js +450 -0
  149. package/es-modules/Maps/MapViewOptionsDefault.js +97 -0
  150. package/es-modules/Maps/Projection.js +436 -0
  151. package/es-modules/Maps/ProjectionDefinition.js +9 -0
  152. package/es-modules/Maps/Projections/EqualEarth.js +42 -0
  153. package/es-modules/Maps/Projections/LambertConformalConic.js +52 -0
  154. package/es-modules/Maps/Projections/Miller.js +16 -0
  155. package/es-modules/Maps/Projections/Orthographic.js +26 -0
  156. package/es-modules/Maps/Projections/ProjectionRegistry.js +19 -0
  157. package/es-modules/Maps/Projections/WebMercator.js +24 -0
  158. package/es-modules/Series/AreaRange/AreaRangeSeries.js +4 -5
  159. package/es-modules/Series/Bellcurve/BellcurveSeries.js +2 -8
  160. package/es-modules/Series/BoxPlot/BoxPlotSeries.js +1 -2
  161. package/es-modules/Series/Bubble/BubbleLegendDefaults.js +1 -2
  162. package/es-modules/Series/Bubble/BubbleLegendItem.js +3 -3
  163. package/es-modules/Series/Bubble/BubblePoint.js +5 -0
  164. package/es-modules/Series/Bubble/BubbleSeries.js +90 -50
  165. package/es-modules/Series/Candlestick/CandlestickSeries.js +10 -18
  166. package/es-modules/{Mixins/CenteredSeries.js → Series/CenteredUtilities.js} +45 -23
  167. package/es-modules/Series/ColorMapComposition.js +109 -0
  168. package/es-modules/Series/Column/ColumnDataLabel.js +5 -5
  169. package/es-modules/Series/Column/ColumnSeries.js +3 -4
  170. package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +6 -6
  171. package/es-modules/Series/DataModifyComposition.js +539 -0
  172. package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +2 -6
  173. package/es-modules/Series/DerivedComposition.js +137 -0
  174. package/es-modules/Series/DrawPointComposition.js +111 -0
  175. package/es-modules/Series/Dumbbell/DumbbellSeries.js +2 -3
  176. package/es-modules/Series/ErrorBar/ErrorBarSeries.js +1 -2
  177. package/es-modules/Series/Flags/FlagsSeries.js +18 -25
  178. package/es-modules/Series/Funnel/FunnelSeries.js +6 -5
  179. package/es-modules/Series/Gantt/GanttSeries.js +0 -2
  180. package/es-modules/Series/Gauge/GaugePoint.js +1 -1
  181. package/es-modules/Series/Gauge/GaugeSeries.js +7 -7
  182. package/es-modules/Series/HLC/HLCPoint.js +55 -0
  183. package/es-modules/Series/HLC/HLCSeries.js +383 -0
  184. package/es-modules/Series/Heatmap/HeatmapPoint.js +3 -4
  185. package/es-modules/Series/Heatmap/HeatmapSeries.js +19 -6
  186. package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +2 -3
  187. package/es-modules/Series/Histogram/HistogramSeries.js +3 -7
  188. package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +2 -2
  189. package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +33 -34
  190. package/es-modules/Series/Line/LineSeries.js +1 -2
  191. package/es-modules/Series/Map/MapPoint.js +23 -16
  192. package/es-modules/Series/Map/MapSeries.js +271 -309
  193. package/es-modules/Series/MapBubble/MapBubblePoint.js +0 -3
  194. package/es-modules/Series/MapBubble/MapBubbleSeries.js +10 -1
  195. package/es-modules/Series/MapLine/MapLineSeries.js +2 -0
  196. package/es-modules/Series/MapPoint/MapPointPoint.js +5 -1
  197. package/es-modules/Series/MapPoint/MapPointSeries.js +99 -14
  198. package/es-modules/Series/Networkgraph/Networkgraph.js +5 -5
  199. package/es-modules/{Mixins/Nodes.js → Series/NodesComposition.js} +76 -29
  200. package/es-modules/Series/OHLC/OHLCPoint.js +2 -6
  201. package/es-modules/Series/OHLC/OHLCSeries.js +55 -183
  202. package/es-modules/{Mixins/OnSeries.js → Series/OnSeriesComposition.js} +53 -21
  203. package/es-modules/Series/Organization/OrganizationSeries.js +2 -3
  204. package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +46 -6
  205. package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -7
  206. package/es-modules/Series/Pie/PieDataLabel.js +1 -2
  207. package/es-modules/Series/Pie/PieSeries.js +6 -7
  208. package/es-modules/Series/Sankey/SankeyPoint.js +0 -4
  209. package/es-modules/Series/Sankey/SankeySeries.js +89 -20
  210. package/es-modules/Series/Sunburst/SunburstPoint.js +2 -3
  211. package/es-modules/Series/Sunburst/SunburstSeries.js +4 -4
  212. package/es-modules/Series/Tilemap/TilemapPoint.js +2 -3
  213. package/es-modules/Series/Timeline/TimelineSeries.js +3 -4
  214. package/es-modules/{Mixins/TreeSeries.js → Series/TreeUtilities.js} +86 -76
  215. package/es-modules/Series/Treemap/TreemapPoint.js +2 -2
  216. package/es-modules/Series/Treemap/TreemapSeries.js +8 -8
  217. package/es-modules/Series/Venn/VennPoint.js +16 -7
  218. package/es-modules/Series/Venn/VennSeries.js +5 -8
  219. package/es-modules/Series/Venn/VennUtils.js +550 -439
  220. package/es-modules/Series/Waterfall/WaterfallSeries.js +2 -3
  221. package/es-modules/Series/Windbarb/WindbarbSeries.js +23 -24
  222. package/es-modules/Series/Wordcloud/WordcloudPoint.js +8 -6
  223. package/es-modules/Series/Wordcloud/WordcloudSeries.js +24 -20
  224. package/es-modules/Series/Wordcloud/WordcloudUtils.js +673 -484
  225. package/es-modules/Series/XRange/XRangePoint.js +1 -0
  226. package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +3 -6
  227. package/es-modules/Stock/Indicators/AO/AOIndicator.js +2 -3
  228. package/es-modules/Stock/Indicators/APO/APOIndicator.js +14 -20
  229. package/es-modules/Stock/Indicators/Aroon/AroonIndicator.js +3 -6
  230. package/es-modules/Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js +11 -13
  231. package/es-modules/Stock/Indicators/ArrayUtilities.js +47 -0
  232. package/es-modules/Stock/Indicators/BB/BBIndicator.js +27 -11
  233. package/es-modules/Stock/Indicators/Chaikin/ChaikinIndicator.js +6 -12
  234. package/es-modules/Stock/Indicators/DEMA/DEMAIndicator.js +1 -11
  235. package/es-modules/Stock/Indicators/DMI/DMIIndicator.js +19 -11
  236. package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +17 -11
  237. package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +1 -3
  238. package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +11 -9
  239. package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +8 -16
  240. package/es-modules/Stock/Indicators/LinearRegression/LinearRegression.js +2 -2
  241. package/es-modules/Stock/Indicators/LinearRegressionAngle/LinearRegressionAngle.js +2 -2
  242. package/es-modules/Stock/Indicators/LinearRegressionIntercept/LinearRegressionIntercept.js +2 -2
  243. package/es-modules/Stock/Indicators/LinearRegressionSlopes/LinearRegressionSlopes.js +2 -2
  244. package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +1 -2
  245. package/es-modules/{Mixins/MultipleLines.js → Stock/Indicators/MultipleLinesComposition.js} +136 -87
  246. package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +1 -3
  247. package/es-modules/Stock/Indicators/PC/PCIndicator.js +14 -13
  248. package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +1 -11
  249. package/es-modules/Stock/Indicators/SMA/SMAComposition.js +0 -26
  250. package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +32 -49
  251. package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +0 -8
  252. package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +15 -8
  253. package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +4 -6
  254. package/es-modules/Stock/Indicators/TEMA/TEMAIndicator.js +26 -11
  255. package/es-modules/Stock/Indicators/TRIX/TRIXIndicator.js +6 -12
  256. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +23 -7
  257. package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +2 -3
  258. package/es-modules/Stock/StockToolsBindings.js +144 -42
  259. package/es-modules/Stock/StockToolsGui.js +409 -15
  260. package/es-modules/masters/highcharts-3d.src.js +1 -1
  261. package/es-modules/masters/highcharts-gantt.src.js +1 -1
  262. package/es-modules/masters/highcharts-more.src.js +1 -1
  263. package/es-modules/masters/highcharts.src.js +1 -1
  264. package/es-modules/masters/highmaps.src.js +1 -1
  265. package/es-modules/masters/highstock.src.js +1 -1
  266. package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  267. package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  268. package/es-modules/masters/indicators/ao.src.js +1 -1
  269. package/es-modules/masters/indicators/apo.src.js +1 -1
  270. package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  271. package/es-modules/masters/indicators/aroon.src.js +1 -1
  272. package/es-modules/masters/indicators/atr.src.js +1 -1
  273. package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  274. package/es-modules/masters/indicators/cci.src.js +1 -1
  275. package/es-modules/masters/indicators/chaikin.src.js +1 -1
  276. package/es-modules/masters/indicators/cmf.src.js +1 -1
  277. package/es-modules/masters/indicators/cmo.src.js +1 -1
  278. package/es-modules/masters/indicators/dema.src.js +1 -1
  279. package/es-modules/masters/indicators/disparity-index.src.js +1 -1
  280. package/es-modules/masters/indicators/dmi.src.js +1 -1
  281. package/es-modules/masters/indicators/dpo.src.js +1 -1
  282. package/es-modules/masters/indicators/ema.src.js +4 -10
  283. package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  284. package/es-modules/masters/indicators/indicators-all.src.js +2 -2
  285. package/es-modules/masters/indicators/indicators.src.js +2 -1
  286. package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  287. package/es-modules/masters/indicators/klinger.src.js +1 -1
  288. package/es-modules/masters/indicators/macd.src.js +1 -1
  289. package/es-modules/masters/indicators/mfi.src.js +1 -1
  290. package/es-modules/masters/indicators/momentum.src.js +1 -1
  291. package/es-modules/masters/indicators/natr.src.js +1 -1
  292. package/es-modules/masters/indicators/obv.src.js +1 -1
  293. package/es-modules/masters/indicators/pivot-points.src.js +1 -1
  294. package/es-modules/masters/indicators/ppo.src.js +1 -1
  295. package/es-modules/masters/indicators/price-channel.src.js +1 -1
  296. package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  297. package/es-modules/masters/indicators/psar.src.js +1 -1
  298. package/es-modules/masters/indicators/regressions.src.js +1 -1
  299. package/es-modules/masters/indicators/roc.src.js +1 -1
  300. package/es-modules/masters/indicators/rsi.src.js +1 -1
  301. package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  302. package/es-modules/masters/indicators/stochastic.src.js +1 -1
  303. package/es-modules/masters/indicators/supertrend.src.js +1 -1
  304. package/es-modules/masters/indicators/tema.src.js +1 -1
  305. package/es-modules/masters/indicators/trendline.src.js +1 -1
  306. package/es-modules/masters/indicators/trix.src.js +1 -1
  307. package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  308. package/es-modules/masters/indicators/vwap.src.js +1 -1
  309. package/es-modules/masters/indicators/williams-r.src.js +1 -1
  310. package/es-modules/masters/indicators/wma.src.js +1 -1
  311. package/es-modules/masters/indicators/zigzag.src.js +1 -1
  312. package/es-modules/masters/modules/accessibility.src.js +16 -2
  313. package/es-modules/masters/modules/annotations-advanced.src.js +3 -1
  314. package/es-modules/masters/modules/annotations.src.js +1 -1
  315. package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  316. package/es-modules/masters/modules/boost-canvas.src.js +1 -1
  317. package/es-modules/masters/modules/boost.src.js +1 -1
  318. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  319. package/es-modules/masters/modules/bullet.src.js +1 -1
  320. package/es-modules/masters/modules/coloraxis.src.js +1 -1
  321. package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  322. package/es-modules/masters/modules/cylinder.src.js +1 -1
  323. package/es-modules/masters/modules/data.src.js +6 -3
  324. package/es-modules/masters/modules/datagrouping.src.js +1 -1
  325. package/es-modules/masters/modules/debugger.src.js +1 -1
  326. package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  327. package/es-modules/masters/modules/dotplot.src.js +1 -1
  328. package/es-modules/masters/modules/drag-panes.src.js +1 -1
  329. package/es-modules/masters/modules/draggable-points.src.js +1 -1
  330. package/es-modules/masters/modules/drilldown.src.js +1 -1
  331. package/es-modules/masters/modules/dumbbell.src.js +1 -1
  332. package/es-modules/masters/modules/export-data.src.js +1 -1
  333. package/es-modules/masters/modules/exporting.src.js +1 -1
  334. package/es-modules/masters/modules/full-screen.src.js +1 -1
  335. package/es-modules/masters/modules/funnel.src.js +1 -1
  336. package/es-modules/masters/modules/funnel3d.src.js +1 -1
  337. package/es-modules/masters/modules/gantt.src.js +1 -1
  338. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  339. package/es-modules/masters/modules/heatmap.src.js +1 -2
  340. package/es-modules/masters/modules/heikinashi.src.js +1 -1
  341. package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  342. package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
  343. package/es-modules/masters/modules/item-series.src.js +1 -1
  344. package/es-modules/masters/modules/lollipop.src.js +1 -1
  345. package/es-modules/masters/modules/map.src.js +1 -3
  346. package/es-modules/masters/modules/marker-clusters.src.js +1 -1
  347. package/es-modules/masters/modules/networkgraph.src.js +1 -1
  348. package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  349. package/es-modules/masters/modules/offline-exporting.src.js +1 -1
  350. package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
  351. package/es-modules/masters/modules/oldie.src.js +1 -1
  352. package/es-modules/masters/modules/organization.src.js +1 -1
  353. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  354. package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  355. package/es-modules/masters/modules/pareto.src.js +1 -1
  356. package/es-modules/masters/modules/pathfinder.src.js +1 -1
  357. package/es-modules/masters/modules/pattern-fill.src.js +1 -1
  358. package/es-modules/masters/modules/price-indicator.src.js +1 -1
  359. package/es-modules/masters/modules/pyramid3d.src.js +1 -1
  360. package/es-modules/masters/modules/sankey.src.js +1 -1
  361. package/es-modules/masters/modules/series-label.src.js +1 -1
  362. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  363. package/es-modules/masters/modules/sonification.src.js +33 -2
  364. package/es-modules/masters/modules/static-scale.src.js +1 -1
  365. package/es-modules/masters/modules/stock-tools.src.js +1 -1
  366. package/es-modules/masters/modules/stock.src.js +4 -1
  367. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  368. package/es-modules/masters/modules/sunburst.src.js +1 -1
  369. package/es-modules/masters/modules/tilemap.src.js +1 -1
  370. package/es-modules/masters/modules/timeline.src.js +1 -1
  371. package/es-modules/masters/modules/treegrid.src.js +1 -1
  372. package/es-modules/masters/modules/treemap.src.js +1 -1
  373. package/es-modules/masters/modules/variable-pie.src.js +1 -1
  374. package/es-modules/masters/modules/variwide.src.js +1 -1
  375. package/es-modules/masters/modules/vector.src.js +1 -1
  376. package/es-modules/masters/modules/venn.src.js +1 -1
  377. package/es-modules/masters/modules/windbarb.src.js +1 -1
  378. package/es-modules/masters/modules/wordcloud.src.js +1 -1
  379. package/es-modules/masters/modules/xrange.src.js +1 -1
  380. package/es-modules/masters/themes/avocado.src.js +1 -1
  381. package/es-modules/masters/themes/dark-blue.src.js +1 -1
  382. package/es-modules/masters/themes/dark-green.src.js +1 -1
  383. package/es-modules/masters/themes/dark-unica.src.js +1 -1
  384. package/es-modules/masters/themes/gray.src.js +1 -1
  385. package/es-modules/masters/themes/grid-light.src.js +1 -1
  386. package/es-modules/masters/themes/grid.src.js +1 -1
  387. package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
  388. package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
  389. package/es-modules/masters/themes/sand-signika.src.js +1 -1
  390. package/es-modules/masters/themes/skies.src.js +1 -1
  391. package/es-modules/masters/themes/sunset.src.js +1 -1
  392. package/highcharts-3d.js +1 -1
  393. package/highcharts-3d.src.js +1 -1
  394. package/highcharts-gantt.js +799 -801
  395. package/highcharts-gantt.js.map +1 -1
  396. package/highcharts-gantt.src.js +793 -755
  397. package/highcharts-more.js +194 -193
  398. package/highcharts-more.js.map +1 -1
  399. package/highcharts-more.src.js +208 -120
  400. package/highcharts.d.ts +9814 -4231
  401. package/highcharts.js +585 -587
  402. package/highcharts.js.map +1 -1
  403. package/highcharts.src.d.ts +9814 -4231
  404. package/highcharts.src.js +626 -603
  405. package/highmaps.js +728 -707
  406. package/highmaps.js.map +1 -1
  407. package/highmaps.src.js +2824 -1613
  408. package/highstock.js +788 -782
  409. package/highstock.js.map +1 -1
  410. package/highstock.src.js +1913 -1284
  411. package/indicators/acceleration-bands.js +10 -9
  412. package/indicators/acceleration-bands.js.map +1 -1
  413. package/indicators/acceleration-bands.src.js +156 -112
  414. package/indicators/accumulation-distribution.js +1 -1
  415. package/indicators/accumulation-distribution.src.js +1 -1
  416. package/indicators/ao.js +6 -6
  417. package/indicators/ao.js.map +1 -1
  418. package/indicators/ao.src.js +4 -4
  419. package/indicators/apo.js +5 -6
  420. package/indicators/apo.js.map +1 -1
  421. package/indicators/apo.src.js +16 -84
  422. package/indicators/aroon-oscillator.js +9 -9
  423. package/indicators/aroon-oscillator.js.map +1 -1
  424. package/indicators/aroon-oscillator.src.js +160 -177
  425. package/indicators/aroon.js +9 -9
  426. package/indicators/aroon.js.map +1 -1
  427. package/indicators/aroon.src.js +156 -112
  428. package/indicators/atr.js +1 -1
  429. package/indicators/atr.src.js +1 -1
  430. package/indicators/bollinger-bands.js +10 -9
  431. package/indicators/bollinger-bands.js.map +1 -1
  432. package/indicators/bollinger-bands.src.js +180 -117
  433. package/indicators/cci.js +1 -1
  434. package/indicators/cci.src.js +1 -1
  435. package/indicators/chaikin.js +8 -9
  436. package/indicators/chaikin.js.map +1 -1
  437. package/indicators/chaikin.src.js +8 -76
  438. package/indicators/cmf.js +1 -1
  439. package/indicators/cmf.src.js +1 -1
  440. package/indicators/cmo.js +1 -1
  441. package/indicators/cmo.src.js +1 -1
  442. package/indicators/dema.js +5 -6
  443. package/indicators/dema.js.map +1 -1
  444. package/indicators/dema.src.js +3 -75
  445. package/indicators/disparity-index.js +6 -7
  446. package/indicators/disparity-index.js.map +1 -1
  447. package/indicators/disparity-index.src.js +19 -74
  448. package/indicators/dmi.js +11 -11
  449. package/indicators/dmi.js.map +1 -1
  450. package/indicators/dmi.src.js +173 -116
  451. package/indicators/dpo.js +1 -1
  452. package/indicators/dpo.src.js +1 -1
  453. package/indicators/ema.js +1 -13
  454. package/indicators/ema.js.map +1 -1
  455. package/indicators/ema.src.js +7 -188
  456. package/indicators/ichimoku-kinko-hyo.js +1 -1
  457. package/indicators/ichimoku-kinko-hyo.src.js +1 -1
  458. package/indicators/indicators-all.js +197 -203
  459. package/indicators/indicators-all.js.map +1 -1
  460. package/indicators/indicators-all.src.js +677 -743
  461. package/indicators/indicators.js +12 -12
  462. package/indicators/indicators.js.map +1 -1
  463. package/indicators/indicators.src.js +213 -143
  464. package/indicators/keltner-channels.js +10 -10
  465. package/indicators/keltner-channels.js.map +1 -1
  466. package/indicators/keltner-channels.src.js +164 -118
  467. package/indicators/klinger.js +12 -13
  468. package/indicators/klinger.js.map +1 -1
  469. package/indicators/klinger.src.js +161 -184
  470. package/indicators/macd.js +2 -2
  471. package/indicators/macd.js.map +1 -1
  472. package/indicators/macd.src.js +2 -3
  473. package/indicators/mfi.js +1 -1
  474. package/indicators/mfi.src.js +1 -1
  475. package/indicators/momentum.js +1 -1
  476. package/indicators/momentum.src.js +1 -1
  477. package/indicators/natr.js +3 -3
  478. package/indicators/natr.js.map +1 -1
  479. package/indicators/natr.src.js +2 -4
  480. package/indicators/obv.js +1 -1
  481. package/indicators/obv.src.js +1 -1
  482. package/indicators/pivot-points.js +1 -1
  483. package/indicators/pivot-points.src.js +1 -1
  484. package/indicators/ppo.js +5 -6
  485. package/indicators/ppo.js.map +1 -1
  486. package/indicators/ppo.src.js +3 -75
  487. package/indicators/price-channel.js +9 -9
  488. package/indicators/price-channel.js.map +1 -1
  489. package/indicators/price-channel.src.js +207 -168
  490. package/indicators/price-envelopes.js +1 -1
  491. package/indicators/price-envelopes.src.js +1 -1
  492. package/indicators/psar.js +1 -1
  493. package/indicators/psar.src.js +1 -1
  494. package/indicators/regressions.js +1 -1
  495. package/indicators/regressions.src.js +9 -9
  496. package/indicators/roc.js +1 -1
  497. package/indicators/roc.src.js +1 -1
  498. package/indicators/rsi.js +1 -1
  499. package/indicators/rsi.src.js +1 -1
  500. package/indicators/slow-stochastic.js +5 -6
  501. package/indicators/slow-stochastic.js.map +1 -1
  502. package/indicators/slow-stochastic.src.js +2 -72
  503. package/indicators/stochastic.js +10 -10
  504. package/indicators/stochastic.js.map +1 -1
  505. package/indicators/stochastic.src.js +209 -164
  506. package/indicators/supertrend.js +10 -10
  507. package/indicators/supertrend.js.map +1 -1
  508. package/indicators/supertrend.src.js +6 -7
  509. package/indicators/tema.js +6 -7
  510. package/indicators/tema.js.map +1 -1
  511. package/indicators/tema.src.js +28 -75
  512. package/indicators/trendline.js +1 -1
  513. package/indicators/trendline.src.js +1 -1
  514. package/indicators/trix.js +4 -5
  515. package/indicators/trix.js.map +1 -1
  516. package/indicators/trix.src.js +8 -76
  517. package/indicators/volume-by-price.js +16 -16
  518. package/indicators/volume-by-price.js.map +1 -1
  519. package/indicators/volume-by-price.src.js +24 -7
  520. package/indicators/vwap.js +1 -1
  521. package/indicators/vwap.src.js +1 -1
  522. package/indicators/williams-r.js +5 -6
  523. package/indicators/williams-r.js.map +1 -1
  524. package/indicators/williams-r.src.js +41 -51
  525. package/indicators/wma.js +1 -1
  526. package/indicators/wma.src.js +1 -1
  527. package/indicators/zigzag.js +1 -1
  528. package/indicators/zigzag.src.js +1 -1
  529. package/modules/accessibility.d.ts +5 -0
  530. package/modules/accessibility.js +237 -216
  531. package/modules/accessibility.js.map +1 -1
  532. package/modules/accessibility.src.d.ts +5 -0
  533. package/modules/accessibility.src.js +7400 -6078
  534. package/modules/annotations-advanced.d.ts +30 -0
  535. package/modules/annotations-advanced.js +192 -165
  536. package/modules/annotations-advanced.js.map +1 -1
  537. package/modules/annotations-advanced.src.d.ts +30 -0
  538. package/modules/annotations-advanced.src.js +1604 -332
  539. package/modules/annotations.js +121 -106
  540. package/modules/annotations.js.map +1 -1
  541. package/modules/annotations.src.js +981 -238
  542. package/modules/arrow-symbols.js +1 -1
  543. package/modules/arrow-symbols.src.js +1 -1
  544. package/modules/boost-canvas.js +15 -15
  545. package/modules/boost-canvas.js.map +1 -1
  546. package/modules/boost-canvas.src.js +3 -3
  547. package/modules/boost.js +79 -79
  548. package/modules/boost.js.map +1 -1
  549. package/modules/boost.src.js +10 -9
  550. package/modules/broken-axis.js +1 -1
  551. package/modules/broken-axis.src.js +1 -1
  552. package/modules/bullet.js +1 -1
  553. package/modules/bullet.src.js +1 -1
  554. package/modules/coloraxis.js +24 -24
  555. package/modules/coloraxis.js.map +1 -1
  556. package/modules/coloraxis.src.js +69 -98
  557. package/modules/current-date-indicator.js +4 -4
  558. package/modules/current-date-indicator.js.map +1 -1
  559. package/modules/current-date-indicator.src.js +4 -4
  560. package/modules/cylinder.js +1 -1
  561. package/modules/cylinder.src.js +1 -1
  562. package/modules/data.js +32 -32
  563. package/modules/data.js.map +1 -1
  564. package/modules/data.src.js +85 -88
  565. package/modules/datagrouping.js +20 -20
  566. package/modules/datagrouping.js.map +1 -1
  567. package/modules/datagrouping.src.js +35 -19
  568. package/modules/debugger.js +3 -3
  569. package/modules/debugger.js.map +1 -1
  570. package/modules/debugger.src.js +3 -3
  571. package/modules/dependency-wheel.js +11 -11
  572. package/modules/dependency-wheel.js.map +1 -1
  573. package/modules/dependency-wheel.src.js +4 -7
  574. package/modules/dotplot.js +1 -1
  575. package/modules/dotplot.src.js +1 -1
  576. package/modules/drag-panes.js +8 -8
  577. package/modules/drag-panes.js.map +1 -1
  578. package/modules/drag-panes.src.js +3 -3
  579. package/modules/draggable-points.js +1 -1
  580. package/modules/draggable-points.src.js +1 -1
  581. package/modules/drilldown.js +24 -24
  582. package/modules/drilldown.js.map +1 -1
  583. package/modules/drilldown.src.js +4 -4
  584. package/modules/dumbbell.js +17 -17
  585. package/modules/dumbbell.js.map +1 -1
  586. package/modules/dumbbell.src.js +4 -4
  587. package/modules/export-data.js +1 -1
  588. package/modules/export-data.js.map +1 -1
  589. package/modules/export-data.src.js +3 -3
  590. package/modules/exporting.js +39 -38
  591. package/modules/exporting.js.map +1 -1
  592. package/modules/exporting.src.js +102 -72
  593. package/modules/full-screen.js +1 -1
  594. package/modules/full-screen.src.js +1 -1
  595. package/modules/funnel.js +12 -12
  596. package/modules/funnel.js.map +1 -1
  597. package/modules/funnel.src.js +9 -6
  598. package/modules/funnel3d.js +1 -1
  599. package/modules/funnel3d.src.js +1 -1
  600. package/modules/gantt.js +217 -218
  601. package/modules/gantt.js.map +1 -1
  602. package/modules/gantt.src.js +167 -152
  603. package/modules/grid-axis.js +1 -1
  604. package/modules/grid-axis.src.js +1 -1
  605. package/modules/heatmap.js +39 -39
  606. package/modules/heatmap.js.map +1 -1
  607. package/modules/heatmap.src.js +177 -162
  608. package/modules/heikinashi.js +1 -1
  609. package/modules/heikinashi.src.js +4 -4
  610. package/modules/histogram-bellcurve.js +13 -13
  611. package/modules/histogram-bellcurve.js.map +1 -1
  612. package/modules/histogram-bellcurve.src.js +91 -86
  613. package/modules/hollowcandlestick.js +9 -9
  614. package/modules/hollowcandlestick.js.map +1 -1
  615. package/modules/hollowcandlestick.src.js +37 -37
  616. package/modules/item-series.js +1 -1
  617. package/modules/item-series.src.js +1 -1
  618. package/modules/lollipop.js +1 -1
  619. package/modules/lollipop.src.js +1 -1
  620. package/modules/map.d.ts +136 -14
  621. package/modules/map.js +144 -122
  622. package/modules/map.js.map +1 -1
  623. package/modules/map.src.d.ts +136 -14
  624. package/modules/map.src.js +2227 -1039
  625. package/modules/marker-clusters.js +36 -36
  626. package/modules/marker-clusters.js.map +1 -1
  627. package/modules/marker-clusters.src.js +173 -142
  628. package/modules/networkgraph.d.ts +12 -1
  629. package/modules/networkgraph.js +49 -49
  630. package/modules/networkgraph.js.map +1 -1
  631. package/modules/networkgraph.src.d.ts +12 -1
  632. package/modules/networkgraph.src.js +91 -43
  633. package/modules/no-data-to-display.js +5 -5
  634. package/modules/no-data-to-display.js.map +1 -1
  635. package/modules/no-data-to-display.src.js +3 -3
  636. package/modules/offline-exporting.js +18 -17
  637. package/modules/offline-exporting.js.map +1 -1
  638. package/modules/offline-exporting.src.js +14 -14
  639. package/modules/oldie-polyfills.js +1 -1
  640. package/modules/oldie-polyfills.src.js +1 -1
  641. package/modules/oldie.js +26 -26
  642. package/modules/oldie.js.map +1 -1
  643. package/modules/oldie.src.js +4 -4
  644. package/modules/organization.js +13 -13
  645. package/modules/organization.js.map +1 -1
  646. package/modules/organization.src.js +4 -4
  647. package/modules/overlapping-datalabels.js +1 -1
  648. package/modules/overlapping-datalabels.src.js +1 -1
  649. package/modules/parallel-coordinates.js +1 -1
  650. package/modules/parallel-coordinates.src.js +1 -1
  651. package/modules/pareto.js +7 -7
  652. package/modules/pareto.js.map +1 -1
  653. package/modules/pareto.src.js +89 -78
  654. package/modules/pathfinder.js +1 -1
  655. package/modules/pathfinder.src.js +1 -1
  656. package/modules/pattern-fill.js +1 -1
  657. package/modules/pattern-fill.src.js +1 -1
  658. package/modules/price-indicator.js +1 -1
  659. package/modules/price-indicator.src.js +1 -1
  660. package/modules/pyramid3d.js +1 -1
  661. package/modules/pyramid3d.src.js +1 -1
  662. package/modules/sankey.d.ts +12 -1
  663. package/modules/sankey.js +29 -29
  664. package/modules/sankey.js.map +1 -1
  665. package/modules/sankey.src.d.ts +12 -1
  666. package/modules/sankey.src.js +300 -176
  667. package/modules/series-label.js +1 -1
  668. package/modules/series-label.src.js +1 -1
  669. package/modules/solid-gauge.js +1 -1
  670. package/modules/solid-gauge.src.js +1 -1
  671. package/modules/sonification.js +59 -55
  672. package/modules/sonification.js.map +1 -1
  673. package/modules/sonification.src.js +3034 -2553
  674. package/modules/static-scale.js +1 -1
  675. package/modules/static-scale.src.js +1 -1
  676. package/modules/stock-tools.js +178 -163
  677. package/modules/stock-tools.js.map +1 -1
  678. package/modules/stock-tools.src.js +1028 -144
  679. package/modules/stock.d.ts +39 -6
  680. package/modules/stock.js +204 -196
  681. package/modules/stock.js.map +1 -1
  682. package/modules/stock.src.d.ts +39 -6
  683. package/modules/stock.src.js +1667 -1061
  684. package/modules/streamgraph.js +1 -1
  685. package/modules/streamgraph.src.js +1 -1
  686. package/modules/sunburst.js +61 -60
  687. package/modules/sunburst.js.map +1 -1
  688. package/modules/sunburst.src.js +329 -266
  689. package/modules/tilemap.js +17 -17
  690. package/modules/tilemap.js.map +1 -1
  691. package/modules/tilemap.src.js +3 -4
  692. package/modules/timeline.js +18 -18
  693. package/modules/timeline.js.map +1 -1
  694. package/modules/timeline.src.js +5 -5
  695. package/modules/treegrid.js +56 -57
  696. package/modules/treegrid.js.map +1 -1
  697. package/modules/treegrid.src.js +126 -120
  698. package/modules/treemap.js +41 -41
  699. package/modules/treemap.js.map +1 -1
  700. package/modules/treemap.src.js +319 -254
  701. package/modules/variable-pie.js +1 -1
  702. package/modules/variable-pie.src.js +1 -1
  703. package/modules/variwide.js +1 -1
  704. package/modules/variwide.src.js +1 -1
  705. package/modules/vector.js +1 -1
  706. package/modules/vector.src.js +1 -1
  707. package/modules/venn.js +31 -31
  708. package/modules/venn.js.map +1 -1
  709. package/modules/venn.src.js +731 -721
  710. package/modules/windbarb.js +15 -15
  711. package/modules/windbarb.js.map +1 -1
  712. package/modules/windbarb.src.js +90 -62
  713. package/modules/wordcloud.js +23 -24
  714. package/modules/wordcloud.js.map +1 -1
  715. package/modules/wordcloud.src.js +897 -949
  716. package/modules/xrange.js +2 -2
  717. package/modules/xrange.js.map +1 -1
  718. package/modules/xrange.src.js +2 -1
  719. package/package.json +1 -1
  720. package/themes/avocado.js +1 -1
  721. package/themes/avocado.src.js +1 -1
  722. package/themes/dark-blue.js +1 -1
  723. package/themes/dark-blue.src.js +1 -1
  724. package/themes/dark-green.js +1 -1
  725. package/themes/dark-green.src.js +1 -1
  726. package/themes/dark-unica.js +1 -1
  727. package/themes/dark-unica.src.js +1 -1
  728. package/themes/gray.js +1 -1
  729. package/themes/gray.src.js +1 -1
  730. package/themes/grid-light.js +1 -1
  731. package/themes/grid-light.src.js +1 -1
  732. package/themes/grid.js +1 -1
  733. package/themes/grid.src.js +1 -1
  734. package/themes/high-contrast-dark.js +1 -1
  735. package/themes/high-contrast-dark.src.js +1 -1
  736. package/themes/high-contrast-light.js +1 -1
  737. package/themes/high-contrast-light.src.js +1 -1
  738. package/themes/sand-signika.js +1 -1
  739. package/themes/sand-signika.src.js +1 -1
  740. package/themes/skies.js +1 -1
  741. package/themes/skies.src.js +1 -1
  742. package/themes/sunset.js +1 -1
  743. package/themes/sunset.src.js +1 -1
  744. package/es-modules/Core/Axis/MapAxis.js +0 -157
  745. package/es-modules/Core/Color/Palette.js +0 -82
  746. package/es-modules/Extensions/Sonification/InstrumentDefinitions.js +0 -32
  747. package/es-modules/Mixins/ColorMapSeries.js +0 -82
  748. package/es-modules/Mixins/ColorSeries.js +0 -77
  749. package/es-modules/Mixins/DerivedSeries.js +0 -118
  750. package/es-modules/Mixins/DrawPoint.js +0 -81
  751. package/es-modules/Mixins/IndicatorRequired.js +0 -56
  752. package/es-modules/Mixins/Navigation.js +0 -54
  753. package/es-modules/Mixins/NelderMead.js +0 -132
  754. package/es-modules/Mixins/Polygon.js +0 -259
  755. package/es-modules/Mixins/ReduceArray.js +0 -54
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v9.2.0 (2021-08-18)
2
+ * @license Highcharts JS v9.3.1 (2021-11-05)
3
3
  *
4
4
  * Annotations module
5
5
  *
@@ -293,8 +293,7 @@
293
293
  * @param {Highcharts.AnnotationControllable} target
294
294
  * @return {Highcharts.PositionObject}
295
295
  */
296
- var extend = U.extend,
297
- merge = U.merge,
296
+ var merge = U.merge,
298
297
  pick = U.pick;
299
298
  /* eslint-disable no-invalid-this, valid-jsdoc */
300
299
  /**
@@ -1188,8 +1187,11 @@
1188
1187
  *
1189
1188
  * @param {number} dx translation for x coordinate
1190
1189
  * @param {number} dy translation for y coordinate
1190
+ * @param {boolean|undefined} translateSecondPoint If the shape has two
1191
+ * points attached to it, this option allows you to translate also
1192
+ * the second point
1191
1193
  */
1192
- translateShape: function (dx, dy) {
1194
+ translateShape: function (dx, dy, translateSecondPoint) {
1193
1195
  var chart = this.annotation.chart,
1194
1196
  // Annotation.options
1195
1197
  shapeOptions = this.annotation.userOptions,
@@ -1197,6 +1199,9 @@
1197
1199
  annotationIndex = chart.annotations.indexOf(this.annotation),
1198
1200
  chartOptions = chart.options.annotations[annotationIndex];
1199
1201
  this.translatePoint(dx, dy, 0);
1202
+ if (translateSecondPoint) {
1203
+ this.translatePoint(dx, dy, 1);
1204
+ }
1200
1205
  // Options stored in:
1201
1206
  // - chart (for exporting)
1202
1207
  // - current config (for redraws)
@@ -1890,6 +1895,215 @@
1890
1895
 
1891
1896
  return ControllableCircle;
1892
1897
  });
1898
+ _registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableEllipse.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Core/Utilities.js']], function (ControllableMixin, ControllablePath, U) {
1899
+ /* *
1900
+ *
1901
+ * Author: Pawel Lysy
1902
+ *
1903
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1904
+ *
1905
+ * */
1906
+ var merge = U.merge,
1907
+ defined = U.defined;
1908
+ /**
1909
+ * A controllable ellipse class.
1910
+ *
1911
+ * @requires modules/annotations
1912
+ *
1913
+ * @private
1914
+ * @class
1915
+ * @name Highcharts.AnnotationControllableEllipse
1916
+ *
1917
+ * @param {Highcharts.Annotation} annotation an annotation instance
1918
+ * @param {Highcharts.AnnotationsShapeOptions} options a shape's options
1919
+ * @param {number} index of the Ellipse
1920
+ */
1921
+ var ControllableEllipse = /** @class */ (function () {
1922
+ /* *
1923
+ *
1924
+ * Constructor
1925
+ *
1926
+ * */
1927
+ function ControllableEllipse(annotation, options, index) {
1928
+ /* *
1929
+ *
1930
+ * Properties
1931
+ *
1932
+ * */
1933
+ this.addControlPoints = ControllableMixin.addControlPoints;
1934
+ this.anchor = ControllableMixin.anchor;
1935
+ this.attr = ControllableMixin.attr;
1936
+ this.attrsFromOptions = ControllableMixin.attrsFromOptions;
1937
+ this.destroy = ControllableMixin.destroy;
1938
+ this.getPointsOptions = ControllableMixin.getPointsOptions;
1939
+ this.linkPoints = ControllableMixin.linkPoints;
1940
+ this.point = ControllableMixin.point;
1941
+ this.scale = ControllableMixin.scale;
1942
+ this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
1943
+ this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
1944
+ this.transform = ControllableMixin.transform;
1945
+ this.translatePoint = ControllableMixin.translatePoint;
1946
+ this.transformPoint = ControllableMixin.transformPoint;
1947
+ /**
1948
+ * @type 'ellipse'
1949
+ */
1950
+ this.type = 'ellipse';
1951
+ this.init(annotation, options, index);
1952
+ this.collection = 'shapes';
1953
+ }
1954
+ /* *
1955
+ *
1956
+ * Functions
1957
+ *
1958
+ * */
1959
+ ControllableEllipse.prototype.init = function (annotation, options, index) {
1960
+ if (defined(options.yAxis)) {
1961
+ options.points.forEach(function (point) {
1962
+ point.yAxis = options.yAxis;
1963
+ });
1964
+ }
1965
+ if (defined(options.xAxis)) {
1966
+ options.points.forEach(function (point) {
1967
+ point.xAxis = options.xAxis;
1968
+ });
1969
+ }
1970
+ ControllableMixin.init.call(this, annotation, options, index);
1971
+ };
1972
+ /**
1973
+ *
1974
+ * Render the element
1975
+ * @param parent parent SVG element.
1976
+ */
1977
+ ControllableEllipse.prototype.render = function (parent) {
1978
+ this.graphic = this.annotation.chart.renderer.createElement('ellipse')
1979
+ .attr(this.attrsFromOptions(this.options))
1980
+ .add(parent);
1981
+ ControllableMixin.render.call(this);
1982
+ };
1983
+ /**
1984
+ * Translate the points.
1985
+ * Mostly used to handle dragging of the ellipse.
1986
+ */
1987
+ ControllableEllipse.prototype.translate = function (dx, dy) {
1988
+ ControllableMixin.translateShape.call(this, dx, dy, true);
1989
+ };
1990
+ /**
1991
+ * Get the distance from the line to the point.
1992
+ * @param point1 first point which is on the line
1993
+ * @param point2 second point
1994
+ * @param x0 point's x value from which you want to calculate the distance from
1995
+ * @param y0 point's y value from which you want to calculate the distance from
1996
+ */
1997
+ ControllableEllipse.prototype.getDistanceFromLine = function (point1, point2, x0, y0) {
1998
+ return Math.abs((point2.y - point1.y) * x0 - (point2.x - point1.x) * y0 +
1999
+ point2.x * point1.y - point2.y * point1.x) / Math.sqrt((point2.y - point1.y) * (point2.y - point1.y) +
2000
+ (point2.x - point1.x) * (point2.x - point1.x));
2001
+ };
2002
+ /**
2003
+ * The fuction calculates the svg attributes of the ellipse, and returns all
2004
+ * parameters neccessary to draw the ellipse.
2005
+ * @param position absolute position of the first point in points array
2006
+ * @param position2 absolute position of the second point in points array
2007
+ */
2008
+ ControllableEllipse.prototype.getAttrs = function (position, position2) {
2009
+ var x1 = position.x,
2010
+ y1 = position.y,
2011
+ x2 = position2.x,
2012
+ y2 = position2.y,
2013
+ cx = (x1 + x2) / 2,
2014
+ cy = (y1 + y2) / 2,
2015
+ rx = Math.sqrt((x1 - x2) * (x1 - x2) / 4 + (y1 - y2) * (y1 - y2) / 4),
2016
+ tan = (y2 - y1) / (x2 - x1);
2017
+ var angle = Math.atan(tan) * 180 / Math.PI;
2018
+ if (cx < x1) {
2019
+ angle += 180;
2020
+ }
2021
+ var ry = this.getRY();
2022
+ return { cx: cx, cy: cy, rx: rx, ry: ry, angle: angle };
2023
+ };
2024
+ /**
2025
+ * Get the value of minor radius of the ellipse.
2026
+ */
2027
+ ControllableEllipse.prototype.getRY = function () {
2028
+ var yAxis = this.getYAxis();
2029
+ return defined(yAxis) ?
2030
+ Math.abs(yAxis.toPixels(this.options.ry) - yAxis.toPixels(0)) :
2031
+ this.options.ry;
2032
+ };
2033
+ /**
2034
+ * get the yAxis object to which the ellipse is pinned.
2035
+ */
2036
+ ControllableEllipse.prototype.getYAxis = function () {
2037
+ var yAxisIndex = this.options.yAxis;
2038
+ return this.chart.yAxis[yAxisIndex];
2039
+ };
2040
+ /**
2041
+ * Get the absolute coordinates of the MockPoint
2042
+ * @param point MockPoint that is added through options
2043
+ */
2044
+ ControllableEllipse.prototype.getAbsolutePosition = function (point) {
2045
+ return this.anchor(point).absolutePosition;
2046
+ };
2047
+ /**
2048
+ *
2049
+ * Redraw the element
2050
+ * @param animation display an annimation
2051
+ */
2052
+ ControllableEllipse.prototype.redraw = function (animation) {
2053
+ var position = this.getAbsolutePosition(this.points[0]),
2054
+ position2 = this.getAbsolutePosition(this.points[1]),
2055
+ attrs = this.getAttrs(position,
2056
+ position2);
2057
+ if (position) {
2058
+ this.graphic[animation ? 'animate' : 'attr']({
2059
+ cx: attrs.cx,
2060
+ cy: attrs.cy,
2061
+ rx: attrs.rx,
2062
+ ry: attrs.ry,
2063
+ rotation: attrs.angle,
2064
+ rotationOriginX: attrs.cx,
2065
+ rotationOriginY: attrs.cy
2066
+ });
2067
+ }
2068
+ else {
2069
+ this.graphic.attr({
2070
+ x: 0,
2071
+ y: -9e9
2072
+ });
2073
+ }
2074
+ this.graphic.placed = Boolean(position);
2075
+ ControllableMixin.redraw.call(this, animation);
2076
+ };
2077
+ /**
2078
+ * Set the radius Y.
2079
+ *
2080
+ * @param {number} ry a radius in y direction to be set
2081
+ */
2082
+ ControllableEllipse.prototype.setYRadius = function (ry) {
2083
+ this.options.ry = ry;
2084
+ this.annotation.userOptions.shapes[0].ry = ry;
2085
+ this.annotation.options.shapes[0].ry = ry;
2086
+ };
2087
+ /* *
2088
+ *
2089
+ * Static Properties
2090
+ *
2091
+ * */
2092
+ /**
2093
+ * A map object which allows to map options attributes to element
2094
+ * attributes.
2095
+ *
2096
+ * @name Highcharts.AnnotationControllableEllipse.attrsMap
2097
+ * @type {Highcharts.Dictionary<string>}
2098
+ */
2099
+ ControllableEllipse.attrsMap = merge(ControllablePath.attrsMap, {
2100
+ ry: 'ry'
2101
+ });
2102
+ return ControllableEllipse;
2103
+ }());
2104
+
2105
+ return ControllableEllipse;
2106
+ });
1893
2107
  _registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableLabel.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Core/FormatUtilities.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Tooltip.js'], _modules['Core/Utilities.js']], function (ControllableMixin, F, MockPoint, SVGRenderer, Tooltip, U) {
1894
2108
  /* *
1895
2109
  *
@@ -2424,7 +2638,7 @@
2424
2638
 
2425
2639
  return ControllableImage;
2426
2640
  });
2427
- _registerModule(_modules, 'Extensions/Annotations/Annotations.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Core/Chart/Chart.js'], _modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllableRect.js'], _modules['Extensions/Annotations/Controllables/ControllableCircle.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Extensions/Annotations/Controllables/ControllableImage.js'], _modules['Extensions/Annotations/Controllables/ControllableLabel.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/Mixins/EventEmitterMixin.js'], _modules['Core/Globals.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js'], _modules['Core/Color/Palette.js']], function (A, Chart, ControllableMixin, ControllableRect, ControllableCircle, ControllablePath, ControllableImage, ControllableLabel, ControlPoint, EventEmitterMixin, H, MockPoint, Pointer, U, palette) {
2641
+ _registerModule(_modules, 'Extensions/Annotations/Annotations.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Core/Chart/Chart.js'], _modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllableRect.js'], _modules['Extensions/Annotations/Controllables/ControllableCircle.js'], _modules['Extensions/Annotations/Controllables/ControllableEllipse.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Extensions/Annotations/Controllables/ControllableImage.js'], _modules['Extensions/Annotations/Controllables/ControllableLabel.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/Mixins/EventEmitterMixin.js'], _modules['Core/Globals.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']], function (A, Chart, ControllableMixin, ControllableRect, ControllableCircle, ControllableEllipse, ControllablePath, ControllableImage, ControllableLabel, ControlPoint, EventEmitterMixin, H, MockPoint, Pointer, U) {
2428
2642
  /* *
2429
2643
  *
2430
2644
  * (c) 2009-2021 Highsoft, Black Label
@@ -2646,7 +2860,10 @@
2646
2860
  };
2647
2861
  Annotation.prototype.addClipPaths = function () {
2648
2862
  this.setClipAxes();
2649
- if (this.clipXAxis && this.clipYAxis) {
2863
+ if (this.clipXAxis &&
2864
+ this.clipYAxis &&
2865
+ this.options.crop // #15399
2866
+ ) {
2650
2867
  this.clipRect = this.chart.renderer.clipRect(this.getClipBox());
2651
2868
  }
2652
2869
  };
@@ -2748,8 +2965,10 @@
2748
2965
  .add();
2749
2966
  this.shapesGroup = renderer
2750
2967
  .g('annotation-shapes')
2751
- .add(this.graphic)
2752
- .clip(this.chart.plotBoxClip);
2968
+ .add(this.graphic);
2969
+ if (this.options.crop) { // #15399
2970
+ this.shapesGroup.clip(this.chart.plotBoxClip);
2971
+ }
2753
2972
  this.labelsGroup = renderer
2754
2973
  .g('annotation-labels')
2755
2974
  .attr({
@@ -2866,6 +3085,9 @@
2866
3085
  * Initialisation of a single shape
2867
3086
  * @private
2868
3087
  * @param {Object} shapeOptions - a confg object for a single shape
3088
+ * @param {number} index - annotation may have many shapes,
3089
+ * this is the shape's index saved in shapes.index.
3090
+
2869
3091
  */
2870
3092
  Annotation.prototype.initShape = function (shapeOptions, index) {
2871
3093
  var options = merge(this.options.shapeOptions, {
@@ -2971,6 +3193,7 @@
2971
3193
  Annotation.shapesMap = {
2972
3194
  'rect': ControllableRect,
2973
3195
  'circle': ControllableCircle,
3196
+ 'ellipse': ControllableEllipse,
2974
3197
  'path': ControllablePath,
2975
3198
  'image': ControllableImage
2976
3199
  };
@@ -3047,9 +3270,18 @@
3047
3270
  * Animation defer settings
3048
3271
  * @type {boolean|Partial<Highcharts.AnimationOptionsObject>}
3049
3272
  * @since 8.2.0
3050
- * @apioption annotations.animation
3051
3273
  */
3052
3274
  animation: {},
3275
+ /**
3276
+ * Whether to hide the part of the annotation
3277
+ * that is outside the plot area.
3278
+ *
3279
+ * @sample highcharts/annotations/label-crop-overflow/
3280
+ * Crop line annotation
3281
+ * @type {boolean}
3282
+ * @since 9.3.0
3283
+ */
3284
+ crop: true,
3053
3285
  /**
3054
3286
  * The animation delay time in milliseconds.
3055
3287
  * Set to `0` renders annotation immediately.
@@ -3114,7 +3346,7 @@
3114
3346
  *
3115
3347
  * @type {Highcharts.ColorString}
3116
3348
  */
3117
- borderColor: palette.neutralColor100,
3349
+ borderColor: "#000000" /* neutralColor100 */,
3118
3350
  /**
3119
3351
  * The border radius in pixels for the annotaiton's label.
3120
3352
  *
@@ -3409,6 +3641,32 @@
3409
3641
  * @requires modules/annotations
3410
3642
  */
3411
3643
  shapeOptions: {
3644
+ /**
3645
+ *
3646
+ * The radius of the shape in y direction.
3647
+ * Used for the ellipse.
3648
+ *
3649
+ * @sample highcharts/annotations/ellipse/
3650
+ * Ellipse annotation
3651
+ *
3652
+ * @type {number}
3653
+ * @apioption annotations.shapeOptions.ry
3654
+ **/
3655
+ /**
3656
+ *
3657
+ * The xAxis index to which the points should be attached.
3658
+ * Used for the ellipse.
3659
+ *
3660
+ * @type {number}
3661
+ * @apioption annotations.shapeOptions.xAxis
3662
+ **/
3663
+ /**
3664
+ * The yAxis index to which the points should be attached.
3665
+ * Used for the ellipse.
3666
+ *
3667
+ * @type {number}
3668
+ * @apioption annotations.shapeOptions.yAxis
3669
+ **/
3412
3670
  /**
3413
3671
  * The width of the shape.
3414
3672
  *
@@ -3428,11 +3686,15 @@
3428
3686
  * @apioption annotations.shapeOptions.height
3429
3687
  */
3430
3688
  /**
3431
- * The type of the shape, e.g. circle or rectangle.
3689
+ * The type of the shape.
3690
+ * Avaliable options are circle, rect and ellipse.
3432
3691
  *
3433
3692
  * @sample highcharts/annotations/shape/
3434
3693
  * Basic shape annotation
3435
3694
  *
3695
+ * @sample highcharts/annotations/ellipse/
3696
+ * Ellipse annotation
3697
+ *
3436
3698
  * @type {string}
3437
3699
  * @default rect
3438
3700
  * @apioption annotations.shapeOptions.type
@@ -3514,9 +3776,10 @@
3514
3776
  width: 10,
3515
3777
  height: 10,
3516
3778
  style: {
3517
- stroke: palette.neutralColor100,
3518
- 'stroke-width': 2,
3519
- fill: palette.backgroundColor
3779
+ cursor: 'pointer',
3780
+ fill: "#ffffff" /* backgroundColor */,
3781
+ stroke: "#000000" /* neutralColor100 */,
3782
+ 'stroke-width': 2
3520
3783
  },
3521
3784
  visible: false,
3522
3785
  events: {}
@@ -3579,7 +3842,8 @@
3579
3842
  * @param {Highcharts.AnnotationsOptions} options
3580
3843
  * The annotation options for the new, detailed annotation.
3581
3844
  * @param {boolean} [redraw]
3582
- *
3845
+ * @sample highcharts/annotations/add-annotation/
3846
+ * Add annotation
3583
3847
  * @return {Highcharts.Annotation} - The newly generated annotation.
3584
3848
  */
3585
3849
  addAnnotation: function (userOptions, redraw) {
@@ -3898,10 +4162,11 @@
3898
4162
  var options = this.options;
3899
4163
  if (options.shapes) {
3900
4164
  delete options.labelOptions;
3901
- if (options.shapes[0].type === 'circle') {
3902
- this.basicType = 'circle';
4165
+ if (options.shapes[0].type) {
4166
+ this.basicType = options.shapes[0].type;
3903
4167
  }
3904
4168
  else {
4169
+ // Defalut shape would be rectangle.
3905
4170
  this.basicType = 'rectangle';
3906
4171
  }
3907
4172
  }
@@ -4026,6 +4291,64 @@
4026
4291
  target.redraw(false);
4027
4292
  }
4028
4293
  }
4294
+ }],
4295
+ ellipse: [{
4296
+ positioner: function (target) {
4297
+ var position = target.getAbsolutePosition(target.points[0]);
4298
+ return {
4299
+ x: position.x - this.graphic.width / 2,
4300
+ y: position.y - this.graphic.height / 2
4301
+ };
4302
+ },
4303
+ events: {
4304
+ drag: function (e, target) {
4305
+ var position = target.getAbsolutePosition(target.points[0]);
4306
+ target.translatePoint(e.chartX - position.x, e.chartY - position.y, 0);
4307
+ target.redraw(false);
4308
+ }
4309
+ }
4310
+ }, {
4311
+ positioner: function (target) {
4312
+ var position = target.getAbsolutePosition(target.points[1]);
4313
+ return {
4314
+ x: position.x - this.graphic.width / 2,
4315
+ y: position.y - this.graphic.height / 2
4316
+ };
4317
+ },
4318
+ events: {
4319
+ drag: function (e, target) {
4320
+ var position = target.getAbsolutePosition(target.points[1]);
4321
+ target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
4322
+ target.redraw(false);
4323
+ }
4324
+ }
4325
+ }, {
4326
+ positioner: function (target) {
4327
+ var position = target.getAbsolutePosition(target.points[0]),
4328
+ position2 = target.getAbsolutePosition(target.points[1]),
4329
+ attrs = target.getAttrs(position,
4330
+ position2);
4331
+ return {
4332
+ x: attrs.cx - this.graphic.width / 2 +
4333
+ attrs.ry * Math.sin((attrs.angle * Math.PI) / 180),
4334
+ y: attrs.cy - this.graphic.height / 2 -
4335
+ attrs.ry * Math.cos((attrs.angle * Math.PI) / 180)
4336
+ };
4337
+ },
4338
+ events: {
4339
+ drag: function (e, target) {
4340
+ var position = target.getAbsolutePosition(target.points[0]),
4341
+ position2 = target.getAbsolutePosition(target.points[1]),
4342
+ newR = target.getDistanceFromLine(position,
4343
+ position2,
4344
+ e.chartX,
4345
+ e.chartY),
4346
+ yAxis = target.getYAxis(),
4347
+ newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
4348
+ target.setYRadius(newRY);
4349
+ target.redraw(false);
4350
+ }
4351
+ }
4029
4352
  }]
4030
4353
  };
4031
4354
  return BasicAnnotation;
@@ -4124,7 +4447,7 @@
4124
4447
  return target.annotation.points[i];
4125
4448
  };
4126
4449
  })
4127
- }), false);
4450
+ }), 0);
4128
4451
  typeOptions.line = shape.options;
4129
4452
  };
4130
4453
  return CrookedLine;
@@ -4422,14 +4745,14 @@
4422
4745
  },
4423
4746
  this.points[3]
4424
4747
  ]
4425
- }), false);
4748
+ }), 0);
4426
4749
  this.options.typeOptions.line = line.options;
4427
4750
  };
4428
4751
  Tunnel.prototype.addBackground = function () {
4429
4752
  var background = this.initShape(merge(this.options.typeOptions.background, {
4430
4753
  type: 'path',
4431
4754
  points: this.points.slice()
4432
- }));
4755
+ }), 1);
4433
4756
  this.options.typeOptions.background = background.options;
4434
4757
  };
4435
4758
  /**
@@ -4469,8 +4792,6 @@
4469
4792
  */
4470
4793
  {
4471
4794
  typeOptions: {
4472
- xAxis: 0,
4473
- yAxis: 0,
4474
4795
  /**
4475
4796
  * Background options.
4476
4797
  *
@@ -4530,7 +4851,7 @@
4530
4851
  visiblePlotOnly: true
4531
4852
  })) {
4532
4853
  var translation = this.mouseMoveToTranslation(e);
4533
- target.translateSide(translation.x, translation.y, this.index);
4854
+ target.translateSide(translation.x, translation.y, !!this.index);
4534
4855
  target.redraw(false);
4535
4856
  }
4536
4857
  }
@@ -4689,8 +5010,7 @@
4689
5010
  var line = this.initShape(merge(typeOptions.line, {
4690
5011
  type: 'path',
4691
5012
  points: points
4692
- }),
4693
- false);
5013
+ }), 0);
4694
5014
  typeOptions.line = line.options;
4695
5015
  };
4696
5016
  /**
@@ -4733,8 +5053,10 @@
4733
5053
 
4734
5054
  return InfinityLine;
4735
5055
  });
4736
- _registerModule(_modules, 'Extensions/Annotations/Types/Fibonacci.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Extensions/Annotations/Types/Tunnel.js'], _modules['Core/Utilities.js'], _modules['Core/Color/Palette.js']], function (Annotation, MockPoint, Tunnel, U, palette) {
5056
+ _registerModule(_modules, 'Extensions/Annotations/Types/TimeCycles.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/Types/CrookedLine.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Core/Utilities.js']], function (Annotation, CrookedLine, ControlPoint, U) {
4737
5057
  /* *
5058
+ *
5059
+ * Authors: Rafal Sebestjanski and Pawel Lysy
4738
5060
  *
4739
5061
  * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
4740
5062
  *
@@ -4755,74 +5077,301 @@
4755
5077
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4756
5078
  };
4757
5079
  })();
4758
- var merge = U.merge;
5080
+ var merge = U.merge,
5081
+ isNumber = U.isNumber,
5082
+ defined = U.defined;
5083
+ /**
5084
+ * Function to create start of the path.
5085
+ * @param {number} x x position of the TimeCycles
5086
+ * @param {number} y y position of the TimeCycles
5087
+ * @return {string} path
5088
+ */
5089
+ function getStartingPath(x, y) {
5090
+ return ['M', x, y];
5091
+ }
5092
+ /**
5093
+ * Function which generates the path of the halfcircle.
5094
+ *
5095
+ * @param {number} pixelInterval diameter of the circle in pixels
5096
+ * @param {number} numberOfCircles number of cricles
5097
+ * @param {number} startX x position of the first circle
5098
+ * @param {number} y y position of the bottom of the timeCycles
5099
+ * @return {string} path
5100
+ *
5101
+ */
5102
+ function getCirclePath(pixelInterval, numberOfCircles, startX, y) {
5103
+ var strToRepeat = function (i) { return [
5104
+ 'A',
5105
+ pixelInterval / 2,
5106
+ pixelInterval / 2,
5107
+ 0,
5108
+ 1,
5109
+ 1,
5110
+ startX + i * pixelInterval,
5111
+ y
5112
+ ]; };
5113
+ var path = [];
5114
+ for (var i = 1; i <= numberOfCircles; i++) {
5115
+ path.push(strToRepeat(i));
5116
+ }
5117
+ return path;
5118
+ }
5119
+ /* *
5120
+ *
5121
+ * Class
5122
+ *
5123
+ * */
4759
5124
  /* eslint-disable no-invalid-this, valid-jsdoc */
4760
- var createPathDGenerator = function (retracementIndex,
4761
- isBackground) {
4762
- return function () {
4763
- var annotation = this.annotation;
4764
- if (!annotation.startRetracements || !annotation.endRetracements) {
4765
- return [];
5125
+ var TimeCycles = /** @class */ (function (_super) {
5126
+ __extends(TimeCycles, _super);
5127
+ function TimeCycles() {
5128
+ return _super !== null && _super.apply(this, arguments) || this;
5129
+ }
5130
+ TimeCycles.prototype.init = function (annotation, options, index) {
5131
+ if (defined(options.yAxis)) {
5132
+ options.points.forEach(function (point) {
5133
+ point.yAxis = options.yAxis;
5134
+ });
4766
5135
  }
4767
- var leftTop = this.anchor(annotation.startRetracements[retracementIndex]).absolutePosition,
4768
- rightTop = this.anchor(annotation.endRetracements[retracementIndex]).absolutePosition,
4769
- d = [
4770
- ['M',
4771
- Math.round(leftTop.x),
4772
- Math.round(leftTop.y)],
4773
- ['L',
4774
- Math.round(rightTop.x),
4775
- Math.round(rightTop.y)]
4776
- ],
4777
- rightBottom,
4778
- leftBottom;
4779
- if (isBackground) {
4780
- rightBottom = this.anchor(annotation.endRetracements[retracementIndex - 1]).absolutePosition;
4781
- leftBottom = this.anchor(annotation.startRetracements[retracementIndex - 1]).absolutePosition;
4782
- d.push(['L', Math.round(rightBottom.x), Math.round(rightBottom.y)], ['L', Math.round(leftBottom.x), Math.round(leftBottom.y)]);
5136
+ if (defined(options.xAxis)) {
5137
+ options.points.forEach(function (point) {
5138
+ point.xAxis = options.xAxis;
5139
+ });
4783
5140
  }
4784
- return d;
5141
+ _super.prototype.init.call(this, annotation, options, index);
4785
5142
  };
4786
- };
4787
- var Fibonacci = /** @class */ (function (_super) {
4788
- __extends(Fibonacci, _super);
4789
- /* *
4790
- *
4791
- * Constructors
4792
- *
4793
- * */
4794
- function Fibonacci(chart, options) {
4795
- return _super.call(this, chart, options) || this;
4796
- }
4797
- /* *
4798
- *
4799
- * Functions
4800
- *
4801
- * */
4802
- Fibonacci.prototype.linkPoints = function () {
4803
- _super.prototype.linkPoints.call(this);
4804
- this.linkRetracementsPoints();
4805
- return;
5143
+ TimeCycles.prototype.setPath = function () {
5144
+ this.shapes[0].options.d = this.getPath();
4806
5145
  };
4807
- Fibonacci.prototype.linkRetracementsPoints = function () {
4808
- var points = this.points,
4809
- startDiff = points[0].y - points[3].y,
4810
- endDiff = points[1].y - points[2].y,
4811
- startX = points[0].x,
4812
- endX = points[1].x;
4813
- Fibonacci.levels.forEach(function (level, i) {
4814
- var startRetracement = points[0].y - startDiff * level,
4815
- endRetracement = points[1].y - endDiff * level;
4816
- this.startRetracements = this.startRetracements || [];
4817
- this.endRetracements = this.endRetracements || [];
4818
- this.linkRetracementPoint(i, startX, startRetracement, this.startRetracements);
4819
- this.linkRetracementPoint(i, endX, endRetracement, this.endRetracements);
4820
- }, this);
5146
+ TimeCycles.prototype.getPath = function () {
5147
+ return [getStartingPath(this.startX, this.y)].concat(getCirclePath(this.pixelInterval, this.numberOfCircles, this.startX, this.y));
4821
5148
  };
4822
- Fibonacci.prototype.linkRetracementPoint = function (pointIndex, x, y, retracements) {
4823
- var point = retracements[pointIndex],
4824
- typeOptions = this.options.typeOptions;
4825
- if (!point) {
5149
+ TimeCycles.prototype.addShapes = function () {
5150
+ var typeOptions = this.options.typeOptions;
5151
+ this.setPathProperties();
5152
+ var shape = this.initShape(merge(typeOptions.line, {
5153
+ type: 'path',
5154
+ d: this.getPath(),
5155
+ points: this.options.points
5156
+ }), 0);
5157
+ typeOptions.line = shape.options;
5158
+ };
5159
+ TimeCycles.prototype.addControlPoints = function () {
5160
+ var _this = this;
5161
+ var options = this.options,
5162
+ typeOptions = options.typeOptions;
5163
+ options.controlPointOptions.style.cursor = this.chart.inverted ? 'ns-resize' : 'ew-resize';
5164
+ typeOptions.controlPointOptions.forEach(function (option) {
5165
+ var controlPointsOptions = merge(options.controlPointOptions,
5166
+ option);
5167
+ var controlPoint = new ControlPoint(_this.chart,
5168
+ _this,
5169
+ controlPointsOptions, 0);
5170
+ _this.controlPoints.push(controlPoint);
5171
+ });
5172
+ };
5173
+ TimeCycles.prototype.setPathProperties = function () {
5174
+ var options = this.options.typeOptions,
5175
+ points = options.points;
5176
+ if (!points) {
5177
+ return;
5178
+ }
5179
+ var point1 = points[0],
5180
+ point2 = points[1],
5181
+ xAxisNumber = options.xAxis || 0,
5182
+ yAxisNumber = options.yAxis || 0,
5183
+ xAxis = this.chart.xAxis[xAxisNumber],
5184
+ yAxis = this.chart.yAxis[yAxisNumber],
5185
+ xValue1 = point1.x,
5186
+ yValue = point1.y,
5187
+ xValue2 = point2.x;
5188
+ if (!xValue1 || !xValue2) {
5189
+ return;
5190
+ }
5191
+ var y = isNumber(yValue) ? yAxis.toPixels(yValue) : yAxis.top + yAxis.height,
5192
+ x = isNumber(xValue1) ? xAxis.toPixels(xValue1) : xAxis.left,
5193
+ x2 = isNumber(xValue2) ? xAxis.toPixels(xValue2) : xAxis.left + 30,
5194
+ xAxisLength = xAxis.len,
5195
+ pixelInterval = Math.round(Math.max(Math.abs(x2 - x), 2)),
5196
+ // There can be 2 not full circles on the chart, so add 2.
5197
+ numberOfCircles = Math.floor(xAxisLength / pixelInterval) + 2,
5198
+ // Calculate where the annotation should start drawing
5199
+ // relative to first point.
5200
+ pixelShift = (Math.floor((x - xAxis.left) / pixelInterval) + 1) * pixelInterval;
5201
+ this.startX = x - pixelShift;
5202
+ this.y = y;
5203
+ this.pixelInterval = pixelInterval;
5204
+ this.numberOfCircles = numberOfCircles;
5205
+ };
5206
+ TimeCycles.prototype.redraw = function (animation) {
5207
+ this.setPathProperties();
5208
+ this.setPath();
5209
+ _super.prototype.redraw.call(this, animation);
5210
+ };
5211
+ return TimeCycles;
5212
+ }(CrookedLine));
5213
+ TimeCycles.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions, {
5214
+ typeOptions: {
5215
+ controlPointOptions: [{
5216
+ positioner: function (target) {
5217
+ var point = target.points[0],
5218
+ position = target.anchor(point).absolutePosition;
5219
+ return {
5220
+ x: position.x - this.graphic.width / 2,
5221
+ y: target.y - this.graphic.height
5222
+ };
5223
+ },
5224
+ events: {
5225
+ drag: function (e, target) {
5226
+ var position = target.anchor(target.points[0]).absolutePosition;
5227
+ target.translatePoint(e.chartX - position.x, 0, 0);
5228
+ target.redraw(false);
5229
+ }
5230
+ }
5231
+ }, {
5232
+ positioner: function (target) {
5233
+ var point = target.points[1],
5234
+ position = target.anchor(point).absolutePosition;
5235
+ return {
5236
+ x: position.x - this.graphic.width / 2,
5237
+ y: target.y - this.graphic.height
5238
+ };
5239
+ },
5240
+ events: {
5241
+ drag: function (e, target) {
5242
+ var position = target.anchor(target.points[1]).absolutePosition;
5243
+ target.translatePoint(e.chartX - position.x, 0, 1);
5244
+ target.redraw(false);
5245
+ }
5246
+ }
5247
+ }]
5248
+ }
5249
+ });
5250
+ /* *
5251
+ *
5252
+ * Registry
5253
+ *
5254
+ * */
5255
+ Annotation.types.timeCycles = TimeCycles;
5256
+ /* *
5257
+ *
5258
+ * Default Export
5259
+ *
5260
+ * */
5261
+ /* *
5262
+ *
5263
+ * API Declarations
5264
+ *
5265
+ * */
5266
+ /**
5267
+ * The TimeCycles Annotation
5268
+ * @sample highcharts/annotations-advanced/time-cycles/
5269
+ * Time Cycles annotation
5270
+ *
5271
+ * @extends annotations.crookedLine
5272
+ * @product highstock
5273
+ * @exclude labelOptions
5274
+ * @apioption annotations.timeCycles
5275
+ */
5276
+ /**
5277
+ * @exclude y
5278
+ * @product highstock
5279
+ * @apioption annotations.timeCycles.typeOptions.points
5280
+ */
5281
+ (''); // keeps doclets above in transpiled file
5282
+
5283
+ return TimeCycles;
5284
+ });
5285
+ _registerModule(_modules, 'Extensions/Annotations/Types/Fibonacci.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Extensions/Annotations/Types/Tunnel.js'], _modules['Core/Utilities.js']], function (Annotation, MockPoint, Tunnel, U) {
5286
+ /* *
5287
+ *
5288
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
5289
+ *
5290
+ * */
5291
+ var __extends = (this && this.__extends) || (function () {
5292
+ var extendStatics = function (d,
5293
+ b) {
5294
+ extendStatics = Object.setPrototypeOf ||
5295
+ ({ __proto__: [] } instanceof Array && function (d,
5296
+ b) { d.__proto__ = b; }) ||
5297
+ function (d,
5298
+ b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5299
+ return extendStatics(d, b);
5300
+ };
5301
+ return function (d, b) {
5302
+ extendStatics(d, b);
5303
+ function __() { this.constructor = d; }
5304
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5305
+ };
5306
+ })();
5307
+ var merge = U.merge;
5308
+ /* eslint-disable no-invalid-this, valid-jsdoc */
5309
+ var createPathDGenerator = function (retracementIndex,
5310
+ isBackground) {
5311
+ return function () {
5312
+ var annotation = this.annotation;
5313
+ if (!annotation.startRetracements || !annotation.endRetracements) {
5314
+ return [];
5315
+ }
5316
+ var leftTop = this.anchor(annotation.startRetracements[retracementIndex]).absolutePosition,
5317
+ rightTop = this.anchor(annotation.endRetracements[retracementIndex]).absolutePosition,
5318
+ d = [
5319
+ ['M',
5320
+ Math.round(leftTop.x),
5321
+ Math.round(leftTop.y)],
5322
+ ['L',
5323
+ Math.round(rightTop.x),
5324
+ Math.round(rightTop.y)]
5325
+ ],
5326
+ rightBottom,
5327
+ leftBottom;
5328
+ if (isBackground) {
5329
+ rightBottom = this.anchor(annotation.endRetracements[retracementIndex - 1]).absolutePosition;
5330
+ leftBottom = this.anchor(annotation.startRetracements[retracementIndex - 1]).absolutePosition;
5331
+ d.push(['L', Math.round(rightBottom.x), Math.round(rightBottom.y)], ['L', Math.round(leftBottom.x), Math.round(leftBottom.y)]);
5332
+ }
5333
+ return d;
5334
+ };
5335
+ };
5336
+ var Fibonacci = /** @class */ (function (_super) {
5337
+ __extends(Fibonacci, _super);
5338
+ /* *
5339
+ *
5340
+ * Constructors
5341
+ *
5342
+ * */
5343
+ function Fibonacci(chart, options) {
5344
+ return _super.call(this, chart, options) || this;
5345
+ }
5346
+ /* *
5347
+ *
5348
+ * Functions
5349
+ *
5350
+ * */
5351
+ Fibonacci.prototype.linkPoints = function () {
5352
+ _super.prototype.linkPoints.call(this);
5353
+ this.linkRetracementsPoints();
5354
+ return;
5355
+ };
5356
+ Fibonacci.prototype.linkRetracementsPoints = function () {
5357
+ var points = this.points,
5358
+ startDiff = points[0].y - points[3].y,
5359
+ endDiff = points[1].y - points[2].y,
5360
+ startX = points[0].x,
5361
+ endX = points[1].x;
5362
+ Fibonacci.levels.forEach(function (level, i) {
5363
+ var startRetracement = points[0].y - startDiff * level,
5364
+ endRetracement = points[1].y - endDiff * level;
5365
+ this.startRetracements = this.startRetracements || [];
5366
+ this.endRetracements = this.endRetracements || [];
5367
+ this.linkRetracementPoint(i, startX, startRetracement, this.startRetracements);
5368
+ this.linkRetracementPoint(i, endX, endRetracement, this.endRetracements);
5369
+ }, this);
5370
+ };
5371
+ Fibonacci.prototype.linkRetracementPoint = function (pointIndex, x, y, retracements) {
5372
+ var point = retracements[pointIndex],
5373
+ typeOptions = this.options.typeOptions;
5374
+ if (!point) {
4826
5375
  retracements[pointIndex] = new MockPoint(this.chart, this, {
4827
5376
  x: x,
4828
5377
  y: y,
@@ -4846,7 +5395,7 @@
4846
5395
  type: 'path',
4847
5396
  d: createPathDGenerator(i),
4848
5397
  stroke: lineColors[i] || lineColor
4849
- }, false);
5398
+ }, i);
4850
5399
  if (i > 0) {
4851
5400
  this.initShape({
4852
5401
  type: 'path',
@@ -4920,7 +5469,7 @@
4920
5469
  /**
4921
5470
  * The color of line.
4922
5471
  */
4923
- lineColor: palette.neutralColor40,
5472
+ lineColor: "#999999" /* neutralColor40 */,
4924
5473
  /**
4925
5474
  * An array of colors for the lines.
4926
5475
  */
@@ -4958,6 +5507,243 @@
4958
5507
 
4959
5508
  return Fibonacci;
4960
5509
  });
5510
+ _registerModule(_modules, 'Extensions/Annotations/Types/FibonacciTimeZones.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/Types/CrookedLine.js'], _modules['Extensions/Annotations/Types/InfinityLine.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, ControlPoint, CrookedLine, InfinityLine, MockPoint, U) {
5511
+ /* *
5512
+ *
5513
+ * Author: Rafal Sebestjanski
5514
+ *
5515
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
5516
+ *
5517
+ * */
5518
+ var __extends = (this && this.__extends) || (function () {
5519
+ var extendStatics = function (d,
5520
+ b) {
5521
+ extendStatics = Object.setPrototypeOf ||
5522
+ ({ __proto__: [] } instanceof Array && function (d,
5523
+ b) { d.__proto__ = b; }) ||
5524
+ function (d,
5525
+ b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5526
+ return extendStatics(d, b);
5527
+ };
5528
+ return function (d, b) {
5529
+ extendStatics(d, b);
5530
+ function __() { this.constructor = d; }
5531
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5532
+ };
5533
+ })();
5534
+ var merge = U.merge;
5535
+ /* *
5536
+ *
5537
+ * Class
5538
+ *
5539
+ * */
5540
+ /* eslint-disable no-invalid-this, valid-jsdoc */
5541
+ var FibonacciTimeZones = /** @class */ (function (_super) {
5542
+ __extends(FibonacciTimeZones, _super);
5543
+ function FibonacciTimeZones() {
5544
+ return _super !== null && _super.apply(this, arguments) || this;
5545
+ }
5546
+ /* *
5547
+ *
5548
+ * Functions
5549
+ *
5550
+ * */
5551
+ /*
5552
+ Method taken (and slightly changed) from the InfinityLine annotation.
5553
+
5554
+ It uses x coordinate to create two mock points on the same x. Then,
5555
+ it uses some logic from InfinityLine to find equation of the line passing
5556
+ through our two points and, using that equation, it finds and returns
5557
+ the coordinates of where the line intersects the plot area edges.
5558
+
5559
+ This is being done for each fibonacci time zone line.
5560
+
5561
+
5562
+ this point here is found
5563
+ |
5564
+ v
5565
+ |---------*--------------------------------------------------------|
5566
+ | |
5567
+ | |
5568
+ | |
5569
+ | |
5570
+ | * copy of the primary point |
5571
+ | |
5572
+ | * primary point (e.g. the one given in options) |
5573
+ | |
5574
+ |---------*--------------------------------------------------------|
5575
+ and this point here is found (intersection with the plot area edge)
5576
+
5577
+ */
5578
+ FibonacciTimeZones.prototype.edgePoint = function (startIndex, endIndex, fibonacciIndex) {
5579
+ return function (target) {
5580
+ var chart = target.annotation.chart,
5581
+ plotLeftOrTop = chart.inverted ? chart.plotTop : chart.plotLeft;
5582
+ var points = target.annotation.points;
5583
+ var xAxis = points[0].series.xAxis,
5584
+ // Distance between the two first lines in pixels
5585
+ deltaX = points.length > 1 ?
5586
+ points[1].plotX - points[0].plotX : 0,
5587
+ // firstLine.x + fibb * offset
5588
+ x = xAxis.toValue(points[0].plotX + plotLeftOrTop + fibonacciIndex * deltaX);
5589
+ // We need 2 mock points with the same x coordinate, different y
5590
+ points = [
5591
+ new MockPoint(chart, points[0].target, {
5592
+ x: x,
5593
+ y: 0,
5594
+ xAxis: points[0].options.xAxis,
5595
+ yAxis: points[0].options.yAxis
5596
+ }),
5597
+ new MockPoint(chart, points[0].target, {
5598
+ x: x,
5599
+ y: 1,
5600
+ xAxis: points[0].options.xAxis,
5601
+ yAxis: points[0].options.yAxis
5602
+ })
5603
+ ];
5604
+ return InfinityLine.findEdgePoint(points[startIndex], points[endIndex]);
5605
+ };
5606
+ };
5607
+ FibonacciTimeZones.prototype.addShapes = function () {
5608
+ var numberOfLines = 11;
5609
+ var fibb = 1,
5610
+ nextFibb = 1;
5611
+ for (var i = 0; i < numberOfLines; i++) {
5612
+ // The fibb variable equals to 1 twice - correct it in the first
5613
+ // iteration so the lines don't overlap
5614
+ var correctedFibb = !i ? 0 : fibb,
5615
+ points = [
5616
+ this.edgePoint(1, 0,
5617
+ correctedFibb),
5618
+ this.edgePoint(0, 1,
5619
+ correctedFibb)
5620
+ ];
5621
+ // Calculate fibbonacci
5622
+ nextFibb = fibb + nextFibb;
5623
+ fibb = nextFibb - fibb;
5624
+ // Save the second line for the control point
5625
+ if (i === 1) {
5626
+ this.secondLineEdgePoints = [points[0], points[1]];
5627
+ }
5628
+ this.initShape(merge(this.options.typeOptions.line, {
5629
+ type: 'path',
5630
+ points: points
5631
+ }), i // shape's index. Can be found in annotation.shapes[i].index
5632
+ );
5633
+ }
5634
+ };
5635
+ FibonacciTimeZones.prototype.addControlPoints = function () {
5636
+ var options = this.options,
5637
+ typeOptions = options.typeOptions,
5638
+ controlPoint = new ControlPoint(this.chart,
5639
+ this,
5640
+ merge(options.controlPointOptions,
5641
+ typeOptions.controlPointOptions), 0);
5642
+ this.controlPoints.push(controlPoint);
5643
+ typeOptions.controlPointOptions = controlPoint.options;
5644
+ };
5645
+ return FibonacciTimeZones;
5646
+ }(CrookedLine));
5647
+ FibonacciTimeZones.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions, {
5648
+ typeOptions: {
5649
+ // Options for showing in popup edit
5650
+ line: {
5651
+ /**
5652
+ * The color of the lines.
5653
+ *
5654
+ * @type {string}
5655
+ * @since 9.3.0
5656
+ * @default 'rgba(0, 0, 0, 0.75)'
5657
+ * @apioption annotations.fibonacciTimeZones.typeOptions.line.stroke
5658
+ */
5659
+ stroke: 'rgba(0, 0, 0, 0.75)',
5660
+ /**
5661
+ * The width of the lines.
5662
+ *
5663
+ * @type {number}
5664
+ * @since 9.3.0
5665
+ * @default 1
5666
+ * @apioption annotations.fibonacciTimeZones.typeOptions.line.strokeWidth
5667
+ */
5668
+ strokeWidth: 1,
5669
+ // Don't inherit fill (don't display in popup edit)
5670
+ fill: void 0
5671
+ },
5672
+ controlPointOptions: {
5673
+ positioner: function () {
5674
+ var _a;
5675
+ // The control point is in the middle of the second line
5676
+ var target = this.target,
5677
+ graphic = this.graphic,
5678
+ edgePoints = target.secondLineEdgePoints,
5679
+ args = { annotation: target },
5680
+ firstEdgePointY = edgePoints[0](args).y,
5681
+ secondEdgePointY = edgePoints[1](args).y,
5682
+ plotLeft = this.chart.plotLeft,
5683
+ plotTop = this.chart.plotTop;
5684
+ var x = edgePoints[0](args).x,
5685
+ y = (firstEdgePointY + secondEdgePointY) / 2;
5686
+ if (this.chart.inverted) {
5687
+ _a = [y, x], x = _a[0], y = _a[1];
5688
+ }
5689
+ return {
5690
+ x: plotLeft + x - graphic.width / 2,
5691
+ y: plotTop + y - graphic.height / 2
5692
+ };
5693
+ },
5694
+ events: {
5695
+ drag: function (e, target) {
5696
+ var isInsidePlot = target.chart.isInsidePlot(e.chartX - target.chart.plotLeft,
5697
+ e.chartY - target.chart.plotTop, {
5698
+ visiblePlotOnly: true
5699
+ });
5700
+ if (isInsidePlot) {
5701
+ var translation = this.mouseMoveToTranslation(e);
5702
+ target.translatePoint(translation.x, 0, 1);
5703
+ target.redraw(false);
5704
+ }
5705
+ }
5706
+ }
5707
+ }
5708
+ }
5709
+ });
5710
+ /* *
5711
+ *
5712
+ * Registry
5713
+ *
5714
+ * */
5715
+ Annotation.types.fibonacciTimeZones = FibonacciTimeZones;
5716
+ /* *
5717
+ *
5718
+ * Default Export
5719
+ *
5720
+ * */
5721
+ /* *
5722
+ *
5723
+ * API Declarations
5724
+ *
5725
+ * */
5726
+ /**
5727
+ * The Fibonacci Time Zones annotation.
5728
+ *
5729
+ * @sample highcharts/annotations-advanced/fibonacci-time-zones/
5730
+ * Fibonacci Time Zones
5731
+ *
5732
+ * @extends annotations.crookedLine
5733
+ * @since 9.3.0
5734
+ * @product highstock
5735
+ * @apioption annotations.fibonacciTimeZones
5736
+ */
5737
+ /**
5738
+ * @exclude y
5739
+ * @since 9.3.0
5740
+ * @product highstock
5741
+ * @apioption annotations.fibonacciTimeZones.typeOptions.points
5742
+ */
5743
+ (''); // keeps doclets above in transpiled file
5744
+
5745
+ return FibonacciTimeZones;
5746
+ });
4961
5747
  _registerModule(_modules, 'Extensions/Annotations/Types/Pitchfork.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/Types/InfinityLine.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, InfinityLine, MockPoint, U) {
4962
5748
  /* *
4963
5749
  *
@@ -5043,21 +5829,21 @@
5043
5829
  this.points[0],
5044
5830
  Pitchfork.middleLineEdgePoint
5045
5831
  ]
5046
- }, false);
5832
+ }, 0);
5047
5833
  this.initShape({
5048
5834
  type: 'path',
5049
5835
  points: [
5050
5836
  this.points[1],
5051
5837
  Pitchfork.topLineEdgePoint
5052
5838
  ]
5053
- }, false);
5839
+ }, 1);
5054
5840
  this.initShape({
5055
5841
  type: 'path',
5056
5842
  points: [
5057
5843
  this.points[2],
5058
5844
  Pitchfork.bottomLineEdgePoint
5059
5845
  ]
5060
- }, false);
5846
+ }, 2);
5061
5847
  };
5062
5848
  Pitchfork.prototype.addBackgrounds = function () {
5063
5849
  var shapes = this.shapes,
@@ -5090,7 +5876,7 @@
5090
5876
  };
5091
5877
  }
5092
5878
  ]
5093
- }));
5879
+ }), 3);
5094
5880
  var outerBackground = this.initShape(merge(typeOptions.outerBackground, {
5095
5881
  type: 'path',
5096
5882
  points: [
@@ -5099,7 +5885,7 @@
5099
5885
  shapes[2].points[1],
5100
5886
  this.points[2]
5101
5887
  ]
5102
- }));
5888
+ }), 4);
5103
5889
  typeOptions.innerBackground = innerBackground.options;
5104
5890
  typeOptions.outerBackground = outerBackground.options;
5105
5891
  };
@@ -5255,8 +6041,7 @@
5255
6041
  VerticalLine.connectorFirstPoint,
5256
6042
  VerticalLine.connectorSecondPoint
5257
6043
  ]
5258
- }),
5259
- false);
6044
+ }), 0);
5260
6045
  typeOptions.connector = connector.options;
5261
6046
  };
5262
6047
  VerticalLine.prototype.addLabels = function () {
@@ -5361,7 +6146,8 @@
5361
6146
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5362
6147
  };
5363
6148
  })();
5364
- var extend = U.extend,
6149
+ var defined = U.defined,
6150
+ extend = U.extend,
5365
6151
  isNumber = U.isNumber,
5366
6152
  merge = U.merge,
5367
6153
  pick = U.pick;
@@ -5448,8 +6234,19 @@
5448
6234
  ];
5449
6235
  };
5450
6236
  Measure.prototype.addControlPoints = function () {
6237
+ var inverted = this.chart.inverted,
6238
+ options = this.options.controlPointOptions;
5451
6239
  var selectType = this.options.typeOptions.selectType,
5452
6240
  controlPoint;
6241
+ if (!defined(this.userOptions.controlPointOptions &&
6242
+ this.userOptions.controlPointOptions.style.cursor)) {
6243
+ if (selectType === 'x') {
6244
+ options.style.cursor = inverted ? 'ns-resize' : 'ew-resize';
6245
+ }
6246
+ else if (selectType === 'y') {
6247
+ options.style.cursor = inverted ? 'ew-resize' : 'ns-resize';
6248
+ }
6249
+ }
5453
6250
  controlPoint = new ControlPoint(this.chart, this, this.options.controlPointOptions, 0);
5454
6251
  this.controlPoints.push(controlPoint);
5455
6252
  // add extra controlPoint for horizontal and vertical range
@@ -5526,7 +6323,7 @@
5526
6323
  this.initShape(extend({
5527
6324
  type: 'path',
5528
6325
  points: this.shapePointsOptions()
5529
- }, this.options.typeOptions.background), false);
6326
+ }, this.options.typeOptions.background), 2);
5530
6327
  };
5531
6328
  /**
5532
6329
  * Add internal crosshair shapes (on top and bottom).
@@ -5593,12 +6390,8 @@
5593
6390
  // Add new crosshairs
5594
6391
  crosshairOptionsX = merge(defaultOptions, options.crosshairX);
5595
6392
  crosshairOptionsY = merge(defaultOptions, options.crosshairY);
5596
- this.initShape(extend({
5597
- d: pathH
5598
- }, crosshairOptionsX), false);
5599
- this.initShape(extend({
5600
- d: pathV
5601
- }, crosshairOptionsY), false);
6393
+ this.initShape(extend({ d: pathH }, crosshairOptionsX), 0);
6394
+ this.initShape(extend({ d: pathV }, crosshairOptionsY), 1);
5602
6395
  }
5603
6396
  };
5604
6397
  Measure.prototype.onDrag = function (e) {
@@ -6205,66 +6998,101 @@
6205
6998
 
6206
6999
  return Measure;
6207
7000
  });
6208
- _registerModule(_modules, 'Mixins/Navigation.js', [], function () {
7001
+ _registerModule(_modules, 'Core/Chart/ChartNavigationComposition.js', [], function () {
6209
7002
  /**
6210
7003
  *
6211
7004
  * (c) 2010-2021 Paweł Fus
6212
7005
  *
6213
7006
  * License: www.highcharts.com/license
6214
- *
6215
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
6216
- *
6217
- * */
6218
- var chartNavigation = {
6219
- /**
6220
- * Initializes `chart.navigation` object which delegates `update()` methods
6221
- * to all other common classes (used in exporting and navigationBindings).
6222
- *
6223
- * @private
6224
- * @param {Highcharts.Chart} chart
6225
- * The chart instance.
6226
- * @return {void}
6227
- */
6228
- initUpdate: function (chart) {
6229
- if (!chart.navigation) {
6230
- chart.navigation = {
6231
- updates: [],
6232
- update: function (options,
6233
- redraw) {
6234
- this.updates.forEach(function (updateConfig) {
6235
- updateConfig.update.call(updateConfig.context,
6236
- options,
6237
- redraw);
6238
- });
6239
- }
6240
- };
6241
- }
6242
- },
6243
- /**
6244
- * Registers an `update()` method in the `chart.navigation` object.
7007
+ *
7008
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
7009
+ *
7010
+ * */
7011
+ /* *
7012
+ *
7013
+ * Composition
7014
+ *
7015
+ * */
7016
+ var ChartNavigationComposition;
7017
+ (function (ChartNavigationComposition) {
7018
+ /* *
7019
+ *
7020
+ * Declarations
7021
+ *
7022
+ * */
7023
+ /* *
7024
+ *
7025
+ * Functions
6245
7026
  *
7027
+ * */
7028
+ /* eslint-disable valid-jsdoc */
7029
+ /**
6246
7030
  * @private
6247
- * @param {Highcharts.ChartNavigationUpdateFunction} update
6248
- * The `update()` method that will be called in `chart.update()`.
6249
- * @param {Highcharts.Chart} chart
6250
- * The chart instance. `update()` will use that as a context
6251
- * (`this`).
6252
- * @return {void}
6253
7031
  */
6254
- addUpdate: function (update, chart) {
7032
+ function compose(chart) {
6255
7033
  if (!chart.navigation) {
6256
- this.initUpdate(chart);
7034
+ chart.navigation = new Additions(chart);
6257
7035
  }
6258
- chart.navigation.updates.push({
6259
- update: update,
6260
- context: chart
6261
- });
7036
+ return chart;
6262
7037
  }
6263
- };
7038
+ ChartNavigationComposition.compose = compose;
7039
+ /* *
7040
+ *
7041
+ * Class
7042
+ *
7043
+ * */
7044
+ /**
7045
+ * Initializes `chart.navigation` object which delegates `update()` methods
7046
+ * to all other common classes (used in exporting and navigationBindings).
7047
+ * @private
7048
+ */
7049
+ var Additions = /** @class */ (function () {
7050
+ /* *
7051
+ *
7052
+ * Constructor
7053
+ *
7054
+ * */
7055
+ function Additions(chart) {
7056
+ this.updates = [];
7057
+ this.chart = chart;
7058
+ }
7059
+ /* *
7060
+ *
7061
+ * Functions
7062
+ *
7063
+ * */
7064
+ /**
7065
+ * Registers an `update()` method in the `chart.navigation` object.
7066
+ *
7067
+ * @private
7068
+ * @param {UpdateFunction} updateFn
7069
+ * The `update()` method that will be called in `chart.update()`.
7070
+ */
7071
+ Additions.prototype.addUpdate = function (updateFn) {
7072
+ this.chart.navigation.updates.push(updateFn);
7073
+ };
7074
+ /**
7075
+ * @private
7076
+ */
7077
+ Additions.prototype.update = function (options, redraw) {
7078
+ var _this = this;
7079
+ this.updates.forEach(function (updateFn) {
7080
+ updateFn.call(_this.chart, options, redraw);
7081
+ });
7082
+ };
7083
+ return Additions;
7084
+ }());
7085
+ ChartNavigationComposition.Additions = Additions;
7086
+ })(ChartNavigationComposition || (ChartNavigationComposition = {}));
7087
+ /* *
7088
+ *
7089
+ * Default Export
7090
+ *
7091
+ * */
6264
7092
 
6265
- return chartNavigation;
7093
+ return ChartNavigationComposition;
6266
7094
  });
6267
- _registerModule(_modules, 'Extensions/Annotations/NavigationBindings.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Core/Chart/Chart.js'], _modules['Mixins/Navigation.js'], _modules['Core/FormatUtilities.js'], _modules['Core/Globals.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Utilities.js']], function (Annotation, Chart, chartNavigationMixin, F, H, D, U) {
7095
+ _registerModule(_modules, 'Extensions/Annotations/NavigationBindings.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Chart/ChartNavigationComposition.js'], _modules['Core/FormatUtilities.js'], _modules['Core/Globals.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Utilities.js']], function (Annotation, Chart, ChartNavigationComposition, F, H, D, U) {
6268
7096
  /* *
6269
7097
  *
6270
7098
  * (c) 2009-2021 Highsoft, Black Label
@@ -6412,8 +7240,9 @@
6412
7240
  */
6413
7241
  getAssignedAxis: function (coords) {
6414
7242
  return coords.filter(function (coord) {
6415
- var axisMin = coord.axis.min,
6416
- axisMax = coord.axis.max,
7243
+ var extremes = coord.axis.getExtremes(),
7244
+ axisMin = extremes.min,
7245
+ axisMax = extremes.max,
6417
7246
  // Correct axis edges when axis has series
6418
7247
  // with pointRange (like column)
6419
7248
  minPointOffset = pick(coord.axis.minPointOffset, 0);
@@ -6514,9 +7343,11 @@
6514
7343
  */
6515
7344
  NavigationBindings.prototype.initUpdate = function () {
6516
7345
  var navigation = this;
6517
- chartNavigationMixin.addUpdate(function (options) {
7346
+ ChartNavigationComposition
7347
+ .compose(this.chart).navigation
7348
+ .addUpdate(function (options) {
6518
7349
  navigation.update(options);
6519
- }, this.chart);
7350
+ });
6520
7351
  };
6521
7352
  /**
6522
7353
  * Hook for click on a button, method selcts/unselects buttons,
@@ -6536,8 +7367,13 @@
6536
7367
  */
6537
7368
  NavigationBindings.prototype.bindingsButtonClick = function (button, events, clickEvent) {
6538
7369
  var navigation = this,
6539
- chart = navigation.chart;
7370
+ chart = navigation.chart,
7371
+ svgContainer = chart.renderer.boxWrapper;
7372
+ var shouldEventBeFired = true;
6540
7373
  if (navigation.selectedButtonElement) {
7374
+ if (navigation.selectedButtonElement.classList === button.classList) {
7375
+ shouldEventBeFired = false;
7376
+ }
6541
7377
  fireEvent(navigation, 'deselectButton', { button: navigation.selectedButtonElement });
6542
7378
  if (navigation.nextEvent) {
6543
7379
  // Remove in-progress annotations adders:
@@ -6548,15 +7384,24 @@
6548
7384
  navigation.mouseMoveEvent = navigation.nextEvent = false;
6549
7385
  }
6550
7386
  }
6551
- navigation.selectedButton = events;
6552
- navigation.selectedButtonElement = button;
6553
- fireEvent(navigation, 'selectButton', { button: button });
6554
- // Call "init" event, for example to open modal window
6555
- if (events.init) {
6556
- events.init.call(navigation, button, clickEvent);
7387
+ if (shouldEventBeFired) {
7388
+ navigation.selectedButton = events;
7389
+ navigation.selectedButtonElement = button;
7390
+ fireEvent(navigation, 'selectButton', { button: button });
7391
+ // Call "init" event, for example to open modal window
7392
+ if (events.init) {
7393
+ events.init.call(navigation, button, clickEvent);
7394
+ }
7395
+ if (events.start || events.steps) {
7396
+ chart.renderer.boxWrapper.addClass(PREFIX + 'draw-mode');
7397
+ }
6557
7398
  }
6558
- if (events.start || events.steps) {
6559
- chart.renderer.boxWrapper.addClass(PREFIX + 'draw-mode');
7399
+ else {
7400
+ chart.stockTools && chart.stockTools.toggleButtonAciveClass(button);
7401
+ svgContainer.removeClass(PREFIX + 'draw-mode');
7402
+ navigation.nextEvent = false;
7403
+ navigation.mouseMoveEvent = false;
7404
+ navigation.selectedButton = null;
6560
7405
  }
6561
7406
  };
6562
7407
  /**
@@ -6961,6 +7806,7 @@
6961
7806
  },
6962
7807
  // Simple shapes:
6963
7808
  circle: ['shapes'],
7809
+ ellipse: ['shapes'],
6964
7810
  verticalLine: [],
6965
7811
  label: ['labelOptions'],
6966
7812
  // Measure
@@ -6977,7 +7823,9 @@
6977
7823
  // Define non editable fields per annotation, for example Rectangle inherits
6978
7824
  // options from Measure, but crosshairs are not available
6979
7825
  NavigationBindings.annotationsNonEditable = {
6980
- rectangle: ['crosshairX', 'crosshairY', 'label']
7826
+ rectangle: ['crosshairX', 'crosshairY', 'labelOptions'],
7827
+ ellipse: ['labelOptions'],
7828
+ circle: ['labelOptions']
6981
7829
  };
6982
7830
  return NavigationBindings;
6983
7831
  }());
@@ -7094,7 +7942,6 @@
7094
7942
  * Configure the Popup strings in the chart. Requires the
7095
7943
  * `annotations.js` or `annotations-advanced.src.js` module to be
7096
7944
  * loaded.
7097
- *
7098
7945
  * @since 7.0.0
7099
7946
  * @product highcharts highstock
7100
7947
  */
@@ -7108,6 +7955,7 @@
7108
7955
  simpleShapes: 'Simple shapes',
7109
7956
  lines: 'Lines',
7110
7957
  circle: 'Circle',
7958
+ ellipse: 'Ellipse',
7111
7959
  rectangle: 'Rectangle',
7112
7960
  label: 'Label',
7113
7961
  shapeOptions: 'Shape options',
@@ -7168,9 +8016,16 @@
7168
8016
  * - `end`: last event to be called after last step event
7169
8017
  *
7170
8018
  * @type {Highcharts.Dictionary<Highcharts.NavigationBindingsOptionsObject>|*}
7171
- * @sample stock/stocktools/stocktools-thresholds
7172
- * Custom bindings in Highcharts Stock
8019
+ *
8020
+ * @sample {highstock} stock/stocktools/stocktools-thresholds
8021
+ * Custom bindings
8022
+ * @sample {highcharts} highcharts/annotations/bindings/
8023
+ * Simple binding
8024
+ * @sample {highcharts} highcharts/annotations/bindings-custom-annotation/
8025
+ * Custom annotation binding
8026
+ *
7173
8027
  * @since 7.0.0
8028
+ * @requires modules/annotations
7174
8029
  * @product highcharts highstock
7175
8030
  */
7176
8031
  bindings: {
@@ -7207,27 +8062,21 @@
7207
8062
  },
7208
8063
  r: 5
7209
8064
  }]
7210
- }, navigation
7211
- .annotationsOptions, navigation
7212
- .bindings
7213
- .circleAnnotation
7214
- .annotationsOptions));
8065
+ }, navigation.annotationsOptions, navigation.bindings.circleAnnotation.annotationsOptions));
7215
8066
  },
7216
8067
  /** @ignore-option */
7217
8068
  steps: [
7218
8069
  function (e, annotation) {
7219
8070
  var mockPointOpts = annotation.options.shapes[0]
7220
8071
  .point,
7221
- inverted = this.chart.inverted,
7222
- x,
7223
- y,
7224
8072
  distance;
7225
8073
  if (isNumber(mockPointOpts.xAxis) &&
7226
8074
  isNumber(mockPointOpts.yAxis)) {
7227
- x = this.chart.xAxis[mockPointOpts.xAxis]
7228
- .toPixels(mockPointOpts.x);
7229
- y = this.chart.yAxis[mockPointOpts.yAxis]
7230
- .toPixels(mockPointOpts.y);
8075
+ var inverted = this.chart.inverted,
8076
+ x = this.chart.xAxis[mockPointOpts.xAxis]
8077
+ .toPixels(mockPointOpts.x),
8078
+ y = this.chart.yAxis[mockPointOpts.yAxis]
8079
+ .toPixels(mockPointOpts.y);
7231
8080
  distance = Math.max(Math.sqrt(Math.pow(inverted ? y - e.chartX : x - e.chartX, 2) +
7232
8081
  Math.pow(inverted ? x - e.chartY : y - e.chartY, 2)), 5);
7233
8082
  }
@@ -7239,6 +8088,58 @@
7239
8088
  }
7240
8089
  ]
7241
8090
  },
8091
+ ellipseAnnotation: {
8092
+ className: 'highcharts-ellipse-annotation',
8093
+ start: function (e) {
8094
+ var coords = this.chart.pointer.getCoordinates(e),
8095
+ coordsX = this.utils.getAssignedAxis(coords.xAxis),
8096
+ coordsY = this.utils.getAssignedAxis(coords.yAxis),
8097
+ navigation = this.chart.options.navigation;
8098
+ if (!coordsX || !coordsY) {
8099
+ return;
8100
+ }
8101
+ return this.chart.addAnnotation(merge({
8102
+ langKey: 'ellipse',
8103
+ type: 'basicAnnotation',
8104
+ shapes: [
8105
+ {
8106
+ type: 'ellipse',
8107
+ xAxis: coordsX.axis.options.index,
8108
+ yAxis: coordsY.axis.options.index,
8109
+ points: [{
8110
+ x: coordsX.value,
8111
+ y: coordsY.value
8112
+ }, {
8113
+ x: coordsX.value,
8114
+ y: coordsY.value
8115
+ }],
8116
+ ry: 1
8117
+ }
8118
+ ]
8119
+ }, navigation.annotationsOptions, navigation.bindings.ellipseAnnotation.annotationOptions));
8120
+ },
8121
+ steps: [
8122
+ function (e, annotation) {
8123
+ var target = annotation.shapes[0],
8124
+ position = target.getAbsolutePosition(target.points[1]);
8125
+ target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
8126
+ target.redraw(false);
8127
+ },
8128
+ function (e, annotation) {
8129
+ var target = annotation.shapes[0],
8130
+ position = target.getAbsolutePosition(target.points[0]),
8131
+ position2 = target.getAbsolutePosition(target.points[1]),
8132
+ newR = target.getDistanceFromLine(position,
8133
+ position2,
8134
+ e.chartX,
8135
+ e.chartY),
8136
+ yAxis = target.getYAxis(),
8137
+ newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
8138
+ target.setYRadius(newRY);
8139
+ target.redraw(false);
8140
+ }
8141
+ ]
8142
+ },
7242
8143
  /**
7243
8144
  * A rectangle annotation bindings. Includes `start` and one event
7244
8145
  * in `steps` array.
@@ -7272,7 +8173,8 @@
7272
8173
  { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
7273
8174
  { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
7274
8175
  { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
7275
- { xAxis: xAxis, yAxis: yAxis, x: x, y: y }
8176
+ { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
8177
+ { command: 'Z' }
7276
8178
  ]
7277
8179
  }]
7278
8180
  }, navigation
@@ -7357,7 +8259,7 @@
7357
8259
  * from a different server.
7358
8260
  *
7359
8261
  * @type {string}
7360
- * @default https://code.highcharts.com/9.2.0/gfx/stock-icons/
8262
+ * @default https://code.highcharts.com/9.3.1/gfx/stock-icons/
7361
8263
  * @since 7.1.3
7362
8264
  * @apioption navigation.iconsURL
7363
8265
  */
@@ -7413,6 +8315,7 @@
7413
8315
  * @extends annotations
7414
8316
  * @exclude crookedLine, elliottWave, fibonacci, infinityLine,
7415
8317
  * measure, pitchfork, tunnel, verticalLine, basicAnnotation
8318
+ * @requires modules/annotations
7416
8319
  * @apioption navigation.annotationsOptions
7417
8320
  */
7418
8321
  annotationsOptions: {
@@ -7497,20 +8400,34 @@
7497
8400
  fireEvent = U.fireEvent,
7498
8401
  isArray = U.isArray,
7499
8402
  isObject = U.isObject,
7500
- isString = U.isString,
7501
8403
  objectEach = U.objectEach,
7502
8404
  pick = U.pick,
7503
8405
  stableSort = U.stableSort,
7504
8406
  wrap = U.wrap;
7505
- var indexFilter = /\d/g, PREFIX = 'highcharts-', DIV = 'div', INPUT = 'input', LABEL = 'label', BUTTON = 'button', SELECT = 'select', OPTION = 'option', SPAN = 'span', UL = 'ul', LI = 'li', H3 = 'h3';
8407
+ var indexFilter = /\d/g, PREFIX = 'highcharts-', A = 'a', DIV = 'div', INPUT = 'input', LABEL = 'label', BUTTON = 'button', SELECT = 'select', OPTION = 'option', SPAN = 'span', UL = 'ul', LI = 'li', H3 = 'h3';
8408
+ /**
8409
+ * Enum for properties which should have dropdown list.
8410
+ * @private
8411
+ */
8412
+ var DropdownProperties;
8413
+ (function (DropdownProperties) {
8414
+ DropdownProperties[DropdownProperties["params.algorithm"] = 0] = "params.algorithm";
8415
+ DropdownProperties[DropdownProperties["params.average"] = 1] = "params.average";
8416
+ })(DropdownProperties || (DropdownProperties = {}));
8417
+ /**
8418
+ * List of available algorithms for the specific indicator.
8419
+ * @private
8420
+ */
8421
+ var dropdownParameters = {
8422
+ 'algorithm-pivotpoints': ['standard', 'fibonacci', 'camarilla'],
8423
+ 'average-disparityindex': ['sma', 'ema', 'dema', 'tema', 'wma']
8424
+ };
7506
8425
  /* eslint-disable no-invalid-this, valid-jsdoc */
7507
8426
  // onContainerMouseDown blocks internal popup events, due to e.preventDefault.
7508
8427
  // Related issue #4606
7509
8428
  wrap(Pointer.prototype, 'onContainerMouseDown', function (proceed, e) {
7510
- var popupClass = e.target && e.target.className;
7511
8429
  // elements is not in popup
7512
- if (!(isString(popupClass) &&
7513
- popupClass.indexOf(PREFIX + 'popup-field') >= 0)) {
8430
+ if (!this.inClass(e.target, PREFIX + 'popup')) {
7514
8431
  proceed.apply(this, Array.prototype.slice.call(arguments, 1));
7515
8432
  }
7516
8433
  });
@@ -7531,7 +8448,22 @@
7531
8448
  // create popup div
7532
8449
  this.container = createElement(DIV, {
7533
8450
  className: PREFIX + 'popup highcharts-no-tooltip'
7534
- }, null, parentDiv);
8451
+ }, void 0, parentDiv);
8452
+ addEvent(this.container, 'mousedown', function () {
8453
+ var activeAnnotation = chart &&
8454
+ chart.navigationBindings &&
8455
+ chart.navigationBindings.activeAnnotation;
8456
+ if (activeAnnotation) {
8457
+ activeAnnotation.cancelClick = true;
8458
+ var unbind_1 = addEvent(H.doc, 'click',
8459
+ function () {
8460
+ setTimeout(function () {
8461
+ activeAnnotation.cancelClick = false;
8462
+ }, 0);
8463
+ unbind_1();
8464
+ });
8465
+ }
8466
+ });
7535
8467
  this.lang = this.getLangpack();
7536
8468
  this.iconsURL = iconsURL;
7537
8469
  // add close button
@@ -7548,7 +8480,7 @@
7548
8480
  // create close popup btn
7549
8481
  closeBtn = createElement(DIV, {
7550
8482
  className: PREFIX + 'popup-close'
7551
- }, null, this.container);
8483
+ }, void 0, this.container);
7552
8484
  closeBtn.style['background-image'] = 'url(' +
7553
8485
  (iconsURL.match(/png|svg|jpeg|jpg|gif/ig) ?
7554
8486
  iconsURL : iconsURL + 'close.svg') + ')';
@@ -7577,15 +8509,15 @@
7577
8509
  // left column
7578
8510
  lhsCol = createElement(DIV, {
7579
8511
  className: PREFIX + 'popup-lhs-col'
7580
- }, null, container);
8512
+ }, void 0, container);
7581
8513
  // right column
7582
8514
  rhsCol = createElement(DIV, {
7583
8515
  className: PREFIX + 'popup-rhs-col'
7584
- }, null, container);
8516
+ }, void 0, container);
7585
8517
  // wrapper content
7586
8518
  createElement(DIV, {
7587
8519
  className: PREFIX + 'popup-rhs-col-wrapper'
7588
- }, null, rhsCol);
8520
+ }, void 0, rhsCol);
7589
8521
  return {
7590
8522
  lhsCol: lhsCol,
7591
8523
  rhsCol: rhsCol
@@ -7593,34 +8525,43 @@
7593
8525
  },
7594
8526
  /**
7595
8527
  * Create input with label.
8528
+ *
7596
8529
  * @private
8530
+ *
7597
8531
  * @param {string} option
7598
- * Chain of fields i.e params.styles.fontSize
7599
- * @param {string} type
7600
- * Indicator type
7601
- * @param {Highhcharts.HTMLDOMElement}
7602
- * Container where elements should be added
7603
- * @param {string} value
7604
- * Default value of input i.e period value is 14, extracted from
7605
- * defaultOptions (ADD mode) or series options (EDIT mode)
8532
+ * Chain of fields i.e params.styles.fontSize separeted by the dot.
8533
+ *
8534
+ * @param {string} indicatorType
8535
+ * Type of the indicator i.e. sma, ema...
8536
+ *
8537
+ * @param {HTMLDOMElement} parentDiv
8538
+ * HTML parent element.
8539
+ *
8540
+ * @param {Highcharts.InputAttributes} inputAttributes
8541
+ * Attributes of the input.
8542
+ *
8543
+ * @return {HTMLInputElement}
8544
+ * Return created input element.
7606
8545
  */
7607
- addInput: function (option, type, parentDiv, value) {
7608
- var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX + type + '-' + optionName;
8546
+ addInput: function (option, indicatorType, parentDiv, inputAttributes) {
8547
+ var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX + indicatorType + '-' + pick(inputAttributes.htmlFor, optionName);
8548
+ var input;
7609
8549
  if (!inputName.match(indexFilter)) {
7610
8550
  // add label
7611
8551
  createElement(LABEL, {
7612
- htmlFor: inputName
8552
+ htmlFor: inputName,
8553
+ className: inputAttributes.labelClassName
7613
8554
  }, void 0, parentDiv).appendChild(doc.createTextNode(lang[optionName] || optionName));
7614
8555
  }
7615
8556
  // add input
7616
- if (value !== '') {
7617
- createElement(INPUT, {
7618
- name: inputName,
7619
- value: value[0],
7620
- type: value[1],
7621
- className: PREFIX + 'popup-field'
7622
- }, void 0, parentDiv).setAttribute(PREFIX + 'data-name', option);
7623
- }
8557
+ input = createElement(INPUT, {
8558
+ name: inputName,
8559
+ value: inputAttributes.value,
8560
+ type: inputAttributes.type,
8561
+ className: PREFIX + 'popup-field'
8562
+ }, void 0, parentDiv);
8563
+ input.setAttribute(PREFIX + 'data-name', option);
8564
+ return input;
7624
8565
  },
7625
8566
  /**
7626
8567
  * Create button.
@@ -7638,38 +8579,46 @@
7638
8579
  * @return {Highcharts.HTMLDOMElement}
7639
8580
  * HTML button
7640
8581
  */
7641
- addButton: function (parentDiv, label, type, callback, fieldsDiv) {
8582
+ addButton: function (parentDiv, label, type, fieldsDiv, callback) {
7642
8583
  var _self = this,
7643
8584
  closePopup = this.closePopup,
7644
8585
  getFields = this.getFields,
7645
8586
  button;
7646
8587
  button = createElement(BUTTON, void 0, void 0, parentDiv);
7647
8588
  button.appendChild(doc.createTextNode(label));
7648
- ['click', 'touchstart'].forEach(function (eventName) {
7649
- addEvent(button, eventName, function () {
7650
- closePopup.call(_self);
7651
- return callback(getFields(fieldsDiv, type));
8589
+ if (callback) {
8590
+ ['click', 'touchstart'].forEach(function (eventName) {
8591
+ addEvent(button, eventName, function () {
8592
+ closePopup.call(_self);
8593
+ return callback(getFields(fieldsDiv, type));
8594
+ });
7652
8595
  });
7653
- });
8596
+ }
7654
8597
  return button;
7655
8598
  },
7656
8599
  /**
7657
- * Get values from all inputs and create JSON.
8600
+ * Get values from all inputs and selections then create JSON.
8601
+ *
7658
8602
  * @private
7659
- * @param {Highcharts.HTMLDOMElement} - container where inputs are created
7660
- * @param {string} - add | edit | remove
7661
- * @return {Highcharts.PopupFieldsObject} - fields
8603
+ *
8604
+ * @param {Highcharts.HTMLDOMElement} parentDiv
8605
+ * The container where inputs and selections are created.
8606
+ *
8607
+ * @param {string} type
8608
+ * Type of the popup bookmark (add|edit|remove).
8609
+ *
8610
+ * @return {Highcharts.PopupFieldsObject}
7662
8611
  */
7663
8612
  getFields: function (parentDiv, type) {
7664
- var inputList = parentDiv.querySelectorAll('input'), optionSeries = '#' + PREFIX + 'select-series > option:checked', optionVolume = '#' + PREFIX + 'select-volume > option:checked', linkedTo = parentDiv.querySelectorAll(optionSeries)[0], volumeTo = parentDiv.querySelectorAll(optionVolume)[0], seriesId, param, fieldsOutput;
8613
+ var inputList = Array.prototype.slice.call(parentDiv.querySelectorAll(INPUT)), selectList = Array.prototype.slice.call(parentDiv.querySelectorAll(SELECT)), optionSeries = '#' + PREFIX + 'select-series > option:checked', optionVolume = '#' + PREFIX + 'select-volume > option:checked', linkedTo = parentDiv.querySelectorAll(optionSeries)[0], volumeTo = parentDiv.querySelectorAll(optionVolume)[0];
8614
+ var fieldsOutput;
7665
8615
  fieldsOutput = {
7666
8616
  actionType: type,
7667
- linkedTo: linkedTo && linkedTo.getAttribute('value'),
8617
+ linkedTo: linkedTo && linkedTo.getAttribute('value') || '',
7668
8618
  fields: {}
7669
8619
  };
7670
- [].forEach.call(inputList, function (input) {
7671
- param = input.getAttribute(PREFIX + 'data-name');
7672
- seriesId = input.getAttribute(PREFIX + 'data-series-id');
8620
+ inputList.forEach(function (input) {
8621
+ var param = input.getAttribute(PREFIX + 'data-name'), seriesId = input.getAttribute(PREFIX + 'data-series-id');
7673
8622
  // params
7674
8623
  if (seriesId) {
7675
8624
  fieldsOutput.seriesId = input.value;
@@ -7682,8 +8631,16 @@
7682
8631
  fieldsOutput.type = input.value;
7683
8632
  }
7684
8633
  });
8634
+ selectList.forEach(function (select) {
8635
+ var id = select.id;
8636
+ // Get inputs only for the parameters, not for series and volume.
8637
+ if (id !== PREFIX + 'select-series' && id !== PREFIX + 'select-volume') {
8638
+ var parameter = id.split('highcharts-select-')[1];
8639
+ fieldsOutput.fields[parameter] = select.value;
8640
+ }
8641
+ });
7685
8642
  if (volumeTo) {
7686
- fieldsOutput.fields['params.volumeSeriesID'] = volumeTo.getAttribute('value');
8643
+ fieldsOutput.fields['params.volumeSeriesID'] = volumeTo.getAttribute('value') || '';
7687
8644
  }
7688
8645
  return fieldsOutput;
7689
8646
  },
@@ -7793,13 +8750,13 @@
7793
8750
  // Basic shapes:
7794
8751
  options.shapes && options.shapes[0].type)));
7795
8752
  // add buttons
7796
- button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove', callback, popupDiv);
8753
+ button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove', popupDiv, callback);
7797
8754
  button.className += ' ' + PREFIX + 'annotation-remove-button';
7798
8755
  button.style['background-image'] = 'url(' +
7799
8756
  this.iconsURL + 'destroy.svg)';
7800
- button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', function () {
8757
+ button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', popupDiv, function () {
7801
8758
  showForm.call(_self, 'annotation-edit', chart, options, callback);
7802
- }, popupDiv);
8759
+ });
7803
8760
  button.className += ' ' + PREFIX + 'annotation-edit-button';
7804
8761
  button.style['background-image'] = 'url(' +
7805
8762
  this.iconsURL + 'edit.svg)';
@@ -7833,14 +8790,14 @@
7833
8790
  // left column
7834
8791
  lhsCol = createElement(DIV, {
7835
8792
  className: PREFIX + 'popup-lhs-col ' + PREFIX + 'popup-lhs-full'
7836
- }, null, popupDiv);
8793
+ }, void 0, popupDiv);
7837
8794
  bottomRow = createElement(DIV, {
7838
8795
  className: PREFIX + 'popup-bottom-row'
7839
- }, null, popupDiv);
8796
+ }, void 0, popupDiv);
7840
8797
  this.annotations.addFormFields.call(this, lhsCol, chart, '', options, [], true);
7841
8798
  this.addButton(bottomRow, isInit ?
7842
8799
  (lang.addButton || 'add') :
7843
- (lang.saveButton || 'save'), isInit ? 'add' : 'save', callback, popupDiv);
8800
+ (lang.saveButton || 'save'), isInit ? 'add' : 'save', popupDiv, callback);
7844
8801
  },
7845
8802
  /**
7846
8803
  * Create annotation's form fields.
@@ -7913,6 +8870,10 @@
7913
8870
  }, void 0, genInput[2]).appendChild(doc.createTextNode(genInput[1]));
7914
8871
  }
7915
8872
  else {
8873
+ genInput[4] = {
8874
+ value: genInput[4][0],
8875
+ type: genInput[4][1]
8876
+ };
7916
8877
  addInput.apply(genInput[0], genInput.splice(1));
7917
8878
  }
7918
8879
  });
@@ -7940,138 +8901,431 @@
7940
8901
  .querySelectorAll('.' + PREFIX + 'tab-item-content');
7941
8902
  // ADD tab
7942
8903
  this.addColsContainer(tabsContainers[0]);
8904
+ indicators.addSearchBox.call(this, chart, tabsContainers[0]);
7943
8905
  indicators.addIndicatorList.call(this, chart, tabsContainers[0], 'add');
7944
8906
  buttonParentDiv = tabsContainers[0]
7945
8907
  .querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
7946
- this.addButton(buttonParentDiv, lang.addButton || 'add', 'add', callback, buttonParentDiv);
8908
+ this.addButton(buttonParentDiv, lang.addButton || 'add', 'add', buttonParentDiv, callback);
7947
8909
  // EDIT tab
7948
8910
  this.addColsContainer(tabsContainers[1]);
7949
8911
  indicators.addIndicatorList.call(this, chart, tabsContainers[1], 'edit');
7950
8912
  buttonParentDiv = tabsContainers[1]
7951
8913
  .querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
7952
- this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit', callback, buttonParentDiv);
7953
- this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove', callback, buttonParentDiv);
8914
+ this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit', buttonParentDiv, callback);
8915
+ this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove', buttonParentDiv, callback);
8916
+ },
8917
+ /**
8918
+ * Filter object of series which are not indicators.
8919
+ * If the filter string exists, check against it.
8920
+ *
8921
+ * @private
8922
+ *
8923
+ * @param {Highcharts.FilteredSeries} series
8924
+ * All series are available in the plotOptions.
8925
+ *
8926
+ * @param {string|undefined} filter
8927
+ * Applied filter string from the input.
8928
+ * For the first iteration, it's an empty string.
8929
+ *
8930
+ * @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
8931
+ * Returns array of filtered series based on filter string.
8932
+ */
8933
+ filterSeries: function (series, filter) {
8934
+ var popup = this,
8935
+ indicators = popup.indicators,
8936
+ lang = popup.chart && popup.chart.options.lang,
8937
+ indicatorAliases = lang &&
8938
+ lang.navigation &&
8939
+ lang.navigation.popup &&
8940
+ lang.navigation.popup.indicatorAliases;
8941
+ var filteredSeriesArray = [],
8942
+ filteredSeries;
8943
+ objectEach(series, function (series, value) {
8944
+ var seriesOptions = series.options;
8945
+ // Allow only indicators.
8946
+ if (series.params || seriesOptions &&
8947
+ seriesOptions.params) {
8948
+ var _a = indicators.getNameType(series,
8949
+ value),
8950
+ indicatorFullName = _a.indicatorFullName,
8951
+ indicatorType = _a.indicatorType;
8952
+ if (filter) {
8953
+ // Replace invalid characters.
8954
+ var validFilter = filter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
8955
+ var regex = new RegExp(validFilter, 'i'),
8956
+ alias = indicatorAliases &&
8957
+ indicatorAliases[indicatorType] &&
8958
+ indicatorAliases[indicatorType].join(' ') || '';
8959
+ if (indicatorFullName.match(regex) || alias.match(regex)) {
8960
+ filteredSeries = {
8961
+ indicatorFullName: indicatorFullName,
8962
+ indicatorType: indicatorType,
8963
+ series: series
8964
+ };
8965
+ filteredSeriesArray.push(filteredSeries);
8966
+ }
8967
+ }
8968
+ else {
8969
+ filteredSeries = {
8970
+ indicatorFullName: indicatorFullName,
8971
+ indicatorType: indicatorType,
8972
+ series: series
8973
+ };
8974
+ filteredSeriesArray.push(filteredSeries);
8975
+ }
8976
+ }
8977
+ });
8978
+ return filteredSeriesArray;
8979
+ },
8980
+ /**
8981
+ * Filter an array of series and map its names and types.
8982
+ *
8983
+ * @private
8984
+ *
8985
+ * @param {Highcharts.FilteredSeries} series
8986
+ * All series that are available in the plotOptions.
8987
+ *
8988
+ * @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
8989
+ * Returns array of filtered series based on filter string.
8990
+ */
8991
+ filterSeriesArray: function (series) {
8992
+ var filteredSeriesArray = [],
8993
+ filteredSeries;
8994
+ // Allow only indicators.
8995
+ series.forEach(function (series) {
8996
+ var seriesOptions = series.options;
8997
+ if (series.is('sma')) {
8998
+ filteredSeries = {
8999
+ indicatorFullName: series.name,
9000
+ indicatorType: series.type,
9001
+ series: series
9002
+ };
9003
+ filteredSeriesArray.push(filteredSeries);
9004
+ }
9005
+ });
9006
+ return filteredSeriesArray;
7954
9007
  },
7955
9008
  /**
7956
9009
  * Create HTML list of all indicators (ADD mode) or added indicators
7957
9010
  * (EDIT mode).
9011
+ *
7958
9012
  * @private
9013
+ *
9014
+ * @param {Highcharts.AnnotationChart} chart
9015
+ * The chart object.
9016
+ *
9017
+ * @param {string} [optionName]
9018
+ * Name of the option into which selection is being added.
9019
+ *
9020
+ * @param {HTMLDOMElement} [parentDiv]
9021
+ * HTML parent element.
9022
+ *
9023
+ * @param {string} listType
9024
+ * Type of list depending on the selected bookmark.
9025
+ * Might be 'add' or 'edit'.
9026
+ *
9027
+ * @param {string|undefined} filter
9028
+ * Applied filter string from the input.
9029
+ * For the first iteration, it's an empty string.
7959
9030
  */
7960
- addIndicatorList: function (chart, parentDiv, listType) {
7961
- var _self = this, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], rhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0], isEdit = listType === 'edit', series = (isEdit ?
9031
+ addIndicatorList: function (chart, parentDiv, listType, filter) {
9032
+ var popup = this, indicators = popup.indicators, lang = popup.lang, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], rhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0], isEdit = listType === 'edit', addFormFields = this.indicators.addFormFields, series = (isEdit ?
7962
9033
  chart.series : // EDIT mode
7963
- chart.options.plotOptions // ADD mode
7964
- ), addFormFields = this.indicators.addFormFields, rhsColWrapper, indicatorList, item;
7965
- if (!chart) {
9034
+ chart.options.plotOptions || {} // ADD mode
9035
+ );
9036
+ if (!chart && series) {
7966
9037
  return;
7967
9038
  }
7968
- // create wrapper for list
9039
+ var rhsColWrapper,
9040
+ indicatorList,
9041
+ item,
9042
+ filteredSeriesArray = [];
9043
+ // Filter and sort the series.
9044
+ if (!isEdit && !isArray(series)) {
9045
+ // Apply filters only for the 'add' indicator list.
9046
+ filteredSeriesArray = indicators.filterSeries.call(this, series, filter);
9047
+ }
9048
+ else if (isArray(series)) {
9049
+ filteredSeriesArray = indicators.filterSeriesArray.call(this, series);
9050
+ }
9051
+ // Sort indicators alphabeticaly.
9052
+ stableSort(filteredSeriesArray, function (a, b) {
9053
+ var seriesAName = a.indicatorFullName.toLowerCase(),
9054
+ seriesBName = b.indicatorFullName.toLowerCase();
9055
+ return (seriesAName < seriesBName) ?
9056
+ -1 : (seriesAName > seriesBName) ? 1 : 0;
9057
+ });
9058
+ // If the list exists remove it from the DOM
9059
+ // in order to create a new one with different filters.
9060
+ if (lhsCol.children[1]) {
9061
+ lhsCol.children[1].remove();
9062
+ }
9063
+ // Create wrapper for list.
7969
9064
  indicatorList = createElement(UL, {
7970
9065
  className: PREFIX + 'indicator-list'
7971
- }, null, lhsCol);
9066
+ }, void 0, lhsCol);
7972
9067
  rhsColWrapper = rhsCol
7973
9068
  .querySelectorAll('.' + PREFIX + 'popup-rhs-col-wrapper')[0];
7974
- objectEach(series, function (serie, value) {
7975
- var seriesOptions = serie.options;
7976
- if (serie.params ||
7977
- seriesOptions && seriesOptions.params) {
7978
- var indicatorNameType_1 = _self.indicators.getNameType(serie,
7979
- value),
7980
- indicatorType_1 = indicatorNameType_1.type;
7981
- item = createElement(LI, {
7982
- className: PREFIX + 'indicator-list'
7983
- }, void 0, indicatorList);
7984
- item.appendChild(doc.createTextNode(indicatorNameType_1.name));
7985
- ['click', 'touchstart'].forEach(function (eventName) {
7986
- addEvent(item, eventName, function () {
7987
- addFormFields.call(_self, chart, isEdit ? serie : series[indicatorType_1], indicatorNameType_1.type, rhsColWrapper);
7988
- // add hidden input with series.id
7989
- if (isEdit && serie.options) {
7990
- createElement(INPUT, {
7991
- type: 'hidden',
7992
- name: PREFIX + 'id-' + indicatorType_1,
7993
- value: serie.options.id
7994
- }, null, rhsColWrapper)
7995
- .setAttribute(PREFIX + 'data-series-id', serie.options.id);
7996
- }
7997
- });
9069
+ filteredSeriesArray.forEach(function (seriesSet) {
9070
+ var indicatorFullName = seriesSet.indicatorFullName,
9071
+ indicatorType = seriesSet.indicatorType,
9072
+ series = seriesSet.series;
9073
+ item = createElement(LI, {
9074
+ className: PREFIX + 'indicator-list'
9075
+ }, void 0, indicatorList);
9076
+ item.appendChild(doc.createTextNode(indicatorFullName));
9077
+ ['click', 'touchstart'].forEach(function (eventName) {
9078
+ addEvent(item, eventName, function () {
9079
+ var button = rhsColWrapper.parentNode.children[1];
9080
+ addFormFields.call(popup, chart, series, indicatorType, rhsColWrapper);
9081
+ if (button) {
9082
+ button.style.display = 'block';
9083
+ }
9084
+ // add hidden input with series.id
9085
+ if (isEdit && series.options) {
9086
+ createElement(INPUT, {
9087
+ type: 'hidden',
9088
+ name: PREFIX + 'id-' + indicatorType,
9089
+ value: series.options.id
9090
+ }, void 0, rhsColWrapper).setAttribute(PREFIX + 'data-series-id', series.options.id);
9091
+ }
7998
9092
  });
7999
- }
9093
+ });
8000
9094
  });
8001
9095
  // select first item from the list
8002
9096
  if (indicatorList.childNodes.length > 0) {
8003
9097
  indicatorList.childNodes[0].click();
8004
9098
  }
9099
+ else if (!isEdit) {
9100
+ rhsColWrapper.parentNode.children[0].innerHTML = lang.noFilterMatch || '';
9101
+ rhsColWrapper.parentNode.children[1].style.display = 'none';
9102
+ }
9103
+ },
9104
+ /**
9105
+ * Add searchbox HTML element and its' label.
9106
+ *
9107
+ * @private
9108
+ *
9109
+ * @param {Highcharts.AnnotationChart} chart
9110
+ * The chart object.
9111
+ *
9112
+ * @param {HTMLDOMElement} parentDiv
9113
+ * HTML parent element.
9114
+ */
9115
+ addSearchBox: function (chart, parentDiv) {
9116
+ var popup = this, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], options = 'searchIndicators', inputAttributes = {
9117
+ value: '',
9118
+ type: 'text',
9119
+ htmlFor: 'search-indicators',
9120
+ labelClassName: 'highcharts-input-search-indicators-label'
9121
+ }, clearFilterText = this.lang.clearFilter, inputWrapper = createElement(DIV, {
9122
+ className: 'highcharts-input-wrapper'
9123
+ }, void 0, lhsCol);
9124
+ var handleInputChange = function (inputText) {
9125
+ // Apply some filters.
9126
+ popup.indicators.addIndicatorList.call(popup,
9127
+ chart,
9128
+ popup.container, 'add',
9129
+ inputText);
9130
+ };
9131
+ // Add input field with the label and button.
9132
+ var input = this.addInput(options,
9133
+ INPUT,
9134
+ inputWrapper,
9135
+ inputAttributes),
9136
+ button = createElement(A, {
9137
+ textContent: clearFilterText
9138
+ },
9139
+ void 0,
9140
+ inputWrapper);
9141
+ input.classList.add('highcharts-input-search-indicators');
9142
+ button.classList.add('clear-filter-button');
9143
+ // Add input change events.
9144
+ addEvent(input, 'input', function (e) {
9145
+ handleInputChange(this.value);
9146
+ // Show clear filter button.
9147
+ if (this.value.length) {
9148
+ button.style.display = 'inline-block';
9149
+ }
9150
+ else {
9151
+ button.style.display = 'none';
9152
+ }
9153
+ });
9154
+ // Add clear filter click event.
9155
+ ['click', 'touchstart'].forEach(function (eventName) {
9156
+ addEvent(button, eventName, function () {
9157
+ // Clear the input.
9158
+ input.value = '';
9159
+ handleInputChange('');
9160
+ // Hide clear filter button- no longer nececary.
9161
+ button.style.display = 'none';
9162
+ });
9163
+ });
9164
+ },
9165
+ /**
9166
+ * Add selection HTML element and its' label.
9167
+ *
9168
+ * @private
9169
+ *
9170
+ * @param {string} indicatorType
9171
+ * Type of the indicator i.e. sma, ema...
9172
+ *
9173
+ * @param {string} [optionName]
9174
+ * Name of the option into which selection is being added.
9175
+ *
9176
+ * @param {HTMLDOMElement} [parentDiv]
9177
+ * HTML parent element.
9178
+ *
9179
+ * @return {HTMLSelectElement}
9180
+ */
9181
+ addSelection: function (indicatorType, optionName, parentDiv) {
9182
+ var optionParamList = optionName.split('.'),
9183
+ labelText = optionParamList[optionParamList.length - 1];
9184
+ var selectName = PREFIX + optionName + '-type-' + indicatorType,
9185
+ lang = this.lang,
9186
+ selectBox;
9187
+ // Add a label for the selection box.
9188
+ createElement(LABEL, {
9189
+ htmlFor: selectName
9190
+ }, null, parentDiv).appendChild(doc.createTextNode(lang[labelText] || optionName));
9191
+ // Create a selection box.
9192
+ selectBox = createElement(SELECT, {
9193
+ name: selectName,
9194
+ className: PREFIX + 'popup-field',
9195
+ id: PREFIX + 'select-' + optionName
9196
+ }, null, parentDiv);
9197
+ selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
9198
+ return selectBox;
9199
+ },
9200
+ /**
9201
+ * Get and add selection options.
9202
+ *
9203
+ * @private
9204
+ *
9205
+ * @param {Highcharts.AnnotationChart} chart
9206
+ * The chart object.
9207
+ *
9208
+ * @param {string} [optionName]
9209
+ * Name of the option into which selection is being added.
9210
+ *
9211
+ * @param {HTMLSelectElement} [selectBox]
9212
+ * HTML select box element to which the options are being added.
9213
+ *
9214
+ * @param {string|undefined} indicatorType
9215
+ * Type of the indicator i.e. sma, ema...
9216
+ *
9217
+ * @param {string|undefined} parameterName
9218
+ * Name of the parameter which should be applied.
9219
+ *
9220
+ * @param {string|undefined} selectedOption
9221
+ * Default value in dropdown.
9222
+ */
9223
+ addSelectionOptions: function (chart, optionName, selectBox, indicatorType, parameterName, selectedOption, currentSeries) {
9224
+ var popup = this;
9225
+ // Get and apply selection options for the possible series.
9226
+ if (optionName === 'series' || optionName === 'volume') {
9227
+ // List all series which have id - mandatory for indicator.
9228
+ chart.series.forEach(function (series) {
9229
+ var seriesOptions = series.options,
9230
+ seriesName = seriesOptions.name ||
9231
+ seriesOptions.params ? series.name : seriesOptions.id || '';
9232
+ if (seriesOptions.id !== PREFIX + 'navigator-series' &&
9233
+ seriesOptions.id !== (currentSeries && currentSeries.options && currentSeries.options.id)) {
9234
+ if (!defined(selectedOption) &&
9235
+ optionName === 'volume' &&
9236
+ series.type === 'column') {
9237
+ selectedOption = seriesOptions.id;
9238
+ }
9239
+ createElement(OPTION, {
9240
+ value: seriesOptions.id
9241
+ }, void 0, selectBox).appendChild(doc.createTextNode(seriesName));
9242
+ }
9243
+ });
9244
+ }
9245
+ else if (indicatorType && parameterName) {
9246
+ // Get and apply options for the possible parameters.
9247
+ var dropdownKey = parameterName + '-' + indicatorType,
9248
+ parameterOption = dropdownParameters[dropdownKey];
9249
+ parameterOption.forEach(function (element) {
9250
+ createElement(OPTION, {
9251
+ value: element
9252
+ }, void 0, selectBox).appendChild(doc.createTextNode(element));
9253
+ });
9254
+ }
9255
+ // Add the default dropdown value if defined.
9256
+ if (defined(selectedOption)) {
9257
+ selectBox.value = selectedOption;
9258
+ }
8005
9259
  },
8006
9260
  /**
8007
9261
  * Extract full name and type of requested indicator.
9262
+ *
8008
9263
  * @private
9264
+ *
8009
9265
  * @param {Highcharts.Series} series
8010
- * Series which name is needed. (EDIT mode - defaultOptions.series, ADD
8011
- * mode - indicator series).
8012
- * @param {string} - indicator type like: sma, ema, etc.
8013
- * @return {Object} - series name and type like: sma, ema, etc.
9266
+ * Series which name is needed(EDITmode - defaultOptions.series,
9267
+ * ADDmode - indicator series).
9268
+ *
9269
+ * @param {string} [IndicatorType]
9270
+ * Type of the indicator i.e. sma, ema...
9271
+ *
9272
+ * @return Highcharts.Dictionary<string>
9273
+ * Full name and series type.
8014
9274
  */
8015
- getNameType: function (series, type) {
9275
+ getNameType: function (series, indicatorType) {
8016
9276
  var options = series.options,
8017
- seriesTypes = H.seriesTypes,
8018
- // add mode
8019
- seriesName = seriesTypes[type] &&
8020
- seriesTypes[type].prototype.nameBase || type.toUpperCase(),
8021
- seriesType = type;
9277
+ seriesTypes = H.seriesTypes;
9278
+ // add mode
9279
+ var seriesName = (seriesTypes[indicatorType] &&
9280
+ seriesTypes[indicatorType].prototype.nameBase) ||
9281
+ indicatorType.toUpperCase(),
9282
+ seriesType = indicatorType;
8022
9283
  // edit
8023
9284
  if (options && options.type) {
8024
9285
  seriesType = series.options.type;
8025
9286
  seriesName = series.name;
8026
9287
  }
8027
9288
  return {
8028
- name: seriesName,
8029
- type: seriesType
9289
+ indicatorFullName: seriesName,
9290
+ indicatorType: seriesType
8030
9291
  };
8031
9292
  },
8032
9293
  /**
8033
- * List all series with unique ID. Its mandatory for indicators to set
8034
- * correct linking.
9294
+ * Create the selection box for the series,
9295
+ * add options and apply the default one.
9296
+ *
8035
9297
  * @private
8036
- * @param {string} type
8037
- * Indicator type like: sma, ema, etc.
8038
- * @param {string} optionName
8039
- * Type of select i.e series or volume.
8040
- * @param {Highcharts.Chart} chart
8041
- * Chart
8042
- * @param {Highcharts.HTMLDOMElement} parentDiv
8043
- * Element where created HTML list is added
8044
- * @param {string} selectedOption
8045
- * optional param for default value in dropdown
9298
+ *
9299
+ * @param {string} indicatorType
9300
+ * Type of the indicator i.e. sma, ema...
9301
+ *
9302
+ * @param {string} [optionName]
9303
+ * Name of the option into which selection is being added.
9304
+ *
9305
+ * @param {Highcharts.AnnotationChart} chart
9306
+ * The chart object.
9307
+ *
9308
+ * @param {HTMLDOMElement} [parentDiv]
9309
+ * HTML parent element.
9310
+ *
9311
+ * @param {string|undefined} selectedOption
9312
+ * Default value in dropdown.
8046
9313
  */
8047
- listAllSeries: function (type, optionName, chart, parentDiv, selectedOption) {
8048
- var selectName = PREFIX + optionName + '-type-' + type,
8049
- lang = this.lang,
8050
- selectBox,
8051
- seriesOptions;
9314
+ listAllSeries: function (indicatorType, optionName, chart, parentDiv, currentSeries, selectedOption) {
9315
+ var popup = this,
9316
+ indicators = popup.indicators;
9317
+ // Won't work without the chart.
8052
9318
  if (!chart) {
8053
9319
  return;
8054
9320
  }
8055
- createElement(LABEL, {
8056
- htmlFor: selectName
8057
- }, null, parentDiv).appendChild(doc.createTextNode(lang[optionName] || optionName));
8058
- // select type
8059
- selectBox = createElement(SELECT, {
8060
- name: selectName,
8061
- className: PREFIX + 'popup-field'
8062
- }, null, parentDiv);
8063
- selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
8064
- // list all series which have id - mandatory for creating indicator
8065
- chart.series.forEach(function (serie) {
8066
- seriesOptions = serie.options;
8067
- if (!seriesOptions.params &&
8068
- seriesOptions.id &&
8069
- seriesOptions.id !== PREFIX + 'navigator-series') {
8070
- createElement(OPTION, {
8071
- value: seriesOptions.id
8072
- }, null, selectBox).appendChild(doc.createTextNode(seriesOptions.name || seriesOptions.id));
8073
- }
8074
- });
9321
+ // Add selection boxes.
9322
+ var selectBox = indicators.addSelection.call(popup,
9323
+ indicatorType,
9324
+ optionName,
9325
+ parentDiv);
9326
+ // Add possible dropdown options.
9327
+ indicators.addSelectionOptions.call(popup, chart, optionName, selectBox, void 0, void 0, void 0, currentSeries);
9328
+ // Add the default dropdown value if defined.
8075
9329
  if (defined(selectedOption)) {
8076
9330
  selectBox.value = selectedOption;
8077
9331
  }
@@ -8100,17 +9354,17 @@
8100
9354
  // create title (indicator name in the right column)
8101
9355
  createElement(H3, {
8102
9356
  className: PREFIX + 'indicator-title'
8103
- }, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).name));
9357
+ }, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).indicatorFullName));
8104
9358
  // input type
8105
9359
  createElement(INPUT, {
8106
9360
  type: 'hidden',
8107
9361
  name: PREFIX + 'type-' + seriesType,
8108
9362
  value: seriesType
8109
- }, null, rhsColWrapper);
9363
+ }, void 0, rhsColWrapper);
8110
9364
  // list all series with id
8111
- this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series.linkedParent && fields.volumeSeriesID);
9365
+ this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series, series.linkedParent && series.linkedParent.options.id);
8112
9366
  if (fields.volumeSeriesID) {
8113
- this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series.linkedParent && series.linkedParent.options.id);
9367
+ this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series, series.linkedParent && fields.volumeSeriesID);
8114
9368
  }
8115
9369
  // add param fields
8116
9370
  this.indicators.addParamInputs.call(this, chart, 'params', fields, seriesType, rhsColWrapper);
@@ -8132,8 +9386,9 @@
8132
9386
  * Element where created HTML list is added
8133
9387
  */
8134
9388
  addParamInputs: function (chart, parentNode, fields, type, parentDiv) {
8135
- var _self = this,
8136
- addParamInputs = this.indicators.addParamInputs,
9389
+ var popup = this,
9390
+ indicators = popup.indicators;
9391
+ var addParamInputs = this.indicators.addParamInputs,
8137
9392
  addInput = this.addInput,
8138
9393
  parentFullName;
8139
9394
  if (!chart) {
@@ -8142,16 +9397,33 @@
8142
9397
  objectEach(fields, function (value, fieldName) {
8143
9398
  // create name like params.styles.fontSize
8144
9399
  parentFullName = parentNode + '.' + fieldName;
8145
- if (value !== void 0) { // skip if field is unnecessary, #15362
9400
+ if (defined(value) && // skip if field is unnecessary, #15362
9401
+ parentFullName) {
8146
9402
  if (isObject(value)) {
8147
9403
  addInput.call(// (15733) 'Periods' has an arrayed value. Label must be created here.
8148
- _self, parentFullName, type, parentDiv, '');
8149
- addParamInputs.call(_self, chart, parentFullName, value, type, parentDiv);
9404
+ popup, parentFullName, type, parentDiv, {});
9405
+ addParamInputs.call(popup, chart, parentFullName, value, type, parentDiv);
9406
+ }
9407
+ // If the option is listed in dropdown enum,
9408
+ // add the selection box for it.
9409
+ if (parentFullName in DropdownProperties) {
9410
+ // Add selection boxes.
9411
+ var selectBox = indicators.addSelection.call(popup,
9412
+ type,
9413
+ parentFullName,
9414
+ parentDiv);
9415
+ // Add possible dropdown options.
9416
+ indicators.addSelectionOptions.call(popup, chart, parentNode, selectBox, type, fieldName, value);
8150
9417
  }
8151
9418
  else if (
8152
- // skip volume field which is created by addFormFields
8153
- parentFullName !== 'params.volumeSeriesID') {
8154
- addInput.call(_self, parentFullName, type, parentDiv, [value, 'text'] // all inputs are text type
9419
+ // Skip volume field which is created by addFormFields.
9420
+ parentFullName !== 'params.volumeSeriesID' &&
9421
+ !isArray(value) // Skip params declared in array.
9422
+ ) {
9423
+ addInput.call(popup, parentFullName, type, parentDiv, {
9424
+ value: value,
9425
+ type: 'text'
9426
+ } // all inputs are text type
8155
9427
  );
8156
9428
  }
8157
9429
  }
@@ -8234,7 +9506,7 @@
8234
9506
  var popupDiv = this.popup.container;
8235
9507
  return createElement(DIV, {
8236
9508
  className: PREFIX + 'tab-item-content ' + PREFIX + 'no-mousewheel' // #12100
8237
- }, null, popupDiv);
9509
+ }, void 0, popupDiv);
8238
9510
  },
8239
9511
  /**
8240
9512
  * Add click event to each tab
@@ -8297,7 +9569,7 @@
8297
9569
  this.popup = new H.Popup(this.chart.container, (this.chart.options.navigation.iconsURL ||
8298
9570
  (this.chart.options.stockTools &&
8299
9571
  this.chart.options.stockTools.gui.iconsURL) ||
8300
- 'https://code.highcharts.com/9.2.0/gfx/stock-icons/'), this.chart);
9572
+ 'https://code.highcharts.com/9.3.1/gfx/stock-icons/'), this.chart);
8301
9573
  }
8302
9574
  this.popup.showForm(config.formType, this.chart, config.options, config.onSubmit);
8303
9575
  });