highcharts 10.0.0 → 10.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (942) hide show
  1. package/bower.json +1 -1
  2. package/css/highcharts.css +10 -20
  3. package/css/themes/dark-unica.css +10 -20
  4. package/css/themes/grid-light.css +10 -20
  5. package/css/themes/sand-signika.css +10 -20
  6. package/es-modules/Accessibility/A11yI18n.js +4 -4
  7. package/es-modules/Accessibility/Accessibility.js +8 -3
  8. package/es-modules/Accessibility/Components/AnnotationsA11y.js +3 -3
  9. package/es-modules/Accessibility/Components/ContainerComponent.js +11 -10
  10. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +18 -11
  11. package/es-modules/Accessibility/Components/LegendComponent.js +11 -11
  12. package/es-modules/Accessibility/Components/MenuComponent.js +3 -1
  13. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +3 -1
  14. package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +3 -1
  15. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +34 -17
  16. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +35 -10
  17. package/es-modules/Accessibility/Components/ZoomComponent.js +30 -70
  18. package/es-modules/Accessibility/FocusBorder.js +6 -5
  19. package/es-modules/Accessibility/HighContrastMode.js +1 -1
  20. package/es-modules/Accessibility/KeyboardNavigation.js +2 -2
  21. package/es-modules/Accessibility/Options/{Options.js → A11yDefaults.js} +73 -5
  22. package/es-modules/Accessibility/Options/DeprecatedOptions.js +12 -2
  23. package/es-modules/Accessibility/Options/{LangOptions.js → LangDefaults.js} +46 -31
  24. package/es-modules/Accessibility/Utils/ChartUtilities.js +10 -5
  25. package/es-modules/Core/Animation/Fx.js +1 -1
  26. package/es-modules/Core/Axis/Axis.js +51 -46
  27. package/es-modules/Core/Axis/Axis3D.js +1 -1
  28. package/es-modules/Core/Axis/AxisDefaults.js +9 -9
  29. package/es-modules/Core/Axis/BrokenAxis.js +1 -1
  30. package/es-modules/Core/Axis/Color/ColorAxis.js +4 -2
  31. package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +7 -3
  32. package/es-modules/Core/Axis/DateTimeAxis.js +5 -3
  33. package/es-modules/Core/Axis/GridAxis.js +821 -822
  34. package/es-modules/Core/Axis/LogarithmicAxis.js +1 -1
  35. package/es-modules/Core/Axis/NavigatorAxis.js +2 -2
  36. package/es-modules/Core/Axis/OrdinalAxis.js +26 -3
  37. package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +3 -3
  38. package/es-modules/Core/Axis/RadialAxis.js +1 -1
  39. package/es-modules/Core/Axis/Stacking/StackItem.js +262 -0
  40. package/es-modules/Core/Axis/Stacking/StackingAxis.js +468 -0
  41. package/es-modules/Core/Axis/Tick.js +22 -18
  42. package/es-modules/Core/Axis/TreeGrid/TreeGridAxis.js +732 -0
  43. package/es-modules/Core/Axis/TreeGrid/TreeGridTick.js +313 -0
  44. package/es-modules/Core/Axis/WaterfallAxis.js +1 -1
  45. package/es-modules/Core/Axis/ZAxis.js +76 -71
  46. package/es-modules/Core/Chart/Chart.js +42 -9
  47. package/es-modules/Core/Chart/Chart3D.js +2 -2
  48. package/es-modules/Core/Chart/ChartDefaults.js +165 -5
  49. package/es-modules/Core/Chart/GanttChart.js +3 -1
  50. package/es-modules/Core/Chart/MapChart.js +3 -1
  51. package/es-modules/Core/Chart/StockChart.js +12 -8
  52. package/es-modules/Core/Color/Color.js +1 -1
  53. package/es-modules/Core/DefaultOptions.js +19 -16
  54. package/es-modules/Core/Geometry/CircleUtilities.js +4 -4
  55. package/es-modules/Core/Globals.js +2 -1
  56. package/es-modules/Core/HttpUtilities.js +39 -37
  57. package/es-modules/Core/Legend/Legend.js +4 -4
  58. package/es-modules/Core/MSPointer.js +3 -1
  59. package/es-modules/{Extensions → Core}/Math3D.js +48 -43
  60. package/es-modules/Core/Navigator.js +31 -14
  61. package/es-modules/Core/Pointer.js +8 -10
  62. package/es-modules/Core/Renderer/HTML/AST.js +13 -7
  63. package/es-modules/Core/Renderer/HTML/HTMLElement.js +3 -1
  64. package/es-modules/Core/Renderer/HTML/HTMLRenderer.js +3 -1
  65. package/es-modules/Core/Renderer/SVG/SVGElement.js +132 -192
  66. package/es-modules/Core/Renderer/SVG/SVGLabel.js +32 -28
  67. package/es-modules/Core/Renderer/SVG/SVGRenderer.js +50 -45
  68. package/es-modules/Core/Renderer/SVG/SVGRenderer3D.js +5 -3
  69. package/es-modules/Core/Renderer/SVG/TextBuilder.js +5 -3
  70. package/es-modules/Core/Scrollbar.js +12 -6
  71. package/es-modules/Core/ScrollbarDefaults.js +8 -8
  72. package/es-modules/Core/Series/DataLabel.js +63 -40
  73. package/es-modules/Core/Series/Point.js +11 -2
  74. package/es-modules/Core/Series/Series.js +60 -43
  75. package/es-modules/Core/Series/Series3D.js +4 -2
  76. package/es-modules/Core/Series/SeriesDefaults.js +11 -6
  77. package/es-modules/Core/Series/SeriesRegistry.js +6 -29
  78. package/es-modules/Core/Time.js +6 -7
  79. package/es-modules/Core/Tooltip.js +17 -6
  80. package/es-modules/Core/Utilities.js +7 -9
  81. package/es-modules/Data/DataConverter.js +6 -1
  82. package/es-modules/Data/DataPromise.js +1 -1
  83. package/es-modules/Data/DataSeriesComposition.js +288 -0
  84. package/es-modules/Data/DataSeriesConverter.js +1 -1
  85. package/es-modules/Data/DataTable.js +14 -12
  86. package/es-modules/Data/Modifiers/ChainModifier.js +4 -2
  87. package/es-modules/Data/Modifiers/DataModifier.js +1 -1
  88. package/es-modules/Data/Modifiers/GroupModifier.js +4 -2
  89. package/es-modules/Data/Modifiers/InvertModifier.js +10 -8
  90. package/es-modules/Data/Modifiers/RangeModifier.js +4 -2
  91. package/es-modules/Data/Modifiers/SeriesPointsModifier.js +4 -2
  92. package/es-modules/Data/Modifiers/SortModifier.js +4 -2
  93. package/es-modules/Data/Parsers/CSVParser.js +3 -1
  94. package/es-modules/Data/Parsers/DataParser.js +2 -2
  95. package/es-modules/Data/Parsers/GoogleSheetsParser.js +3 -2
  96. package/es-modules/Data/Parsers/HTMLTableParser.js +3 -1
  97. package/es-modules/Data/Stores/CSVStore.js +8 -5
  98. package/es-modules/Data/Stores/DataStore.js +1 -1
  99. package/es-modules/Data/Stores/GoogleSheetsStore.js +3 -1
  100. package/es-modules/Data/Stores/HTMLTableStore.js +3 -1
  101. package/es-modules/Extensions/Annotations/Annotation.js +652 -0
  102. package/es-modules/Extensions/Annotations/AnnotationChart.js +291 -0
  103. package/es-modules/Extensions/Annotations/AnnotationDefaults.js +624 -0
  104. package/es-modules/Extensions/Annotations/ControlPoint.js +89 -64
  105. package/es-modules/Extensions/Annotations/{Mixins/ControllableMixin.js → Controllables/Controllable.js} +300 -241
  106. package/es-modules/Extensions/Annotations/Controllables/ControllableCircle.js +63 -50
  107. package/es-modules/Extensions/Annotations/Controllables/ControllableDefaults.js +95 -0
  108. package/es-modules/Extensions/Annotations/Controllables/ControllableEllipse.js +95 -63
  109. package/es-modules/Extensions/Annotations/Controllables/ControllableImage.js +50 -44
  110. package/es-modules/Extensions/Annotations/Controllables/ControllableLabel.js +95 -78
  111. package/es-modules/Extensions/Annotations/Controllables/ControllablePath.js +167 -51
  112. package/es-modules/Extensions/Annotations/Controllables/ControllableRect.js +53 -52
  113. package/es-modules/Extensions/Annotations/{Mixins/EventEmitterMixin.js → EventEmitter.js} +136 -116
  114. package/es-modules/Extensions/Annotations/MockPoint.js +210 -145
  115. package/es-modules/Extensions/Annotations/NavigationBindings.js +272 -663
  116. package/es-modules/Extensions/Annotations/NavigationBindingsDefaults.js +396 -0
  117. package/es-modules/Extensions/Annotations/NavigationBindingsUtilities.js +98 -0
  118. package/es-modules/Extensions/Annotations/Popup/Popup.js +295 -0
  119. package/es-modules/Extensions/Annotations/Popup/PopupAnnotations.js +177 -0
  120. package/es-modules/Extensions/Annotations/Popup/PopupComposition.js +81 -0
  121. package/es-modules/Extensions/Annotations/Popup/PopupIndicators.js +609 -0
  122. package/es-modules/Extensions/Annotations/Popup/PopupTabs.js +134 -0
  123. package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +23 -23
  124. package/es-modules/Extensions/Annotations/Types/CrookedLine.js +15 -21
  125. package/es-modules/Extensions/Annotations/Types/ElliottWave.js +14 -12
  126. package/es-modules/Extensions/Annotations/Types/Fibonacci.js +33 -23
  127. package/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +67 -65
  128. package/es-modules/Extensions/Annotations/Types/InfinityLine.js +14 -21
  129. package/es-modules/Extensions/Annotations/Types/Measure.js +259 -251
  130. package/es-modules/Extensions/Annotations/Types/Pitchfork.js +15 -19
  131. package/es-modules/Extensions/Annotations/Types/TimeCycles.js +24 -19
  132. package/es-modules/Extensions/Annotations/Types/Tunnel.js +17 -15
  133. package/es-modules/Extensions/Annotations/Types/VerticalLine.js +15 -17
  134. package/es-modules/Extensions/Boost/Boost.js +320 -15
  135. package/es-modules/Extensions/Boost/BoostChart.js +245 -0
  136. package/es-modules/Extensions/Boost/BoostSeries.js +927 -0
  137. package/es-modules/Extensions/Boost/BoostableMap.js +21 -5
  138. package/es-modules/Extensions/Boost/Boostables.js +13 -2
  139. package/es-modules/Extensions/Boost/NamedColors.js +15 -6
  140. package/es-modules/Extensions/Boost/WGLDrawMode.js +36 -0
  141. package/es-modules/Extensions/Boost/WGLRenderer.js +288 -295
  142. package/es-modules/Extensions/Boost/WGLShader.js +370 -376
  143. package/es-modules/Extensions/Boost/WGLVertexBuffer.js +192 -0
  144. package/es-modules/Extensions/BoostCanvas.js +70 -48
  145. package/es-modules/Extensions/Breadcrumbs.js +37 -9
  146. package/es-modules/Extensions/CurrentDateIndication.js +1 -1
  147. package/es-modules/Extensions/Data.js +638 -602
  148. package/es-modules/Extensions/DataGrouping.js +68 -28
  149. package/es-modules/Extensions/Debugger/Debugger.js +60 -22
  150. package/es-modules/Extensions/Debugger/ErrorMessages.js +4 -0
  151. package/es-modules/Extensions/DownloadURL.js +3 -3
  152. package/es-modules/Extensions/DragPanes.js +1 -1
  153. package/es-modules/Extensions/DraggablePoints.js +4 -3
  154. package/es-modules/Extensions/Drilldown.js +15 -14
  155. package/es-modules/Extensions/{ExportData.js → ExportData/ExportData.js} +358 -498
  156. package/es-modules/Extensions/ExportData/ExportDataDefaults.js +272 -0
  157. package/es-modules/Extensions/Exporting/Exporting.js +30 -17
  158. package/es-modules/Extensions/Exporting/ExportingDefaults.js +10 -8
  159. package/es-modules/Extensions/Exporting/Fullscreen.js +352 -0
  160. package/es-modules/Extensions/GeoJSON.js +3 -4
  161. package/es-modules/Extensions/MarkerClusters.js +5 -3
  162. package/es-modules/Extensions/NoDataToDisplay.js +1 -1
  163. package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
  164. package/es-modules/Extensions/Oldie/Oldie.js +2 -2
  165. package/es-modules/Extensions/OverlappingDataLabels.js +5 -4
  166. package/es-modules/Extensions/Pane.js +3 -3
  167. package/es-modules/Extensions/ParallelCoordinates.js +12 -8
  168. package/es-modules/Extensions/PatternFill.js +14 -2
  169. package/es-modules/Extensions/RangeSelector.js +29 -18
  170. package/es-modules/Extensions/ScrollablePlotArea.js +4 -4
  171. package/es-modules/Extensions/{SeriesLabel.js → SeriesLabel/SeriesLabel.js} +264 -386
  172. package/es-modules/Extensions/SeriesLabel/SeriesLabelDefaults.js +124 -0
  173. package/es-modules/Extensions/SeriesLabel/SeriesLabelUtilities.js +67 -0
  174. package/es-modules/Extensions/Sonification/ChartSonify.js +1 -1
  175. package/es-modules/Extensions/Sonification/Earcon.js +1 -1
  176. package/es-modules/Extensions/Themes/HighContrastDark.js +10 -10
  177. package/es-modules/Extensions/Themes/HighContrastLight.js +9 -9
  178. package/es-modules/Maps/MapNavigation.js +3 -7
  179. package/es-modules/Maps/MapPointer.js +1 -1
  180. package/es-modules/Maps/MapView.js +31 -19
  181. package/es-modules/Maps/MapViewInsetsOptionsDefault.js +1 -1
  182. package/es-modules/Maps/MapViewOptionsDefault.js +3 -1
  183. package/es-modules/Maps/Projection.js +13 -11
  184. package/es-modules/Series/ArcDiagram/ArcDiagramPoint.js +3 -1
  185. package/es-modules/Series/ArcDiagram/ArcDiagramSeries.js +12 -2
  186. package/es-modules/Series/Area/AreaSeries.js +21 -14
  187. package/es-modules/Series/{Area3DSeries.js → Area3D/Area3DSeries.js} +42 -20
  188. package/es-modules/Series/AreaRange/AreaRangePoint.js +24 -11
  189. package/es-modules/Series/AreaRange/AreaRangeSeries.js +162 -149
  190. package/es-modules/Series/AreaSpline/AreaSplineSeries.js +45 -41
  191. package/es-modules/Series/AreaSplineRange/AreaSplineRangeSeries.js +43 -43
  192. package/es-modules/Series/Bar/BarSeries.js +3 -1
  193. package/es-modules/Series/Bellcurve/BellcurveSeries.js +3 -1
  194. package/es-modules/Series/BoxPlot/BoxPlotSeries.js +4 -2
  195. package/es-modules/Series/Bubble/BubbleLegendComposition.js +223 -231
  196. package/es-modules/Series/Bubble/BubbleLegendDefaults.js +1 -1
  197. package/es-modules/Series/Bubble/BubbleLegendItem.js +46 -45
  198. package/es-modules/Series/Bubble/BubblePoint.js +3 -1
  199. package/es-modules/Series/Bubble/BubbleSeries.js +96 -68
  200. package/es-modules/Series/Bullet/BulletPoint.js +3 -1
  201. package/es-modules/Series/Bullet/BulletSeries.js +4 -3
  202. package/es-modules/Series/Candlestick/CandlestickSeries.js +5 -3
  203. package/es-modules/Series/CenteredUtilities.js +8 -2
  204. package/es-modules/Series/ColorMapComposition.js +111 -0
  205. package/es-modules/Series/Column/ColumnSeries.js +8 -4
  206. package/es-modules/Series/Column3D/Column3DComposition.js +2 -2
  207. package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +4 -2
  208. package/es-modules/Series/ColumnRange/ColumnRangePoint.js +17 -13
  209. package/es-modules/Series/ColumnRange/ColumnRangeSeries.js +60 -57
  210. package/es-modules/Series/Cylinder/CylinderComposition.js +1 -1
  211. package/es-modules/Series/Cylinder/CylinderPoint.js +3 -1
  212. package/es-modules/Series/Cylinder/CylinderSeries.js +3 -1
  213. package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +27 -12
  214. package/es-modules/Series/DependencyWheel/DependencyWheelSeries.js +19 -3
  215. package/es-modules/Series/DotPlot/DotPlotSeries.js +3 -1
  216. package/es-modules/Series/DragNodesComposition.js +166 -0
  217. package/es-modules/Series/DrawPointUtilities.js +87 -0
  218. package/es-modules/Series/Dumbbell/DumbbellPoint.js +3 -1
  219. package/es-modules/Series/Dumbbell/DumbbellSeries.js +4 -2
  220. package/es-modules/Series/ErrorBar/ErrorBarSeries.js +4 -2
  221. package/es-modules/Series/Flags/FlagsPoint.js +4 -1
  222. package/es-modules/Series/Flags/FlagsSeries.js +13 -16
  223. package/es-modules/Series/Funnel/FunnelSeries.js +5 -3
  224. package/es-modules/Series/Funnel3D/Funnel3DPoint.js +3 -1
  225. package/es-modules/Series/Funnel3D/Funnel3DSeries.js +4 -2
  226. package/es-modules/Series/Gantt/GanttPoint.js +3 -1
  227. package/es-modules/Series/Gantt/GanttSeries.js +4 -2
  228. package/es-modules/Series/Gauge/GaugePoint.js +3 -1
  229. package/es-modules/Series/Gauge/GaugeSeries.js +196 -174
  230. package/es-modules/Series/GraphLayoutComposition.js +130 -0
  231. package/es-modules/Series/HLC/HLCPoint.js +3 -1
  232. package/es-modules/Series/HLC/HLCSeries.js +4 -2
  233. package/es-modules/Series/Heatmap/HeatmapPoint.js +7 -5
  234. package/es-modules/Series/Heatmap/HeatmapSeries.js +34 -34
  235. package/es-modules/Series/HeikinAshi/HeikinAshiPoint.js +3 -1
  236. package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +3 -1
  237. package/es-modules/Series/Histogram/HistogramSeries.js +3 -1
  238. package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +3 -1
  239. package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +11 -9
  240. package/es-modules/Series/Item/ItemPoint.js +3 -1
  241. package/es-modules/Series/Item/ItemSeries.js +3 -1
  242. package/es-modules/Series/Line/LineSeries.js +4 -2
  243. package/es-modules/Series/Lollipop/LollipopPoint.js +24 -12
  244. package/es-modules/Series/Lollipop/LollipopSeries.js +18 -11
  245. package/es-modules/Series/Map/MapPoint.js +8 -6
  246. package/es-modules/Series/Map/MapSeries.js +115 -28
  247. package/es-modules/Series/MapBubble/MapBubblePoint.js +18 -18
  248. package/es-modules/Series/MapBubble/MapBubbleSeries.js +69 -21
  249. package/es-modules/Series/MapLine/MapLineSeries.js +18 -1
  250. package/es-modules/Series/MapPoint/MapPointPoint.js +4 -2
  251. package/es-modules/Series/MapPoint/MapPointSeries.js +14 -2
  252. package/es-modules/Series/Networkgraph/EulerIntegration.js +199 -0
  253. package/es-modules/Series/Networkgraph/NetworkgraphPoint.js +290 -0
  254. package/es-modules/Series/Networkgraph/NetworkgraphSeries.js +401 -0
  255. package/es-modules/Series/Networkgraph/NetworkgraphSeriesDefaults.js +545 -0
  256. package/es-modules/Series/Networkgraph/QuadTree.js +66 -272
  257. package/es-modules/Series/Networkgraph/QuadTreeNode.js +271 -0
  258. package/es-modules/Series/Networkgraph/{Layouts.js → ReingoldFruchtermanLayout.js} +240 -259
  259. package/es-modules/Series/Networkgraph/VerletIntegration.js +193 -0
  260. package/es-modules/Series/NodesComposition.js +45 -40
  261. package/es-modules/Series/OHLC/OHLCPoint.js +3 -1
  262. package/es-modules/Series/OHLC/OHLCSeries.js +3 -1
  263. package/es-modules/Series/Organization/OrganizationPoint.js +3 -1
  264. package/es-modules/Series/Organization/OrganizationSeries.js +14 -4
  265. package/es-modules/Series/PackedBubble/PackedBubbleIntegration.js +81 -0
  266. package/es-modules/Series/PackedBubble/{PackedBubbleComposition.js → PackedBubbleLayout.js} +114 -79
  267. package/es-modules/Series/PackedBubble/PackedBubblePoint.js +5 -3
  268. package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +200 -571
  269. package/es-modules/Series/PackedBubble/PackedBubbleSeriesDefaults.js +394 -0
  270. package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -1
  271. package/es-modules/Series/Pie/PieDataLabel.js +4 -2
  272. package/es-modules/Series/Pie/PiePoint.js +3 -1
  273. package/es-modules/Series/Pie/PieSeries.js +54 -38
  274. package/es-modules/Series/Pie3D/Pie3DPoint.js +3 -1
  275. package/es-modules/Series/Pie3D/Pie3DSeries.js +3 -1
  276. package/es-modules/Series/PolarComposition.js +819 -0
  277. package/es-modules/Series/Polygon/PolygonSeries.js +3 -1
  278. package/es-modules/Series/Pyramid/PyramidSeries.js +3 -1
  279. package/es-modules/Series/Pyramid3D/Pyramid3DSeries.js +3 -1
  280. package/es-modules/Series/Sankey/SankeyPoint.js +3 -1
  281. package/es-modules/Series/Sankey/SankeySeries.js +38 -10
  282. package/es-modules/Series/Scatter/ScatterSeries.js +14 -6
  283. package/es-modules/Series/Scatter3D/Scatter3DPoint.js +3 -1
  284. package/es-modules/Series/Scatter3D/Scatter3DSeries.js +4 -2
  285. package/es-modules/Series/SeriesOnPointComposition.js +395 -0
  286. package/es-modules/Series/SolidGauge/SolidGaugeSeries.js +6 -4
  287. package/es-modules/Series/Spline/SplineSeries.js +13 -4
  288. package/es-modules/Series/Streamgraph/StreamgraphSeries.js +3 -1
  289. package/es-modules/Series/Sunburst/SunburstPoint.js +8 -9
  290. package/es-modules/Series/Sunburst/SunburstSeries.js +32 -5
  291. package/es-modules/Series/Tilemap/TilemapPoint.js +3 -1
  292. package/es-modules/Series/Tilemap/TilemapSeries.js +3 -1
  293. package/es-modules/Series/Timeline/TimelinePoint.js +3 -1
  294. package/es-modules/Series/Timeline/TimelineSeries.js +8 -4
  295. package/es-modules/Series/Treemap/TreemapPoint.js +8 -4
  296. package/es-modules/Series/Treemap/TreemapSeries.js +12 -10
  297. package/es-modules/Series/VariablePie/VariablePieSeries.js +3 -1
  298. package/es-modules/Series/Variwide/VariwidePoint.js +3 -1
  299. package/es-modules/Series/Variwide/VariwideSeries.js +3 -1
  300. package/es-modules/Series/Vector/VectorSeries.js +5 -5
  301. package/es-modules/Series/Venn/VennPoint.js +5 -5
  302. package/es-modules/Series/Venn/VennSeries.js +9 -6
  303. package/es-modules/Series/Waterfall/WaterfallPoint.js +3 -1
  304. package/es-modules/Series/Waterfall/WaterfallSeries.js +14 -12
  305. package/es-modules/Series/Windbarb/WindbarbPoint.js +3 -1
  306. package/es-modules/Series/Windbarb/WindbarbSeries.js +3 -1
  307. package/es-modules/Series/Wordcloud/WordcloudPoint.js +6 -6
  308. package/es-modules/Series/Wordcloud/WordcloudSeries.js +12 -9
  309. package/es-modules/Series/Wordcloud/WordcloudUtils.js +1 -1
  310. package/es-modules/Series/XRange/XRangePoint.js +57 -46
  311. package/es-modules/Series/XRange/XRangeSeries.js +124 -274
  312. package/es-modules/Series/XRange/XRangeSeriesDefaults.js +211 -0
  313. package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +13 -3
  314. package/es-modules/Stock/Indicators/AD/ADIndicator.js +8 -1
  315. package/es-modules/Stock/Indicators/AO/AOIndicator.js +27 -14
  316. package/es-modules/Stock/Indicators/APO/APOIndicator.js +9 -2
  317. package/es-modules/Stock/Indicators/ATR/ATRIndicator.js +19 -4
  318. package/es-modules/Stock/Indicators/Aroon/AroonIndicator.js +18 -3
  319. package/es-modules/Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js +9 -3
  320. package/es-modules/Stock/Indicators/BB/BBIndicator.js +11 -5
  321. package/es-modules/Stock/Indicators/CCI/CCIIndicator.js +19 -4
  322. package/es-modules/Stock/Indicators/CMF/CMFIndicator.js +23 -1
  323. package/es-modules/Stock/Indicators/CMO/CMOIndicator.js +18 -2
  324. package/es-modules/Stock/Indicators/Chaikin/ChaikinIndicator.js +10 -3
  325. package/es-modules/Stock/Indicators/DEMA/DEMAIndicator.js +28 -1
  326. package/es-modules/Stock/Indicators/DMI/DMIIndicator.js +18 -7
  327. package/es-modules/Stock/Indicators/DPO/DPOIndicator.js +22 -9
  328. package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +3 -1
  329. package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +13 -1
  330. package/es-modules/Stock/Indicators/IKH/IKHIndicator.js +37 -16
  331. package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +28 -1
  332. package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +15 -2
  333. package/es-modules/Stock/Indicators/LinearRegression/{LinearRegression.js → LinearRegressionIndicator.js} +14 -2
  334. package/es-modules/Stock/Indicators/LinearRegressionAngle/{LinearRegressionAngle.js → LinearRegressionAngleIndicator.js} +15 -8
  335. package/es-modules/Stock/Indicators/LinearRegressionIntercept/{LinearRegressionIntercept.js → LinearRegressionInterceptIndicator.js} +14 -2
  336. package/es-modules/Stock/Indicators/LinearRegressionSlopes/{LinearRegressionSlopes.js → LinearRegressionSlopesIndicator.js} +14 -2
  337. package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +47 -23
  338. package/es-modules/Stock/Indicators/MFI/MFIIndicator.js +26 -11
  339. package/es-modules/Stock/Indicators/Momentum/MomentumIndicator.js +33 -3
  340. package/es-modules/Stock/Indicators/MultipleLinesComposition.js +85 -95
  341. package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +19 -2
  342. package/es-modules/Stock/Indicators/OBV/OBVIndicator.js +13 -1
  343. package/es-modules/Stock/Indicators/PC/PCIndicator.js +16 -9
  344. package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +17 -5
  345. package/es-modules/Stock/Indicators/PSAR/PSARIndicator.js +19 -4
  346. package/es-modules/Stock/Indicators/PivotPoints/PivotPointsIndicator.js +19 -7
  347. package/es-modules/Stock/Indicators/PivotPoints/PivotPointsPoint.js +19 -13
  348. package/es-modules/Stock/Indicators/PriceEnvelopes/PriceEnvelopesIndicator.js +28 -1
  349. package/es-modules/Stock/Indicators/ROC/ROCIndicator.js +18 -3
  350. package/es-modules/Stock/Indicators/RSI/RSIIndicator.js +23 -3
  351. package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +4 -2
  352. package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +28 -1
  353. package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +18 -1
  354. package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +23 -7
  355. package/es-modules/Stock/Indicators/TEMA/TEMAIndicator.js +3 -1
  356. package/es-modules/Stock/Indicators/TRIX/TRIXIndicator.js +28 -1
  357. package/es-modules/Stock/Indicators/TrendLine/TrendLineIndicator.js +17 -5
  358. package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +35 -4
  359. package/es-modules/Stock/Indicators/VBP/VBPPoint.js +9 -7
  360. package/es-modules/Stock/Indicators/VWAP/VWAPIndicator.js +14 -2
  361. package/es-modules/Stock/Indicators/WMA/WMAIndicator.js +33 -3
  362. package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +13 -1
  363. package/es-modules/Stock/Indicators/Zigzag/ZigzagIndicator.js +14 -2
  364. package/es-modules/Stock/StockToolbar.js +568 -0
  365. package/es-modules/Stock/StockTools.js +256 -0
  366. package/es-modules/Stock/StockToolsBindings.js +140 -647
  367. package/es-modules/Stock/StockToolsDefaults.js +1190 -0
  368. package/es-modules/Stock/StockToolsGui.js +150 -1771
  369. package/es-modules/Stock/StockToolsUtilities.js +423 -0
  370. package/es-modules/masters/highcharts-3d.src.js +5 -4
  371. package/es-modules/masters/highcharts-gantt.src.js +1 -1
  372. package/es-modules/masters/highcharts-more.src.js +7 -6
  373. package/es-modules/masters/highcharts.src.js +5 -2
  374. package/es-modules/masters/highmaps.src.js +1 -1
  375. package/es-modules/masters/highstock.src.js +1 -1
  376. package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  377. package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  378. package/es-modules/masters/indicators/ao.src.js +1 -1
  379. package/es-modules/masters/indicators/apo.src.js +1 -1
  380. package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  381. package/es-modules/masters/indicators/aroon.src.js +1 -1
  382. package/es-modules/masters/indicators/atr.src.js +1 -1
  383. package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  384. package/es-modules/masters/indicators/cci.src.js +1 -1
  385. package/es-modules/masters/indicators/chaikin.src.js +1 -1
  386. package/es-modules/masters/indicators/cmf.src.js +1 -1
  387. package/es-modules/masters/indicators/cmo.src.js +1 -1
  388. package/es-modules/masters/indicators/dema.src.js +1 -1
  389. package/es-modules/masters/indicators/disparity-index.src.js +1 -1
  390. package/es-modules/masters/indicators/dmi.src.js +1 -1
  391. package/es-modules/masters/indicators/dpo.src.js +1 -1
  392. package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  393. package/es-modules/masters/indicators/indicators-all.src.js +5 -7
  394. package/es-modules/masters/indicators/indicators.src.js +1 -1
  395. package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  396. package/es-modules/masters/indicators/klinger.src.js +1 -1
  397. package/es-modules/masters/indicators/macd.src.js +1 -1
  398. package/es-modules/masters/indicators/mfi.src.js +1 -1
  399. package/es-modules/masters/indicators/momentum.src.js +1 -1
  400. package/es-modules/masters/indicators/natr.src.js +1 -1
  401. package/es-modules/masters/indicators/obv.src.js +1 -1
  402. package/es-modules/masters/indicators/pivot-points.src.js +1 -1
  403. package/es-modules/masters/indicators/ppo.src.js +1 -1
  404. package/es-modules/masters/indicators/price-channel.src.js +1 -1
  405. package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  406. package/es-modules/masters/indicators/psar.src.js +1 -1
  407. package/es-modules/masters/indicators/regressions.src.js +5 -5
  408. package/es-modules/masters/indicators/roc.src.js +1 -1
  409. package/es-modules/masters/indicators/rsi.src.js +1 -1
  410. package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  411. package/es-modules/masters/indicators/stochastic.src.js +1 -1
  412. package/es-modules/masters/indicators/supertrend.src.js +1 -1
  413. package/es-modules/masters/indicators/tema.src.js +1 -1
  414. package/es-modules/masters/indicators/trendline.src.js +1 -1
  415. package/es-modules/masters/indicators/trix.src.js +1 -1
  416. package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  417. package/es-modules/masters/indicators/vwap.src.js +1 -1
  418. package/es-modules/masters/indicators/williams-r.src.js +1 -1
  419. package/es-modules/masters/indicators/wma.src.js +1 -1
  420. package/es-modules/masters/indicators/zigzag.src.js +1 -1
  421. package/es-modules/masters/modules/accessibility.src.js +1 -1
  422. package/es-modules/masters/modules/annotations-advanced.src.js +6 -4
  423. package/es-modules/masters/modules/annotations.src.js +6 -4
  424. package/es-modules/masters/modules/arc-diagram.src.js +1 -1
  425. package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  426. package/es-modules/masters/modules/boost-canvas.src.js +1 -1
  427. package/es-modules/masters/modules/boost.src.js +6 -2
  428. package/es-modules/masters/modules/broken-axis.src.js +1 -1
  429. package/es-modules/masters/modules/bullet.src.js +1 -1
  430. package/es-modules/masters/modules/coloraxis.src.js +1 -1
  431. package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  432. package/es-modules/masters/modules/cylinder.src.js +1 -1
  433. package/es-modules/masters/modules/data.src.js +2 -1
  434. package/es-modules/masters/modules/datagrouping.src.js +1 -1
  435. package/es-modules/masters/modules/debugger.src.js +5 -3
  436. package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  437. package/es-modules/masters/modules/dotplot.src.js +1 -1
  438. package/es-modules/masters/modules/drag-panes.src.js +1 -1
  439. package/es-modules/masters/modules/draggable-points.src.js +1 -1
  440. package/es-modules/masters/modules/drilldown.src.js +1 -1
  441. package/es-modules/masters/modules/dumbbell.src.js +1 -1
  442. package/es-modules/masters/modules/export-data.src.js +5 -2
  443. package/es-modules/masters/modules/exporting.src.js +1 -2
  444. package/es-modules/masters/modules/full-screen.src.js +6 -2
  445. package/es-modules/masters/modules/funnel.src.js +1 -1
  446. package/es-modules/masters/modules/funnel3d.src.js +1 -1
  447. package/es-modules/masters/modules/gantt.src.js +3 -2
  448. package/es-modules/masters/modules/grid-axis.src.js +1 -1
  449. package/es-modules/masters/modules/heatmap.src.js +1 -1
  450. package/es-modules/masters/modules/heikinashi.src.js +1 -1
  451. package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  452. package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
  453. package/es-modules/masters/modules/item-series.src.js +1 -1
  454. package/es-modules/masters/modules/lollipop.src.js +1 -1
  455. package/es-modules/masters/modules/map.src.js +2 -2
  456. package/es-modules/masters/modules/marker-clusters.src.js +1 -1
  457. package/es-modules/masters/modules/networkgraph.src.js +5 -2
  458. package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  459. package/es-modules/masters/modules/offline-exporting.src.js +1 -1
  460. package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
  461. package/es-modules/masters/modules/oldie.src.js +1 -1
  462. package/es-modules/masters/modules/organization.src.js +1 -1
  463. package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
  464. package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  465. package/es-modules/masters/modules/pareto.src.js +1 -1
  466. package/es-modules/masters/modules/pathfinder.src.js +1 -1
  467. package/es-modules/masters/modules/pattern-fill.src.js +1 -1
  468. package/es-modules/masters/modules/price-indicator.src.js +1 -1
  469. package/es-modules/masters/modules/pyramid3d.src.js +1 -1
  470. package/es-modules/masters/modules/sankey.src.js +1 -1
  471. package/es-modules/masters/modules/series-label.src.js +5 -2
  472. package/es-modules/masters/modules/series-on-point.src.js +16 -0
  473. package/es-modules/masters/modules/solid-gauge.src.js +1 -1
  474. package/es-modules/masters/modules/sonification.src.js +2 -6
  475. package/es-modules/masters/modules/static-scale.src.js +1 -1
  476. package/es-modules/masters/modules/stock-tools.src.js +10 -3
  477. package/es-modules/masters/modules/stock.src.js +1 -1
  478. package/es-modules/masters/modules/streamgraph.src.js +1 -1
  479. package/es-modules/masters/modules/sunburst.src.js +1 -1
  480. package/es-modules/masters/modules/tilemap.src.js +1 -1
  481. package/es-modules/masters/modules/timeline.src.js +1 -1
  482. package/es-modules/masters/modules/treegrid.src.js +2 -2
  483. package/es-modules/masters/modules/treemap.src.js +1 -1
  484. package/es-modules/masters/modules/variable-pie.src.js +1 -1
  485. package/es-modules/masters/modules/variwide.src.js +1 -1
  486. package/es-modules/masters/modules/vector.src.js +1 -1
  487. package/es-modules/masters/modules/venn.src.js +1 -1
  488. package/es-modules/masters/modules/windbarb.src.js +1 -1
  489. package/es-modules/masters/modules/wordcloud.src.js +1 -1
  490. package/es-modules/masters/modules/xrange.src.js +5 -2
  491. package/es-modules/masters/themes/avocado.src.js +1 -1
  492. package/es-modules/masters/themes/brand-dark.src.js +1 -1
  493. package/es-modules/masters/themes/brand-light.src.js +1 -1
  494. package/es-modules/masters/themes/dark-blue.src.js +1 -1
  495. package/es-modules/masters/themes/dark-green.src.js +1 -1
  496. package/es-modules/masters/themes/dark-unica.src.js +1 -1
  497. package/es-modules/masters/themes/gray.src.js +1 -1
  498. package/es-modules/masters/themes/grid-light.src.js +1 -1
  499. package/es-modules/masters/themes/grid.src.js +1 -1
  500. package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
  501. package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
  502. package/es-modules/masters/themes/sand-signika.src.js +1 -1
  503. package/es-modules/masters/themes/skies.src.js +1 -1
  504. package/es-modules/masters/themes/sunset.src.js +1 -1
  505. package/highcharts-3d.js +98 -99
  506. package/highcharts-3d.js.map +1 -1
  507. package/highcharts-3d.src.js +233 -212
  508. package/highcharts-gantt.js +809 -805
  509. package/highcharts-gantt.js.map +1 -1
  510. package/highcharts-gantt.src.js +3817 -3470
  511. package/highcharts-more.d.ts +15 -8
  512. package/highcharts-more.js +201 -195
  513. package/highcharts-more.js.map +1 -1
  514. package/highcharts-more.src.d.ts +15 -8
  515. package/highcharts-more.src.js +7994 -7461
  516. package/highcharts.d.ts +11364 -1136
  517. package/highcharts.js +593 -591
  518. package/highcharts.js.map +1 -1
  519. package/highcharts.src.d.ts +11364 -1136
  520. package/highcharts.src.js +1408 -1117
  521. package/highmaps.js +762 -758
  522. package/highmaps.js.map +1 -1
  523. package/highmaps.src.js +2237 -1721
  524. package/highstock.js +796 -792
  525. package/highstock.js.map +1 -1
  526. package/highstock.src.js +1617 -1224
  527. package/indicators/acceleration-bands.d.ts +1 -17
  528. package/indicators/acceleration-bands.js +11 -12
  529. package/indicators/acceleration-bands.js.map +1 -1
  530. package/indicators/acceleration-bands.src.d.ts +1 -17
  531. package/indicators/acceleration-bands.src.js +99 -101
  532. package/indicators/accumulation-distribution.js +1 -1
  533. package/indicators/accumulation-distribution.js.map +1 -1
  534. package/indicators/accumulation-distribution.src.js +6 -1
  535. package/indicators/ao.js +6 -6
  536. package/indicators/ao.js.map +1 -1
  537. package/indicators/ao.src.js +25 -16
  538. package/indicators/apo.js +1 -1
  539. package/indicators/apo.js.map +1 -1
  540. package/indicators/apo.src.js +6 -1
  541. package/indicators/aroon-oscillator.d.ts +1 -17
  542. package/indicators/aroon-oscillator.js +10 -10
  543. package/indicators/aroon-oscillator.js.map +1 -1
  544. package/indicators/aroon-oscillator.src.d.ts +1 -17
  545. package/indicators/aroon-oscillator.src.js +95 -101
  546. package/indicators/aroon.d.ts +1 -17
  547. package/indicators/aroon.js +11 -11
  548. package/indicators/aroon.js.map +1 -1
  549. package/indicators/aroon.src.d.ts +1 -17
  550. package/indicators/aroon.src.js +104 -101
  551. package/indicators/atr.js +1 -1
  552. package/indicators/atr.js.map +1 -1
  553. package/indicators/atr.src.js +17 -4
  554. package/indicators/bollinger-bands.d.ts +1 -17
  555. package/indicators/bollinger-bands.js +11 -12
  556. package/indicators/bollinger-bands.js.map +1 -1
  557. package/indicators/bollinger-bands.src.d.ts +1 -17
  558. package/indicators/bollinger-bands.src.js +97 -103
  559. package/indicators/cci.js +1 -1
  560. package/indicators/cci.js.map +1 -1
  561. package/indicators/cci.src.js +17 -4
  562. package/indicators/chaikin.js +8 -8
  563. package/indicators/chaikin.js.map +1 -1
  564. package/indicators/chaikin.src.js +13 -5
  565. package/indicators/cmf.js +1 -1
  566. package/indicators/cmf.js.map +1 -1
  567. package/indicators/cmf.src.js +21 -1
  568. package/indicators/cmo.js +1 -1
  569. package/indicators/cmo.js.map +1 -1
  570. package/indicators/cmo.src.js +16 -2
  571. package/indicators/dema.js +1 -1
  572. package/indicators/dema.js.map +1 -1
  573. package/indicators/dema.src.js +26 -1
  574. package/indicators/disparity-index.js +1 -1
  575. package/indicators/disparity-index.src.js +1 -1
  576. package/indicators/dmi.js +12 -12
  577. package/indicators/dmi.js.map +1 -1
  578. package/indicators/dmi.src.js +104 -105
  579. package/indicators/dpo.js +1 -1
  580. package/indicators/dpo.js.map +1 -1
  581. package/indicators/dpo.src.js +20 -9
  582. package/indicators/ichimoku-kinko-hyo.js +1 -1
  583. package/indicators/ichimoku-kinko-hyo.js.map +1 -1
  584. package/indicators/ichimoku-kinko-hyo.src.js +35 -16
  585. package/indicators/indicators-all.d.ts +1 -17
  586. package/indicators/indicators-all.js +200 -199
  587. package/indicators/indicators-all.js.map +1 -1
  588. package/indicators/indicators-all.src.d.ts +1 -17
  589. package/indicators/indicators-all.src.js +882 -284
  590. package/indicators/indicators.js +1 -1
  591. package/indicators/indicators.js.map +1 -1
  592. package/indicators/indicators.src.js +12 -2
  593. package/indicators/keltner-channels.d.ts +1 -17
  594. package/indicators/keltner-channels.js +11 -12
  595. package/indicators/keltner-channels.js.map +1 -1
  596. package/indicators/keltner-channels.src.d.ts +1 -17
  597. package/indicators/keltner-channels.src.js +114 -99
  598. package/indicators/klinger.js +14 -14
  599. package/indicators/klinger.js.map +1 -1
  600. package/indicators/klinger.src.js +101 -102
  601. package/indicators/macd.js +10 -9
  602. package/indicators/macd.js.map +1 -1
  603. package/indicators/macd.src.js +46 -25
  604. package/indicators/mfi.js +1 -1
  605. package/indicators/mfi.js.map +1 -1
  606. package/indicators/mfi.src.js +24 -11
  607. package/indicators/momentum.js +1 -1
  608. package/indicators/momentum.js.map +1 -1
  609. package/indicators/momentum.src.js +31 -3
  610. package/indicators/natr.js +1 -1
  611. package/indicators/natr.js.map +1 -1
  612. package/indicators/natr.src.js +17 -3
  613. package/indicators/obv.js +1 -1
  614. package/indicators/obv.js.map +1 -1
  615. package/indicators/obv.src.js +11 -1
  616. package/indicators/pivot-points.js +1 -1
  617. package/indicators/pivot-points.js.map +1 -1
  618. package/indicators/pivot-points.src.js +32 -19
  619. package/indicators/ppo.js +1 -1
  620. package/indicators/ppo.js.map +1 -1
  621. package/indicators/ppo.src.js +15 -5
  622. package/indicators/price-channel.d.ts +1 -17
  623. package/indicators/price-channel.js +11 -11
  624. package/indicators/price-channel.js.map +1 -1
  625. package/indicators/price-channel.src.d.ts +1 -17
  626. package/indicators/price-channel.src.js +102 -107
  627. package/indicators/price-envelopes.js +1 -1
  628. package/indicators/price-envelopes.js.map +1 -1
  629. package/indicators/price-envelopes.src.js +26 -1
  630. package/indicators/psar.js +1 -1
  631. package/indicators/psar.js.map +1 -1
  632. package/indicators/psar.src.js +17 -4
  633. package/indicators/regressions.js +12 -11
  634. package/indicators/regressions.js.map +1 -1
  635. package/indicators/regressions.src.js +50 -15
  636. package/indicators/roc.js +1 -1
  637. package/indicators/roc.js.map +1 -1
  638. package/indicators/roc.src.js +16 -3
  639. package/indicators/rsi.js +1 -1
  640. package/indicators/rsi.js.map +1 -1
  641. package/indicators/rsi.src.js +21 -3
  642. package/indicators/slow-stochastic.js +1 -1
  643. package/indicators/slow-stochastic.js.map +1 -1
  644. package/indicators/slow-stochastic.src.js +26 -1
  645. package/indicators/stochastic.d.ts +1 -17
  646. package/indicators/stochastic.js +12 -12
  647. package/indicators/stochastic.js.map +1 -1
  648. package/indicators/stochastic.src.d.ts +1 -17
  649. package/indicators/stochastic.src.js +104 -99
  650. package/indicators/supertrend.js +7 -7
  651. package/indicators/supertrend.js.map +1 -1
  652. package/indicators/supertrend.src.js +21 -9
  653. package/indicators/tema.js +1 -1
  654. package/indicators/tema.src.js +1 -1
  655. package/indicators/trendline.js +1 -1
  656. package/indicators/trendline.js.map +1 -1
  657. package/indicators/trendline.src.js +15 -5
  658. package/indicators/trix.js +1 -1
  659. package/indicators/trix.js.map +1 -1
  660. package/indicators/trix.src.js +26 -1
  661. package/indicators/volume-by-price.js +17 -17
  662. package/indicators/volume-by-price.js.map +1 -1
  663. package/indicators/volume-by-price.src.js +38 -10
  664. package/indicators/vwap.js +1 -1
  665. package/indicators/vwap.js.map +1 -1
  666. package/indicators/vwap.src.js +12 -2
  667. package/indicators/williams-r.js +1 -1
  668. package/indicators/williams-r.js.map +1 -1
  669. package/indicators/williams-r.src.js +11 -1
  670. package/indicators/wma.js +1 -1
  671. package/indicators/wma.js.map +1 -1
  672. package/indicators/wma.src.js +31 -3
  673. package/indicators/zigzag.js +1 -1
  674. package/indicators/zigzag.js.map +1 -1
  675. package/indicators/zigzag.src.js +12 -2
  676. package/modules/accessibility.js +246 -242
  677. package/modules/accessibility.js.map +1 -1
  678. package/modules/accessibility.src.js +797 -664
  679. package/modules/annotations-advanced.d.ts +1 -1
  680. package/modules/annotations-advanced.js +193 -192
  681. package/modules/annotations-advanced.js.map +1 -1
  682. package/modules/annotations-advanced.src.d.ts +1 -1
  683. package/modules/annotations-advanced.src.js +9229 -8589
  684. package/modules/annotations.d.ts +1 -1
  685. package/modules/annotations.js +128 -126
  686. package/modules/annotations.js.map +1 -1
  687. package/modules/annotations.src.d.ts +1 -1
  688. package/modules/annotations.src.js +6190 -5528
  689. package/modules/arc-diagram.js +7 -7
  690. package/modules/arc-diagram.js.map +1 -1
  691. package/modules/arc-diagram.src.js +10 -2
  692. package/modules/arrow-symbols.js +1 -1
  693. package/modules/arrow-symbols.src.js +1 -1
  694. package/modules/boost-canvas.d.ts +19 -0
  695. package/modules/boost-canvas.js +81 -15
  696. package/modules/boost-canvas.js.map +1 -1
  697. package/modules/boost-canvas.src.d.ts +19 -0
  698. package/modules/boost-canvas.src.js +3342 -52
  699. package/modules/boost.d.ts +8 -26
  700. package/modules/boost.js +88 -80
  701. package/modules/boost.js.map +1 -1
  702. package/modules/boost.src.d.ts +8 -26
  703. package/modules/boost.src.js +2435 -1889
  704. package/modules/broken-axis.js +2 -2
  705. package/modules/broken-axis.js.map +1 -1
  706. package/modules/broken-axis.src.js +2 -2
  707. package/modules/bullet.js +1 -1
  708. package/modules/bullet.js.map +1 -1
  709. package/modules/bullet.src.js +2 -5
  710. package/modules/coloraxis.js +2 -2
  711. package/modules/coloraxis.js.map +1 -1
  712. package/modules/coloraxis.src.js +9 -5
  713. package/modules/current-date-indicator.js +1 -1
  714. package/modules/current-date-indicator.src.js +2 -2
  715. package/modules/cylinder.js +9 -9
  716. package/modules/cylinder.js.map +1 -1
  717. package/modules/cylinder.src.js +2 -2
  718. package/modules/data.d.ts +12 -12
  719. package/modules/data.js +33 -34
  720. package/modules/data.js.map +1 -1
  721. package/modules/data.src.d.ts +12 -12
  722. package/modules/data.src.js +862 -829
  723. package/modules/datagrouping.d.ts +22 -0
  724. package/modules/datagrouping.js +9 -9
  725. package/modules/datagrouping.js.map +1 -1
  726. package/modules/datagrouping.src.d.ts +22 -0
  727. package/modules/datagrouping.src.js +69 -29
  728. package/modules/debugger.js +8 -6
  729. package/modules/debugger.js.map +1 -1
  730. package/modules/debugger.src.js +85 -40
  731. package/modules/dependency-wheel.js +12 -12
  732. package/modules/dependency-wheel.js.map +1 -1
  733. package/modules/dependency-wheel.src.js +41 -14
  734. package/modules/dotplot.js +1 -1
  735. package/modules/dotplot.src.js +1 -1
  736. package/modules/drag-panes.js +1 -1
  737. package/modules/drag-panes.src.js +2 -2
  738. package/modules/draggable-points.js +5 -5
  739. package/modules/draggable-points.js.map +1 -1
  740. package/modules/draggable-points.src.js +5 -4
  741. package/modules/drilldown.d.ts +0 -10
  742. package/modules/drilldown.js +37 -37
  743. package/modules/drilldown.js.map +1 -1
  744. package/modules/drilldown.src.d.ts +0 -10
  745. package/modules/drilldown.src.js +59 -25
  746. package/modules/dumbbell.d.ts +4 -0
  747. package/modules/dumbbell.js +17 -17
  748. package/modules/dumbbell.js.map +1 -1
  749. package/modules/dumbbell.src.d.ts +4 -0
  750. package/modules/dumbbell.src.js +24 -12
  751. package/modules/export-data.js +25 -22
  752. package/modules/export-data.js.map +1 -1
  753. package/modules/export-data.src.js +641 -469
  754. package/modules/exporting.d.ts +8 -8
  755. package/modules/exporting.js +39 -39
  756. package/modules/exporting.js.map +1 -1
  757. package/modules/exporting.src.d.ts +8 -8
  758. package/modules/exporting.src.js +442 -319
  759. package/modules/full-screen.js +8 -8
  760. package/modules/full-screen.js.map +1 -1
  761. package/modules/full-screen.src.js +196 -78
  762. package/modules/funnel.js +1 -1
  763. package/modules/funnel.src.js +3 -3
  764. package/modules/funnel3d.js +2 -2
  765. package/modules/funnel3d.js.map +1 -1
  766. package/modules/funnel3d.src.js +2 -2
  767. package/modules/gantt.js +219 -217
  768. package/modules/gantt.js.map +1 -1
  769. package/modules/gantt.src.js +2420 -2364
  770. package/modules/grid-axis.js +23 -23
  771. package/modules/grid-axis.js.map +1 -1
  772. package/modules/grid-axis.src.js +890 -891
  773. package/modules/heatmap.js +40 -40
  774. package/modules/heatmap.js.map +1 -1
  775. package/modules/heatmap.src.js +137 -108
  776. package/modules/heikinashi.js +1 -1
  777. package/modules/heikinashi.src.js +1 -1
  778. package/modules/histogram-bellcurve.js +1 -1
  779. package/modules/histogram-bellcurve.src.js +1 -1
  780. package/modules/hollowcandlestick.js +1 -1
  781. package/modules/hollowcandlestick.src.js +9 -9
  782. package/modules/item-series.js +1 -1
  783. package/modules/item-series.src.js +1 -1
  784. package/modules/lollipop.js +6 -6
  785. package/modules/lollipop.js.map +1 -1
  786. package/modules/lollipop.src.js +37 -22
  787. package/modules/map.d.ts +3 -3
  788. package/modules/map.js +171 -169
  789. package/modules/map.js.map +1 -1
  790. package/modules/map.src.d.ts +3 -3
  791. package/modules/map.src.js +830 -605
  792. package/modules/marker-clusters.js +1 -1
  793. package/modules/marker-clusters.js.map +1 -1
  794. package/modules/marker-clusters.src.js +4 -6
  795. package/modules/networkgraph.d.ts +1 -17
  796. package/modules/networkgraph.js +55 -50
  797. package/modules/networkgraph.js.map +1 -1
  798. package/modules/networkgraph.src.d.ts +1 -17
  799. package/modules/networkgraph.src.js +2339 -2008
  800. package/modules/no-data-to-display.js +1 -1
  801. package/modules/no-data-to-display.src.js +2 -2
  802. package/modules/offline-exporting.js +3 -3
  803. package/modules/offline-exporting.js.map +1 -1
  804. package/modules/offline-exporting.src.js +5 -5
  805. package/modules/oldie-polyfills.js +1 -1
  806. package/modules/oldie-polyfills.src.js +1 -1
  807. package/modules/oldie.js +2 -2
  808. package/modules/oldie.src.js +3 -3
  809. package/modules/organization.js +15 -15
  810. package/modules/organization.js.map +1 -1
  811. package/modules/organization.src.js +12 -4
  812. package/modules/overlapping-datalabels.js +1 -1
  813. package/modules/overlapping-datalabels.src.js +1 -1
  814. package/modules/parallel-coordinates.js +11 -11
  815. package/modules/parallel-coordinates.js.map +1 -1
  816. package/modules/parallel-coordinates.src.js +14 -9
  817. package/modules/pareto.js +1 -1
  818. package/modules/pareto.src.js +1 -1
  819. package/modules/pathfinder.js +1 -1
  820. package/modules/pathfinder.src.js +1 -1
  821. package/modules/pattern-fill.js +15 -14
  822. package/modules/pattern-fill.js.map +1 -1
  823. package/modules/pattern-fill.src.js +15 -2
  824. package/modules/price-indicator.js +1 -1
  825. package/modules/price-indicator.src.js +1 -1
  826. package/modules/pyramid3d.js +1 -1
  827. package/modules/pyramid3d.src.js +1 -1
  828. package/modules/sankey.d.ts +1 -17
  829. package/modules/sankey.js +32 -32
  830. package/modules/sankey.js.map +1 -1
  831. package/modules/sankey.src.d.ts +1 -17
  832. package/modules/sankey.src.js +102 -57
  833. package/modules/series-label.js +18 -18
  834. package/modules/series-label.js.map +1 -1
  835. package/modules/series-label.src.js +474 -387
  836. package/modules/series-on-point.js +18 -0
  837. package/modules/series-on-point.js.map +1 -0
  838. package/modules/series-on-point.src.js +468 -0
  839. package/modules/solid-gauge.js +4 -4
  840. package/modules/solid-gauge.js.map +1 -1
  841. package/modules/solid-gauge.src.js +6 -6
  842. package/modules/sonification.d.ts +2 -2
  843. package/modules/sonification.js +1 -1
  844. package/modules/sonification.js.map +1 -1
  845. package/modules/sonification.src.d.ts +2 -2
  846. package/modules/sonification.src.js +4 -8
  847. package/modules/static-scale.js +1 -1
  848. package/modules/static-scale.src.js +1 -1
  849. package/modules/stock-tools.d.ts +1 -23
  850. package/modules/stock-tools.js +109 -179
  851. package/modules/stock-tools.js.map +1 -1
  852. package/modules/stock-tools.src.d.ts +1 -23
  853. package/modules/stock-tools.src.js +2652 -6347
  854. package/modules/stock.d.ts +8 -0
  855. package/modules/stock.js +205 -204
  856. package/modules/stock.js.map +1 -1
  857. package/modules/stock.src.d.ts +8 -0
  858. package/modules/stock.src.js +208 -106
  859. package/modules/streamgraph.js +1 -1
  860. package/modules/streamgraph.src.js +1 -1
  861. package/modules/sunburst.js +73 -73
  862. package/modules/sunburst.js.map +1 -1
  863. package/modules/sunburst.src.js +251 -193
  864. package/modules/tilemap.js +1 -1
  865. package/modules/tilemap.src.js +1 -1
  866. package/modules/timeline.js +1 -1
  867. package/modules/timeline.js.map +1 -1
  868. package/modules/timeline.src.js +6 -4
  869. package/modules/treegrid.js +57 -57
  870. package/modules/treegrid.js.map +1 -1
  871. package/modules/treegrid.src.js +1908 -1901
  872. package/modules/treemap.js +54 -53
  873. package/modules/treemap.js.map +1 -1
  874. package/modules/treemap.src.js +217 -183
  875. package/modules/variable-pie.js +1 -1
  876. package/modules/variable-pie.src.js +1 -1
  877. package/modules/variwide.js +1 -1
  878. package/modules/variwide.src.js +1 -1
  879. package/modules/vector.js +2 -2
  880. package/modules/vector.js.map +1 -1
  881. package/modules/vector.src.js +3 -5
  882. package/modules/venn.js +31 -31
  883. package/modules/venn.js.map +1 -1
  884. package/modules/venn.src.js +82 -111
  885. package/modules/windbarb.js +1 -1
  886. package/modules/windbarb.src.js +1 -1
  887. package/modules/wordcloud.js +23 -23
  888. package/modules/wordcloud.js.map +1 -1
  889. package/modules/wordcloud.src.js +84 -113
  890. package/modules/xrange.js +17 -17
  891. package/modules/xrange.js.map +1 -1
  892. package/modules/xrange.src.js +411 -397
  893. package/package.json +1 -1
  894. package/themes/avocado.js +1 -1
  895. package/themes/avocado.src.js +1 -1
  896. package/themes/brand-dark.js +1 -1
  897. package/themes/brand-dark.src.js +1 -1
  898. package/themes/brand-light.js +1 -1
  899. package/themes/brand-light.src.js +1 -1
  900. package/themes/dark-blue.js +1 -1
  901. package/themes/dark-blue.src.js +1 -1
  902. package/themes/dark-green.js +1 -1
  903. package/themes/dark-green.src.js +1 -1
  904. package/themes/dark-unica.js +1 -1
  905. package/themes/dark-unica.src.js +1 -1
  906. package/themes/gray.js +1 -1
  907. package/themes/gray.src.js +1 -1
  908. package/themes/grid-light.js +1 -1
  909. package/themes/grid-light.src.js +1 -1
  910. package/themes/grid.js +1 -1
  911. package/themes/grid.src.js +1 -1
  912. package/themes/high-contrast-dark.js +2 -2
  913. package/themes/high-contrast-dark.src.js +11 -11
  914. package/themes/high-contrast-light.js +2 -2
  915. package/themes/high-contrast-light.src.js +10 -10
  916. package/themes/sand-signika.js +1 -1
  917. package/themes/sand-signika.src.js +1 -1
  918. package/themes/skies.js +1 -1
  919. package/themes/skies.src.js +1 -1
  920. package/themes/sunset.js +1 -1
  921. package/themes/sunset.src.js +1 -1
  922. package/es-modules/Core/Axis/StackingAxis.js +0 -216
  923. package/es-modules/Core/Axis/TreeGridAxis.js +0 -720
  924. package/es-modules/Core/Axis/TreeGridTick.js +0 -317
  925. package/es-modules/Extensions/Annotations/Annotations.js +0 -1449
  926. package/es-modules/Extensions/Annotations/Mixins/MarkerMixin.js +0 -179
  927. package/es-modules/Extensions/Annotations/Popup.js +0 -1123
  928. package/es-modules/Extensions/Boost/BoostAttach.js +0 -150
  929. package/es-modules/Extensions/Boost/BoostInit.js +0 -323
  930. package/es-modules/Extensions/Boost/BoostOptions.js +0 -245
  931. package/es-modules/Extensions/Boost/BoostOverrides.js +0 -386
  932. package/es-modules/Extensions/Boost/BoostUtils.js +0 -255
  933. package/es-modules/Extensions/Boost/WGLVBuffer.js +0 -153
  934. package/es-modules/Extensions/FullScreen.js +0 -240
  935. package/es-modules/Extensions/Polar.js +0 -740
  936. package/es-modules/Extensions/Stacking.js +0 -517
  937. package/es-modules/Series/ColorMapMixin.js +0 -84
  938. package/es-modules/Series/DrawPointComposition.js +0 -114
  939. package/es-modules/Series/Networkgraph/DraggableNodes.js +0 -132
  940. package/es-modules/Series/Networkgraph/Integrations.js +0 -348
  941. package/es-modules/Series/Networkgraph/Networkgraph.js +0 -1178
  942. package/es-modules/Series/XRange/XRangeComposition.js +0 -49
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts Gantt JS v10.0.0 (2022-03-07)
2
+ * @license Highcharts Gantt JS v10.2.1 (2022-08-29)
3
3
  *
