highcharts 9.2.2 → 9.3.3

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 (894) 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 +46 -1
  6. package/css/highcharts.scss +40 -0
  7. package/css/stocktools/gui.css +1 -1
  8. package/css/themes/dark-unica.css +46 -1
  9. package/css/themes/grid-light.css +46 -1
  10. package/css/themes/sand-signika.css +46 -1
  11. package/es-modules/Accessibility/A11yI18n.js +269 -224
  12. package/es-modules/Accessibility/Accessibility.js +244 -129
  13. package/es-modules/Accessibility/AccessibilityComponent.js +78 -313
  14. package/es-modules/Accessibility/Components/AnnotationsA11y.js +19 -5
  15. package/es-modules/Accessibility/Components/ContainerComponent.js +53 -28
  16. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +178 -120
  17. package/es-modules/Accessibility/Components/LegendComponent.js +251 -129
  18. package/es-modules/Accessibility/Components/MenuComponent.js +250 -154
  19. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +172 -93
  20. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +161 -115
  21. package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +138 -69
  22. package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +67 -28
  23. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +48 -56
  24. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +387 -343
  25. package/es-modules/Accessibility/Components/ZoomComponent.js +156 -70
  26. package/es-modules/Accessibility/FocusBorder.js +192 -152
  27. package/es-modules/Accessibility/HighContrastMode.js +79 -66
  28. package/es-modules/Accessibility/HighContrastTheme.js +10 -0
  29. package/es-modules/Accessibility/KeyboardNavigation.js +151 -75
  30. package/es-modules/Accessibility/KeyboardNavigationHandler.js +71 -44
  31. package/es-modules/Accessibility/Options/DeprecatedOptions.js +21 -4
  32. package/es-modules/Accessibility/Options/LangOptions.js +4 -5
  33. package/es-modules/Accessibility/Options/Options.js +32 -17
  34. package/es-modules/Accessibility/ProxyElement.js +218 -0
  35. package/es-modules/Accessibility/ProxyProvider.js +302 -0
  36. package/es-modules/Accessibility/Utils/Announcer.js +17 -10
  37. package/es-modules/Accessibility/Utils/ChartUtilities.js +55 -45
  38. package/es-modules/Accessibility/Utils/DOMElementProvider.js +27 -15
  39. package/es-modules/Accessibility/Utils/EventProvider.js +27 -17
  40. package/es-modules/Accessibility/Utils/HTMLUtilities.js +125 -42
  41. package/es-modules/Core/Animation/Fx.js +5 -14
  42. package/es-modules/Core/Axis/Axis.js +77 -96
  43. package/es-modules/Core/Axis/Axis3D.js +10 -4
  44. package/es-modules/Core/Axis/AxisDefaults.js +35 -24
  45. package/es-modules/Core/Axis/BrokenAxis.js +17 -11
  46. package/es-modules/Core/Axis/Color/ColorAxis.js +7 -4
  47. package/es-modules/Core/Axis/Color/ColorAxisComposition.js +55 -5
  48. package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +5 -5
  49. package/es-modules/Core/Axis/DateTimeAxis.js +3 -14
  50. package/es-modules/Core/Axis/GridAxis.js +26 -16
  51. package/es-modules/Core/Axis/NavigatorAxis.js +0 -5
  52. package/es-modules/Core/Axis/OrdinalAxis.js +88 -92
  53. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +4 -5
  54. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js +0 -5
  55. package/es-modules/Core/Axis/RadialAxis.js +7 -28
  56. package/es-modules/Core/Axis/ScrollbarAxis.js +27 -12
  57. package/es-modules/Core/Axis/StackingAxis.js +2 -1
  58. package/es-modules/Core/Axis/Tick.js +2 -4
  59. package/es-modules/Core/Axis/TreeGridAxis.js +28 -19
  60. package/es-modules/Core/Axis/TreeGridTick.js +5 -3
  61. package/es-modules/Core/Axis/WaterfallAxis.js +1 -1
  62. package/es-modules/Core/Axis/ZAxis.js +1 -1
  63. package/es-modules/Core/Chart/Chart.js +44 -47
  64. package/es-modules/Core/Chart/Chart3D.js +23 -10
  65. package/es-modules/Core/Chart/ChartDefaults.js +3 -4
  66. package/es-modules/Core/Chart/ChartNavigationComposition.js +92 -0
  67. package/es-modules/Core/Chart/GanttChart.js +4 -4
  68. package/es-modules/Core/Chart/MapChart.js +13 -25
  69. package/es-modules/Core/Chart/StockChart.js +13 -316
  70. package/es-modules/Core/Color/Palettes.js +22 -0
  71. package/es-modules/Core/DefaultOptions.js +22 -19
  72. package/es-modules/Core/Foundation.js +39 -31
  73. package/es-modules/Core/Geometry/CircleUtilities.js +2 -1
  74. package/es-modules/Core/Globals.js +1 -1
  75. package/es-modules/Core/HttpUtilities.js +8 -7
  76. package/es-modules/Core/Legend/Legend.js +19 -16
  77. package/es-modules/Core/Navigator.js +41 -30
  78. package/es-modules/Core/Pointer.js +52 -45
  79. package/es-modules/Core/Renderer/HTML/AST.js +29 -14
  80. package/es-modules/Core/Renderer/HTML/HTMLElement.js +27 -20
  81. package/es-modules/Core/Renderer/HTML/HTMLRenderer.js +8 -6
  82. package/es-modules/Core/Renderer/RendererUtilities.js +2 -2
  83. package/es-modules/Core/Renderer/SVG/SVGElement.js +11 -20
  84. package/es-modules/Core/Renderer/SVG/SVGLabel.js +17 -8
  85. package/es-modules/Core/Renderer/SVG/SVGRenderer.js +25 -29
  86. package/es-modules/Core/Renderer/SVG/SVGRenderer3D.js +12 -5
  87. package/es-modules/Core/Renderer/SVG/TextBuilder.js +18 -12
  88. package/es-modules/Core/Responsive.js +2 -3
  89. package/es-modules/Core/Scrollbar.js +14 -12
  90. package/es-modules/Core/ScrollbarDefaults.js +10 -9
  91. package/es-modules/Core/Series/DataLabel.js +19 -15
  92. package/es-modules/Core/Series/Point.js +22 -19
  93. package/es-modules/Core/Series/Series.js +197 -235
  94. package/es-modules/Core/Series/SeriesDefaults.js +8 -8
  95. package/es-modules/Core/Series/SeriesRegistry.js +1 -2
  96. package/es-modules/Core/Time.js +14 -11
  97. package/es-modules/Core/Tooltip.js +63 -53
  98. package/es-modules/Core/Utilities.js +20 -24
  99. package/es-modules/Data/DataConverter.js +483 -0
  100. package/es-modules/Data/DataPromise.js +252 -0
  101. package/es-modules/Data/DataSeriesConverter.js +207 -0
  102. package/es-modules/Data/DataTable.js +1205 -0
  103. package/es-modules/Data/Modifiers/ChainModifier.js +299 -0
  104. package/es-modules/Data/Modifiers/DataModifier.js +303 -0
  105. package/es-modules/Data/Modifiers/GroupModifier.js +144 -0
  106. package/es-modules/Data/Modifiers/InvertModifier.js +254 -0
  107. package/es-modules/Data/Modifiers/RangeModifier.js +143 -0
  108. package/es-modules/Data/Modifiers/SeriesPointsModifier.js +110 -0
  109. package/es-modules/Data/Modifiers/SortModifier.js +249 -0
  110. package/es-modules/Data/Parsers/CSVParser.js +400 -0
  111. package/es-modules/Data/Parsers/DataParser.js +101 -0
  112. package/es-modules/Data/Parsers/GoogleSheetsParser.js +223 -0
  113. package/es-modules/Data/Parsers/HTMLTableParser.js +213 -0
  114. package/es-modules/Data/Stores/CSVStore.js +317 -0
  115. package/es-modules/Data/Stores/DataStore.js +276 -0
  116. package/es-modules/Data/Stores/GoogleSheetsStore.js +169 -0
  117. package/es-modules/Data/Stores/HTMLTableStore.js +353 -0
  118. package/es-modules/Extensions/Annotations/Annotations.js +69 -18
  119. package/es-modules/Extensions/Annotations/ControlPoint.js +1 -3
  120. package/es-modules/Extensions/Annotations/Controllables/ControllableCircle.js +1 -1
  121. package/es-modules/Extensions/Annotations/Controllables/ControllableEllipse.js +199 -0
  122. package/es-modules/Extensions/Annotations/Controllables/ControllableImage.js +1 -1
  123. package/es-modules/Extensions/Annotations/Controllables/ControllableLabel.js +3 -6
  124. package/es-modules/Extensions/Annotations/Controllables/ControllablePath.js +3 -2
  125. package/es-modules/Extensions/Annotations/Controllables/ControllableRect.js +1 -1
  126. package/es-modules/Extensions/Annotations/Mixins/ControllableMixin.js +13 -4
  127. package/es-modules/Extensions/Annotations/Mixins/EventEmitterMixin.js +0 -1
  128. package/es-modules/Extensions/Annotations/Mixins/MarkerMixin.js +5 -4
  129. package/es-modules/Extensions/Annotations/NavigationBindings.js +120 -53
  130. package/es-modules/Extensions/Annotations/Popup.js +494 -148
  131. package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +51 -2
  132. package/es-modules/Extensions/Annotations/Types/CrookedLine.js +5 -3
  133. package/es-modules/Extensions/Annotations/Types/ElliottWave.js +1 -1
  134. package/es-modules/Extensions/Annotations/Types/Fibonacci.js +2 -3
  135. package/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +219 -0
  136. package/es-modules/Extensions/Annotations/Types/InfinityLine.js +1 -1
  137. package/es-modules/Extensions/Annotations/Types/Measure.js +29 -19
  138. package/es-modules/Extensions/Annotations/Types/Pitchfork.js +7 -6
  139. package/es-modules/Extensions/Annotations/Types/TimeCycles.js +211 -0
  140. package/es-modules/Extensions/Annotations/Types/Tunnel.js +13 -10
  141. package/es-modules/Extensions/Annotations/Types/VerticalLine.js +1 -1
  142. package/es-modules/Extensions/Boost/BoostOptions.js +2 -2
  143. package/es-modules/Extensions/Boost/BoostOverrides.js +6 -10
  144. package/es-modules/Extensions/Boost/BoostUtils.js +0 -6
  145. package/es-modules/Extensions/Boost/WGLRenderer.js +16 -12
  146. package/es-modules/Extensions/Boost/WGLShader.js +13 -11
  147. package/es-modules/Extensions/Boost/WGLVBuffer.js +4 -7
  148. package/es-modules/Extensions/BoostCanvas.js +1 -2
  149. package/es-modules/Extensions/CurrentDateIndication.js +2 -3
  150. package/es-modules/Extensions/Data.js +4 -48
  151. package/es-modules/Extensions/DataGrouping.js +52 -32
  152. package/es-modules/Extensions/DownloadURL.js +2 -2
  153. package/es-modules/Extensions/DragPanes.js +1 -2
  154. package/es-modules/Extensions/DraggablePoints.js +7 -8
  155. package/es-modules/Extensions/Drilldown.js +11 -7
  156. package/es-modules/Extensions/ExportData.js +6 -5
  157. package/es-modules/Extensions/Exporting/Exporting.js +33 -46
  158. package/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -15
  159. package/es-modules/Extensions/FullScreen.js +4 -3
  160. package/es-modules/Extensions/GeoJSON.js +42 -66
  161. package/es-modules/Extensions/MarkerClusters.js +118 -98
  162. package/es-modules/Extensions/Math3D.js +4 -4
  163. package/es-modules/Extensions/NoDataToDisplay.js +1 -2
  164. package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +32 -32
  165. package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
  166. package/es-modules/Extensions/Oldie/Oldie.js +14 -79
  167. package/es-modules/Extensions/Oldie/VMLAxis3D.js +5 -1
  168. package/es-modules/Extensions/OverlappingDataLabels.js +10 -6
  169. package/es-modules/Extensions/Pane.js +11 -12
  170. package/es-modules/Extensions/ParallelCoordinates.js +5 -3
  171. package/es-modules/Extensions/PatternFill.js +17 -11
  172. package/es-modules/Extensions/Polar.js +7 -4
  173. package/es-modules/Extensions/PriceIndication.js +2 -1
  174. package/es-modules/Extensions/RangeSelector.js +22 -59
  175. package/es-modules/Extensions/ScrollablePlotArea.js +2 -2
  176. package/es-modules/Extensions/SeriesLabel.js +1 -1
  177. package/es-modules/Extensions/Sonification/ChartSonify.js +279 -663
  178. package/es-modules/Extensions/Sonification/Earcon.js +136 -102
  179. package/es-modules/Extensions/Sonification/Instrument.js +493 -426
  180. package/es-modules/Extensions/Sonification/MusicalFrequencies.js +10 -0
  181. package/es-modules/Extensions/Sonification/Options.js +10 -0
  182. package/es-modules/Extensions/Sonification/PointSonify.js +207 -152
  183. package/es-modules/Extensions/Sonification/SeriesSonify.js +474 -0
  184. package/es-modules/Extensions/Sonification/SignalHandler.js +122 -0
  185. package/es-modules/Extensions/Sonification/Sonification.js +27 -53
  186. package/es-modules/Extensions/Sonification/{Utilities.js → SonificationUtilities.js} +70 -88
  187. package/es-modules/Extensions/Sonification/Timeline.js +250 -567
  188. package/es-modules/Extensions/Sonification/TimelineEvent.js +157 -0
  189. package/es-modules/Extensions/Sonification/TimelinePath.js +311 -0
  190. package/es-modules/Extensions/Stacking.js +5 -23
  191. package/es-modules/Extensions/Themes/BrandDark.js +293 -0
  192. package/es-modules/Extensions/Themes/BrandLight.js +259 -0
  193. package/es-modules/Extensions/Themes/DarkUnica.js +4 -2
  194. package/es-modules/Extensions/Themes/Grid.js +4 -2
  195. package/es-modules/Extensions/Themes/GridLight.js +4 -2
  196. package/es-modules/Gantt/Connection.js +2 -2
  197. package/es-modules/Gantt/Pathfinder.js +6 -5
  198. package/es-modules/Gantt/PathfinderAlgorithms.js +12 -12
  199. package/es-modules/Maps/MapNavigation.js +30 -68
  200. package/es-modules/Maps/MapNavigationOptionsDefault.js +3 -0
  201. package/es-modules/Maps/MapPointer.js +8 -5
  202. package/es-modules/Maps/MapSymbols.js +23 -3
  203. package/es-modules/Maps/MapView.js +450 -0
  204. package/es-modules/Maps/MapViewOptionsDefault.js +97 -0
  205. package/es-modules/Maps/Projection.js +436 -0
  206. package/es-modules/Maps/ProjectionDefinition.js +9 -0
  207. package/es-modules/Maps/Projections/EqualEarth.js +42 -0
  208. package/es-modules/Maps/Projections/LambertConformalConic.js +52 -0
  209. package/es-modules/Maps/Projections/Miller.js +16 -0
  210. package/es-modules/Maps/Projections/Orthographic.js +26 -0
  211. package/es-modules/Maps/Projections/ProjectionRegistry.js +19 -0
  212. package/es-modules/Maps/Projections/WebMercator.js +24 -0
  213. package/es-modules/Series/Area/AreaSeries.js +13 -13
  214. package/es-modules/Series/Area3DSeries.js +4 -2
  215. package/es-modules/Series/AreaRange/AreaRangeSeries.js +28 -17
  216. package/es-modules/Series/Bellcurve/BellcurveSeries.js +4 -9
  217. package/es-modules/Series/BoxPlot/BoxPlotSeries.js +1 -2
  218. package/es-modules/Series/Bubble/BubbleLegendDefaults.js +1 -2
  219. package/es-modules/Series/Bubble/BubbleLegendItem.js +5 -15
  220. package/es-modules/Series/Bubble/BubblePoint.js +5 -0
  221. package/es-modules/Series/Bubble/BubbleSeries.js +90 -50
  222. package/es-modules/Series/Candlestick/CandlestickSeries.js +10 -19
  223. package/es-modules/{Mixins/CenteredSeries.js → Series/CenteredUtilities.js} +45 -23
  224. package/es-modules/{Mixins/ColorMapSeries.js → Series/ColorMapMixin.js} +10 -8
  225. package/es-modules/Series/Column/ColumnDataLabel.js +5 -5
  226. package/es-modules/Series/Column/ColumnSeries.js +19 -18
  227. package/es-modules/Series/Column3D/Column3DComposition.js +1 -2
  228. package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +11 -8
  229. package/es-modules/Series/ColumnRange/ColumnRangeSeries.js +2 -1
  230. package/es-modules/Series/Cylinder/CylinderComposition.js +36 -4
  231. package/es-modules/Series/DataModifyComposition.js +539 -0
  232. package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +2 -6
  233. package/es-modules/Series/DependencyWheel/DependencyWheelSeries.js +1 -1
  234. package/es-modules/Series/DerivedComposition.js +137 -0
  235. package/es-modules/Series/DrawPointComposition.js +111 -0
  236. package/es-modules/Series/Dumbbell/DumbbellPoint.js +0 -1
  237. package/es-modules/Series/Dumbbell/DumbbellSeries.js +2 -6
  238. package/es-modules/Series/ErrorBar/ErrorBarSeries.js +1 -2
  239. package/es-modules/Series/Flags/FlagsSeries.js +18 -25
  240. package/es-modules/Series/Flags/FlagsSymbols.js +2 -2
  241. package/es-modules/Series/Funnel/FunnelSeries.js +6 -5
  242. package/es-modules/Series/Funnel3D/Funnel3DComposition.js +14 -8
  243. package/es-modules/Series/Funnel3D/Funnel3DSeries.js +2 -1
  244. package/es-modules/Series/Gantt/GanttPoint.js +1 -1
  245. package/es-modules/Series/Gantt/GanttSeries.js +3 -3
  246. package/es-modules/Series/Gauge/GaugePoint.js +1 -1
  247. package/es-modules/Series/Gauge/GaugeSeries.js +7 -7
  248. package/es-modules/Series/HLC/HLCPoint.js +55 -0
  249. package/es-modules/Series/HLC/HLCSeries.js +378 -0
  250. package/es-modules/Series/Heatmap/HeatmapPoint.js +13 -14
  251. package/es-modules/Series/Heatmap/HeatmapSeries.js +24 -12
  252. package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +10 -9
  253. package/es-modules/Series/Histogram/HistogramSeries.js +7 -11
  254. package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +1 -4
  255. package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +28 -30
  256. package/es-modules/Series/Item/ItemSeries.js +4 -5
  257. package/es-modules/Series/Line/LineSeries.js +1 -2
  258. package/es-modules/Series/Map/MapPoint.js +27 -14
  259. package/es-modules/Series/Map/MapSeries.js +283 -322
  260. package/es-modules/Series/MapBubble/MapBubblePoint.js +0 -3
  261. package/es-modules/Series/MapBubble/MapBubbleSeries.js +10 -1
  262. package/es-modules/Series/MapLine/MapLineSeries.js +2 -4
  263. package/es-modules/Series/MapPoint/MapPointPoint.js +5 -1
  264. package/es-modules/Series/MapPoint/MapPointSeries.js +99 -14
  265. package/es-modules/Series/Networkgraph/DraggableNodes.js +0 -4
  266. package/es-modules/Series/Networkgraph/Integrations.js +8 -22
  267. package/es-modules/Series/Networkgraph/Networkgraph.js +6 -10
  268. package/es-modules/Series/Networkgraph/QuadTree.js +1 -3
  269. package/es-modules/{Mixins/Nodes.js → Series/NodesComposition.js} +78 -30
  270. package/es-modules/Series/OHLC/OHLCPoint.js +2 -7
  271. package/es-modules/Series/OHLC/OHLCSeries.js +55 -183
  272. package/es-modules/{Mixins/OnSeries.js → Series/OnSeriesComposition.js} +53 -21
  273. package/es-modules/Series/Organization/OrganizationSeries.js +6 -5
  274. package/es-modules/Series/PackedBubble/PackedBubbleComposition.js +1 -0
  275. package/es-modules/Series/PackedBubble/PackedBubblePoint.js +1 -1
  276. package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +48 -10
  277. package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -7
  278. package/es-modules/Series/Pie/PieDataLabel.js +1 -2
  279. package/es-modules/Series/Pie/PiePoint.js +2 -2
  280. package/es-modules/Series/Pie/PieSeries.js +7 -8
  281. package/es-modules/Series/Pie3D/Pie3DComposition.js +2 -1
  282. package/es-modules/Series/Pie3D/Pie3DPoint.js +2 -1
  283. package/es-modules/Series/Pie3D/Pie3DSeries.js +1 -1
  284. package/es-modules/Series/Pyramid3D/Pyramid3DSeries.js +2 -1
  285. package/es-modules/Series/Sankey/SankeyPoint.js +0 -4
  286. package/es-modules/Series/Sankey/SankeySeries.js +92 -22
  287. package/es-modules/Series/SolidGauge/SolidGaugeComposition.js +3 -1
  288. package/es-modules/Series/Spline/SplineSeries.js +0 -8
  289. package/es-modules/Series/Sunburst/SunburstPoint.js +2 -3
  290. package/es-modules/Series/Sunburst/SunburstSeries.js +6 -6
  291. package/es-modules/Series/Sunburst/SunburstUtilities.js +3 -2
  292. package/es-modules/Series/Tilemap/TilemapPoint.js +2 -5
  293. package/es-modules/Series/Tilemap/TilemapShapes.js +0 -7
  294. package/es-modules/Series/Timeline/TimelineSeries.js +3 -4
  295. package/es-modules/{Mixins/TreeSeries.js → Series/TreeUtilities.js} +88 -78
  296. package/es-modules/Series/Treemap/TreemapPoint.js +2 -2
  297. package/es-modules/Series/Treemap/TreemapSeries.js +22 -25
  298. package/es-modules/Series/Variwide/VariwideSeries.js +5 -1
  299. package/es-modules/Series/Venn/VennPoint.js +16 -7
  300. package/es-modules/Series/Venn/VennSeries.js +11 -17
  301. package/es-modules/Series/Venn/VennUtils.js +551 -439
  302. package/es-modules/Series/Waterfall/WaterfallSeries.js +8 -6
  303. package/es-modules/Series/Windbarb/WindbarbSeries.js +23 -24
  304. package/es-modules/Series/Wordcloud/WordcloudPoint.js +8 -6
  305. package/es-modules/Series/Wordcloud/WordcloudSeries.js +26 -22
  306. package/es-modules/Series/Wordcloud/WordcloudUtils.js +669 -484
  307. package/es-modules/Series/XRange/XRangePoint.js +7 -12
  308. package/es-modules/Series/XRange/XRangeSeries.js +4 -20
  309. package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +15 -6
  310. package/es-modules/Stock/Indicators/AO/AOIndicator.js +2 -3
  311. package/es-modules/Stock/Indicators/APO/APOIndicator.js +14 -20
  312. package/es-modules/Stock/Indicators/Aroon/AroonIndicator.js +4 -6
  313. package/es-modules/Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js +11 -13
  314. package/es-modules/Stock/Indicators/ArrayUtilities.js +47 -0
  315. package/es-modules/Stock/Indicators/BB/BBIndicator.js +39 -11
  316. package/es-modules/Stock/Indicators/CMF/CMFIndicator.js +35 -15
  317. package/es-modules/Stock/Indicators/Chaikin/ChaikinIndicator.js +6 -12
  318. package/es-modules/Stock/Indicators/DEMA/DEMAIndicator.js +1 -11
  319. package/es-modules/Stock/Indicators/DMI/DMIIndicator.js +28 -16
  320. package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +18 -11
  321. package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +1 -3
  322. package/es-modules/Stock/Indicators/IKH/IKHIndicator.js +6 -6
  323. package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +23 -9
  324. package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +16 -19
  325. package/es-modules/Stock/Indicators/LinearRegression/LinearRegression.js +32 -14
  326. package/es-modules/Stock/Indicators/LinearRegressionAngle/LinearRegressionAngle.js +2 -2
  327. package/es-modules/Stock/Indicators/LinearRegressionIntercept/LinearRegressionIntercept.js +2 -2
  328. package/es-modules/Stock/Indicators/LinearRegressionSlopes/LinearRegressionSlopes.js +2 -2
  329. package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +2 -3
  330. package/es-modules/Stock/Indicators/MultipleLinesComposition.js +294 -0
  331. package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +1 -3
  332. package/es-modules/Stock/Indicators/PC/PCIndicator.js +25 -13
  333. package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +1 -11
  334. package/es-modules/Stock/Indicators/PivotPoints/PivotPointsIndicator.js +2 -1
  335. package/es-modules/Stock/Indicators/RSI/RSIIndicator.js +2 -1
  336. package/es-modules/Stock/Indicators/SMA/SMAComposition.js +0 -26
  337. package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +32 -50
  338. package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +0 -8
  339. package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +18 -9
  340. package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +4 -6
  341. package/es-modules/Stock/Indicators/TEMA/TEMAIndicator.js +26 -11
  342. package/es-modules/Stock/Indicators/TRIX/TRIXIndicator.js +6 -12
  343. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +26 -10
  344. package/es-modules/Stock/Indicators/VWAP/VWAPIndicator.js +19 -7
  345. package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +2 -3
  346. package/es-modules/Stock/StockToolsBindings.js +156 -47
  347. package/es-modules/Stock/StockToolsGui.js +442 -37
  348. package/es-modules/masters/highcharts-3d.src.js +1 -1
  349. package/es-modules/masters/highcharts-gantt.src.js +1 -1
  350. package/es-modules/masters/highcharts-more.src.js +1 -1
  351. package/es-modules/masters/highcharts.src.js +1 -1
  352. package/es-modules/masters/highmaps.src.js +1 -1
  353. package/es-modules/masters/highstock.src.js +1 -1
  354. package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  355. package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  356. package/es-modules/masters/indicators/ao.src.js +1 -1
  357. package/es-modules/masters/indicators/apo.src.js +1 -1
  358. package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  359. package/es-modules/masters/indicators/aroon.src.js +1 -1
  360. package/es-modules/masters/indicators/atr.src.js +1 -1
  361. package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  362. package/es-modules/masters/indicators/cci.src.js +1 -1
  363. package/es-modules/masters/indicators/chaikin.src.js +1 -1
  364. package/es-modules/masters/indicators/cmf.src.js +1 -1
  365. package/es-modules/masters/indicators/cmo.src.js +1 -1
  366. package/es-modules/masters/indicators/dema.src.js +1 -1
  367. package/es-modules/masters/indicators/disparity-index.src.js +1 -1
  368. package/es-modules/masters/indicators/dmi.src.js +1 -1
  369. package/es-modules/masters/indicators/dpo.src.js +1 -1
  370. package/es-modules/masters/indicators/ema.src.js +4 -10
  371. package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  372. package/es-modules/masters/indicators/indicators-all.src.js +2 -2
  373. package/es-modules/masters/indicators/indicators.src.js +2 -1
  374. package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  375. package/es-modules/masters/indicators/klinger.src.js +1 -1
  376. package/es-modules/masters/indicators/macd.src.js +1 -1
  377. package/es-modules/masters/indicators/mfi.src.js +1 -1
  378. package/es-modules/masters/indicators/momentum.src.js +1 -1
  379. package/es-modules/masters/indicators/natr.src.js +1 -1
  380. package/es-modules/masters/indicators/obv.src.js +1 -1
  381. package/es-modules/masters/indicators/pivot-points.src.js +1 -1
  382. package/es-modules/masters/indicators/ppo.src.js +1 -1
  383. package/es-modules/masters/indicators/price-channel.src.js +1 -1
  384. package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  385. package/es-modules/masters/indicators/psar.src.js +1 -1
  386. package/es-modules/masters/indicators/regressions.src.js +1 -1
  387. package/es-modules/masters/indicators/roc.src.js +1 -1
  388. package/es-modules/masters/indicators/rsi.src.js +1 -1
  389. package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  390. package/es-modules/masters/indicators/stochastic.src.js +1 -1
  391. package/es-modules/masters/indicators/supertrend.src.js +1 -1
  392. package/es-modules/masters/indicators/tema.src.js +1 -1
  393. package/es-modules/masters/indicators/trendline.src.js +1 -1
  394. package/es-modules/masters/indicators/trix.src.js +1 -1
  395. package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  396. package/es-modules/masters/indicators/vwap.src.js +1 -1
  397. package/es-modules/masters/indicators/williams-r.src.js +1 -1
  398. package/es-modules/masters/indicators/wma.src.js +1 -1
  399. package/es-modules/masters/indicators/zigzag.src.js +1 -1
  400. package/es-modules/masters/modules/accessibility.src.js +16 -2
  401. package/es-modules/masters/modules/annotations-advanced.src.js +3 -1
  402. package/es-modules/masters/modules/annotations.src.js +1 -1
  403. package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  404. package/es-modules/masters/modules/boost-canvas.src.js +1 -1
  405. package/es-modules/masters/modules/boost.src.js +1 -1
  406. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  407. package/es-modules/masters/modules/bullet.src.js +1 -1
  408. package/es-modules/masters/modules/coloraxis.src.js +1 -1
  409. package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  410. package/es-modules/masters/modules/cylinder.src.js +1 -1
  411. package/es-modules/masters/modules/data.src.js +6 -3
  412. package/es-modules/masters/modules/datagrouping.src.js +1 -1
  413. package/es-modules/masters/modules/debugger.src.js +1 -1
  414. package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  415. package/es-modules/masters/modules/dotplot.src.js +1 -1
  416. package/es-modules/masters/modules/drag-panes.src.js +1 -1
  417. package/es-modules/masters/modules/draggable-points.src.js +1 -1
  418. package/es-modules/masters/modules/drilldown.src.js +1 -1
  419. package/es-modules/masters/modules/dumbbell.src.js +1 -1
  420. package/es-modules/masters/modules/export-data.src.js +1 -1
  421. package/es-modules/masters/modules/exporting.src.js +1 -1
  422. package/es-modules/masters/modules/full-screen.src.js +1 -1
  423. package/es-modules/masters/modules/funnel.src.js +1 -1
  424. package/es-modules/masters/modules/funnel3d.src.js +1 -1
  425. package/es-modules/masters/modules/gantt.src.js +1 -1
  426. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  427. package/es-modules/masters/modules/heatmap.src.js +1 -2
  428. package/es-modules/masters/modules/heikinashi.src.js +1 -1
  429. package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  430. package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
  431. package/es-modules/masters/modules/item-series.src.js +1 -1
  432. package/es-modules/masters/modules/lollipop.src.js +1 -1
  433. package/es-modules/masters/modules/map.src.js +1 -3
  434. package/es-modules/masters/modules/marker-clusters.src.js +1 -1
  435. package/es-modules/masters/modules/networkgraph.src.js +1 -1
  436. package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  437. package/es-modules/masters/modules/offline-exporting.src.js +1 -1
  438. package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
  439. package/es-modules/masters/modules/oldie.src.js +1 -1
  440. package/es-modules/masters/modules/organization.src.js +1 -1
  441. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  442. package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  443. package/es-modules/masters/modules/pareto.src.js +1 -1
  444. package/es-modules/masters/modules/pathfinder.src.js +1 -1
  445. package/es-modules/masters/modules/pattern-fill.src.js +1 -1
  446. package/es-modules/masters/modules/price-indicator.src.js +1 -1
  447. package/es-modules/masters/modules/pyramid3d.src.js +1 -1
  448. package/es-modules/masters/modules/sankey.src.js +1 -1
  449. package/es-modules/masters/modules/series-label.src.js +1 -1
  450. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  451. package/es-modules/masters/modules/sonification.src.js +33 -2
  452. package/es-modules/masters/modules/static-scale.src.js +1 -1
  453. package/es-modules/masters/modules/stock-tools.src.js +1 -1
  454. package/es-modules/masters/modules/stock.src.js +4 -1
  455. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  456. package/es-modules/masters/modules/sunburst.src.js +1 -1
  457. package/es-modules/masters/modules/tilemap.src.js +1 -1
  458. package/es-modules/masters/modules/timeline.src.js +1 -1
  459. package/es-modules/masters/modules/treegrid.src.js +1 -1
  460. package/es-modules/masters/modules/treemap.src.js +1 -1
  461. package/es-modules/masters/modules/variable-pie.src.js +1 -1
  462. package/es-modules/masters/modules/variwide.src.js +1 -1
  463. package/es-modules/masters/modules/vector.src.js +1 -1
  464. package/es-modules/masters/modules/venn.src.js +1 -1
  465. package/es-modules/masters/modules/windbarb.src.js +1 -1
  466. package/es-modules/masters/modules/wordcloud.src.js +1 -1
  467. package/es-modules/masters/modules/xrange.src.js +1 -1
  468. package/es-modules/masters/themes/avocado.src.js +1 -1
  469. package/es-modules/masters/themes/brand-dark.src.js +14 -0
  470. package/es-modules/masters/themes/brand-light.src.js +14 -0
  471. package/es-modules/masters/themes/dark-blue.src.js +1 -1
  472. package/es-modules/masters/themes/dark-green.src.js +1 -1
  473. package/es-modules/masters/themes/dark-unica.src.js +1 -1
  474. package/es-modules/masters/themes/gray.src.js +1 -1
  475. package/es-modules/masters/themes/grid-light.src.js +1 -1
  476. package/es-modules/masters/themes/grid.src.js +1 -1
  477. package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
  478. package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
  479. package/es-modules/masters/themes/sand-signika.src.js +1 -1
  480. package/es-modules/masters/themes/skies.src.js +1 -1
  481. package/es-modules/masters/themes/sunset.src.js +1 -1
  482. package/highcharts-3d.js +1 -1
  483. package/highcharts-3d.js.map +1 -1
  484. package/highcharts-3d.src.js +65 -35
  485. package/highcharts-gantt.js +800 -803
  486. package/highcharts-gantt.js.map +1 -1
  487. package/highcharts-gantt.src.js +1356 -1429
  488. package/highcharts-more.js +194 -193
  489. package/highcharts-more.js.map +1 -1
  490. package/highcharts-more.src.js +280 -222
  491. package/highcharts.d.ts +10208 -761
  492. package/highcharts.js +585 -588
  493. package/highcharts.js.map +1 -1
  494. package/highcharts.src.d.ts +10208 -761
  495. package/highcharts.src.js +992 -1066
  496. package/highmaps.js +727 -707
  497. package/highmaps.js.map +1 -1
  498. package/highmaps.src.js +3240 -2135
  499. package/highstock.js +788 -783
  500. package/highstock.js.map +1 -1
  501. package/highstock.src.js +2487 -1981
  502. package/indicators/acceleration-bands.d.ts +17 -1
  503. package/indicators/acceleration-bands.js +11 -9
  504. package/indicators/acceleration-bands.js.map +1 -1
  505. package/indicators/acceleration-bands.src.d.ts +17 -1
  506. package/indicators/acceleration-bands.src.js +238 -112
  507. package/indicators/accumulation-distribution.js +1 -1
  508. package/indicators/accumulation-distribution.src.js +1 -1
  509. package/indicators/ao.js +6 -6
  510. package/indicators/ao.js.map +1 -1
  511. package/indicators/ao.src.js +4 -4
  512. package/indicators/apo.js +5 -6
  513. package/indicators/apo.js.map +1 -1
  514. package/indicators/apo.src.js +16 -84
  515. package/indicators/aroon-oscillator.d.ts +17 -1
  516. package/indicators/aroon-oscillator.js +10 -9
  517. package/indicators/aroon-oscillator.js.map +1 -1
  518. package/indicators/aroon-oscillator.src.d.ts +17 -1
  519. package/indicators/aroon-oscillator.src.js +230 -177
  520. package/indicators/aroon.d.ts +17 -1
  521. package/indicators/aroon.js +11 -9
  522. package/indicators/aroon.js.map +1 -1
  523. package/indicators/aroon.src.d.ts +17 -1
  524. package/indicators/aroon.src.js +227 -112
  525. package/indicators/atr.js +1 -1
  526. package/indicators/atr.src.js +1 -1
  527. package/indicators/bollinger-bands.d.ts +17 -1
  528. package/indicators/bollinger-bands.js +12 -9
  529. package/indicators/bollinger-bands.js.map +1 -1
  530. package/indicators/bollinger-bands.src.d.ts +17 -1
  531. package/indicators/bollinger-bands.src.js +262 -117
  532. package/indicators/cci.js +1 -1
  533. package/indicators/cci.src.js +1 -1
  534. package/indicators/chaikin.js +8 -9
  535. package/indicators/chaikin.js.map +1 -1
  536. package/indicators/chaikin.src.js +8 -76
  537. package/indicators/cmf.js +1 -1
  538. package/indicators/cmf.js.map +1 -1
  539. package/indicators/cmf.src.js +36 -16
  540. package/indicators/cmo.js +1 -1
  541. package/indicators/cmo.src.js +1 -1
  542. package/indicators/dema.js +5 -6
  543. package/indicators/dema.js.map +1 -1
  544. package/indicators/dema.src.js +3 -75
  545. package/indicators/disparity-index.js +6 -7
  546. package/indicators/disparity-index.js.map +1 -1
  547. package/indicators/disparity-index.src.js +20 -74
  548. package/indicators/dmi.js +12 -11
  549. package/indicators/dmi.js.map +1 -1
  550. package/indicators/dmi.src.js +252 -121
  551. package/indicators/dpo.js +1 -1
  552. package/indicators/dpo.src.js +1 -1
  553. package/indicators/ema.js +1 -13
  554. package/indicators/ema.js.map +1 -1
  555. package/indicators/ema.src.js +7 -188
  556. package/indicators/ichimoku-kinko-hyo.js +1 -1
  557. package/indicators/ichimoku-kinko-hyo.js.map +1 -1
  558. package/indicators/ichimoku-kinko-hyo.src.js +7 -7
  559. package/indicators/indicators-all.d.ts +17 -1
  560. package/indicators/indicators-all.js +198 -203
  561. package/indicators/indicators-all.js.map +1 -1
  562. package/indicators/indicators-all.src.d.ts +17 -1
  563. package/indicators/indicators-all.src.js +892 -777
  564. package/indicators/indicators.js +12 -12
  565. package/indicators/indicators.js.map +1 -1
  566. package/indicators/indicators.src.js +213 -144
  567. package/indicators/keltner-channels.d.ts +17 -1
  568. package/indicators/keltner-channels.js +11 -10
  569. package/indicators/keltner-channels.js.map +1 -1
  570. package/indicators/keltner-channels.src.d.ts +17 -1
  571. package/indicators/keltner-channels.src.js +246 -118
  572. package/indicators/klinger.js +14 -13
  573. package/indicators/klinger.js.map +1 -1
  574. package/indicators/klinger.src.js +239 -187
  575. package/indicators/macd.js +2 -2
  576. package/indicators/macd.js.map +1 -1
  577. package/indicators/macd.src.js +3 -4
  578. package/indicators/mfi.js +1 -1
  579. package/indicators/mfi.src.js +1 -1
  580. package/indicators/momentum.js +1 -1
  581. package/indicators/momentum.src.js +1 -1
  582. package/indicators/natr.js +3 -3
  583. package/indicators/natr.js.map +1 -1
  584. package/indicators/natr.src.js +2 -4
  585. package/indicators/obv.js +1 -1
  586. package/indicators/obv.src.js +1 -1
  587. package/indicators/pivot-points.js +1 -1
  588. package/indicators/pivot-points.js.map +1 -1
  589. package/indicators/pivot-points.src.js +3 -2
  590. package/indicators/ppo.js +5 -6
  591. package/indicators/ppo.js.map +1 -1
  592. package/indicators/ppo.src.js +3 -75
  593. package/indicators/price-channel.d.ts +17 -1
  594. package/indicators/price-channel.js +11 -9
  595. package/indicators/price-channel.js.map +1 -1
  596. package/indicators/price-channel.src.d.ts +17 -1
  597. package/indicators/price-channel.src.js +288 -168
  598. package/indicators/price-envelopes.js +1 -1
  599. package/indicators/price-envelopes.src.js +1 -1
  600. package/indicators/psar.js +1 -1
  601. package/indicators/psar.src.js +1 -1
  602. package/indicators/regressions.js +1 -1
  603. package/indicators/regressions.js.map +1 -1
  604. package/indicators/regressions.src.js +39 -21
  605. package/indicators/roc.js +1 -1
  606. package/indicators/roc.src.js +1 -1
  607. package/indicators/rsi.js +1 -1
  608. package/indicators/rsi.js.map +1 -1
  609. package/indicators/rsi.src.js +3 -2
  610. package/indicators/slow-stochastic.js +5 -6
  611. package/indicators/slow-stochastic.js.map +1 -1
  612. package/indicators/slow-stochastic.src.js +2 -72
  613. package/indicators/stochastic.d.ts +17 -1
  614. package/indicators/stochastic.js +12 -10
  615. package/indicators/stochastic.js.map +1 -1
  616. package/indicators/stochastic.src.d.ts +17 -1
  617. package/indicators/stochastic.src.js +282 -165
  618. package/indicators/supertrend.js +10 -10
  619. package/indicators/supertrend.js.map +1 -1
  620. package/indicators/supertrend.src.js +6 -7
  621. package/indicators/tema.js +6 -7
  622. package/indicators/tema.js.map +1 -1
  623. package/indicators/tema.src.js +28 -75
  624. package/indicators/trendline.js +1 -1
  625. package/indicators/trendline.src.js +1 -1
  626. package/indicators/trix.js +4 -5
  627. package/indicators/trix.js.map +1 -1
  628. package/indicators/trix.src.js +8 -76
  629. package/indicators/volume-by-price.js +16 -16
  630. package/indicators/volume-by-price.js.map +1 -1
  631. package/indicators/volume-by-price.src.js +27 -10
  632. package/indicators/vwap.js +1 -1
  633. package/indicators/vwap.js.map +1 -1
  634. package/indicators/vwap.src.js +20 -8
  635. package/indicators/williams-r.js +5 -6
  636. package/indicators/williams-r.js.map +1 -1
  637. package/indicators/williams-r.src.js +41 -51
  638. package/indicators/wma.js +1 -1
  639. package/indicators/wma.src.js +1 -1
  640. package/indicators/zigzag.js +1 -1
  641. package/indicators/zigzag.src.js +1 -1
  642. package/modules/accessibility.d.ts +0 -30
  643. package/modules/accessibility.js +241 -216
  644. package/modules/accessibility.js.map +1 -1
  645. package/modules/accessibility.src.d.ts +0 -30
  646. package/modules/accessibility.src.js +7818 -6398
  647. package/modules/annotations-advanced.d.ts +30 -0
  648. package/modules/annotations-advanced.js +192 -165
  649. package/modules/annotations-advanced.js.map +1 -1
  650. package/modules/annotations-advanced.src.d.ts +30 -0
  651. package/modules/annotations-advanced.src.js +1716 -416
  652. package/modules/annotations.js +125 -110
  653. package/modules/annotations.js.map +1 -1
  654. package/modules/annotations.src.js +1059 -304
  655. package/modules/arrow-symbols.js +1 -1
  656. package/modules/arrow-symbols.src.js +1 -1
  657. package/modules/boost-canvas.js +15 -15
  658. package/modules/boost-canvas.js.map +1 -1
  659. package/modules/boost-canvas.src.js +3 -3
  660. package/modules/boost.js +79 -79
  661. package/modules/boost.js.map +1 -1
  662. package/modules/boost.src.js +42 -51
  663. package/modules/broken-axis.js +1 -1
  664. package/modules/broken-axis.js.map +1 -1
  665. package/modules/broken-axis.src.js +18 -12
  666. package/modules/bullet.js +1 -1
  667. package/modules/bullet.src.js +1 -1
  668. package/modules/coloraxis.js +24 -24
  669. package/modules/coloraxis.js.map +1 -1
  670. package/modules/coloraxis.src.js +77 -103
  671. package/modules/current-date-indicator.js +4 -4
  672. package/modules/current-date-indicator.js.map +1 -1
  673. package/modules/current-date-indicator.src.js +4 -4
  674. package/modules/cylinder.js +1 -1
  675. package/modules/cylinder.js.map +1 -1
  676. package/modules/cylinder.src.js +37 -5
  677. package/modules/data.d.ts +6 -6
  678. package/modules/data.js +31 -31
  679. package/modules/data.js.map +1 -1
  680. package/modules/data.src.d.ts +6 -6
  681. package/modules/data.src.js +18 -58
  682. package/modules/datagrouping.js +20 -20
  683. package/modules/datagrouping.js.map +1 -1
  684. package/modules/datagrouping.src.js +54 -33
  685. package/modules/debugger.js +1 -1
  686. package/modules/debugger.src.js +1 -1
  687. package/modules/dependency-wheel.js +11 -11
  688. package/modules/dependency-wheel.js.map +1 -1
  689. package/modules/dependency-wheel.src.js +5 -8
  690. package/modules/dotplot.js +1 -1
  691. package/modules/dotplot.src.js +1 -1
  692. package/modules/drag-panes.js +8 -8
  693. package/modules/drag-panes.js.map +1 -1
  694. package/modules/drag-panes.src.js +3 -3
  695. package/modules/draggable-points.js +1 -1
  696. package/modules/draggable-points.js.map +1 -1
  697. package/modules/draggable-points.src.js +8 -9
  698. package/modules/drilldown.js +24 -24
  699. package/modules/drilldown.js.map +1 -1
  700. package/modules/drilldown.src.js +13 -8
  701. package/modules/dumbbell.js +17 -17
  702. package/modules/dumbbell.js.map +1 -1
  703. package/modules/dumbbell.src.js +4 -8
  704. package/modules/export-data.js +19 -19
  705. package/modules/export-data.js.map +1 -1
  706. package/modules/export-data.src.js +9 -8
  707. package/modules/exporting.js +39 -38
  708. package/modules/exporting.js.map +1 -1
  709. package/modules/exporting.src.js +132 -113
  710. package/modules/full-screen.js +1 -1
  711. package/modules/full-screen.js.map +1 -1
  712. package/modules/full-screen.src.js +5 -4
  713. package/modules/funnel.js +12 -12
  714. package/modules/funnel.js.map +1 -1
  715. package/modules/funnel.src.js +9 -6
  716. package/modules/funnel3d.js +1 -1
  717. package/modules/funnel3d.js.map +1 -1
  718. package/modules/funnel3d.src.js +17 -10
  719. package/modules/gantt.js +217 -218
  720. package/modules/gantt.js.map +1 -1
  721. package/modules/gantt.src.js +364 -363
  722. package/modules/grid-axis.js +1 -1
  723. package/modules/grid-axis.js.map +1 -1
  724. package/modules/grid-axis.src.js +27 -19
  725. package/modules/heatmap.js +39 -39
  726. package/modules/heatmap.js.map +1 -1
  727. package/modules/heatmap.src.js +132 -141
  728. package/modules/heikinashi.js +1 -1
  729. package/modules/heikinashi.js.map +1 -1
  730. package/modules/heikinashi.src.js +12 -10
  731. package/modules/histogram-bellcurve.js +13 -13
  732. package/modules/histogram-bellcurve.js.map +1 -1
  733. package/modules/histogram-bellcurve.src.js +97 -91
  734. package/modules/hollowcandlestick.js +9 -9
  735. package/modules/hollowcandlestick.js.map +1 -1
  736. package/modules/hollowcandlestick.src.js +31 -35
  737. package/modules/item-series.js +6 -6
  738. package/modules/item-series.js.map +1 -1
  739. package/modules/item-series.src.js +6 -6
  740. package/modules/lollipop.js +1 -1
  741. package/modules/lollipop.src.js +1 -1
  742. package/modules/map.d.ts +138 -14
  743. package/modules/map.js +144 -122
  744. package/modules/map.js.map +1 -1
  745. package/modules/map.src.d.ts +138 -14
  746. package/modules/map.src.js +2253 -1074
  747. package/modules/marker-clusters.js +36 -36
  748. package/modules/marker-clusters.js.map +1 -1
  749. package/modules/marker-clusters.src.js +176 -143
  750. package/modules/networkgraph.d.ts +12 -1
  751. package/modules/networkgraph.js +49 -49
  752. package/modules/networkgraph.js.map +1 -1
  753. package/modules/networkgraph.src.d.ts +12 -1
  754. package/modules/networkgraph.src.js +103 -78
  755. package/modules/no-data-to-display.js +5 -5
  756. package/modules/no-data-to-display.js.map +1 -1
  757. package/modules/no-data-to-display.src.js +3 -3
  758. package/modules/offline-exporting.js +18 -18
  759. package/modules/offline-exporting.js.map +1 -1
  760. package/modules/offline-exporting.src.js +38 -43
  761. package/modules/oldie-polyfills.js +1 -1
  762. package/modules/oldie-polyfills.src.js +1 -1
  763. package/modules/oldie.js +26 -26
  764. package/modules/oldie.js.map +1 -1
  765. package/modules/oldie.src.js +21 -81
  766. package/modules/organization.js +13 -13
  767. package/modules/organization.js.map +1 -1
  768. package/modules/organization.src.js +8 -6
  769. package/modules/overlapping-datalabels.js +1 -1
  770. package/modules/overlapping-datalabels.src.js +1 -1
  771. package/modules/parallel-coordinates.js +1 -1
  772. package/modules/parallel-coordinates.js.map +1 -1
  773. package/modules/parallel-coordinates.src.js +6 -4
  774. package/modules/pareto.js +7 -7
  775. package/modules/pareto.js.map +1 -1
  776. package/modules/pareto.src.js +89 -78
  777. package/modules/pathfinder.js +1 -1
  778. package/modules/pathfinder.js.map +1 -1
  779. package/modules/pathfinder.src.js +21 -20
  780. package/modules/pattern-fill.js +1 -1
  781. package/modules/pattern-fill.js.map +1 -1
  782. package/modules/pattern-fill.src.js +18 -12
  783. package/modules/price-indicator.js +1 -1
  784. package/modules/price-indicator.js.map +1 -1
  785. package/modules/price-indicator.src.js +3 -2
  786. package/modules/pyramid3d.js +1 -1
  787. package/modules/pyramid3d.js.map +1 -1
  788. package/modules/pyramid3d.src.js +3 -2
  789. package/modules/sankey.d.ts +12 -1
  790. package/modules/sankey.js +29 -29
  791. package/modules/sankey.js.map +1 -1
  792. package/modules/sankey.src.d.ts +12 -1
  793. package/modules/sankey.src.js +307 -181
  794. package/modules/series-label.js +1 -1
  795. package/modules/series-label.js.map +1 -1
  796. package/modules/series-label.src.js +2 -2
  797. package/modules/solid-gauge.js +1 -1
  798. package/modules/solid-gauge.js.map +1 -1
  799. package/modules/solid-gauge.src.js +17 -2
  800. package/modules/sonification.js +59 -55
  801. package/modules/sonification.js.map +1 -1
  802. package/modules/sonification.src.js +3093 -2594
  803. package/modules/static-scale.js +1 -1
  804. package/modules/static-scale.src.js +1 -1
  805. package/modules/stock-tools.js +178 -163
  806. package/modules/stock-tools.js.map +1 -1
  807. package/modules/stock-tools.src.js +1136 -229
  808. package/modules/stock.d.ts +39 -6
  809. package/modules/stock.js +204 -196
  810. package/modules/stock.js.map +1 -1
  811. package/modules/stock.src.d.ts +39 -6
  812. package/modules/stock.src.js +1820 -1240
  813. package/modules/streamgraph.js +1 -1
  814. package/modules/streamgraph.src.js +1 -1
  815. package/modules/sunburst.js +60 -60
  816. package/modules/sunburst.js.map +1 -1
  817. package/modules/sunburst.src.js +281 -248
  818. package/modules/tilemap.js +17 -17
  819. package/modules/tilemap.js.map +1 -1
  820. package/modules/tilemap.src.js +3 -13
  821. package/modules/timeline.js +18 -18
  822. package/modules/timeline.js.map +1 -1
  823. package/modules/timeline.src.js +5 -5
  824. package/modules/treegrid.js +56 -57
  825. package/modules/treegrid.js.map +1 -1
  826. package/modules/treegrid.src.js +201 -169
  827. package/modules/treemap.js +41 -41
  828. package/modules/treemap.js.map +1 -1
  829. package/modules/treemap.src.js +266 -232
  830. package/modules/variable-pie.js +1 -1
  831. package/modules/variable-pie.src.js +1 -1
  832. package/modules/variwide.js +1 -1
  833. package/modules/variwide.js.map +1 -1
  834. package/modules/variwide.src.js +7 -3
  835. package/modules/vector.js +1 -1
  836. package/modules/vector.src.js +1 -1
  837. package/modules/venn.js +31 -31
  838. package/modules/venn.js.map +1 -1
  839. package/modules/venn.src.js +740 -731
  840. package/modules/windbarb.js +15 -15
  841. package/modules/windbarb.js.map +1 -1
  842. package/modules/windbarb.src.js +90 -62
  843. package/modules/wordcloud.js +23 -24
  844. package/modules/wordcloud.js.map +1 -1
  845. package/modules/wordcloud.src.js +898 -954
  846. package/modules/xrange.js +2 -2
  847. package/modules/xrange.js.map +1 -1
  848. package/modules/xrange.src.js +12 -33
  849. package/package.json +1 -1
  850. package/themes/avocado.js +1 -1
  851. package/themes/avocado.src.js +1 -1
  852. package/themes/brand-dark.js +15 -0
  853. package/themes/brand-dark.js.map +1 -0
  854. package/themes/brand-dark.src.js +328 -0
  855. package/themes/brand-light.js +15 -0
  856. package/themes/brand-light.js.map +1 -0
  857. package/themes/brand-light.src.js +294 -0
  858. package/themes/dark-blue.js +1 -1
  859. package/themes/dark-blue.src.js +1 -1
  860. package/themes/dark-green.js +1 -1
  861. package/themes/dark-green.src.js +1 -1
  862. package/themes/dark-unica.js +1 -1
  863. package/themes/dark-unica.js.map +1 -1
  864. package/themes/dark-unica.src.js +5 -3
  865. package/themes/gray.js +1 -1
  866. package/themes/gray.src.js +1 -1
  867. package/themes/grid-light.js +1 -1
  868. package/themes/grid-light.js.map +1 -1
  869. package/themes/grid-light.src.js +5 -3
  870. package/themes/grid.js +1 -1
  871. package/themes/grid.js.map +1 -1
  872. package/themes/grid.src.js +5 -3
  873. package/themes/high-contrast-dark.js +1 -1
  874. package/themes/high-contrast-dark.src.js +1 -1
  875. package/themes/high-contrast-light.js +1 -1
  876. package/themes/high-contrast-light.src.js +1 -1
  877. package/themes/sand-signika.js +1 -1
  878. package/themes/sand-signika.src.js +1 -1
  879. package/themes/skies.js +1 -1
  880. package/themes/skies.src.js +1 -1
  881. package/themes/sunset.js +1 -1
  882. package/themes/sunset.src.js +1 -1
  883. package/es-modules/Core/Axis/MapAxis.js +0 -157
  884. package/es-modules/Core/Color/Palette.js +0 -82
  885. package/es-modules/Extensions/Sonification/InstrumentDefinitions.js +0 -32
  886. package/es-modules/Mixins/ColorSeries.js +0 -77
  887. package/es-modules/Mixins/DerivedSeries.js +0 -118
  888. package/es-modules/Mixins/DrawPoint.js +0 -81
  889. package/es-modules/Mixins/IndicatorRequired.js +0 -56
  890. package/es-modules/Mixins/MultipleLines.js +0 -181
  891. package/es-modules/Mixins/Navigation.js +0 -54
  892. package/es-modules/Mixins/NelderMead.js +0 -132
  893. package/es-modules/Mixins/Polygon.js +0 -259
  894. package/es-modules/Mixins/ReduceArray.js +0 -54
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v9.2.2 (2021-08-24)
2
+ * @license Highcharts JS v9.3.3 (2022-02-01)
3
3
  *
