highcharts 6.1.4 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/css/highcharts.css +17 -0
- package/css/highcharts.scss +14 -0
- package/css/themes/dark-unica.css +17 -0
- package/css/themes/grid-light.css +17 -0
- package/css/themes/sand-signika.css +17 -0
- package/es-modules/indicators/momentum.src.js +1 -1
- package/es-modules/indicators/pivot-points.src.js +6 -1
- package/es-modules/masters/highcharts-gantt.src.js +11 -0
- package/es-modules/masters/modules/annotations.src.js +1 -1
- package/es-modules/masters/modules/arrow-symbols.src.js +12 -0
- package/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/es-modules/masters/modules/current-date-indicator.src.js +12 -0
- package/es-modules/masters/modules/data.src.js +1 -1
- package/es-modules/masters/modules/draggable-points.src.js +9 -0
- package/es-modules/masters/modules/export-data.src.js +1 -1
- package/es-modules/masters/modules/exporting.src.js +1 -1
- package/es-modules/masters/modules/funnel.src.js +1 -1
- package/es-modules/masters/modules/gantt.src.js +2 -1
- package/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/es-modules/masters/modules/heatmap.src.js +1 -1
- package/es-modules/masters/modules/item-series.src.js +1 -1
- package/es-modules/masters/modules/map.src.js +1 -1
- package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
- package/es-modules/masters/modules/pathfinder.src.js +12 -0
- package/es-modules/masters/modules/sankey.src.js +1 -1
- package/es-modules/masters/modules/series-label.src.js +1 -1
- package/es-modules/masters/modules/solid-gauge.src.js +1 -1
- package/es-modules/masters/modules/stock.src.js +1 -1
- package/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/es-modules/masters/modules/treegrid.src.js +12 -0
- package/es-modules/masters/modules/variwide.src.js +1 -1
- package/es-modules/masters/modules/vector.src.js +1 -1
- package/es-modules/masters/modules/windbarb.src.js +1 -1
- package/es-modules/masters/modules/xrange.src.js +1 -1
- package/es-modules/masters/themes/dark-blue.src.js +1 -1
- package/es-modules/masters/themes/dark-green.src.js +1 -1
- package/es-modules/masters/themes/dark-unica.src.js +1 -1
- package/es-modules/masters/themes/gray.src.js +1 -1
- package/es-modules/masters/themes/grid-light.src.js +1 -1
- package/es-modules/masters/themes/grid.src.js +1 -1
- package/es-modules/masters/themes/sand-signika.src.js +1 -1
- package/es-modules/masters/themes/skies.src.js +1 -1
- package/es-modules/mixins/centered-series.js +1 -1
- package/es-modules/mixins/on-series.js +1 -1
- package/es-modules/modules/boost.src.js +22 -14
- package/es-modules/modules/broken-axis.src.js +169 -134
- package/es-modules/modules/data.src.js +2 -2
- package/es-modules/modules/draggable-points.src.js +2257 -0
- package/es-modules/modules/drilldown.src.js +1 -0
- package/es-modules/modules/export-data.src.js +1 -1
- package/es-modules/modules/exporting.src.js +1 -1
- package/es-modules/modules/funnel.src.js +1 -1
- package/es-modules/modules/item-series.src.js +1 -1
- package/es-modules/modules/no-data-to-display.src.js +5 -5
- package/es-modules/modules/oldie.src.js +1 -1
- package/es-modules/modules/overlapping-datalabels.src.js +38 -22
- package/es-modules/modules/parallel-coordinates.src.js +3 -2
- package/es-modules/modules/sankey.src.js +1 -1
- package/es-modules/modules/series-label.src.js +2 -2
- package/es-modules/modules/solid-gauge.src.js +1 -1
- package/es-modules/modules/static-scale.src.js +67 -28
- package/es-modules/modules/streamgraph.src.js +1 -1
- package/es-modules/modules/tilemap.src.js +231 -134
- package/es-modules/modules/variwide.src.js +1 -1
- package/es-modules/modules/vector.src.js +92 -22
- package/es-modules/modules/windbarb.src.js +1 -1
- package/es-modules/modules/xrange.src.js +257 -77
- package/es-modules/parts/AreaSeries.js +77 -77
- package/es-modules/parts/AreaSplineSeries.js +64 -27
- package/es-modules/parts/Axis.js +160 -67
- package/es-modules/parts/BarSeries.js +68 -51
- package/es-modules/parts/CandlestickSeries.js +1 -1
- package/es-modules/parts/Chart.js +31 -55
- package/es-modules/parts/Color.js +29 -18
- package/es-modules/parts/ColumnSeries.js +264 -142
- package/es-modules/parts/DataGrouping.js +9 -6
- package/es-modules/parts/DataLabels.js +261 -210
- package/es-modules/parts/DateTimeAxis.js +26 -7
- package/es-modules/parts/Dynamics.js +5 -2
- package/es-modules/parts/FlagsSeries.js +1 -1
- package/es-modules/parts/Globals.js +1 -1
- package/es-modules/parts/Html.js +64 -12
- package/es-modules/parts/Interaction.js +187 -63
- package/es-modules/parts/Legend.js +7 -3
- package/es-modules/parts/LogarithmicAxis.js +35 -4
- package/es-modules/parts/MSPointer.js +1 -1
- package/es-modules/parts/Navigator.js +27 -5
- package/es-modules/parts/OHLCSeries.js +1 -1
- package/es-modules/parts/Options.js +15 -13
- package/es-modules/parts/OrdinalAxis.js +1 -1
- package/es-modules/parts/PieSeries.js +256 -140
- package/es-modules/parts/PlotBandSeries.experimental.js +1 -1
- package/es-modules/parts/PlotLineOrBand.js +7 -40
- package/es-modules/parts/Point.js +28 -4
- package/es-modules/parts/Pointer.js +8 -6
- package/es-modules/parts/RangeSelector.js +1 -1
- package/es-modules/parts/Responsive.js +82 -36
- package/es-modules/parts/ScatterSeries.js +57 -25
- package/es-modules/parts/ScrollablePlotArea.js +17 -7
- package/es-modules/parts/Scrollbar.js +9 -2
- package/es-modules/parts/Series.js +22 -9
- package/es-modules/parts/SplineSeries.js +51 -29
- package/es-modules/parts/Stacking.js +100 -6
- package/es-modules/parts/StockChart.js +9 -3
- package/es-modules/parts/SvgRenderer.js +15 -10
- package/es-modules/parts/Tick.js +150 -30
- package/es-modules/parts/Time.js +23 -5
- package/es-modules/parts/Tooltip.js +2 -2
- package/es-modules/parts/TouchPointer.js +1 -1
- package/es-modules/parts/Utilities.js +16 -1
- package/es-modules/parts-3d/Axis.js +1 -1
- package/es-modules/parts-3d/Chart.js +1 -1
- package/es-modules/parts-3d/Column.js +1 -1
- package/es-modules/parts-3d/Math.js +1 -1
- package/es-modules/parts-3d/Pie.js +1 -1
- package/es-modules/parts-3d/SVGRenderer.js +1 -1
- package/es-modules/parts-3d/Scatter.js +1 -1
- package/es-modules/parts-3d/Series.js +1 -1
- package/es-modules/parts-3d/VMLRenderer.js +1 -1
- package/es-modules/parts-gantt/ArrowSymbols.js +110 -0
- package/es-modules/parts-gantt/CurrentDateIndicator.js +92 -0
- package/es-modules/parts-gantt/GanttChart.js +111 -0
- package/es-modules/parts-gantt/GanttSeries.js +376 -0
- package/es-modules/parts-gantt/GridAxis.js +965 -0
- package/es-modules/parts-gantt/Pathfinder.js +1247 -0
- package/es-modules/parts-gantt/PathfinderAlgorithms.js +746 -0
- package/es-modules/parts-gantt/Tree.js +146 -0
- package/es-modules/parts-gantt/TreeGrid.js +917 -0
- package/es-modules/parts-map/ColorAxis.js +1 -1
- package/es-modules/parts-map/ColorSeriesMixin.js +1 -1
- package/es-modules/parts-map/GeoJSON.js +1 -1
- package/es-modules/parts-map/HeatmapSeries.js +124 -53
- package/es-modules/parts-map/Map.js +1 -1
- package/es-modules/parts-map/MapAxis.js +1 -1
- package/es-modules/parts-map/MapBubbleSeries.js +1 -1
- package/es-modules/parts-map/MapLineSeries.js +1 -1
- package/es-modules/parts-map/MapNavigation.js +1 -1
- package/es-modules/parts-map/MapPointSeries.js +1 -1
- package/es-modules/parts-map/MapPointer.js +1 -1
- package/es-modules/parts-map/MapSeries.js +2 -2
- package/es-modules/parts-more/AreaRangeSeries.js +80 -38
- package/es-modules/parts-more/AreaSplineRangeSeries.js +1 -1
- package/es-modules/parts-more/BoxPlotSeries.js +1 -1
- package/es-modules/parts-more/BubbleSeries.js +1 -1
- package/es-modules/parts-more/ColumnRangeSeries.js +1 -1
- package/es-modules/parts-more/ErrorBarSeries.js +1 -1
- package/es-modules/parts-more/GaugeSeries.js +1 -1
- package/es-modules/parts-more/Pane.js +2 -1
- package/es-modules/parts-more/Polar.js +1 -1
- package/es-modules/parts-more/PolygonSeries.js +1 -1
- package/es-modules/parts-more/RadialAxis.js +5 -4
- package/es-modules/parts-more/WaterfallSeries.js +1 -1
- package/es-modules/supplemental.docs.js +0 -1955
- package/es-modules/themes/dark-blue.js +1 -1
- package/es-modules/themes/dark-green.js +1 -1
- package/es-modules/themes/dark-unica.js +1 -1
- package/es-modules/themes/gray.js +1 -1
- package/es-modules/themes/grid-light.js +1 -1
- package/es-modules/themes/grid.js +1 -1
- package/es-modules/themes/sand-signika.js +1 -1
- package/es-modules/themes/skies.js +1 -1
- package/highcharts-3d.js +1 -1
- package/highcharts-3d.src.js +10 -10
- package/highcharts-gantt.js +503 -0
- package/highcharts-gantt.js.map +1 -0
- package/highcharts-gantt.src.js +49289 -0
- package/highcharts-more.js +65 -64
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.js +97 -53
- package/highcharts.js +415 -410
- package/highcharts.js.map +1 -1
- package/highcharts.src.js +2170 -1128
- package/highmaps.js +443 -438
- package/highmaps.js.map +1 -1
- package/highmaps.src.js +1647 -849
- package/highstock.js +553 -548
- package/highstock.js.map +1 -1
- package/highstock.src.js +2398 -1283
- package/indicators/accumulation-distribution.js +1 -1
- package/indicators/accumulation-distribution.src.js +1 -1
- package/indicators/atr.js +1 -1
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.js +1 -1
- package/indicators/bollinger-bands.src.js +1 -1
- package/indicators/cci.js +1 -1
- package/indicators/cci.src.js +1 -1
- package/indicators/cmf.js +1 -1
- package/indicators/cmf.src.js +1 -1
- package/indicators/ema.js +1 -1
- package/indicators/ema.src.js +1 -1
- package/indicators/ichimoku-kinko-hyo.js +1 -1
- package/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/indicators/indicators.js +1 -1
- package/indicators/indicators.src.js +1 -1
- package/indicators/macd.js +1 -1
- package/indicators/macd.src.js +1 -1
- package/indicators/mfi.js +1 -1
- package/indicators/mfi.src.js +1 -1
- package/indicators/momentum.js +1 -1
- package/indicators/momentum.src.js +2 -2
- package/indicators/pivot-points.js +4 -4
- package/indicators/pivot-points.js.map +1 -1
- package/indicators/pivot-points.src.js +7 -2
- package/indicators/price-envelopes.js +1 -1
- package/indicators/price-envelopes.src.js +1 -1
- package/indicators/psar.js +1 -1
- package/indicators/psar.src.js +1 -1
- package/indicators/roc.js +1 -1
- package/indicators/roc.src.js +1 -1
- package/indicators/rsi.js +1 -1
- package/indicators/rsi.src.js +1 -1
- package/indicators/stochastic.js +1 -1
- package/indicators/stochastic.src.js +1 -1
- package/indicators/volume-by-price.js +1 -1
- package/indicators/volume-by-price.src.js +1 -1
- package/indicators/vwap.js +1 -1
- package/indicators/vwap.src.js +1 -1
- package/indicators/wma.js +1 -1
- package/indicators/wma.src.js +1 -1
- package/indicators/zigzag.js +1 -1
- package/indicators/zigzag.src.js +1 -1
- package/js/es-modules/indicators/momentum.src.js +1 -1
- package/js/es-modules/indicators/pivot-points.src.js +6 -1
- package/js/es-modules/masters/highcharts-gantt.src.js +11 -0
- package/js/es-modules/masters/modules/annotations.src.js +1 -1
- package/js/es-modules/masters/modules/arrow-symbols.src.js +12 -0
- package/js/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/js/es-modules/masters/modules/current-date-indicator.src.js +12 -0
- package/js/es-modules/masters/modules/data.src.js +1 -1
- package/js/es-modules/masters/modules/draggable-points.src.js +9 -0
- package/js/es-modules/masters/modules/export-data.src.js +1 -1
- package/js/es-modules/masters/modules/exporting.src.js +1 -1
- package/js/es-modules/masters/modules/funnel.src.js +1 -1
- package/js/es-modules/masters/modules/gantt.src.js +2 -1
- package/js/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/js/es-modules/masters/modules/heatmap.src.js +1 -1
- package/js/es-modules/masters/modules/item-series.src.js +1 -1
- package/js/es-modules/masters/modules/map.src.js +1 -1
- package/js/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
- package/js/es-modules/masters/modules/pathfinder.src.js +12 -0
- package/js/es-modules/masters/modules/sankey.src.js +1 -1
- package/js/es-modules/masters/modules/series-label.src.js +1 -1
- package/js/es-modules/masters/modules/solid-gauge.src.js +1 -1
- package/js/es-modules/masters/modules/stock.src.js +1 -1
- package/js/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/js/es-modules/masters/modules/treegrid.src.js +12 -0
- package/js/es-modules/masters/modules/variwide.src.js +1 -1
- package/js/es-modules/masters/modules/vector.src.js +1 -1
- package/js/es-modules/masters/modules/windbarb.src.js +1 -1
- package/js/es-modules/masters/modules/xrange.src.js +1 -1
- package/js/es-modules/masters/themes/dark-blue.src.js +1 -1
- package/js/es-modules/masters/themes/dark-green.src.js +1 -1
- package/js/es-modules/masters/themes/dark-unica.src.js +1 -1
- package/js/es-modules/masters/themes/gray.src.js +1 -1
- package/js/es-modules/masters/themes/grid-light.src.js +1 -1
- package/js/es-modules/masters/themes/grid.src.js +1 -1
- package/js/es-modules/masters/themes/sand-signika.src.js +1 -1
- package/js/es-modules/masters/themes/skies.src.js +1 -1
- package/js/es-modules/mixins/centered-series.js +1 -1
- package/js/es-modules/mixins/on-series.js +1 -1
- package/js/es-modules/modules/boost.src.js +22 -14
- package/js/es-modules/modules/broken-axis.src.js +169 -134
- package/js/es-modules/modules/data.src.js +2 -2
- package/js/es-modules/modules/draggable-points.src.js +2257 -0
- package/js/es-modules/modules/drilldown.src.js +1 -0
- package/js/es-modules/modules/export-data.src.js +1 -1
- package/js/es-modules/modules/exporting.src.js +1 -1
- package/js/es-modules/modules/funnel.src.js +1 -1
- package/js/es-modules/modules/item-series.src.js +1 -1
- package/js/es-modules/modules/no-data-to-display.src.js +5 -5
- package/js/es-modules/modules/oldie.src.js +1 -1
- package/js/es-modules/modules/overlapping-datalabels.src.js +38 -22
- package/js/es-modules/modules/parallel-coordinates.src.js +3 -2
- package/js/es-modules/modules/sankey.src.js +1 -1
- package/js/es-modules/modules/series-label.src.js +2 -2
- package/js/es-modules/modules/solid-gauge.src.js +1 -1
- package/js/es-modules/modules/static-scale.src.js +67 -28
- package/js/es-modules/modules/streamgraph.src.js +1 -1
- package/js/es-modules/modules/tilemap.src.js +231 -134
- package/js/es-modules/modules/variwide.src.js +1 -1
- package/js/es-modules/modules/vector.src.js +92 -22
- package/js/es-modules/modules/windbarb.src.js +1 -1
- package/js/es-modules/modules/xrange.src.js +255 -68
- package/js/es-modules/parts/AreaSeries.js +77 -77
- package/js/es-modules/parts/AreaSplineSeries.js +64 -27
- package/js/es-modules/parts/Axis.js +160 -67
- package/js/es-modules/parts/BarSeries.js +68 -51
- package/js/es-modules/parts/CandlestickSeries.js +1 -1
- package/js/es-modules/parts/Chart.js +31 -55
- package/js/es-modules/parts/Color.js +29 -18
- package/js/es-modules/parts/ColumnSeries.js +231 -123
- package/js/es-modules/parts/DataGrouping.js +9 -6
- package/js/es-modules/parts/DataLabels.js +230 -182
- package/js/es-modules/parts/DateTimeAxis.js +26 -7
- package/js/es-modules/parts/Dynamics.js +5 -2
- package/js/es-modules/parts/FlagsSeries.js +1 -1
- package/js/es-modules/parts/Globals.js +1 -1
- package/js/es-modules/parts/Html.js +64 -12
- package/js/es-modules/parts/Interaction.js +178 -61
- package/js/es-modules/parts/Legend.js +7 -3
- package/js/es-modules/parts/LogarithmicAxis.js +35 -4
- package/js/es-modules/parts/MSPointer.js +1 -1
- package/js/es-modules/parts/Navigator.js +27 -5
- package/js/es-modules/parts/OHLCSeries.js +1 -1
- package/js/es-modules/parts/Options.js +13 -12
- package/js/es-modules/parts/OrdinalAxis.js +1 -1
- package/js/es-modules/parts/PieSeries.js +245 -132
- package/js/es-modules/parts/PlotBandSeries.experimental.js +1 -1
- package/js/es-modules/parts/PlotLineOrBand.js +7 -40
- package/js/es-modules/parts/Point.js +28 -4
- package/js/es-modules/parts/Pointer.js +8 -6
- package/js/es-modules/parts/RangeSelector.js +1 -1
- package/js/es-modules/parts/Responsive.js +82 -36
- package/js/es-modules/parts/ScatterSeries.js +56 -25
- package/js/es-modules/parts/ScrollablePlotArea.js +17 -7
- package/js/es-modules/parts/Scrollbar.js +9 -2
- package/js/es-modules/parts/Series.js +22 -9
- package/js/es-modules/parts/SplineSeries.js +51 -29
- package/js/es-modules/parts/Stacking.js +100 -6
- package/js/es-modules/parts/StockChart.js +9 -3
- package/js/es-modules/parts/SvgRenderer.js +15 -10
- package/js/es-modules/parts/Tick.js +150 -30
- package/js/es-modules/parts/Time.js +23 -5
- package/js/es-modules/parts/Tooltip.js +2 -2
- package/js/es-modules/parts/TouchPointer.js +1 -1
- package/js/es-modules/parts/Utilities.js +16 -1
- package/js/es-modules/parts-3d/Axis.js +1 -1
- package/js/es-modules/parts-3d/Chart.js +1 -1
- package/js/es-modules/parts-3d/Column.js +1 -1
- package/js/es-modules/parts-3d/Math.js +1 -1
- package/js/es-modules/parts-3d/Pie.js +1 -1
- package/js/es-modules/parts-3d/SVGRenderer.js +1 -1
- package/js/es-modules/parts-3d/Scatter.js +1 -1
- package/js/es-modules/parts-3d/Series.js +1 -1
- package/js/es-modules/parts-3d/VMLRenderer.js +1 -1
- package/js/es-modules/parts-gantt/ArrowSymbols.js +110 -0
- package/js/es-modules/parts-gantt/CurrentDateIndicator.js +92 -0
- package/js/es-modules/parts-gantt/GanttChart.js +111 -0
- package/js/es-modules/parts-gantt/GanttSeries.js +371 -0
- package/js/es-modules/parts-gantt/GridAxis.js +962 -0
- package/js/es-modules/parts-gantt/Pathfinder.js +1225 -0
- package/js/es-modules/parts-gantt/PathfinderAlgorithms.js +746 -0
- package/js/es-modules/parts-gantt/Tree.js +146 -0
- package/js/es-modules/parts-gantt/TreeGrid.js +891 -0
- package/js/es-modules/parts-map/ColorAxis.js +1 -1
- package/js/es-modules/parts-map/ColorSeriesMixin.js +1 -1
- package/js/es-modules/parts-map/GeoJSON.js +1 -1
- package/js/es-modules/parts-map/HeatmapSeries.js +122 -52
- package/js/es-modules/parts-map/Map.js +1 -1
- package/js/es-modules/parts-map/MapAxis.js +1 -1
- package/js/es-modules/parts-map/MapBubbleSeries.js +1 -1
- package/js/es-modules/parts-map/MapLineSeries.js +1 -1
- package/js/es-modules/parts-map/MapNavigation.js +1 -1
- package/js/es-modules/parts-map/MapPointSeries.js +1 -1
- package/js/es-modules/parts-map/MapPointer.js +1 -1
- package/js/es-modules/parts-map/MapSeries.js +2 -2
- package/js/es-modules/parts-more/AreaRangeSeries.js +80 -38
- package/js/es-modules/parts-more/AreaSplineRangeSeries.js +1 -1
- package/js/es-modules/parts-more/BoxPlotSeries.js +1 -1
- package/js/es-modules/parts-more/BubbleSeries.js +1 -1
- package/js/es-modules/parts-more/ColumnRangeSeries.js +1 -1
- package/js/es-modules/parts-more/ErrorBarSeries.js +1 -1
- package/js/es-modules/parts-more/GaugeSeries.js +1 -1
- package/js/es-modules/parts-more/Pane.js +2 -1
- package/js/es-modules/parts-more/Polar.js +1 -1
- package/js/es-modules/parts-more/PolygonSeries.js +1 -1
- package/js/es-modules/parts-more/RadialAxis.js +5 -4
- package/js/es-modules/parts-more/WaterfallSeries.js +1 -1
- package/js/es-modules/supplemental.docs.js +0 -1955
- package/js/es-modules/themes/dark-blue.js +1 -1
- package/js/es-modules/themes/dark-green.js +1 -1
- package/js/es-modules/themes/dark-unica.js +1 -1
- package/js/es-modules/themes/gray.js +1 -1
- package/js/es-modules/themes/grid-light.js +1 -1
- package/js/es-modules/themes/grid.js +1 -1
- package/js/es-modules/themes/sand-signika.js +1 -1
- package/js/es-modules/themes/skies.js +1 -1
- package/js/highcharts-3d.js +1 -1
- package/js/highcharts-3d.src.js +10 -10
- package/js/highcharts-gantt.js +480 -0
- package/js/highcharts-gantt.js.map +1 -0
- package/js/highcharts-gantt.src.js +47011 -0
- package/js/highcharts-more.js +62 -61
- package/js/highcharts-more.js.map +1 -1
- package/js/highcharts-more.src.js +97 -53
- package/js/highcharts.js +394 -390
- package/js/highcharts.js.map +1 -1
- package/js/highcharts.src.js +2083 -1070
- package/js/highmaps.js +420 -416
- package/js/highmaps.js.map +1 -1
- package/js/highmaps.src.js +1569 -798
- package/js/highstock.js +526 -520
- package/js/highstock.js.map +1 -1
- package/js/highstock.src.js +2311 -1225
- package/js/indicators/accumulation-distribution.js +1 -1
- package/js/indicators/accumulation-distribution.src.js +1 -1
- package/js/indicators/atr.js +1 -1
- package/js/indicators/atr.src.js +1 -1
- package/js/indicators/bollinger-bands.js +1 -1
- package/js/indicators/bollinger-bands.src.js +1 -1
- package/js/indicators/cci.js +1 -1
- package/js/indicators/cci.src.js +1 -1
- package/js/indicators/cmf.js +1 -1
- package/js/indicators/cmf.src.js +1 -1
- package/js/indicators/ema.js +1 -1
- package/js/indicators/ema.src.js +1 -1
- package/js/indicators/ichimoku-kinko-hyo.js +1 -1
- package/js/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/js/indicators/indicators.js +1 -1
- package/js/indicators/indicators.src.js +1 -1
- package/js/indicators/macd.js +1 -1
- package/js/indicators/macd.src.js +1 -1
- package/js/indicators/mfi.js +1 -1
- package/js/indicators/mfi.src.js +1 -1
- package/js/indicators/momentum.js +1 -1
- package/js/indicators/momentum.src.js +2 -2
- package/js/indicators/pivot-points.js +4 -4
- package/js/indicators/pivot-points.js.map +1 -1
- package/js/indicators/pivot-points.src.js +7 -2
- package/js/indicators/price-envelopes.js +1 -1
- package/js/indicators/price-envelopes.src.js +1 -1
- package/js/indicators/psar.js +1 -1
- package/js/indicators/psar.src.js +1 -1
- package/js/indicators/roc.js +1 -1
- package/js/indicators/roc.src.js +1 -1
- package/js/indicators/rsi.js +1 -1
- package/js/indicators/rsi.src.js +1 -1
- package/js/indicators/stochastic.js +1 -1
- package/js/indicators/stochastic.src.js +1 -1
- package/js/indicators/volume-by-price.js +1 -1
- package/js/indicators/volume-by-price.src.js +1 -1
- package/js/indicators/vwap.js +1 -1
- package/js/indicators/vwap.src.js +1 -1
- package/js/indicators/wma.js +1 -1
- package/js/indicators/wma.src.js +1 -1
- package/js/indicators/zigzag.js +1 -1
- package/js/indicators/zigzag.src.js +1 -1
- package/js/modules/accessibility.js +1 -1
- package/js/modules/accessibility.src.js +1 -1
- package/js/modules/annotations.js +2 -2
- package/js/modules/annotations.src.js +2 -2
- package/js/modules/arrow-symbols.js +13 -0
- package/js/modules/arrow-symbols.js.map +1 -0
- package/js/modules/arrow-symbols.src.js +138 -0
- package/js/modules/boost-canvas.js +1 -1
- package/js/modules/boost-canvas.src.js +1 -1
- package/js/modules/boost.js +43 -43
- package/js/modules/boost.js.map +1 -1
- package/js/modules/boost.src.js +23 -15
- package/js/modules/broken-axis.js +11 -10
- package/js/modules/broken-axis.js.map +1 -1
- package/js/modules/broken-axis.src.js +171 -136
- package/js/modules/bullet.js +1 -1
- package/js/modules/bullet.src.js +1 -1
- package/js/modules/current-date-indicator.js +13 -0
- package/js/modules/current-date-indicator.js.map +1 -0
- package/js/modules/current-date-indicator.src.js +120 -0
- package/js/modules/data.js +2 -2
- package/js/modules/data.src.js +4 -4
- package/js/modules/drag-panes.js +1 -1
- package/js/modules/drag-panes.src.js +1 -1
- package/js/modules/draggable-points.js +38 -0
- package/js/modules/draggable-points.js.map +1 -0
- package/js/modules/draggable-points.src.js +2281 -0
- package/js/modules/drilldown.js +1 -1
- package/js/modules/drilldown.js.map +1 -1
- package/js/modules/drilldown.src.js +2 -1
- package/js/modules/export-data.js +2 -2
- package/js/modules/export-data.src.js +3 -3
- package/js/modules/exporting.js +2 -2
- package/js/modules/exporting.src.js +3 -3
- package/js/modules/funnel.js +2 -2
- package/js/modules/funnel.src.js +3 -3
- package/js/modules/gantt.js +80 -18
- package/js/modules/gantt.js.map +1 -1
- package/js/modules/gantt.src.js +5490 -372
- package/js/modules/grid-axis.js +15 -11
- package/js/modules/grid-axis.js.map +1 -1
- package/js/modules/grid-axis.src.js +731 -293
- package/js/modules/heatmap.js +2 -2
- package/js/modules/heatmap.js.map +1 -1
- package/js/modules/heatmap.src.js +126 -56
- package/js/modules/histogram-bellcurve.js +1 -1
- package/js/modules/histogram-bellcurve.src.js +1 -1
- package/js/modules/item-series.js +2 -2
- package/js/modules/item-series.src.js +3 -3
- package/js/modules/map.js +2 -2
- package/js/modules/map.js.map +1 -1
- package/js/modules/map.src.js +137 -67
- package/js/modules/no-data-to-display.js +1 -1
- package/js/modules/no-data-to-display.src.js +6 -6
- package/js/modules/offline-exporting.js +2 -2
- package/js/modules/offline-exporting.src.js +2 -2
- package/js/modules/oldie.js +2 -2
- package/js/modules/oldie.src.js +3 -3
- package/js/modules/overlapping-datalabels.js +2 -2
- package/js/modules/overlapping-datalabels.src.js +2 -2
- package/js/modules/parallel-coordinates.js +9 -9
- package/js/modules/parallel-coordinates.js.map +1 -1
- package/js/modules/parallel-coordinates.src.js +4 -3
- package/js/modules/pareto.js +1 -1
- package/js/modules/pareto.src.js +1 -1
- package/js/modules/pathfinder.js +34 -0
- package/js/modules/pathfinder.js.map +1 -0
- package/js/modules/pathfinder.src.js +2106 -0
- package/js/modules/pattern-fill.js +1 -1
- package/js/modules/pattern-fill.src.js +1 -1
- package/js/modules/sankey.js +2 -2
- package/js/modules/sankey.src.js +3 -3
- package/js/modules/series-label.js +2 -2
- package/js/modules/series-label.src.js +4 -4
- package/js/modules/solid-gauge.js +2 -2
- package/js/modules/solid-gauge.src.js +3 -3
- package/js/modules/static-scale.js +3 -3
- package/js/modules/static-scale.js.map +1 -1
- package/js/modules/static-scale.src.js +65 -26
- package/js/modules/stock.js +135 -134
- package/js/modules/stock.js.map +1 -1
- package/js/modules/stock.src.js +230 -157
- package/js/modules/streamgraph.js +2 -2
- package/js/modules/streamgraph.src.js +3 -3
- package/js/modules/sunburst.js +1 -1
- package/js/modules/sunburst.src.js +1 -1
- package/js/modules/tilemap.js +1 -1
- package/js/modules/tilemap.js.map +1 -1
- package/js/modules/tilemap.src.js +355 -188
- package/js/modules/treegrid.js +51 -0
- package/js/modules/treegrid.js.map +1 -0
- package/js/modules/treegrid.src.js +2759 -0
- package/js/modules/treemap.js +1 -1
- package/js/modules/treemap.src.js +1 -1
- package/js/modules/variable-pie.js +1 -1
- package/js/modules/variable-pie.src.js +1 -1
- package/js/modules/variwide.js +2 -2
- package/js/modules/variwide.src.js +3 -3
- package/js/modules/vector.js +2 -2
- package/js/modules/vector.js.map +1 -1
- package/js/modules/vector.src.js +94 -24
- package/js/modules/windbarb.js +2 -2
- package/js/modules/windbarb.src.js +4 -4
- package/js/modules/wordcloud.js +1 -1
- package/js/modules/wordcloud.src.js +1 -1
- package/js/modules/xrange.js +11 -10
- package/js/modules/xrange.js.map +1 -1
- package/js/modules/xrange.src.js +257 -70
- package/js/themes/avocado.js +1 -1
- package/js/themes/avocado.src.js +1 -1
- package/js/themes/dark-blue.js +2 -2
- package/js/themes/dark-blue.src.js +3 -3
- package/js/themes/dark-green.js +2 -2
- package/js/themes/dark-green.src.js +3 -3
- package/js/themes/dark-unica.js +2 -2
- package/js/themes/dark-unica.src.js +3 -3
- package/js/themes/gray.js +2 -2
- package/js/themes/gray.src.js +3 -3
- package/js/themes/grid-light.js +2 -2
- package/js/themes/grid-light.src.js +3 -3
- package/js/themes/grid.js +2 -2
- package/js/themes/grid.src.js +3 -3
- package/js/themes/sand-signika.js +2 -2
- package/js/themes/sand-signika.src.js +3 -3
- package/js/themes/skies.js +2 -2
- package/js/themes/skies.src.js +3 -3
- package/js/themes/sunset.js +1 -1
- package/js/themes/sunset.src.js +1 -1
- package/modules/accessibility.js +1 -1
- package/modules/accessibility.src.js +1 -1
- package/modules/annotations.js +2 -2
- package/modules/annotations.src.js +2 -2
- package/modules/arrow-symbols.js +13 -0
- package/modules/arrow-symbols.js.map +1 -0
- package/modules/arrow-symbols.src.js +138 -0
- package/modules/boost-canvas.js +1 -1
- package/modules/boost-canvas.src.js +1 -1
- package/modules/boost.js +36 -36
- package/modules/boost.js.map +1 -1
- package/modules/boost.src.js +23 -15
- package/modules/broken-axis.js +11 -10
- package/modules/broken-axis.js.map +1 -1
- package/modules/broken-axis.src.js +171 -136
- package/modules/bullet.js +1 -1
- package/modules/bullet.src.js +1 -1
- package/modules/current-date-indicator.js +13 -0
- package/modules/current-date-indicator.js.map +1 -0
- package/modules/current-date-indicator.src.js +120 -0
- package/modules/data.js +2 -2
- package/modules/data.src.js +4 -4
- package/modules/drag-panes.js +1 -1
- package/modules/drag-panes.src.js +1 -1
- package/modules/draggable-points.js +38 -0
- package/modules/draggable-points.js.map +1 -0
- package/modules/draggable-points.src.js +2281 -0
- package/modules/drilldown.js +1 -1
- package/modules/drilldown.js.map +1 -1
- package/modules/drilldown.src.js +2 -1
- package/modules/export-data.js +2 -2
- package/modules/export-data.src.js +3 -3
- package/modules/exporting.js +2 -2
- package/modules/exporting.src.js +3 -3
- package/modules/funnel.js +2 -2
- package/modules/funnel.src.js +3 -3
- package/modules/gantt.js +83 -19
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +5553 -379
- package/modules/grid-axis.js +16 -11
- package/modules/grid-axis.js.map +1 -1
- package/modules/grid-axis.src.js +732 -293
- package/modules/heatmap.js +2 -2
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +128 -57
- package/modules/histogram-bellcurve.js +1 -1
- package/modules/histogram-bellcurve.src.js +1 -1
- package/modules/item-series.js +2 -2
- package/modules/item-series.src.js +3 -3
- package/modules/map.js +2 -2
- package/modules/map.js.map +1 -1
- package/modules/map.src.js +139 -68
- package/modules/no-data-to-display.js +1 -1
- package/modules/no-data-to-display.src.js +6 -6
- package/modules/offline-exporting.js +2 -2
- package/modules/offline-exporting.src.js +2 -2
- package/modules/oldie.js +2 -2
- package/modules/oldie.src.js +3 -3
- package/modules/overlapping-datalabels.js +2 -2
- package/modules/overlapping-datalabels.src.js +2 -2
- package/modules/parallel-coordinates.js +8 -8
- package/modules/parallel-coordinates.js.map +1 -1
- package/modules/parallel-coordinates.src.js +4 -3
- package/modules/pareto.js +1 -1
- package/modules/pareto.src.js +1 -1
- package/modules/pathfinder.js +35 -0
- package/modules/pathfinder.js.map +1 -0
- package/modules/pathfinder.src.js +2128 -0
- package/modules/pattern-fill.js +1 -1
- package/modules/pattern-fill.src.js +1 -1
- package/modules/sankey.js +2 -2
- package/modules/sankey.src.js +3 -3
- package/modules/series-label.js +2 -2
- package/modules/series-label.src.js +4 -4
- package/modules/solid-gauge.js +2 -2
- package/modules/solid-gauge.src.js +3 -3
- package/modules/static-scale.js +3 -3
- package/modules/static-scale.js.map +1 -1
- package/modules/static-scale.src.js +65 -26
- package/modules/stock.js +142 -142
- package/modules/stock.js.map +1 -1
- package/modules/stock.src.js +230 -157
- package/modules/streamgraph.js +2 -2
- package/modules/streamgraph.src.js +3 -3
- package/modules/sunburst.js +1 -1
- package/modules/sunburst.src.js +1 -1
- package/modules/tilemap.js +1 -1
- package/modules/tilemap.js.map +1 -1
- package/modules/tilemap.src.js +357 -189
- package/modules/treegrid.js +52 -0
- package/modules/treegrid.js.map +1 -0
- package/modules/treegrid.src.js +2797 -0
- package/modules/treemap.js +1 -1
- package/modules/treemap.src.js +1 -1
- package/modules/variable-pie.js +1 -1
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.js +2 -2
- package/modules/variwide.src.js +3 -3
- package/modules/vector.js +2 -2
- package/modules/vector.js.map +1 -1
- package/modules/vector.src.js +94 -24
- package/modules/windbarb.js +2 -2
- package/modules/windbarb.src.js +4 -4
- package/modules/wordcloud.js +1 -1
- package/modules/wordcloud.src.js +1 -1
- package/modules/xrange.js +12 -11
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +259 -79
- package/package.json +1 -1
- package/themes/avocado.js +1 -1
- package/themes/avocado.src.js +1 -1
- package/themes/dark-blue.js +2 -2
- package/themes/dark-blue.src.js +3 -3
- package/themes/dark-green.js +2 -2
- package/themes/dark-green.src.js +3 -3
- package/themes/dark-unica.js +2 -2
- package/themes/dark-unica.src.js +3 -3
- package/themes/gray.js +2 -2
- package/themes/gray.src.js +3 -3
- package/themes/grid-light.js +2 -2
- package/themes/grid-light.src.js +3 -3
- package/themes/grid.js +2 -2
- package/themes/grid.src.js +3 -3
- package/themes/sand-signika.js +2 -2
- package/themes/sand-signika.src.js +3 -3
- package/themes/skies.js +2 -2
- package/themes/skies.src.js +3 -3
- package/themes/sunset.js +1 -1
- package/themes/sunset.src.js +1 -1
|
@@ -0,0 +1,891 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (c) 2016 Highsoft AS
|
|
3
|
+
* Authors: Jon Arild Nygard
|
|
4
|
+
*
|
|
5
|
+
* License: www.highcharts.com/license
|
|
6
|
+
*/
|
|
7
|
+
/* eslint no-console: 0 */
|
|
8
|
+
'use strict';
|
|
9
|
+
import H from '../parts/Globals.js';
|
|
10
|
+
import '../parts/Utilities.js';
|
|
11
|
+
import './GridAxis.js';
|
|
12
|
+
import Tree from './Tree.js';
|
|
13
|
+
import mixinTreeSeries from '../mixins/tree-series.js';
|
|
14
|
+
import '../modules/broken-axis.src.js';
|
|
15
|
+
var argsToArray = function (args) {
|
|
16
|
+
return Array.prototype.slice.call(args, 1);
|
|
17
|
+
},
|
|
18
|
+
defined = H.defined,
|
|
19
|
+
each = H.each,
|
|
20
|
+
extend = H.extend,
|
|
21
|
+
find = H.find,
|
|
22
|
+
fireEvent = H.fireEvent,
|
|
23
|
+
getLevelOptions = mixinTreeSeries.getLevelOptions,
|
|
24
|
+
map = H.map,
|
|
25
|
+
merge = H.merge,
|
|
26
|
+
inArray = H.inArray,
|
|
27
|
+
isBoolean = function (x) {
|
|
28
|
+
return typeof x === 'boolean';
|
|
29
|
+
},
|
|
30
|
+
isNumber = H.isNumber,
|
|
31
|
+
isObject = function (x) {
|
|
32
|
+
// Always use strict mode.
|
|
33
|
+
return H.isObject(x, true);
|
|
34
|
+
},
|
|
35
|
+
isString = H.isString,
|
|
36
|
+
keys = H.keys,
|
|
37
|
+
pick = H.pick,
|
|
38
|
+
reduce = H.reduce,
|
|
39
|
+
wrap = H.wrap,
|
|
40
|
+
GridAxis = H.Axis,
|
|
41
|
+
GridAxisTick = H.Tick;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* some - Equivalent of Array.prototype.some
|
|
45
|
+
*
|
|
46
|
+
* @param {Array} arr Array to look for matching elements in.
|
|
47
|
+
* @param {function} condition The condition to check against.
|
|
48
|
+
* @return {boolean} Whether some elements pass the condition.
|
|
49
|
+
*/
|
|
50
|
+
var some = function (arr, condition) {
|
|
51
|
+
var result = false;
|
|
52
|
+
each(arr, function (element, index, array) {
|
|
53
|
+
if (!result) {
|
|
54
|
+
result = condition(element, index, array);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return result;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var override = function (obj, methods) {
|
|
61
|
+
var method,
|
|
62
|
+
func;
|
|
63
|
+
for (method in methods) {
|
|
64
|
+
if (methods.hasOwnProperty(method)) {
|
|
65
|
+
func = methods[method];
|
|
66
|
+
wrap(obj, method, func);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* getCategoriesFromTree - getCategories based on a tree
|
|
73
|
+
*
|
|
74
|
+
* @param {object} tree Root of tree to collect categories from
|
|
75
|
+
* @return {Array} Array of categories
|
|
76
|
+
*/
|
|
77
|
+
var getCategoriesFromTree = function (tree) {
|
|
78
|
+
var categories = [];
|
|
79
|
+
if (tree.data) {
|
|
80
|
+
categories.push(tree.data.name);
|
|
81
|
+
}
|
|
82
|
+
each(tree.children, function (child) {
|
|
83
|
+
categories = categories.concat(getCategoriesFromTree(child));
|
|
84
|
+
});
|
|
85
|
+
return categories;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var mapTickPosToNode = function (node, categories) {
|
|
89
|
+
var map = {},
|
|
90
|
+
name = node.data && node.data.name,
|
|
91
|
+
pos = inArray(name, categories);
|
|
92
|
+
map[pos] = node;
|
|
93
|
+
each(node.children, function (child) {
|
|
94
|
+
extend(map, mapTickPosToNode(child, categories));
|
|
95
|
+
});
|
|
96
|
+
return map;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
var getBreakFromNode = function (node, max) {
|
|
100
|
+
var from = node.collapseStart,
|
|
101
|
+
to = node.collapseEnd;
|
|
102
|
+
|
|
103
|
+
// In broken-axis, the axis.max is minimized until it is not within a break.
|
|
104
|
+
// Therefore, if break.to is larger than axis.max, the axis.to should not
|
|
105
|
+
// add the 0.5 axis.tickMarkOffset, to avoid adding a break larger than
|
|
106
|
+
// axis.max
|
|
107
|
+
// TODO consider simplifying broken-axis and this might solve itself
|
|
108
|
+
if (to >= max) {
|
|
109
|
+
from -= 0.5;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
from: from,
|
|
114
|
+
to: to,
|
|
115
|
+
showPoints: false
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Creates a list of positions for the ticks on the axis. Filters out positions
|
|
121
|
+
* that are outside min and max, or is inside an axis break.
|
|
122
|
+
*
|
|
123
|
+
* @param {Object} axis The Axis to get the tick positions from.
|
|
124
|
+
* @param {number} axis.min The minimum value of the axis.
|
|
125
|
+
* @param {number} axis.max The maximum value of the axis.
|
|
126
|
+
* @param {function} axis.isInAnyBreak Function to determine if a position is
|
|
127
|
+
* inside any breaks on the axis.
|
|
128
|
+
* @returns {number[]} List of positions.
|
|
129
|
+
*/
|
|
130
|
+
var getTickPositions = function (axis) {
|
|
131
|
+
return reduce(
|
|
132
|
+
keys(axis.mapOfPosToGridNode),
|
|
133
|
+
function (arr, key) {
|
|
134
|
+
var pos = +key;
|
|
135
|
+
if (
|
|
136
|
+
axis.min <= pos &&
|
|
137
|
+
axis.max >= pos &&
|
|
138
|
+
!axis.isInAnyBreak(pos)
|
|
139
|
+
) {
|
|
140
|
+
arr.push(pos);
|
|
141
|
+
}
|
|
142
|
+
return arr;
|
|
143
|
+
},
|
|
144
|
+
[]
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Check if a node is collapsed.
|
|
149
|
+
* @param {object} axis The axis to check against.
|
|
150
|
+
* @param {object} node The node to check if is collapsed.
|
|
151
|
+
* @param {number} pos The tick position to collapse.
|
|
152
|
+
* @returns {boolean} Returns true if collapsed, false if expanded.
|
|
153
|
+
*/
|
|
154
|
+
var isCollapsed = function (axis, node) {
|
|
155
|
+
var breaks = (axis.options.breaks || []),
|
|
156
|
+
obj = getBreakFromNode(node, axis.max);
|
|
157
|
+
return some(breaks, function (b) {
|
|
158
|
+
return b.from === obj.from && b.to === obj.to;
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Calculates the new axis breaks to collapse a node.
|
|
164
|
+
* @param {object} axis The axis to check against.
|
|
165
|
+
* @param {object} node The node to collapse.
|
|
166
|
+
* @param {number} pos The tick position to collapse.
|
|
167
|
+
* @returns {array} Returns an array of the new breaks for the axis.
|
|
168
|
+
*/
|
|
169
|
+
var collapse = function (axis, node) {
|
|
170
|
+
var breaks = (axis.options.breaks || []),
|
|
171
|
+
obj = getBreakFromNode(node, axis.max);
|
|
172
|
+
breaks.push(obj);
|
|
173
|
+
return breaks;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Calculates the new axis breaks to expand a node.
|
|
178
|
+
* @param {object} axis The axis to check against.
|
|
179
|
+
* @param {object} node The node to expand.
|
|
180
|
+
* @param {number} pos The tick position to expand.
|
|
181
|
+
* @returns {array} Returns an array of the new breaks for the axis.
|
|
182
|
+
*/
|
|
183
|
+
var expand = function (axis, node) {
|
|
184
|
+
var breaks = (axis.options.breaks || []),
|
|
185
|
+
obj = getBreakFromNode(node, axis.max);
|
|
186
|
+
// Remove the break from the axis breaks array.
|
|
187
|
+
return reduce(breaks, function (arr, b) {
|
|
188
|
+
if (b.to !== obj.to || b.from !== obj.from) {
|
|
189
|
+
arr.push(b);
|
|
190
|
+
}
|
|
191
|
+
return arr;
|
|
192
|
+
}, []);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Calculates the new axis breaks after toggling the collapse/expand state of a
|
|
197
|
+
* node. If it is collapsed it will be expanded, and if it is exapended it will
|
|
198
|
+
* be collapsed.
|
|
199
|
+
* @param {object} axis The axis to check against.
|
|
200
|
+
* @param {object} node The node to toggle.
|
|
201
|
+
* @param {number} pos The tick position to toggle.
|
|
202
|
+
* @returns {array} Returns an array of the new breaks for the axis.
|
|
203
|
+
*/
|
|
204
|
+
var toggleCollapse = function (axis, node) {
|
|
205
|
+
return (
|
|
206
|
+
isCollapsed(axis, node) ?
|
|
207
|
+
expand(axis, node) :
|
|
208
|
+
collapse(axis, node)
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
var renderLabelIcon = function (tick, params) {
|
|
212
|
+
var icon = tick.labelIcon,
|
|
213
|
+
isNew = !icon,
|
|
214
|
+
renderer = params.renderer,
|
|
215
|
+
labelBox = params.xy,
|
|
216
|
+
options = params.options,
|
|
217
|
+
width = options.width,
|
|
218
|
+
height = options.height,
|
|
219
|
+
iconCenter = {
|
|
220
|
+
x: labelBox.x - (width / 2) - options.padding,
|
|
221
|
+
y: labelBox.y - (height / 2)
|
|
222
|
+
},
|
|
223
|
+
rotation = params.collapsed ? 90 : 180,
|
|
224
|
+
shouldRender = params.show && H.isNumber(iconCenter.y);
|
|
225
|
+
|
|
226
|
+
if (isNew) {
|
|
227
|
+
tick.labelIcon = icon = renderer.path(renderer.symbols[options.type](
|
|
228
|
+
options.x,
|
|
229
|
+
options.y,
|
|
230
|
+
width,
|
|
231
|
+
height
|
|
232
|
+
))
|
|
233
|
+
.addClass('highcharts-label-icon')
|
|
234
|
+
.add(params.group);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Set the new position, and show or hide
|
|
238
|
+
if (!shouldRender) {
|
|
239
|
+
icon.attr({ y: -9999 }); // #1338
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
// Update the icon positions
|
|
245
|
+
icon[isNew ? 'attr' : 'animate']({
|
|
246
|
+
translateX: iconCenter.x,
|
|
247
|
+
translateY: iconCenter.y,
|
|
248
|
+
rotation: rotation
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
};
|
|
252
|
+
var onTickHover = function (label) {
|
|
253
|
+
label.addClass('highcharts-treegrid-node-active');
|
|
254
|
+
|
|
255
|
+
};
|
|
256
|
+
var onTickHoverExit = function (label, options) {
|
|
257
|
+
var css = defined(options.style) ? options.style : {};
|
|
258
|
+
label.removeClass('highcharts-treegrid-node-active');
|
|
259
|
+
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Creates a tree structure of the data, and the treegrid. Calculates
|
|
264
|
+
* categories, and y-values of points based on the tree.
|
|
265
|
+
* @param {Array} data All the data points to display in the axis.
|
|
266
|
+
* @param {boolean} uniqueNames Wether or not the data node with the same name
|
|
267
|
+
* should share grid cell. If true they do share cell. False by default.
|
|
268
|
+
* @returns {object} Returns an object containing categories, mapOfIdToNode,
|
|
269
|
+
* mapOfPosToGridNode, and tree.
|
|
270
|
+
* @todo There should be only one point per line.
|
|
271
|
+
* @todo It should be optional to have one category per point, or merge cells
|
|
272
|
+
* @todo Add unit-tests.
|
|
273
|
+
*/
|
|
274
|
+
var getTreeGridFromData = function (data, uniqueNames, numberOfSeries) {
|
|
275
|
+
var categories = [],
|
|
276
|
+
collapsedNodes = [],
|
|
277
|
+
mapOfIdToNode = {},
|
|
278
|
+
mapOfPosToGridNode = {},
|
|
279
|
+
posIterator = -1,
|
|
280
|
+
uniqueNamesEnabled = isBoolean(uniqueNames) ? uniqueNames : false,
|
|
281
|
+
tree,
|
|
282
|
+
treeParams,
|
|
283
|
+
updateYValuesAndTickPos;
|
|
284
|
+
|
|
285
|
+
// Build the tree from the series data.
|
|
286
|
+
treeParams = {
|
|
287
|
+
// After the children has been created.
|
|
288
|
+
after: function (node) {
|
|
289
|
+
var gridNode = mapOfPosToGridNode[node.pos],
|
|
290
|
+
height = 0,
|
|
291
|
+
descendants = 0;
|
|
292
|
+
each(gridNode.children, function (child) {
|
|
293
|
+
descendants += child.descendants + 1;
|
|
294
|
+
height = Math.max(child.height + 1, height);
|
|
295
|
+
});
|
|
296
|
+
gridNode.descendants = descendants;
|
|
297
|
+
gridNode.height = height;
|
|
298
|
+
if (gridNode.collapsed) {
|
|
299
|
+
collapsedNodes.push(gridNode);
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
// Before the children has been created.
|
|
303
|
+
before: function (node) {
|
|
304
|
+
var data = isObject(node.data) ? node.data : {},
|
|
305
|
+
name = isString(data.name) ? data.name : '',
|
|
306
|
+
parentNode = mapOfIdToNode[node.parent],
|
|
307
|
+
parentGridNode = (
|
|
308
|
+
isObject(parentNode) ?
|
|
309
|
+
mapOfPosToGridNode[parentNode.pos] :
|
|
310
|
+
null
|
|
311
|
+
),
|
|
312
|
+
hasSameName = function (x) {
|
|
313
|
+
return x.name === name;
|
|
314
|
+
},
|
|
315
|
+
gridNode,
|
|
316
|
+
pos;
|
|
317
|
+
|
|
318
|
+
// If not unique names, look for a sibling node with the same name.
|
|
319
|
+
if (
|
|
320
|
+
uniqueNamesEnabled &&
|
|
321
|
+
isObject(parentGridNode) &&
|
|
322
|
+
!!(gridNode = find(parentGridNode.children, hasSameName))
|
|
323
|
+
) {
|
|
324
|
+
// If if there is a gridNode with the same name, reuse position.
|
|
325
|
+
pos = gridNode.pos;
|
|
326
|
+
// Add data node to list of nodes in the grid node.
|
|
327
|
+
gridNode.nodes.push(node);
|
|
328
|
+
} else {
|
|
329
|
+
// If it is a new grid node, increment position.
|
|
330
|
+
pos = posIterator++;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// Add new grid node to map.
|
|
334
|
+
if (!mapOfPosToGridNode[pos]) {
|
|
335
|
+
mapOfPosToGridNode[pos] = gridNode = {
|
|
336
|
+
depth: parentGridNode ? parentGridNode.depth + 1 : 0,
|
|
337
|
+
name: name,
|
|
338
|
+
nodes: [node],
|
|
339
|
+
children: [],
|
|
340
|
+
pos: pos
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
// If not root, then add name to categories.
|
|
344
|
+
if (pos !== -1) {
|
|
345
|
+
categories.push(name);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// Add name to list of children.
|
|
349
|
+
if (isObject(parentGridNode)) {
|
|
350
|
+
parentGridNode.children.push(gridNode);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Add data node to map
|
|
355
|
+
if (isString(node.id)) {
|
|
356
|
+
mapOfIdToNode[node.id] = node;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// If one of the points are collapsed, then start the grid node in
|
|
360
|
+
// collapsed state.
|
|
361
|
+
if (data.collapsed === true) {
|
|
362
|
+
gridNode.collapsed = true;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Assign pos to data node
|
|
366
|
+
node.pos = pos;
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
updateYValuesAndTickPos = function (map, numberOfSeries) {
|
|
371
|
+
var setValues = function (gridNode, start, result) {
|
|
372
|
+
var nodes = gridNode.nodes,
|
|
373
|
+
end = start + (start === -1 ? 0 : numberOfSeries - 1),
|
|
374
|
+
diff = (end - start) / 2,
|
|
375
|
+
padding = 0.5,
|
|
376
|
+
pos = start + diff;
|
|
377
|
+
|
|
378
|
+
each(nodes, function (node) {
|
|
379
|
+
var data = node.data;
|
|
380
|
+
if (isObject(data)) {
|
|
381
|
+
// Update point
|
|
382
|
+
data.y = start + data.seriesIndex;
|
|
383
|
+
// Remove the property once used
|
|
384
|
+
delete data.seriesIndex;
|
|
385
|
+
}
|
|
386
|
+
node.pos = pos;
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
result[pos] = gridNode;
|
|
390
|
+
|
|
391
|
+
gridNode.pos = pos;
|
|
392
|
+
gridNode.tickmarkOffset = diff + padding;
|
|
393
|
+
gridNode.collapseStart = end + padding;
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
each(gridNode.children, function (child) {
|
|
397
|
+
setValues(child, end + 1, result);
|
|
398
|
+
end = child.collapseEnd - padding;
|
|
399
|
+
});
|
|
400
|
+
// Set collapseEnd to the end of the last child node.
|
|
401
|
+
gridNode.collapseEnd = end + padding;
|
|
402
|
+
|
|
403
|
+
return result;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
return setValues(map['-1'], -1, {});
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
// Create tree from data
|
|
410
|
+
tree = Tree.getTree(data, treeParams);
|
|
411
|
+
|
|
412
|
+
// Update y values of data, and set calculate tick positions.
|
|
413
|
+
mapOfPosToGridNode = updateYValuesAndTickPos(
|
|
414
|
+
mapOfPosToGridNode,
|
|
415
|
+
numberOfSeries
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
// Return the resulting data.
|
|
419
|
+
return {
|
|
420
|
+
categories: categories,
|
|
421
|
+
mapOfIdToNode: mapOfIdToNode,
|
|
422
|
+
mapOfPosToGridNode: mapOfPosToGridNode,
|
|
423
|
+
collapsedNodes: collapsedNodes,
|
|
424
|
+
tree: tree
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
override(GridAxis.prototype, {
|
|
429
|
+
init: function (proceed, chart, userOptions) {
|
|
430
|
+
var axis = this,
|
|
431
|
+
removeFoundExtremesEvent,
|
|
432
|
+
isTreeGrid = userOptions.type === 'treegrid';
|
|
433
|
+
// Set default and forced options for TreeGrid
|
|
434
|
+
if (isTreeGrid) {
|
|
435
|
+
userOptions = merge({
|
|
436
|
+
// Default options
|
|
437
|
+
grid: {
|
|
438
|
+
enabled: true
|
|
439
|
+
},
|
|
440
|
+
// TODO: add support for align in treegrid.
|
|
441
|
+
labels: {
|
|
442
|
+
align: 'left',
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Set options on specific levels in a tree grid axis. Takes
|
|
446
|
+
* precedence over labels options.
|
|
447
|
+
*
|
|
448
|
+
* @product gantt
|
|
449
|
+
* @sample {gantt} gantt/treegrid-axis/labels-levels
|
|
450
|
+
* Levels on TreeGrid Labels
|
|
451
|
+
* @type {Array<Object>}
|
|
452
|
+
* @apioption yAxis.labels.levels
|
|
453
|
+
*/
|
|
454
|
+
levels: [{
|
|
455
|
+
/**
|
|
456
|
+
* Specify the level which the options within this object
|
|
457
|
+
* applies to.
|
|
458
|
+
*
|
|
459
|
+
* @sample {gantt} gantt/treegrid-axis/labels-levels
|
|
460
|
+
*/
|
|
461
|
+
level: undefined
|
|
462
|
+
}, {
|
|
463
|
+
level: 1,
|
|
464
|
+
style: {
|
|
465
|
+
fontWeight: 'bold'
|
|
466
|
+
}
|
|
467
|
+
}],
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* The symbol for the collapse and expand icon in a
|
|
471
|
+
* treegrid.
|
|
472
|
+
*
|
|
473
|
+
* @product gantt
|
|
474
|
+
* @optionparent yAxis.labels.symbol
|
|
475
|
+
*/
|
|
476
|
+
symbol: {
|
|
477
|
+
/**
|
|
478
|
+
* The symbol type. Points to a definition function in
|
|
479
|
+
* the `Highcharts.Renderer.symbols` collection.
|
|
480
|
+
*
|
|
481
|
+
* @validvalue ['arc', 'circle', 'diamond', 'square', 'triangle', 'triangle-down']
|
|
482
|
+
*/
|
|
483
|
+
type: 'triangle',
|
|
484
|
+
x: -5,
|
|
485
|
+
y: -5,
|
|
486
|
+
height: 10,
|
|
487
|
+
width: 10,
|
|
488
|
+
padding: 5
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
uniqueNames: false
|
|
492
|
+
|
|
493
|
+
}, userOptions, { // User options
|
|
494
|
+
// Forced options
|
|
495
|
+
reversed: true,
|
|
496
|
+
// grid.columns is not supported in treegrid
|
|
497
|
+
grid: {
|
|
498
|
+
columns: undefined
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// Now apply the original function with the original arguments,
|
|
504
|
+
// which are sliced off this function's arguments
|
|
505
|
+
proceed.apply(axis, [chart, userOptions]);
|
|
506
|
+
if (isTreeGrid) {
|
|
507
|
+
H.addEvent(axis.chart, 'beforeRender', function () {
|
|
508
|
+
var labelOptions = axis.options && axis.options.labels;
|
|
509
|
+
|
|
510
|
+
// beforeRender is fired after all the series is initialized,
|
|
511
|
+
// which is an ideal time to update the axis.categories.
|
|
512
|
+
axis.updateYNames();
|
|
513
|
+
|
|
514
|
+
// Update yData now that we have calculated the y values
|
|
515
|
+
// TODO: it would be better to be able to calculate y values
|
|
516
|
+
// before Series.setData
|
|
517
|
+
each(axis.series, function (series) {
|
|
518
|
+
series.yData = map(series.options.data, function (data) {
|
|
519
|
+
return data.y;
|
|
520
|
+
});
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// Calculate the label options for each level in the tree.
|
|
524
|
+
axis.mapOptionsToLevel = getLevelOptions({
|
|
525
|
+
defaults: labelOptions,
|
|
526
|
+
from: 1,
|
|
527
|
+
levels: labelOptions.levels,
|
|
528
|
+
to: axis.tree.height
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
// Collapse all the nodes belonging to a point where collapsed
|
|
532
|
+
// equals true.
|
|
533
|
+
// Can be called from beforeRender, if getBreakFromNode removes
|
|
534
|
+
// its dependency on axis.max.
|
|
535
|
+
removeFoundExtremesEvent =
|
|
536
|
+
H.addEvent(axis, 'foundExtremes', function () {
|
|
537
|
+
each(axis.collapsedNodes, function (node) {
|
|
538
|
+
var breaks = collapse(axis, node);
|
|
539
|
+
axis.setBreaks(breaks, false);
|
|
540
|
+
});
|
|
541
|
+
removeFoundExtremesEvent();
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
axis.hasNames = true;
|
|
545
|
+
axis.options.showLastLabel = true;
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
/**
|
|
549
|
+
* Override to add indentation to axis.maxLabelDimensions.
|
|
550
|
+
* @param {Function} proceed the original function
|
|
551
|
+
* @returns {undefined}
|
|
552
|
+
*/
|
|
553
|
+
getMaxLabelDimensions: function (proceed) {
|
|
554
|
+
var axis = this,
|
|
555
|
+
options = axis.options,
|
|
556
|
+
labelOptions = options && options.labels,
|
|
557
|
+
indentation = (
|
|
558
|
+
labelOptions && isNumber(labelOptions.indentation) ?
|
|
559
|
+
options.labels.indentation :
|
|
560
|
+
0
|
|
561
|
+
),
|
|
562
|
+
retVal = proceed.apply(axis, argsToArray(arguments)),
|
|
563
|
+
isTreeGrid = axis.options.type === 'treegrid',
|
|
564
|
+
treeDepth;
|
|
565
|
+
|
|
566
|
+
if (isTreeGrid) {
|
|
567
|
+
treeDepth = axis.mapOfPosToGridNode[-1].height;
|
|
568
|
+
retVal.width += indentation * (treeDepth - 1);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return retVal;
|
|
572
|
+
},
|
|
573
|
+
/**
|
|
574
|
+
* Generates a tick for initial positioning.
|
|
575
|
+
*
|
|
576
|
+
* @private
|
|
577
|
+
* @param {function} proceed The original generateTick function.
|
|
578
|
+
* @param {number} pos The tick position in axis values.
|
|
579
|
+
*/
|
|
580
|
+
generateTick: function (proceed, pos) {
|
|
581
|
+
var axis = this,
|
|
582
|
+
mapOptionsToLevel = (
|
|
583
|
+
isObject(axis.mapOptionsToLevel) ? axis.mapOptionsToLevel : {}
|
|
584
|
+
),
|
|
585
|
+
isTreeGrid = axis.options.type === 'treegrid',
|
|
586
|
+
ticks = axis.ticks,
|
|
587
|
+
tick = ticks[pos],
|
|
588
|
+
levelOptions,
|
|
589
|
+
options,
|
|
590
|
+
gridNode;
|
|
591
|
+
|
|
592
|
+
if (isTreeGrid) {
|
|
593
|
+
gridNode = axis.mapOfPosToGridNode[pos];
|
|
594
|
+
levelOptions = mapOptionsToLevel[gridNode.depth];
|
|
595
|
+
|
|
596
|
+
if (levelOptions) {
|
|
597
|
+
options = {
|
|
598
|
+
labels: levelOptions
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
if (!tick) {
|
|
603
|
+
ticks[pos] = tick =
|
|
604
|
+
new GridAxisTick(axis, pos, null, undefined, {
|
|
605
|
+
category: gridNode.name,
|
|
606
|
+
tickmarkOffset: gridNode.tickmarkOffset,
|
|
607
|
+
options: options
|
|
608
|
+
});
|
|
609
|
+
} else {
|
|
610
|
+
// update labels depending on tick interval
|
|
611
|
+
tick.parameters.category = gridNode.name;
|
|
612
|
+
tick.options = options;
|
|
613
|
+
tick.addLabel();
|
|
614
|
+
}
|
|
615
|
+
} else {
|
|
616
|
+
proceed.apply(axis, argsToArray(arguments));
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
/**
|
|
620
|
+
* Set the tick positions, tickInterval, axis min and max.
|
|
621
|
+
*
|
|
622
|
+
* @private
|
|
623
|
+
*/
|
|
624
|
+
setTickInterval: function (proceed) {
|
|
625
|
+
var axis = this,
|
|
626
|
+
options = axis.options,
|
|
627
|
+
isTreeGrid = options.type === 'treegrid';
|
|
628
|
+
|
|
629
|
+
if (isTreeGrid) {
|
|
630
|
+
axis.min = pick(axis.userMin, options.min, axis.dataMin);
|
|
631
|
+
axis.max = pick(axis.userMax, options.max, axis.dataMax);
|
|
632
|
+
|
|
633
|
+
fireEvent(axis, 'foundExtremes');
|
|
634
|
+
|
|
635
|
+
// setAxisTranslation modifies the min and max according to
|
|
636
|
+
// axis breaks.
|
|
637
|
+
axis.setAxisTranslation(true);
|
|
638
|
+
|
|
639
|
+
axis.tickmarkOffset = 0.5;
|
|
640
|
+
axis.tickInterval = 1;
|
|
641
|
+
axis.tickPositions = getTickPositions(axis);
|
|
642
|
+
} else {
|
|
643
|
+
proceed.apply(axis, argsToArray(arguments));
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
override(GridAxisTick.prototype, {
|
|
648
|
+
getLabelPosition: function (
|
|
649
|
+
proceed,
|
|
650
|
+
x,
|
|
651
|
+
y,
|
|
652
|
+
label,
|
|
653
|
+
horiz,
|
|
654
|
+
labelOptions,
|
|
655
|
+
tickmarkOffset,
|
|
656
|
+
index,
|
|
657
|
+
step
|
|
658
|
+
) {
|
|
659
|
+
var tick = this,
|
|
660
|
+
lbOptions = pick(
|
|
661
|
+
tick.options && tick.options.labels,
|
|
662
|
+
labelOptions
|
|
663
|
+
),
|
|
664
|
+
pos = tick.pos,
|
|
665
|
+
axis = tick.axis,
|
|
666
|
+
options = axis.options,
|
|
667
|
+
isTreeGrid = options.type === 'treegrid',
|
|
668
|
+
result = proceed.apply(
|
|
669
|
+
tick,
|
|
670
|
+
[x, y, label, horiz, lbOptions, tickmarkOffset, index, step]
|
|
671
|
+
),
|
|
672
|
+
symbolOptions,
|
|
673
|
+
indentation,
|
|
674
|
+
mapOfPosToGridNode,
|
|
675
|
+
node,
|
|
676
|
+
level;
|
|
677
|
+
|
|
678
|
+
if (isTreeGrid) {
|
|
679
|
+
symbolOptions = (
|
|
680
|
+
lbOptions && isObject(lbOptions.symbol) ?
|
|
681
|
+
lbOptions.symbol :
|
|
682
|
+
{}
|
|
683
|
+
);
|
|
684
|
+
indentation = (
|
|
685
|
+
lbOptions && isNumber(lbOptions.indentation) ?
|
|
686
|
+
lbOptions.indentation :
|
|
687
|
+
0
|
|
688
|
+
);
|
|
689
|
+
mapOfPosToGridNode = axis.mapOfPosToGridNode;
|
|
690
|
+
node = mapOfPosToGridNode && mapOfPosToGridNode[pos];
|
|
691
|
+
level = (node && node.depth) || 1;
|
|
692
|
+
result.x += (
|
|
693
|
+
// Add space for symbols
|
|
694
|
+
((symbolOptions.width) + (symbolOptions.padding * 2)) +
|
|
695
|
+
// Apply indentation
|
|
696
|
+
((level - 1) * indentation)
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
return result;
|
|
701
|
+
},
|
|
702
|
+
renderLabel: function (proceed) {
|
|
703
|
+
var tick = this,
|
|
704
|
+
pos = tick.pos,
|
|
705
|
+
axis = tick.axis,
|
|
706
|
+
label = tick.label,
|
|
707
|
+
mapOfPosToGridNode = axis.mapOfPosToGridNode,
|
|
708
|
+
options = axis.options,
|
|
709
|
+
labelOptions = pick(
|
|
710
|
+
tick.options && tick.options.labels,
|
|
711
|
+
options && options.labels
|
|
712
|
+
),
|
|
713
|
+
symbolOptions = (
|
|
714
|
+
labelOptions && isObject(labelOptions.symbol) ?
|
|
715
|
+
labelOptions.symbol :
|
|
716
|
+
{}
|
|
717
|
+
),
|
|
718
|
+
node = mapOfPosToGridNode && mapOfPosToGridNode[pos],
|
|
719
|
+
level = node && node.depth,
|
|
720
|
+
isTreeGrid = options.type === 'treegrid',
|
|
721
|
+
hasLabel = !!(label && label.element),
|
|
722
|
+
shouldRender = inArray(pos, axis.tickPositions) > -1,
|
|
723
|
+
prefixClassName = 'highcharts-treegrid-node-',
|
|
724
|
+
collapsed,
|
|
725
|
+
addClassName,
|
|
726
|
+
removeClassName;
|
|
727
|
+
|
|
728
|
+
if (isTreeGrid && node) {
|
|
729
|
+
// Add class name for hierarchical styling.
|
|
730
|
+
if (hasLabel) {
|
|
731
|
+
label.addClass(prefixClassName + 'level-' + level);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
proceed.apply(tick, argsToArray(arguments));
|
|
736
|
+
|
|
737
|
+
if (isTreeGrid && node && hasLabel && node.descendants > 0) {
|
|
738
|
+
collapsed = isCollapsed(axis, node);
|
|
739
|
+
|
|
740
|
+
renderLabelIcon(
|
|
741
|
+
tick,
|
|
742
|
+
{
|
|
743
|
+
|
|
744
|
+
collapsed: collapsed,
|
|
745
|
+
group: label.parentGroup,
|
|
746
|
+
options: symbolOptions,
|
|
747
|
+
renderer: label.renderer,
|
|
748
|
+
show: shouldRender,
|
|
749
|
+
xy: label.xy
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
|
|
753
|
+
// Add class name for the node.
|
|
754
|
+
addClassName = prefixClassName +
|
|
755
|
+
(collapsed ? 'collapsed' : 'expanded');
|
|
756
|
+
removeClassName = prefixClassName +
|
|
757
|
+
(collapsed ? 'expanded' : 'collapsed');
|
|
758
|
+
|
|
759
|
+
label
|
|
760
|
+
.addClass(addClassName)
|
|
761
|
+
.removeClass(removeClassName);
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
// Add events to both label text and icon
|
|
766
|
+
each([label, tick.labelIcon], function (object) {
|
|
767
|
+
if (!object.attachedTreeGridEvents) {
|
|
768
|
+
// On hover
|
|
769
|
+
H.addEvent(object.element, 'mouseover', function () {
|
|
770
|
+
onTickHover(label);
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
// On hover out
|
|
774
|
+
H.addEvent(object.element, 'mouseout', function () {
|
|
775
|
+
onTickHoverExit(label, labelOptions);
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
H.addEvent(object.element, 'click', function () {
|
|
779
|
+
tick.toggleCollapse();
|
|
780
|
+
});
|
|
781
|
+
object.attachedTreeGridEvents = true;
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
|
|
788
|
+
extend(GridAxisTick.prototype, /** @lends Highcharts.Tick.prototype */{
|
|
789
|
+
/**
|
|
790
|
+
* Collapse the grid cell. Used when axis is of type treegrid.
|
|
791
|
+
* @param {boolean} [redraw=true] Whether to redraw the chart or wait for
|
|
792
|
+
* an explicit call to {@link Highcharts.Chart#redraw}
|
|
793
|
+
* @sample {gantt} gantt/treegrid-axis/collapsed-dynamically/demo.js
|
|
794
|
+
* Dynamically collapse
|
|
795
|
+
*/
|
|
796
|
+
collapse: function (redraw) {
|
|
797
|
+
var tick = this,
|
|
798
|
+
axis = tick.axis,
|
|
799
|
+
pos = tick.pos,
|
|
800
|
+
node = axis.mapOfPosToGridNode[pos],
|
|
801
|
+
breaks = collapse(axis, node);
|
|
802
|
+
axis.setBreaks(breaks, pick(redraw, true));
|
|
803
|
+
},
|
|
804
|
+
/**
|
|
805
|
+
* Expand the grid cell. Used when axis is of type treegrid.
|
|
806
|
+
*
|
|
807
|
+
* @param {boolean} [redraw=true] Whether to redraw the chart or wait for
|
|
808
|
+
* an explicit call to {@link Highcharts.Chart#redraw}
|
|
809
|
+
* @sample {gantt} gantt/treegrid-axis/collapsed-dynamically/demo.js
|
|
810
|
+
* Dynamically collapse
|
|
811
|
+
*/
|
|
812
|
+
expand: function (redraw) {
|
|
813
|
+
var tick = this,
|
|
814
|
+
axis = tick.axis,
|
|
815
|
+
pos = tick.pos,
|
|
816
|
+
node = axis.mapOfPosToGridNode[pos],
|
|
817
|
+
breaks = expand(axis, node);
|
|
818
|
+
axis.setBreaks(breaks, pick(redraw, true));
|
|
819
|
+
},
|
|
820
|
+
/**
|
|
821
|
+
* Toggle the collapse/expand state of the grid cell. Used when axis is of
|
|
822
|
+
* type treegrid.
|
|
823
|
+
*
|
|
824
|
+
* @param {boolean} [redraw=true] Whether to redraw the chart or wait for
|
|
825
|
+
* an explicit call to {@link Highcharts.Chart#redraw}
|
|
826
|
+
* @sample {gantt} gantt/treegrid-axis/collapsed-dynamically/demo.js
|
|
827
|
+
* Dynamically collapse
|
|
828
|
+
*/
|
|
829
|
+
toggleCollapse: function (redraw) {
|
|
830
|
+
var tick = this,
|
|
831
|
+
axis = tick.axis,
|
|
832
|
+
pos = tick.pos,
|
|
833
|
+
node = axis.mapOfPosToGridNode[pos],
|
|
834
|
+
breaks = toggleCollapse(axis, node);
|
|
835
|
+
axis.setBreaks(breaks, pick(redraw, true));
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
GridAxis.prototype.updateYNames = function () {
|
|
840
|
+
var axis = this,
|
|
841
|
+
options = axis.options,
|
|
842
|
+
isTreeGrid = options.type === 'treegrid',
|
|
843
|
+
uniqueNames = options.uniqueNames,
|
|
844
|
+
isYAxis = !axis.isXAxis,
|
|
845
|
+
series = axis.series,
|
|
846
|
+
numberOfSeries = 0,
|
|
847
|
+
treeGrid,
|
|
848
|
+
data;
|
|
849
|
+
|
|
850
|
+
if (isTreeGrid && isYAxis) {
|
|
851
|
+
// Concatenate data from all series assigned to this axis.
|
|
852
|
+
data = reduce(series, function (arr, s) {
|
|
853
|
+
if (s.visible) {
|
|
854
|
+
// Push all data to array
|
|
855
|
+
each(s.options.data, function (data) {
|
|
856
|
+
if (isObject(data)) {
|
|
857
|
+
// Set series index on data. Removed again after use.
|
|
858
|
+
data.seriesIndex = numberOfSeries;
|
|
859
|
+
arr.push(data);
|
|
860
|
+
}
|
|
861
|
+
});
|
|
862
|
+
|
|
863
|
+
// Increment series index
|
|
864
|
+
if (uniqueNames === true) {
|
|
865
|
+
numberOfSeries++;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return arr;
|
|
869
|
+
}, []);
|
|
870
|
+
|
|
871
|
+
// Calculate categories and the hierarchy for the grid.
|
|
872
|
+
treeGrid = getTreeGridFromData(
|
|
873
|
+
data,
|
|
874
|
+
uniqueNames,
|
|
875
|
+
(uniqueNames === true) ? numberOfSeries : 1
|
|
876
|
+
);
|
|
877
|
+
|
|
878
|
+
// Assign values to the axis.
|
|
879
|
+
axis.categories = treeGrid.categories;
|
|
880
|
+
axis.mapOfPosToGridNode = treeGrid.mapOfPosToGridNode;
|
|
881
|
+
// Used on init to start a node as collapsed
|
|
882
|
+
axis.collapsedNodes = treeGrid.collapsedNodes;
|
|
883
|
+
axis.hasNames = true;
|
|
884
|
+
axis.tree = treeGrid.tree;
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
// Make utility functions available for testing.
|
|
889
|
+
GridAxis.prototype.utils = {
|
|
890
|
+
getNode: Tree.getNode
|
|
891
|
+
};
|