4
4
  * Tree Grid
5
5
  *
@@ -37,7 +37,7 @@
37
37
  }
38
38
  }
39
39
  }
40
- _registerModule(_modules, 'Core/Axis/BrokenAxis.js', [_modules['Extensions/Stacking.js'], _modules['Core/Utilities.js']], function (StackItem, U) {
40
+ _registerModule(_modules, 'Core/Axis/BrokenAxis.js', [_modules['Core/Axis/Stacking/StackItem.js'], _modules['Core/Utilities.js']], function (StackItem, U) {
41
41
  /* *
42
42
  *
43
43
  * (c) 2009-2021 Torstein Honsi
@@ -705,19 +705,49 @@
705
705
  pick = U.pick,
706
706
  timeUnits = U.timeUnits,
707
707
  wrap = U.wrap;
708
+ /* *
709
+ *
710
+ * Enums
711
+ *
712
+ * */
713
+ /**
714
+ * Enum for which side the axis is on. Maps to axis.side.
715
+ * @private
716
+ */
717
+ var GridAxisSide;
718
+ (function (GridAxisSide) {
719
+ GridAxisSide[GridAxisSide["top"] = 0] = "top";
720
+ GridAxisSide[GridAxisSide["right"] = 1] = "right";
721
+ GridAxisSide[GridAxisSide["bottom"] = 2] = "bottom";
722
+ GridAxisSide[GridAxisSide["left"] = 3] = "left";
723
+ })(GridAxisSide || (GridAxisSide = {}));
724
+ /* *
725
+ *
726
+ * Constants
727
+ *
728
+ * */
729
+ var composedClasses = [];
708
730
  /* *
709
731
  *
710
732
  * Functions
711
733
  *
712
734
  * */
713
- /* eslint-disable require-jsdoc */
735
+ /**
736
+ * @private
737
+ */
714
738
  function argsToArray(args) {
715
739
  return Array.prototype.slice.call(args, 1);
716
740
  }
741
+ /**
742
+ * @private
743
+ */
717
744
  function isObject(x) {
718
745
  // Always use strict mode
719
746
  return U.isObject(x, true);
720
747
  }
748
+ /**
749
+ * @private
750
+ */
721
751
  function applyGridOptions(axis) {
722
752
  var options = axis.options;
723
753
  // Center-align by default
@@ -742,962 +772,925 @@
742
772
  options.labels.rotation = 0;
743
773
  }
744
774
  /**
745
- * Axis with grid support.
775
+ * Extends axis class with grid support.
746
776
  * @private
747
777
  */
748
- var GridAxis;
749
- (function (GridAxis) {
750
- /* *
751
- *
752
- * Declarations
753
- *
754
- * */
755
- /**
756
- * Enum for which side the axis is on. Maps to axis.side.
757
- * @private
758
- */
759
- var Side;
760
- (function (Side) {
761
- Side[Side["top"] = 0] = "top";
762
- Side[Side["right"] = 1] = "right";
763
- Side[Side["bottom"] = 2] = "bottom";
764
- Side[Side["left"] = 3] = "left";
765
- })(Side = GridAxis.Side || (GridAxis.Side = {}));
766
- /* *
767
- *
768
- * Functions
769
- *
770
- * */
771
- /* eslint-disable valid-jsdoc */
772
- /**
773
- * Extends axis class with grid support.
774
- * @private
775
- */
776
- function compose(AxisClass, ChartClass, TickClass) {
777
- if (AxisClass.keepProps.indexOf('grid') === -1) {
778
- AxisClass.keepProps.push('grid');
779
- AxisClass.prototype.getMaxLabelDimensions = getMaxLabelDimensions;
780
- wrap(AxisClass.prototype, 'unsquish', wrapUnsquish);
781
- // Add event handlers
782
- addEvent(AxisClass, 'init', onInit);
783
- addEvent(AxisClass, 'afterGetOffset', onAfterGetOffset);
784
- addEvent(AxisClass, 'afterGetTitlePosition', onAfterGetTitlePosition);
785
- addEvent(AxisClass, 'afterInit', onAfterInit);
786
- addEvent(AxisClass, 'afterRender', onAfterRender);
787
- addEvent(AxisClass, 'afterSetAxisTranslation', onAfterSetAxisTranslation);
788
- addEvent(AxisClass, 'afterSetOptions', onAfterSetOptions);
789
- addEvent(AxisClass, 'afterSetOptions', onAfterSetOptions2);
790
- addEvent(AxisClass, 'afterSetScale', onAfterSetScale);
791
- addEvent(AxisClass, 'afterTickSize', onAfterTickSize);
792
- addEvent(AxisClass, 'trimTicks', onTrimTicks);
793
- addEvent(AxisClass, 'destroy', onDestroy);
794
- }
778
+ function compose(AxisClass, ChartClass, TickClass) {
779
+ if (composedClasses.indexOf(AxisClass) === -1) {
780
+ composedClasses.push(AxisClass);
781
+ AxisClass.keepProps.push('grid');
782
+ AxisClass.prototype.getMaxLabelDimensions = getMaxLabelDimensions;
783
+ wrap(AxisClass.prototype, 'unsquish', wrapUnsquish);
784
+ // Add event handlers
785
+ addEvent(AxisClass, 'init', onInit);
786
+ addEvent(AxisClass, 'afterGetOffset', onAfterGetOffset);
787
+ addEvent(AxisClass, 'afterGetTitlePosition', onAfterGetTitlePosition);
788
+ addEvent(AxisClass, 'afterInit', onAfterInit);
789
+ addEvent(AxisClass, 'afterRender', onAfterRender);
790
+ addEvent(AxisClass, 'afterSetAxisTranslation', onAfterSetAxisTranslation);
791
+ addEvent(AxisClass, 'afterSetOptions', onAfterSetOptions);
792
+ addEvent(AxisClass, 'afterSetOptions', onAfterSetOptions2);
793
+ addEvent(AxisClass, 'afterSetScale', onAfterSetScale);
794
+ addEvent(AxisClass, 'afterTickSize', onAfterTickSize);
795
+ addEvent(AxisClass, 'trimTicks', onTrimTicks);
796
+ addEvent(AxisClass, 'destroy', onDestroy);
797
+ }
798
+ if (composedClasses.indexOf(ChartClass) === -1) {
795
799
  addEvent(ChartClass, 'afterSetChartSize', onChartAfterSetChartSize);
800
+ }
801
+ if (composedClasses.indexOf(TickClass) === -1) {
796
802
  addEvent(TickClass, 'afterGetLabelPosition', onTickAfterGetLabelPosition);
797
803
  addEvent(TickClass, 'labelFormat', onTickLabelFormat);
798
- return AxisClass;
799
804
  }
800
- GridAxis.compose = compose;
801
- /**
802
- * Get the largest label width and height.
803
- *
804
- * @private
805
- * @function Highcharts.Axis#getMaxLabelDimensions
806
- *
807
- * @param {Highcharts.Dictionary<Highcharts.Tick>} ticks
808
- * All the ticks on one axis.
809
- *
810
- * @param {Array<number|string>} tickPositions
811
- * All the tick positions on one axis.
812
- *
813
- * @return {Highcharts.SizeObject}
814
- * Object containing the properties height and width.
815
- *
816
- * @todo Move this to the generic axis implementation, as it is used there.
817
- */
818
- function getMaxLabelDimensions(ticks, tickPositions) {
819
- var dimensions = {
820
- width: 0,
821
- height: 0
822
- };
823
- tickPositions.forEach(function (pos) {
824
- var tick = ticks[pos];
825
- var labelHeight = 0,
826
- labelWidth = 0,
827
- label;
828
- if (isObject(tick)) {
829
- label = isObject(tick.label) ? tick.label : {};
830
- // Find width and height of label
831
- labelHeight = label.getBBox ? label.getBBox().height : 0;
832
- if (label.textStr && !isNumber(label.textPxLength)) {
833
- label.textPxLength = label.getBBox().width;
834
- }
835
- labelWidth = isNumber(label.textPxLength) ?
836
- // Math.round ensures crisp lines
837
- Math.round(label.textPxLength) :
838
- 0;
839
- if (label.textStr) {
840
- // Set the tickWidth same as the label width after ellipsis
841
- // applied #10281
842
- labelWidth = Math.round(label.getBBox().width);
843
- }
844
- // Update the result if width and/or height are larger
845
- dimensions.height = Math.max(labelHeight, dimensions.height);
846
- dimensions.width = Math.max(labelWidth, dimensions.width);
805
+ return AxisClass;
806
+ }
807
+ /**
808
+ * Get the largest label width and height.
809
+ *
810
+ * @private
811
+ * @function Highcharts.Axis#getMaxLabelDimensions
812
+ *
813
+ * @param {Highcharts.Dictionary<Highcharts.Tick>} ticks
814
+ * All the ticks on one axis.
815
+ *
816
+ * @param {Array<number|string>} tickPositions
817
+ * All the tick positions on one axis.
818
+ *
819
+ * @return {Highcharts.SizeObject}
820
+ * Object containing the properties height and width.
821
+ *
822
+ * @todo Move this to the generic axis implementation, as it is used there.
823
+ */
824
+ function getMaxLabelDimensions(ticks, tickPositions) {
825
+ var dimensions = {
826
+ width: 0,
827
+ height: 0
828
+ };
829
+ tickPositions.forEach(function (pos) {
830
+ var tick = ticks[pos];
831
+ var labelHeight = 0,
832
+ labelWidth = 0,
833
+ label;
834
+ if (isObject(tick)) {
835
+ label = isObject(tick.label) ? tick.label : {};
836
+ // Find width and height of label
837
+ labelHeight = label.getBBox ? label.getBBox().height : 0;
838
+ if (label.textStr && !isNumber(label.textPxLength)) {
839
+ label.textPxLength = label.getBBox().width;
847
840
  }
848
- });
849
- // For tree grid, add indentation
850
- if (this.options.type === 'treegrid' &&
851
- this.treeGrid &&
852
- this.treeGrid.mapOfPosToGridNode) {
853
- var treeDepth = this.treeGrid.mapOfPosToGridNode[-1].height || 0;
854
- dimensions.width += (this.options.labels.indentation *
855
- (treeDepth - 1));
841
+ labelWidth = isNumber(label.textPxLength) ?
842
+ // Math.round ensures crisp lines
843
+ Math.round(label.textPxLength) :
844
+ 0;
845
+ if (label.textStr) {
846
+ // Set the tickWidth same as the label width after ellipsis
847
+ // applied #10281
848
+ labelWidth = Math.round(label.getBBox().width);
849
+ }
850
+ // Update the result if width and/or height are larger
851
+ dimensions.height = Math.max(labelHeight, dimensions.height);
852
+ dimensions.width = Math.max(labelWidth, dimensions.width);
856
853
  }
857
- return dimensions;
854
+ });
855
+ // For tree grid, add indentation
856
+ if (this.options.type === 'treegrid' &&
857
+ this.treeGrid &&
858
+ this.treeGrid.mapOfPosToGridNode) {
859
+ var treeDepth = this.treeGrid.mapOfPosToGridNode[-1].height || 0;
860
+ dimensions.width += (this.options.labels.indentation *
861
+ (treeDepth - 1));
858
862
  }
859
- /**
860
- * Handle columns and getOffset.
861
- * @private
862
- */
863
- function onAfterGetOffset() {
864
- var grid = this.grid;
865
- (grid && grid.columns || []).forEach(function (column) {
866
- column.getOffset();
867
- });
863
+ return dimensions;
864
+ }
865
+ /**
866
+ * Handle columns and getOffset.
867
+ * @private
868
+ */
869
+ function onAfterGetOffset() {
870
+ var grid = this.grid;
871
+ (grid && grid.columns || []).forEach(function (column) {
872
+ column.getOffset();
873
+ });
874
+ }
875
+ /**
876
+ * @private
877
+ */
878
+ function onAfterGetTitlePosition(e) {
879
+ var axis = this;
880
+ var options = axis.options;
881
+ var gridOptions = options.grid || {};
882
+ if (gridOptions.enabled === true) {
883
+ // compute anchor points for each of the title align options
884
+ var axisTitle = axis.axisTitle,
885
+ axisHeight = axis.height,
886
+ horiz = axis.horiz,
887
+ axisLeft = axis.left,
888
+ offset = axis.offset,
889
+ opposite = axis.opposite,
890
+ options_1 = axis.options,
891
+ axisTop = axis.top,
892
+ axisWidth = axis.width;
893
+ var tickSize = axis.tickSize();
894
+ var titleWidth = axisTitle && axisTitle.getBBox().width;
895
+ var xOption = options_1.title.x;
896
+ var yOption = options_1.title.y;
897
+ var titleMargin = pick(options_1.title.margin,
898
+ horiz ? 5 : 10);
899
+ var titleFontSize = axis.chart.renderer.fontMetrics(options_1.title.style.fontSize,
900
+ axisTitle).f;
901
+ var crispCorr = tickSize ? tickSize[0] / 2 : 0;
902
+ // TODO account for alignment
903
+ // the position in the perpendicular direction of the axis
904
+ var offAxis = ((horiz ? axisTop + axisHeight : axisLeft) +
905
+ (horiz ? 1 : -1) * // horizontal axis reverses the margin
906
+ (opposite ? -1 : 1) * // so does opposite axes
907
+ crispCorr +
908
+ (axis.side === GridAxisSide.bottom ? titleFontSize : 0));
909
+ e.titlePosition.x = horiz ?
910
+ axisLeft - (titleWidth || 0) / 2 - titleMargin + xOption :
911
+ offAxis + (opposite ? axisWidth : 0) + offset + xOption;
912
+ e.titlePosition.y = horiz ?
913
+ (offAxis -
914
+ (opposite ? axisHeight : 0) +
915
+ (opposite ? titleFontSize : -titleFontSize) / 2 +
916
+ offset +
917
+ yOption) :
918
+ axisTop - titleMargin + yOption;
868
919
  }
869
- /**
870
- * @private
871
- */
872
- function onAfterGetTitlePosition(e) {
873
- var axis = this;
874
- var options = axis.options;
875
- var gridOptions = options.grid || {};
876
- if (gridOptions.enabled === true) {
877
- // compute anchor points for each of the title align options
878
- var axisTitle = axis.axisTitle,
879
- axisHeight = axis.height,
880
- horiz = axis.horiz,
881
- axisLeft = axis.left,
882
- offset = axis.offset,
883
- opposite = axis.opposite,
884
- options_1 = axis.options,
885
- axisTop = axis.top,
886
- axisWidth = axis.width;
887
- var tickSize = axis.tickSize();
888
- var titleWidth = axisTitle && axisTitle.getBBox().width;
889
- var xOption = options_1.title.x;
890
- var yOption = options_1.title.y;
891
- var titleMargin = pick(options_1.title.margin,
892
- horiz ? 5 : 10);
893
- var titleFontSize = axis.chart.renderer.fontMetrics(options_1.title.style.fontSize,
894
- axisTitle).f;
895
- var crispCorr = tickSize ? tickSize[0] / 2 : 0;
896
- // TODO account for alignment
897
- // the position in the perpendicular direction of the axis
898
- var offAxis = ((horiz ? axisTop + axisHeight : axisLeft) +
899
- (horiz ? 1 : -1) * // horizontal axis reverses the margin
900
- (opposite ? -1 : 1) * // so does opposite axes
901
- crispCorr +
902
- (axis.side === GridAxis.Side.bottom ? titleFontSize : 0));
903
- e.titlePosition.x = horiz ?
904
- axisLeft - (titleWidth || 0) / 2 - titleMargin + xOption :
905
- offAxis + (opposite ? axisWidth : 0) + offset + xOption;
906
- e.titlePosition.y = horiz ?
907
- (offAxis -
908
- (opposite ? axisHeight : 0) +
909
- (opposite ? titleFontSize : -titleFontSize) / 2 +
910
- offset +
911
- yOption) :
912
- axisTop - titleMargin + yOption;
913
- }
920
+ }
921
+ /**
922
+ * @private
923
+ */
924
+ function onAfterInit() {
925
+ var axis = this;
926
+ var chart = axis.chart,
927
+ _a = axis.options.grid,
928
+ gridOptions = _a === void 0 ? {} : _a,
929
+ userOptions = axis.userOptions;
930
+ if (gridOptions.enabled) {
931
+ applyGridOptions(axis);
914
932
  }
915
- /**
916
- * @private
917
- */
918
- function onAfterInit() {
919
- var axis = this;
920
- var chart = axis.chart,
921
- _a = axis.options.grid,
922
- gridOptions = _a === void 0 ? {} : _a,
923
- userOptions = axis.userOptions;
924
- if (gridOptions.enabled) {
925
- applyGridOptions(axis);
926
- }
927
- if (gridOptions.columns) {
928
- var columns = axis.grid.columns = [];
929
- var columnIndex = axis.grid.columnIndex = 0;
930
- // Handle columns, each column is a grid axis
931
- while (++columnIndex < gridOptions.columns.length) {
932
- var columnOptions = merge(userOptions,
933
- gridOptions.columns[gridOptions.columns.length - columnIndex - 1], {
934
- linkedTo: 0,
935
- // Force to behave like category axis
936
- type: 'category',
937
- // Disable by default the scrollbar on the grid axis
938
- scrollbar: {
939
- enabled: false
940
- }
941
- });
942
- delete columnOptions.grid.columns; // Prevent recursion
943
- var column = new Axis(axis.chart,
944
- columnOptions);
945
- column.grid.isColumn = true;
946
- column.grid.columnIndex = columnIndex;
947
- // Remove column axis from chart axes array, and place it
948
- // in the columns array.
949
- erase(chart.axes, column);
950
- erase(chart[axis.coll], column);
951
- columns.push(column);
952
- }
933
+ if (gridOptions.columns) {
934
+ var columns = axis.grid.columns = [];
935
+ var columnIndex = axis.grid.columnIndex = 0;
936
+ // Handle columns, each column is a grid axis
937
+ while (++columnIndex < gridOptions.columns.length) {
938
+ var columnOptions = merge(userOptions,
939
+ gridOptions.columns[gridOptions.columns.length - columnIndex - 1], {
940
+ linkedTo: 0,
941
+ // Force to behave like category axis
942
+ type: 'category',
943
+ // Disable by default the scrollbar on the grid axis
944
+ scrollbar: {
945
+ enabled: false
946
+ }
947
+ });
948
+ delete columnOptions.grid.columns; // Prevent recursion
949
+ var column = new Axis(axis.chart,
950
+ columnOptions);
951
+ column.grid.isColumn = true;
952
+ column.grid.columnIndex = columnIndex;
953
+ // Remove column axis from chart axes array, and place it
954
+ // in the columns array.
955
+ erase(chart.axes, column);
956
+ erase(chart[axis.coll], column);
957
+ columns.push(column);
953
958
  }
954
959
  }
955
- /**
956
- * Draw an extra line on the far side of the outermost axis,
957
- * creating floor/roof/wall of a grid. And some padding.
958
- * ```
959
- * Make this:
960
- * (axis.min) __________________________ (axis.max)
961
- * | | | | |
962
- * Into this:
963
- * (axis.min) __________________________ (axis.max)
964
- * ___|____|____|____|____|__
965
- * ```
966
- * @private
967
- */
968
- function onAfterRender() {
969
- var axis = this,
970
- grid = axis.grid,
971
- options = axis.options,
972
- gridOptions = options.grid || {};
973
- if (gridOptions.enabled === true) {
974
- var min = axis.min || 0,
975
- max = axis.max || 0;
976
- // @todo acutual label padding (top, bottom, left, right)
977
- axis.maxLabelDimensions = axis.getMaxLabelDimensions(axis.ticks, axis.tickPositions);
978
- // Remove right wall before rendering if updating
979
- if (axis.rightWall) {
980
- axis.rightWall.destroy();
981
- }
982
- /*
983
- Draw an extra axis line on outer axes
984
- >
985
- Make this: |______|______|______|___
960
+ }
961
+ /**
962
+ * Draw an extra line on the far side of the outermost axis,
963
+ * creating floor/roof/wall of a grid. And some padding.
964
+ * ```
965
+ * Make this:
966
+ * (axis.min) __________________________ (axis.max)
967
+ * | | | | |
968
+ * Into this:
969
+ * (axis.min) __________________________ (axis.max)
970
+ * ___|____|____|____|____|__
971
+ * ```
972
+ * @private
973
+ */
974
+ function onAfterRender() {
975
+ var axis = this,
976
+ grid = axis.grid,
977
+ options = axis.options,
978
+ gridOptions = options.grid || {};
979
+ if (gridOptions.enabled === true) {
980
+ var min = axis.min || 0,
981
+ max = axis.max || 0;
982
+ // @todo acutual label padding (top, bottom, left, right)
983
+ axis.maxLabelDimensions = axis.getMaxLabelDimensions(axis.ticks, axis.tickPositions);
984
+ // Remove right wall before rendering if updating
985
+ if (axis.rightWall) {
986
+ axis.rightWall.destroy();
987
+ }
988
+ /*
989
+ Draw an extra axis line on outer axes
990
+ >
991
+ Make this: |______|______|______|___
986
992
 
987
- > _________________________
988
- Into this: |______|______|______|__|
989
- */
990
- if (axis.grid && axis.grid.isOuterAxis() && axis.axisLine) {
991
- var lineWidth = options.lineWidth;
992
- if (lineWidth) {
993
- var linePath = axis.getLinePath(lineWidth),
994
- startPoint = linePath[0],
995
- endPoint = linePath[1],
996
- // Negate distance if top or left axis
997
- // Subtract 1px to draw the line at the end of the tick
998
- tickLength = (axis.tickSize('tick') || [1])[0],
999
- distance = (tickLength - 1) * ((axis.side === GridAxis.Side.top ||
1000
- axis.side === GridAxis.Side.left) ? -1 : 1);
1001
- // If axis is horizontal, reposition line path vertically
1002
- if (startPoint[0] === 'M' && endPoint[0] === 'L') {
1003
- if (axis.horiz) {
1004
- startPoint[2] += distance;
1005
- endPoint[2] += distance;
1006
- }
1007
- else {
1008
- startPoint[1] += distance;
1009
- endPoint[1] += distance;
1010
- }
993
+ > _________________________
994
+ Into this: |______|______|______|__|
995
+ */
996
+ if (axis.grid && axis.grid.isOuterAxis() && axis.axisLine) {
997
+ var lineWidth = options.lineWidth;
998
+ if (lineWidth) {
999
+ var linePath = axis.getLinePath(lineWidth),
1000
+ startPoint = linePath[0],
1001
+ endPoint = linePath[1],
1002
+ // Negate distance if top or left axis
1003
+ // Subtract 1px to draw the line at the end of the tick
1004
+ tickLength = (axis.tickSize('tick') || [1])[0],
1005
+ distance = (tickLength - 1) * ((axis.side === GridAxisSide.top ||
1006
+ axis.side === GridAxisSide.left) ? -1 : 1);
1007
+ // If axis is horizontal, reposition line path vertically
1008
+ if (startPoint[0] === 'M' && endPoint[0] === 'L') {
1009
+ if (axis.horiz) {
1010
+ startPoint[2] += distance;
1011
+ endPoint[2] += distance;
1011
1012
  }
1012
- // If it doesn't exist, add an upper and lower border
1013
- // for the vertical grid axis.
1014
- if (!axis.horiz && axis.chart.marginRight) {
1015
- var upperBorderStartPoint = startPoint,
1016
- upperBorderEndPoint = [
1017
- 'L',
1018
- axis.left,
1019
- startPoint[2] || 0
1020
- ],
1021
- upperBorderPath = [
1022
- upperBorderStartPoint,
1023
- upperBorderEndPoint
1024
- ],
1025
- lowerBorderEndPoint = [
1026
- 'L',
1027
- axis.chart.chartWidth - axis.chart.marginRight,
1028
- axis.toPixels(max + axis.tickmarkOffset)
1029
- ],
1030
- lowerBorderStartPoint = [
1031
- 'M',
1032
- endPoint[1] || 0,
1033
- axis.toPixels(max + axis.tickmarkOffset)
1034
- ],
1035
- lowerBorderPath = [
1036
- lowerBorderStartPoint,
1037
- lowerBorderEndPoint
1038
- ];
1039
- if (!axis.grid.upperBorder && min % 1 !== 0) {
1040
- axis.grid.upperBorder = axis.grid.renderBorder(upperBorderPath);
1041
- }
1042
- if (axis.grid.upperBorder) {
1043
- axis.grid.upperBorder.attr({
1044
- stroke: options.lineColor,
1045
- 'stroke-width': options.lineWidth
1046
- });
1047
- axis.grid.upperBorder.animate({
1048
- d: upperBorderPath
1049
- });
1050
- }
1051
- if (!axis.grid.lowerBorder && max % 1 !== 0) {
1052
- axis.grid.lowerBorder = axis.grid.renderBorder(lowerBorderPath);
1053
- }
1054
- if (axis.grid.lowerBorder) {
1055
- axis.grid.lowerBorder.attr({
1056
- stroke: options.lineColor,
1057
- 'stroke-width': options.lineWidth
1058
- });
1059
- axis.grid.lowerBorder.animate({
1060
- d: lowerBorderPath
1061
- });
1062
- }
1013
+ else {
1014
+ startPoint[1] += distance;
1015
+ endPoint[1] += distance;
1063
1016
  }
1064
- // Render an extra line parallel to the existing axes, to
1065
- // close the grid.
1066
- if (!axis.grid.axisLineExtra) {
1067
- axis.grid.axisLineExtra = axis.grid.renderBorder(linePath);
1017
+ }
1018
+ // If it doesn't exist, add an upper and lower border
1019
+ // for the vertical grid axis.
1020
+ if (!axis.horiz && axis.chart.marginRight) {
1021
+ var upperBorderStartPoint = startPoint,
1022
+ upperBorderEndPoint = [
1023
+ 'L',
1024
+ axis.left,
1025
+ startPoint[2] || 0
1026
+ ],
1027
+ upperBorderPath = [
1028
+ upperBorderStartPoint,
1029
+ upperBorderEndPoint
1030
+ ],
1031
+ lowerBorderEndPoint = [
1032
+ 'L',
1033
+ axis.chart.chartWidth - axis.chart.marginRight,
1034
+ axis.toPixels(max + axis.tickmarkOffset)
1035
+ ],
1036
+ lowerBorderStartPoint = [
1037
+ 'M',
1038
+ endPoint[1] || 0,
1039
+ axis.toPixels(max + axis.tickmarkOffset)
1040
+ ],
1041
+ lowerBorderPath = [
1042
+ lowerBorderStartPoint,
1043
+ lowerBorderEndPoint
1044
+ ];
1045
+ if (!axis.grid.upperBorder && min % 1 !== 0) {
1046
+ axis.grid.upperBorder = axis.grid.renderBorder(upperBorderPath);
1068
1047
  }
1069
- else {
1070
- axis.grid.axisLineExtra.attr({
1048
+ if (axis.grid.upperBorder) {
1049
+ axis.grid.upperBorder.attr({
1071
1050
  stroke: options.lineColor,
1072
1051
  'stroke-width': options.lineWidth
1073
1052
  });
1074
- axis.grid.axisLineExtra.animate({
1075
- d: linePath
1053
+ axis.grid.upperBorder.animate({
1054
+ d: upperBorderPath
1055
+ });
1056
+ }
1057
+ if (!axis.grid.lowerBorder && max % 1 !== 0) {
1058
+ axis.grid.lowerBorder = axis.grid.renderBorder(lowerBorderPath);
1059
+ }
1060
+ if (axis.grid.lowerBorder) {
1061
+ axis.grid.lowerBorder.attr({
1062
+ stroke: options.lineColor,
1063
+ 'stroke-width': options.lineWidth
1064
+ });
1065
+ axis.grid.lowerBorder.animate({
1066
+ d: lowerBorderPath
1076
1067
  });
1077
1068
  }
1078
- // show or hide the line depending on options.showEmpty
1079
- axis.axisLine[axis.showAxis ? 'show' : 'hide'](true);
1080
1069
  }
1081
- }
1082
- (grid && grid.columns || []).forEach(function (column) {
1083
- column.render();
1084
- });
1085
- // Manipulate the tick mark visibility
1086
- // based on the axis.max- allows smooth scrolling.
1087
- if (!axis.horiz &&
1088
- axis.chart.hasRendered &&
1089
- (axis.scrollbar ||
1090
- (axis.linkedParent && axis.linkedParent.scrollbar))) {
1091
- var tickmarkOffset = axis.tickmarkOffset,
1092
- lastTick = axis.tickPositions[axis.tickPositions.length - 1],
1093
- firstTick = axis.tickPositions[0];
1094
- var label = void 0,
1095
- tickMark = void 0;
1096
- while ((label = axis.hiddenLabels.pop()) && label.element) {
1097
- label.show(); // #15453
1070
+ // Render an extra line parallel to the existing axes, to
1071
+ // close the grid.
1072
+ if (!axis.grid.axisLineExtra) {
1073
+ axis.grid.axisLineExtra = axis.grid.renderBorder(linePath);
1098
1074
  }
1099
- while ((tickMark = axis.hiddenMarks.pop()) &&
1100
- tickMark.element) {
1101
- tickMark.show(); // #16439
1075
+ else {
1076
+ axis.grid.axisLineExtra.attr({
1077
+ stroke: options.lineColor,
1078
+ 'stroke-width': options.lineWidth
1079
+ });
1080
+ axis.grid.axisLineExtra.animate({
1081
+ d: linePath
1082
+ });
1102
1083
  }
1103
- // Hide/show firts tick label.
1104
- label = axis.ticks[firstTick].label;
1105
- if (label) {
1106
- if (min - firstTick > tickmarkOffset) {
1107
- axis.hiddenLabels.push(label.hide());
1108
- }
1109
- else {
1110
- label.show();
1111
- }
1084
+ // show or hide the line depending on options.showEmpty
1085
+ axis.axisLine[axis.showAxis ? 'show' : 'hide']();
1086
+ }
1087
+ }
1088
+ (grid && grid.columns || []).forEach(function (column) { return column.render(); });
1089
+ // Manipulate the tick mark visibility
1090
+ // based on the axis.max- allows smooth scrolling.
1091
+ if (!axis.horiz &&
1092
+ axis.chart.hasRendered &&
1093
+ (axis.scrollbar ||
1094
+ (axis.linkedParent && axis.linkedParent.scrollbar))) {
1095
+ var tickmarkOffset = axis.tickmarkOffset,
1096
+ lastTick = axis.tickPositions[axis.tickPositions.length - 1],
1097
+ firstTick = axis.tickPositions[0];
1098
+ var label = void 0,
1099
+ tickMark = void 0;
1100
+ while ((label = axis.hiddenLabels.pop()) && label.element) {
1101
+ label.show(); // #15453
1102
+ }
1103
+ while ((tickMark = axis.hiddenMarks.pop()) &&
1104
+ tickMark.element) {
1105
+ tickMark.show(); // #16439
1106
+ }
1107
+ // Hide/show firts tick label.
1108
+ label = axis.ticks[firstTick].label;
1109
+ if (label) {
1110
+ if (min - firstTick > tickmarkOffset) {
1111
+ axis.hiddenLabels.push(label.hide());
1112
1112
  }
1113
- // Hide/show last tick mark/label.
1114
- label = axis.ticks[lastTick].label;
1115
- if (label) {
1116
- if (lastTick - max > tickmarkOffset) {
1117
- axis.hiddenLabels.push(label.hide());
1118
- }
1119
- else {
1120
- label.show();
1121
- }
1113
+ else {
1114
+ label.show();
1115
+ }
1116
+ }
1117
+ // Hide/show last tick mark/label.
1118
+ label = axis.ticks[lastTick].label;
1119
+ if (label) {
1120
+ if (lastTick - max > tickmarkOffset) {
1121
+ axis.hiddenLabels.push(label.hide());
1122
1122
  }
1123
- var mark = axis.ticks[lastTick].mark;
1124
- if (mark &&
1125
- lastTick - max < tickmarkOffset &&
1126
- lastTick - max > 0 && axis.ticks[lastTick].isLast) {
1127
- axis.hiddenMarks.push(mark.hide());
1123
+ else {
1124
+ label.show();
1128
1125
  }
1129
1126
  }
1127
+ var mark = axis.ticks[lastTick].mark;
1128
+ if (mark &&
1129
+ lastTick - max < tickmarkOffset &&
1130
+ lastTick - max > 0 && axis.ticks[lastTick].isLast) {
1131
+ axis.hiddenMarks.push(mark.hide());
1132
+ }
1130
1133
  }
1131
1134
  }
1132
- /**
1133
- * @private
1134
- */
1135
- function onAfterSetAxisTranslation() {
1136
- var axis = this;
1137
- var tickInfo = axis.tickPositions && axis.tickPositions.info;
1138
- var options = axis.options;
1139
- var gridOptions = options.grid || {};
1140
- var userLabels = axis.userOptions.labels || {};
1141
- // Fire this only for the Gantt type chart, #14868.
1142
- if (gridOptions.enabled) {
1143
- if (axis.horiz) {
1144
- axis.series.forEach(function (series) {
1145
- series.options.pointRange = 0;
1146
- });
1147
- // Lower level time ticks, like hours or minutes, represent
1148
- // points in time and not ranges. These should be aligned
1149
- // left in the grid cell by default. The same applies to
1150
- // years of higher order.
1151
- if (tickInfo &&
1152
- options.dateTimeLabelFormats &&
1153
- options.labels &&
1154
- !defined(userLabels.align) &&
1155
- (options.dateTimeLabelFormats[tickInfo.unitName]
1156
- .range === false ||
1157
- tickInfo.count > 1 // years
1158
- )) {
1159
- options.labels.align = 'left';
1160
- if (!defined(userLabels.x)) {
1161
- options.labels.x = 3;
1162
- }
1135
+ }
1136
+ /**
1137
+ * @private
1138
+ */
1139
+ function onAfterSetAxisTranslation() {
1140
+ var axis = this;
1141
+ var tickInfo = axis.tickPositions && axis.tickPositions.info;
1142
+ var options = axis.options;
1143
+ var gridOptions = options.grid || {};
1144
+ var userLabels = axis.userOptions.labels || {};
1145
+ // Fire this only for the Gantt type chart, #14868.
1146
+ if (gridOptions.enabled) {
1147
+ if (axis.horiz) {
1148
+ axis.series.forEach(function (series) {
1149
+ series.options.pointRange = 0;
1150
+ });
1151
+ // Lower level time ticks, like hours or minutes, represent
1152
+ // points in time and not ranges. These should be aligned
1153
+ // left in the grid cell by default. The same applies to
1154
+ // years of higher order.
1155
+ if (tickInfo &&
1156
+ options.dateTimeLabelFormats &&
1157
+ options.labels &&
1158
+ !defined(userLabels.align) &&
1159
+ (options.dateTimeLabelFormats[tickInfo.unitName]
1160
+ .range === false ||
1161
+ tickInfo.count > 1 // years
1162
+ )) {
1163
+ options.labels.align = 'left';
1164
+ if (!defined(userLabels.x)) {
1165
+ options.labels.x = 3;
1163
1166
  }
1164
1167
  }
1165
- else {
1166
- // Don't trim ticks which not in min/max range but
1167
- // they are still in the min/max plus tickInterval.
1168
- if (this.options.type !== 'treegrid' &&
1169
- axis.grid &&
1170
- axis.grid.columns) {
1171
- this.minPointOffset = this.tickInterval;
1172
- }
1168
+ }
1169
+ else {
1170
+ // Don't trim ticks which not in min/max range but
1171
+ // they are still in the min/max plus tickInterval.
1172
+ if (this.options.type !== 'treegrid' &&
1173
+ axis.grid &&
1174
+ axis.grid.columns) {
1175
+ this.minPointOffset = this.tickInterval;
1173
1176
  }
1174
1177
  }
1175
1178
  }
1176
- /**
1177
- * Creates a left and right wall on horizontal axes:
1178
- * - Places leftmost tick at the start of the axis, to create a left
1179
- * wall
1180
- * - Ensures that the rightmost tick is at the end of the axis, to
1181
- * create a right wall.
1182
- * @private
1183
- */
1184
- function onAfterSetOptions(e) {
1185
- var options = this.options,
1186
- userOptions = e.userOptions,
1187
- gridOptions = ((options && isObject(options.grid)) ? options.grid : {});
1188
- var gridAxisOptions;
1189
- if (gridOptions.enabled === true) {
1190
- // Merge the user options into default grid axis options so
1191
- // that when a user option is set, it takes presedence.
1192
- gridAxisOptions = merge(true, {
1193
- className: ('highcharts-grid-axis ' + (userOptions.className || '')),
1194
- dateTimeLabelFormats: {
1195
- hour: {
1196
- list: ['%H:%M', '%H']
1197
- },
1198
- day: {
1199
- list: ['%A, %e. %B', '%a, %e. %b', '%E']
1200
- },
1201
- week: {
1202
- list: ['Week %W', 'W%W']
1203
- },
1204
- month: {
1205
- list: ['%B', '%b', '%o']
1206
- }
1207
- },
1208
- grid: {
1209
- borderWidth: 1
1179
+ }
1180
+ /**
1181
+ * Creates a left and right wall on horizontal axes:
1182
+ * - Places leftmost tick at the start of the axis, to create a left
1183
+ * wall
1184
+ * - Ensures that the rightmost tick is at the end of the axis, to
1185
+ * create a right wall.
1186
+ * @private
1187
+ */
1188
+ function onAfterSetOptions(e) {
1189
+ var options = this.options,
1190
+ userOptions = e.userOptions,
1191
+ gridOptions = ((options && isObject(options.grid)) ? options.grid : {});
1192
+ var gridAxisOptions;
1193
+ if (gridOptions.enabled === true) {
1194
+ // Merge the user options into default grid axis options so
1195
+ // that when a user option is set, it takes presedence.
1196
+ gridAxisOptions = merge(true, {
1197
+ className: ('highcharts-grid-axis ' + (userOptions.className || '')),
1198
+ dateTimeLabelFormats: {
1199
+ hour: {
1200
+ list: ['%H:%M', '%H']
1210
1201
  },
1211
- labels: {
1212
- padding: 2,
1213
- style: {
1214
- fontSize: '13px'
1215
- }
1202
+ day: {
1203
+ list: ['%A, %e. %B', '%a, %e. %b', '%E']
1216
1204
  },
1217
- margin: 0,
1218
- title: {
1219
- text: null,
1220
- reserveSpace: false,
1221
- rotation: 0
1205
+ week: {
1206
+ list: ['Week %W', 'W%W']
1222
1207
  },
1223
- // In a grid axis, only allow one unit of certain types,
1224
- // for example we shouln't have one grid cell spanning
1225
- // two days.
1226
- units: [[
1227
- 'millisecond',
1228
- [1, 10, 100]
1229
- ], [
1230
- 'second',
1231
- [1, 10]
1232
- ], [
1233
- 'minute',
1234
- [1, 5, 15]
1235
- ], [
1236
- 'hour',
1237
- [1, 6]
1238
- ], [
1239
- 'day',
1240
- [1]
1241
- ], [
1242
- 'week',
1243
- [1]
1244
- ], [
1245
- 'month',
1246
- [1]
1247
- ], [
1248
- 'year',
1249
- null
1250
- ]]
1251
- }, userOptions);
1252
- // X-axis specific options
1253
- if (this.coll === 'xAxis') {
1254
- // For linked axes, tickPixelInterval is used only if
1255
- // the tickPositioner below doesn't run or returns
1256
- // undefined (like multiple years)
1257
- if (defined(userOptions.linkedTo) &&
1258
- !defined(userOptions.tickPixelInterval)) {
1259
- gridAxisOptions.tickPixelInterval = 350;
1208
+ month: {
1209
+ list: ['%B', '%b', '%o']
1260
1210
  }
1261
- // For the secondary grid axis, use the primary axis'
1262
- // tick intervals and return ticks one level higher.
1263
- if (
1264
- // Check for tick pixel interval in options
1265
- !defined(userOptions.tickPixelInterval) &&
1266
- // Only for linked axes
1267
- defined(userOptions.linkedTo) &&
1268
- !defined(userOptions.tickPositioner) &&
1269
- !defined(userOptions.tickInterval)) {
1270
- gridAxisOptions.tickPositioner = function (min, max) {
1271
- var parentInfo = (this.linkedParent &&
1272
- this.linkedParent.tickPositions &&
1273
- this.linkedParent.tickPositions.info);
1274
- if (parentInfo) {
1275
- var units = (gridAxisOptions.units || []);
1276
- var unitIdx = void 0,
1277
- count = void 0,
1278
- unitName = void 0;
1279
- for (var i = 0; i < units.length; i++) {
1280
- if (units[i][0] ===
1281
- parentInfo.unitName) {
1282
- unitIdx = i;
1283
- break;
1284
- }
1285
- }
1286
- // Get the first allowed count on the next
1287
- // unit.
1288
- if (units[unitIdx + 1]) {
1289
- unitName = units[unitIdx + 1][0];
1290
- count =
1291
- (units[unitIdx + 1][1] || [1])[0];
1292
- // In case the base X axis shows years, make
1293
- // the secondary axis show ten times the
1294
- // years (#11427)
1295
- }
1296
- else if (parentInfo.unitName === 'year') {
1297
- unitName = 'year';
1298
- count = parentInfo.count * 10;
1299
- }
1300
- var unitRange = timeUnits[unitName];
1301
- this.tickInterval = unitRange * count;
1302
- return this.getTimeTicks({
1303
- unitRange: unitRange,
1304
- count: count,
1305
- unitName: unitName
1306
- }, min, max, this.options.startOfWeek);
1307
- }
1308
- };
1211
+ },
1212
+ grid: {
1213
+ borderWidth: 1
1214
+ },
1215
+ labels: {
1216
+ padding: 2,
1217
+ style: {
1218
+ fontSize: '13px'
1309
1219
  }
1220
+ },
1221
+ margin: 0,
1222
+ title: {
1223
+ text: null,
1224
+ reserveSpace: false,
1225
+ rotation: 0
1226
+ },
1227
+ // In a grid axis, only allow one unit of certain types,
1228
+ // for example we shouln't have one grid cell spanning
1229
+ // two days.
1230
+ units: [[
1231
+ 'millisecond',
1232
+ [1, 10, 100]
1233
+ ], [
1234
+ 'second',
1235
+ [1, 10]
1236
+ ], [
1237
+ 'minute',
1238
+ [1, 5, 15]
1239
+ ], [
1240
+ 'hour',
1241
+ [1, 6]
1242
+ ], [
1243
+ 'day',
1244
+ [1]
1245
+ ], [
1246
+ 'week',
1247
+ [1]
1248
+ ], [
1249
+ 'month',
1250
+ [1]
1251
+ ], [
1252
+ 'year',
1253
+ null
1254
+ ]]
1255
+ }, userOptions);
1256
+ // X-axis specific options
1257
+ if (this.coll === 'xAxis') {
1258
+ // For linked axes, tickPixelInterval is used only if
1259
+ // the tickPositioner below doesn't run or returns
1260
+ // undefined (like multiple years)
1261
+ if (defined(userOptions.linkedTo) &&
1262
+ !defined(userOptions.tickPixelInterval)) {
1263
+ gridAxisOptions.tickPixelInterval = 350;
1310
1264
  }
1311
- // Now merge the combined options into the axis options
1312
- merge(true, this.options, gridAxisOptions);
1313
- if (this.horiz) {
1314
- /* _________________________
1315
- Make this: ___|_____|_____|_____|__|
1316
- ^ ^
1317
- _________________________
1318
- Into this: |_____|_____|_____|_____|
1319
- ^ ^ */
1320
- options.minPadding = pick(userOptions.minPadding, 0);
1321
- options.maxPadding = pick(userOptions.maxPadding, 0);
1322
- }
1323
- // If borderWidth is set, then use its value for tick and
1324
- // line width.
1325
- if (isNumber(options.grid.borderWidth)) {
1326
- options.tickWidth = options.lineWidth =
1327
- gridOptions.borderWidth;
1265
+ // For the secondary grid axis, use the primary axis'
1266
+ // tick intervals and return ticks one level higher.
1267
+ if (
1268
+ // Check for tick pixel interval in options
1269
+ !defined(userOptions.tickPixelInterval) &&
1270
+ // Only for linked axes
1271
+ defined(userOptions.linkedTo) &&
1272
+ !defined(userOptions.tickPositioner) &&
1273
+ !defined(userOptions.tickInterval)) {
1274
+ gridAxisOptions.tickPositioner = function (min, max) {
1275
+ var parentInfo = (this.linkedParent &&
1276
+ this.linkedParent.tickPositions &&
1277
+ this.linkedParent.tickPositions.info);
1278
+ if (parentInfo) {
1279
+ var units = (gridAxisOptions.units || []);
1280
+ var unitIdx = void 0,
1281
+ count = 1,
1282
+ unitName = 'year';
1283
+ for (var i = 0; i < units.length; i++) {
1284
+ var unit_1 = units[i];
1285
+ if (unit_1 && unit_1[0] === parentInfo.unitName) {
1286
+ unitIdx = i;
1287
+ break;
1288
+ }
1289
+ }
1290
+ // Get the first allowed count on the next unit.
1291
+ var unit = (isNumber(unitIdx) && units[unitIdx + 1]);
1292
+ if (unit) {
1293
+ unitName = unit[0] || 'year';
1294
+ var counts = unit[1];
1295
+ count = counts && counts[0] || 1;
1296
+ // In case the base X axis shows years, make the
1297
+ // secondary axis show ten times the years (#11427)
1298
+ }
1299
+ else if (parentInfo.unitName === 'year') {
1300
+ // unitName is 'year'
1301
+ count = parentInfo.count * 10;
1302
+ }
1303
+ var unitRange = timeUnits[unitName];
1304
+ this.tickInterval = unitRange * count;
1305
+ return this.chart.time.getTimeTicks({ unitRange: unitRange, count: count, unitName: unitName }, min, max, this.options.startOfWeek);
1306
+ }
1307
+ };
1328
1308
  }
1329
1309
  }
1330
- }
1331
- /**
1332
- * @private
1333
- */
1334
- function onAfterSetOptions2(e) {
1335
- var axis = this;
1336
- var userOptions = e.userOptions;
1337
- var gridOptions = userOptions && userOptions.grid || {};
1338
- var columns = gridOptions.columns;
1339
- // Add column options to the parent axis. Children has their column
1340
- // options set on init in onGridAxisAfterInit.
1341
- if (gridOptions.enabled && columns) {
1342
- merge(true, axis.options, columns[columns.length - 1]);
1310
+ // Now merge the combined options into the axis options
1311
+ merge(true, this.options, gridAxisOptions);
1312
+ if (this.horiz) {
1313
+ /* _________________________
1314
+ Make this: ___|_____|_____|_____|__|
1315
+ ^ ^
1316
+ _________________________
1317
+ Into this: |_____|_____|_____|_____|
1318
+ ^ ^ */
1319
+ options.minPadding = pick(userOptions.minPadding, 0);
1320
+ options.maxPadding = pick(userOptions.maxPadding, 0);
1321
+ }
1322
+ // If borderWidth is set, then use its value for tick and
1323
+ // line width.
1324
+ if (isNumber(options.grid.borderWidth)) {
1325
+ options.tickWidth = options.lineWidth =
1326
+ gridOptions.borderWidth;
1343
1327
  }
1344
1328
  }
1345
- /**
1346
- * Handle columns and setScale.
1347
- * @private
1348
- */
1349
- function onAfterSetScale() {
1350
- var axis = this;
1351
- (axis.grid.columns || []).forEach(function (column) {
1352
- column.setScale();
1353
- });
1329
+ }
1330
+ /**
1331
+ * @private
1332
+ */
1333
+ function onAfterSetOptions2(e) {
1334
+ var axis = this;
1335
+ var userOptions = e.userOptions;
1336
+ var gridOptions = userOptions && userOptions.grid || {};
1337
+ var columns = gridOptions.columns;
1338
+ // Add column options to the parent axis. Children has their column
1339
+ // options set on init in onGridAxisAfterInit.
1340
+ if (gridOptions.enabled && columns) {
1341
+ merge(true, axis.options, columns[columns.length - 1]);
1354
1342
  }
1355
- /**
1356
- * Draw vertical axis ticks extra long to create cell floors and roofs.
1357
- * Overrides the tickLength for vertical axes.
1358
- * @private
1359
- */
1360
- function onAfterTickSize(e) {
1361
- var defaultLeftAxisOptions = AxisDefaults.defaultLeftAxisOptions;
1362
- var _a = this,
1363
- horiz = _a.horiz,
1364
- maxLabelDimensions = _a.maxLabelDimensions,
1365
- _b = _a.options.grid,
1366
- gridOptions = _b === void 0 ? {} : _b;
1367
- if (gridOptions.enabled && maxLabelDimensions) {
1368
- var labelPadding = (Math.abs(defaultLeftAxisOptions.labels.x) * 2);
1369
- var distance = horiz ?
1370
- (gridOptions.cellHeight ||
1371
- labelPadding + maxLabelDimensions.height) :
1372
- labelPadding + maxLabelDimensions.width;
1373
- if (isArray(e.tickSize)) {
1374
- e.tickSize[0] = distance;
1375
- }
1376
- else {
1377
- e.tickSize = [distance, 0];
1378
- }
1343
+ }
1344
+ /**
1345
+ * Handle columns and setScale.
1346
+ * @private
1347
+ */
1348
+ function onAfterSetScale() {
1349
+ var axis = this;
1350
+ (axis.grid.columns || []).forEach(function (column) { return column.setScale(); });
1351
+ }
1352
+ /**
1353
+ * Draw vertical axis ticks extra long to create cell floors and roofs.
1354
+ * Overrides the tickLength for vertical axes.
1355
+ * @private
1356
+ */
1357
+ function onAfterTickSize(e) {
1358
+ var defaultLeftAxisOptions = AxisDefaults.defaultLeftAxisOptions;
1359
+ var _a = this,
1360
+ horiz = _a.horiz,
1361
+ maxLabelDimensions = _a.maxLabelDimensions,
1362
+ _b = _a.options.grid,
1363
+ gridOptions = _b === void 0 ? {} : _b;
1364
+ if (gridOptions.enabled && maxLabelDimensions) {
1365
+ var labelPadding = (Math.abs(defaultLeftAxisOptions.labels.x) * 2);
1366
+ var distance = horiz ?
1367
+ (gridOptions.cellHeight ||
1368
+ labelPadding + maxLabelDimensions.height) :
1369
+ labelPadding + maxLabelDimensions.width;
1370
+ if (isArray(e.tickSize)) {
1371
+ e.tickSize[0] = distance;
1372
+ }
1373
+ else {
1374
+ e.tickSize = [distance, 0];
1379
1375
  }
1380
1376
  }
1381
- /**
1382
- * @private
1383
- */
1384
- function onChartAfterSetChartSize() {
1385
- this.axes.forEach(function (axis) {
1386
- (axis.grid && axis.grid.columns || []).forEach(function (column) {
1387
- column.setAxisSize();
1388
- column.setAxisTranslation();
1389
- });
1377
+ }
1378
+ /**
1379
+ * @private
1380
+ */
1381
+ function onChartAfterSetChartSize() {
1382
+ this.axes.forEach(function (axis) {
1383
+ (axis.grid && axis.grid.columns || []).forEach(function (column) {
1384
+ column.setAxisSize();
1385
+ column.setAxisTranslation();
1390
1386
  });
1387
+ });
1388
+ }
1389
+ /**
1390
+ * @private
1391
+ */
1392
+ function onDestroy(e) {
1393
+ var grid = this.grid;
1394
+ (grid.columns || []).forEach(function (column) { return column.destroy(e.keepEvents); });
1395
+ grid.columns = void 0;
1396
+ }
1397
+ /**
1398
+ * Wraps axis init to draw cell walls on vertical axes.
1399
+ * @private
1400
+ */
1401
+ function onInit(e) {
1402
+ var axis = this;
1403
+ var userOptions = e.userOptions || {};
1404
+ var gridOptions = userOptions.grid || {};
1405
+ if (gridOptions.enabled && defined(gridOptions.borderColor)) {
1406
+ userOptions.tickColor = userOptions.lineColor = (gridOptions.borderColor);
1391
1407
  }
1392
- /**
1393
- * @private
1394
- */
1395
- function onDestroy(e) {
1396
- var grid = this.grid;
1397
- (grid.columns || []).forEach(function (column) {
1398
- column.destroy(e.keepEvents);
1399
- });
1400
- grid.columns = void 0;
1408
+ if (!axis.grid) {
1409
+ axis.grid = new GridAxisAdditions(axis);
1401
1410
  }
1402
- /**
1403
- * Wraps axis init to draw cell walls on vertical axes.
1404
- * @private
1405
- */
1406
- function onInit(e) {
1407
- var axis = this;
1408
- var userOptions = e.userOptions || {};
1409
- var gridOptions = userOptions.grid || {};
1410
- if (gridOptions.enabled && defined(gridOptions.borderColor)) {
1411
- userOptions.tickColor = userOptions.lineColor = (gridOptions.borderColor);
1411
+ axis.hiddenLabels = [];
1412
+ axis.hiddenMarks = [];
1413
+ }
1414
+ /**
1415
+ * Center tick labels in cells.
1416
+ * @private
1417
+ */
1418
+ function onTickAfterGetLabelPosition(e) {
1419
+ var tick = this,
1420
+ label = tick.label,
1421
+ axis = tick.axis,
1422
+ reversed = axis.reversed,
1423
+ chart = axis.chart,
1424
+ options = axis.options,
1425
+ gridOptions = options.grid || {},
1426
+ labelOpts = axis.options.labels,
1427
+ align = labelOpts.align,
1428
+ // verticalAlign is currently not supported for axis.labels.
1429
+ verticalAlign = 'middle', // labelOpts.verticalAlign,
1430
+ side = GridAxisSide[axis.side],
1431
+ tickmarkOffset = e.tickmarkOffset,
1432
+ tickPositions = axis.tickPositions,
1433
+ tickPos = tick.pos - tickmarkOffset,
1434
+ nextTickPos = (isNumber(tickPositions[e.index + 1]) ?
1435
+ tickPositions[e.index + 1] - tickmarkOffset :
1436
+ (axis.max || 0) + tickmarkOffset),
1437
+ tickSize = axis.tickSize('tick'),
1438
+ tickWidth = tickSize ? tickSize[0] : 0,
1439
+ crispCorr = tickSize ? tickSize[1] / 2 : 0;
1440
+ var labelHeight,
1441
+ lblMetrics,
1442
+ lines,
1443
+ bottom,
1444
+ top,
1445
+ left,
1446
+ right;
1447
+ // Only center tick labels in grid axes
1448
+ if (gridOptions.enabled === true) {
1449
+ // Calculate top and bottom positions of the cell.
1450
+ if (side === 'top') {
1451
+ bottom = axis.top + axis.offset;
1452
+ top = bottom - tickWidth;
1412
1453
  }
1413
- if (!axis.grid) {
1414
- axis.grid = new Additions(axis);
1454
+ else if (side === 'bottom') {
1455
+ top = chart.chartHeight - axis.bottom + axis.offset;
1456
+ bottom = top + tickWidth;
1415
1457
  }
1416
- axis.hiddenLabels = [];
1417
- axis.hiddenMarks = [];
1418
- }
1419
- /**
1420
- * Center tick labels in cells.
1421
- * @private
1422
- */
1423
- function onTickAfterGetLabelPosition(e) {
1424
- var tick = this,
1425
- label = tick.label,
1426
- axis = tick.axis,
1427
- reversed = axis.reversed,
1428
- chart = axis.chart,
1429
- options = axis.options,
1430
- gridOptions = options.grid || {},
1431
- labelOpts = axis.options.labels,
1432
- align = labelOpts.align,
1433
- // verticalAlign is currently not supported for axis.labels.
1434
- verticalAlign = 'middle', // labelOpts.verticalAlign,
1435
- side = GridAxis.Side[axis.side],
1436
- tickmarkOffset = e.tickmarkOffset,
1437
- tickPositions = axis.tickPositions,
1438
- tickPos = tick.pos - tickmarkOffset,
1439
- nextTickPos = (isNumber(tickPositions[e.index + 1]) ?
1440
- tickPositions[e.index + 1] - tickmarkOffset :
1441
- (axis.max || 0) + tickmarkOffset),
1442
- tickSize = axis.tickSize('tick'),
1443
- tickWidth = tickSize ? tickSize[0] : 0,
1444
- crispCorr = tickSize ? tickSize[1] / 2 : 0;
1445
- var labelHeight,
1446
- lblMetrics,
1447
- lines,
1448
- bottom,
1449
- top,
1450
- left,
1451
- right;
1452
- // Only center tick labels in grid axes
1453
- if (gridOptions.enabled === true) {
1454
- // Calculate top and bottom positions of the cell.
1455
- if (side === 'top') {
1456
- bottom = axis.top + axis.offset;
1457
- top = bottom - tickWidth;
1458
- }
1459
- else if (side === 'bottom') {
1460
- top = chart.chartHeight - axis.bottom + axis.offset;
1461
- bottom = top + tickWidth;
1462
- }
1463
- else {
1464
- bottom = axis.top + axis.len - (axis.translate(reversed ? nextTickPos : tickPos) || 0);
1465
- top = axis.top + axis.len - (axis.translate(reversed ? tickPos : nextTickPos) || 0);
1466
- }
1467
- // Calculate left and right positions of the cell.
1468
- if (side === 'right') {
1469
- left = chart.chartWidth - axis.right + axis.offset;
1470
- right = left + tickWidth;
1471
- }
1472
- else if (side === 'left') {
1473
- right = axis.left + axis.offset;
1474
- left = right - tickWidth;
1475
- }
1476
- else {
1477
- left = Math.round(axis.left + (axis.translate(reversed ? nextTickPos : tickPos) || 0)) - crispCorr;
1478
- right = Math.min(// #15742
1479
- Math.round(axis.left + (axis.translate(reversed ? tickPos : nextTickPos) || 0)) - crispCorr, axis.left + axis.len);
1480
- }
1481
- tick.slotWidth = right - left;
1482
- // Calculate the positioning of the label based on
1483
- // alignment.
1484
- e.pos.x = (align === 'left' ?
1485
- left :
1486
- align === 'right' ?
1487
- right :
1488
- left + ((right - left) / 2) // default to center
1489
- );
1490
- e.pos.y = (verticalAlign === 'top' ?
1491
- top :
1492
- verticalAlign === 'bottom' ?
1493
- bottom :
1494
- top + ((bottom - top) / 2) // default to middle
1495
- );
1496
- lblMetrics = chart.renderer.fontMetrics(labelOpts.style.fontSize, label && label.element);
1497
- labelHeight = label ? label.getBBox().height : 0;
1498
- // Adjustment to y position to align the label correctly.
1499
- // Would be better to have a setter or similar for this.
1500
- if (!labelOpts.useHTML) {
1501
- lines = Math.round(labelHeight / lblMetrics.h);
1502
- e.pos.y += (
1503
- // Center the label
1504
- // TODO: why does this actually center the label?
1505
- ((lblMetrics.b - (lblMetrics.h - lblMetrics.f)) / 2) +
1506
- // Adjust for height of additional lines.
1507
- -(((lines - 1) * lblMetrics.h) / 2));
1508
- }
1509
- else {
1510
- e.pos.y += (
1511
- // Readjust yCorr in htmlUpdateTransform
1512
- lblMetrics.b +
1513
- // Adjust for height of html label
1514
- -(labelHeight / 2));
1515
- }
1516
- e.pos.x += (axis.horiz && labelOpts.x) || 0;
1458
+ else {
1459
+ bottom = axis.top + axis.len - (axis.translate(reversed ? nextTickPos : tickPos) || 0);
1460
+ top = axis.top + axis.len - (axis.translate(reversed ? tickPos : nextTickPos) || 0);
1517
1461
  }
1518
- }
1519
- /**
1520
- * @private
1521
- */
1522
- function onTickLabelFormat(ctx) {
1523
- var axis = ctx.axis,
1524
- value = ctx.value;
1525
- if (axis.options.grid &&
1526
- axis.options.grid.enabled) {
1527
- var tickPos = axis.tickPositions;
1528
- var series = (axis.linkedParent || axis).series[0];
1529
- var isFirst = value === tickPos[0];
1530
- var isLast = value === tickPos[tickPos.length - 1];
1531
- var point = series && find(series.options.data,
1532
- function (p) {
1533
- return p[axis.isXAxis ? 'x' : 'y'] === value;
1534
- });
1535
- var pointCopy = void 0;
1536
- if (point && series.is('gantt')) {
1537
- // For the Gantt set point aliases to the pointCopy
1538
- // to do not change the original point
1539
- pointCopy = merge(point);
1540
- H.seriesTypes.gantt.prototype.pointClass
1541
- .setGanttPointAliases(pointCopy);
1542
- }
1543
- // Make additional properties available for the
1544
- // formatter
1545
- ctx.isFirst = isFirst;
1546
- ctx.isLast = isLast;
1547
- ctx.point = pointCopy;
1462
+ // Calculate left and right positions of the cell.
1463
+ if (side === 'right') {
1464
+ left = chart.chartWidth - axis.right + axis.offset;
1465
+ right = left + tickWidth;
1466
+ }
1467
+ else if (side === 'left') {
1468
+ right = axis.left + axis.offset;
1469
+ left = right - tickWidth;
1470
+ }
1471
+ else {
1472
+ left = Math.round(axis.left + (axis.translate(reversed ? nextTickPos : tickPos) || 0)) - crispCorr;
1473
+ right = Math.min(// #15742
1474
+ Math.round(axis.left + (axis.translate(reversed ? tickPos : nextTickPos) || 0)) - crispCorr, axis.left + axis.len);
1475
+ }
1476
+ tick.slotWidth = right - left;
1477
+ // Calculate the positioning of the label based on
1478
+ // alignment.
1479
+ e.pos.x = (align === 'left' ?
1480
+ left :
1481
+ align === 'right' ?
1482
+ right :
1483
+ left + ((right - left) / 2) // default to center
1484
+ );
1485
+ e.pos.y = (verticalAlign === 'top' ?
1486
+ top :
1487
+ verticalAlign === 'bottom' ?
1488
+ bottom :
1489
+ top + ((bottom - top) / 2) // default to middle
1490
+ );
1491
+ lblMetrics = chart.renderer.fontMetrics(labelOpts.style.fontSize, label && label.element);
1492
+ labelHeight = label ? label.getBBox().height : 0;
1493
+ // Adjustment to y position to align the label correctly.
1494
+ // Would be better to have a setter or similar for this.
1495
+ if (!labelOpts.useHTML) {
1496
+ lines = Math.round(labelHeight / lblMetrics.h);
1497
+ e.pos.y += (
1498
+ // Center the label
1499
+ // TODO: why does this actually center the label?
1500
+ ((lblMetrics.b - (lblMetrics.h - lblMetrics.f)) / 2) +
1501
+ // Adjust for height of additional lines.
1502
+ -(((lines - 1) * lblMetrics.h) / 2));
1548
1503
  }
1504
+ else {
1505
+ e.pos.y += (
1506
+ // Readjust yCorr in htmlUpdateTransform
1507
+ lblMetrics.b +
1508
+ // Adjust for height of html label
1509
+ -(labelHeight / 2));
1510
+ }
1511
+ e.pos.x += (axis.horiz && labelOpts.x) || 0;
1549
1512
  }
1550
- /**
1551
- * Makes tick labels which are usually ignored in a linked axis
1552
- * displayed if they are within range of linkedParent.min.
1553
- * ```
1554
- * _____________________________
1555
- * | | | | |
1556
- * Make this: | | 2 | 3 | 4 |
1557
- * |___|_______|_______|_______|
1558
- * ^
1559
- * _____________________________
1560
- * | | | | |
1561
- * Into this: | 1 | 2 | 3 | 4 |
1562
- * |___|_______|_______|_______|
1563
- * ^
1564
- * ```
1565
- * @private
1566
- * @todo Does this function do what the drawing says? Seems to affect
1567
- * ticks and not the labels directly?
1568
- */
1569
- function onTrimTicks() {
1570
- var axis = this;
1571
- var options = axis.options;
1572
- var gridOptions = options.grid || {};
1573
- var categoryAxis = axis.categories;
1574
- var tickPositions = axis.tickPositions;
1575
- var firstPos = tickPositions[0];
1576
- var lastPos = tickPositions[tickPositions.length - 1];
1577
- var linkedMin = axis.linkedParent && axis.linkedParent.min;
1578
- var linkedMax = axis.linkedParent && axis.linkedParent.max;
1579
- var min = linkedMin || axis.min;
1580
- var max = linkedMax || axis.max;
1581
- var tickInterval = axis.tickInterval;
1582
- var endMoreThanMin = (firstPos < min &&
1583
- firstPos + tickInterval > min);
1584
- var startLessThanMax = (lastPos > max &&
1585
- lastPos - tickInterval < max);
1586
- if (gridOptions.enabled === true &&
1587
- !categoryAxis &&
1588
- (axis.horiz || axis.isLinked)) {
1589
- if (endMoreThanMin && !options.startOnTick) {
1590
- tickPositions[0] = min;
1591
- }
1592
- if (startLessThanMax && !options.endOnTick) {
1593
- tickPositions[tickPositions.length - 1] = max;
1594
- }
1513
+ }
1514
+ /**
1515
+ * @private
1516
+ */
1517
+ function onTickLabelFormat(ctx) {
1518
+ var axis = ctx.axis,
1519
+ value = ctx.value;
1520
+ if (axis.options.grid &&
1521
+ axis.options.grid.enabled) {
1522
+ var tickPos = axis.tickPositions;
1523
+ var series = (axis.linkedParent || axis).series[0];
1524
+ var isFirst = value === tickPos[0];
1525
+ var isLast = value === tickPos[tickPos.length - 1];
1526
+ var point = series && find(series.options.data,
1527
+ function (p) {
1528
+ return p[axis.isXAxis ? 'x' : 'y'] === value;
1529
+ });
1530
+ var pointCopy = void 0;
1531
+ if (point && series.is('gantt')) {
1532
+ // For the Gantt set point aliases to the pointCopy
1533
+ // to do not change the original point
1534
+ pointCopy = merge(point);
1535
+ H.seriesTypes.gantt.prototype.pointClass
1536
+ .setGanttPointAliases(pointCopy);
1595
1537
  }
1538
+ // Make additional properties available for the
1539
+ // formatter
1540
+ ctx.isFirst = isFirst;
1541
+ ctx.isLast = isLast;
1542
+ ctx.point = pointCopy;
1596
1543
  }
1597
- /**
1598
- * Avoid altering tickInterval when reserving space.
1599
- * @private
1600
- */
1601
- function wrapUnsquish(proceed) {
1602
- var axis = this;
1603
- var _a = axis.options.grid,
1604
- gridOptions = _a === void 0 ? {} : _a;
1605
- if (gridOptions.enabled === true && axis.categories) {
1606
- return axis.tickInterval;
1544
+ }
1545
+ /**
1546
+ * Makes tick labels which are usually ignored in a linked axis
1547
+ * displayed if they are within range of linkedParent.min.
1548
+ * ```
1549
+ * _____________________________
1550
+ * | | | | |
1551
+ * Make this: | | 2 | 3 | 4 |
1552
+ * |___|_______|_______|_______|
1553
+ * ^
1554
+ * _____________________________
1555
+ * | | | | |
1556
+ * Into this: | 1 | 2 | 3 | 4 |
1557
+ * |___|_______|_______|_______|
1558
+ * ^
1559
+ * ```
1560
+ * @private
1561
+ * @todo Does this function do what the drawing says? Seems to affect
1562
+ * ticks and not the labels directly?
1563
+ */
1564
+ function onTrimTicks() {
1565
+ var axis = this;
1566
+ var options = axis.options;
1567
+ var gridOptions = options.grid || {};
1568
+ var categoryAxis = axis.categories;
1569
+ var tickPositions = axis.tickPositions;
1570
+ var firstPos = tickPositions[0];
1571
+ var lastPos = tickPositions[tickPositions.length - 1];
1572
+ var linkedMin = axis.linkedParent && axis.linkedParent.min;
1573
+ var linkedMax = axis.linkedParent && axis.linkedParent.max;
1574
+ var min = linkedMin || axis.min;
1575
+ var max = linkedMax || axis.max;
1576
+ var tickInterval = axis.tickInterval;
1577
+ var endMoreThanMin = (firstPos < min &&
1578
+ firstPos + tickInterval > min);
1579
+ var startLessThanMax = (lastPos > max &&
1580
+ lastPos - tickInterval < max);
1581
+ if (gridOptions.enabled === true &&
1582
+ !categoryAxis &&
1583
+ (axis.horiz || axis.isLinked)) {
1584
+ if (endMoreThanMin && !options.startOnTick) {
1585
+ tickPositions[0] = min;
1607
1586
  }
1608
- return proceed.apply(axis, argsToArray(arguments));
1587
+ if (startLessThanMax && !options.endOnTick) {
1588
+ tickPositions[tickPositions.length - 1] = max;
1589
+ }
1590
+ }
1591
+ }
1592
+ /**
1593
+ * Avoid altering tickInterval when reserving space.
1594
+ * @private
1595
+ */
1596
+ function wrapUnsquish(proceed) {
1597
+ var axis = this;
1598
+ var _a = axis.options.grid,
1599
+ gridOptions = _a === void 0 ? {} : _a;
1600
+ if (gridOptions.enabled === true && axis.categories) {
1601
+ return axis.tickInterval;
1602
+ }
1603
+ return proceed.apply(axis, argsToArray(arguments));
1604
+ }
1605
+ /* *
1606
+ *
1607
+ * Class
1608
+ *
1609
+ * */
1610
+ /**
1611
+ * Additions for grid axes.
1612
+ * @private
1613
+ * @class
1614
+ */
1615
+ var GridAxisAdditions = /** @class */ (function () {
1616
+ /* *
1617
+ *
1618
+ * Constructors
1619
+ *
1620
+ * */
1621
+ function GridAxisAdditions(axis) {
1622
+ this.axis = axis;
1609
1623
  }
1610
1624
  /* *
1625
+ *
1626
+ * Functions
1627
+ *
1628
+ * */
1629
+ /**
1630
+ * Checks if an axis is the outer axis in its dimension. Since
1631
+ * axes are placed outwards in order, the axis with the highest
1632
+ * index is the outermost axis.
1611
1633
  *
1612
- * Class
1634
+ * Example: If there are multiple x-axes at the top of the chart,
1635
+ * this function returns true if the axis supplied is the last
1636
+ * of the x-axes.
1613
1637
  *
1614
- * */
1615
- /**
1616
- * Additions for grid axes.
1617
1638
  * @private
1618
- * @class
1639
+ *
1640
+ * @return {boolean}
1641
+ * True if the axis is the outermost axis in its dimension; false if
1642
+ * not.
1619
1643
  */
1620
- var Additions = /** @class */ (function () {
1621
- /* *
1622
- *
1623
- * Constructors
1624
- *
1625
- * */
1626
- function Additions(axis) {
1627
- this.axis = axis;
1628
- }
1629
- /* *
1630
- *
1631
- * Functions
1632
- *
1633
- * */
1634
- /**
1635
- * Checks if an axis is the outer axis in its dimension. Since
1636
- * axes are placed outwards in order, the axis with the highest
1637
- * index is the outermost axis.
1638
- *
1639
- * Example: If there are multiple x-axes at the top of the chart,
1640
- * this function returns true if the axis supplied is the last
1641
- * of the x-axes.
1642
- *
1643
- * @private
1644
- *
1645
- * @return {boolean}
1646
- * True if the axis is the outermost axis in its dimension; false if
1647
- * not.
1648
- */
1649
- Additions.prototype.isOuterAxis = function () {
1650
- var axis = this.axis;
1651
- var chart = axis.chart;
1652
- var columnIndex = axis.grid.columnIndex;
1653
- var columns = (axis.linkedParent && axis.linkedParent.grid.columns ||
1654
- axis.grid.columns);
1655
- var parentAxis = columnIndex ? axis.linkedParent : axis;
1656
- var thisIndex = -1,
1657
- lastIndex = 0;
1658
- chart[axis.coll].forEach(function (otherAxis, index) {
1659
- if (otherAxis.side === axis.side &&
1660
- !otherAxis.options.isInternal) {
1661
- lastIndex = index;
1662
- if (otherAxis === parentAxis) {
1663
- // Get the index of the axis in question
1664
- thisIndex = index;
1665
- }
1644
+ GridAxisAdditions.prototype.isOuterAxis = function () {
1645
+ var axis = this.axis;
1646
+ var chart = axis.chart;
1647
+ var columnIndex = axis.grid.columnIndex;
1648
+ var columns = (axis.linkedParent && axis.linkedParent.grid.columns ||
1649
+ axis.grid.columns);
1650
+ var parentAxis = columnIndex ? axis.linkedParent : axis;
1651
+ var thisIndex = -1,
1652
+ lastIndex = 0;
1653
+ (chart[axis.coll] || []).forEach(function (otherAxis, index) {
1654
+ if (otherAxis.side === axis.side &&
1655
+ !otherAxis.options.isInternal) {
1656
+ lastIndex = index;
1657
+ if (otherAxis === parentAxis) {
1658
+ // Get the index of the axis in question
1659
+ thisIndex = index;
1666
1660
  }
1667
- });
1668
- return (lastIndex === thisIndex &&
1669
- (isNumber(columnIndex) ?
1670
- columns.length === columnIndex :
1671
- true));
1672
- };
1673
- /**
1674
- * Add extra border based on the provided path.
1675
- * @private
1676
- * @param {SVGPath} path
1677
- * The path of the border.
1678
- * @return {Highcharts.SVGElement}
1679
- * Border
1680
- */
1681
- Additions.prototype.renderBorder = function (path) {
1682
- var axis = this.axis,
1683
- renderer = axis.chart.renderer,
1684
- options = axis.options,
1685
- extraBorderLine = renderer.path(path)
1686
- .addClass('highcharts-axis-line')
1687
- .add(axis.axisBorder);
1688
- if (!renderer.styledMode) {
1689
- extraBorderLine.attr({
1690
- stroke: options.lineColor,
1691
- 'stroke-width': options.lineWidth,
1692
- zIndex: 7
1693
- });
1694
1661
  }
1695
- return extraBorderLine;
1696
- };
1697
- return Additions;
1698
- }());
1699
- GridAxis.Additions = Additions;
1700
- })(GridAxis || (GridAxis = {}));
1662
+ });
1663
+ return (lastIndex === thisIndex &&
1664
+ (isNumber(columnIndex) ?
1665
+ columns.length === columnIndex :
1666
+ true));
1667
+ };
1668
+ /**
1669
+ * Add extra border based on the provided path.
1670
+ * @private
1671
+ * @param {SVGPath} path
1672
+ * The path of the border.
1673
+ * @return {Highcharts.SVGElement}
1674
+ * Border
1675
+ */
1676
+ GridAxisAdditions.prototype.renderBorder = function (path) {
1677
+ var axis = this.axis,
1678
+ renderer = axis.chart.renderer,
1679
+ options = axis.options,
1680
+ extraBorderLine = renderer.path(path)
1681
+ .addClass('highcharts-axis-line')
1682
+ .add(axis.axisBorder);
1683
+ if (!renderer.styledMode) {
1684
+ extraBorderLine.attr({
1685
+ stroke: options.lineColor,
1686
+ 'stroke-width': options.lineWidth,
1687
+ zIndex: 7
1688
+ });
1689
+ }
1690
+ return extraBorderLine;
1691
+ };
1692
+ return GridAxisAdditions;
1693
+ }());
1701
1694
  /* *
1702
1695
  *
1703
1696
  * Registry
@@ -1709,7 +1702,10 @@
1709
1702
  };
1710
1703
  // Adds week date format
1711
1704
  dateFormats.W = function (timestamp) {
1712
- var d = new this.Date(timestamp);
1705
+ var time = this, d = new this.Date(timestamp), unitsToOmit = ['Hours', 'Milliseconds', 'Minutes', 'Seconds'];
1706
+ unitsToOmit.forEach(function (format) {
1707
+ time.set(format, d, 0);
1708
+ });
1713
1709
  var firstDay = (this.get('Day',
1714
1710
  d) + 6) % 7;
1715
1711
  var thursday = new this.Date(d.valueOf());
@@ -1728,6 +1724,9 @@
1728
1724
  * Default Export
1729
1725
  *
1730
1726
  * */
1727
+ var GridAxis = {
1728
+ compose: compose
1729
+ };
1731
1730
  /* *
1732
1731
  *
1733
1732
  * API Options
@@ -1941,7 +1940,7 @@
1941
1940
 
1942
1941
  return Tree;
1943
1942
  });
1944
- _registerModule(_modules, 'Core/Axis/TreeGridTick.js', [_modules['Core/Utilities.js']], function (U) {
1943
+ _registerModule(_modules, 'Core/Axis/TreeGrid/TreeGridTick.js', [_modules['Core/Utilities.js']], function (U) {
1945
1944
  /* *
1946
1945
  *
1947
1946
  * (c) 2016 Highsoft AS
@@ -1957,34 +1956,237 @@
1957
1956
  isNumber = U.isNumber,
1958
1957
  pick = U.pick,
1959
1958
  wrap = U.wrap;
1960
- /* eslint-disable no-invalid-this, valid-jsdoc */
1959
+ /* *
1960
+ *
1961
+ * Constants
1962
+ *
1963
+ * */
1964
+ var composedClasses = [];
1965
+ /* *
1966
+ *
1967
+ * Functions
1968
+ *
1969
+ * */
1961
1970
  /**
1962
1971
  * @private
1963
1972
  */
1964
- var TreeGridTick;
1965
- (function (TreeGridTick) {
1966
- /* *
1967
- *
1968
- * Interfaces
1969
- *
1970
- * */
1971
- /* *
1972
- *
1973
- * Variables
1974
- *
1975
- * */
1976
- var applied = false;
1973
+ function onTickInit() {
1974
+ var tick = this;
1975
+ if (!tick.treeGrid) {
1976
+ tick.treeGrid = new TreeGridTickAdditions(tick);
1977
+ }
1978
+ }
1979
+ /**
1980
+ * @private
1981
+ */
1982
+ function onTickHover(label) {
1983
+ label.addClass('highcharts-treegrid-node-active');
1984
+ if (!label.renderer.styledMode) {
1985
+ label.css({
1986
+ textDecoration: 'underline'
1987
+ });
1988
+ }
1989
+ }
1990
+ /**
1991
+ * @private
1992
+ */
1993
+ function onTickHoverExit(label, options) {
1994
+ var css = isObject(options.style) ? options.style : {};
1995
+ label.removeClass('highcharts-treegrid-node-active');
1996
+ if (!label.renderer.styledMode) {
1997
+ label.css({ textDecoration: css.textDecoration });
1998
+ }
1999
+ }
2000
+ /**
2001
+ * @private
2002
+ */
2003
+ function renderLabelIcon(tick, params) {
2004
+ var treeGrid = tick.treeGrid,
2005
+ isNew = !treeGrid.labelIcon,
2006
+ renderer = params.renderer,
2007
+ labelBox = params.xy,
2008
+ options = params.options,
2009
+ width = options.width || 0,
2010
+ height = options.height || 0,
2011
+ iconCenter = {
2012
+ x: labelBox.x - (width / 2) - (options.padding || 0),
2013
+ y: labelBox.y - (height / 2)
2014
+ },
2015
+ rotation = params.collapsed ? 90 : 180,
2016
+ shouldRender = params.show && isNumber(iconCenter.y);
2017
+ var icon = treeGrid.labelIcon;
2018
+ if (!icon) {
2019
+ treeGrid.labelIcon = icon = renderer
2020
+ .path(renderer.symbols[options.type](options.x || 0, options.y || 0, width, height))
2021
+ .addClass('highcharts-label-icon')
2022
+ .add(params.group);
2023
+ }
2024
+ // Set the new position, and show or hide
2025
+ icon[shouldRender ? 'show' : 'hide'](); // #14904, #1338
2026
+ // Presentational attributes
2027
+ if (!renderer.styledMode) {
2028
+ icon
2029
+ .attr({
2030
+ cursor: 'pointer',
2031
+ 'fill': pick(params.color, "#666666" /* Palette.neutralColor60 */),
2032
+ 'stroke-width': 1,
2033
+ stroke: options.lineColor,
2034
+ strokeWidth: options.lineWidth || 0
2035
+ });
2036
+ }
2037
+ // Update the icon positions
2038
+ icon[isNew ? 'attr' : 'animate']({
2039
+ translateX: iconCenter.x,
2040
+ translateY: iconCenter.y,
2041
+ rotation: rotation
2042
+ });
2043
+ }
2044
+ /**
2045
+ * @private
2046
+ */
2047
+ function wrapGetLabelPosition(proceed, x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {
2048
+ var tick = this,
2049
+ lbOptions = pick(tick.options && tick.options.labels,
2050
+ labelOptions),
2051
+ pos = tick.pos,
2052
+ axis = tick.axis,
2053
+ options = axis.options,
2054
+ isTreeGrid = options.type === 'treegrid',
2055
+ result = proceed.apply(tick,
2056
+ [x,
2057
+ y,
2058
+ label,
2059
+ horiz,
2060
+ lbOptions,
2061
+ tickmarkOffset,
2062
+ index,
2063
+ step]);
2064
+ var symbolOptions,
2065
+ indentation,
2066
+ mapOfPosToGridNode,
2067
+ node,
2068
+ level;
2069
+ if (isTreeGrid) {
2070
+ symbolOptions = (lbOptions && isObject(lbOptions.symbol, true) ?
2071
+ lbOptions.symbol :
2072
+ {});
2073
+ indentation = (lbOptions && isNumber(lbOptions.indentation) ?
2074
+ lbOptions.indentation :
2075
+ 0);
2076
+ mapOfPosToGridNode = axis.treeGrid.mapOfPosToGridNode;
2077
+ node = mapOfPosToGridNode && mapOfPosToGridNode[pos];
2078
+ level = (node && node.depth) || 1;
2079
+ result.x += (
2080
+ // Add space for symbols
2081
+ ((symbolOptions.width || 0) +
2082
+ ((symbolOptions.padding || 0) * 2)) +
2083
+ // Apply indentation
2084
+ ((level - 1) * indentation));
2085
+ }
2086
+ return result;
2087
+ }
2088
+ /**
2089
+ * @private
2090
+ */
2091
+ function wrapRenderLabel(proceed) {
2092
+ var tick = this, pos = tick.pos, axis = tick.axis, label = tick.label, mapOfPosToGridNode = axis.treeGrid.mapOfPosToGridNode, options = axis.options, labelOptions = pick(tick.options && tick.options.labels, options && options.labels), symbolOptions = (labelOptions && isObject(labelOptions.symbol, true) ?
2093
+ labelOptions.symbol :
2094
+ {}), node = mapOfPosToGridNode && mapOfPosToGridNode[pos], level = node && node.depth, isTreeGrid = options.type === 'treegrid', shouldRender = axis.tickPositions.indexOf(pos) > -1, prefixClassName = 'highcharts-treegrid-node-', styledMode = axis.chart.styledMode;
2095
+ var collapsed,
2096
+ addClassName,
2097
+ removeClassName;
2098
+ if (isTreeGrid && node) {
2099
+ // Add class name for hierarchical styling.
2100
+ if (label &&
2101
+ label.element) {
2102
+ label.addClass(prefixClassName + 'level-' + level);
2103
+ }
2104
+ }
2105
+ proceed.apply(tick, Array.prototype.slice.call(arguments, 1));
2106
+ if (isTreeGrid &&
2107
+ label &&
2108
+ label.element &&
2109
+ node &&
2110
+ node.descendants &&
2111
+ node.descendants > 0) {
2112
+ collapsed = axis.treeGrid.isCollapsed(node);
2113
+ renderLabelIcon(tick, {
2114
+ color: (!styledMode &&
2115
+ label.styles &&
2116
+ label.styles.color ||
2117
+ ''),
2118
+ collapsed: collapsed,
2119
+ group: label.parentGroup,
2120
+ options: symbolOptions,
2121
+ renderer: label.renderer,
2122
+ show: shouldRender,
2123
+ xy: label.xy
2124
+ });
2125
+ // Add class name for the node.
2126
+ addClassName = prefixClassName +
2127
+ (collapsed ? 'collapsed' : 'expanded');
2128
+ removeClassName = prefixClassName +
2129
+ (collapsed ? 'expanded' : 'collapsed');
2130
+ label
2131
+ .addClass(addClassName)
2132
+ .removeClass(removeClassName);
2133
+ if (!styledMode) {
2134
+ label.css({
2135
+ cursor: 'pointer'
2136
+ });
2137
+ }
2138
+ // Add events to both label text and icon
2139
+ [label, tick.treeGrid.labelIcon].forEach(function (object) {
2140
+ if (object && !object.attachedTreeGridEvents) {
2141
+ // On hover
2142
+ addEvent(object.element, 'mouseover', function () {
2143
+ onTickHover(label);
2144
+ });
2145
+ // On hover out
2146
+ addEvent(object.element, 'mouseout', function () {
2147
+ onTickHoverExit(label, labelOptions);
2148
+ });
2149
+ addEvent(object.element, 'click', function () {
2150
+ tick.treeGrid.toggleCollapse();
2151
+ });
2152
+ object.attachedTreeGridEvents = true;
2153
+ }
2154
+ });
2155
+ }
2156
+ }
2157
+ /* *
2158
+ *
2159
+ * Classes
2160
+ *
2161
+ * */
2162
+ /**
2163
+ * @private
2164
+ * @class
2165
+ */
2166
+ var TreeGridTickAdditions = /** @class */ (function () {
2167
+ /* *
2168
+ *
2169
+ * Constructors
2170
+ *
2171
+ * */
2172
+ /**
2173
+ * @private
2174
+ */
2175
+ function TreeGridTickAdditions(tick) {
2176
+ this.tick = tick;
2177
+ }
1977
2178
  /* *
1978
2179
  *
1979
- * Functions
2180
+ * Static Functions
1980
2181
  *
1981
2182
  * */
1982
2183
  /**
1983
2184
  * @private
1984
2185
  */
1985
- function compose(TickClass) {
1986
- if (!applied) {
1987
- addEvent(TickClass, 'init', onInit);
2186
+ TreeGridTickAdditions.compose = function (TickClass) {
2187
+ if (composedClasses.indexOf(TickClass) === -1) {
2188
+ composedClasses.push(TickClass);
2189
+ addEvent(TickClass, 'init', onTickInit);
1988
2190
  wrap(TickClass.prototype, 'getLabelPosition', wrapGetLabelPosition);
1989
2191
  wrap(TickClass.prototype, 'renderLabel', wrapRenderLabel);
1990
2192
  // backwards compatibility
@@ -1997,313 +2199,106 @@
1997
2199
  TickClass.prototype.toggleCollapse = function (redraw) {
1998
2200
  this.treeGrid.toggleCollapse(redraw);
1999
2201
  };
2000
- applied = true;
2001
- }
2002
- }
2003
- TreeGridTick.compose = compose;
2004
- /**
2005
- * @private
2006
- */
2007
- function onInit() {
2008
- var tick = this;
2009
- if (!tick.treeGrid) {
2010
- tick.treeGrid = new Additions(tick);
2011
- }
2012
- }
2013
- /**
2014
- * @private
2015
- */
2016
- function onTickHover(label) {
2017
- label.addClass('highcharts-treegrid-node-active');
2018
- if (!label.renderer.styledMode) {
2019
- label.css({
2020
- textDecoration: 'underline'
2021
- });
2022
2202
  }
2023
- }
2203
+ };
2204
+ /* *
2205
+ *
2206
+ * Functions
2207
+ *
2208
+ * */
2024
2209
  /**
2210
+ * Collapse the grid cell. Used when axis is of type treegrid.
2211
+ *
2212
+ * @see gantt/treegrid-axis/collapsed-dynamically/demo.js
2213
+ *
2025
2214
  * @private
2215
+ * @function Highcharts.Tick#collapse
2216
+ *
2217
+ * @param {boolean} [redraw=true]
2218
+ * Whether to redraw the chart or wait for an explicit call to
2219
+ * {@link Highcharts.Chart#redraw}
2026
2220
  */
2027
- function onTickHoverExit(label, options) {
2028
- var css = isObject(options.style) ? options.style : {};
2029
- label.removeClass('highcharts-treegrid-node-active');
2030
- if (!label.renderer.styledMode) {
2031
- label.css({ textDecoration: css.textDecoration });
2221
+ TreeGridTickAdditions.prototype.collapse = function (redraw) {
2222
+ var tick = this.tick,
2223
+ axis = tick.axis,
2224
+ brokenAxis = axis.brokenAxis;
2225
+ if (brokenAxis &&
2226
+ axis.treeGrid.mapOfPosToGridNode) {
2227
+ var pos = tick.pos,
2228
+ node = axis.treeGrid.mapOfPosToGridNode[pos],
2229
+ breaks = axis.treeGrid.collapse(node);
2230
+ brokenAxis.setBreaks(breaks, pick(redraw, true));
2032
2231
  }
2033
- }
2232
+ };
2034
2233
  /**
2234
+ * Destroy remaining labelIcon if exist.
2235
+ *
2035
2236
  * @private
2237
+ * @function Highcharts.Tick#destroy
2036
2238
  */
2037
- function renderLabelIcon(tick, params) {
2038
- var treeGrid = tick.treeGrid,
2039
- isNew = !treeGrid.labelIcon,
2040
- renderer = params.renderer,
2041
- labelBox = params.xy,
2042
- options = params.options,
2043
- width = options.width || 0,
2044
- height = options.height || 0,
2045
- iconCenter = {
2046
- x: labelBox.x - (width / 2) - (options.padding || 0),
2047
- y: labelBox.y - (height / 2)
2048
- },
2049
- rotation = params.collapsed ? 90 : 180,
2050
- shouldRender = params.show && isNumber(iconCenter.y);
2051
- var icon = treeGrid.labelIcon;
2052
- if (!icon) {
2053
- treeGrid.labelIcon = icon = renderer
2054
- .path(renderer.symbols[options.type](options.x || 0, options.y || 0, width, height))
2055
- .addClass('highcharts-label-icon')
2056
- .add(params.group);
2057
- }
2058
- // Set the new position, and show or hide
2059
- icon.attr({ y: shouldRender ? 0 : -9999 }); // #14904, #1338
2060
- // Presentational attributes
2061
- if (!renderer.styledMode) {
2062
- icon
2063
- .attr({
2064
- cursor: 'pointer',
2065
- 'fill': pick(params.color, "#666666" /* neutralColor60 */),
2066
- 'stroke-width': 1,
2067
- stroke: options.lineColor,
2068
- strokeWidth: options.lineWidth || 0
2069
- });
2239
+ TreeGridTickAdditions.prototype.destroy = function () {
2240
+ if (this.labelIcon) {
2241
+ this.labelIcon.destroy();
2070
2242
  }
2071
- // Update the icon positions
2072
- icon[isNew ? 'attr' : 'animate']({
2073
- translateX: iconCenter.x,
2074
- translateY: iconCenter.y,
2075
- rotation: rotation
2076
- });
2077
- }
2243
+ };
2078
2244
  /**
2245
+ * Expand the grid cell. Used when axis is of type treegrid.
2246
+ *
2247
+ * @see gantt/treegrid-axis/collapsed-dynamically/demo.js
2248
+ *
2079
2249
  * @private
2250
+ * @function Highcharts.Tick#expand
2251
+ *
2252
+ * @param {boolean} [redraw=true]
2253
+ * Whether to redraw the chart or wait for an explicit call to
2254
+ * {@link Highcharts.Chart#redraw}
2080
2255
  */
2081
- function wrapGetLabelPosition(proceed, x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {
2082
- var tick = this,
2083
- lbOptions = pick(tick.options && tick.options.labels,
2084
- labelOptions),
2085
- pos = tick.pos,
2256
+ TreeGridTickAdditions.prototype.expand = function (redraw) {
2257
+ var tick = this.tick,
2086
2258
  axis = tick.axis,
2087
- options = axis.options,
2088
- isTreeGrid = options.type === 'treegrid',
2089
- result = proceed.apply(tick,
2090
- [x,
2091
- y,
2092
- label,
2093
- horiz,
2094
- lbOptions,
2095
- tickmarkOffset,
2096
- index,
2097
- step]);
2098
- var symbolOptions,
2099
- indentation,
2100
- mapOfPosToGridNode,
2101
- node,
2102
- level;
2103
- if (isTreeGrid) {
2104
- symbolOptions = (lbOptions && isObject(lbOptions.symbol, true) ?
2105
- lbOptions.symbol :
2106
- {});
2107
- indentation = (lbOptions && isNumber(lbOptions.indentation) ?
2108
- lbOptions.indentation :
2109
- 0);
2110
- mapOfPosToGridNode = axis.treeGrid.mapOfPosToGridNode;
2111
- node = mapOfPosToGridNode && mapOfPosToGridNode[pos];
2112
- level = (node && node.depth) || 1;
2113
- result.x += (
2114
- // Add space for symbols
2115
- ((symbolOptions.width || 0) +
2116
- ((symbolOptions.padding || 0) * 2)) +
2117
- // Apply indentation
2118
- ((level - 1) * indentation));
2259
+ brokenAxis = axis.brokenAxis;
2260
+ if (brokenAxis &&
2261
+ axis.treeGrid.mapOfPosToGridNode) {
2262
+ var pos = tick.pos,
2263
+ node = axis.treeGrid.mapOfPosToGridNode[pos],
2264
+ breaks = axis.treeGrid.expand(node);
2265
+ brokenAxis.setBreaks(breaks, pick(redraw, true));
2119
2266
  }
2120
- return result;
2121
- }
2267
+ };
2122
2268
  /**
2123
- * @private
2124
- */
2125
- function wrapRenderLabel(proceed) {
2126
- var tick = this, pos = tick.pos, axis = tick.axis, label = tick.label, mapOfPosToGridNode = axis.treeGrid.mapOfPosToGridNode, options = axis.options, labelOptions = pick(tick.options && tick.options.labels, options && options.labels), symbolOptions = (labelOptions && isObject(labelOptions.symbol, true) ?
2127
- labelOptions.symbol :
2128
- {}), node = mapOfPosToGridNode && mapOfPosToGridNode[pos], level = node && node.depth, isTreeGrid = options.type === 'treegrid', shouldRender = axis.tickPositions.indexOf(pos) > -1, prefixClassName = 'highcharts-treegrid-node-', styledMode = axis.chart.styledMode;
2129
- var collapsed,
2130
- addClassName,
2131
- removeClassName;
2132
- if (isTreeGrid && node) {
2133
- // Add class name for hierarchical styling.
2134
- if (label &&
2135
- label.element) {
2136
- label.addClass(prefixClassName + 'level-' + level);
2137
- }
2138
- }
2139
- proceed.apply(tick, Array.prototype.slice.call(arguments, 1));
2140
- if (isTreeGrid &&
2141
- label &&
2142
- label.element &&
2143
- node &&
2144
- node.descendants &&
2145
- node.descendants > 0) {
2146
- collapsed = axis.treeGrid.isCollapsed(node);
2147
- renderLabelIcon(tick, {
2148
- color: (!styledMode &&
2149
- label.styles &&
2150
- label.styles.color ||
2151
- ''),
2152
- collapsed: collapsed,
2153
- group: label.parentGroup,
2154
- options: symbolOptions,
2155
- renderer: label.renderer,
2156
- show: shouldRender,
2157
- xy: label.xy
2158
- });
2159
- // Add class name for the node.
2160
- addClassName = prefixClassName +
2161
- (collapsed ? 'collapsed' : 'expanded');
2162
- removeClassName = prefixClassName +
2163
- (collapsed ? 'expanded' : 'collapsed');
2164
- label
2165
- .addClass(addClassName)
2166
- .removeClass(removeClassName);
2167
- if (!styledMode) {
2168
- label.css({
2169
- cursor: 'pointer'
2170
- });
2171
- }
2172
- // Add events to both label text and icon
2173
- [label, tick.treeGrid.labelIcon].forEach(function (object) {
2174
- if (object && !object.attachedTreeGridEvents) {
2175
- // On hover
2176
- addEvent(object.element, 'mouseover', function () {
2177
- onTickHover(label);
2178
- });
2179
- // On hover out
2180
- addEvent(object.element, 'mouseout', function () {
2181
- onTickHoverExit(label, labelOptions);
2182
- });
2183
- addEvent(object.element, 'click', function () {
2184
- tick.treeGrid.toggleCollapse();
2185
- });
2186
- object.attachedTreeGridEvents = true;
2187
- }
2188
- });
2189
- }
2190
- }
2191
- /* *
2269
+ * Toggle the collapse/expand state of the grid cell. Used when axis is
2270
+ * of type treegrid.
2192
2271
  *
2193
- * Classes
2272
+ * @see gantt/treegrid-axis/collapsed-dynamically/demo.js
2194
2273
  *
2195
- * */
2196
- /**
2197
2274
  * @private
2198
- * @class
2275
+ * @function Highcharts.Tick#toggleCollapse
2276
+ *
2277
+ * @param {boolean} [redraw=true]
2278
+ * Whether to redraw the chart or wait for an explicit call to
2279
+ * {@link Highcharts.Chart#redraw}
2199
2280
  */
2200
- var Additions = /** @class */ (function () {
2201
- /* *
2202
- *
2203
- * Constructors
2204
- *
2205
- * */
2206
- /**
2207
- * @private
2208
- */
2209
- function Additions(tick) {
2210
- this.tick = tick;
2281
+ TreeGridTickAdditions.prototype.toggleCollapse = function (redraw) {
2282
+ var tick = this.tick,
2283
+ axis = tick.axis,
2284
+ brokenAxis = axis.brokenAxis;
2285
+ if (brokenAxis &&
2286
+ axis.treeGrid.mapOfPosToGridNode) {
2287
+ var pos = tick.pos,
2288
+ node = axis.treeGrid.mapOfPosToGridNode[pos],
2289
+ breaks = axis.treeGrid.toggleCollapse(node);
2290
+ brokenAxis.setBreaks(breaks, pick(redraw, true));
2211
2291
  }
2212
- /* *
2213
- *
2214
- * Functions
2215
- *
2216
- * */
2217
- /**
2218
- * Collapse the grid cell. Used when axis is of type treegrid.
2219
- *
2220
- * @see gantt/treegrid-axis/collapsed-dynamically/demo.js
2221
- *
2222
- * @private
2223
- * @function Highcharts.Tick#collapse
2224
- *
2225
- * @param {boolean} [redraw=true]
2226
- * Whether to redraw the chart or wait for an explicit call to
2227
- * {@link Highcharts.Chart#redraw}
2228
- */
2229
- Additions.prototype.collapse = function (redraw) {
2230
- var tick = this.tick,
2231
- axis = tick.axis,
2232
- brokenAxis = axis.brokenAxis;
2233
- if (brokenAxis &&
2234
- axis.treeGrid.mapOfPosToGridNode) {
2235
- var pos = tick.pos,
2236
- node = axis.treeGrid.mapOfPosToGridNode[pos],
2237
- breaks = axis.treeGrid.collapse(node);
2238
- brokenAxis.setBreaks(breaks, pick(redraw, true));
2239
- }
2240
- };
2241
- /**
2242
- * Destroy remaining labelIcon if exist.
2243
- *
2244
- * @private
2245
- * @function Highcharts.Tick#destroy
2246
- */
2247
- Additions.prototype.destroy = function () {
2248
- if (this.labelIcon) {
2249
- this.labelIcon.destroy();
2250
- }
2251
- };
2252
- /**
2253
- * Expand the grid cell. Used when axis is of type treegrid.
2254
- *
2255
- * @see gantt/treegrid-axis/collapsed-dynamically/demo.js
2256
- *
2257
- * @private
2258
- * @function Highcharts.Tick#expand
2259
- *
2260
- * @param {boolean} [redraw=true]
2261
- * Whether to redraw the chart or wait for an explicit call to
2262
- * {@link Highcharts.Chart#redraw}
2263
- */
2264
- Additions.prototype.expand = function (redraw) {
2265
- var tick = this.tick,
2266
- axis = tick.axis,
2267
- brokenAxis = axis.brokenAxis;
2268
- if (brokenAxis &&
2269
- axis.treeGrid.mapOfPosToGridNode) {
2270
- var pos = tick.pos,
2271
- node = axis.treeGrid.mapOfPosToGridNode[pos],
2272
- breaks = axis.treeGrid.expand(node);
2273
- brokenAxis.setBreaks(breaks, pick(redraw, true));
2274
- }
2275
- };
2276
- /**
2277
- * Toggle the collapse/expand state of the grid cell. Used when axis is
2278
- * of type treegrid.
2279
- *
2280
- * @see gantt/treegrid-axis/collapsed-dynamically/demo.js
2281
- *
2282
- * @private
2283
- * @function Highcharts.Tick#toggleCollapse
2284
- *
2285
- * @param {boolean} [redraw=true]
2286
- * Whether to redraw the chart or wait for an explicit call to
2287
- * {@link Highcharts.Chart#redraw}
2288
- */
2289
- Additions.prototype.toggleCollapse = function (redraw) {
2290
- var tick = this.tick,
2291
- axis = tick.axis,
2292
- brokenAxis = axis.brokenAxis;
2293
- if (brokenAxis &&
2294
- axis.treeGrid.mapOfPosToGridNode) {
2295
- var pos = tick.pos,
2296
- node = axis.treeGrid.mapOfPosToGridNode[pos],
2297
- breaks = axis.treeGrid.toggleCollapse(node);
2298
- brokenAxis.setBreaks(breaks, pick(redraw, true));
2299
- }
2300
- };
2301
- return Additions;
2302
- }());
2303
- TreeGridTick.Additions = Additions;
2304
- })(TreeGridTick || (TreeGridTick = {}));
2292
+ };
2293
+ return TreeGridTickAdditions;
2294
+ }());
2295
+ /* *
2296
+ *
2297
+ * Default Export
2298
+ *
2299
+ * */
2305
2300
 
2306
- return TreeGridTick;
2301
+ return TreeGridTickAdditions;
2307
2302
  });
2308
2303
  _registerModule(_modules, 'Series/TreeUtilities.js', [_modules['Core/Color/Color.js'], _modules['Core/Utilities.js']], function (Color, U) {
2309
2304
  /* *
@@ -2535,7 +2530,7 @@
2535
2530
 
2536
2531
  return TreeUtilities;
2537
2532
  });
2538
- _registerModule(_modules, 'Core/Axis/TreeGridAxis.js', [_modules['Core/Axis/BrokenAxis.js'], _modules['Core/Axis/GridAxis.js'], _modules['Gantt/Tree.js'], _modules['Core/Axis/TreeGridTick.js'], _modules['Series/TreeUtilities.js'], _modules['Core/Utilities.js']], function (BrokenAxis, GridAxis, Tree, TreeGridTick, TU, U) {
2533
+ _registerModule(_modules, 'Core/Axis/TreeGrid/TreeGridAxis.js', [_modules['Core/Axis/BrokenAxis.js'], _modules['Core/Axis/GridAxis.js'], _modules['Gantt/Tree.js'], _modules['Core/Axis/TreeGrid/TreeGridTick.js'], _modules['Series/TreeUtilities.js'], _modules['Core/Utilities.js']], function (BrokenAxis, GridAxis, Tree, TreeGridTick, TU, U) {
2539
2534
  /* *
2540
2535
  *
2541
2536
  * (c) 2016 Highsoft AS
@@ -2556,757 +2551,769 @@
2556
2551
  merge = U.merge,
2557
2552
  pick = U.pick,
2558
2553
  wrap = U.wrap;
2554
+ /* *
2555
+ *
2556
+ * Constants
2557
+ *
2558
+ * */
2559
+ var composedClasses = [];
2560
+ /* *
2561
+ *
2562
+ * Variables
2563
+ *
2564
+ * */
2565
+ var TickConstructor;
2566
+ /* *
2567
+ *
2568
+ * Functions
2569
+ *
2570
+ * */
2559
2571
  /**
2560
2572
  * @private
2561
2573
  */
2562
- var TreeGridAxis;
2563
- (function (TreeGridAxis) {
2564
- /* *
2565
- *
2566
- * Declarations
2567
- *
2568
- * */
2569
- /* *
2570
- *
2571
- * Variables
2572
- *
2573
- * */
2574
- var TickConstructor;
2574
+ function getBreakFromNode(node, max) {
2575
+ var to = node.collapseEnd || 0;
2576
+ var from = node.collapseStart || 0;
2577
+ // In broken-axis, the axis.max is minimized until it is not within a
2578
+ // break. Therefore, if break.to is larger than axis.max, the axis.to
2579
+ // should not add the 0.5 axis.tickMarkOffset, to avoid adding a break
2580
+ // larger than axis.max.
2581
+ // TODO consider simplifying broken-axis and this might solve itself
2582
+ if (to >= max) {
2583
+ from -= 0.5;
2584
+ }
2585
+ return {
2586
+ from: from,
2587
+ to: to,
2588
+ showPoints: false
2589
+ };
2590
+ }
2591
+ /**
2592
+ * Creates a tree structure of the data, and the treegrid. Calculates
2593
+ * categories, and y-values of points based on the tree.
2594
+ *
2595
+ * @private
2596
+ * @function getTreeGridFromData
2597
+ *
2598
+ * @param {Array<Highcharts.GanttPointOptions>} data
2599
+ * All the data points to display in the axis.
2600
+ *
2601
+ * @param {boolean} uniqueNames
2602
+ * Whether or not the data node with the same name should share grid cell. If
2603
+ * true they do share cell. False by default.
2604
+ *
2605
+ * @param {number} numberOfSeries
2606
+ *
2607
+ * @return {Object}
2608
+ * Returns an object containing categories, mapOfIdToNode,
2609
+ * mapOfPosToGridNode, and tree.
2610
+ *
2611
+ * @todo There should be only one point per line.
2612
+ * @todo It should be optional to have one category per point, or merge
2613
+ * cells
2614
+ * @todo Add unit-tests.
2615
+ */
2616
+ function getTreeGridFromData(data, uniqueNames, numberOfSeries) {
2617
+ var categories = [],
2618
+ collapsedNodes = [],
2619
+ mapOfIdToNode = {},
2620
+ uniqueNamesEnabled = typeof uniqueNames === 'boolean' ?
2621
+ uniqueNames : false;
2622
+ var mapOfPosToGridNode = {},
2623
+ posIterator = -1;
2624
+ // Build the tree from the series data.
2625
+ var treeParams = {
2626
+ // After the children has been created.
2627
+ after: function (node) {
2628
+ var gridNode = mapOfPosToGridNode[node.pos];
2629
+ var height = 0,
2630
+ descendants = 0;
2631
+ gridNode.children.forEach(function (child) {
2632
+ descendants += (child.descendants || 0) + 1;
2633
+ height = Math.max((child.height || 0) + 1, height);
2634
+ });
2635
+ gridNode.descendants = descendants;
2636
+ gridNode.height = height;
2637
+ if (gridNode.collapsed) {
2638
+ collapsedNodes.push(gridNode);
2639
+ }
2640
+ },
2641
+ // Before the children has been created.
2642
+ before: function (node) {
2643
+ var data = isObject(node.data,
2644
+ true) ?
2645
+ node.data :
2646
+ {},
2647
+ name = isString(data.name) ? data.name : '',
2648
+ parentNode = mapOfIdToNode[node.parent],
2649
+ parentGridNode = (isObject(parentNode,
2650
+ true) ?
2651
+ mapOfPosToGridNode[parentNode.pos] :
2652
+ null),
2653
+ hasSameName = function (x) {
2654
+ return x.name === name;
2655
+ };
2656
+ var gridNode,
2657
+ pos;
2658
+ // If not unique names, look for sibling node with the same name
2659
+ if (uniqueNamesEnabled &&
2660
+ isObject(parentGridNode, true) &&
2661
+ !!(gridNode = find(parentGridNode.children, hasSameName))) {
2662
+ // If there is a gridNode with the same name, reuse position
2663
+ pos = gridNode.pos;
2664
+ // Add data node to list of nodes in the grid node.
2665
+ gridNode.nodes.push(node);
2666
+ }
2667
+ else {
2668
+ // If it is a new grid node, increment position.
2669
+ pos = posIterator++;
2670
+ }
2671
+ // Add new grid node to map.
2672
+ if (!mapOfPosToGridNode[pos]) {
2673
+ mapOfPosToGridNode[pos] = gridNode = {
2674
+ depth: parentGridNode ? parentGridNode.depth + 1 : 0,
2675
+ name: name,
2676
+ id: data.id,
2677
+ nodes: [node],
2678
+ children: [],
2679
+ pos: pos
2680
+ };
2681
+ // If not root, then add name to categories.
2682
+ if (pos !== -1) {
2683
+ categories.push(name);
2684
+ }
2685
+ // Add name to list of children.
2686
+ if (isObject(parentGridNode, true)) {
2687
+ parentGridNode.children.push(gridNode);
2688
+ }
2689
+ }
2690
+ // Add data node to map
2691
+ if (isString(node.id)) {
2692
+ mapOfIdToNode[node.id] = node;
2693
+ }
2694
+ // If one of the points are collapsed, then start the grid node
2695
+ // in collapsed state.
2696
+ if (gridNode &&
2697
+ data.collapsed === true) {
2698
+ gridNode.collapsed = true;
2699
+ }
2700
+ // Assign pos to data node
2701
+ node.pos = pos;
2702
+ }
2703
+ };
2704
+ var updateYValuesAndTickPos = function (map,
2705
+ numberOfSeries) {
2706
+ var setValues = function (gridNode,
2707
+ start,
2708
+ result) {
2709
+ var nodes = gridNode.nodes,
2710
+ padding = 0.5;
2711
+ var end = start + (start === -1 ? 0 : numberOfSeries - 1);
2712
+ var diff = (end - start) / 2,
2713
+ pos = start + diff;
2714
+ nodes.forEach(function (node) {
2715
+ var data = node.data;
2716
+ if (isObject(data, true)) {
2717
+ // Update point
2718
+ data.y = start + (data.seriesIndex || 0);
2719
+ // Remove the property once used
2720
+ delete data.seriesIndex;
2721
+ }
2722
+ node.pos = pos;
2723
+ });
2724
+ result[pos] = gridNode;
2725
+ gridNode.pos = pos;
2726
+ gridNode.tickmarkOffset = diff + padding;
2727
+ gridNode.collapseStart = end + padding;
2728
+ gridNode.children.forEach(function (child) {
2729
+ setValues(child, end + 1, result);
2730
+ end = (child.collapseEnd || 0) - padding;
2731
+ });
2732
+ // Set collapseEnd to the end of the last child node.
2733
+ gridNode.collapseEnd = end + padding;
2734
+ return result;
2735
+ };
2736
+ return setValues(map['-1'], -1, {});
2737
+ };
2738
+ // Create tree from data
2739
+ var tree = Tree.getTree(data,
2740
+ treeParams);
2741
+ // Update y values of data, and set calculate tick positions.
2742
+ mapOfPosToGridNode = updateYValuesAndTickPos(mapOfPosToGridNode, numberOfSeries);
2743
+ // Return the resulting data.
2744
+ return {
2745
+ categories: categories,
2746
+ mapOfIdToNode: mapOfIdToNode,
2747
+ mapOfPosToGridNode: mapOfPosToGridNode,
2748
+ collapsedNodes: collapsedNodes,
2749
+ tree: tree
2750
+ };
2751
+ }
2752
+ /**
2753
+ * Builds the tree of categories and calculates its positions.
2754
+ * @private
2755
+ * @param {Object} e Event object
2756
+ * @param {Object} e.target The chart instance which the event was fired on.
2757
+ * @param {object[]} e.target.axes The axes of the chart.
2758
+ */
2759
+ function onBeforeRender(e) {
2760
+ var chart = e.target,
2761
+ axes = chart.axes;
2762
+ axes.filter(function (axis) {
2763
+ return axis.options.type === 'treegrid';
2764
+ }).forEach(function (axis) {
2765
+ var options = axis.options || {},
2766
+ labelOptions = options.labels,
2767
+ uniqueNames = options.uniqueNames,
2768
+ max = options.max,
2769
+ // Check whether any of series is rendering for the first
2770
+ // time, visibility has changed, or its data is dirty, and
2771
+ // only then update. #10570, #10580. Also check if
2772
+ // mapOfPosToGridNode exists. #10887
2773
+ isDirty = (!axis.treeGrid.mapOfPosToGridNode ||
2774
+ axis.series.some(function (series) {
2775
+ return !series.hasRendered ||
2776
+ series.isDirtyData ||
2777
+ series.isDirty;
2778
+ }));
2779
+ var numberOfSeries = 0,
2780
+ data,
2781
+ treeGrid;
2782
+ if (isDirty) {
2783
+ // Concatenate data from all series assigned to this axis.
2784
+ data = axis.series.reduce(function (arr, s) {
2785
+ if (s.visible) {
2786
+ // Push all data to array
2787
+ (s.options.data || []).forEach(function (data) {
2788
+ // For using keys - rebuild the data structure
2789
+ if (s.options.keys && s.options.keys.length) {
2790
+ data = s.pointClass.prototype
2791
+ .optionsToObject
2792
+ .call({ series: s }, data);
2793
+ s.pointClass.setGanttPointAliases(data);
2794
+ }
2795
+ if (isObject(data, true)) {
2796
+ // Set series index on data. Removed again
2797
+ // after use.
2798
+ data.seriesIndex = (numberOfSeries);
2799
+ arr.push(data);
2800
+ }
2801
+ });
2802
+ // Increment series index
2803
+ if (uniqueNames === true) {
2804
+ numberOfSeries++;
2805
+ }
2806
+ }
2807
+ return arr;
2808
+ }, []);
2809
+ // If max is higher than set data - add a
2810
+ // dummy data to render categories #10779
2811
+ if (max && data.length < max) {
2812
+ for (var i = data.length; i <= max; i++) {
2813
+ data.push({
2814
+ // Use the zero-width character
2815
+ // to avoid conflict with uniqueNames
2816
+ name: i + '\u200B'
2817
+ });
2818
+ }
2819
+ }
2820
+ // setScale is fired after all the series is initialized,
2821
+ // which is an ideal time to update the axis.categories.
2822
+ treeGrid = getTreeGridFromData(data, uniqueNames || false, (uniqueNames === true) ? numberOfSeries : 1);
2823
+ // Assign values to the axis.
2824
+ axis.categories = treeGrid.categories;
2825
+ axis.treeGrid.mapOfPosToGridNode = (treeGrid.mapOfPosToGridNode);
2826
+ axis.hasNames = true;
2827
+ axis.treeGrid.tree = treeGrid.tree;
2828
+ // Update yData now that we have calculated the y values
2829
+ axis.series.forEach(function (series) {
2830
+ var axisData = (series.options.data || []).map(function (d) {
2831
+ if (isArray(d) &&
2832
+ series.options.keys &&
2833
+ series.options.keys.length) {
2834
+ // Get the axisData from the data array used to
2835
+ // build the treeGrid where has been modified
2836
+ data.forEach(function (point) {
2837
+ if (d.indexOf(point.x) >= 0 &&
2838
+ d.indexOf(point.x2) >= 0) {
2839
+ d = point;
2840
+ }
2841
+ });
2842
+ }
2843
+ return isObject(d, true) ? merge(d) : d;
2844
+ });
2845
+ // Avoid destroying points when series is not visible
2846
+ if (series.visible) {
2847
+ series.setData(axisData, false);
2848
+ }
2849
+ });
2850
+ // Calculate the label options for each level in the tree.
2851
+ axis.treeGrid.mapOptionsToLevel =
2852
+ getLevelOptions({
2853
+ defaults: labelOptions,
2854
+ from: 1,
2855
+ levels: labelOptions && labelOptions.levels,
2856
+ to: axis.treeGrid.tree && axis.treeGrid.tree.height
2857
+ });
2858
+ // Setting initial collapsed nodes
2859
+ if (e.type === 'beforeRender') {
2860
+ axis.treeGrid.collapsedNodes = treeGrid.collapsedNodes;
2861
+ }
2862
+ }
2863
+ });
2864
+ }
2865
+ /**
2866
+ * Generates a tick for initial positioning.
2867
+ *
2868
+ * @private
2869
+ * @function Highcharts.GridAxis#generateTick
2870
+ *
2871
+ * @param {Function} proceed
2872
+ * The original generateTick function.
2873
+ *
2874
+ * @param {number} pos
2875
+ * The tick position in axis values.
2876
+ */
2877
+ function wrapGenerateTick(proceed, pos) {
2878
+ var axis = this,
2879
+ mapOptionsToLevel = axis.treeGrid.mapOptionsToLevel || {},
2880
+ isTreeGrid = axis.options.type === 'treegrid',
2881
+ ticks = axis.ticks;
2882
+ var tick = ticks[pos],
2883
+ levelOptions,
2884
+ options,
2885
+ gridNode;
2886
+ if (isTreeGrid &&
2887
+ axis.treeGrid.mapOfPosToGridNode) {
2888
+ gridNode = axis.treeGrid.mapOfPosToGridNode[pos];
2889
+ levelOptions = mapOptionsToLevel[gridNode.depth];
2890
+ if (levelOptions) {
2891
+ options = {
2892
+ labels: levelOptions
2893
+ };
2894
+ }
2895
+ if (!tick &&
2896
+ TickConstructor) {
2897
+ ticks[pos] = tick =
2898
+ new TickConstructor(axis, pos, void 0, void 0, {
2899
+ category: gridNode.name,
2900
+ tickmarkOffset: gridNode.tickmarkOffset,
2901
+ options: options
2902
+ });
2903
+ }
2904
+ else {
2905
+ // update labels depending on tick interval
2906
+ tick.parameters.category = gridNode.name;
2907
+ tick.options = options;
2908
+ tick.addLabel();
2909
+ }
2910
+ }
2911
+ else {
2912
+ proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
2913
+ }
2914
+ }
2915
+ /**
2916
+ * @private
2917
+ */
2918
+ function wrapInit(proceed, chart, userOptions) {
2919
+ var axis = this,
2920
+ isTreeGrid = userOptions.type === 'treegrid';
2921
+ if (!axis.treeGrid) {
2922
+ axis.treeGrid = new TreeGridAxisAdditions(axis);
2923
+ }
2924
+ // Set default and forced options for TreeGrid
2925
+ if (isTreeGrid) {
2926
+ // Add event for updating the categories of a treegrid.
2927
+ // NOTE Preferably these events should be set on the axis.
2928
+ addEvent(chart, 'beforeRender', onBeforeRender);
2929
+ addEvent(chart, 'beforeRedraw', onBeforeRender);
2930
+ // Add new collapsed nodes on addseries
2931
+ addEvent(chart, 'addSeries', function (e) {
2932
+ if (e.options.data) {
2933
+ var treeGrid = getTreeGridFromData(e.options.data,
2934
+ userOptions.uniqueNames || false, 1);
2935
+ axis.treeGrid.collapsedNodes = (axis.treeGrid.collapsedNodes || []).concat(treeGrid.collapsedNodes);
2936
+ }
2937
+ });
2938
+ // Collapse all nodes in axis.treegrid.collapsednodes
2939
+ // where collapsed equals true.
2940
+ addEvent(axis, 'foundExtremes', function () {
2941
+ if (axis.treeGrid.collapsedNodes) {
2942
+ axis.treeGrid.collapsedNodes.forEach(function (node) {
2943
+ var breaks = axis.treeGrid.collapse(node);
2944
+ if (axis.brokenAxis) {
2945
+ axis.brokenAxis.setBreaks(breaks, false);
2946
+ // remove the node from the axis collapsedNodes
2947
+ if (axis.treeGrid.collapsedNodes) {
2948
+ axis.treeGrid.collapsedNodes = axis.treeGrid
2949
+ .collapsedNodes
2950
+ .filter(function (n) { return ((node.collapseStart !==
2951
+ n.collapseStart) ||
2952
+ node.collapseEnd !== n.collapseEnd); });
2953
+ }
2954
+ }
2955
+ });
2956
+ }
2957
+ });
2958
+ // If staticScale is not defined on the yAxis
2959
+ // and chart height is set, set axis.isDirty
2960
+ // to ensure collapsing works (#12012)
2961
+ addEvent(axis, 'afterBreaks', function () {
2962
+ if (axis.coll === 'yAxis' &&
2963
+ !axis.staticScale &&
2964
+ axis.chart.options.chart.height) {
2965
+ axis.isDirty = true;
2966
+ }
2967
+ });
2968
+ userOptions = merge({
2969
+ // Default options
2970
+ grid: {
2971
+ enabled: true
2972
+ },
2973
+ // TODO: add support for align in treegrid.
2974
+ labels: {
2975
+ align: 'left',
2976
+ /**
2977
+ * Set options on specific levels in a tree grid axis. Takes
2978
+ * precedence over labels options.
2979
+ *
2980
+ * @sample {gantt} gantt/treegrid-axis/labels-levels
2981
+ * Levels on TreeGrid Labels
2982
+ *
2983
+ * @type {Array<*>}
2984
+ * @product gantt
2985
+ * @apioption yAxis.labels.levels
2986
+ *
2987
+ * @private
2988
+ */
2989
+ levels: [{
2990
+ /**
2991
+ * Specify the level which the options within this object
2992
+ * applies to.
2993
+ *
2994
+ * @type {number}
2995
+ * @product gantt
2996
+ * @apioption yAxis.labels.levels.level
2997
+ *
2998
+ * @private
2999
+ */
3000
+ level: void 0
3001
+ }, {
3002
+ level: 1,
3003
+ /**
3004
+ * @type {Highcharts.CSSObject}
3005
+ * @product gantt
3006
+ * @apioption yAxis.labels.levels.style
3007
+ *
3008
+ * @private
3009
+ */
3010
+ style: {
3011
+ /** @ignore-option */
3012
+ fontWeight: 'bold'
3013
+ }
3014
+ }],
3015
+ /**
3016
+ * The symbol for the collapse and expand icon in a
3017
+ * treegrid.
3018
+ *
3019
+ * @product gantt
3020
+ * @optionparent yAxis.labels.symbol
3021
+ *
3022
+ * @private
3023
+ */
3024
+ symbol: {
3025
+ /**
3026
+ * The symbol type. Points to a definition function in
3027
+ * the `Highcharts.Renderer.symbols` collection.
3028
+ *
3029
+ * @type {Highcharts.SymbolKeyValue}
3030
+ *
3031
+ * @private
3032
+ */
3033
+ type: 'triangle',
3034
+ x: -5,
3035
+ y: -5,
3036
+ height: 10,
3037
+ width: 10,
3038
+ padding: 5
3039
+ }
3040
+ },
3041
+ uniqueNames: false
3042
+ }, userOptions, {
3043
+ // Forced options
3044
+ reversed: true,
3045
+ // grid.columns is not supported in treegrid
3046
+ grid: {
3047
+ columns: void 0
3048
+ }
3049
+ });
3050
+ }
3051
+ // Now apply the original function with the original arguments,
3052
+ // which are sliced off this function's arguments
3053
+ proceed.apply(axis, [chart, userOptions]);
3054
+ if (isTreeGrid) {
3055
+ axis.hasNames = true;
3056
+ axis.options.showLastLabel = true;
3057
+ }
3058
+ }
3059
+ /**
3060
+ * Set the tick positions, tickInterval, axis min and max.
3061
+ *
3062
+ * @private
3063
+ * @function Highcharts.GridAxis#setTickInterval
3064
+ *
3065
+ * @param {Function} proceed
3066
+ * The original setTickInterval function.
3067
+ */
3068
+ function wrapSetTickInterval(proceed) {
3069
+ var axis = this,
3070
+ options = axis.options,
3071
+ isTreeGrid = options.type === 'treegrid';
3072
+ if (isTreeGrid) {
3073
+ axis.min = pick(axis.userMin, options.min, axis.dataMin);
3074
+ axis.max = pick(axis.userMax, options.max, axis.dataMax);
3075
+ fireEvent(axis, 'foundExtremes');
3076
+ // setAxisTranslation modifies the min and max according to
3077
+ // axis breaks.
3078
+ axis.setAxisTranslation();
3079
+ axis.tickmarkOffset = 0.5;
3080
+ axis.tickInterval = 1;
3081
+ axis.tickPositions = axis.treeGrid.mapOfPosToGridNode ?
3082
+ axis.treeGrid.getTickPositions() :
3083
+ [];
3084
+ }
3085
+ else {
3086
+ proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
3087
+ }
3088
+ }
3089
+ /* *
3090
+ *
3091
+ * Classes
3092
+ *
3093
+ * */
3094
+ /**
3095
+ * @private
3096
+ * @class
3097
+ */
3098
+ var TreeGridAxisAdditions = /** @class */ (function () {
3099
+ /* *
3100
+ *
3101
+ * Constructors
3102
+ *
3103
+ * */
3104
+ /**
3105
+ * @private
3106
+ */
3107
+ function TreeGridAxisAdditions(axis) {
3108
+ this.axis = axis;
3109
+ }
2575
3110
  /* *
2576
3111
  *
2577
- * Functions
3112
+ * Static Functions
2578
3113
  *
2579
3114
  * */
2580
3115
  /**
2581
3116
  * @private
2582
3117
  */
2583
- function compose(AxisClass, ChartClass, SeriesClass, TickClass) {
2584
- if (AxisClass.keepProps.indexOf('treeGrid') === -1) {
2585
- AxisClass.keepProps.push('treeGrid');
2586
- TickConstructor = TickClass;
2587
- wrap(AxisClass.prototype, 'generateTick', wrapGenerateTick);
2588
- wrap(AxisClass.prototype, 'init', wrapInit);
2589
- wrap(AxisClass.prototype, 'setTickInterval', wrapSetTickInterval);
3118
+ TreeGridAxisAdditions.compose = function (AxisClass, ChartClass, SeriesClass, TickClass) {
3119
+ if (composedClasses.indexOf(AxisClass) === -1) {
3120
+ composedClasses.push(AxisClass);
3121
+ if (AxisClass.keepProps.indexOf('treeGrid') === -1) {
3122
+ AxisClass.keepProps.push('treeGrid');
3123
+ }
3124
+ var axisProps = AxisClass.prototype;
3125
+ wrap(axisProps, 'generateTick', wrapGenerateTick);
3126
+ wrap(axisProps, 'init', wrapInit);
3127
+ wrap(axisProps, 'setTickInterval', wrapSetTickInterval);
2590
3128
  // Make utility functions available for testing.
2591
- AxisClass.prototype.utils = {
3129
+ axisProps.utils = {
2592
3130
  getNode: Tree.getNode
2593
3131
  };
2594
- GridAxis.compose(AxisClass, ChartClass, TickClass);
2595
- BrokenAxis.compose(AxisClass, SeriesClass);
2596
- TreeGridTick.compose(TickClass);
2597
3132
  }
2598
- return AxisClass;
2599
- }
2600
- TreeGridAxis.compose = compose;
2601
- /**
2602
- * @private
2603
- */
2604
- function getBreakFromNode(node, max) {
2605
- var to = node.collapseEnd || 0;
2606
- var from = node.collapseStart || 0;
2607
- // In broken-axis, the axis.max is minimized until it is not within a
2608
- // break. Therefore, if break.to is larger than axis.max, the axis.to
2609
- // should not add the 0.5 axis.tickMarkOffset, to avoid adding a break
2610
- // larger than axis.max.
2611
- // TODO consider simplifying broken-axis and this might solve itself
2612
- if (to >= max) {
2613
- from -= 0.5;
3133
+ if (composedClasses.indexOf(TickClass) === -1) {
3134
+ composedClasses.push(TickClass);
3135
+ if (!TickConstructor) {
3136
+ TickConstructor = TickClass;
3137
+ }
2614
3138
  }
2615
- return {
2616
- from: from,
2617
- to: to,
2618
- showPoints: false
2619
- };
2620
- }
2621
- /**
2622
- * Creates a tree structure of the data, and the treegrid. Calculates
2623
- * categories, and y-values of points based on the tree.
2624
- *
2625
- * @private
2626
- * @function getTreeGridFromData
3139
+ GridAxis.compose(AxisClass, ChartClass, TickClass);
3140
+ BrokenAxis.compose(AxisClass, SeriesClass);
3141
+ TreeGridTick.compose(TickClass);
3142
+ return AxisClass;
3143
+ };
3144
+ /* *
2627
3145
  *
2628
- * @param {Array<Highcharts.GanttPointOptions>} data
2629
- * All the data points to display in the axis.
3146
+ * Functions
2630
3147
  *
2631
- * @param {boolean} uniqueNames
2632
- * Wether or not the data node with the same name should share grid cell. If
2633
- * true they do share cell. False by default.
3148
+ * */
3149
+ /**
3150
+ * Set the collapse status.
2634
3151
  *
2635
- * @param {number} numberOfSeries
3152
+ * @private
2636
3153
  *
2637
- * @return {Object}
2638
- * Returns an object containing categories, mapOfIdToNode,
2639
- * mapOfPosToGridNode, and tree.
3154
+ * @param {Highcharts.Axis} axis
3155
+ * The axis to check against.
2640
3156
  *
2641
- * @todo There should be only one point per line.
2642
- * @todo It should be optional to have one category per point, or merge
2643
- * cells
2644
- * @todo Add unit-tests.
3157
+ * @param {Highcharts.GridNode} node
3158
+ * The node to collapse.
2645
3159
  */
2646
- function getTreeGridFromData(data, uniqueNames, numberOfSeries) {
2647
- var categories = [],
2648
- collapsedNodes = [],
2649
- mapOfIdToNode = {},
2650
- uniqueNamesEnabled = typeof uniqueNames === 'boolean' ?
2651
- uniqueNames : false;
2652
- var mapOfPosToGridNode = {},
2653
- posIterator = -1;
2654
- // Build the tree from the series data.
2655
- var treeParams = {
2656
- // After the children has been created.
2657
- after: function (node) {
2658
- var gridNode = mapOfPosToGridNode[node.pos];
2659
- var height = 0,
2660
- descendants = 0;
2661
- gridNode.children.forEach(function (child) {
2662
- descendants += (child.descendants || 0) + 1;
2663
- height = Math.max((child.height || 0) + 1, height);
2664
- });
2665
- gridNode.descendants = descendants;
2666
- gridNode.height = height;
2667
- if (gridNode.collapsed) {
2668
- collapsedNodes.push(gridNode);
2669
- }
2670
- },
2671
- // Before the children has been created.
2672
- before: function (node) {
2673
- var data = isObject(node.data,
2674
- true) ?
2675
- node.data :
2676
- {},
2677
- name = isString(data.name) ? data.name : '',
2678
- parentNode = mapOfIdToNode[node.parent],
2679
- parentGridNode = (isObject(parentNode,
2680
- true) ?
2681
- mapOfPosToGridNode[parentNode.pos] :
2682
- null),
2683
- hasSameName = function (x) {
2684
- return x.name === name;
2685
- };
2686
- var gridNode,
2687
- pos;
2688
- // If not unique names, look for sibling node with the same name
2689
- if (uniqueNamesEnabled &&
2690
- isObject(parentGridNode, true) &&
2691
- !!(gridNode = find(parentGridNode.children, hasSameName))) {
2692
- // If there is a gridNode with the same name, reuse position
2693
- pos = gridNode.pos;
2694
- // Add data node to list of nodes in the grid node.
2695
- gridNode.nodes.push(node);
2696
- }
2697
- else {
2698
- // If it is a new grid node, increment position.
2699
- pos = posIterator++;
2700
- }
2701
- // Add new grid node to map.
2702
- if (!mapOfPosToGridNode[pos]) {
2703
- mapOfPosToGridNode[pos] = gridNode = {
2704
- depth: parentGridNode ? parentGridNode.depth + 1 : 0,
2705
- name: name,
2706
- id: data.id,
2707
- nodes: [node],
2708
- children: [],
2709
- pos: pos
2710
- };
2711
- // If not root, then add name to categories.
2712
- if (pos !== -1) {
2713
- categories.push(name);
2714
- }
2715
- // Add name to list of children.
2716
- if (isObject(parentGridNode, true)) {
2717
- parentGridNode.children.push(gridNode);
2718
- }
3160
+ TreeGridAxisAdditions.prototype.setCollapsedStatus = function (node) {
3161
+ var axis = this.axis,
3162
+ chart = axis.chart;
3163
+ axis.series.forEach(function (series) {
3164
+ var data = series.options.data;
3165
+ if (node.id && data) {
3166
+ var point = chart.get(node.id),
3167
+ dataPoint = data[series.data.indexOf(point)];
3168
+ if (point && dataPoint) {
3169
+ point.collapsed = node.collapsed;
3170
+ dataPoint.collapsed = node.collapsed;
2719
3171
  }
2720
- // Add data node to map
2721
- if (isString(node.id)) {
2722
- mapOfIdToNode[node.id] = node;
2723
- }
2724
- // If one of the points are collapsed, then start the grid node
2725
- // in collapsed state.
2726
- if (gridNode &&
2727
- data.collapsed === true) {
2728
- gridNode.collapsed = true;
2729
- }
2730
- // Assign pos to data node
2731
- node.pos = pos;
2732
3172
  }
2733
- };
2734
- var updateYValuesAndTickPos = function (map,
2735
- numberOfSeries) {
2736
- var setValues = function (gridNode,
2737
- start,
2738
- result) {
2739
- var nodes = gridNode.nodes,
2740
- padding = 0.5;
2741
- var end = start + (start === -1 ? 0 : numberOfSeries - 1);
2742
- var diff = (end - start) / 2,
2743
- pos = start + diff;
2744
- nodes.forEach(function (node) {
2745
- var data = node.data;
2746
- if (isObject(data, true)) {
2747
- // Update point
2748
- data.y = start + (data.seriesIndex || 0);
2749
- // Remove the property once used
2750
- delete data.seriesIndex;
2751
- }
2752
- node.pos = pos;
2753
- });
2754
- result[pos] = gridNode;
2755
- gridNode.pos = pos;
2756
- gridNode.tickmarkOffset = diff + padding;
2757
- gridNode.collapseStart = end + padding;
2758
- gridNode.children.forEach(function (child) {
2759
- setValues(child, end + 1, result);
2760
- end = (child.collapseEnd || 0) - padding;
2761
- });
2762
- // Set collapseEnd to the end of the last child node.
2763
- gridNode.collapseEnd = end + padding;
2764
- return result;
2765
- };
2766
- return setValues(map['-1'], -1, {});
2767
- };
2768
- // Create tree from data
2769
- var tree = Tree.getTree(data,
2770
- treeParams);
2771
- // Update y values of data, and set calculate tick positions.
2772
- mapOfPosToGridNode = updateYValuesAndTickPos(mapOfPosToGridNode, numberOfSeries);
2773
- // Return the resulting data.
2774
- return {
2775
- categories: categories,
2776
- mapOfIdToNode: mapOfIdToNode,
2777
- mapOfPosToGridNode: mapOfPosToGridNode,
2778
- collapsedNodes: collapsedNodes,
2779
- tree: tree
2780
- };
2781
- }
3173
+ });
3174
+ };
2782
3175
  /**
2783
- * Builds the tree of categories and calculates its positions.
3176
+ * Calculates the new axis breaks to collapse a node.
3177
+ *
2784
3178
  * @private
2785
- * @param {Object} e Event object
2786
- * @param {Object} e.target The chart instance which the event was fired on.
2787
- * @param {object[]} e.target.axes The axes of the chart.
3179
+ *
3180
+ * @param {Highcharts.Axis} axis
3181
+ * The axis to check against.
3182
+ *
3183
+ * @param {Highcharts.GridNode} node
3184
+ * The node to collapse.
3185
+ *
3186
+ * @param {number} pos
3187
+ * The tick position to collapse.
3188
+ *
3189
+ * @return {Array<object>}
3190
+ * Returns an array of the new breaks for the axis.
2788
3191
  */
2789
- function onBeforeRender(e) {
2790
- var chart = e.target,
2791
- axes = chart.axes;
2792
- axes.filter(function (axis) {
2793
- return axis.options.type === 'treegrid';
2794
- }).forEach(function (axis) {
2795
- var options = axis.options || {},
2796
- labelOptions = options.labels,
2797
- uniqueNames = options.uniqueNames,
2798
- max = options.max,
2799
- // Check whether any of series is rendering for the first
2800
- // time, visibility has changed, or its data is dirty, and
2801
- // only then update. #10570, #10580. Also check if
2802
- // mapOfPosToGridNode exists. #10887
2803
- isDirty = (!axis.treeGrid.mapOfPosToGridNode ||
2804
- axis.series.some(function (series) {
2805
- return !series.hasRendered ||
2806
- series.isDirtyData ||
2807
- series.isDirty;
2808
- }));
2809
- var numberOfSeries = 0,
2810
- data,
2811
- treeGrid;
2812
- if (isDirty) {
2813
- // Concatenate data from all series assigned to this axis.
2814
- data = axis.series.reduce(function (arr, s) {
2815
- if (s.visible) {
2816
- // Push all data to array
2817
- (s.options.data || []).forEach(function (data) {
2818
- // For using keys - rebuild the data structure
2819
- if (s.options.keys && s.options.keys.length) {
2820
- data = s.pointClass.prototype
2821
- .optionsToObject
2822
- .call({ series: s }, data);
2823
- s.pointClass.setGanttPointAliases(data);
2824
- }
2825
- if (isObject(data, true)) {
2826
- // Set series index on data. Removed again
2827
- // after use.
2828
- data.seriesIndex = (numberOfSeries);
2829
- arr.push(data);
2830
- }
2831
- });
2832
- // Increment series index
2833
- if (uniqueNames === true) {
2834
- numberOfSeries++;
2835
- }
2836
- }
2837
- return arr;
2838
- }, []);
2839
- // If max is higher than set data - add a
2840
- // dummy data to render categories #10779
2841
- if (max && data.length < max) {
2842
- for (var i = data.length; i <= max; i++) {
2843
- data.push({
2844
- // Use the zero-width character
2845
- // to avoid conflict with uniqueNames
2846
- name: i + '\u200B'
2847
- });
2848
- }
2849
- }
2850
- // setScale is fired after all the series is initialized,
2851
- // which is an ideal time to update the axis.categories.
2852
- treeGrid = getTreeGridFromData(data, uniqueNames || false, (uniqueNames === true) ? numberOfSeries : 1);
2853
- // Assign values to the axis.
2854
- axis.categories = treeGrid.categories;
2855
- axis.treeGrid.mapOfPosToGridNode = (treeGrid.mapOfPosToGridNode);
2856
- axis.hasNames = true;
2857
- axis.treeGrid.tree = treeGrid.tree;
2858
- // Update yData now that we have calculated the y values
2859
- axis.series.forEach(function (series) {
2860
- var axisData = (series.options.data || []).map(function (d) {
2861
- if (isArray(d) &&
2862
- series.options.keys &&
2863
- series.options.keys.length) {
2864
- // Get the axisData from the data array used to
2865
- // build the treeGrid where has been modified
2866
- data.forEach(function (point) {
2867
- if (d.indexOf(point.x) >= 0 &&
2868
- d.indexOf(point.x2) >= 0) {
2869
- d = point;
2870
- }
2871
- });
2872
- }
2873
- return isObject(d, true) ? merge(d) : d;
2874
- });
2875
- // Avoid destroying points when series is not visible
2876
- if (series.visible) {
2877
- series.setData(axisData, false);
2878
- }
2879
- });
2880
- // Calculate the label options for each level in the tree.
2881
- axis.treeGrid.mapOptionsToLevel =
2882
- getLevelOptions({
2883
- defaults: labelOptions,
2884
- from: 1,
2885
- levels: labelOptions && labelOptions.levels,
2886
- to: axis.treeGrid.tree && axis.treeGrid.tree.height
2887
- });
2888
- // Setting initial collapsed nodes
2889
- if (e.type === 'beforeRender') {
2890
- axis.treeGrid.collapsedNodes = treeGrid.collapsedNodes;
2891
- }
2892
- }
2893
- });
2894
- }
3192
+ TreeGridAxisAdditions.prototype.collapse = function (node) {
3193
+ var axis = this.axis,
3194
+ breaks = (axis.options.breaks || []),
3195
+ obj = getBreakFromNode(node,
3196
+ axis.max);
3197
+ breaks.push(obj);
3198
+ // Change the collapsed flag #13838
3199
+ node.collapsed = true;
3200
+ axis.treeGrid.setCollapsedStatus(node);
3201
+ return breaks;
3202
+ };
2895
3203
  /**
2896
- * Generates a tick for initial positioning.
3204
+ * Calculates the new axis breaks to expand a node.
2897
3205
  *
2898
3206
  * @private
2899
- * @function Highcharts.GridAxis#generateTick
2900
3207
  *
2901
- * @param {Function} proceed
2902
- * The original generateTick function.
3208
+ * @param {Highcharts.Axis} axis
3209
+ * The axis to check against.
3210
+ *
3211
+ * @param {Highcharts.GridNode} node
3212
+ * The node to expand.
2903
3213
  *
2904
3214
  * @param {number} pos
2905
- * The tick position in axis values.
3215
+ * The tick position to expand.
3216
+ *
3217
+ * @return {Array<object>}
3218
+ * Returns an array of the new breaks for the axis.
2906
3219
  */
2907
- function wrapGenerateTick(proceed, pos) {
2908
- var axis = this,
2909
- mapOptionsToLevel = axis.treeGrid.mapOptionsToLevel || {},
2910
- isTreeGrid = axis.options.type === 'treegrid',
2911
- ticks = axis.ticks;
2912
- var tick = ticks[pos],
2913
- levelOptions,
2914
- options,
2915
- gridNode;
2916
- if (isTreeGrid &&
2917
- axis.treeGrid.mapOfPosToGridNode) {
2918
- gridNode = axis.treeGrid.mapOfPosToGridNode[pos];
2919
- levelOptions = mapOptionsToLevel[gridNode.depth];
2920
- if (levelOptions) {
2921
- options = {
2922
- labels: levelOptions
2923
- };
2924
- }
2925
- if (!tick &&
2926
- TickConstructor) {
2927
- ticks[pos] = tick =
2928
- new TickConstructor(axis, pos, void 0, void 0, {
2929
- category: gridNode.name,
2930
- tickmarkOffset: gridNode.tickmarkOffset,
2931
- options: options
2932
- });
3220
+ TreeGridAxisAdditions.prototype.expand = function (node) {
3221
+ var axis = this.axis,
3222
+ breaks = (axis.options.breaks || []),
3223
+ obj = getBreakFromNode(node,
3224
+ axis.max);
3225
+ // Change the collapsed flag #13838
3226
+ node.collapsed = false;
3227
+ axis.treeGrid.setCollapsedStatus(node);
3228
+ // Remove the break from the axis breaks array.
3229
+ return breaks.reduce(function (arr, b) {
3230
+ if (b.to !== obj.to || b.from !== obj.from) {
3231
+ arr.push(b);
2933
3232
  }
2934
- else {
2935
- // update labels depending on tick interval
2936
- tick.parameters.category = gridNode.name;
2937
- tick.options = options;
2938
- tick.addLabel();
2939
- }
2940
- }
2941
- else {
2942
- proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
2943
- }
2944
- }
3233
+ return arr;
3234
+ }, []);
3235
+ };
2945
3236
  /**
3237
+ * Creates a list of positions for the ticks on the axis. Filters out
3238
+ * positions that are outside min and max, or is inside an axis break.
3239
+ *
2946
3240
  * @private
3241
+ *
3242
+ * @return {Array<number>}
3243
+ * List of positions.
2947
3244
  */
2948
- function wrapInit(proceed, chart, userOptions) {
2949
- var axis = this,
2950
- isTreeGrid = userOptions.type === 'treegrid';
2951
- if (!axis.treeGrid) {
2952
- axis.treeGrid = new Additions(axis);
2953
- }
2954
- // Set default and forced options for TreeGrid
2955
- if (isTreeGrid) {
2956
- // Add event for updating the categories of a treegrid.
2957
- // NOTE Preferably these events should be set on the axis.
2958
- addEvent(chart, 'beforeRender', onBeforeRender);
2959
- addEvent(chart, 'beforeRedraw', onBeforeRender);
2960
- // Add new collapsed nodes on addseries
2961
- addEvent(chart, 'addSeries', function (e) {
2962
- if (e.options.data) {
2963
- var treeGrid = getTreeGridFromData(e.options.data,
2964
- userOptions.uniqueNames || false, 1);
2965
- axis.treeGrid.collapsedNodes = (axis.treeGrid.collapsedNodes || []).concat(treeGrid.collapsedNodes);
2966
- }
2967
- });
2968
- // Collapse all nodes in axis.treegrid.collapsednodes
2969
- // where collapsed equals true.
2970
- addEvent(axis, 'foundExtremes', function () {
2971
- if (axis.treeGrid.collapsedNodes) {
2972
- axis.treeGrid.collapsedNodes.forEach(function (node) {
2973
- var breaks = axis.treeGrid.collapse(node);
2974
- if (axis.brokenAxis) {
2975
- axis.brokenAxis.setBreaks(breaks, false);
2976
- // remove the node from the axis collapsedNodes
2977
- if (axis.treeGrid.collapsedNodes) {
2978
- axis.treeGrid.collapsedNodes = axis.treeGrid
2979
- .collapsedNodes
2980
- .filter(function (n) { return ((node.collapseStart !==
2981
- n.collapseStart) ||
2982
- node.collapseEnd !== n.collapseEnd); });
2983
- }
2984
- }
2985
- });
2986
- }
2987
- });
2988
- // If staticScale is not defined on the yAxis
2989
- // and chart height is set, set axis.isDirty
2990
- // to ensure collapsing works (#12012)
2991
- addEvent(axis, 'afterBreaks', function () {
2992
- if (axis.coll === 'yAxis' &&
2993
- !axis.staticScale &&
2994
- axis.chart.options.chart.height) {
2995
- axis.isDirty = true;
2996
- }
2997
- });
2998
- userOptions = merge({
2999
- // Default options
3000
- grid: {
3001
- enabled: true
3002
- },
3003
- // TODO: add support for align in treegrid.
3004
- labels: {
3005
- align: 'left',
3006
- /**
3007
- * Set options on specific levels in a tree grid axis. Takes
3008
- * precedence over labels options.
3009
- *
3010
- * @sample {gantt} gantt/treegrid-axis/labels-levels
3011
- * Levels on TreeGrid Labels
3012
- *
3013
- * @type {Array<*>}
3014
- * @product gantt
3015
- * @apioption yAxis.labels.levels
3016
- *
3017
- * @private
3018
- */
3019
- levels: [{
3020
- /**
3021
- * Specify the level which the options within this object
3022
- * applies to.
3023
- *
3024
- * @type {number}
3025
- * @product gantt
3026
- * @apioption yAxis.labels.levels.level
3027
- *
3028
- * @private
3029
- */
3030
- level: void 0
3031
- }, {
3032
- level: 1,
3033
- /**
3034
- * @type {Highcharts.CSSObject}
3035
- * @product gantt
3036
- * @apioption yAxis.labels.levels.style
3037
- *
3038
- * @private
3039
- */
3040
- style: {
3041
- /** @ignore-option */
3042
- fontWeight: 'bold'
3043
- }
3044
- }],
3045
- /**
3046
- * The symbol for the collapse and expand icon in a
3047
- * treegrid.
3048
- *
3049
- * @product gantt
3050
- * @optionparent yAxis.labels.symbol
3051
- *
3052
- * @private
3053
- */
3054
- symbol: {
3055
- /**
3056
- * The symbol type. Points to a definition function in
3057
- * the `Highcharts.Renderer.symbols` collection.
3058
- *
3059
- * @type {Highcharts.SymbolKeyValue}
3060
- *
3061
- * @private
3062
- */
3063
- type: 'triangle',
3064
- x: -5,
3065
- y: -5,
3066
- height: 10,
3067
- width: 10,
3068
- padding: 5
3069
- }
3070
- },
3071
- uniqueNames: false
3072
- }, userOptions, {
3073
- // Forced options
3074
- reversed: true,
3075
- // grid.columns is not supported in treegrid
3076
- grid: {
3077
- columns: void 0
3078
- }
3079
- });
3080
- }
3081
- // Now apply the original function with the original arguments,
3082
- // which are sliced off this function's arguments
3083
- proceed.apply(axis, [chart, userOptions]);
3084
- if (isTreeGrid) {
3085
- axis.hasNames = true;
3086
- axis.options.showLastLabel = true;
3087
- }
3088
- }
3245
+ TreeGridAxisAdditions.prototype.getTickPositions = function () {
3246
+ var axis = this.axis,
3247
+ roundedMin = Math.floor(axis.min / axis.tickInterval) * axis.tickInterval,
3248
+ roundedMax = Math.ceil(axis.max / axis.tickInterval) * axis.tickInterval;
3249
+ return Object.keys(axis.treeGrid.mapOfPosToGridNode || {}).reduce(function (arr, key) {
3250
+ var pos = +key;
3251
+ if (pos >= roundedMin &&
3252
+ pos <= roundedMax &&
3253
+ !(axis.brokenAxis && axis.brokenAxis.isInAnyBreak(pos))) {
3254
+ arr.push(pos);
3255
+ }
3256
+ return arr;
3257
+ }, []);
3258
+ };
3089
3259
  /**
3090
- * Set the tick positions, tickInterval, axis min and max.
3260
+ * Check if a node is collapsed.
3091
3261
  *
3092
3262
  * @private
3093
- * @function Highcharts.GridAxis#setTickInterval
3094
3263
  *
3095
- * @param {Function} proceed
3096
- * The original setTickInterval function.
3097
- */
3098
- function wrapSetTickInterval(proceed) {
3099
- var axis = this,
3100
- options = axis.options,
3101
- isTreeGrid = options.type === 'treegrid';
3102
- if (isTreeGrid) {
3103
- axis.min = pick(axis.userMin, options.min, axis.dataMin);
3104
- axis.max = pick(axis.userMax, options.max, axis.dataMax);
3105
- fireEvent(axis, 'foundExtremes');
3106
- // setAxisTranslation modifies the min and max according to
3107
- // axis breaks.
3108
- axis.setAxisTranslation();
3109
- axis.tickmarkOffset = 0.5;
3110
- axis.tickInterval = 1;
3111
- axis.tickPositions = axis.treeGrid.mapOfPosToGridNode ?
3112
- axis.treeGrid.getTickPositions() :
3113
- [];
3114
- }
3115
- else {
3116
- proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
3117
- }
3118
- }
3119
- /* *
3264
+ * @param {Highcharts.Axis} axis
3265
+ * The axis to check against.
3120
3266
  *
3121
- * Classes
3267
+ * @param {Object} node
3268
+ * The node to check if is collapsed.
3122
3269
  *
3123
- * */
3270
+ * @param {number} pos
3271
+ * The tick position to collapse.
3272
+ *
3273
+ * @return {boolean}
3274
+ * Returns true if collapsed, false if expanded.
3275
+ */
3276
+ TreeGridAxisAdditions.prototype.isCollapsed = function (node) {
3277
+ var axis = this.axis,
3278
+ breaks = (axis.options.breaks || []),
3279
+ obj = getBreakFromNode(node,
3280
+ axis.max);
3281
+ return breaks.some(function (b) {
3282
+ return b.from === obj.from && b.to === obj.to;
3283
+ });
3284
+ };
3124
3285
  /**
3286
+ * Calculates the new axis breaks after toggling the collapse/expand
3287
+ * state of a node. If it is collapsed it will be expanded, and if it is
3288
+ * exapended it will be collapsed.
3289
+ *
3125
3290
  * @private
3126
- * @class
3291
+ *
3292
+ * @param {Highcharts.Axis} axis
3293
+ * The axis to check against.
3294
+ *
3295
+ * @param {Highcharts.GridNode} node
3296
+ * The node to toggle.
3297
+ *
3298
+ * @return {Array<object>}
3299
+ * Returns an array of the new breaks for the axis.
3127
3300
  */
3128
- var Additions = /** @class */ (function () {
3129
- /* *
3130
- *
3131
- * Constructors
3132
- *
3133
- * */
3134
- /**
3135
- * @private
3136
- */
3137
- function Additions(axis) {
3138
- this.axis = axis;
3139
- }
3140
- /* *
3141
- *
3142
- * Functions
3143
- *
3144
- * */
3145
- /**
3146
- * Set the collapse status.
3147
- *
3148
- * @private
3149
- *
3150
- * @param {Highcharts.Axis} axis
3151
- * The axis to check against.
3152
- *
3153
- * @param {Highcharts.GridNode} node
3154
- * The node to collapse.
3155
- */
3156
- Additions.prototype.setCollapsedStatus = function (node) {
3157
- var axis = this.axis,
3158
- chart = axis.chart;
3159
- axis.series.forEach(function (series) {
3160
- var data = series.options.data;
3161
- if (node.id && data) {
3162
- var point = chart.get(node.id),
3163
- dataPoint = data[series.data.indexOf(point)];
3164
- if (point && dataPoint) {
3165
- point.collapsed = node.collapsed;
3166
- dataPoint.collapsed = node.collapsed;
3167
- }
3168
- }
3169
- });
3170
- };
3171
- /**
3172
- * Calculates the new axis breaks to collapse a node.
3173
- *
3174
- * @private
3175
- *
3176
- * @param {Highcharts.Axis} axis
3177
- * The axis to check against.
3178
- *
3179
- * @param {Highcharts.GridNode} node
3180
- * The node to collapse.
3181
- *
3182
- * @param {number} pos
3183
- * The tick position to collapse.
3184
- *
3185
- * @return {Array<object>}
3186
- * Returns an array of the new breaks for the axis.
3187
- */
3188
- Additions.prototype.collapse = function (node) {
3189
- var axis = this.axis,
3190
- breaks = (axis.options.breaks || []),
3191
- obj = getBreakFromNode(node,
3192
- axis.max);
3193
- breaks.push(obj);
3194
- // Change the collapsed flag #13838
3195
- node.collapsed = true;
3196
- axis.treeGrid.setCollapsedStatus(node);
3197
- return breaks;
3198
- };
3199
- /**
3200
- * Calculates the new axis breaks to expand a node.
3201
- *
3202
- * @private
3203
- *
3204
- * @param {Highcharts.Axis} axis
3205
- * The axis to check against.
3206
- *
3207
- * @param {Highcharts.GridNode} node
3208
- * The node to expand.
3209
- *
3210
- * @param {number} pos
3211
- * The tick position to expand.
3212
- *
3213
- * @return {Array<object>}
3214
- * Returns an array of the new breaks for the axis.
3215
- */
3216
- Additions.prototype.expand = function (node) {
3217
- var axis = this.axis,
3218
- breaks = (axis.options.breaks || []),
3219
- obj = getBreakFromNode(node,
3220
- axis.max);
3221
- // Change the collapsed flag #13838
3222
- node.collapsed = false;
3223
- axis.treeGrid.setCollapsedStatus(node);
3224
- // Remove the break from the axis breaks array.
3225
- return breaks.reduce(function (arr, b) {
3226
- if (b.to !== obj.to || b.from !== obj.from) {
3227
- arr.push(b);
3228
- }
3229
- return arr;
3230
- }, []);
3231
- };
3232
- /**
3233
- * Creates a list of positions for the ticks on the axis. Filters out
3234
- * positions that are outside min and max, or is inside an axis break.
3235
- *
3236
- * @private
3237
- *
3238
- * @return {Array<number>}
3239
- * List of positions.
3240
- */
3241
- Additions.prototype.getTickPositions = function () {
3242
- var axis = this.axis,
3243
- roundedMin = Math.floor(axis.min / axis.tickInterval) * axis.tickInterval,
3244
- roundedMax = Math.ceil(axis.max / axis.tickInterval) * axis.tickInterval;
3245
- return Object.keys(axis.treeGrid.mapOfPosToGridNode || {}).reduce(function (arr, key) {
3246
- var pos = +key;
3247
- if (pos >= roundedMin &&
3248
- pos <= roundedMax &&
3249
- !(axis.brokenAxis && axis.brokenAxis.isInAnyBreak(pos))) {
3250
- arr.push(pos);
3251
- }
3252
- return arr;
3253
- }, []);
3254
- };
3255
- /**
3256
- * Check if a node is collapsed.
3257
- *
3258
- * @private
3259
- *
3260
- * @param {Highcharts.Axis} axis
3261
- * The axis to check against.
3262
- *
3263
- * @param {Object} node
3264
- * The node to check if is collapsed.
3265
- *
3266
- * @param {number} pos
3267
- * The tick position to collapse.
3268
- *
3269
- * @return {boolean}
3270
- * Returns true if collapsed, false if expanded.
3271
- */
3272
- Additions.prototype.isCollapsed = function (node) {
3273
- var axis = this.axis,
3274
- breaks = (axis.options.breaks || []),
3275
- obj = getBreakFromNode(node,
3276
- axis.max);
3277
- return breaks.some(function (b) {
3278
- return b.from === obj.from && b.to === obj.to;
3279
- });
3280
- };
3281
- /**
3282
- * Calculates the new axis breaks after toggling the collapse/expand
3283
- * state of a node. If it is collapsed it will be expanded, and if it is
3284
- * exapended it will be collapsed.
3285
- *
3286
- * @private
3287
- *
3288
- * @param {Highcharts.Axis} axis
3289
- * The axis to check against.
3290
- *
3291
- * @param {Highcharts.GridNode} node
3292
- * The node to toggle.
3293
- *
3294
- * @return {Array<object>}
3295
- * Returns an array of the new breaks for the axis.
3296
- */
3297
- Additions.prototype.toggleCollapse = function (node) {
3298
- return (this.isCollapsed(node) ?
3299
- this.expand(node) :
3300
- this.collapse(node));
3301
- };
3302
- return Additions;
3303
- }());
3304
- TreeGridAxis.Additions = Additions;
3305
- })(TreeGridAxis || (TreeGridAxis = {}));
3301
+ TreeGridAxisAdditions.prototype.toggleCollapse = function (node) {
3302
+ return (this.isCollapsed(node) ?
3303
+ this.expand(node) :
3304
+ this.collapse(node));
3305
+ };
3306
+ return TreeGridAxisAdditions;
3307
+ }());
3308
+ /* *
3309
+ *
3310
+ * Default Export
3311
+ *
3312
+ * */
3306
3313
 
3307
- return TreeGridAxis;
3314
+ return TreeGridAxisAdditions;
3308
3315
  });
3309
- _registerModule(_modules, 'masters/modules/treegrid.src.js', [_modules['Core/Globals.js'], _modules['Core/Axis/TreeGridAxis.js']], function (Highcharts, TreeGridAxis) {
3316
+ _registerModule(_modules, 'masters/modules/treegrid.src.js', [_modules['Core/Globals.js'], _modules['Core/Axis/TreeGrid/TreeGridAxis.js']], function (Highcharts, TreeGridAxis) {
3310
3317
 
3311
3318
  var G = Highcharts;
3312
3319
  // Compositions