4
4
  * Annotations module
5
5
  *
@@ -49,7 +49,6 @@
49
49
  *
50
50
  * @private
51
51
  * @mixin
52
- * @memberOf Annotation
53
52
  */
54
53
  var eventEmitterMixin = {
55
54
  /**
@@ -293,8 +292,7 @@
293
292
  * @param {Highcharts.AnnotationControllable} target
294
293
  * @return {Highcharts.PositionObject}
295
294
  */
296
- var extend = U.extend,
297
- merge = U.merge,
295
+ var merge = U.merge,
298
296
  pick = U.pick;
299
297
  /* eslint-disable no-invalid-this, valid-jsdoc */
300
298
  /**
@@ -362,7 +360,6 @@
362
360
  * @param {boolean} visible
363
361
  * Visibility of the control point.
364
362
  *
365
- * @return {void}
366
363
  */
367
364
  ControlPoint.prototype.setVisibility = function (visible) {
368
365
  this.graphic.attr('visibility', visible ? 'visible' : 'hidden');
@@ -412,7 +409,6 @@
412
409
  * @param {Partial<Highcharts.AnnotationControlPointOptionsObject>} userOptions
413
410
  * New options for the control point.
414
411
  *
415
- * @return {void}
416
412
  */
417
413
  ControlPoint.prototype.update = function (userOptions) {
418
414
  var chart = this.chart,
@@ -967,7 +963,8 @@
967
963
  */
968
964
  getPointsOptions: function () {
969
965
  var options = this.options;
970
- return (options.points || (options.point && splat(options.point)));
966
+ return (options.points ||
967
+ (options.point && splat(options.point)));
971
968
  },
972
969
  /**
973
970
  * Utility function for mapping item's options
@@ -1188,8 +1185,11 @@
1188
1185
  *
1189
1186
  * @param {number} dx translation for x coordinate
1190
1187
  * @param {number} dy translation for y coordinate
1188
+ * @param {boolean|undefined} translateSecondPoint If the shape has two
1189
+ * points attached to it, this option allows you to translate also
1190
+ * the second point
1191
1191
  */
1192
- translateShape: function (dx, dy) {
1192
+ translateShape: function (dx, dy, translateSecondPoint) {
1193
1193
  var chart = this.annotation.chart,
1194
1194
  // Annotation.options
1195
1195
  shapeOptions = this.annotation.userOptions,
@@ -1197,11 +1197,16 @@
1197
1197
  annotationIndex = chart.annotations.indexOf(this.annotation),
1198
1198
  chartOptions = chart.options.annotations[annotationIndex];
1199
1199
  this.translatePoint(dx, dy, 0);
1200
+ if (translateSecondPoint) {
1201
+ this.translatePoint(dx, dy, 1);
1202
+ }
1200
1203
  // Options stored in:
1201
1204
  // - chart (for exporting)
1202
1205
  // - current config (for redraws)
1203
- chartOptions[this.collection][this.index].point = this.options.point;
1204
- shapeOptions[this.collection][this.index].point = this.options.point;
1206
+ chartOptions[this.collection][this.index]
1207
+ .point = this.options.point;
1208
+ shapeOptions[this.collection][this.index]
1209
+ .point = this.options.point;
1205
1210
  },
1206
1211
  /**
1207
1212
  * Rotate a controllable.
@@ -1419,13 +1424,13 @@
1419
1424
  fill = itemOptions.fill,
1420
1425
  color = defined(fill) && fill !== 'none' ?
1421
1426
  fill :
1422
- itemOptions.stroke,
1423
- setMarker = function (markerType) {
1427
+ itemOptions.stroke;
1428
+ var setMarker = function (markerType) {
1424
1429
  var markerId = itemOptions[markerType],
1425
- def,
1426
- predefinedMarker,
1427
- key,
1428
- marker;
1430
+ def,
1431
+ predefinedMarker,
1432
+ key,
1433
+ marker;
1429
1434
  if (markerId) {
1430
1435
  for (key in defs) { // eslint-disable-line guard-for-in
1431
1436
  def = defs[key];
@@ -1440,13 +1445,13 @@
1440
1445
  }
1441
1446
  if (predefinedMarker) {
1442
1447
  marker = item[markerType] = chart.renderer
1443
- .addMarker((itemOptions.id || uniqueKey()) + '-' +
1444
- markerId, merge(predefinedMarker, { color: color }));
1448
+ .addMarker((itemOptions.id || uniqueKey()) + '-' + markerId, merge(predefinedMarker, { color: color }));
1445
1449
  item.attr(markerType, marker.getAttribute('id'));
1446
1450
  }
1447
1451
  }
1448
1452
  };
1449
- ['markerStart', 'markerEnd'].forEach(setMarker);
1453
+ ['markerStart', 'markerEnd']
1454
+ .forEach(setMarker);
1450
1455
  }
1451
1456
  };
1452
1457
  addEvent(Chart, 'afterGetContainer', function () {
@@ -1517,7 +1522,7 @@
1517
1522
  this.point = ControllableMixin.point;
1518
1523
  this.rotate = ControllableMixin.rotate;
1519
1524
  this.scale = ControllableMixin.scale;
1520
- this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
1525
+ this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
1521
1526
  this.setMarkers = MarkerMixin.setItemMarkers;
1522
1527
  this.transform = ControllableMixin.transform;
1523
1528
  this.transformPoint = ControllableMixin.transformPoint;
@@ -1581,7 +1586,8 @@
1581
1586
  null;
1582
1587
  };
1583
1588
  ControllablePath.prototype.shouldBeDrawn = function () {
1584
- return (ControllableMixin.shouldBeDrawn.call(this) || Boolean(this.options.d));
1589
+ return (ControllableMixin.shouldBeDrawn.call(this) ||
1590
+ Boolean(this.options.d));
1585
1591
  };
1586
1592
  ControllablePath.prototype.render = function (parent) {
1587
1593
  var options = this.options,
@@ -1708,7 +1714,7 @@
1708
1714
  this.point = ControllableMixin.point;
1709
1715
  this.rotate = ControllableMixin.rotate;
1710
1716
  this.scale = ControllableMixin.scale;
1711
- this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
1717
+ this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
1712
1718
  this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
1713
1719
  this.transform = ControllableMixin.transform;
1714
1720
  this.transformPoint = ControllableMixin.transformPoint;
@@ -1818,7 +1824,7 @@
1818
1824
  this.point = ControllableMixin.point;
1819
1825
  this.rotate = ControllableMixin.rotate;
1820
1826
  this.scale = ControllableMixin.scale;
1821
- this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
1827
+ this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
1822
1828
  this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
1823
1829
  this.transform = ControllableMixin.transform;
1824
1830
  this.transformPoint = ControllableMixin.transformPoint;
@@ -1890,6 +1896,215 @@
1890
1896
 
1891
1897
  return ControllableCircle;
1892
1898
  });
1899
+ _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) {
1900
+ /* *
1901
+ *
1902
+ * Author: Pawel Lysy
1903
+ *
1904
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
1905
+ *
1906
+ * */
1907
+ var merge = U.merge,
1908
+ defined = U.defined;
1909
+ /**
1910
+ * A controllable ellipse class.
1911
+ *
1912
+ * @requires modules/annotations
1913
+ *
1914
+ * @private
1915
+ * @class
1916
+ * @name Highcharts.AnnotationControllableEllipse
1917
+ *
1918
+ * @param {Highcharts.Annotation} annotation an annotation instance
1919
+ * @param {Highcharts.AnnotationsShapeOptions} options a shape's options
1920
+ * @param {number} index of the Ellipse
1921
+ */
1922
+ var ControllableEllipse = /** @class */ (function () {
1923
+ /* *
1924
+ *
1925
+ * Constructor
1926
+ *
1927
+ * */
1928
+ function ControllableEllipse(annotation, options, index) {
1929
+ /* *
1930
+ *
1931
+ * Properties
1932
+ *
1933
+ * */
1934
+ this.addControlPoints = ControllableMixin.addControlPoints;
1935
+ this.anchor = ControllableMixin.anchor;
1936
+ this.attr = ControllableMixin.attr;
1937
+ this.attrsFromOptions = ControllableMixin.attrsFromOptions;
1938
+ this.destroy = ControllableMixin.destroy;
1939
+ this.getPointsOptions = ControllableMixin.getPointsOptions;
1940
+ this.linkPoints = ControllableMixin.linkPoints;
1941
+ this.point = ControllableMixin.point;
1942
+ this.scale = ControllableMixin.scale;
1943
+ this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
1944
+ this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
1945
+ this.transform = ControllableMixin.transform;
1946
+ this.translatePoint = ControllableMixin.translatePoint;
1947
+ this.transformPoint = ControllableMixin.transformPoint;
1948
+ /**
1949
+ * @type 'ellipse'
1950
+ */
1951
+ this.type = 'ellipse';
1952
+ this.init(annotation, options, index);
1953
+ this.collection = 'shapes';
1954
+ }
1955
+ /* *
1956
+ *
1957
+ * Functions
1958
+ *
1959
+ * */
1960
+ ControllableEllipse.prototype.init = function (annotation, options, index) {
1961
+ if (defined(options.yAxis)) {
1962
+ options.points.forEach(function (point) {
1963
+ point.yAxis = options.yAxis;
1964
+ });
1965
+ }
1966
+ if (defined(options.xAxis)) {
1967
+ options.points.forEach(function (point) {
1968
+ point.xAxis = options.xAxis;
1969
+ });
1970
+ }
1971
+ ControllableMixin.init.call(this, annotation, options, index);
1972
+ };
1973
+ /**
1974
+ *
1975
+ * Render the element
1976
+ * @param parent parent SVG element.
1977
+ */
1978
+ ControllableEllipse.prototype.render = function (parent) {
1979
+ this.graphic = this.annotation.chart.renderer.createElement('ellipse')
1980
+ .attr(this.attrsFromOptions(this.options))
1981
+ .add(parent);
1982
+ ControllableMixin.render.call(this);
1983
+ };
1984
+ /**
1985
+ * Translate the points.
1986
+ * Mostly used to handle dragging of the ellipse.
1987
+ */
1988
+ ControllableEllipse.prototype.translate = function (dx, dy) {
1989
+ ControllableMixin.translateShape.call(this, dx, dy, true);
1990
+ };
1991
+ /**
1992
+ * Get the distance from the line to the point.
1993
+ * @param point1 first point which is on the line
1994
+ * @param point2 second point
1995
+ * @param x0 point's x value from which you want to calculate the distance from
1996
+ * @param y0 point's y value from which you want to calculate the distance from
1997
+ */
1998
+ ControllableEllipse.prototype.getDistanceFromLine = function (point1, point2, x0, y0) {
1999
+ return Math.abs((point2.y - point1.y) * x0 - (point2.x - point1.x) * y0 +
2000
+ point2.x * point1.y - point2.y * point1.x) / Math.sqrt((point2.y - point1.y) * (point2.y - point1.y) +
2001
+ (point2.x - point1.x) * (point2.x - point1.x));
2002
+ };
2003
+ /**
2004
+ * The fuction calculates the svg attributes of the ellipse, and returns all
2005
+ * parameters neccessary to draw the ellipse.
2006
+ * @param position absolute position of the first point in points array
2007
+ * @param position2 absolute position of the second point in points array
2008
+ */
2009
+ ControllableEllipse.prototype.getAttrs = function (position, position2) {
2010
+ var x1 = position.x,
2011
+ y1 = position.y,
2012
+ x2 = position2.x,
2013
+ y2 = position2.y,
2014
+ cx = (x1 + x2) / 2,
2015
+ cy = (y1 + y2) / 2,
2016
+ rx = Math.sqrt((x1 - x2) * (x1 - x2) / 4 + (y1 - y2) * (y1 - y2) / 4),
2017
+ tan = (y2 - y1) / (x2 - x1);
2018
+ var angle = Math.atan(tan) * 180 / Math.PI;
2019
+ if (cx < x1) {
2020
+ angle += 180;
2021
+ }
2022
+ var ry = this.getRY();
2023
+ return { cx: cx, cy: cy, rx: rx, ry: ry, angle: angle };
2024
+ };
2025
+ /**
2026
+ * Get the value of minor radius of the ellipse.
2027
+ */
2028
+ ControllableEllipse.prototype.getRY = function () {
2029
+ var yAxis = this.getYAxis();
2030
+ return defined(yAxis) ?
2031
+ Math.abs(yAxis.toPixels(this.options.ry) - yAxis.toPixels(0)) :
2032
+ this.options.ry;
2033
+ };
2034
+ /**
2035
+ * get the yAxis object to which the ellipse is pinned.
2036
+ */
2037
+ ControllableEllipse.prototype.getYAxis = function () {
2038
+ var yAxisIndex = this.options.yAxis;
2039
+ return this.chart.yAxis[yAxisIndex];
2040
+ };
2041
+ /**
2042
+ * Get the absolute coordinates of the MockPoint
2043
+ * @param point MockPoint that is added through options
2044
+ */
2045
+ ControllableEllipse.prototype.getAbsolutePosition = function (point) {
2046
+ return this.anchor(point).absolutePosition;
2047
+ };
2048
+ /**
2049
+ *
2050
+ * Redraw the element
2051
+ * @param animation display an annimation
2052
+ */
2053
+ ControllableEllipse.prototype.redraw = function (animation) {
2054
+ var position = this.getAbsolutePosition(this.points[0]),
2055
+ position2 = this.getAbsolutePosition(this.points[1]),
2056
+ attrs = this.getAttrs(position,
2057
+ position2);
2058
+ if (position) {
2059
+ this.graphic[animation ? 'animate' : 'attr']({
2060
+ cx: attrs.cx,
2061
+ cy: attrs.cy,
2062
+ rx: attrs.rx,
2063
+ ry: attrs.ry,
2064
+ rotation: attrs.angle,
2065
+ rotationOriginX: attrs.cx,
2066
+ rotationOriginY: attrs.cy
2067
+ });
2068
+ }
2069
+ else {
2070
+ this.graphic.attr({
2071
+ x: 0,
2072
+ y: -9e9
2073
+ });
2074
+ }
2075
+ this.graphic.placed = Boolean(position);
2076
+ ControllableMixin.redraw.call(this, animation);
2077
+ };
2078
+ /**
2079
+ * Set the radius Y.
2080
+ *
2081
+ * @param {number} ry a radius in y direction to be set
2082
+ */
2083
+ ControllableEllipse.prototype.setYRadius = function (ry) {
2084
+ this.options.ry = ry;
2085
+ this.annotation.userOptions.shapes[0].ry = ry;
2086
+ this.annotation.options.shapes[0].ry = ry;
2087
+ };
2088
+ /* *
2089
+ *
2090
+ * Static Properties
2091
+ *
2092
+ * */
2093
+ /**
2094
+ * A map object which allows to map options attributes to element
2095
+ * attributes.
2096
+ *
2097
+ * @name Highcharts.AnnotationControllableEllipse.attrsMap
2098
+ * @type {Highcharts.Dictionary<string>}
2099
+ */
2100
+ ControllableEllipse.attrsMap = merge(ControllablePath.attrsMap, {
2101
+ ry: 'ry'
2102
+ });
2103
+ return ControllableEllipse;
2104
+ }());
2105
+
2106
+ return ControllableEllipse;
2107
+ });
1893
2108
  _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
2109
  /* *
1895
2110
  *
@@ -1945,7 +2160,7 @@
1945
2160
  this.point = ControllableMixin.point;
1946
2161
  this.rotate = ControllableMixin.rotate;
1947
2162
  this.scale = ControllableMixin.scale;
1948
- this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
2163
+ this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
1949
2164
  this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
1950
2165
  this.transform = ControllableMixin.transform;
1951
2166
  this.transformPoint = ControllableMixin.transformPoint;
@@ -2178,10 +2393,6 @@
2178
2393
  };
2179
2394
  /**
2180
2395
  * Returns the label position relative to its anchor.
2181
- *
2182
- * @param {Highcharts.AnnotationAnchorObject} anchor
2183
- *
2184
- * @return {Highcharts.PositionObject|null}
2185
2396
  */
2186
2397
  ControllableLabel.prototype.position = function (anchor) {
2187
2398
  var item = this.graphic,
@@ -2210,7 +2421,8 @@
2210
2421
  plotY: anchorRelativePosition.y,
2211
2422
  negative: point.negative,
2212
2423
  ttBelow: point.ttBelow,
2213
- h: (anchorRelativePosition.height || anchorRelativePosition.width)
2424
+ h: (anchorRelativePosition.height ||
2425
+ anchorRelativePosition.width)
2214
2426
  });
2215
2427
  }
2216
2428
  else if (itemOptions.positioner) {
@@ -2358,7 +2570,7 @@
2358
2570
  this.point = ControllableMixin.point;
2359
2571
  this.rotate = ControllableMixin.rotate;
2360
2572
  this.scale = ControllableMixin.scale;
2361
- this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
2573
+ this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
2362
2574
  this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
2363
2575
  this.transform = ControllableMixin.transform;
2364
2576
  this.transformPoint = ControllableMixin.transformPoint;
@@ -2424,7 +2636,7 @@
2424
2636
 
2425
2637
  return ControllableImage;
2426
2638
  });
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) {
2639
+ _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
2640
  /* *
2429
2641
  *
2430
2642
  * (c) 2009-2021 Highsoft, Black Label
@@ -2646,7 +2858,10 @@
2646
2858
  };
2647
2859
  Annotation.prototype.addClipPaths = function () {
2648
2860
  this.setClipAxes();
2649
- if (this.clipXAxis && this.clipYAxis) {
2861
+ if (this.clipXAxis &&
2862
+ this.clipYAxis &&
2863
+ this.options.crop // #15399
2864
+ ) {
2650
2865
  this.clipRect = this.chart.renderer.clipRect(this.getClipBox());
2651
2866
  }
2652
2867
  };
@@ -2748,8 +2963,10 @@
2748
2963
  .add();
2749
2964
  this.shapesGroup = renderer
2750
2965
  .g('annotation-shapes')
2751
- .add(this.graphic)
2752
- .clip(this.chart.plotBoxClip);
2966
+ .add(this.graphic);
2967
+ if (this.options.crop) { // #15399
2968
+ this.shapesGroup.clip(this.chart.plotBoxClip);
2969
+ }
2753
2970
  this.labelsGroup = renderer
2754
2971
  .g('annotation-labels')
2755
2972
  .attr({
@@ -2835,7 +3052,6 @@
2835
3052
  * @param {Partial<Highcharts.AnnotationsOptions>} userOptions
2836
3053
  * New user options for the annotation.
2837
3054
  *
2838
- * @return {void}
2839
3055
  */
2840
3056
  Annotation.prototype.update = function (userOptions, redraw) {
2841
3057
  var chart = this.chart,
@@ -2865,7 +3081,11 @@
2865
3081
  /**
2866
3082
  * Initialisation of a single shape
2867
3083
  * @private
2868
- * @param {Object} shapeOptions - a confg object for a single shape
3084
+ * @param {Object} shapeOptions
3085
+ * a confg object for a single shape
3086
+ * @param {number} index
3087
+ * annotation may have many shapes, this is the shape's index saved in
3088
+ * shapes.index.
2869
3089
  */
2870
3090
  Annotation.prototype.initShape = function (shapeOptions, index) {
2871
3091
  var options = merge(this.options.shapeOptions, {
@@ -2971,6 +3191,7 @@
2971
3191
  Annotation.shapesMap = {
2972
3192
  'rect': ControllableRect,
2973
3193
  'circle': ControllableCircle,
3194
+ 'ellipse': ControllableEllipse,
2974
3195
  'path': ControllablePath,
2975
3196
  'image': ControllableImage
2976
3197
  };
@@ -3047,9 +3268,18 @@
3047
3268
  * Animation defer settings
3048
3269
  * @type {boolean|Partial<Highcharts.AnimationOptionsObject>}
3049
3270
  * @since 8.2.0
3050
- * @apioption annotations.animation
3051
3271
  */
3052
3272
  animation: {},
3273
+ /**
3274
+ * Whether to hide the part of the annotation
3275
+ * that is outside the plot area.
3276
+ *
3277
+ * @sample highcharts/annotations/label-crop-overflow/
3278
+ * Crop line annotation
3279
+ * @type {boolean}
3280
+ * @since 9.3.0
3281
+ */
3282
+ crop: true,
3053
3283
  /**
3054
3284
  * The animation delay time in milliseconds.
3055
3285
  * Set to `0` renders annotation immediately.
@@ -3114,7 +3344,7 @@
3114
3344
  *
3115
3345
  * @type {Highcharts.ColorString}
3116
3346
  */
3117
- borderColor: palette.neutralColor100,
3347
+ borderColor: "#000000" /* neutralColor100 */,
3118
3348
  /**
3119
3349
  * The border radius in pixels for the annotaiton's label.
3120
3350
  *
@@ -3409,6 +3639,32 @@
3409
3639
  * @requires modules/annotations
3410
3640
  */
3411
3641
  shapeOptions: {
3642
+ /**
3643
+ *
3644
+ * The radius of the shape in y direction.
3645
+ * Used for the ellipse.
3646
+ *
3647
+ * @sample highcharts/annotations/ellipse/
3648
+ * Ellipse annotation
3649
+ *
3650
+ * @type {number}
3651
+ * @apioption annotations.shapeOptions.ry
3652
+ **/
3653
+ /**
3654
+ *
3655
+ * The xAxis index to which the points should be attached.
3656
+ * Used for the ellipse.
3657
+ *
3658
+ * @type {number}
3659
+ * @apioption annotations.shapeOptions.xAxis
3660
+ **/
3661
+ /**
3662
+ * The yAxis index to which the points should be attached.
3663
+ * Used for the ellipse.
3664
+ *
3665
+ * @type {number}
3666
+ * @apioption annotations.shapeOptions.yAxis
3667
+ **/
3412
3668
  /**
3413
3669
  * The width of the shape.
3414
3670
  *
@@ -3428,11 +3684,15 @@
3428
3684
  * @apioption annotations.shapeOptions.height
3429
3685
  */
3430
3686
  /**
3431
- * The type of the shape, e.g. circle or rectangle.
3687
+ * The type of the shape.
3688
+ * Avaliable options are circle, rect and ellipse.
3432
3689
  *
3433
3690
  * @sample highcharts/annotations/shape/
3434
3691
  * Basic shape annotation
3435
3692
  *
3693
+ * @sample highcharts/annotations/ellipse/
3694
+ * Ellipse annotation
3695
+ *
3436
3696
  * @type {string}
3437
3697
  * @default rect
3438
3698
  * @apioption annotations.shapeOptions.type
@@ -3514,9 +3774,10 @@
3514
3774
  width: 10,
3515
3775
  height: 10,
3516
3776
  style: {
3517
- stroke: palette.neutralColor100,
3518
- 'stroke-width': 2,
3519
- fill: palette.backgroundColor
3777
+ cursor: 'pointer',
3778
+ fill: "#ffffff" /* backgroundColor */,
3779
+ stroke: "#000000" /* neutralColor100 */,
3780
+ 'stroke-width': 2
3520
3781
  },
3521
3782
  visible: false,
3522
3783
  events: {}
@@ -3567,7 +3828,8 @@
3567
3828
  ******************************************************************** */
3568
3829
  extend(chartProto, /** @lends Highcharts.Chart# */ {
3569
3830
  initAnnotation: function (userOptions) {
3570
- var Constructor = Annotation.types[userOptions.type] || Annotation,
3831
+ var Constructor = Annotation
3832
+ .types[userOptions.type] || Annotation,
3571
3833
  annotation = new Constructor(this,
3572
3834
  userOptions);
3573
3835
  this.annotations.push(annotation);
@@ -3579,7 +3841,8 @@
3579
3841
  * @param {Highcharts.AnnotationsOptions} options
3580
3842
  * The annotation options for the new, detailed annotation.
3581
3843
  * @param {boolean} [redraw]
3582
- *
3844
+ * @sample highcharts/annotations/add-annotation/
3845
+ * Add annotation
3583
3846
  * @return {Highcharts.Annotation} - The newly generated annotation.
3584
3847
  */
3585
3848
  addAnnotation: function (userOptions, redraw) {
@@ -3601,7 +3864,7 @@
3601
3864
  */
3602
3865
  removeAnnotation: function (idOrAnnotation) {
3603
3866
  var annotations = this.annotations,
3604
- annotation = idOrAnnotation.coll === 'annotations' ?
3867
+ annotation = (idOrAnnotation.coll === 'annotations') ?
3605
3868
  idOrAnnotation :
3606
3869
  find(annotations,
3607
3870
  function (annotation) {
@@ -3720,15 +3983,15 @@
3720
3983
  // Annotation placed on a exported data point
3721
3984
  // - add new column
3722
3985
  if (!wasAdded) {
3723
- event.dataRows.forEach(function (row, rowIndex) {
3986
+ event.dataRows.forEach(function (row) {
3724
3987
  if (!wasAdded &&
3725
3988
  row.xValues &&
3726
3989
  xAxisIndex !== void 0 &&
3727
3990
  annotationX === row.xValues[xAxisIndex]) {
3728
3991
  if (joinAnnotations &&
3729
3992
  row.length > startRowLength) {
3730
- row[row.length - 1] +=
3731
- annotationSeparator + annotationText_1;
3993
+ row[row.length - 1] += (annotationSeparator +
3994
+ annotationText_1);
3732
3995
  }
3733
3996
  else {
3734
3997
  row.push(annotationText_1);
@@ -3846,7 +4109,7 @@
3846
4109
 
3847
4110
  return Annotation;
3848
4111
  });
3849
- _registerModule(_modules, 'Mixins/Navigation.js', [], function () {
4112
+ _registerModule(_modules, 'Core/Chart/ChartNavigationComposition.js', [], function () {
3850
4113
  /**
3851
4114
  *
3852
4115
  * (c) 2010-2021 Paweł Fus
@@ -3856,56 +4119,91 @@
3856
4119
  * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
3857
4120
  *
3858
4121
  * */
3859
- var chartNavigation = {
3860
- /**
3861
- * Initializes `chart.navigation` object which delegates `update()` methods
3862
- * to all other common classes (used in exporting and navigationBindings).
3863
- *
3864
- * @private
3865
- * @param {Highcharts.Chart} chart
3866
- * The chart instance.
3867
- * @return {void}
3868
- */
3869
- initUpdate: function (chart) {
3870
- if (!chart.navigation) {
3871
- chart.navigation = {
3872
- updates: [],
3873
- update: function (options,
3874
- redraw) {
3875
- this.updates.forEach(function (updateConfig) {
3876
- updateConfig.update.call(updateConfig.context,
3877
- options,
3878
- redraw);
3879
- });
3880
- }
3881
- };
3882
- }
3883
- },
3884
- /**
3885
- * Registers an `update()` method in the `chart.navigation` object.
4122
+ /* *
4123
+ *
4124
+ * Composition
4125
+ *
4126
+ * */
4127
+ var ChartNavigationComposition;
4128
+ (function (ChartNavigationComposition) {
4129
+ /* *
4130
+ *
4131
+ * Declarations
4132
+ *
4133
+ * */
4134
+ /* *
3886
4135
  *
4136
+ * Functions
4137
+ *
4138
+ * */
4139
+ /* eslint-disable valid-jsdoc */
4140
+ /**
3887
4141
  * @private
3888
- * @param {Highcharts.ChartNavigationUpdateFunction} update
3889
- * The `update()` method that will be called in `chart.update()`.
3890
- * @param {Highcharts.Chart} chart
3891
- * The chart instance. `update()` will use that as a context
3892
- * (`this`).
3893
- * @return {void}
3894
4142
  */
3895
- addUpdate: function (update, chart) {
4143
+ function compose(chart) {
3896
4144
  if (!chart.navigation) {
3897
- this.initUpdate(chart);
4145
+ chart.navigation = new Additions(chart);
3898
4146
  }
3899
- chart.navigation.updates.push({
3900
- update: update,
3901
- context: chart
3902
- });
4147
+ return chart;
3903
4148
  }
3904
- };
4149
+ ChartNavigationComposition.compose = compose;
4150
+ /* *
4151
+ *
4152
+ * Class
4153
+ *
4154
+ * */
4155
+ /**
4156
+ * Initializes `chart.navigation` object which delegates `update()` methods
4157
+ * to all other common classes (used in exporting and navigationBindings).
4158
+ * @private
4159
+ */
4160
+ var Additions = /** @class */ (function () {
4161
+ /* *
4162
+ *
4163
+ * Constructor
4164
+ *
4165
+ * */
4166
+ function Additions(chart) {
4167
+ this.updates = [];
4168
+ this.chart = chart;
4169
+ }
4170
+ /* *
4171
+ *
4172
+ * Functions
4173
+ *
4174
+ * */
4175
+ /**
4176
+ * Registers an `update()` method in the `chart.navigation` object.
4177
+ *
4178
+ * @private
4179
+ * @param {UpdateFunction} updateFn
4180
+ * The `update()` method that will be called in `chart.update()`.
4181
+ */
4182
+ Additions.prototype.addUpdate = function (updateFn) {
4183
+ this.chart.navigation.updates.push(updateFn);
4184
+ };
4185
+ /**
4186
+ * @private
4187
+ */
4188
+ Additions.prototype.update = function (options, redraw) {
4189
+ var _this = this;
4190
+ this.updates.forEach(function (updateFn) {
4191
+ updateFn.call(_this.chart, options, redraw);
4192
+ });
4193
+ };
4194
+ return Additions;
4195
+ }());
4196
+ ChartNavigationComposition.Additions = Additions;
4197
+ })(ChartNavigationComposition || (ChartNavigationComposition = {}));
4198
+ /* *
4199
+ *
4200
+ * Default Export
4201
+ *
4202
+ * */
3905
4203
 
3906
- return chartNavigation;
4204
+ return ChartNavigationComposition;
3907
4205
  });
3908
- _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) {
4206
+ _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) {
3909
4207
  /* *
3910
4208
  *
3911
4209
  * (c) 2009-2021 Highsoft, Black Label
@@ -4053,8 +4351,9 @@
4053
4351
  */
4054
4352
  getAssignedAxis: function (coords) {
4055
4353
  return coords.filter(function (coord) {
4056
- var axisMin = coord.axis.min,
4057
- axisMax = coord.axis.max,
4354
+ var extremes = coord.axis.getExtremes(),
4355
+ axisMin = extremes.min,
4356
+ axisMax = extremes.max,
4058
4357
  // Correct axis edges when axis has series
4059
4358
  // with pointRange (like column)
4060
4359
  minPointOffset = pick(coord.axis.minPointOffset, 0);
@@ -4125,7 +4424,9 @@
4125
4424
  navigation.eventsToUnbind.push(addEvent(subContainer, 'click', function (event) {
4126
4425
  var bindings = navigation.getButtonEvents(subContainer,
4127
4426
  event);
4128
- if (bindings && bindings.button.className.indexOf('highcharts-disabled-btn') === -1) {
4427
+ if (bindings &&
4428
+ bindings.button.className
4429
+ .indexOf('highcharts-disabled-btn') === -1) {
4129
4430
  navigation.bindingsButtonClick(bindings.button, bindings.events, event);
4130
4431
  }
4131
4432
  }));
@@ -4155,9 +4456,11 @@
4155
4456
  */
4156
4457
  NavigationBindings.prototype.initUpdate = function () {
4157
4458
  var navigation = this;
4158
- chartNavigationMixin.addUpdate(function (options) {
4459
+ ChartNavigationComposition
4460
+ .compose(this.chart).navigation
4461
+ .addUpdate(function (options) {
4159
4462
  navigation.update(options);
4160
- }, this.chart);
4463
+ });
4161
4464
  };
4162
4465
  /**
4163
4466
  * Hook for click on a button, method selcts/unselects buttons,
@@ -4169,7 +4472,7 @@
4169
4472
  * @param {Highcharts.HTMLDOMElement} [button]
4170
4473
  * Clicked button
4171
4474
  *
4172
- * @param {object} events
4475
+ * @param {Object} events
4173
4476
  * Events passed down from bindings (`init`, `start`, `step`, `end`)
4174
4477
  *
4175
4478
  * @param {Highcharts.PointerEventObject} clickEvent
@@ -4177,8 +4480,13 @@
4177
4480
  */
4178
4481
  NavigationBindings.prototype.bindingsButtonClick = function (button, events, clickEvent) {
4179
4482
  var navigation = this,
4180
- chart = navigation.chart;
4483
+ chart = navigation.chart,
4484
+ svgContainer = chart.renderer.boxWrapper;
4485
+ var shouldEventBeFired = true;
4181
4486
  if (navigation.selectedButtonElement) {
4487
+ if (navigation.selectedButtonElement.classList === button.classList) {
4488
+ shouldEventBeFired = false;
4489
+ }
4182
4490
  fireEvent(navigation, 'deselectButton', { button: navigation.selectedButtonElement });
4183
4491
  if (navigation.nextEvent) {
4184
4492
  // Remove in-progress annotations adders:
@@ -4189,15 +4497,24 @@
4189
4497
  navigation.mouseMoveEvent = navigation.nextEvent = false;
4190
4498
  }
4191
4499
  }
4192
- navigation.selectedButton = events;
4193
- navigation.selectedButtonElement = button;
4194
- fireEvent(navigation, 'selectButton', { button: button });
4195
- // Call "init" event, for example to open modal window
4196
- if (events.init) {
4197
- events.init.call(navigation, button, clickEvent);
4500
+ if (shouldEventBeFired) {
4501
+ navigation.selectedButton = events;
4502
+ navigation.selectedButtonElement = button;
4503
+ fireEvent(navigation, 'selectButton', { button: button });
4504
+ // Call "init" event, for example to open modal window
4505
+ if (events.init) {
4506
+ events.init.call(navigation, button, clickEvent);
4507
+ }
4508
+ if (events.start || events.steps) {
4509
+ chart.renderer.boxWrapper.addClass(PREFIX + 'draw-mode');
4510
+ }
4198
4511
  }
4199
- if (events.start || events.steps) {
4200
- chart.renderer.boxWrapper.addClass(PREFIX + 'draw-mode');
4512
+ else {
4513
+ chart.stockTools && chart.stockTools.toggleButtonAciveClass(button);
4514
+ svgContainer.removeClass(PREFIX + 'draw-mode');
4515
+ navigation.nextEvent = false;
4516
+ navigation.mouseMoveEvent = false;
4517
+ navigation.selectedButton = null;
4201
4518
  }
4202
4519
  };
4203
4520
  /**
@@ -4268,8 +4585,7 @@
4268
4585
  navigation.stepIndex++;
4269
4586
  if (selectedButton.steps[navigation.stepIndex]) {
4270
4587
  // If we have more steps, bind them one by one:
4271
- navigation.mouseMoveEvent = navigation.nextEvent =
4272
- selectedButton.steps[navigation.stepIndex];
4588
+ navigation.mouseMoveEvent = navigation.nextEvent = selectedButton.steps[navigation.stepIndex];
4273
4589
  }
4274
4590
  else {
4275
4591
  fireEvent(navigation, 'deselectButton', { button: navigation.selectedButtonElement });
@@ -4403,10 +4719,10 @@
4403
4719
  * @param {string} key
4404
4720
  * Option name, for example "visible" or "x", "y"
4405
4721
  *
4406
- * @param {object} parentEditables
4722
+ * @param {Object} parentEditables
4407
4723
  * Editables from NavigationBindings.annotationsEditable
4408
4724
  *
4409
- * @param {object} parent
4725
+ * @param {Object} parent
4410
4726
  * Where new options will be assigned
4411
4727
  */
4412
4728
  function traverse(option, key, parentEditables, parent) {
@@ -4447,7 +4763,9 @@
4447
4763
  parent[key] = nextParent;
4448
4764
  }
4449
4765
  objectEach(option, function (nestedOption, nestedKey) {
4450
- traverse(nestedOption, nestedKey, key === 0 ? parentEditables : nestedEditables[key], nextParent);
4766
+ traverse(nestedOption, nestedKey, key === 0 ?
4767
+ parentEditables :
4768
+ nestedEditables[key], nextParent);
4451
4769
  });
4452
4770
  }
4453
4771
  else {
@@ -4486,14 +4804,14 @@
4486
4804
  *
4487
4805
  * @function Highcharts.NavigationBindings#getClickedClassNames
4488
4806
  *
4489
- * @param {Highcharts.HTMLDOMElement}
4490
- * Container that event is bound to.
4807
+ * @param {Highcharts.HTMLDOMElement} container
4808
+ * Container that event is bound to.
4491
4809
  *
4492
4810
  * @param {global.Event} event
4493
- * Browser's event.
4811
+ * Browser's event.
4494
4812
  *
4495
4813
  * @return {Array<Array<string, Highcharts.HTMLDOMElement>>}
4496
- * Array of class names with corresponding elements
4814
+ * Array of class names with corresponding elements
4497
4815
  */
4498
4816
  NavigationBindings.prototype.getClickedClassNames = function (container, event) {
4499
4817
  var element = event.target,
@@ -4531,7 +4849,7 @@
4531
4849
  * @param {global.Event} event
4532
4850
  * Browser's event.
4533
4851
  *
4534
- * @return {object}
4852
+ * @return {Object}
4535
4853
  * Object with events (init, start, steps, and end)
4536
4854
  */
4537
4855
  NavigationBindings.prototype.getButtonEvents = function (container, event) {
@@ -4602,6 +4920,7 @@
4602
4920
  },
4603
4921
  // Simple shapes:
4604
4922
  circle: ['shapes'],
4923
+ ellipse: ['shapes'],
4605
4924
  verticalLine: [],
4606
4925
  label: ['labelOptions'],
4607
4926
  // Measure
@@ -4618,7 +4937,9 @@
4618
4937
  // Define non editable fields per annotation, for example Rectangle inherits
4619
4938
  // options from Measure, but crosshairs are not available
4620
4939
  NavigationBindings.annotationsNonEditable = {
4621
- rectangle: ['crosshairX', 'crosshairY', 'label']
4940
+ rectangle: ['crosshairX', 'crosshairY', 'labelOptions'],
4941
+ ellipse: ['labelOptions'],
4942
+ circle: ['labelOptions']
4622
4943
  };
4623
4944
  return NavigationBindings;
4624
4945
  }());
@@ -4695,10 +5016,10 @@
4695
5016
  if (annotation.options.type === 'measure') {
4696
5017
  // Manually disable crooshars according to
4697
5018
  // stroke width of the shape:
4698
- typeOptions.crosshairY.enabled =
4699
- typeOptions.crosshairY.strokeWidth !== 0;
4700
- typeOptions.crosshairX.enabled =
4701
- typeOptions.crosshairX.strokeWidth !== 0;
5019
+ typeOptions.crosshairY.enabled = (typeOptions.crosshairY
5020
+ .strokeWidth !== 0);
5021
+ typeOptions.crosshairX.enabled = (typeOptions.crosshairX
5022
+ .strokeWidth !== 0);
4702
5023
  }
4703
5024
  annotation.update(config);
4704
5025
  }
@@ -4735,7 +5056,6 @@
4735
5056
  * Configure the Popup strings in the chart. Requires the
4736
5057
  * `annotations.js` or `annotations-advanced.src.js` module to be
4737
5058
  * loaded.
4738
- *
4739
5059
  * @since 7.0.0
4740
5060
  * @product highcharts highstock
4741
5061
  */
@@ -4749,6 +5069,7 @@
4749
5069
  simpleShapes: 'Simple shapes',
4750
5070
  lines: 'Lines',
4751
5071
  circle: 'Circle',
5072
+ ellipse: 'Ellipse',
4752
5073
  rectangle: 'Rectangle',
4753
5074
  label: 'Label',
4754
5075
  shapeOptions: 'Shape options',
@@ -4809,9 +5130,16 @@
4809
5130
  * - `end`: last event to be called after last step event
4810
5131
  *
4811
5132
  * @type {Highcharts.Dictionary<Highcharts.NavigationBindingsOptionsObject>|*}
4812
- * @sample stock/stocktools/stocktools-thresholds
4813
- * Custom bindings in Highcharts Stock
5133
+ *
5134
+ * @sample {highstock} stock/stocktools/stocktools-thresholds
5135
+ * Custom bindings
5136
+ * @sample {highcharts} highcharts/annotations/bindings/
5137
+ * Simple binding
5138
+ * @sample {highcharts} highcharts/annotations/bindings-custom-annotation/
5139
+ * Custom annotation binding
5140
+ *
4814
5141
  * @since 7.0.0
5142
+ * @requires modules/annotations
4815
5143
  * @product highcharts highstock
4816
5144
  */
4817
5145
  bindings: {
@@ -4848,10 +5176,7 @@
4848
5176
  },
4849
5177
  r: 5
4850
5178
  }]
4851
- }, navigation
4852
- .annotationsOptions, navigation
4853
- .bindings
4854
- .circleAnnotation
5179
+ }, navigation.annotationsOptions, navigation.bindings.circleAnnotation
4855
5180
  .annotationsOptions));
4856
5181
  },
4857
5182
  /** @ignore-option */
@@ -4859,16 +5184,14 @@
4859
5184
  function (e, annotation) {
4860
5185
  var mockPointOpts = annotation.options.shapes[0]
4861
5186
  .point,
4862
- inverted = this.chart.inverted,
4863
- x,
4864
- y,
4865
5187
  distance;
4866
5188
  if (isNumber(mockPointOpts.xAxis) &&
4867
5189
  isNumber(mockPointOpts.yAxis)) {
4868
- x = this.chart.xAxis[mockPointOpts.xAxis]
4869
- .toPixels(mockPointOpts.x);
4870
- y = this.chart.yAxis[mockPointOpts.yAxis]
4871
- .toPixels(mockPointOpts.y);
5190
+ var inverted = this.chart.inverted,
5191
+ x = this.chart.xAxis[mockPointOpts.xAxis]
5192
+ .toPixels(mockPointOpts.x),
5193
+ y = this.chart.yAxis[mockPointOpts.yAxis]
5194
+ .toPixels(mockPointOpts.y);
4872
5195
  distance = Math.max(Math.sqrt(Math.pow(inverted ? y - e.chartX : x - e.chartX, 2) +
4873
5196
  Math.pow(inverted ? x - e.chartY : y - e.chartY, 2)), 5);
4874
5197
  }
@@ -4880,6 +5203,59 @@
4880
5203
  }
4881
5204
  ]
4882
5205
  },
5206
+ ellipseAnnotation: {
5207
+ className: 'highcharts-ellipse-annotation',
5208
+ start: function (e) {
5209
+ var coords = this.chart.pointer.getCoordinates(e),
5210
+ coordsX = this.utils.getAssignedAxis(coords.xAxis),
5211
+ coordsY = this.utils.getAssignedAxis(coords.yAxis),
5212
+ navigation = this.chart.options.navigation;
5213
+ if (!coordsX || !coordsY) {
5214
+ return;
5215
+ }
5216
+ return this.chart.addAnnotation(merge({
5217
+ langKey: 'ellipse',
5218
+ type: 'basicAnnotation',
5219
+ shapes: [
5220
+ {
5221
+ type: 'ellipse',
5222
+ xAxis: coordsX.axis.options.index,
5223
+ yAxis: coordsY.axis.options.index,
5224
+ points: [{
5225
+ x: coordsX.value,
5226
+ y: coordsY.value
5227
+ }, {
5228
+ x: coordsX.value,
5229
+ y: coordsY.value
5230
+ }],
5231
+ ry: 1
5232
+ }
5233
+ ]
5234
+ }, navigation.annotationsOptions, navigation.bindings.ellipseAnnotation
5235
+ .annotationOptions));
5236
+ },
5237
+ steps: [
5238
+ function (e, annotation) {
5239
+ var target = annotation.shapes[0],
5240
+ position = target.getAbsolutePosition(target.points[1]);
5241
+ target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
5242
+ target.redraw(false);
5243
+ },
5244
+ function (e, annotation) {
5245
+ var target = annotation.shapes[0],
5246
+ position = target.getAbsolutePosition(target.points[0]),
5247
+ position2 = target.getAbsolutePosition(target.points[1]),
5248
+ newR = target.getDistanceFromLine(position,
5249
+ position2,
5250
+ e.chartX,
5251
+ e.chartY),
5252
+ yAxis = target.getYAxis(),
5253
+ newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
5254
+ target.setYRadius(newRY);
5255
+ target.redraw(false);
5256
+ }
5257
+ ]
5258
+ },
4883
5259
  /**
4884
5260
  * A rectangle annotation bindings. Includes `start` and one event
4885
5261
  * in `steps` array.
@@ -4913,7 +5289,8 @@
4913
5289
  { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
4914
5290
  { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
4915
5291
  { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
4916
- { xAxis: xAxis, yAxis: yAxis, x: x, y: y }
5292
+ { xAxis: xAxis, yAxis: yAxis, x: x, y: y },
5293
+ { command: 'Z' }
4917
5294
  ]
4918
5295
  }]
4919
5296
  }, navigation
@@ -4998,7 +5375,7 @@
4998
5375
  * from a different server.
4999
5376
  *
5000
5377
  * @type {string}
5001
- * @default https://code.highcharts.com/9.2.2/gfx/stock-icons/
5378
+ * @default https://code.highcharts.com/9.3.3/gfx/stock-icons/
5002
5379
  * @since 7.1.3
5003
5380
  * @apioption navigation.iconsURL
5004
5381
  */
@@ -5054,6 +5431,7 @@
5054
5431
  * @extends annotations
5055
5432
  * @exclude crookedLine, elliottWave, fibonacci, infinityLine,
5056
5433
  * measure, pitchfork, tunnel, verticalLine, basicAnnotation
5434
+ * @requires modules/annotations
5057
5435
  * @apioption navigation.annotationsOptions
5058
5436
  */
5059
5437
  annotationsOptions: {
@@ -5080,28 +5458,29 @@
5080
5458
  if (chart.navigationBindings &&
5081
5459
  chart.navigationBindings.container &&
5082
5460
  chart.navigationBindings.container[0]) {
5083
- // Get the HTML element coresponding to the
5084
- // className taken from StockToolsBindings.
5085
- var buttonNode = chart.navigationBindings.container[0].querySelectorAll('.' + key);
5461
+ // Get the HTML element coresponding to the className taken
5462
+ // from StockToolsBindings.
5463
+ var buttonNode = chart.navigationBindings.container[0]
5464
+ .querySelectorAll('.' + key);
5086
5465
  if (buttonNode) {
5087
5466
  for (var i = 0; i < buttonNode.length; i++) {
5088
- var button = buttonNode[i];
5467
+ var button = buttonNode[i],
5468
+ cls = button.className;
5089
5469
  if (value.noDataState === 'normal') {
5090
- // If button has noDataState: 'normal',
5091
- // and has disabledClassName,
5092
- // remove this className.
5093
- if (button.className.indexOf(disabledClassName) !== -1) {
5470
+ // If button has noDataState: 'normal', and has
5471
+ // disabledClassName, remove this className.
5472
+ if (cls.indexOf(disabledClassName) !== -1) {
5094
5473
  button.classList.remove(disabledClassName);
5095
5474
  }
5096
5475
  }
5097
5476
  else if (!buttonsEnabled_1) {
5098
- if (button.className.indexOf(disabledClassName) === -1) {
5477
+ if (cls.indexOf(disabledClassName) === -1) {
5099
5478
  button.className += ' ' + disabledClassName;
5100
5479
  }
5101
5480
  }
5102
5481
  else {
5103
5482
  // Enable all buttons by deleting the className.
5104
- if (button.className.indexOf(disabledClassName) !== -1) {
5483
+ if (cls.indexOf(disabledClassName) !== -1) {
5105
5484
  button.classList.remove(disabledClassName);
5106
5485
  }
5107
5486
  }
@@ -5117,7 +5496,7 @@
5117
5496
 
5118
5497
  return NavigationBindings;
5119
5498
  });
5120
- _registerModule(_modules, 'Extensions/Annotations/Popup.js', [_modules['Core/Globals.js'], _modules['Extensions/Annotations/NavigationBindings.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']], function (H, NavigationBindings, D, Pointer, U) {
5499
+ _registerModule(_modules, 'Extensions/Annotations/Popup.js', [_modules['Core/Renderer/HTML/AST.js'], _modules['Core/Globals.js'], _modules['Extensions/Annotations/NavigationBindings.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']], function (AST, H, NavigationBindings, D, Pointer, U) {
5121
5500
  /* *
5122
5501
  *
5123
5502
  * Popup generator for Stock tools
@@ -5138,20 +5517,34 @@
5138
5517
  fireEvent = U.fireEvent,
5139
5518
  isArray = U.isArray,
5140
5519
  isObject = U.isObject,
5141
- isString = U.isString,
5142
5520
  objectEach = U.objectEach,
5143
5521
  pick = U.pick,
5144
5522
  stableSort = U.stableSort,
5145
5523
  wrap = U.wrap;
5146
- 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';
5524
+ 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';
5525
+ /**
5526
+ * Enum for properties which should have dropdown list.
5527
+ * @private
5528
+ */
5529
+ var DropdownProperties;
5530
+ (function (DropdownProperties) {
5531
+ DropdownProperties[DropdownProperties["params.algorithm"] = 0] = "params.algorithm";
5532
+ DropdownProperties[DropdownProperties["params.average"] = 1] = "params.average";
5533
+ })(DropdownProperties || (DropdownProperties = {}));
5534
+ /**
5535
+ * List of available algorithms for the specific indicator.
5536
+ * @private
5537
+ */
5538
+ var dropdownParameters = {
5539
+ 'algorithm-pivotpoints': ['standard', 'fibonacci', 'camarilla'],
5540
+ 'average-disparityindex': ['sma', 'ema', 'dema', 'tema', 'wma']
5541
+ };
5147
5542
  /* eslint-disable no-invalid-this, valid-jsdoc */
5148
5543
  // onContainerMouseDown blocks internal popup events, due to e.preventDefault.
5149
5544
  // Related issue #4606
5150
5545
  wrap(Pointer.prototype, 'onContainerMouseDown', function (proceed, e) {
5151
- var popupClass = e.target && e.target.className;
5152
5546
  // elements is not in popup
5153
- if (!(isString(popupClass) &&
5154
- popupClass.indexOf(PREFIX + 'popup-field') >= 0)) {
5547
+ if (!this.inClass(e.target, PREFIX + 'popup')) {
5155
5548
  proceed.apply(this, Array.prototype.slice.call(arguments, 1));
5156
5549
  }
5157
5550
  });
@@ -5172,7 +5565,22 @@
5172
5565
  // create popup div
5173
5566
  this.container = createElement(DIV, {
5174
5567
  className: PREFIX + 'popup highcharts-no-tooltip'
5175
- }, null, parentDiv);
5568
+ }, void 0, parentDiv);
5569
+ addEvent(this.container, 'mousedown', function () {
5570
+ var activeAnnotation = chart &&
5571
+ chart.navigationBindings &&
5572
+ chart.navigationBindings.activeAnnotation;
5573
+ if (activeAnnotation) {
5574
+ activeAnnotation.cancelClick = true;
5575
+ var unbind_1 = addEvent(H.doc, 'click',
5576
+ function () {
5577
+ setTimeout(function () {
5578
+ activeAnnotation.cancelClick = false;
5579
+ }, 0);
5580
+ unbind_1();
5581
+ });
5582
+ }
5583
+ });
5176
5584
  this.lang = this.getLangpack();
5177
5585
  this.iconsURL = iconsURL;
5178
5586
  // add close button
@@ -5189,7 +5597,7 @@
5189
5597
  // create close popup btn
5190
5598
  closeBtn = createElement(DIV, {
5191
5599
  className: PREFIX + 'popup-close'
5192
- }, null, this.container);
5600
+ }, void 0, this.container);
5193
5601
  closeBtn.style['background-image'] = 'url(' +
5194
5602
  (iconsURL.match(/png|svg|jpeg|jpg|gif/ig) ?
5195
5603
  iconsURL : iconsURL + 'close.svg') + ')';
@@ -5218,15 +5626,15 @@
5218
5626
  // left column
5219
5627
  lhsCol = createElement(DIV, {
5220
5628
  className: PREFIX + 'popup-lhs-col'
5221
- }, null, container);
5629
+ }, void 0, container);
5222
5630
  // right column
5223
5631
  rhsCol = createElement(DIV, {
5224
5632
  className: PREFIX + 'popup-rhs-col'
5225
- }, null, container);
5633
+ }, void 0, container);
5226
5634
  // wrapper content
5227
5635
  createElement(DIV, {
5228
5636
  className: PREFIX + 'popup-rhs-col-wrapper'
5229
- }, null, rhsCol);
5637
+ }, void 0, rhsCol);
5230
5638
  return {
5231
5639
  lhsCol: lhsCol,
5232
5640
  rhsCol: rhsCol
@@ -5234,34 +5642,43 @@
5234
5642
  },
5235
5643
  /**
5236
5644
  * Create input with label.
5645
+ *
5237
5646
  * @private
5647
+ *
5238
5648
  * @param {string} option
5239
- * Chain of fields i.e params.styles.fontSize
5240
- * @param {string} type
5241
- * Indicator type
5242
- * @param {Highhcharts.HTMLDOMElement}
5243
- * Container where elements should be added
5244
- * @param {string} value
5245
- * Default value of input i.e period value is 14, extracted from
5246
- * defaultOptions (ADD mode) or series options (EDIT mode)
5649
+ * Chain of fields i.e params.styles.fontSize separeted by the dot.
5650
+ *
5651
+ * @param {string} indicatorType
5652
+ * Type of the indicator i.e. sma, ema...
5653
+ *
5654
+ * @param {HTMLDOMElement} parentDiv
5655
+ * HTML parent element.
5656
+ *
5657
+ * @param {Highcharts.InputAttributes} inputAttributes
5658
+ * Attributes of the input.
5659
+ *
5660
+ * @return {HTMLInputElement}
5661
+ * Return created input element.
5247
5662
  */
5248
- addInput: function (option, type, parentDiv, value) {
5249
- var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX + type + '-' + optionName;
5663
+ addInput: function (option, indicatorType, parentDiv, inputAttributes) {
5664
+ var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX + indicatorType + '-' + pick(inputAttributes.htmlFor, optionName);
5665
+ var input;
5250
5666
  if (!inputName.match(indexFilter)) {
5251
5667
  // add label
5252
5668
  createElement(LABEL, {
5253
- htmlFor: inputName
5669
+ htmlFor: inputName,
5670
+ className: inputAttributes.labelClassName
5254
5671
  }, void 0, parentDiv).appendChild(doc.createTextNode(lang[optionName] || optionName));
5255
5672
  }
5256
5673
  // add input
5257
- if (value !== '') {
5258
- createElement(INPUT, {
5259
- name: inputName,
5260
- value: value[0],
5261
- type: value[1],
5262
- className: PREFIX + 'popup-field'
5263
- }, void 0, parentDiv).setAttribute(PREFIX + 'data-name', option);
5264
- }
5674
+ input = createElement(INPUT, {
5675
+ name: inputName,
5676
+ value: inputAttributes.value,
5677
+ type: inputAttributes.type,
5678
+ className: PREFIX + 'popup-field'
5679
+ }, void 0, parentDiv);
5680
+ input.setAttribute(PREFIX + 'data-name', option);
5681
+ return input;
5265
5682
  },
5266
5683
  /**
5267
5684
  * Create button.
@@ -5279,38 +5696,44 @@
5279
5696
  * @return {Highcharts.HTMLDOMElement}
5280
5697
  * HTML button
5281
5698
  */
5282
- addButton: function (parentDiv, label, type, callback, fieldsDiv) {
5699
+ addButton: function (parentDiv, label, type, fieldsDiv, callback) {
5283
5700
  var _self = this,
5284
5701
  closePopup = this.closePopup,
5285
5702
  getFields = this.getFields,
5286
5703
  button;
5287
5704
  button = createElement(BUTTON, void 0, void 0, parentDiv);
5288
5705
  button.appendChild(doc.createTextNode(label));
5289
- ['click', 'touchstart'].forEach(function (eventName) {
5290
- addEvent(button, eventName, function () {
5291
- closePopup.call(_self);
5292
- return callback(getFields(fieldsDiv, type));
5706
+ if (callback) {
5707
+ ['click', 'touchstart'].forEach(function (eventName) {
5708
+ addEvent(button, eventName, function () {
5709
+ closePopup.call(_self);
5710
+ return callback(getFields(fieldsDiv, type));
5711
+ });
5293
5712
  });
5294
- });
5713
+ }
5295
5714
  return button;
5296
5715
  },
5297
5716
  /**
5298
- * Get values from all inputs and create JSON.
5717
+ * Get values from all inputs and selections then create JSON.
5718
+ *
5299
5719
  * @private
5300
- * @param {Highcharts.HTMLDOMElement} - container where inputs are created
5301
- * @param {string} - add | edit | remove
5302
- * @return {Highcharts.PopupFieldsObject} - fields
5720
+ *
5721
+ * @param {Highcharts.HTMLDOMElement} parentDiv
5722
+ * The container where inputs and selections are created.
5723
+ *
5724
+ * @param {string} type
5725
+ * Type of the popup bookmark (add|edit|remove).
5303
5726
  */
5304
5727
  getFields: function (parentDiv, type) {
5305
- 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;
5728
+ 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];
5729
+ var fieldsOutput;
5306
5730
  fieldsOutput = {
5307
5731
  actionType: type,
5308
- linkedTo: linkedTo && linkedTo.getAttribute('value'),
5732
+ linkedTo: linkedTo && linkedTo.getAttribute('value') || '',
5309
5733
  fields: {}
5310
5734
  };
5311
- [].forEach.call(inputList, function (input) {
5312
- param = input.getAttribute(PREFIX + 'data-name');
5313
- seriesId = input.getAttribute(PREFIX + 'data-series-id');
5735
+ inputList.forEach(function (input) {
5736
+ var param = input.getAttribute(PREFIX + 'data-name'), seriesId = input.getAttribute(PREFIX + 'data-series-id');
5314
5737
  // params
5315
5738
  if (seriesId) {
5316
5739
  fieldsOutput.seriesId = input.value;
@@ -5323,8 +5746,18 @@
5323
5746
  fieldsOutput.type = input.value;
5324
5747
  }
5325
5748
  });
5749
+ selectList.forEach(function (select) {
5750
+ var id = select.id;
5751
+ // Get inputs only for the parameters, not for series and volume.
5752
+ if (id !== PREFIX + 'select-series' &&
5753
+ id !== PREFIX + 'select-volume') {
5754
+ var parameter = id.split('highcharts-select-')[1];
5755
+ fieldsOutput.fields[parameter] = select.value;
5756
+ }
5757
+ });
5326
5758
  if (volumeTo) {
5327
- fieldsOutput.fields['params.volumeSeriesID'] = volumeTo.getAttribute('value');
5759
+ fieldsOutput.fields['params.volumeSeriesID'] = volumeTo
5760
+ .getAttribute('value') || '';
5328
5761
  }
5329
5762
  return fieldsOutput;
5330
5763
  },
@@ -5339,7 +5772,7 @@
5339
5772
  .querySelectorAll('.' + PREFIX + 'popup-close')[0];
5340
5773
  this.formType = void 0;
5341
5774
  // reset content
5342
- popupDiv.innerHTML = '';
5775
+ popupDiv.innerHTML = AST.emptyHTML;
5343
5776
  // reset toolbar styles if exists
5344
5777
  if (popupDiv.className.indexOf(toolbarClass) >= 0) {
5345
5778
  popupDiv.classList.remove(toolbarClass);
@@ -5434,13 +5867,13 @@
5434
5867
  // Basic shapes:
5435
5868
  options.shapes && options.shapes[0].type)));
5436
5869
  // add buttons
5437
- button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove', callback, popupDiv);
5870
+ button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove', popupDiv, callback);
5438
5871
  button.className += ' ' + PREFIX + 'annotation-remove-button';
5439
5872
  button.style['background-image'] = 'url(' +
5440
5873
  this.iconsURL + 'destroy.svg)';
5441
- button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', function () {
5874
+ button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', popupDiv, function () {
5442
5875
  showForm.call(_self, 'annotation-edit', chart, options, callback);
5443
- }, popupDiv);
5876
+ });
5444
5877
  button.className += ' ' + PREFIX + 'annotation-edit-button';
5445
5878
  button.style['background-image'] = 'url(' +
5446
5879
  this.iconsURL + 'edit.svg)';
@@ -5473,15 +5906,15 @@
5473
5906
  lhsCol.appendChild(doc.createTextNode(lang[options.langKey] || options.langKey || ''));
5474
5907
  // left column
5475
5908
  lhsCol = createElement(DIV, {
5476
- className: PREFIX + 'popup-lhs-col ' + PREFIX + 'popup-lhs-full'
5477
- }, null, popupDiv);
5909
+ className: (PREFIX + 'popup-lhs-col ' + PREFIX + 'popup-lhs-full')
5910
+ }, void 0, popupDiv);
5478
5911
  bottomRow = createElement(DIV, {
5479
5912
  className: PREFIX + 'popup-bottom-row'
5480
- }, null, popupDiv);
5913
+ }, void 0, popupDiv);
5481
5914
  this.annotations.addFormFields.call(this, lhsCol, chart, '', options, [], true);
5482
5915
  this.addButton(bottomRow, isInit ?
5483
5916
  (lang.addButton || 'add') :
5484
- (lang.saveButton || 'save'), isInit ? 'add' : 'save', callback, popupDiv);
5917
+ (lang.saveButton || 'save'), isInit ? 'add' : 'save', popupDiv, callback);
5485
5918
  },
5486
5919
  /**
5487
5920
  * Create annotation's form fields.
@@ -5554,6 +5987,10 @@
5554
5987
  }, void 0, genInput[2]).appendChild(doc.createTextNode(genInput[1]));
5555
5988
  }
5556
5989
  else {
5990
+ genInput[4] = {
5991
+ value: genInput[4][0],
5992
+ type: genInput[4][1]
5993
+ };
5557
5994
  addInput.apply(genInput[0], genInput.splice(1));
5558
5995
  }
5559
5996
  });
@@ -5581,138 +6018,435 @@
5581
6018
  .querySelectorAll('.' + PREFIX + 'tab-item-content');
5582
6019
  // ADD tab
5583
6020
  this.addColsContainer(tabsContainers[0]);
6021
+ indicators.addSearchBox.call(this, chart, tabsContainers[0]);
5584
6022
  indicators.addIndicatorList.call(this, chart, tabsContainers[0], 'add');
5585
6023
  buttonParentDiv = tabsContainers[0]
5586
6024
  .querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
5587
- this.addButton(buttonParentDiv, lang.addButton || 'add', 'add', callback, buttonParentDiv);
6025
+ this.addButton(buttonParentDiv, lang.addButton || 'add', 'add', buttonParentDiv, callback);
5588
6026
  // EDIT tab
5589
6027
  this.addColsContainer(tabsContainers[1]);
5590
6028
  indicators.addIndicatorList.call(this, chart, tabsContainers[1], 'edit');
5591
6029
  buttonParentDiv = tabsContainers[1]
5592
6030
  .querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
5593
- this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit', callback, buttonParentDiv);
5594
- this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove', callback, buttonParentDiv);
6031
+ this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit', buttonParentDiv, callback);
6032
+ this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove', buttonParentDiv, callback);
6033
+ },
6034
+ /**
6035
+ * Filter object of series which are not indicators.
6036
+ * If the filter string exists, check against it.
6037
+ *
6038
+ * @private
6039
+ *
6040
+ * @param {Highcharts.FilteredSeries} series
6041
+ * All series are available in the plotOptions.
6042
+ *
6043
+ * @param {string|undefined} filter
6044
+ * Applied filter string from the input.
6045
+ * For the first iteration, it's an empty string.
6046
+ *
6047
+ * @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
6048
+ * Returns array of filtered series based on filter string.
6049
+ */
6050
+ filterSeries: function (series, filter) {
6051
+ var popup = this,
6052
+ indicators = popup.indicators,
6053
+ lang = popup.chart && popup.chart.options.lang,
6054
+ indicatorAliases = lang &&
6055
+ lang.navigation &&
6056
+ lang.navigation.popup &&
6057
+ lang.navigation.popup.indicatorAliases;
6058
+ var filteredSeriesArray = [],
6059
+ filteredSeries;
6060
+ objectEach(series, function (series, value) {
6061
+ var seriesOptions = series.options;
6062
+ // Allow only indicators.
6063
+ if (series.params || seriesOptions &&
6064
+ seriesOptions.params) {
6065
+ var _a = indicators.getNameType(series,
6066
+ value),
6067
+ indicatorFullName = _a.indicatorFullName,
6068
+ indicatorType = _a.indicatorType;
6069
+ if (filter) {
6070
+ // Replace invalid characters.
6071
+ var validFilter = filter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
6072
+ var regex = new RegExp(validFilter, 'i'),
6073
+ alias = indicatorAliases &&
6074
+ indicatorAliases[indicatorType] &&
6075
+ indicatorAliases[indicatorType].join(' ') || '';
6076
+ if (indicatorFullName.match(regex) ||
6077
+ alias.match(regex)) {
6078
+ filteredSeries = {
6079
+ indicatorFullName: indicatorFullName,
6080
+ indicatorType: indicatorType,
6081
+ series: series
6082
+ };
6083
+ filteredSeriesArray.push(filteredSeries);
6084
+ }
6085
+ }
6086
+ else {
6087
+ filteredSeries = {
6088
+ indicatorFullName: indicatorFullName,
6089
+ indicatorType: indicatorType,
6090
+ series: series
6091
+ };
6092
+ filteredSeriesArray.push(filteredSeries);
6093
+ }
6094
+ }
6095
+ });
6096
+ return filteredSeriesArray;
6097
+ },
6098
+ /**
6099
+ * Filter an array of series and map its names and types.
6100
+ *
6101
+ * @private
6102
+ *
6103
+ * @param {Highcharts.FilteredSeries} series
6104
+ * All series that are available in the plotOptions.
6105
+ *
6106
+ * @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
6107
+ * Returns array of filtered series based on filter string.
6108
+ */
6109
+ filterSeriesArray: function (series) {
6110
+ var filteredSeriesArray = [],
6111
+ filteredSeries;
6112
+ // Allow only indicators.
6113
+ series.forEach(function (series) {
6114
+ var seriesOptions = series.options;
6115
+ if (series.is('sma')) {
6116
+ filteredSeries = {
6117
+ indicatorFullName: series.name,
6118
+ indicatorType: series.type,
6119
+ series: series
6120
+ };
6121
+ filteredSeriesArray.push(filteredSeries);
6122
+ }
6123
+ });
6124
+ return filteredSeriesArray;
5595
6125
  },
5596
6126
  /**
5597
6127
  * Create HTML list of all indicators (ADD mode) or added indicators
5598
6128
  * (EDIT mode).
6129
+ *
5599
6130
  * @private
6131
+ *
6132
+ * @param {Highcharts.AnnotationChart} chart
6133
+ * The chart object.
6134
+ *
6135
+ * @param {string} [optionName]
6136
+ * Name of the option into which selection is being added.
6137
+ *
6138
+ * @param {HTMLDOMElement} [parentDiv]
6139
+ * HTML parent element.
6140
+ *
6141
+ * @param {string} listType
6142
+ * Type of list depending on the selected bookmark.
6143
+ * Might be 'add' or 'edit'.
6144
+ *
6145
+ * @param {string|undefined} filter
6146
+ * Applied filter string from the input.
6147
+ * For the first iteration, it's an empty string.
5600
6148
  */
5601
- addIndicatorList: function (chart, parentDiv, listType) {
5602
- var _self = this, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], rhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0], isEdit = listType === 'edit', series = (isEdit ?
6149
+ addIndicatorList: function (chart, parentDiv, listType, filter) {
6150
+ 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 ?
5603
6151
  chart.series : // EDIT mode
5604
- chart.options.plotOptions // ADD mode
5605
- ), addFormFields = this.indicators.addFormFields, rhsColWrapper, indicatorList, item;
5606
- if (!chart) {
6152
+ chart.options.plotOptions || {} // ADD mode
6153
+ );
6154
+ if (!chart && series) {
5607
6155
  return;
5608
6156
  }
5609
- // create wrapper for list
6157
+ var rhsColWrapper,
6158
+ indicatorList,
6159
+ item,
6160
+ filteredSeriesArray = [];
6161
+ // Filter and sort the series.
6162
+ if (!isEdit && !isArray(series)) {
6163
+ // Apply filters only for the 'add' indicator list.
6164
+ filteredSeriesArray = indicators.filterSeries.call(this, series, filter);
6165
+ }
6166
+ else if (isArray(series)) {
6167
+ filteredSeriesArray = indicators.filterSeriesArray.call(this, series);
6168
+ }
6169
+ // Sort indicators alphabeticaly.
6170
+ stableSort(filteredSeriesArray, function (a, b) {
6171
+ var seriesAName = a.indicatorFullName.toLowerCase(),
6172
+ seriesBName = b.indicatorFullName.toLowerCase();
6173
+ return (seriesAName < seriesBName) ?
6174
+ -1 : (seriesAName > seriesBName) ? 1 : 0;
6175
+ });
6176
+ // If the list exists remove it from the DOM
6177
+ // in order to create a new one with different filters.
6178
+ if (lhsCol.children[1]) {
6179
+ lhsCol.children[1].remove();
6180
+ }
6181
+ // Create wrapper for list.
5610
6182
  indicatorList = createElement(UL, {
5611
6183
  className: PREFIX + 'indicator-list'
5612
- }, null, lhsCol);
5613
- rhsColWrapper = rhsCol
5614
- .querySelectorAll('.' + PREFIX + 'popup-rhs-col-wrapper')[0];
5615
- objectEach(series, function (serie, value) {
5616
- var seriesOptions = serie.options;
5617
- if (serie.params ||
5618
- seriesOptions && seriesOptions.params) {
5619
- var indicatorNameType_1 = _self.indicators.getNameType(serie,
5620
- value),
5621
- indicatorType_1 = indicatorNameType_1.type;
5622
- item = createElement(LI, {
5623
- className: PREFIX + 'indicator-list'
5624
- }, void 0, indicatorList);
5625
- item.appendChild(doc.createTextNode(indicatorNameType_1.name));
5626
- ['click', 'touchstart'].forEach(function (eventName) {
5627
- addEvent(item, eventName, function () {
5628
- addFormFields.call(_self, chart, isEdit ? serie : series[indicatorType_1], indicatorNameType_1.type, rhsColWrapper);
5629
- // add hidden input with series.id
5630
- if (isEdit && serie.options) {
5631
- createElement(INPUT, {
5632
- type: 'hidden',
5633
- name: PREFIX + 'id-' + indicatorType_1,
5634
- value: serie.options.id
5635
- }, null, rhsColWrapper)
5636
- .setAttribute(PREFIX + 'data-series-id', serie.options.id);
5637
- }
5638
- });
6184
+ }, void 0, lhsCol);
6185
+ rhsColWrapper = rhsCol.querySelectorAll('.' + PREFIX + 'popup-rhs-col-wrapper')[0];
6186
+ filteredSeriesArray.forEach(function (seriesSet) {
6187
+ var indicatorFullName = seriesSet.indicatorFullName,
6188
+ indicatorType = seriesSet.indicatorType,
6189
+ series = seriesSet.series;
6190
+ item = createElement(LI, {
6191
+ className: PREFIX + 'indicator-list'
6192
+ }, void 0, indicatorList);
6193
+ item.appendChild(doc.createTextNode(indicatorFullName));
6194
+ ['click', 'touchstart'].forEach(function (eventName) {
6195
+ addEvent(item, eventName, function () {
6196
+ var button = rhsColWrapper.parentNode
6197
+ .children[1];
6198
+ addFormFields.call(popup, chart, series, indicatorType, rhsColWrapper);
6199
+ if (button) {
6200
+ button.style.display = 'block';
6201
+ }
6202
+ // add hidden input with series.id
6203
+ if (isEdit && series.options) {
6204
+ createElement(INPUT, {
6205
+ type: 'hidden',
6206
+ name: PREFIX + 'id-' + indicatorType,
6207
+ value: series.options.id
6208
+ }, void 0, rhsColWrapper).setAttribute(PREFIX + 'data-series-id', series.options.id);
6209
+ }
5639
6210
  });
5640
- }
6211
+ });
5641
6212
  });
5642
6213
  // select first item from the list
5643
6214
  if (indicatorList.childNodes.length > 0) {
5644
6215
  indicatorList.childNodes[0].click();
5645
6216
  }
6217
+ else if (!isEdit) {
6218
+ AST.setElementHTML(rhsColWrapper.parentNode.children[0], lang.noFilterMatch || '');
6219
+ rhsColWrapper.parentNode.children[1]
6220
+ .style.display = 'none';
6221
+ }
6222
+ },
6223
+ /**
6224
+ * Add searchbox HTML element and its' label.
6225
+ *
6226
+ * @private
6227
+ *
6228
+ * @param {Highcharts.AnnotationChart} chart
6229
+ * The chart object.
6230
+ *
6231
+ * @param {HTMLDOMElement} parentDiv
6232
+ * HTML parent element.
6233
+ */
6234
+ addSearchBox: function (chart, parentDiv) {
6235
+ var popup = this, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], options = 'searchIndicators', inputAttributes = {
6236
+ value: '',
6237
+ type: 'text',
6238
+ htmlFor: 'search-indicators',
6239
+ labelClassName: 'highcharts-input-search-indicators-label'
6240
+ }, clearFilterText = this.lang.clearFilter, inputWrapper = createElement(DIV, {
6241
+ className: 'highcharts-input-wrapper'
6242
+ }, void 0, lhsCol);
6243
+ var handleInputChange = function (inputText) {
6244
+ // Apply some filters.
6245
+ popup.indicators.addIndicatorList.call(popup,
6246
+ chart,
6247
+ popup.container, 'add',
6248
+ inputText);
6249
+ };
6250
+ // Add input field with the label and button.
6251
+ var input = this.addInput(options,
6252
+ INPUT,
6253
+ inputWrapper,
6254
+ inputAttributes),
6255
+ button = createElement(A, {
6256
+ textContent: clearFilterText
6257
+ },
6258
+ void 0,
6259
+ inputWrapper);
6260
+ input.classList.add('highcharts-input-search-indicators');
6261
+ button.classList.add('clear-filter-button');
6262
+ // Add input change events.
6263
+ addEvent(input, 'input', function (e) {
6264
+ handleInputChange(this.value);
6265
+ // Show clear filter button.
6266
+ if (this.value.length) {
6267
+ button.style.display = 'inline-block';
6268
+ }
6269
+ else {
6270
+ button.style.display = 'none';
6271
+ }
6272
+ });
6273
+ // Add clear filter click event.
6274
+ ['click', 'touchstart'].forEach(function (eventName) {
6275
+ addEvent(button, eventName, function () {
6276
+ // Clear the input.
6277
+ input.value = '';
6278
+ handleInputChange('');
6279
+ // Hide clear filter button- no longer nececary.
6280
+ button.style.display = 'none';
6281
+ });
6282
+ });
6283
+ },
6284
+ /**
6285
+ * Add selection HTML element and its' label.
6286
+ *
6287
+ * @private
6288
+ *
6289
+ * @param {string} indicatorType
6290
+ * Type of the indicator i.e. sma, ema...
6291
+ *
6292
+ * @param {string} [optionName]
6293
+ * Name of the option into which selection is being added.
6294
+ *
6295
+ * @param {HTMLDOMElement} [parentDiv]
6296
+ * HTML parent element.
6297
+ */
6298
+ addSelection: function (indicatorType, optionName, parentDiv) {
6299
+ var optionParamList = optionName.split('.'),
6300
+ labelText = optionParamList[optionParamList.length - 1];
6301
+ var selectName = PREFIX + optionName + '-type-' + indicatorType,
6302
+ lang = this.lang,
6303
+ selectBox;
6304
+ // Add a label for the selection box.
6305
+ createElement(LABEL, {
6306
+ htmlFor: selectName
6307
+ }, null, parentDiv).appendChild(doc.createTextNode(lang[labelText] || optionName));
6308
+ // Create a selection box.
6309
+ selectBox = createElement(SELECT, {
6310
+ name: selectName,
6311
+ className: PREFIX + 'popup-field',
6312
+ id: PREFIX + 'select-' + optionName
6313
+ }, null, parentDiv);
6314
+ selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
6315
+ return selectBox;
6316
+ },
6317
+ /**
6318
+ * Get and add selection options.
6319
+ *
6320
+ * @private
6321
+ *
6322
+ * @param {Highcharts.AnnotationChart} chart
6323
+ * The chart object.
6324
+ *
6325
+ * @param {string} [optionName]
6326
+ * Name of the option into which selection is being added.
6327
+ *
6328
+ * @param {HTMLSelectElement} [selectBox]
6329
+ * HTML select box element to which the options are being added.
6330
+ *
6331
+ * @param {string|undefined} indicatorType
6332
+ * Type of the indicator i.e. sma, ema...
6333
+ *
6334
+ * @param {string|undefined} parameterName
6335
+ * Name of the parameter which should be applied.
6336
+ *
6337
+ * @param {string|undefined} selectedOption
6338
+ * Default value in dropdown.
6339
+ */
6340
+ addSelectionOptions: function (chart, optionName, selectBox, indicatorType, parameterName, selectedOption, currentSeries) {
6341
+ var popup = this;
6342
+ // Get and apply selection options for the possible series.
6343
+ if (optionName === 'series' || optionName === 'volume') {
6344
+ // List all series which have id - mandatory for indicator.
6345
+ chart.series.forEach(function (series) {
6346
+ var seriesOptions = series.options,
6347
+ seriesName = seriesOptions.name ||
6348
+ seriesOptions.params ?
6349
+ series.name :
6350
+ seriesOptions.id || '';
6351
+ if (seriesOptions.id !== PREFIX + 'navigator-series' &&
6352
+ seriesOptions.id !== (currentSeries &&
6353
+ currentSeries.options &&
6354
+ currentSeries.options.id)) {
6355
+ if (!defined(selectedOption) &&
6356
+ optionName === 'volume' &&
6357
+ series.type === 'column') {
6358
+ selectedOption = seriesOptions.id;
6359
+ }
6360
+ createElement(OPTION, {
6361
+ value: seriesOptions.id
6362
+ }, void 0, selectBox).appendChild(doc.createTextNode(seriesName));
6363
+ }
6364
+ });
6365
+ }
6366
+ else if (indicatorType && parameterName) {
6367
+ // Get and apply options for the possible parameters.
6368
+ var dropdownKey = parameterName + '-' + indicatorType,
6369
+ parameterOption = dropdownParameters[dropdownKey];
6370
+ parameterOption.forEach(function (element) {
6371
+ createElement(OPTION, {
6372
+ value: element
6373
+ }, void 0, selectBox).appendChild(doc.createTextNode(element));
6374
+ });
6375
+ }
6376
+ // Add the default dropdown value if defined.
6377
+ if (defined(selectedOption)) {
6378
+ selectBox.value = selectedOption;
6379
+ }
5646
6380
  },
5647
6381
  /**
5648
6382
  * Extract full name and type of requested indicator.
6383
+ *
5649
6384
  * @private
6385
+ *
5650
6386
  * @param {Highcharts.Series} series
5651
- * Series which name is needed. (EDIT mode - defaultOptions.series, ADD
5652
- * mode - indicator series).
5653
- * @param {string} - indicator type like: sma, ema, etc.
5654
- * @return {Object} - series name and type like: sma, ema, etc.
6387
+ * Series which name is needed(EDITmode - defaultOptions.series,
6388
+ * ADDmode - indicator series).
6389
+ *
6390
+ * @param {string} [indicatorType]
6391
+ * Type of the indicator i.e. sma, ema...
6392
+ *
6393
+ * @return {Highcharts.Dictionary<string>}
6394
+ * Full name and series type.
5655
6395
  */
5656
- getNameType: function (series, type) {
6396
+ getNameType: function (series, indicatorType) {
5657
6397
  var options = series.options,
5658
- seriesTypes = H.seriesTypes,
5659
- // add mode
5660
- seriesName = seriesTypes[type] &&
5661
- seriesTypes[type].prototype.nameBase || type.toUpperCase(),
5662
- seriesType = type;
6398
+ seriesTypes = H.seriesTypes;
6399
+ // add mode
6400
+ var seriesName = (seriesTypes[indicatorType] &&
6401
+ seriesTypes[indicatorType].prototype.nameBase) ||
6402
+ indicatorType.toUpperCase(),
6403
+ seriesType = indicatorType;
5663
6404
  // edit
5664
6405
  if (options && options.type) {
5665
6406
  seriesType = series.options.type;
5666
6407
  seriesName = series.name;
5667
6408
  }
5668
6409
  return {
5669
- name: seriesName,
5670
- type: seriesType
6410
+ indicatorFullName: seriesName,
6411
+ indicatorType: seriesType
5671
6412
  };
5672
6413
  },
5673
6414
  /**
5674
- * List all series with unique ID. Its mandatory for indicators to set
5675
- * correct linking.
6415
+ * Create the selection box for the series,
6416
+ * add options and apply the default one.
6417
+ *
5676
6418
  * @private
5677
- * @param {string} type
5678
- * Indicator type like: sma, ema, etc.
5679
- * @param {string} optionName
5680
- * Type of select i.e series or volume.
5681
- * @param {Highcharts.Chart} chart
5682
- * Chart
5683
- * @param {Highcharts.HTMLDOMElement} parentDiv
5684
- * Element where created HTML list is added
5685
- * @param {string} selectedOption
5686
- * optional param for default value in dropdown
6419
+ *
6420
+ * @param {string} indicatorType
6421
+ * Type of the indicator i.e. sma, ema...
6422
+ *
6423
+ * @param {string} [optionName]
6424
+ * Name of the option into which selection is being added.
6425
+ *
6426
+ * @param {Highcharts.AnnotationChart} chart
6427
+ * The chart object.
6428
+ *
6429
+ * @param {HTMLDOMElement} [parentDiv]
6430
+ * HTML parent element.
6431
+ *
6432
+ * @param {string|undefined} selectedOption
6433
+ * Default value in dropdown.
5687
6434
  */
5688
- listAllSeries: function (type, optionName, chart, parentDiv, selectedOption) {
5689
- var selectName = PREFIX + optionName + '-type-' + type,
5690
- lang = this.lang,
5691
- selectBox,
5692
- seriesOptions;
6435
+ listAllSeries: function (indicatorType, optionName, chart, parentDiv, currentSeries, selectedOption) {
6436
+ var popup = this,
6437
+ indicators = popup.indicators;
6438
+ // Won't work without the chart.
5693
6439
  if (!chart) {
5694
6440
  return;
5695
6441
  }
5696
- createElement(LABEL, {
5697
- htmlFor: selectName
5698
- }, null, parentDiv).appendChild(doc.createTextNode(lang[optionName] || optionName));
5699
- // select type
5700
- selectBox = createElement(SELECT, {
5701
- name: selectName,
5702
- className: PREFIX + 'popup-field'
5703
- }, null, parentDiv);
5704
- selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
5705
- // list all series which have id - mandatory for creating indicator
5706
- chart.series.forEach(function (serie) {
5707
- seriesOptions = serie.options;
5708
- if (!seriesOptions.params &&
5709
- seriesOptions.id &&
5710
- seriesOptions.id !== PREFIX + 'navigator-series') {
5711
- createElement(OPTION, {
5712
- value: seriesOptions.id
5713
- }, null, selectBox).appendChild(doc.createTextNode(seriesOptions.name || seriesOptions.id));
5714
- }
5715
- });
6442
+ // Add selection boxes.
6443
+ var selectBox = indicators.addSelection.call(popup,
6444
+ indicatorType,
6445
+ optionName,
6446
+ parentDiv);
6447
+ // Add possible dropdown options.
6448
+ indicators.addSelectionOptions.call(popup, chart, optionName, selectBox, void 0, void 0, void 0, currentSeries);
6449
+ // Add the default dropdown value if defined.
5716
6450
  if (defined(selectedOption)) {
5717
6451
  selectBox.value = selectedOption;
5718
6452
  }
@@ -5737,21 +6471,21 @@
5737
6471
  var fields = series.params || series.options.params,
5738
6472
  getNameType = this.indicators.getNameType;
5739
6473
  // reset current content
5740
- rhsColWrapper.innerHTML = '';
6474
+ rhsColWrapper.innerHTML = AST.emptyHTML;
5741
6475
  // create title (indicator name in the right column)
5742
6476
  createElement(H3, {
5743
6477
  className: PREFIX + 'indicator-title'
5744
- }, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).name));
6478
+ }, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).indicatorFullName));
5745
6479
  // input type
5746
6480
  createElement(INPUT, {
5747
6481
  type: 'hidden',
5748
6482
  name: PREFIX + 'type-' + seriesType,
5749
6483
  value: seriesType
5750
- }, null, rhsColWrapper);
6484
+ }, void 0, rhsColWrapper);
5751
6485
  // list all series with id
5752
- this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series.linkedParent && fields.volumeSeriesID);
6486
+ this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series, series.linkedParent && series.linkedParent.options.id);
5753
6487
  if (fields.volumeSeriesID) {
5754
- this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series.linkedParent && series.linkedParent.options.id);
6488
+ this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series, series.linkedParent && fields.volumeSeriesID);
5755
6489
  }
5756
6490
  // add param fields
5757
6491
  this.indicators.addParamInputs.call(this, chart, 'params', fields, seriesType, rhsColWrapper);
@@ -5773,8 +6507,9 @@
5773
6507
  * Element where created HTML list is added
5774
6508
  */
5775
6509
  addParamInputs: function (chart, parentNode, fields, type, parentDiv) {
5776
- var _self = this,
5777
- addParamInputs = this.indicators.addParamInputs,
6510
+ var popup = this,
6511
+ indicators = popup.indicators;
6512
+ var addParamInputs = this.indicators.addParamInputs,
5778
6513
  addInput = this.addInput,
5779
6514
  parentFullName;
5780
6515
  if (!chart) {
@@ -5783,16 +6518,34 @@
5783
6518
  objectEach(fields, function (value, fieldName) {
5784
6519
  // create name like params.styles.fontSize
5785
6520
  parentFullName = parentNode + '.' + fieldName;
5786
- if (value !== void 0) { // skip if field is unnecessary, #15362
6521
+ if (defined(value) && // skip if field is unnecessary, #15362
6522
+ parentFullName) {
5787
6523
  if (isObject(value)) {
5788
- addInput.call(// (15733) 'Periods' has an arrayed value. Label must be created here.
5789
- _self, parentFullName, type, parentDiv, '');
5790
- addParamInputs.call(_self, chart, parentFullName, value, type, parentDiv);
6524
+ // (15733) 'Periods' has an arrayed value. Label must be
6525
+ // created here.
6526
+ addInput.call(popup, parentFullName, type, parentDiv, {});
6527
+ addParamInputs.call(popup, chart, parentFullName, value, type, parentDiv);
6528
+ }
6529
+ // If the option is listed in dropdown enum,
6530
+ // add the selection box for it.
6531
+ if (parentFullName in DropdownProperties) {
6532
+ // Add selection boxes.
6533
+ var selectBox = indicators.addSelection.call(popup,
6534
+ type,
6535
+ parentFullName,
6536
+ parentDiv);
6537
+ // Add possible dropdown options.
6538
+ indicators.addSelectionOptions.call(popup, chart, parentNode, selectBox, type, fieldName, value);
5791
6539
  }
5792
6540
  else if (
5793
- // skip volume field which is created by addFormFields
5794
- parentFullName !== 'params.volumeSeriesID') {
5795
- addInput.call(_self, parentFullName, type, parentDiv, [value, 'text'] // all inputs are text type
6541
+ // Skip volume field which is created by addFormFields.
6542
+ parentFullName !== 'params.volumeSeriesID' &&
6543
+ !isArray(value) // Skip params declared in array.
6544
+ ) {
6545
+ addInput.call(popup, parentFullName, type, parentDiv, {
6546
+ value: value,
6547
+ type: 'text'
6548
+ } // all inputs are text type
5796
6549
  );
5797
6550
  }
5798
6551
  }
@@ -5874,8 +6627,10 @@
5874
6627
  addContentItem: function () {
5875
6628
  var popupDiv = this.popup.container;
5876
6629
  return createElement(DIV, {
5877
- className: PREFIX + 'tab-item-content ' + PREFIX + 'no-mousewheel' // #12100
5878
- }, null, popupDiv);
6630
+ // #12100
6631
+ className: PREFIX + 'tab-item-content ' +
6632
+ PREFIX + 'no-mousewheel'
6633
+ }, void 0, popupDiv);
5879
6634
  },
5880
6635
  /**
5881
6636
  * Add click event to each tab
@@ -5938,7 +6693,7 @@
5938
6693
  this.popup = new H.Popup(this.chart.container, (this.chart.options.navigation.iconsURL ||
5939
6694
  (this.chart.options.stockTools &&
5940
6695
  this.chart.options.stockTools.gui.iconsURL) ||
5941
- 'https://code.highcharts.com/9.2.2/gfx/stock-icons/'), this.chart);
6696
+ 'https://code.highcharts.com/9.3.3/gfx/stock-icons/'), this.chart);
5942
6697
  }
5943
6698
  this.popup.showForm(config.formType, this.chart, config.options, config.onSubmit);
5944
6699
  });