@ntlab/ntjs-assets 2.0.21 → 2.0.22
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/assets/js/cdn.json +1 -1
- package/assets/js/highcharts/css/highcharts.css +74 -0
- package/assets/js/highcharts/es-modules/Accessibility/Components/LegendComponent.js +1 -1
- package/assets/js/highcharts/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +1 -1
- package/assets/js/highcharts/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +9 -2
- package/assets/js/highcharts/es-modules/Core/Axis/Axis.js +25 -15
- package/assets/js/highcharts/es-modules/Core/Axis/AxisDefaults.js +3 -2
- package/assets/js/highcharts/es-modules/Core/Axis/Color/ColorAxis.js +1 -1
- package/assets/js/highcharts/es-modules/Core/Axis/Color/ColorAxisDefaults.js +2 -2
- package/assets/js/highcharts/es-modules/Core/Axis/GridAxis.js +1 -1
- package/assets/js/highcharts/es-modules/Core/Axis/OrdinalAxis.js +1 -1
- package/assets/js/highcharts/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +10 -0
- package/assets/js/highcharts/es-modules/Core/Axis/RadialAxis.js +19 -113
- package/assets/js/highcharts/es-modules/Core/Axis/RadialAxisDefaults.js +128 -0
- package/assets/js/highcharts/es-modules/Core/Axis/Tick.js +9 -13
- package/assets/js/highcharts/es-modules/Core/Chart/Chart.js +21 -17
- package/assets/js/highcharts/es-modules/Core/Chart/ChartDefaults.js +4 -2
- package/assets/js/highcharts/es-modules/Core/Chart/StockChart.js +5 -9
- package/assets/js/highcharts/es-modules/Core/Defaults.js +180 -91
- package/assets/js/highcharts/es-modules/Core/Renderer/SVG/SVGElement.js +50 -28
- package/assets/js/highcharts/es-modules/Core/Renderer/SVG/SVGLabel.js +6 -3
- package/assets/js/highcharts/es-modules/Core/Renderer/SVG/SVGRenderer.js +38 -80
- package/assets/js/highcharts/es-modules/Core/Renderer/SVG/Symbols.js +9 -5
- package/assets/js/highcharts/es-modules/Core/Series/DataLabel.js +17 -10
- package/assets/js/highcharts/es-modules/Core/Series/Point.js +4 -3
- package/assets/js/highcharts/es-modules/Core/Series/Series.js +24 -15
- package/assets/js/highcharts/es-modules/Core/Series/SeriesDefaults.js +15 -0
- package/assets/js/highcharts/es-modules/Core/Templating.js +4 -1
- package/assets/js/highcharts/es-modules/Core/Tooltip.js +17 -55
- package/assets/js/highcharts/es-modules/Core/Utilities.js +16 -0
- package/assets/js/highcharts/es-modules/Data/Converters/CSVConverter.js +1 -1
- package/assets/js/highcharts/es-modules/Data/DataCursor.js +34 -16
- package/assets/js/highcharts/es-modules/Data/DataPool.js +1 -1
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Controllables/Controllable.js +3 -0
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Controllables/ControllableLabel.js +0 -3
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Controllables/ControllablePath.js +0 -3
- package/assets/js/highcharts/es-modules/Extensions/Annotations/EventEmitter.js +6 -6
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +2 -0
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/CrookedLine.js +1 -0
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Fibonacci.js +4 -2
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +2 -1
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/InfinityLine.js +2 -1
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Measure.js +4 -3
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Pitchfork.js +11 -5
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/TimeCycles.js +2 -1
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Tunnel.js +4 -2
- package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/VerticalLine.js +2 -1
- package/assets/js/highcharts/es-modules/Extensions/Boost/BoostChart.js +11 -3
- package/assets/js/highcharts/es-modules/Extensions/Boost/BoostSeries.js +7 -4
- package/assets/js/highcharts/es-modules/Extensions/Boost/WGLRenderer.js +11 -2
- package/assets/js/highcharts/es-modules/Extensions/Data.js +3 -3
- package/assets/js/highcharts/es-modules/Extensions/DataGrouping/DataGroupingSeriesComposition.js +1 -0
- package/assets/js/highcharts/es-modules/Extensions/DownloadURL.js +3 -0
- package/assets/js/highcharts/es-modules/Extensions/DragPanes/AxisResizer.js +1 -2
- package/assets/js/highcharts/es-modules/Extensions/DraggablePoints/DragDropProps.js +17 -0
- package/assets/js/highcharts/es-modules/Extensions/DraggablePoints/DraggablePoints.js +1 -0
- package/assets/js/highcharts/es-modules/Extensions/Drilldown/Drilldown.js +14 -14
- package/assets/js/highcharts/es-modules/Extensions/Exporting/Exporting.js +13 -18
- package/assets/js/highcharts/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -6
- package/assets/js/highcharts/es-modules/Extensions/OfflineExporting/OfflineExporting.js +38 -30
- package/assets/js/highcharts/es-modules/Extensions/Pane/PaneDefaults.js +11 -0
- package/assets/js/highcharts/es-modules/Extensions/RegexLimits.js +1 -0
- package/assets/js/highcharts/es-modules/Extensions/ScrollablePlotArea.js +19 -17
- package/assets/js/highcharts/es-modules/Extensions/Themes/BrandDark.js +13 -1
- package/assets/js/highcharts/es-modules/Maps/MapNavigation.js +5 -3
- package/assets/js/highcharts/es-modules/Maps/MapView.js +5 -5
- package/assets/js/highcharts/es-modules/Maps/Projection.js +39 -20
- package/assets/js/highcharts/es-modules/Series/ArcDiagram/ArcDiagramSeries.js +10 -231
- package/assets/js/highcharts/es-modules/Series/ArcDiagram/ArcDiagramSeriesDefaults.js +245 -0
- package/assets/js/highcharts/es-modules/Series/Area/AreaSeries.js +2 -222
- package/assets/js/highcharts/es-modules/Series/Area/AreaSeriesDefaults.js +239 -0
- package/assets/js/highcharts/es-modules/Series/AreaRange/AreaRangeSeries.js +0 -133
- package/assets/js/highcharts/es-modules/Series/AreaRange/AreaRangeSeriesDefaults.js +273 -0
- package/assets/js/highcharts/es-modules/Series/BoxPlot/BoxPlotSeries.js +36 -38
- package/assets/js/highcharts/es-modules/Series/Bubble/BubbleSeries.js +17 -6
- package/assets/js/highcharts/es-modules/Series/Candlestick/CandlestickSeries.js +9 -11
- package/assets/js/highcharts/es-modules/Series/ColorMapComposition.js +28 -4
- package/assets/js/highcharts/es-modules/Series/Column/ColumnDataLabel.js +1 -1
- package/assets/js/highcharts/es-modules/Series/Column/ColumnSeries.js +25 -30
- package/assets/js/highcharts/es-modules/Series/DataModifyComposition.js +26 -2
- package/assets/js/highcharts/es-modules/Series/DotPlot/DotPlotSeries.js +37 -27
- package/assets/js/highcharts/es-modules/Series/DotPlot/DotPlotSeriesDefaults.js +3 -2
- package/assets/js/highcharts/es-modules/Series/Dumbbell/DumbbellSeries.js +1 -39
- package/assets/js/highcharts/es-modules/Series/Dumbbell/DumbbellSeriesDefaults.js +29 -0
- package/assets/js/highcharts/es-modules/Series/Flags/FlagsSeries.js +2 -1
- package/assets/js/highcharts/es-modules/Series/GeoHeatmap/GeoHeatmapSeries.js +3 -10
- package/assets/js/highcharts/es-modules/Series/HLC/HLCSeries.js +4 -5
- package/assets/js/highcharts/es-modules/Series/MapLine/MapLineSeriesDefaults.js +7 -6
- package/assets/js/highcharts/es-modules/Series/MapPoint/MapPointSeriesDefaults.js +17 -11
- package/assets/js/highcharts/es-modules/Series/Networkgraph/NetworkgraphSeriesDefaults.js +1 -1
- package/assets/js/highcharts/es-modules/Series/Networkgraph/ReingoldFruchtermanLayout.js +1 -1
- package/assets/js/highcharts/es-modules/Series/OHLC/OHLCSeries.js +3 -5
- package/assets/js/highcharts/es-modules/Series/Organization/OrganizationSeries.js +17 -19
- package/assets/js/highcharts/es-modules/Series/Organization/OrganizationSeriesDefaults.js +1 -1
- package/assets/js/highcharts/es-modules/Series/PackedBubble/PackedBubbleLayout.js +3 -3
- package/assets/js/highcharts/es-modules/Series/PackedBubble/PackedBubbleSeries.js +3 -3
- package/assets/js/highcharts/es-modules/Series/PackedBubble/PackedBubbleSeriesDefaults.js +0 -1
- package/assets/js/highcharts/es-modules/Series/Pyramid/PyramidSeriesDefaults.js +3 -3
- package/assets/js/highcharts/es-modules/Series/Sankey/SankeySeries.js +5 -6
- package/assets/js/highcharts/es-modules/Series/Sankey/SankeySeriesDefaults.js +1 -1
- package/assets/js/highcharts/es-modules/Series/SeriesOnPointComposition.js +2 -2
- package/assets/js/highcharts/es-modules/Series/Sunburst/SunburstSeriesDefaults.js +1 -1
- package/assets/js/highcharts/es-modules/Series/Treegraph/TreegraphLink.js +12 -7
- package/assets/js/highcharts/es-modules/Series/Treegraph/TreegraphSeries.js +8 -9
- package/assets/js/highcharts/es-modules/Series/Treemap/TreemapSeries.js +8 -8
- package/assets/js/highcharts/es-modules/Series/Treemap/TreemapSeriesDefaults.js +1 -1
- package/assets/js/highcharts/es-modules/Series/Variwide/VariwideSeries.js +4 -4
- package/assets/js/highcharts/es-modules/Series/Venn/VennSeriesDefaults.js +2 -2
- package/assets/js/highcharts/es-modules/Series/Waterfall/WaterfallSeries.js +11 -12
- package/assets/js/highcharts/es-modules/Series/XRange/XRangeSeries.js +4 -4
- package/assets/js/highcharts/es-modules/Stock/Navigator/Navigator.js +2 -5
- package/assets/js/highcharts/es-modules/Stock/Navigator/NavigatorDefaults.js +11 -0
- package/assets/js/highcharts/es-modules/Stock/Navigator/NavigatorSymbols.js +9 -10
- package/assets/js/highcharts/es-modules/Stock/RangeSelector/RangeSelector.js +162 -187
- package/assets/js/highcharts/es-modules/Stock/RangeSelector/RangeSelectorComposition.js +32 -74
- package/assets/js/highcharts/es-modules/Stock/Scrollbar/Scrollbar.js +6 -7
- package/assets/js/highcharts/es-modules/masters/highcharts-more.src.js +2 -0
- package/assets/js/highcharts/highcharts-3d.js +1 -1
- package/assets/js/highcharts/highcharts-3d.src.js +1 -1
- package/assets/js/highcharts/highcharts-gantt.js +3 -3
- package/assets/js/highcharts/highcharts-gantt.src.js +2008 -906
- package/assets/js/highcharts/highcharts-more.js +2 -2
- package/assets/js/highcharts/highcharts-more.src.js +234 -313
- package/assets/js/highcharts/highcharts.js +3 -3
- package/assets/js/highcharts/highcharts.src.js +743 -616
- package/assets/js/highcharts/highmaps.js +3 -3
- package/assets/js/highcharts/highmaps.src.js +862 -673
- package/assets/js/highcharts/highstock.js +3 -3
- package/assets/js/highcharts/highstock.src.js +1016 -935
- package/assets/js/highcharts/indicators/acceleration-bands.js +1 -1
- package/assets/js/highcharts/indicators/acceleration-bands.src.js +1 -1
- package/assets/js/highcharts/indicators/accumulation-distribution.js +1 -1
- package/assets/js/highcharts/indicators/accumulation-distribution.src.js +1 -1
- package/assets/js/highcharts/indicators/ao.js +1 -1
- package/assets/js/highcharts/indicators/ao.src.js +1 -1
- package/assets/js/highcharts/indicators/apo.js +1 -1
- package/assets/js/highcharts/indicators/apo.src.js +1 -1
- package/assets/js/highcharts/indicators/aroon-oscillator.js +1 -1
- package/assets/js/highcharts/indicators/aroon-oscillator.src.js +1 -1
- package/assets/js/highcharts/indicators/aroon.js +1 -1
- package/assets/js/highcharts/indicators/aroon.src.js +1 -1
- package/assets/js/highcharts/indicators/atr.js +1 -1
- package/assets/js/highcharts/indicators/atr.src.js +1 -1
- package/assets/js/highcharts/indicators/bollinger-bands.js +1 -1
- package/assets/js/highcharts/indicators/bollinger-bands.src.js +1 -1
- package/assets/js/highcharts/indicators/cci.js +1 -1
- package/assets/js/highcharts/indicators/cci.src.js +1 -1
- package/assets/js/highcharts/indicators/chaikin.js +1 -1
- package/assets/js/highcharts/indicators/chaikin.src.js +1 -1
- package/assets/js/highcharts/indicators/cmf.js +1 -1
- package/assets/js/highcharts/indicators/cmf.src.js +1 -1
- package/assets/js/highcharts/indicators/cmo.js +1 -1
- package/assets/js/highcharts/indicators/cmo.src.js +1 -1
- package/assets/js/highcharts/indicators/dema.js +1 -1
- package/assets/js/highcharts/indicators/dema.src.js +1 -1
- package/assets/js/highcharts/indicators/disparity-index.js +1 -1
- package/assets/js/highcharts/indicators/disparity-index.src.js +1 -1
- package/assets/js/highcharts/indicators/dmi.js +1 -1
- package/assets/js/highcharts/indicators/dmi.src.js +1 -1
- package/assets/js/highcharts/indicators/dpo.js +1 -1
- package/assets/js/highcharts/indicators/dpo.src.js +1 -1
- package/assets/js/highcharts/indicators/ichimoku-kinko-hyo.js +1 -1
- package/assets/js/highcharts/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/assets/js/highcharts/indicators/indicators-all.js +1 -1
- package/assets/js/highcharts/indicators/indicators-all.src.js +1 -1
- package/assets/js/highcharts/indicators/indicators.js +1 -1
- package/assets/js/highcharts/indicators/indicators.src.js +1 -1
- package/assets/js/highcharts/indicators/keltner-channels.js +1 -1
- package/assets/js/highcharts/indicators/keltner-channels.src.js +1 -1
- package/assets/js/highcharts/indicators/klinger.js +1 -1
- package/assets/js/highcharts/indicators/klinger.src.js +1 -1
- package/assets/js/highcharts/indicators/macd.js +1 -1
- package/assets/js/highcharts/indicators/macd.src.js +1 -1
- package/assets/js/highcharts/indicators/mfi.js +1 -1
- package/assets/js/highcharts/indicators/mfi.src.js +1 -1
- package/assets/js/highcharts/indicators/momentum.js +1 -1
- package/assets/js/highcharts/indicators/momentum.src.js +1 -1
- package/assets/js/highcharts/indicators/natr.js +1 -1
- package/assets/js/highcharts/indicators/natr.src.js +1 -1
- package/assets/js/highcharts/indicators/obv.js +1 -1
- package/assets/js/highcharts/indicators/obv.src.js +1 -1
- package/assets/js/highcharts/indicators/pivot-points.js +1 -1
- package/assets/js/highcharts/indicators/pivot-points.src.js +1 -1
- package/assets/js/highcharts/indicators/ppo.js +1 -1
- package/assets/js/highcharts/indicators/ppo.src.js +1 -1
- package/assets/js/highcharts/indicators/price-channel.js +1 -1
- package/assets/js/highcharts/indicators/price-channel.src.js +1 -1
- package/assets/js/highcharts/indicators/price-envelopes.js +1 -1
- package/assets/js/highcharts/indicators/price-envelopes.src.js +1 -1
- package/assets/js/highcharts/indicators/psar.js +1 -1
- package/assets/js/highcharts/indicators/psar.src.js +1 -1
- package/assets/js/highcharts/indicators/regressions.js +1 -1
- package/assets/js/highcharts/indicators/regressions.src.js +1 -1
- package/assets/js/highcharts/indicators/roc.js +1 -1
- package/assets/js/highcharts/indicators/roc.src.js +1 -1
- package/assets/js/highcharts/indicators/rsi.js +1 -1
- package/assets/js/highcharts/indicators/rsi.src.js +1 -1
- package/assets/js/highcharts/indicators/slow-stochastic.js +1 -1
- package/assets/js/highcharts/indicators/slow-stochastic.src.js +1 -1
- package/assets/js/highcharts/indicators/stochastic.js +1 -1
- package/assets/js/highcharts/indicators/stochastic.src.js +1 -1
- package/assets/js/highcharts/indicators/supertrend.js +1 -1
- package/assets/js/highcharts/indicators/supertrend.src.js +1 -1
- package/assets/js/highcharts/indicators/tema.js +1 -1
- package/assets/js/highcharts/indicators/tema.src.js +1 -1
- package/assets/js/highcharts/indicators/trendline.js +1 -1
- package/assets/js/highcharts/indicators/trendline.src.js +1 -1
- package/assets/js/highcharts/indicators/trix.js +1 -1
- package/assets/js/highcharts/indicators/trix.src.js +1 -1
- package/assets/js/highcharts/indicators/volume-by-price.js +1 -1
- package/assets/js/highcharts/indicators/volume-by-price.src.js +1 -1
- package/assets/js/highcharts/indicators/vwap.js +1 -1
- package/assets/js/highcharts/indicators/vwap.src.js +1 -1
- package/assets/js/highcharts/indicators/williams-r.js +1 -1
- package/assets/js/highcharts/indicators/williams-r.src.js +1 -1
- package/assets/js/highcharts/indicators/wma.js +1 -1
- package/assets/js/highcharts/indicators/wma.src.js +1 -1
- package/assets/js/highcharts/indicators/zigzag.js +1 -1
- package/assets/js/highcharts/indicators/zigzag.src.js +1 -1
- package/assets/js/highcharts/modules/accessibility.js +2 -2
- package/assets/js/highcharts/modules/accessibility.src.js +39 -28
- package/assets/js/highcharts/modules/annotations-advanced.js +2 -2
- package/assets/js/highcharts/modules/annotations-advanced.src.js +46 -31
- package/assets/js/highcharts/modules/annotations.js +2 -2
- package/assets/js/highcharts/modules/annotations.src.js +12 -15
- package/assets/js/highcharts/modules/arc-diagram.js +2 -2
- package/assets/js/highcharts/modules/arc-diagram.src.js +258 -233
- package/assets/js/highcharts/modules/arrow-symbols.js +1 -1
- package/assets/js/highcharts/modules/arrow-symbols.src.js +1 -1
- package/assets/js/highcharts/modules/boost-canvas.js +2 -2
- package/assets/js/highcharts/modules/boost-canvas.src.js +30 -10
- package/assets/js/highcharts/modules/boost.js +2 -2
- package/assets/js/highcharts/modules/boost.src.js +30 -10
- package/assets/js/highcharts/modules/broken-axis.js +1 -1
- package/assets/js/highcharts/modules/broken-axis.src.js +1 -1
- package/assets/js/highcharts/modules/bullet.js +1 -1
- package/assets/js/highcharts/modules/bullet.src.js +1 -1
- package/assets/js/highcharts/modules/coloraxis.js +2 -2
- package/assets/js/highcharts/modules/coloraxis.src.js +4 -4
- package/assets/js/highcharts/modules/current-date-indicator.js +1 -1
- package/assets/js/highcharts/modules/current-date-indicator.src.js +1 -1
- package/assets/js/highcharts/modules/cylinder.js +1 -1
- package/assets/js/highcharts/modules/cylinder.src.js +1 -1
- package/assets/js/highcharts/modules/data-tools.js +2 -2
- package/assets/js/highcharts/modules/data-tools.src.js +37 -19
- package/assets/js/highcharts/modules/data.js +1 -1
- package/assets/js/highcharts/modules/data.src.js +4 -4
- package/assets/js/highcharts/modules/datagrouping.js +2 -2
- package/assets/js/highcharts/modules/datagrouping.src.js +2 -1
- package/assets/js/highcharts/modules/debugger.js +1 -1
- package/assets/js/highcharts/modules/debugger.src.js +1 -1
- package/assets/js/highcharts/modules/dependency-wheel.js +1 -1
- package/assets/js/highcharts/modules/dependency-wheel.src.js +1 -1
- package/assets/js/highcharts/modules/dotplot.js +2 -2
- package/assets/js/highcharts/modules/dotplot.src.js +41 -30
- package/assets/js/highcharts/modules/drag-panes.js +2 -2
- package/assets/js/highcharts/modules/drag-panes.src.js +2 -3
- package/assets/js/highcharts/modules/draggable-points.js +2 -2
- package/assets/js/highcharts/modules/draggable-points.src.js +19 -1
- package/assets/js/highcharts/modules/drilldown.js +2 -2
- package/assets/js/highcharts/modules/drilldown.src.js +15 -15
- package/assets/js/highcharts/modules/dumbbell.js +2 -2
- package/assets/js/highcharts/modules/dumbbell.src.js +31 -40
- package/assets/js/highcharts/modules/export-data.js +2 -2
- package/assets/js/highcharts/modules/export-data.src.js +4 -1
- package/assets/js/highcharts/modules/exporting.js +2 -2
- package/assets/js/highcharts/modules/exporting.src.js +22 -25
- package/assets/js/highcharts/modules/flowmap.js +1 -1
- package/assets/js/highcharts/modules/flowmap.src.js +1 -1
- package/assets/js/highcharts/modules/full-screen.js +1 -1
- package/assets/js/highcharts/modules/full-screen.src.js +1 -1
- package/assets/js/highcharts/modules/funnel.js +2 -2
- package/assets/js/highcharts/modules/funnel.src.js +4 -4
- package/assets/js/highcharts/modules/funnel3d.js +1 -1
- package/assets/js/highcharts/modules/funnel3d.src.js +1 -1
- package/assets/js/highcharts/modules/gantt.js +2 -2
- package/assets/js/highcharts/modules/gantt.src.js +1266 -291
- package/assets/js/highcharts/modules/geoheatmap.js +1 -1
- package/assets/js/highcharts/modules/geoheatmap.src.js +4 -11
- package/assets/js/highcharts/modules/grid-axis.js +2 -2
- package/assets/js/highcharts/modules/grid-axis.src.js +2 -2
- package/assets/js/highcharts/modules/heatmap.js +2 -2
- package/assets/js/highcharts/modules/heatmap.src.js +32 -9
- package/assets/js/highcharts/modules/heikinashi.js +1 -1
- package/assets/js/highcharts/modules/heikinashi.src.js +1 -1
- package/assets/js/highcharts/modules/histogram-bellcurve.js +1 -1
- package/assets/js/highcharts/modules/histogram-bellcurve.src.js +1 -1
- package/assets/js/highcharts/modules/hollowcandlestick.js +1 -1
- package/assets/js/highcharts/modules/hollowcandlestick.src.js +1 -1
- package/assets/js/highcharts/modules/item-series.js +1 -1
- package/assets/js/highcharts/modules/item-series.src.js +1 -1
- package/assets/js/highcharts/modules/lollipop.js +1 -1
- package/assets/js/highcharts/modules/lollipop.src.js +1 -1
- package/assets/js/highcharts/modules/map.js +2 -2
- package/assets/js/highcharts/modules/map.src.js +120 -58
- package/assets/js/highcharts/modules/marker-clusters.js +1 -1
- package/assets/js/highcharts/modules/marker-clusters.src.js +1 -1
- package/assets/js/highcharts/modules/mouse-wheel-zoom.js +1 -1
- package/assets/js/highcharts/modules/mouse-wheel-zoom.src.js +1 -1
- package/assets/js/highcharts/modules/navigator.js +2 -2
- package/assets/js/highcharts/modules/navigator.src.js +28 -24
- package/assets/js/highcharts/modules/networkgraph.js +2 -2
- package/assets/js/highcharts/modules/networkgraph.src.js +3 -3
- package/assets/js/highcharts/modules/no-data-to-display.js +1 -1
- package/assets/js/highcharts/modules/no-data-to-display.src.js +1 -1
- package/assets/js/highcharts/modules/offline-exporting.js +2 -2
- package/assets/js/highcharts/modules/offline-exporting.src.js +43 -32
- package/assets/js/highcharts/modules/organization.js +2 -2
- package/assets/js/highcharts/modules/organization.src.js +19 -21
- package/assets/js/highcharts/modules/overlapping-datalabels.js +1 -1
- package/assets/js/highcharts/modules/overlapping-datalabels.src.js +1 -1
- package/assets/js/highcharts/modules/parallel-coordinates.js +1 -1
- package/assets/js/highcharts/modules/parallel-coordinates.src.js +1 -1
- package/assets/js/highcharts/modules/pareto.js +1 -1
- package/assets/js/highcharts/modules/pareto.src.js +1 -1
- package/assets/js/highcharts/modules/pathfinder.js +1 -1
- package/assets/js/highcharts/modules/pathfinder.src.js +1 -1
- package/assets/js/highcharts/modules/pattern-fill.js +1 -1
- package/assets/js/highcharts/modules/pattern-fill.src.js +1 -1
- package/assets/js/highcharts/modules/pictorial.js +1 -1
- package/assets/js/highcharts/modules/pictorial.src.js +1 -1
- package/assets/js/highcharts/modules/price-indicator.js +1 -1
- package/assets/js/highcharts/modules/price-indicator.src.js +1 -1
- package/assets/js/highcharts/modules/pyramid3d.js +1 -1
- package/assets/js/highcharts/modules/pyramid3d.src.js +1 -1
- package/assets/js/highcharts/modules/sankey.js +2 -2
- package/assets/js/highcharts/modules/sankey.src.js +7 -8
- package/assets/js/highcharts/modules/series-label.js +1 -1
- package/assets/js/highcharts/modules/series-label.src.js +1 -1
- package/assets/js/highcharts/modules/series-on-point.js +2 -2
- package/assets/js/highcharts/modules/series-on-point.src.js +3 -3
- package/assets/js/highcharts/modules/solid-gauge.js +1 -1
- package/assets/js/highcharts/modules/solid-gauge.src.js +1 -1
- package/assets/js/highcharts/modules/sonification.js +2 -2
- package/assets/js/highcharts/modules/sonification.src.js +4 -1
- package/assets/js/highcharts/modules/static-scale.js +1 -1
- package/assets/js/highcharts/modules/static-scale.src.js +1 -1
- package/assets/js/highcharts/modules/stock-tools.js +2 -2
- package/assets/js/highcharts/modules/stock-tools.src.js +3 -3
- package/assets/js/highcharts/modules/stock.js +2 -2
- package/assets/js/highcharts/modules/stock.src.js +274 -320
- package/assets/js/highcharts/modules/streamgraph.js +1 -1
- package/assets/js/highcharts/modules/streamgraph.src.js +1 -1
- package/assets/js/highcharts/modules/sunburst.js +2 -2
- package/assets/js/highcharts/modules/sunburst.src.js +39 -16
- package/assets/js/highcharts/modules/tiledwebmap.js +1 -1
- package/assets/js/highcharts/modules/tiledwebmap.src.js +1 -1
- package/assets/js/highcharts/modules/tilemap.js +1 -1
- package/assets/js/highcharts/modules/tilemap.src.js +1 -1
- package/assets/js/highcharts/modules/timeline.js +1 -1
- package/assets/js/highcharts/modules/timeline.src.js +1 -1
- package/assets/js/highcharts/modules/treegraph.js +2 -2
- package/assets/js/highcharts/modules/treegraph.src.js +21 -17
- package/assets/js/highcharts/modules/treegrid.js +2 -2
- package/assets/js/highcharts/modules/treegrid.src.js +2 -2
- package/assets/js/highcharts/modules/treemap.js +2 -2
- package/assets/js/highcharts/modules/treemap.src.js +38 -15
- package/assets/js/highcharts/modules/variable-pie.js +1 -1
- package/assets/js/highcharts/modules/variable-pie.src.js +1 -1
- package/assets/js/highcharts/modules/variwide.js +2 -2
- package/assets/js/highcharts/modules/variwide.src.js +5 -5
- package/assets/js/highcharts/modules/vector.js +1 -1
- package/assets/js/highcharts/modules/vector.src.js +1 -1
- package/assets/js/highcharts/modules/venn.js +1 -1
- package/assets/js/highcharts/modules/venn.src.js +3 -3
- package/assets/js/highcharts/modules/windbarb.js +1 -1
- package/assets/js/highcharts/modules/windbarb.src.js +1 -1
- package/assets/js/highcharts/modules/wordcloud.js +1 -1
- package/assets/js/highcharts/modules/wordcloud.src.js +1 -1
- package/assets/js/highcharts/modules/xrange.js +2 -2
- package/assets/js/highcharts/modules/xrange.src.js +5 -5
- package/assets/js/highcharts/standalone-navigator.js +2 -2
- package/assets/js/highcharts/standalone-navigator.src.js +769 -638
- package/assets/js/highcharts/themes/avocado.js +1 -1
- package/assets/js/highcharts/themes/avocado.src.js +1 -1
- package/assets/js/highcharts/themes/brand-dark.js +2 -2
- package/assets/js/highcharts/themes/brand-dark.src.js +14 -2
- package/assets/js/highcharts/themes/brand-light.js +1 -1
- package/assets/js/highcharts/themes/brand-light.src.js +1 -1
- package/assets/js/highcharts/themes/dark-blue.js +1 -1
- package/assets/js/highcharts/themes/dark-blue.src.js +1 -1
- package/assets/js/highcharts/themes/dark-green.js +1 -1
- package/assets/js/highcharts/themes/dark-green.src.js +1 -1
- package/assets/js/highcharts/themes/dark-unica.js +1 -1
- package/assets/js/highcharts/themes/dark-unica.src.js +1 -1
- package/assets/js/highcharts/themes/gray.js +1 -1
- package/assets/js/highcharts/themes/gray.src.js +1 -1
- package/assets/js/highcharts/themes/grid-light.js +1 -1
- package/assets/js/highcharts/themes/grid-light.src.js +1 -1
- package/assets/js/highcharts/themes/grid.js +1 -1
- package/assets/js/highcharts/themes/grid.src.js +1 -1
- package/assets/js/highcharts/themes/high-contrast-dark.js +1 -1
- package/assets/js/highcharts/themes/high-contrast-dark.src.js +1 -1
- package/assets/js/highcharts/themes/high-contrast-light.js +1 -1
- package/assets/js/highcharts/themes/high-contrast-light.src.js +1 -1
- package/assets/js/highcharts/themes/sand-signika.js +1 -1
- package/assets/js/highcharts/themes/sand-signika.src.js +1 -1
- package/assets/js/highcharts/themes/skies.js +1 -1
- package/assets/js/highcharts/themes/skies.src.js +1 -1
- package/assets/js/highcharts/themes/sunset.js +1 -1
- package/assets/js/highcharts/themes/sunset.src.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Highcharts Gantt JS v11.4.
|
|
2
|
+
* @license Highcharts Gantt JS v11.4.3 (2024-05-22)
|
|
3
3
|
*
|
|
4
4
|
* Gantt series
|
|
5
5
|
*
|
|
@@ -1330,6 +1330,15 @@
|
|
|
1330
1330
|
* @since 6.0.0
|
|
1331
1331
|
*/
|
|
1332
1332
|
width: 7,
|
|
1333
|
+
/**
|
|
1334
|
+
* Border radius of the handles.
|
|
1335
|
+
*
|
|
1336
|
+
* @sample {highstock} stock/navigator/handles-border-radius/
|
|
1337
|
+
* Border radius on the navigator handles.
|
|
1338
|
+
*
|
|
1339
|
+
* @since 11.4.2
|
|
1340
|
+
*/
|
|
1341
|
+
borderRadius: 0,
|
|
1333
1342
|
/**
|
|
1334
1343
|
* Height for handles.
|
|
1335
1344
|
*
|
|
@@ -1641,6 +1650,7 @@
|
|
|
1641
1650
|
tickLength: 0,
|
|
1642
1651
|
lineWidth: 0,
|
|
1643
1652
|
gridLineColor: "#e6e6e6" /* Palette.neutralColor10 */,
|
|
1653
|
+
id: 'navigator-x-axis',
|
|
1644
1654
|
gridLineWidth: 1,
|
|
1645
1655
|
tickPixelInterval: 200,
|
|
1646
1656
|
labels: {
|
|
@@ -1694,6 +1704,7 @@
|
|
|
1694
1704
|
startOnTick: false,
|
|
1695
1705
|
endOnTick: false,
|
|
1696
1706
|
minPadding: 0.1,
|
|
1707
|
+
id: 'navigator-y-axis',
|
|
1697
1708
|
maxPadding: 0.1,
|
|
1698
1709
|
labels: {
|
|
1699
1710
|
enabled: false
|
|
@@ -1732,7 +1743,7 @@
|
|
|
1732
1743
|
|
|
1733
1744
|
return NavigatorDefaults;
|
|
1734
1745
|
});
|
|
1735
|
-
_registerModule(_modules, 'Stock/Navigator/NavigatorSymbols.js', [], function () {
|
|
1746
|
+
_registerModule(_modules, 'Stock/Navigator/NavigatorSymbols.js', [_modules['Core/Renderer/SVG/Symbols.js'], _modules['Core/Utilities.js']], function (rect, U) {
|
|
1736
1747
|
/* *
|
|
1737
1748
|
*
|
|
1738
1749
|
* (c) 2010-2024 Torstein Honsi
|
|
@@ -1742,6 +1753,7 @@
|
|
|
1742
1753
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1743
1754
|
*
|
|
1744
1755
|
* */
|
|
1756
|
+
const { relativeLength } = U;
|
|
1745
1757
|
/* *
|
|
1746
1758
|
*
|
|
1747
1759
|
* Constants
|
|
@@ -1752,18 +1764,14 @@
|
|
|
1752
1764
|
* @private
|
|
1753
1765
|
*/
|
|
1754
1766
|
function navigatorHandle(_x, _y, width, height, options = {}) {
|
|
1755
|
-
const halfWidth = options.width ? options.width / 2 : width, markerPosition = Math.
|
|
1767
|
+
const halfWidth = options.width ? options.width / 2 : width, markerPosition = 1.5, r = relativeLength(options.borderRadius || 0, Math.min(halfWidth * 2, height));
|
|
1756
1768
|
height = options.height || height;
|
|
1757
1769
|
return [
|
|
1758
|
-
['M', -
|
|
1759
|
-
['L',
|
|
1760
|
-
['
|
|
1761
|
-
['L',
|
|
1762
|
-
|
|
1763
|
-
['M', -markerPosition, 4],
|
|
1764
|
-
['L', -markerPosition, height - 3],
|
|
1765
|
-
['M', markerPosition - 1, 4],
|
|
1766
|
-
['L', markerPosition - 1, height - 3]
|
|
1770
|
+
['M', -markerPosition, height / 2 - 3.5],
|
|
1771
|
+
['L', -markerPosition, height / 2 + 4.5],
|
|
1772
|
+
['M', markerPosition - 1, height / 2 - 3.5],
|
|
1773
|
+
['L', markerPosition - 1, height / 2 + 4.5],
|
|
1774
|
+
...rect.rect(-halfWidth - 1, 0.5, halfWidth * 2 + 1, height, { r })
|
|
1767
1775
|
];
|
|
1768
1776
|
}
|
|
1769
1777
|
/* *
|
|
@@ -2316,7 +2324,7 @@
|
|
|
2316
2324
|
*
|
|
2317
2325
|
* */
|
|
2318
2326
|
const { defaultOptions } = D;
|
|
2319
|
-
const { addEvent, correctFloat, defined, destroyObjectProperties, fireEvent, merge, pick, removeEvent } = U;
|
|
2327
|
+
const { addEvent, correctFloat, crisp, defined, destroyObjectProperties, fireEvent, merge, pick, removeEvent } = U;
|
|
2320
2328
|
/* *
|
|
2321
2329
|
*
|
|
2322
2330
|
* Constants
|
|
@@ -2548,9 +2556,8 @@
|
|
|
2548
2556
|
rect.attr(rect.crisp({
|
|
2549
2557
|
x: -0.5,
|
|
2550
2558
|
y: -0.5,
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
height: size + 1,
|
|
2559
|
+
width: size,
|
|
2560
|
+
height: size,
|
|
2554
2561
|
r: options.buttonBorderRadius
|
|
2555
2562
|
}, rect.strokeWidth()));
|
|
2556
2563
|
// Button arrow
|
|
@@ -2760,8 +2767,8 @@
|
|
|
2760
2767
|
const trackBorderWidth = scroller.trackBorderWidth =
|
|
2761
2768
|
scroller.track.strokeWidth();
|
|
2762
2769
|
scroller.track.attr({
|
|
2763
|
-
x: -trackBorderWidth
|
|
2764
|
-
y: -trackBorderWidth
|
|
2770
|
+
x: -crisp(0, trackBorderWidth),
|
|
2771
|
+
y: -crisp(0, trackBorderWidth)
|
|
2765
2772
|
});
|
|
2766
2773
|
// Draw the scrollbar itself
|
|
2767
2774
|
scroller.scrollbarGroup = renderer.g().add(group);
|
|
@@ -2795,7 +2802,7 @@
|
|
|
2795
2802
|
});
|
|
2796
2803
|
}
|
|
2797
2804
|
scroller.scrollbarStrokeWidth = scroller.scrollbar.strokeWidth();
|
|
2798
|
-
scroller.scrollbarGroup.translate(-scroller.scrollbarStrokeWidth
|
|
2805
|
+
scroller.scrollbarGroup.translate(-crisp(0, scroller.scrollbarStrokeWidth), -crisp(0, scroller.scrollbarStrokeWidth));
|
|
2799
2806
|
// Draw the buttons:
|
|
2800
2807
|
scroller.drawScrollbarButton(0);
|
|
2801
2808
|
scroller.drawScrollbarButton(1);
|
|
@@ -3797,8 +3804,6 @@
|
|
|
3797
3804
|
ordinal: baseXaxis.options.ordinal,
|
|
3798
3805
|
overscroll: baseXaxis.options.overscroll
|
|
3799
3806
|
}, navigatorOptions.xAxis, {
|
|
3800
|
-
id: 'navigator-x-axis',
|
|
3801
|
-
yAxis: 'navigator-y-axis',
|
|
3802
3807
|
type: 'datetime',
|
|
3803
3808
|
index: xAxisIndex,
|
|
3804
3809
|
isInternal: true,
|
|
@@ -3817,7 +3822,6 @@
|
|
|
3817
3822
|
height: height
|
|
3818
3823
|
}), 'xAxis');
|
|
3819
3824
|
navigator.yAxis = new Axis(chart, merge(navigatorOptions.yAxis, {
|
|
3820
|
-
id: 'navigator-y-axis',
|
|
3821
3825
|
alignTicks: false,
|
|
3822
3826
|
offset: 0,
|
|
3823
3827
|
index: yAxisIndex,
|
|
@@ -3969,8 +3973,8 @@
|
|
|
3969
3973
|
linkedTo: null,
|
|
3970
3974
|
group: 'nav',
|
|
3971
3975
|
padXAxis: false,
|
|
3972
|
-
xAxis:
|
|
3973
|
-
yAxis:
|
|
3976
|
+
xAxis: this.navigatorOptions.xAxis?.id,
|
|
3977
|
+
yAxis: this.navigatorOptions.yAxis?.id,
|
|
3974
3978
|
showInLegend: false,
|
|
3975
3979
|
stacking: void 0,
|
|
3976
3980
|
isInternal: true,
|
|
@@ -4894,7 +4898,7 @@
|
|
|
4894
4898
|
* */
|
|
4895
4899
|
const { defaultOptions } = D;
|
|
4896
4900
|
const { composed } = H;
|
|
4897
|
-
const { addEvent, defined, extend,
|
|
4901
|
+
const { addEvent, defined, extend, isNumber, merge, pick, pushUnique } = U;
|
|
4898
4902
|
/* *
|
|
4899
4903
|
*
|
|
4900
4904
|
* Constants
|
|
@@ -4978,13 +4982,13 @@
|
|
|
4978
4982
|
if (pushUnique(composed, 'RangeSelector')) {
|
|
4979
4983
|
const chartProto = ChartClass.prototype;
|
|
4980
4984
|
AxisClass.prototype.minFromRange = axisMinFromRange;
|
|
4981
|
-
addEvent(ChartClass, 'afterGetContainer',
|
|
4985
|
+
addEvent(ChartClass, 'afterGetContainer', createRangeSelector);
|
|
4982
4986
|
addEvent(ChartClass, 'beforeRender', onChartBeforeRender);
|
|
4983
4987
|
addEvent(ChartClass, 'destroy', onChartDestroy);
|
|
4984
4988
|
addEvent(ChartClass, 'getMargins', onChartGetMargins);
|
|
4985
|
-
addEvent(ChartClass, '
|
|
4989
|
+
addEvent(ChartClass, 'redraw', redrawRangeSelector);
|
|
4986
4990
|
addEvent(ChartClass, 'update', onChartUpdate);
|
|
4987
|
-
chartProto.callbacks.push(
|
|
4991
|
+
chartProto.callbacks.push(redrawRangeSelector);
|
|
4988
4992
|
extend(defaultOptions, { rangeSelector: RangeSelectorDefaults.rangeSelector });
|
|
4989
4993
|
extend(defaultOptions.lang, RangeSelectorDefaults.lang);
|
|
4990
4994
|
}
|
|
@@ -4993,7 +4997,7 @@
|
|
|
4993
4997
|
* Initialize rangeselector for stock charts
|
|
4994
4998
|
* @private
|
|
4995
4999
|
*/
|
|
4996
|
-
function
|
|
5000
|
+
function createRangeSelector() {
|
|
4997
5001
|
if (this.options.rangeSelector &&
|
|
4998
5002
|
this.options.rangeSelector.enabled) {
|
|
4999
5003
|
this.rangeSelector = new RangeSelectorConstructor(this);
|
|
@@ -5003,18 +5007,12 @@
|
|
|
5003
5007
|
* @private
|
|
5004
5008
|
*/
|
|
5005
5009
|
function onChartBeforeRender() {
|
|
5006
|
-
const chart = this,
|
|
5010
|
+
const chart = this, rangeSelector = chart.rangeSelector;
|
|
5007
5011
|
if (rangeSelector) {
|
|
5008
5012
|
if (isNumber(rangeSelector.deferredYTDClick)) {
|
|
5009
5013
|
rangeSelector.clickButton(rangeSelector.deferredYTDClick);
|
|
5010
5014
|
delete rangeSelector.deferredYTDClick;
|
|
5011
5015
|
}
|
|
5012
|
-
axes.forEach((axis) => {
|
|
5013
|
-
axis.updateNames();
|
|
5014
|
-
axis.setScale();
|
|
5015
|
-
});
|
|
5016
|
-
chart.getAxisMargins();
|
|
5017
|
-
rangeSelector.render();
|
|
5018
5016
|
const verticalAlign = rangeSelector.options.verticalAlign;
|
|
5019
5017
|
if (!rangeSelector.options.floating) {
|
|
5020
5018
|
if (verticalAlign === 'bottom') {
|
|
@@ -5026,53 +5024,34 @@
|
|
|
5026
5024
|
}
|
|
5027
5025
|
}
|
|
5028
5026
|
}
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
}
|
|
5052
|
-
else {
|
|
5053
|
-
alignTo.y += rangeSelector.getHeight();
|
|
5054
|
-
}
|
|
5055
|
-
legend.group.placed = false; // Don't animate the alignment.
|
|
5056
|
-
legend.align(alignTo);
|
|
5057
|
-
}
|
|
5027
|
+
function redrawRangeSelector() {
|
|
5028
|
+
const chart = this;
|
|
5029
|
+
const rangeSelector = this.rangeSelector;
|
|
5030
|
+
if (!rangeSelector) {
|
|
5031
|
+
return;
|
|
5032
|
+
}
|
|
5033
|
+
let alignTo;
|
|
5034
|
+
const extremes = chart.xAxis[0].getExtremes();
|
|
5035
|
+
const legend = chart.legend;
|
|
5036
|
+
const verticalAlign = (rangeSelector &&
|
|
5037
|
+
rangeSelector.options.verticalAlign);
|
|
5038
|
+
if (isNumber(extremes.min)) {
|
|
5039
|
+
rangeSelector.render(extremes.min, extremes.max);
|
|
5040
|
+
}
|
|
5041
|
+
// Re-align the legend so that it's below the rangeselector
|
|
5042
|
+
if (legend.display &&
|
|
5043
|
+
verticalAlign === 'top' &&
|
|
5044
|
+
verticalAlign === legend.options.verticalAlign) {
|
|
5045
|
+
// Create a new alignment box for the legend.
|
|
5046
|
+
alignTo = merge(chart.spacingBox);
|
|
5047
|
+
if (legend.options.layout === 'vertical') {
|
|
5048
|
+
alignTo.y = chart.plotTop;
|
|
5058
5049
|
}
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
const events = find(chartDestroyEvents, (e) => e[0] === chart);
|
|
5062
|
-
if (!events) {
|
|
5063
|
-
chartDestroyEvents.push([chart, [
|
|
5064
|
-
// Redraw the scroller on setExtremes
|
|
5065
|
-
addEvent(chart.xAxis[0], 'afterSetExtremes', function (e) {
|
|
5066
|
-
if (rangeSelector) {
|
|
5067
|
-
rangeSelector.render(e.min, e.max);
|
|
5068
|
-
}
|
|
5069
|
-
}),
|
|
5070
|
-
// Redraw the scroller chart resize
|
|
5071
|
-
addEvent(chart, 'redraw', redraw)
|
|
5072
|
-
]]);
|
|
5050
|
+
else {
|
|
5051
|
+
alignTo.y += rangeSelector.getHeight();
|
|
5073
5052
|
}
|
|
5074
|
-
//
|
|
5075
|
-
|
|
5053
|
+
legend.group.placed = false; // Don't animate the alignment.
|
|
5054
|
+
legend.align(alignTo);
|
|
5076
5055
|
}
|
|
5077
5056
|
}
|
|
5078
5057
|
/**
|
|
@@ -5104,22 +5083,6 @@
|
|
|
5104
5083
|
}
|
|
5105
5084
|
}
|
|
5106
5085
|
}
|
|
5107
|
-
/**
|
|
5108
|
-
* @private
|
|
5109
|
-
*/
|
|
5110
|
-
function onChartRender() {
|
|
5111
|
-
const chart = this, rangeSelector = chart.rangeSelector;
|
|
5112
|
-
if (rangeSelector && !rangeSelector.options.floating) {
|
|
5113
|
-
rangeSelector.render();
|
|
5114
|
-
const verticalAlign = rangeSelector.options.verticalAlign;
|
|
5115
|
-
if (verticalAlign === 'bottom') {
|
|
5116
|
-
this.extraBottomMargin = true;
|
|
5117
|
-
}
|
|
5118
|
-
else if (verticalAlign !== 'middle') {
|
|
5119
|
-
this.extraTopMargin = true;
|
|
5120
|
-
}
|
|
5121
|
-
}
|
|
5122
|
-
}
|
|
5123
5086
|
/**
|
|
5124
5087
|
* @private
|
|
5125
5088
|
*/
|
|
@@ -5136,7 +5099,6 @@
|
|
|
5136
5099
|
this.extraBottomMargin = false;
|
|
5137
5100
|
this.extraTopMargin = false;
|
|
5138
5101
|
if (rangeSelector) {
|
|
5139
|
-
onChartCallback(this);
|
|
5140
5102
|
const verticalAlign = (optionsRangeSelector &&
|
|
5141
5103
|
optionsRangeSelector.verticalAlign) || (rangeSelector.options && rangeSelector.options.verticalAlign);
|
|
5142
5104
|
if (!rangeSelector.options.floating) {
|
|
@@ -5164,7 +5126,1046 @@
|
|
|
5164
5126
|
|
|
5165
5127
|
return RangeSelectorComposition;
|
|
5166
5128
|
});
|
|
5167
|
-
_registerModule(_modules, '
|
|
5129
|
+
_registerModule(_modules, 'Core/Axis/OrdinalAxis.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Globals.js'], _modules['Core/Series/Series.js'], _modules['Core/Utilities.js']], function (Axis, H, Series, U) {
|
|
5130
|
+
/* *
|
|
5131
|
+
*
|
|
5132
|
+
* (c) 2010-2024 Torstein Honsi
|
|
5133
|
+
*
|
|
5134
|
+
* License: www.highcharts.com/license
|
|
5135
|
+
*
|
|
5136
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5137
|
+
*
|
|
5138
|
+
* */
|
|
5139
|
+
const { addEvent, correctFloat, css, defined, error, isNumber, pick, timeUnits, isString } = U;
|
|
5140
|
+
/* *
|
|
5141
|
+
*
|
|
5142
|
+
* Composition
|
|
5143
|
+
*
|
|
5144
|
+
* */
|
|
5145
|
+
/**
|
|
5146
|
+
* Extends the axis with ordinal support.
|
|
5147
|
+
* @private
|
|
5148
|
+
*/
|
|
5149
|
+
var OrdinalAxis;
|
|
5150
|
+
(function (OrdinalAxis) {
|
|
5151
|
+
/* *
|
|
5152
|
+
*
|
|
5153
|
+
* Declarations
|
|
5154
|
+
*
|
|
5155
|
+
* */
|
|
5156
|
+
/* *
|
|
5157
|
+
*
|
|
5158
|
+
* Functions
|
|
5159
|
+
*
|
|
5160
|
+
* */
|
|
5161
|
+
/**
|
|
5162
|
+
* Extends the axis with ordinal support.
|
|
5163
|
+
*
|
|
5164
|
+
* @private
|
|
5165
|
+
*
|
|
5166
|
+
* @param AxisClass
|
|
5167
|
+
* Axis class to extend.
|
|
5168
|
+
*
|
|
5169
|
+
* @param ChartClass
|
|
5170
|
+
* Chart class to use.
|
|
5171
|
+
*
|
|
5172
|
+
* @param SeriesClass
|
|
5173
|
+
* Series class to use.
|
|
5174
|
+
*/
|
|
5175
|
+
function compose(AxisClass, SeriesClass, ChartClass) {
|
|
5176
|
+
const axisProto = AxisClass.prototype;
|
|
5177
|
+
if (!axisProto.ordinal2lin) {
|
|
5178
|
+
axisProto.getTimeTicks = getTimeTicks;
|
|
5179
|
+
axisProto.index2val = index2val;
|
|
5180
|
+
axisProto.lin2val = lin2val;
|
|
5181
|
+
axisProto.val2lin = val2lin;
|
|
5182
|
+
// Record this to prevent overwriting by broken-axis module (#5979)
|
|
5183
|
+
axisProto.ordinal2lin = axisProto.val2lin;
|
|
5184
|
+
addEvent(AxisClass, 'afterInit', onAxisAfterInit);
|
|
5185
|
+
addEvent(AxisClass, 'foundExtremes', onAxisFoundExtremes);
|
|
5186
|
+
addEvent(AxisClass, 'afterSetScale', onAxisAfterSetScale);
|
|
5187
|
+
addEvent(AxisClass, 'initialAxisTranslation', onAxisInitialAxisTranslation);
|
|
5188
|
+
addEvent(ChartClass, 'pan', onChartPan);
|
|
5189
|
+
addEvent(SeriesClass, 'updatedData', onSeriesUpdatedData);
|
|
5190
|
+
}
|
|
5191
|
+
return AxisClass;
|
|
5192
|
+
}
|
|
5193
|
+
OrdinalAxis.compose = compose;
|
|
5194
|
+
/**
|
|
5195
|
+
* In an ordinal axis, there might be areas with dense concentrations of
|
|
5196
|
+
* points, then large gaps between some. Creating equally distributed
|
|
5197
|
+
* ticks over this entire range may lead to a huge number of ticks that
|
|
5198
|
+
* will later be removed. So instead, break the positions up in
|
|
5199
|
+
* segments, find the tick positions for each segment then concatenize
|
|
5200
|
+
* them. This method is used from both data grouping logic and X axis
|
|
5201
|
+
* tick position logic.
|
|
5202
|
+
* @private
|
|
5203
|
+
*/
|
|
5204
|
+
function getTimeTicks(normalizedInterval, min, max, startOfWeek, positions = [], closestDistance = 0, findHigherRanks) {
|
|
5205
|
+
const higherRanks = {}, tickPixelIntervalOption = this.options.tickPixelInterval, time = this.chart.time,
|
|
5206
|
+
// Record all the start positions of a segment, to use when
|
|
5207
|
+
// deciding what's a gap in the data.
|
|
5208
|
+
segmentStarts = [];
|
|
5209
|
+
let end, segmentPositions, hasCrossedHigherRank, info, outsideMax, start = 0, groupPositions = [], lastGroupPosition = -Number.MAX_VALUE;
|
|
5210
|
+
// The positions are not always defined, for example for ordinal
|
|
5211
|
+
// positions when data has regular interval (#1557, #2090)
|
|
5212
|
+
if ((!this.options.ordinal && !this.options.breaks) ||
|
|
5213
|
+
!positions ||
|
|
5214
|
+
positions.length < 3 ||
|
|
5215
|
+
typeof min === 'undefined') {
|
|
5216
|
+
return time.getTimeTicks.apply(time, arguments);
|
|
5217
|
+
}
|
|
5218
|
+
// Analyze the positions array to split it into segments on gaps
|
|
5219
|
+
// larger than 5 times the closest distance. The closest distance is
|
|
5220
|
+
// already found at this point, so we reuse that instead of
|
|
5221
|
+
// computing it again.
|
|
5222
|
+
const posLength = positions.length;
|
|
5223
|
+
for (end = 0; end < posLength; end++) {
|
|
5224
|
+
outsideMax = end && positions[end - 1] > max;
|
|
5225
|
+
if (positions[end] < min) { // Set the last position before min
|
|
5226
|
+
start = end;
|
|
5227
|
+
}
|
|
5228
|
+
if (end === posLength - 1 ||
|
|
5229
|
+
positions[end + 1] - positions[end] > closestDistance * 5 ||
|
|
5230
|
+
outsideMax) {
|
|
5231
|
+
// For each segment, calculate the tick positions from the
|
|
5232
|
+
// getTimeTicks utility function. The interval will be the
|
|
5233
|
+
// same regardless of how long the segment is.
|
|
5234
|
+
if (positions[end] > lastGroupPosition) { // #1475
|
|
5235
|
+
segmentPositions = time.getTimeTicks(normalizedInterval, positions[start], positions[end], startOfWeek);
|
|
5236
|
+
// Prevent duplicate groups, for example for multiple
|
|
5237
|
+
// segments within one larger time frame (#1475)
|
|
5238
|
+
while (segmentPositions.length &&
|
|
5239
|
+
segmentPositions[0] <= lastGroupPosition) {
|
|
5240
|
+
segmentPositions.shift();
|
|
5241
|
+
}
|
|
5242
|
+
if (segmentPositions.length) {
|
|
5243
|
+
lastGroupPosition =
|
|
5244
|
+
segmentPositions[segmentPositions.length - 1];
|
|
5245
|
+
}
|
|
5246
|
+
segmentStarts.push(groupPositions.length);
|
|
5247
|
+
groupPositions = groupPositions.concat(segmentPositions);
|
|
5248
|
+
}
|
|
5249
|
+
// Set start of next segment
|
|
5250
|
+
start = end + 1;
|
|
5251
|
+
}
|
|
5252
|
+
if (outsideMax) {
|
|
5253
|
+
break;
|
|
5254
|
+
}
|
|
5255
|
+
}
|
|
5256
|
+
// Get the grouping info from the last of the segments. The info is
|
|
5257
|
+
// the same for all segments.
|
|
5258
|
+
if (segmentPositions) {
|
|
5259
|
+
info = segmentPositions.info;
|
|
5260
|
+
// Optionally identify ticks with higher rank, for example
|
|
5261
|
+
// when the ticks have crossed midnight.
|
|
5262
|
+
if (findHigherRanks && info.unitRange <= timeUnits.hour) {
|
|
5263
|
+
end = groupPositions.length - 1;
|
|
5264
|
+
// Compare points two by two
|
|
5265
|
+
for (start = 1; start < end; start++) {
|
|
5266
|
+
if (time.dateFormat('%d', groupPositions[start]) !==
|
|
5267
|
+
time.dateFormat('%d', groupPositions[start - 1])) {
|
|
5268
|
+
higherRanks[groupPositions[start]] = 'day';
|
|
5269
|
+
hasCrossedHigherRank = true;
|
|
5270
|
+
}
|
|
5271
|
+
}
|
|
5272
|
+
// If the complete array has crossed midnight, we want
|
|
5273
|
+
// to mark the first positions also as higher rank
|
|
5274
|
+
if (hasCrossedHigherRank) {
|
|
5275
|
+
higherRanks[groupPositions[0]] = 'day';
|
|
5276
|
+
}
|
|
5277
|
+
info.higherRanks = higherRanks;
|
|
5278
|
+
}
|
|
5279
|
+
// Save the info
|
|
5280
|
+
info.segmentStarts = segmentStarts;
|
|
5281
|
+
groupPositions.info = info;
|
|
5282
|
+
}
|
|
5283
|
+
else {
|
|
5284
|
+
error(12, false, this.chart);
|
|
5285
|
+
}
|
|
5286
|
+
// Don't show ticks within a gap in the ordinal axis, where the
|
|
5287
|
+
// space between two points is greater than a portion of the tick
|
|
5288
|
+
// pixel interval
|
|
5289
|
+
if (findHigherRanks && defined(tickPixelIntervalOption)) {
|
|
5290
|
+
const length = groupPositions.length, translatedArr = [], distances = [];
|
|
5291
|
+
let itemToRemove, translated, lastTranslated, medianDistance, distance, i = length;
|
|
5292
|
+
// Find median pixel distance in order to keep a reasonably even
|
|
5293
|
+
// distance between ticks (#748)
|
|
5294
|
+
while (i--) {
|
|
5295
|
+
translated = this.translate(groupPositions[i]);
|
|
5296
|
+
if (lastTranslated) {
|
|
5297
|
+
distances[i] = lastTranslated - translated;
|
|
5298
|
+
}
|
|
5299
|
+
translatedArr[i] = lastTranslated = translated;
|
|
5300
|
+
}
|
|
5301
|
+
distances.sort((a, b) => a - b);
|
|
5302
|
+
medianDistance = distances[Math.floor(distances.length / 2)];
|
|
5303
|
+
if (medianDistance < tickPixelIntervalOption * 0.6) {
|
|
5304
|
+
medianDistance = null;
|
|
5305
|
+
}
|
|
5306
|
+
// Now loop over again and remove ticks where needed
|
|
5307
|
+
i = groupPositions[length - 1] > max ? length - 1 : length; // #817
|
|
5308
|
+
lastTranslated = void 0;
|
|
5309
|
+
while (i--) {
|
|
5310
|
+
translated = translatedArr[i];
|
|
5311
|
+
distance = Math.abs(lastTranslated - translated);
|
|
5312
|
+
// #4175 - when axis is reversed, the distance, is negative but
|
|
5313
|
+
// tickPixelIntervalOption positive, so we need to compare the
|
|
5314
|
+
// same values
|
|
5315
|
+
// Remove ticks that are closer than 0.6 times the pixel
|
|
5316
|
+
// interval from the one to the right, but not if it is close to
|
|
5317
|
+
// the median distance (#748).
|
|
5318
|
+
if (lastTranslated &&
|
|
5319
|
+
distance < tickPixelIntervalOption * 0.8 &&
|
|
5320
|
+
(medianDistance === null || distance < medianDistance * 0.8)) {
|
|
5321
|
+
// Is this a higher ranked position with a normal
|
|
5322
|
+
// position to the right?
|
|
5323
|
+
if (higherRanks[groupPositions[i]] &&
|
|
5324
|
+
!higherRanks[groupPositions[i + 1]]) {
|
|
5325
|
+
// Yes: remove the lower ranked neighbour to the
|
|
5326
|
+
// right
|
|
5327
|
+
itemToRemove = i + 1;
|
|
5328
|
+
lastTranslated = translated; // #709
|
|
5329
|
+
}
|
|
5330
|
+
else {
|
|
5331
|
+
// No: remove this one
|
|
5332
|
+
itemToRemove = i;
|
|
5333
|
+
}
|
|
5334
|
+
groupPositions.splice(itemToRemove, 1);
|
|
5335
|
+
}
|
|
5336
|
+
else {
|
|
5337
|
+
lastTranslated = translated;
|
|
5338
|
+
}
|
|
5339
|
+
}
|
|
5340
|
+
}
|
|
5341
|
+
return groupPositions;
|
|
5342
|
+
}
|
|
5343
|
+
/**
|
|
5344
|
+
* Get axis position of given index of the extended ordinal positions.
|
|
5345
|
+
* Used only when panning an ordinal axis.
|
|
5346
|
+
*
|
|
5347
|
+
* @private
|
|
5348
|
+
* @function Highcharts.Axis#index2val
|
|
5349
|
+
* @param {number} index
|
|
5350
|
+
* The index value of searched point
|
|
5351
|
+
*/
|
|
5352
|
+
function index2val(index) {
|
|
5353
|
+
const axis = this, ordinal = axis.ordinal,
|
|
5354
|
+
// Context could be changed to extendedOrdinalPositions.
|
|
5355
|
+
ordinalPositions = ordinal.positions;
|
|
5356
|
+
// The visible range contains only equally spaced values.
|
|
5357
|
+
if (!ordinalPositions) {
|
|
5358
|
+
return index;
|
|
5359
|
+
}
|
|
5360
|
+
let i = ordinalPositions.length - 1, distance;
|
|
5361
|
+
if (index < 0) { // Out of range, in effect panning to the left
|
|
5362
|
+
index = ordinalPositions[0];
|
|
5363
|
+
}
|
|
5364
|
+
else if (index > i) { // Out of range, panning to the right
|
|
5365
|
+
index = ordinalPositions[i];
|
|
5366
|
+
}
|
|
5367
|
+
else { // Split it up
|
|
5368
|
+
i = Math.floor(index);
|
|
5369
|
+
distance = index - i; // The decimal
|
|
5370
|
+
}
|
|
5371
|
+
if (typeof distance !== 'undefined' &&
|
|
5372
|
+
typeof ordinalPositions[i] !== 'undefined') {
|
|
5373
|
+
return ordinalPositions[i] + (distance ?
|
|
5374
|
+
distance *
|
|
5375
|
+
(ordinalPositions[i + 1] - ordinalPositions[i]) :
|
|
5376
|
+
0);
|
|
5377
|
+
}
|
|
5378
|
+
return index;
|
|
5379
|
+
}
|
|
5380
|
+
/**
|
|
5381
|
+
* Translate from linear (internal) to axis value.
|
|
5382
|
+
*
|
|
5383
|
+
* @private
|
|
5384
|
+
* @function Highcharts.Axis#lin2val
|
|
5385
|
+
* @param {number} val
|
|
5386
|
+
* The linear abstracted value.
|
|
5387
|
+
*/
|
|
5388
|
+
function lin2val(val) {
|
|
5389
|
+
const axis = this, ordinal = axis.ordinal, localMin = axis.old ? axis.old.min : axis.min, localA = axis.old ? axis.old.transA : axis.transA;
|
|
5390
|
+
// Always use extendedPositions (#19816)
|
|
5391
|
+
const positions = ordinal.getExtendedPositions();
|
|
5392
|
+
// In some cases (especially in early stages of the chart creation) the
|
|
5393
|
+
// getExtendedPositions might return undefined.
|
|
5394
|
+
if (positions && positions.length) {
|
|
5395
|
+
// Convert back from modivied value to pixels. // #15970
|
|
5396
|
+
const pixelVal = correctFloat((val - localMin) * localA +
|
|
5397
|
+
axis.minPixelPadding), index = correctFloat(ordinal.getIndexOfPoint(pixelVal, positions)), mantissa = correctFloat(index % 1);
|
|
5398
|
+
// Check if the index is inside position array. If true,
|
|
5399
|
+
// read/approximate value for that exact index.
|
|
5400
|
+
if (index >= 0 && index <= positions.length - 1) {
|
|
5401
|
+
const leftNeighbour = positions[Math.floor(index)], rightNeighbour = positions[Math.ceil(index)], distance = rightNeighbour - leftNeighbour;
|
|
5402
|
+
return positions[Math.floor(index)] + mantissa * distance;
|
|
5403
|
+
}
|
|
5404
|
+
}
|
|
5405
|
+
// If the value is outside positions array, return initial value
|
|
5406
|
+
return val; // #16784
|
|
5407
|
+
}
|
|
5408
|
+
/**
|
|
5409
|
+
* Internal function to calculate the precise index in ordinalPositions
|
|
5410
|
+
* array.
|
|
5411
|
+
* @private
|
|
5412
|
+
*/
|
|
5413
|
+
function getIndexInArray(ordinalPositions, val) {
|
|
5414
|
+
const index = OrdinalAxis.Additions.findIndexOf(ordinalPositions, val, true);
|
|
5415
|
+
if (ordinalPositions[index] === val) {
|
|
5416
|
+
return index;
|
|
5417
|
+
}
|
|
5418
|
+
const percent = (val - ordinalPositions[index]) /
|
|
5419
|
+
(ordinalPositions[index + 1] - ordinalPositions[index]);
|
|
5420
|
+
return index + percent;
|
|
5421
|
+
}
|
|
5422
|
+
/**
|
|
5423
|
+
* @private
|
|
5424
|
+
*/
|
|
5425
|
+
function onAxisAfterInit() {
|
|
5426
|
+
const axis = this;
|
|
5427
|
+
if (!axis.ordinal) {
|
|
5428
|
+
axis.ordinal = new OrdinalAxis.Additions(axis);
|
|
5429
|
+
}
|
|
5430
|
+
}
|
|
5431
|
+
/**
|
|
5432
|
+
* @private
|
|
5433
|
+
*/
|
|
5434
|
+
function onAxisFoundExtremes() {
|
|
5435
|
+
const axis = this, { eventArgs, options } = axis;
|
|
5436
|
+
if (axis.isXAxis &&
|
|
5437
|
+
defined(options.overscroll) &&
|
|
5438
|
+
options.overscroll !== 0 &&
|
|
5439
|
+
isNumber(axis.max) &&
|
|
5440
|
+
isNumber(axis.min)) {
|
|
5441
|
+
if (axis.options.ordinal && !axis.ordinal.originalOrdinalRange) {
|
|
5442
|
+
// Calculate the original ordinal range
|
|
5443
|
+
axis.ordinal.getExtendedPositions(false);
|
|
5444
|
+
}
|
|
5445
|
+
if (axis.max === axis.dataMax &&
|
|
5446
|
+
(
|
|
5447
|
+
// Panning is an exception. We don't want to apply
|
|
5448
|
+
// overscroll when panning over the dataMax
|
|
5449
|
+
eventArgs?.trigger !== 'pan' ||
|
|
5450
|
+
axis.isInternal) &&
|
|
5451
|
+
// Scrollbar buttons are the other execption
|
|
5452
|
+
eventArgs?.trigger !== 'navigator') {
|
|
5453
|
+
const overscroll = axis.ordinal.convertOverscroll(options.overscroll);
|
|
5454
|
+
axis.max += overscroll;
|
|
5455
|
+
// Live data and buttons require translation for the min:
|
|
5456
|
+
if (!axis.isInternal &&
|
|
5457
|
+
defined(axis.userMin) &&
|
|
5458
|
+
eventArgs?.trigger !== 'mousewheel') {
|
|
5459
|
+
axis.min += overscroll;
|
|
5460
|
+
}
|
|
5461
|
+
}
|
|
5462
|
+
}
|
|
5463
|
+
}
|
|
5464
|
+
/**
|
|
5465
|
+
* For ordinal axis, that loads data async, redraw axis after data is
|
|
5466
|
+
* loaded. If we don't do that, axis will have the same extremes as
|
|
5467
|
+
* previously, but ordinal positions won't be calculated. See #10290
|
|
5468
|
+
* @private
|
|
5469
|
+
*/
|
|
5470
|
+
function onAxisAfterSetScale() {
|
|
5471
|
+
const axis = this;
|
|
5472
|
+
if (axis.horiz && !axis.isDirty) {
|
|
5473
|
+
axis.isDirty = axis.isOrdinal &&
|
|
5474
|
+
axis.chart.navigator &&
|
|
5475
|
+
!axis.chart.navigator.adaptToUpdatedData;
|
|
5476
|
+
}
|
|
5477
|
+
}
|
|
5478
|
+
/**
|
|
5479
|
+
* @private
|
|
5480
|
+
*/
|
|
5481
|
+
function onAxisInitialAxisTranslation() {
|
|
5482
|
+
const axis = this;
|
|
5483
|
+
if (axis.ordinal) {
|
|
5484
|
+
axis.ordinal.beforeSetTickPositions();
|
|
5485
|
+
axis.tickInterval = axis.ordinal.postProcessTickInterval(axis.tickInterval);
|
|
5486
|
+
}
|
|
5487
|
+
}
|
|
5488
|
+
/**
|
|
5489
|
+
* Extending the Chart.pan method for ordinal axes
|
|
5490
|
+
* @private
|
|
5491
|
+
*/
|
|
5492
|
+
function onChartPan(e) {
|
|
5493
|
+
const chart = this, xAxis = chart.xAxis[0], overscroll = xAxis.ordinal.convertOverscroll(xAxis.options.overscroll), chartX = e.originalEvent.chartX, panning = chart.options.chart.panning;
|
|
5494
|
+
let runBase = false;
|
|
5495
|
+
if (panning &&
|
|
5496
|
+
panning.type !== 'y' &&
|
|
5497
|
+
xAxis.options.ordinal &&
|
|
5498
|
+
xAxis.series.length) {
|
|
5499
|
+
const mouseDownX = chart.mouseDownX, extremes = xAxis.getExtremes(), dataMin = extremes.dataMin, dataMax = extremes.dataMax, min = extremes.min, max = extremes.max, hoverPoints = chart.hoverPoints, closestPointRange = (xAxis.closestPointRange ||
|
|
5500
|
+
(xAxis.ordinal && xAxis.ordinal.overscrollPointsRange)), pointPixelWidth = (xAxis.translationSlope *
|
|
5501
|
+
(xAxis.ordinal.slope || closestPointRange)),
|
|
5502
|
+
// How many ordinal units did we move?
|
|
5503
|
+
movedUnits = Math.round((mouseDownX - chartX) / pointPixelWidth),
|
|
5504
|
+
// Get index of all the chart's points
|
|
5505
|
+
extendedOrdinalPositions = xAxis.ordinal.getExtendedPositions(), extendedAxis = {
|
|
5506
|
+
ordinal: {
|
|
5507
|
+
positions: extendedOrdinalPositions,
|
|
5508
|
+
extendedOrdinalPositions: extendedOrdinalPositions
|
|
5509
|
+
}
|
|
5510
|
+
}, index2val = xAxis.index2val, val2lin = xAxis.val2lin;
|
|
5511
|
+
let trimmedRange, ordinalPositions;
|
|
5512
|
+
// Make sure panning to the edges does not decrease the zoomed range
|
|
5513
|
+
if ((min <= dataMin && movedUnits < 0) ||
|
|
5514
|
+
(max + overscroll >= dataMax && movedUnits > 0)) {
|
|
5515
|
+
return;
|
|
5516
|
+
}
|
|
5517
|
+
// We have an ordinal axis, but the data is equally spaced
|
|
5518
|
+
if (!extendedAxis.ordinal.positions) {
|
|
5519
|
+
runBase = true;
|
|
5520
|
+
}
|
|
5521
|
+
else if (Math.abs(movedUnits) > 1) {
|
|
5522
|
+
// Remove active points for shared tooltip
|
|
5523
|
+
if (hoverPoints) {
|
|
5524
|
+
hoverPoints.forEach(function (point) {
|
|
5525
|
+
point.setState();
|
|
5526
|
+
});
|
|
5527
|
+
}
|
|
5528
|
+
// In grouped data series, the last ordinal position represents
|
|
5529
|
+
// the grouped data, which is to the left of the real data max.
|
|
5530
|
+
// If we don't compensate for this, we will be allowed to pan
|
|
5531
|
+
// grouped data series passed the right of the plot area.
|
|
5532
|
+
ordinalPositions = extendedAxis.ordinal.positions;
|
|
5533
|
+
if (dataMax >
|
|
5534
|
+
ordinalPositions[ordinalPositions.length - 1]) {
|
|
5535
|
+
ordinalPositions.push(dataMax);
|
|
5536
|
+
}
|
|
5537
|
+
// Get the new min and max values by getting the ordinal index
|
|
5538
|
+
// for the current extreme, then add the moved units and
|
|
5539
|
+
// translate back to values. This happens on the extended
|
|
5540
|
+
// ordinal positions if the new position is out of range, else
|
|
5541
|
+
// it happens on the current x axis which is smaller and faster.
|
|
5542
|
+
chart.setFixedRange(max - min);
|
|
5543
|
+
trimmedRange = xAxis.navigatorAxis
|
|
5544
|
+
.toFixedRange(void 0, void 0, index2val.apply(extendedAxis, [
|
|
5545
|
+
val2lin.apply(extendedAxis, [min, true]) +
|
|
5546
|
+
movedUnits
|
|
5547
|
+
]), index2val.apply(extendedAxis, [
|
|
5548
|
+
val2lin.apply(extendedAxis, [max, true]) +
|
|
5549
|
+
movedUnits
|
|
5550
|
+
]));
|
|
5551
|
+
// Apply it if it is within the available data range
|
|
5552
|
+
if (trimmedRange.min >= Math.min(extremes.dataMin, min) &&
|
|
5553
|
+
trimmedRange.max <= Math.max(dataMax, max) + overscroll) {
|
|
5554
|
+
xAxis.setExtremes(trimmedRange.min, trimmedRange.max, true, false, { trigger: 'pan' });
|
|
5555
|
+
}
|
|
5556
|
+
chart.mouseDownX = chartX; // Set new reference for next run
|
|
5557
|
+
css(chart.container, { cursor: 'move' });
|
|
5558
|
+
}
|
|
5559
|
+
}
|
|
5560
|
+
else {
|
|
5561
|
+
runBase = true;
|
|
5562
|
+
}
|
|
5563
|
+
// Revert to the linear chart.pan version
|
|
5564
|
+
if (runBase || (panning && /y/.test(panning.type))) {
|
|
5565
|
+
if (overscroll) {
|
|
5566
|
+
xAxis.max = xAxis.dataMax + overscroll;
|
|
5567
|
+
}
|
|
5568
|
+
}
|
|
5569
|
+
else {
|
|
5570
|
+
e.preventDefault();
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
/**
|
|
5574
|
+
* @private
|
|
5575
|
+
*/
|
|
5576
|
+
function onSeriesUpdatedData() {
|
|
5577
|
+
const xAxis = this.xAxis;
|
|
5578
|
+
// Destroy the extended ordinal index on updated data
|
|
5579
|
+
// and destroy extendedOrdinalPositions, #16055.
|
|
5580
|
+
if (xAxis && xAxis.options.ordinal) {
|
|
5581
|
+
delete xAxis.ordinal.index;
|
|
5582
|
+
delete xAxis.ordinal.originalOrdinalRange;
|
|
5583
|
+
}
|
|
5584
|
+
}
|
|
5585
|
+
/**
|
|
5586
|
+
* Translate from a linear axis value to the corresponding ordinal axis
|
|
5587
|
+
* position. If there are no gaps in the ordinal axis this will be the
|
|
5588
|
+
* same. The translated value is the value that the point would have if
|
|
5589
|
+
* the axis was linear, using the same min and max.
|
|
5590
|
+
*
|
|
5591
|
+
* @private
|
|
5592
|
+
* @function Highcharts.Axis#val2lin
|
|
5593
|
+
* @param {number} val
|
|
5594
|
+
* The axis value.
|
|
5595
|
+
* @param {boolean} [toIndex]
|
|
5596
|
+
* Whether to return the index in the ordinalPositions or the new value.
|
|
5597
|
+
*/
|
|
5598
|
+
function val2lin(val, toIndex) {
|
|
5599
|
+
const axis = this, ordinal = axis.ordinal, ordinalPositions = ordinal.positions;
|
|
5600
|
+
let slope = ordinal.slope, extendedOrdinalPositions;
|
|
5601
|
+
if (!ordinalPositions) {
|
|
5602
|
+
return val;
|
|
5603
|
+
}
|
|
5604
|
+
const ordinalLength = ordinalPositions.length;
|
|
5605
|
+
let ordinalIndex;
|
|
5606
|
+
// If the searched value is inside visible plotArea, ivastigate the
|
|
5607
|
+
// value basing on ordinalPositions.
|
|
5608
|
+
if (ordinalPositions[0] <= val &&
|
|
5609
|
+
ordinalPositions[ordinalLength - 1] >= val) {
|
|
5610
|
+
ordinalIndex = getIndexInArray(ordinalPositions, val);
|
|
5611
|
+
// Final return value is based on ordinalIndex
|
|
5612
|
+
}
|
|
5613
|
+
else {
|
|
5614
|
+
extendedOrdinalPositions =
|
|
5615
|
+
ordinal.getExtendedPositions &&
|
|
5616
|
+
ordinal.getExtendedPositions();
|
|
5617
|
+
if (!(extendedOrdinalPositions && extendedOrdinalPositions.length)) {
|
|
5618
|
+
return val;
|
|
5619
|
+
}
|
|
5620
|
+
const length = extendedOrdinalPositions.length;
|
|
5621
|
+
if (!slope) {
|
|
5622
|
+
slope =
|
|
5623
|
+
(extendedOrdinalPositions[length - 1] -
|
|
5624
|
+
extendedOrdinalPositions[0]) /
|
|
5625
|
+
length;
|
|
5626
|
+
}
|
|
5627
|
+
// `originalPointReference` is equal to the index of first point of
|
|
5628
|
+
// ordinalPositions in extendedOrdinalPositions.
|
|
5629
|
+
const originalPositionsReference = getIndexInArray(extendedOrdinalPositions, ordinalPositions[0]);
|
|
5630
|
+
// If the searched value is outside the visiblePlotArea,
|
|
5631
|
+
// check if it is inside extendedOrdinalPositions.
|
|
5632
|
+
if (val >= extendedOrdinalPositions[0] &&
|
|
5633
|
+
val <=
|
|
5634
|
+
extendedOrdinalPositions[length - 1]) {
|
|
5635
|
+
// Return Value
|
|
5636
|
+
ordinalIndex = getIndexInArray(extendedOrdinalPositions, val) -
|
|
5637
|
+
originalPositionsReference;
|
|
5638
|
+
}
|
|
5639
|
+
else {
|
|
5640
|
+
if (!toIndex) {
|
|
5641
|
+
// If the value is outside positions array,
|
|
5642
|
+
// return initial value, #16784
|
|
5643
|
+
return val;
|
|
5644
|
+
}
|
|
5645
|
+
// Since ordinal.slope is the average distance between 2
|
|
5646
|
+
// points on visible plotArea, this can be used to calculate
|
|
5647
|
+
// the approximate position of the point, which is outside
|
|
5648
|
+
// the extendedOrdinalPositions.
|
|
5649
|
+
if (val < extendedOrdinalPositions[0]) {
|
|
5650
|
+
const diff = extendedOrdinalPositions[0] - val, approximateIndexOffset = diff / slope;
|
|
5651
|
+
ordinalIndex =
|
|
5652
|
+
-originalPositionsReference -
|
|
5653
|
+
approximateIndexOffset;
|
|
5654
|
+
}
|
|
5655
|
+
else {
|
|
5656
|
+
const diff = val -
|
|
5657
|
+
extendedOrdinalPositions[length - 1], approximateIndexOffset = diff / slope;
|
|
5658
|
+
ordinalIndex =
|
|
5659
|
+
approximateIndexOffset +
|
|
5660
|
+
length -
|
|
5661
|
+
originalPositionsReference;
|
|
5662
|
+
}
|
|
5663
|
+
}
|
|
5664
|
+
}
|
|
5665
|
+
return toIndex ? ordinalIndex : slope * (ordinalIndex || 0) +
|
|
5666
|
+
ordinal.offset;
|
|
5667
|
+
}
|
|
5668
|
+
/* *
|
|
5669
|
+
*
|
|
5670
|
+
* Classes
|
|
5671
|
+
*
|
|
5672
|
+
* */
|
|
5673
|
+
/**
|
|
5674
|
+
* @private
|
|
5675
|
+
*/
|
|
5676
|
+
class Additions {
|
|
5677
|
+
/* *
|
|
5678
|
+
*
|
|
5679
|
+
* Constructors
|
|
5680
|
+
*
|
|
5681
|
+
* */
|
|
5682
|
+
/**
|
|
5683
|
+
* @private
|
|
5684
|
+
*/
|
|
5685
|
+
constructor(axis) {
|
|
5686
|
+
this.index = {};
|
|
5687
|
+
this.axis = axis;
|
|
5688
|
+
}
|
|
5689
|
+
/* *
|
|
5690
|
+
*
|
|
5691
|
+
* Functions
|
|
5692
|
+
*
|
|
5693
|
+
* */
|
|
5694
|
+
/**
|
|
5695
|
+
* Calculate the ordinal positions before tick positions are calculated.
|
|
5696
|
+
* @private
|
|
5697
|
+
*/
|
|
5698
|
+
beforeSetTickPositions() {
|
|
5699
|
+
const axis = this.axis, ordinal = axis.ordinal, extremes = axis.getExtremes(), min = extremes.min, max = extremes.max, hasBreaks = axis.brokenAxis?.hasBreaks, isOrdinal = axis.options.ordinal;
|
|
5700
|
+
let len, uniqueOrdinalPositions, dist, minIndex, maxIndex, slope, i, ordinalPositions = [], overscrollPointsRange = Number.MAX_VALUE, useOrdinal = false, adjustOrdinalExtremesPoints = false, isBoosted = false;
|
|
5701
|
+
// Apply the ordinal logic
|
|
5702
|
+
if (isOrdinal || hasBreaks) { // #4167 YAxis is never ordinal ?
|
|
5703
|
+
let distanceBetweenPoint = 0;
|
|
5704
|
+
axis.series.forEach(function (series, i) {
|
|
5705
|
+
uniqueOrdinalPositions = [];
|
|
5706
|
+
// For an axis with multiple series, check if the distance
|
|
5707
|
+
// between points is identical throughout all series.
|
|
5708
|
+
if (i > 0 &&
|
|
5709
|
+
series.options.id !== 'highcharts-navigator-series' &&
|
|
5710
|
+
series.processedXData.length > 1) {
|
|
5711
|
+
adjustOrdinalExtremesPoints =
|
|
5712
|
+
distanceBetweenPoint !== series.processedXData[1] -
|
|
5713
|
+
series.processedXData[0];
|
|
5714
|
+
}
|
|
5715
|
+
distanceBetweenPoint =
|
|
5716
|
+
series.processedXData[1] - series.processedXData[0];
|
|
5717
|
+
if (series.boosted) {
|
|
5718
|
+
isBoosted = series.boosted;
|
|
5719
|
+
}
|
|
5720
|
+
if (series.reserveSpace() &&
|
|
5721
|
+
(series
|
|
5722
|
+
.takeOrdinalPosition !== false || hasBreaks)) {
|
|
5723
|
+
// Concatenate the processed X data into the existing
|
|
5724
|
+
// positions, or the empty array
|
|
5725
|
+
ordinalPositions = ordinalPositions.concat(series.processedXData);
|
|
5726
|
+
len = ordinalPositions.length;
|
|
5727
|
+
// Remove duplicates (#1588)
|
|
5728
|
+
ordinalPositions.sort(function (a, b) {
|
|
5729
|
+
// Without a custom function it is sorted as strings
|
|
5730
|
+
return a - b;
|
|
5731
|
+
});
|
|
5732
|
+
overscrollPointsRange = Math.min(overscrollPointsRange, pick(
|
|
5733
|
+
// Check for a single-point series:
|
|
5734
|
+
series.closestPointRange, overscrollPointsRange));
|
|
5735
|
+
if (len) {
|
|
5736
|
+
i = 0;
|
|
5737
|
+
while (i < len - 1) {
|
|
5738
|
+
if (ordinalPositions[i] !==
|
|
5739
|
+
ordinalPositions[i + 1]) {
|
|
5740
|
+
uniqueOrdinalPositions.push(ordinalPositions[i + 1]);
|
|
5741
|
+
}
|
|
5742
|
+
i++;
|
|
5743
|
+
}
|
|
5744
|
+
// Check first item:
|
|
5745
|
+
if (uniqueOrdinalPositions[0] !==
|
|
5746
|
+
ordinalPositions[0]) {
|
|
5747
|
+
uniqueOrdinalPositions.unshift(ordinalPositions[0]);
|
|
5748
|
+
}
|
|
5749
|
+
ordinalPositions = uniqueOrdinalPositions;
|
|
5750
|
+
}
|
|
5751
|
+
}
|
|
5752
|
+
});
|
|
5753
|
+
if (!axis.ordinal.originalOrdinalRange) {
|
|
5754
|
+
// Calculate current originalOrdinalRange
|
|
5755
|
+
axis.ordinal.originalOrdinalRange =
|
|
5756
|
+
(ordinalPositions.length - 1) * overscrollPointsRange;
|
|
5757
|
+
}
|
|
5758
|
+
// If the distance between points is not identical throughout
|
|
5759
|
+
// all series, remove the first and last ordinal position to
|
|
5760
|
+
// avoid enabling ordinal logic when it is not needed, #17405.
|
|
5761
|
+
// Only for boosted series because changes are negligible.
|
|
5762
|
+
if (adjustOrdinalExtremesPoints && isBoosted) {
|
|
5763
|
+
ordinalPositions.pop();
|
|
5764
|
+
ordinalPositions.shift();
|
|
5765
|
+
}
|
|
5766
|
+
// Cache the length
|
|
5767
|
+
len = ordinalPositions.length;
|
|
5768
|
+
// Check if we really need the overhead of mapping axis data
|
|
5769
|
+
// against the ordinal positions. If the series consist of
|
|
5770
|
+
// evenly spaced data any way, we don't need any ordinal logic.
|
|
5771
|
+
if (len > 2) { // Two points have equal distance by default
|
|
5772
|
+
dist = ordinalPositions[1] - ordinalPositions[0];
|
|
5773
|
+
i = len - 1;
|
|
5774
|
+
while (i-- && !useOrdinal) {
|
|
5775
|
+
if (ordinalPositions[i + 1] - ordinalPositions[i] !==
|
|
5776
|
+
dist) {
|
|
5777
|
+
useOrdinal = true;
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
// When zooming in on a week, prevent axis padding for
|
|
5781
|
+
// weekends even though the data within the week is evenly
|
|
5782
|
+
// spaced.
|
|
5783
|
+
if (!axis.options.keepOrdinalPadding &&
|
|
5784
|
+
(ordinalPositions[0] - min > dist ||
|
|
5785
|
+
(max -
|
|
5786
|
+
ordinalPositions[ordinalPositions.length - 1]) > dist)) {
|
|
5787
|
+
useOrdinal = true;
|
|
5788
|
+
}
|
|
5789
|
+
}
|
|
5790
|
+
else if (axis.options.overscroll) {
|
|
5791
|
+
if (len === 2) {
|
|
5792
|
+
// Exactly two points, distance for overscroll is fixed:
|
|
5793
|
+
overscrollPointsRange =
|
|
5794
|
+
ordinalPositions[1] - ordinalPositions[0];
|
|
5795
|
+
}
|
|
5796
|
+
else if (len === 1) {
|
|
5797
|
+
// We have just one point, closest distance is unknown.
|
|
5798
|
+
// Assume then it is last point and overscrolled range:
|
|
5799
|
+
overscrollPointsRange = axis.ordinal.convertOverscroll(axis.options.overscroll);
|
|
5800
|
+
ordinalPositions = [
|
|
5801
|
+
ordinalPositions[0],
|
|
5802
|
+
ordinalPositions[0] + overscrollPointsRange
|
|
5803
|
+
];
|
|
5804
|
+
}
|
|
5805
|
+
else {
|
|
5806
|
+
// In case of zooming in on overscrolled range, stick to
|
|
5807
|
+
// the old range:
|
|
5808
|
+
overscrollPointsRange = ordinal.overscrollPointsRange;
|
|
5809
|
+
}
|
|
5810
|
+
}
|
|
5811
|
+
// Record the slope and offset to compute the linear values from
|
|
5812
|
+
// the array index. Since the ordinal positions may exceed the
|
|
5813
|
+
// current range, get the start and end positions within it
|
|
5814
|
+
// (#719, #665b)
|
|
5815
|
+
if (useOrdinal || axis.forceOrdinal) {
|
|
5816
|
+
if (axis.options.overscroll) {
|
|
5817
|
+
ordinal.overscrollPointsRange = overscrollPointsRange;
|
|
5818
|
+
ordinalPositions = ordinalPositions.concat(ordinal.getOverscrollPositions());
|
|
5819
|
+
}
|
|
5820
|
+
// Register
|
|
5821
|
+
ordinal.positions = ordinalPositions;
|
|
5822
|
+
// This relies on the ordinalPositions being set. Use
|
|
5823
|
+
// Math.max and Math.min to prevent padding on either sides
|
|
5824
|
+
// of the data.
|
|
5825
|
+
minIndex = axis.ordinal2lin(// #5979
|
|
5826
|
+
Math.max(min, ordinalPositions[0]), true);
|
|
5827
|
+
maxIndex = Math.max(axis.ordinal2lin(Math.min(max, ordinalPositions[ordinalPositions.length - 1]), true), 1); // #3339
|
|
5828
|
+
// Set the slope and offset of the values compared to the
|
|
5829
|
+
// indices in the ordinal positions.
|
|
5830
|
+
ordinal.slope = slope =
|
|
5831
|
+
(max - min) / (maxIndex - minIndex);
|
|
5832
|
+
ordinal.offset = min - (minIndex * slope);
|
|
5833
|
+
}
|
|
5834
|
+
else {
|
|
5835
|
+
ordinal.overscrollPointsRange = pick(axis.closestPointRange, ordinal.overscrollPointsRange);
|
|
5836
|
+
ordinal.positions = axis.ordinal.slope = ordinal.offset =
|
|
5837
|
+
void 0;
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5840
|
+
axis.isOrdinal = isOrdinal && useOrdinal; // #3818, #4196, #4926
|
|
5841
|
+
ordinal.groupIntervalFactor = null; // Reset for next run
|
|
5842
|
+
}
|
|
5843
|
+
/**
|
|
5844
|
+
* Faster way of using the Array.indexOf method.
|
|
5845
|
+
* Works for sorted arrays only with unique values.
|
|
5846
|
+
*
|
|
5847
|
+
* @param {Array} sortedArray
|
|
5848
|
+
* The sorted array inside which we are looking for.
|
|
5849
|
+
* @param {number} key
|
|
5850
|
+
* The key to being found.
|
|
5851
|
+
* @param {boolean} indirectSearch
|
|
5852
|
+
* In case of lack of the point in the array, should return
|
|
5853
|
+
* value be equal to -1 or the closest smaller index.
|
|
5854
|
+
* @private
|
|
5855
|
+
*/
|
|
5856
|
+
static findIndexOf(sortedArray, key, indirectSearch) {
|
|
5857
|
+
let start = 0, end = sortedArray.length - 1, middle;
|
|
5858
|
+
while (start < end) {
|
|
5859
|
+
middle = Math.ceil((start + end) / 2);
|
|
5860
|
+
// Key found as the middle element.
|
|
5861
|
+
if (sortedArray[middle] <= key) {
|
|
5862
|
+
// Continue searching to the right.
|
|
5863
|
+
start = middle;
|
|
5864
|
+
}
|
|
5865
|
+
else {
|
|
5866
|
+
// Continue searching to the left.
|
|
5867
|
+
end = middle - 1;
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5870
|
+
if (sortedArray[start] === key) {
|
|
5871
|
+
return start;
|
|
5872
|
+
}
|
|
5873
|
+
// Key could not be found.
|
|
5874
|
+
return !indirectSearch ? -1 : start;
|
|
5875
|
+
}
|
|
5876
|
+
/**
|
|
5877
|
+
* Get the ordinal positions for the entire data set. This is necessary
|
|
5878
|
+
* in chart panning because we need to find out what points or data
|
|
5879
|
+
* groups are available outside the visible range. When a panning
|
|
5880
|
+
* operation starts, if an index for the given grouping does not exists,
|
|
5881
|
+
* it is created and cached. This index is deleted on updated data, so
|
|
5882
|
+
* it will be regenerated the next time a panning operation starts.
|
|
5883
|
+
* @private
|
|
5884
|
+
*/
|
|
5885
|
+
getExtendedPositions(withOverscroll = true) {
|
|
5886
|
+
const ordinal = this, axis = ordinal.axis, axisProto = axis.constructor.prototype, chart = axis.chart, grouping = axis.series[0]?.currentDataGrouping, key = grouping ?
|
|
5887
|
+
grouping.count + grouping.unitName :
|
|
5888
|
+
'raw', overscroll = withOverscroll ?
|
|
5889
|
+
axis.ordinal.convertOverscroll(axis.options.overscroll) : 0, extremes = axis.getExtremes();
|
|
5890
|
+
let fakeAxis, fakeSeries = void 0, ordinalIndex = ordinal.index;
|
|
5891
|
+
// If this is the first time, or the ordinal index is deleted by
|
|
5892
|
+
// updatedData,
|
|
5893
|
+
// create it.
|
|
5894
|
+
if (!ordinalIndex) {
|
|
5895
|
+
ordinalIndex = ordinal.index = {};
|
|
5896
|
+
}
|
|
5897
|
+
if (!ordinalIndex[key]) {
|
|
5898
|
+
// Create a fake axis object where the extended ordinal
|
|
5899
|
+
// positions are emulated
|
|
5900
|
+
fakeAxis = {
|
|
5901
|
+
series: [],
|
|
5902
|
+
chart: chart,
|
|
5903
|
+
forceOrdinal: false,
|
|
5904
|
+
getExtremes: function () {
|
|
5905
|
+
return {
|
|
5906
|
+
min: extremes.dataMin,
|
|
5907
|
+
max: extremes.dataMax + overscroll
|
|
5908
|
+
};
|
|
5909
|
+
},
|
|
5910
|
+
applyGrouping: axisProto.applyGrouping,
|
|
5911
|
+
getGroupPixelWidth: axisProto.getGroupPixelWidth,
|
|
5912
|
+
getTimeTicks: axisProto.getTimeTicks,
|
|
5913
|
+
options: {
|
|
5914
|
+
ordinal: true
|
|
5915
|
+
},
|
|
5916
|
+
ordinal: {
|
|
5917
|
+
getGroupIntervalFactor: this.getGroupIntervalFactor
|
|
5918
|
+
},
|
|
5919
|
+
ordinal2lin: axisProto.ordinal2lin,
|
|
5920
|
+
getIndexOfPoint: axisProto.getIndexOfPoint,
|
|
5921
|
+
val2lin: axisProto.val2lin // #2590
|
|
5922
|
+
};
|
|
5923
|
+
fakeAxis.ordinal.axis = fakeAxis;
|
|
5924
|
+
// Add the fake series to hold the full data, then apply
|
|
5925
|
+
// processData to it
|
|
5926
|
+
axis.series.forEach(function (series) {
|
|
5927
|
+
fakeSeries = {
|
|
5928
|
+
xAxis: fakeAxis,
|
|
5929
|
+
xData: series.xData.slice(),
|
|
5930
|
+
chart: chart,
|
|
5931
|
+
groupPixelWidth: series.groupPixelWidth,
|
|
5932
|
+
destroyGroupedData: H.noop,
|
|
5933
|
+
getProcessedData: Series.prototype.getProcessedData,
|
|
5934
|
+
applyGrouping: Series.prototype.applyGrouping,
|
|
5935
|
+
reserveSpace: Series.prototype.reserveSpace,
|
|
5936
|
+
visible: series.visible
|
|
5937
|
+
};
|
|
5938
|
+
if (withOverscroll) {
|
|
5939
|
+
fakeSeries.xData = fakeSeries.xData.concat(ordinal.getOverscrollPositions());
|
|
5940
|
+
}
|
|
5941
|
+
fakeSeries.options = {
|
|
5942
|
+
dataGrouping: grouping ? {
|
|
5943
|
+
firstAnchor: series.options.dataGrouping?.firstAnchor,
|
|
5944
|
+
anchor: series.options.dataGrouping?.anchor,
|
|
5945
|
+
lastAnchor: series.options.dataGrouping?.firstAnchor,
|
|
5946
|
+
enabled: true,
|
|
5947
|
+
forced: true,
|
|
5948
|
+
// Doesn't matter which, use the fastest
|
|
5949
|
+
approximation: 'open',
|
|
5950
|
+
units: [[
|
|
5951
|
+
grouping.unitName,
|
|
5952
|
+
[grouping.count]
|
|
5953
|
+
]]
|
|
5954
|
+
} : {
|
|
5955
|
+
enabled: false
|
|
5956
|
+
}
|
|
5957
|
+
};
|
|
5958
|
+
fakeAxis.series.push(fakeSeries);
|
|
5959
|
+
series.processData.apply(fakeSeries);
|
|
5960
|
+
});
|
|
5961
|
+
fakeAxis.applyGrouping({ hasExtremesChanged: true });
|
|
5962
|
+
// Force to use the ordinal when points are evenly spaced (e.g.
|
|
5963
|
+
// weeks), #3825.
|
|
5964
|
+
if ((fakeSeries?.closestPointRange !==
|
|
5965
|
+
fakeSeries?.basePointRange) &&
|
|
5966
|
+
fakeSeries.currentDataGrouping) {
|
|
5967
|
+
fakeAxis.forceOrdinal = true;
|
|
5968
|
+
}
|
|
5969
|
+
// Run beforeSetTickPositions to compute the ordinalPositions
|
|
5970
|
+
axis.ordinal.beforeSetTickPositions.apply({ axis: fakeAxis });
|
|
5971
|
+
if (!axis.ordinal.originalOrdinalRange &&
|
|
5972
|
+
fakeAxis.ordinal.originalOrdinalRange) {
|
|
5973
|
+
axis.ordinal.originalOrdinalRange =
|
|
5974
|
+
fakeAxis.ordinal.originalOrdinalRange;
|
|
5975
|
+
}
|
|
5976
|
+
// Cache it
|
|
5977
|
+
ordinalIndex[key] = fakeAxis.ordinal.positions;
|
|
5978
|
+
}
|
|
5979
|
+
return ordinalIndex[key];
|
|
5980
|
+
}
|
|
5981
|
+
/**
|
|
5982
|
+
* Find the factor to estimate how wide the plot area would have been if
|
|
5983
|
+
* ordinal gaps were included. This value is used to compute an imagined
|
|
5984
|
+
* plot width in order to establish the data grouping interval.
|
|
5985
|
+
*
|
|
5986
|
+
* A real world case is the intraday-candlestick example. Without this
|
|
5987
|
+
* logic, it would show the correct data grouping when viewing a range
|
|
5988
|
+
* within each day, but once moving the range to include the gap between
|
|
5989
|
+
* two days, the interval would include the cut-away night hours and the
|
|
5990
|
+
* data grouping would be wrong. So the below method tries to compensate
|
|
5991
|
+
* by identifying the most common point interval, in this case days.
|
|
5992
|
+
*
|
|
5993
|
+
* An opposite case is presented in issue #718. We have a long array of
|
|
5994
|
+
* daily data, then one point is appended one hour after the last point.
|
|
5995
|
+
* We expect the data grouping not to change.
|
|
5996
|
+
*
|
|
5997
|
+
* In the future, if we find cases where this estimation doesn't work
|
|
5998
|
+
* optimally, we might need to add a second pass to the data grouping
|
|
5999
|
+
* logic, where we do another run with a greater interval if the number
|
|
6000
|
+
* of data groups is more than a certain fraction of the desired group
|
|
6001
|
+
* count.
|
|
6002
|
+
* @private
|
|
6003
|
+
*/
|
|
6004
|
+
getGroupIntervalFactor(xMin, xMax, series) {
|
|
6005
|
+
const ordinal = this, processedXData = series.processedXData, len = processedXData.length, distances = [];
|
|
6006
|
+
let median, i, groupIntervalFactor = ordinal.groupIntervalFactor;
|
|
6007
|
+
// Only do this computation for the first series, let the other
|
|
6008
|
+
// inherit it (#2416)
|
|
6009
|
+
if (!groupIntervalFactor) {
|
|
6010
|
+
// Register all the distances in an array
|
|
6011
|
+
for (i = 0; i < len - 1; i++) {
|
|
6012
|
+
distances[i] = (processedXData[i + 1] -
|
|
6013
|
+
processedXData[i]);
|
|
6014
|
+
}
|
|
6015
|
+
// Sort them and find the median
|
|
6016
|
+
distances.sort(function (a, b) {
|
|
6017
|
+
return a - b;
|
|
6018
|
+
});
|
|
6019
|
+
median = distances[Math.floor(len / 2)];
|
|
6020
|
+
// Compensate for series that don't extend through the entire
|
|
6021
|
+
// axis extent. #1675.
|
|
6022
|
+
xMin = Math.max(xMin, processedXData[0]);
|
|
6023
|
+
xMax = Math.min(xMax, processedXData[len - 1]);
|
|
6024
|
+
ordinal.groupIntervalFactor = groupIntervalFactor =
|
|
6025
|
+
(len * median) / (xMax - xMin);
|
|
6026
|
+
}
|
|
6027
|
+
// Return the factor needed for data grouping
|
|
6028
|
+
return groupIntervalFactor;
|
|
6029
|
+
}
|
|
6030
|
+
/**
|
|
6031
|
+
* Get index of point inside the ordinal positions array.
|
|
6032
|
+
*
|
|
6033
|
+
* @private
|
|
6034
|
+
* @param {number} val
|
|
6035
|
+
* The pixel value of a point.
|
|
6036
|
+
*
|
|
6037
|
+
* @param {Array<number>} [ordinalArray]
|
|
6038
|
+
* An array of all points available on the axis for the given data set.
|
|
6039
|
+
* Either ordinalPositions if the value is inside the plotArea or
|
|
6040
|
+
* extendedOrdinalPositions if not.
|
|
6041
|
+
*/
|
|
6042
|
+
getIndexOfPoint(val, ordinalArray) {
|
|
6043
|
+
const ordinal = this, axis = ordinal.axis;
|
|
6044
|
+
let firstPointVal = 0;
|
|
6045
|
+
// Check whether the series has at least one point inside the chart
|
|
6046
|
+
const hasPointsInside = function (series) {
|
|
6047
|
+
const { min, max } = axis;
|
|
6048
|
+
if (defined(min) && defined(max)) {
|
|
6049
|
+
return series.points.some((point) => point.x >= min && point.x <= max);
|
|
6050
|
+
}
|
|
6051
|
+
return false;
|
|
6052
|
+
};
|
|
6053
|
+
let firstPointX;
|
|
6054
|
+
// When more series assign to axis, find the smallest one, #15987.
|
|
6055
|
+
axis.series.forEach((series) => {
|
|
6056
|
+
const firstPoint = series.points?.[0];
|
|
6057
|
+
if (defined(firstPoint?.plotX) &&
|
|
6058
|
+
(firstPoint.plotX < firstPointX ||
|
|
6059
|
+
!defined(firstPointX)) &&
|
|
6060
|
+
hasPointsInside(series)) {
|
|
6061
|
+
firstPointX = firstPoint.plotX;
|
|
6062
|
+
firstPointVal = firstPoint.x;
|
|
6063
|
+
}
|
|
6064
|
+
});
|
|
6065
|
+
// If undefined, give a default value
|
|
6066
|
+
firstPointX ?? (firstPointX = axis.minPixelPadding);
|
|
6067
|
+
// Distance in pixels between two points on the ordinal axis in the
|
|
6068
|
+
// current zoom.
|
|
6069
|
+
const ordinalPointPixelInterval = axis.translationSlope * (ordinal.slope ||
|
|
6070
|
+
axis.closestPointRange ||
|
|
6071
|
+
ordinal.overscrollPointsRange),
|
|
6072
|
+
// `toValue` for the first point.
|
|
6073
|
+
shiftIndex = correctFloat((val - firstPointX) / ordinalPointPixelInterval);
|
|
6074
|
+
return Additions.findIndexOf(ordinalArray, firstPointVal, true) + shiftIndex;
|
|
6075
|
+
}
|
|
6076
|
+
/**
|
|
6077
|
+
* Get ticks for an ordinal axis within a range where points don't
|
|
6078
|
+
* exist. It is required when overscroll is enabled. We can't base on
|
|
6079
|
+
* points, because we may not have any, so we use approximated
|
|
6080
|
+
* pointRange and generate these ticks between Axis.dataMax,
|
|
6081
|
+
* Axis.dataMax + Axis.overscroll evenly spaced. Used in panning and
|
|
6082
|
+
* navigator scrolling.
|
|
6083
|
+
* @private
|
|
6084
|
+
*/
|
|
6085
|
+
getOverscrollPositions() {
|
|
6086
|
+
const ordinal = this, axis = ordinal.axis, extraRange = ordinal.convertOverscroll(axis.options.overscroll), distance = ordinal.overscrollPointsRange, positions = [];
|
|
6087
|
+
let max = axis.dataMax;
|
|
6088
|
+
if (defined(distance)) {
|
|
6089
|
+
// Max + pointRange because we need to scroll to the last
|
|
6090
|
+
while (max <= axis.dataMax + extraRange) {
|
|
6091
|
+
max += distance;
|
|
6092
|
+
positions.push(max);
|
|
6093
|
+
}
|
|
6094
|
+
}
|
|
6095
|
+
return positions;
|
|
6096
|
+
}
|
|
6097
|
+
/**
|
|
6098
|
+
* Make the tick intervals closer because the ordinal gaps make the
|
|
6099
|
+
* ticks spread out or cluster.
|
|
6100
|
+
* @private
|
|
6101
|
+
*/
|
|
6102
|
+
postProcessTickInterval(tickInterval) {
|
|
6103
|
+
// Problem: https://jsfiddle.net/highcharts/FQm4E/1/. This is a case
|
|
6104
|
+
// where this algorithm doesn't work optimally. In this case, the
|
|
6105
|
+
// tick labels are spread out per week, but all the gaps reside
|
|
6106
|
+
// within weeks. So we have a situation where the labels are courser
|
|
6107
|
+
// than the ordinal gaps, and thus the tick interval should not be
|
|
6108
|
+
// altered.
|
|
6109
|
+
const ordinal = this, axis = ordinal.axis, ordinalSlope = ordinal.slope;
|
|
6110
|
+
let ret;
|
|
6111
|
+
if (ordinalSlope) {
|
|
6112
|
+
if (!axis.options.breaks) {
|
|
6113
|
+
ret = (tickInterval /
|
|
6114
|
+
(ordinalSlope / axis.closestPointRange));
|
|
6115
|
+
}
|
|
6116
|
+
else {
|
|
6117
|
+
ret = axis.closestPointRange || tickInterval; // #7275
|
|
6118
|
+
}
|
|
6119
|
+
}
|
|
6120
|
+
else {
|
|
6121
|
+
ret = tickInterval;
|
|
6122
|
+
}
|
|
6123
|
+
return ret;
|
|
6124
|
+
}
|
|
6125
|
+
/**
|
|
6126
|
+
* If overscroll is pixel or pecentage value, convert it to axis range.
|
|
6127
|
+
*
|
|
6128
|
+
* @private
|
|
6129
|
+
* @param {number | string} overscroll
|
|
6130
|
+
* Overscroll value in axis range, pixels or percentage value.
|
|
6131
|
+
* @return {number}
|
|
6132
|
+
* Overscroll value in axis range.
|
|
6133
|
+
*/
|
|
6134
|
+
convertOverscroll(overscroll = 0) {
|
|
6135
|
+
const ordinal = this, axis = ordinal.axis, calculateOverscroll = function (overscrollPercentage) {
|
|
6136
|
+
return pick(ordinal.originalOrdinalRange, defined(axis.dataMax) && defined(axis.dataMin) ?
|
|
6137
|
+
axis.dataMax - axis.dataMin : 0) * overscrollPercentage;
|
|
6138
|
+
};
|
|
6139
|
+
if (isString(overscroll)) {
|
|
6140
|
+
const overscrollValue = parseInt(overscroll, 10);
|
|
6141
|
+
if (/%$/.test(overscroll)) {
|
|
6142
|
+
// If overscroll is percentage
|
|
6143
|
+
return calculateOverscroll(overscrollValue / 100);
|
|
6144
|
+
}
|
|
6145
|
+
if (/px/.test(overscroll)) {
|
|
6146
|
+
// If overscroll is pixels, it is limited to 90% of the axis
|
|
6147
|
+
// length to prevent division by zero
|
|
6148
|
+
const limitedOverscrollValue = Math.min(overscrollValue, axis.len * 0.9), pixelToPercent = limitedOverscrollValue / axis.len;
|
|
6149
|
+
return calculateOverscroll(pixelToPercent / (1 - pixelToPercent));
|
|
6150
|
+
}
|
|
6151
|
+
// If overscroll is a string but not pixels or percentage,
|
|
6152
|
+
// return 0 as no overscroll
|
|
6153
|
+
return 0;
|
|
6154
|
+
}
|
|
6155
|
+
return overscroll;
|
|
6156
|
+
}
|
|
6157
|
+
}
|
|
6158
|
+
OrdinalAxis.Additions = Additions;
|
|
6159
|
+
})(OrdinalAxis || (OrdinalAxis = {}));
|
|
6160
|
+
/* *
|
|
6161
|
+
*
|
|
6162
|
+
* Default Export
|
|
6163
|
+
*
|
|
6164
|
+
* */
|
|
6165
|
+
|
|
6166
|
+
return OrdinalAxis;
|
|
6167
|
+
});
|
|
6168
|
+
_registerModule(_modules, 'Stock/RangeSelector/RangeSelector.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Defaults.js'], _modules['Core/Globals.js'], _modules['Stock/RangeSelector/RangeSelectorComposition.js'], _modules['Core/Renderer/SVG/SVGElement.js'], _modules['Core/Utilities.js'], _modules['Core/Axis/OrdinalAxis.js']], function (Axis, D, H, RangeSelectorComposition, SVGElement, U, OrdinalAxis) {
|
|
5168
6169
|
/* *
|
|
5169
6170
|
*
|
|
5170
6171
|
* (c) 2010-2024 Torstein Honsi
|
|
@@ -5240,7 +6241,6 @@
|
|
|
5240
6241
|
constructor(chart) {
|
|
5241
6242
|
this.buttonOptions = RangeSelector.prototype.defaultButtons;
|
|
5242
6243
|
this.initialButtonGroupWidth = 0;
|
|
5243
|
-
this.chart = chart;
|
|
5244
6244
|
this.init(chart);
|
|
5245
6245
|
}
|
|
5246
6246
|
/* *
|
|
@@ -5261,7 +6261,7 @@
|
|
|
5261
6261
|
clickButton(i, redraw) {
|
|
5262
6262
|
const rangeSelector = this, chart = rangeSelector.chart, rangeOptions = rangeSelector.buttonOptions[i], baseAxis = chart.xAxis[0], unionExtremes = (chart.scroller && chart.scroller.getUnionExtremes()) || baseAxis || {}, type = rangeOptions.type, dataGrouping = rangeOptions.dataGrouping;
|
|
5263
6263
|
let dataMin = unionExtremes.dataMin, dataMax = unionExtremes.dataMax, newMin, newMax = baseAxis && Math.round(Math.min(baseAxis.max, pick(dataMax, baseAxis.max))), // #1568
|
|
5264
|
-
baseXAxisOptions, range = rangeOptions._range, rangeMin,
|
|
6264
|
+
baseXAxisOptions, range = rangeOptions._range, rangeMin, ctx, ytdExtremes, addOffsetMin = true;
|
|
5265
6265
|
// Chart has no data, base series is removed
|
|
5266
6266
|
if (dataMin === null || dataMax === null) {
|
|
5267
6267
|
return;
|
|
@@ -5359,16 +6359,20 @@
|
|
|
5359
6359
|
// Update the chart
|
|
5360
6360
|
if (!baseAxis) {
|
|
5361
6361
|
// Axis not yet instantiated. Temporarily set min and range
|
|
5362
|
-
// options and remove them on
|
|
6362
|
+
// options and axes once defined and remove them on
|
|
6363
|
+
// chart load (#4317 & #20529).
|
|
5363
6364
|
baseXAxisOptions = splat(chart.options.xAxis)[0];
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
6365
|
+
const axisRangeUpdateEvent = addEvent(chart, 'afterGetAxes', function () {
|
|
6366
|
+
const xAxis = chart.xAxis[0];
|
|
6367
|
+
xAxis.range = xAxis.options.range = range;
|
|
6368
|
+
xAxis.min = xAxis.options.min = rangeMin;
|
|
6369
|
+
});
|
|
5368
6370
|
addEvent(chart, 'load', function resetMinAndRange() {
|
|
6371
|
+
const xAxis = chart.xAxis[0];
|
|
5369
6372
|
chart.setFixedRange(rangeOptions._range);
|
|
5370
|
-
|
|
5371
|
-
|
|
6373
|
+
xAxis.options.range = baseXAxisOptions.range;
|
|
6374
|
+
xAxis.options.min = baseXAxisOptions.min;
|
|
6375
|
+
axisRangeUpdateEvent(); // Remove event
|
|
5372
6376
|
});
|
|
5373
6377
|
}
|
|
5374
6378
|
else {
|
|
@@ -5442,6 +6446,7 @@
|
|
|
5442
6446
|
});
|
|
5443
6447
|
}
|
|
5444
6448
|
}));
|
|
6449
|
+
this.createElements();
|
|
5445
6450
|
}
|
|
5446
6451
|
/**
|
|
5447
6452
|
* Dynamically update the range selector buttons after a new range has been
|
|
@@ -5451,25 +6456,25 @@
|
|
|
5451
6456
|
* @function Highcharts.RangeSelector#updateButtonStates
|
|
5452
6457
|
*/
|
|
5453
6458
|
updateButtonStates() {
|
|
5454
|
-
const rangeSelector = this, chart = this.chart, dropdown = this.dropdown, baseAxis = chart.xAxis[0], actualRange = Math.round(baseAxis.max - baseAxis.min), hasNoData = !baseAxis.hasVisibleSeries, day = 24 * 36e5, // A single day in milliseconds
|
|
6459
|
+
const rangeSelector = this, chart = this.chart, dropdown = this.dropdown, dropdownLabel = this.dropdownLabel, baseAxis = chart.xAxis[0], actualRange = Math.round(baseAxis.max - baseAxis.min), hasNoData = !baseAxis.hasVisibleSeries, day = 24 * 36e5, // A single day in milliseconds
|
|
5455
6460
|
unionExtremes = (chart.scroller &&
|
|
5456
|
-
chart.scroller.getUnionExtremes()) || baseAxis, dataMin = unionExtremes.dataMin, dataMax = unionExtremes.dataMax, ytdExtremes = rangeSelector.getYTDExtremes(dataMax, dataMin, chart.time.useUTC), ytdMin = ytdExtremes.min, ytdMax = ytdExtremes.max, selected = rangeSelector.selected, allButtonsEnabled = rangeSelector.options.allButtonsEnabled,
|
|
5457
|
-
|
|
6461
|
+
chart.scroller.getUnionExtremes()) || baseAxis, dataMin = unionExtremes.dataMin, dataMax = unionExtremes.dataMax, ytdExtremes = rangeSelector.getYTDExtremes(dataMax, dataMin, chart.time.useUTC), ytdMin = ytdExtremes.min, ytdMax = ytdExtremes.max, selected = rangeSelector.selected, allButtonsEnabled = rangeSelector.options.allButtonsEnabled, buttonStates = new Array(rangeSelector.buttonOptions.length)
|
|
6462
|
+
.fill(0), selectedExists = isNumber(selected), buttons = rangeSelector.buttons;
|
|
6463
|
+
let isSelectedTooGreat = false, selectedIndex = null;
|
|
5458
6464
|
rangeSelector.buttonOptions.forEach((rangeOptions, i) => {
|
|
5459
|
-
const range = rangeOptions._range, type = rangeOptions.type, count = rangeOptions.count || 1,
|
|
6465
|
+
const range = rangeOptions._range, type = rangeOptions.type, count = rangeOptions.count || 1, offsetRange = rangeOptions._offsetMax -
|
|
5460
6466
|
rangeOptions._offsetMin, isSelected = i === selected,
|
|
5461
|
-
// Disable buttons where the range exceeds what is allowed
|
|
6467
|
+
// Disable buttons where the range exceeds what is allowed i;
|
|
5462
6468
|
// the current view
|
|
5463
6469
|
isTooGreatRange = range >
|
|
5464
6470
|
dataMax - dataMin,
|
|
5465
6471
|
// Disable buttons where the range is smaller than the minimum
|
|
5466
6472
|
// range
|
|
5467
6473
|
isTooSmallRange = range < baseAxis.minRange;
|
|
5468
|
-
let state = 0,
|
|
5469
6474
|
// Do not select the YTD button if not explicitly told so
|
|
5470
|
-
isYTDButNotSelected = false,
|
|
6475
|
+
let isYTDButNotSelected = false,
|
|
5471
6476
|
// Disable the All button if we're already showing all
|
|
5472
|
-
|
|
6477
|
+
isSameRange = range === actualRange;
|
|
5473
6478
|
if (isSelected && isTooGreatRange) {
|
|
5474
6479
|
isSelectedTooGreat = true;
|
|
5475
6480
|
}
|
|
@@ -5478,8 +6483,9 @@
|
|
|
5478
6483
|
range &&
|
|
5479
6484
|
actualRange < range) {
|
|
5480
6485
|
// Handle ordinal ranges
|
|
5481
|
-
const positions = baseAxis.ordinal.positions;
|
|
5482
|
-
if (positions[
|
|
6486
|
+
const positions = baseAxis.ordinal.positions, prevOrdinalPosition = OrdinalAxis.Additions.findIndexOf(positions, baseAxis.min, true), nextOrdinalPosition = Math.min(OrdinalAxis.Additions.findIndexOf(positions, baseAxis.max, true) + 1, positions.length - 1);
|
|
6487
|
+
if (positions[nextOrdinalPosition] -
|
|
6488
|
+
positions[prevOrdinalPosition] > range) {
|
|
5483
6489
|
isSameRange = true;
|
|
5484
6490
|
}
|
|
5485
6491
|
}
|
|
@@ -5499,9 +6505,6 @@
|
|
|
5499
6505
|
else if (type === 'all') {
|
|
5500
6506
|
isSameRange = (baseAxis.max - baseAxis.min >=
|
|
5501
6507
|
dataMax - dataMin);
|
|
5502
|
-
isAllButAlreadyShowingAll = (!isSelected &&
|
|
5503
|
-
selectedExists &&
|
|
5504
|
-
isSameRange);
|
|
5505
6508
|
}
|
|
5506
6509
|
// The new zoom area happens to match the range for a button - mark
|
|
5507
6510
|
// it selected. This happens when scrolling across an ordinal gap.
|
|
@@ -5511,38 +6514,56 @@
|
|
|
5511
6514
|
!(isSelectedTooGreat && type === 'all') &&
|
|
5512
6515
|
(isTooGreatRange ||
|
|
5513
6516
|
isTooSmallRange ||
|
|
5514
|
-
isAllButAlreadyShowingAll ||
|
|
5515
6517
|
hasNoData));
|
|
5516
6518
|
const select = ((isSelectedTooGreat && type === 'all') ||
|
|
5517
|
-
(
|
|
5518
|
-
(isSameRange && !selectedExists && !isYTDButNotSelected) ||
|
|
6519
|
+
(isYTDButNotSelected ? false : isSameRange) ||
|
|
5519
6520
|
(isSelected && rangeSelector.frozenStates));
|
|
5520
6521
|
if (disable) {
|
|
5521
|
-
|
|
6522
|
+
buttonStates[i] = 3;
|
|
5522
6523
|
}
|
|
5523
6524
|
else if (select) {
|
|
5524
|
-
selectedExists
|
|
5525
|
-
|
|
6525
|
+
if (!selectedExists || i === selected) {
|
|
6526
|
+
selectedIndex = i;
|
|
6527
|
+
}
|
|
6528
|
+
}
|
|
6529
|
+
});
|
|
6530
|
+
if (selectedIndex !== null) {
|
|
6531
|
+
buttonStates[selectedIndex] = 2;
|
|
6532
|
+
rangeSelector.setSelected(selectedIndex);
|
|
6533
|
+
}
|
|
6534
|
+
else {
|
|
6535
|
+
rangeSelector.setSelected();
|
|
6536
|
+
if (dropdownLabel) {
|
|
6537
|
+
dropdownLabel.setState(0);
|
|
6538
|
+
dropdownLabel.attr({
|
|
6539
|
+
text: (defaultOptions.lang.rangeSelectorZoom || '') + ' ▾'
|
|
6540
|
+
});
|
|
5526
6541
|
}
|
|
5527
|
-
|
|
6542
|
+
}
|
|
6543
|
+
for (let i = 0; i < buttonStates.length; i++) {
|
|
6544
|
+
const state = buttonStates[i];
|
|
6545
|
+
const button = buttons[i];
|
|
5528
6546
|
if (button.state !== state) {
|
|
5529
6547
|
button.setState(state);
|
|
5530
6548
|
if (dropdown) {
|
|
5531
|
-
dropdown.options[i + 1].disabled =
|
|
6549
|
+
dropdown.options[i + 1].disabled = (state === 3);
|
|
5532
6550
|
if (state === 2) {
|
|
6551
|
+
if (dropdownLabel) {
|
|
6552
|
+
dropdownLabel.setState(2);
|
|
6553
|
+
dropdownLabel.attr({
|
|
6554
|
+
text: rangeSelector.buttonOptions[i].text + ' ▾'
|
|
6555
|
+
});
|
|
6556
|
+
}
|
|
5533
6557
|
dropdown.selectedIndex = i + 1;
|
|
5534
6558
|
}
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
else if ((state === 2 && !defined(selected)) ||
|
|
5541
|
-
isSelectedTooGreat) {
|
|
5542
|
-
rangeSelector.setSelected(i);
|
|
6559
|
+
const bbox = dropdownLabel.getBBox();
|
|
6560
|
+
css(dropdown, {
|
|
6561
|
+
width: `${bbox.width}px`,
|
|
6562
|
+
height: `${bbox.height}px`
|
|
6563
|
+
});
|
|
5543
6564
|
}
|
|
5544
6565
|
}
|
|
5545
|
-
}
|
|
6566
|
+
}
|
|
5546
6567
|
}
|
|
5547
6568
|
/**
|
|
5548
6569
|
* Compute and cache the range for an individual button
|
|
@@ -5740,12 +6761,10 @@
|
|
|
5740
6761
|
/**
|
|
5741
6762
|
* @private
|
|
5742
6763
|
*/
|
|
5743
|
-
function updateExtremes() {
|
|
5744
|
-
const { maxInput, minInput } = rangeSelector, chartAxis = chart.xAxis[0], unionExtremes =
|
|
6764
|
+
function updateExtremes(name) {
|
|
6765
|
+
const { maxInput, minInput } = rangeSelector, chartAxis = chart.xAxis[0], unionExtremes = chart.scroller?.getUnionExtremes() || chartAxis, dataMin = unionExtremes.dataMin, dataMax = unionExtremes.dataMax, currentExtreme = chart.xAxis[0].getExtremes()[name];
|
|
5745
6766
|
let value = rangeSelector.getInputValue(name);
|
|
5746
|
-
if (value !==
|
|
5747
|
-
isNumber(value)) {
|
|
5748
|
-
input.setAttribute('data-hc-time-previous', value);
|
|
6767
|
+
if (isNumber(value) && value !== currentExtreme) {
|
|
5749
6768
|
// Validate the extremes. If it goes beyond the data min or
|
|
5750
6769
|
// max, use the actual data extreme (#2438).
|
|
5751
6770
|
if (isMin && maxInput && isNumber(dataMin)) {
|
|
@@ -5842,7 +6861,7 @@
|
|
|
5842
6861
|
if (input === H.doc.activeElement) { // Only when focused
|
|
5843
6862
|
// Update also when no `change` event is triggered, like when
|
|
5844
6863
|
// clicking inside the SVG (#4710)
|
|
5845
|
-
updateExtremes();
|
|
6864
|
+
updateExtremes(name);
|
|
5846
6865
|
}
|
|
5847
6866
|
// #10404 - move hide and blur outside focus
|
|
5848
6867
|
rangeSelector.hideInput(name);
|
|
@@ -5854,7 +6873,7 @@
|
|
|
5854
6873
|
input.onchange = () => {
|
|
5855
6874
|
// Update extremes and blur input when clicking date input calendar
|
|
5856
6875
|
if (!keyDown) {
|
|
5857
|
-
updateExtremes();
|
|
6876
|
+
updateExtremes(name);
|
|
5858
6877
|
rangeSelector.hideInput(name);
|
|
5859
6878
|
input.blur();
|
|
5860
6879
|
}
|
|
@@ -5862,14 +6881,16 @@
|
|
|
5862
6881
|
input.onkeypress = (event) => {
|
|
5863
6882
|
// IE does not fire onchange on enter
|
|
5864
6883
|
if (event.keyCode === 13) {
|
|
5865
|
-
updateExtremes();
|
|
6884
|
+
updateExtremes(name);
|
|
5866
6885
|
}
|
|
5867
6886
|
};
|
|
5868
6887
|
input.onkeydown = (event) => {
|
|
5869
6888
|
keyDown = true;
|
|
5870
6889
|
// Arrow keys
|
|
5871
|
-
if (event.
|
|
5872
|
-
|
|
6890
|
+
if (event.key === 'ArrowUp' ||
|
|
6891
|
+
event.key === 'ArrowDown' ||
|
|
6892
|
+
event.key === 'Tab') {
|
|
6893
|
+
updateExtremes(name);
|
|
5873
6894
|
}
|
|
5874
6895
|
};
|
|
5875
6896
|
input.onkeyup = () => {
|
|
@@ -5912,6 +6933,42 @@
|
|
|
5912
6933
|
min
|
|
5913
6934
|
};
|
|
5914
6935
|
}
|
|
6936
|
+
createElements() {
|
|
6937
|
+
const chart = this.chart, renderer = chart.renderer, container = chart.container, chartOptions = chart.options, options = chartOptions.rangeSelector, inputEnabled = options.inputEnabled, inputsZIndex = pick(chartOptions.chart.style?.zIndex, 0) + 1;
|
|
6938
|
+
if (options.enabled === false) {
|
|
6939
|
+
return;
|
|
6940
|
+
}
|
|
6941
|
+
this.group = renderer.g('range-selector-group')
|
|
6942
|
+
.attr({
|
|
6943
|
+
zIndex: 7
|
|
6944
|
+
})
|
|
6945
|
+
.add();
|
|
6946
|
+
this.div = createElement('div', void 0, {
|
|
6947
|
+
position: 'relative',
|
|
6948
|
+
height: 0,
|
|
6949
|
+
zIndex: inputsZIndex
|
|
6950
|
+
});
|
|
6951
|
+
if (this.buttonOptions.length) {
|
|
6952
|
+
this.renderButtons();
|
|
6953
|
+
}
|
|
6954
|
+
// First create a wrapper outside the container in order to make
|
|
6955
|
+
// the inputs work and make export correct
|
|
6956
|
+
if (container.parentNode) {
|
|
6957
|
+
container.parentNode.insertBefore(this.div, container);
|
|
6958
|
+
}
|
|
6959
|
+
if (inputEnabled) {
|
|
6960
|
+
// Create the group to keep the inputs
|
|
6961
|
+
this.inputGroup = renderer.g('input-group').add(this.group);
|
|
6962
|
+
const minElems = this.drawInput('min');
|
|
6963
|
+
this.minDateBox = minElems.dateBox;
|
|
6964
|
+
this.minLabel = minElems.label;
|
|
6965
|
+
this.minInput = minElems.input;
|
|
6966
|
+
const maxElems = this.drawInput('max');
|
|
6967
|
+
this.maxDateBox = maxElems.dateBox;
|
|
6968
|
+
this.maxLabel = maxElems.label;
|
|
6969
|
+
this.maxInput = maxElems.input;
|
|
6970
|
+
}
|
|
6971
|
+
}
|
|
5915
6972
|
/**
|
|
5916
6973
|
* Render the range selector including the buttons and the inputs. The first
|
|
5917
6974
|
* time render is called, the elements are created and positioned. On
|
|
@@ -5925,46 +6982,12 @@
|
|
|
5925
6982
|
* X axis maximum
|
|
5926
6983
|
*/
|
|
5927
6984
|
render(min, max) {
|
|
5928
|
-
const chart = this.chart,
|
|
6985
|
+
const chart = this.chart, chartOptions = chart.options, options = chartOptions.rangeSelector,
|
|
5929
6986
|
// Place inputs above the container
|
|
5930
|
-
|
|
5931
|
-
chartOptions.chart.style.zIndex, 0) + 1, inputEnabled = options.inputEnabled, rendered = this.rendered;
|
|
6987
|
+
inputEnabled = options.inputEnabled;
|
|
5932
6988
|
if (options.enabled === false) {
|
|
5933
6989
|
return;
|
|
5934
6990
|
}
|
|
5935
|
-
// Create the elements
|
|
5936
|
-
if (!rendered) {
|
|
5937
|
-
this.group = renderer.g('range-selector-group')
|
|
5938
|
-
.attr({
|
|
5939
|
-
zIndex: 7
|
|
5940
|
-
})
|
|
5941
|
-
.add();
|
|
5942
|
-
this.div = createElement('div', void 0, {
|
|
5943
|
-
position: 'relative',
|
|
5944
|
-
height: 0,
|
|
5945
|
-
zIndex: inputsZIndex
|
|
5946
|
-
});
|
|
5947
|
-
if (this.buttonOptions.length) {
|
|
5948
|
-
this.renderButtons();
|
|
5949
|
-
}
|
|
5950
|
-
// First create a wrapper outside the container in order to make
|
|
5951
|
-
// the inputs work and make export correct
|
|
5952
|
-
if (container.parentNode) {
|
|
5953
|
-
container.parentNode.insertBefore(this.div, container);
|
|
5954
|
-
}
|
|
5955
|
-
if (inputEnabled) {
|
|
5956
|
-
// Create the group to keep the inputs
|
|
5957
|
-
this.inputGroup = renderer.g('input-group').add(this.group);
|
|
5958
|
-
const minElems = this.drawInput('min');
|
|
5959
|
-
this.minDateBox = minElems.dateBox;
|
|
5960
|
-
this.minLabel = minElems.label;
|
|
5961
|
-
this.minInput = minElems.input;
|
|
5962
|
-
const maxElems = this.drawInput('max');
|
|
5963
|
-
this.maxDateBox = maxElems.dateBox;
|
|
5964
|
-
this.maxLabel = maxElems.label;
|
|
5965
|
-
this.maxInput = maxElems.input;
|
|
5966
|
-
}
|
|
5967
|
-
}
|
|
5968
6991
|
if (inputEnabled) {
|
|
5969
6992
|
// Set or reset the input values
|
|
5970
6993
|
this.setInputValue('min', min);
|
|
@@ -5996,7 +7019,7 @@
|
|
|
5996
7019
|
}
|
|
5997
7020
|
}
|
|
5998
7021
|
this.alignElements();
|
|
5999
|
-
this.
|
|
7022
|
+
this.updateButtonStates();
|
|
6000
7023
|
}
|
|
6001
7024
|
/**
|
|
6002
7025
|
* Render the range buttons. This only runs the first time, later the
|
|
@@ -6020,33 +7043,39 @@
|
|
|
6020
7043
|
this.buttonGroup = renderer.g('range-selector-buttons').add(this.group);
|
|
6021
7044
|
const dropdown = this.dropdown = createElement('select', void 0, {
|
|
6022
7045
|
position: 'absolute',
|
|
6023
|
-
width: '1px',
|
|
6024
|
-
height: '1px',
|
|
6025
7046
|
padding: 0,
|
|
6026
7047
|
border: 0,
|
|
6027
|
-
top: '-9999em',
|
|
6028
7048
|
cursor: 'pointer',
|
|
6029
7049
|
opacity: 0.0001
|
|
6030
7050
|
}, this.div);
|
|
7051
|
+
// Create a label for dropdown select element
|
|
7052
|
+
const userButtonTheme = chart.userOptions.rangeSelector?.buttonTheme;
|
|
7053
|
+
this.dropdownLabel = renderer.button('', 0, 0, () => { }, merge(buttonTheme, {
|
|
7054
|
+
'stroke-width': pick(buttonTheme['stroke-width'], 0),
|
|
7055
|
+
width: 'auto',
|
|
7056
|
+
paddingLeft: pick(options.buttonTheme.paddingLeft, userButtonTheme?.padding, 8),
|
|
7057
|
+
paddingRight: pick(options.buttonTheme.paddingRight, userButtonTheme?.padding, 8)
|
|
7058
|
+
}), states && states.hover, states && states.select, states && states.disabled)
|
|
7059
|
+
.hide()
|
|
7060
|
+
.add(this.group);
|
|
6031
7061
|
// Prevent page zoom on iPhone
|
|
6032
7062
|
addEvent(dropdown, 'touchstart', () => {
|
|
6033
7063
|
dropdown.style.fontSize = '16px';
|
|
6034
7064
|
});
|
|
6035
7065
|
// Forward events from select to button
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
});
|
|
7066
|
+
const mouseOver = H.isMS ? 'mouseover' : 'mouseenter', mouseOut = H.isMS ? 'mouseout' : 'mouseleave';
|
|
7067
|
+
addEvent(dropdown, mouseOver, () => {
|
|
7068
|
+
fireEvent(this.dropdownLabel.element, mouseOver);
|
|
7069
|
+
});
|
|
7070
|
+
addEvent(dropdown, mouseOut, () => {
|
|
7071
|
+
fireEvent(this.dropdownLabel.element, mouseOut);
|
|
7072
|
+
});
|
|
7073
|
+
addEvent(dropdown, 'change', () => {
|
|
7074
|
+
const button = this.buttons[dropdown.selectedIndex - 1];
|
|
7075
|
+
fireEvent(button.element, 'click');
|
|
6047
7076
|
});
|
|
6048
7077
|
this.zoomText = renderer
|
|
6049
|
-
.label(
|
|
7078
|
+
.label(lang.rangeSelectorZoom || '', 0)
|
|
6050
7079
|
.attr({
|
|
6051
7080
|
padding: options.buttonTheme.padding,
|
|
6052
7081
|
height: options.buttonTheme.height,
|
|
@@ -6138,10 +7167,13 @@
|
|
|
6138
7167
|
this.initialButtonGroupWidth = width;
|
|
6139
7168
|
}
|
|
6140
7169
|
plotLeft -= chart.spacing[3];
|
|
6141
|
-
this.updateButtonStates();
|
|
6142
7170
|
// Detect collision between button group and exporting
|
|
6143
7171
|
const xOffsetForExportButton = getXOffsetForExportButton(buttonGroup, buttonPosition);
|
|
6144
7172
|
this.alignButtonGroup(xOffsetForExportButton);
|
|
7173
|
+
if (this.buttonGroup?.translateY) {
|
|
7174
|
+
this.dropdownLabel
|
|
7175
|
+
.attr({ y: this.buttonGroup.translateY });
|
|
7176
|
+
}
|
|
6145
7177
|
// Skip animation
|
|
6146
7178
|
group.placed = buttonGroup.placed = chart.hasLoaded;
|
|
6147
7179
|
}
|
|
@@ -6311,7 +7343,7 @@
|
|
|
6311
7343
|
return buttonWidth;
|
|
6312
7344
|
};
|
|
6313
7345
|
const groupsOverlap = (buttonGroupWidth) => {
|
|
6314
|
-
if (inputGroup && buttonGroup) {
|
|
7346
|
+
if (inputGroup?.alignOptions && buttonGroup) {
|
|
6315
7347
|
const inputGroupX = (inputGroup.alignAttr.translateX +
|
|
6316
7348
|
inputGroup.alignOptions.x -
|
|
6317
7349
|
xOffsetForExportButton +
|
|
@@ -6319,7 +7351,7 @@
|
|
|
6319
7351
|
inputGroup.getBBox().x +
|
|
6320
7352
|
// 2px padding to not overlap input and label
|
|
6321
7353
|
2);
|
|
6322
|
-
const inputGroupWidth = inputGroup.alignOptions.width;
|
|
7354
|
+
const inputGroupWidth = inputGroup.alignOptions.width || 0;
|
|
6323
7355
|
const buttonGroupX = buttonGroup.alignAttr.translateX +
|
|
6324
7356
|
buttonGroup.getBBox().x;
|
|
6325
7357
|
return (buttonGroupX + buttonGroupWidth > inputGroupX) &&
|
|
@@ -6343,7 +7375,7 @@
|
|
|
6343
7375
|
};
|
|
6344
7376
|
if (buttonGroup) {
|
|
6345
7377
|
if (dropdown === 'always') {
|
|
6346
|
-
this.collapseButtons(
|
|
7378
|
+
this.collapseButtons();
|
|
6347
7379
|
if (groupsOverlap(maxButtonWidth())) {
|
|
6348
7380
|
// Move the inputs down if there is still a collision
|
|
6349
7381
|
// after collapsing the buttons
|
|
@@ -6361,7 +7393,7 @@
|
|
|
6361
7393
|
// 20 is minimal spacing between elements
|
|
6362
7394
|
groupsOverlap(this.initialButtonGroupWidth + 20)) {
|
|
6363
7395
|
if (dropdown === 'responsive') {
|
|
6364
|
-
this.collapseButtons(
|
|
7396
|
+
this.collapseButtons();
|
|
6365
7397
|
if (groupsOverlap(maxButtonWidth())) {
|
|
6366
7398
|
moveInputsDown();
|
|
6367
7399
|
}
|
|
@@ -6376,7 +7408,7 @@
|
|
|
6376
7408
|
}
|
|
6377
7409
|
else if (buttonGroup && dropdown === 'responsive') {
|
|
6378
7410
|
if (this.initialButtonGroupWidth > chart.plotWidth) {
|
|
6379
|
-
this.collapseButtons(
|
|
7411
|
+
this.collapseButtons();
|
|
6380
7412
|
}
|
|
6381
7413
|
else {
|
|
6382
7414
|
this.expandButtons();
|
|
@@ -6384,54 +7416,20 @@
|
|
|
6384
7416
|
}
|
|
6385
7417
|
}
|
|
6386
7418
|
/**
|
|
6387
|
-
* Collapse the buttons and
|
|
7419
|
+
* Collapse the buttons and show the select element.
|
|
6388
7420
|
*
|
|
6389
7421
|
* @private
|
|
6390
7422
|
* @function Highcharts.RangeSelector#collapseButtons
|
|
6391
7423
|
* @param {number} xOffsetForExportButton
|
|
6392
7424
|
*/
|
|
6393
|
-
collapseButtons(
|
|
6394
|
-
const { buttons,
|
|
6395
|
-
// If the buttons are already collapsed do nothing.
|
|
7425
|
+
collapseButtons() {
|
|
7426
|
+
const { buttons, zoomText } = this;
|
|
6396
7427
|
if (this.isCollapsed === true) {
|
|
6397
7428
|
return;
|
|
6398
7429
|
}
|
|
6399
7430
|
this.isCollapsed = true;
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
const getAttribs = (text) => ({
|
|
6403
|
-
text: text ? `${text} ▾` : '▾',
|
|
6404
|
-
width: 'auto',
|
|
6405
|
-
paddingLeft: pick(options.buttonTheme.paddingLeft, userButtonTheme.padding, 8),
|
|
6406
|
-
paddingRight: pick(options.buttonTheme.paddingRight, userButtonTheme.padding, 8)
|
|
6407
|
-
});
|
|
6408
|
-
if (zoomText) {
|
|
6409
|
-
zoomText.hide();
|
|
6410
|
-
}
|
|
6411
|
-
let hasActiveButton = false;
|
|
6412
|
-
buttonOptions.forEach((rangeOptions, i) => {
|
|
6413
|
-
const button = buttons[i];
|
|
6414
|
-
if (button.state !== 2) {
|
|
6415
|
-
button.hide();
|
|
6416
|
-
}
|
|
6417
|
-
else {
|
|
6418
|
-
button.show();
|
|
6419
|
-
button.attr(getAttribs(rangeOptions.text));
|
|
6420
|
-
hasActiveButton = true;
|
|
6421
|
-
}
|
|
6422
|
-
});
|
|
6423
|
-
if (!hasActiveButton) {
|
|
6424
|
-
if (dropdown) {
|
|
6425
|
-
dropdown.selectedIndex = 0;
|
|
6426
|
-
}
|
|
6427
|
-
buttons[0].show();
|
|
6428
|
-
buttons[0].attr(getAttribs(this.zoomText && this.zoomText.textStr));
|
|
6429
|
-
}
|
|
6430
|
-
const { align } = options.buttonPosition;
|
|
6431
|
-
this.positionButtons();
|
|
6432
|
-
if (align === 'right' || align === 'center') {
|
|
6433
|
-
this.alignButtonGroup(xOffsetForExportButton, buttons[this.currentButtonIndex()].getBBox().width);
|
|
6434
|
-
}
|
|
7431
|
+
zoomText.hide();
|
|
7432
|
+
buttons.forEach((button) => void button.hide());
|
|
6435
7433
|
this.showDropdown();
|
|
6436
7434
|
}
|
|
6437
7435
|
/**
|
|
@@ -6441,44 +7439,16 @@
|
|
|
6441
7439
|
* @function Highcharts.RangeSelector#expandButtons
|
|
6442
7440
|
*/
|
|
6443
7441
|
expandButtons() {
|
|
6444
|
-
const { buttons,
|
|
6445
|
-
this.hideDropdown();
|
|
6446
|
-
// If buttons are already not collapsed, do nothing.
|
|
7442
|
+
const { buttons, zoomText } = this;
|
|
6447
7443
|
if (this.isCollapsed === false) {
|
|
6448
7444
|
return;
|
|
6449
7445
|
}
|
|
6450
7446
|
this.isCollapsed = false;
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
buttonOptions.forEach((rangeOptions, i) => {
|
|
6455
|
-
const button = buttons[i];
|
|
6456
|
-
button.show();
|
|
6457
|
-
button.attr({
|
|
6458
|
-
text: rangeOptions.text,
|
|
6459
|
-
width: options.buttonTheme.width || 28,
|
|
6460
|
-
paddingLeft: pick(options.buttonTheme.paddingLeft, 'unset'),
|
|
6461
|
-
paddingRight: pick(options.buttonTheme.paddingRight, 'unset')
|
|
6462
|
-
});
|
|
6463
|
-
if (button.state < 2) {
|
|
6464
|
-
button.setState(0);
|
|
6465
|
-
}
|
|
6466
|
-
});
|
|
7447
|
+
this.hideDropdown();
|
|
7448
|
+
zoomText.show();
|
|
7449
|
+
buttons.forEach((button) => void button.show());
|
|
6467
7450
|
this.positionButtons();
|
|
6468
7451
|
}
|
|
6469
|
-
/**
|
|
6470
|
-
* Get the index of the visible button when the buttons are collapsed.
|
|
6471
|
-
*
|
|
6472
|
-
* @private
|
|
6473
|
-
* @function Highcharts.RangeSelector#currentButtonIndex
|
|
6474
|
-
*/
|
|
6475
|
-
currentButtonIndex() {
|
|
6476
|
-
const { dropdown } = this;
|
|
6477
|
-
if (dropdown && dropdown.selectedIndex > 0) {
|
|
6478
|
-
return dropdown.selectedIndex - 1;
|
|
6479
|
-
}
|
|
6480
|
-
return 0;
|
|
6481
|
-
}
|
|
6482
7452
|
/**
|
|
6483
7453
|
* Position the select element on top of the button.
|
|
6484
7454
|
*
|
|
@@ -6486,14 +7456,16 @@
|
|
|
6486
7456
|
* @function Highcharts.RangeSelector#showDropdown
|
|
6487
7457
|
*/
|
|
6488
7458
|
showDropdown() {
|
|
6489
|
-
const { buttonGroup,
|
|
7459
|
+
const { buttonGroup, chart, dropdownLabel, dropdown } = this;
|
|
6490
7460
|
if (buttonGroup && dropdown) {
|
|
6491
|
-
const { translateX = 0, translateY = 0 } = buttonGroup,
|
|
7461
|
+
const { translateX = 0, translateY = 0 } = buttonGroup, left = chart.plotLeft + translateX, top = translateY;
|
|
7462
|
+
dropdownLabel
|
|
7463
|
+
.attr({ x: left, y: top })
|
|
7464
|
+
.show();
|
|
6492
7465
|
css(dropdown, {
|
|
6493
|
-
left:
|
|
6494
|
-
top:
|
|
6495
|
-
|
|
6496
|
-
height: bBox.height + 'px'
|
|
7466
|
+
left: left + 'px',
|
|
7467
|
+
top: top + 'px',
|
|
7468
|
+
visibility: 'inherit'
|
|
6497
7469
|
});
|
|
6498
7470
|
this.hasVisibleDropdown = true;
|
|
6499
7471
|
}
|
|
@@ -6505,8 +7477,9 @@
|
|
|
6505
7477
|
hideDropdown() {
|
|
6506
7478
|
const { dropdown } = this;
|
|
6507
7479
|
if (dropdown) {
|
|
7480
|
+
this.dropdownLabel.hide();
|
|
6508
7481
|
css(dropdown, {
|
|
6509
|
-
|
|
7482
|
+
visibility: 'hidden',
|
|
6510
7483
|
width: '1px',
|
|
6511
7484
|
height: '1px'
|
|
6512
7485
|
});
|
|
@@ -6561,12 +7534,14 @@
|
|
|
6561
7534
|
* @function Highcharts.RangeSelector#update
|
|
6562
7535
|
* @param {Highcharts.RangeSelectorOptions} options
|
|
6563
7536
|
*/
|
|
6564
|
-
update(options) {
|
|
7537
|
+
update(options, redraw = true) {
|
|
6565
7538
|
const chart = this.chart;
|
|
6566
7539
|
merge(true, chart.options.rangeSelector, options);
|
|
6567
7540
|
this.destroy();
|
|
6568
7541
|
this.init(chart);
|
|
6569
|
-
|
|
7542
|
+
if (redraw) {
|
|
7543
|
+
this.render();
|
|
7544
|
+
}
|
|
6570
7545
|
}
|
|
6571
7546
|
/**
|
|
6572
7547
|
* Destroys allocated elements.
|
|
@@ -8981,7 +9956,7 @@
|
|
|
8981
9956
|
const { composed, noop } = H;
|
|
8982
9957
|
const { parse: color } = Color;
|
|
8983
9958
|
const { column: ColumnSeries } = SeriesRegistry.seriesTypes;
|
|
8984
|
-
const { addEvent, clamp, defined, extend, find, isNumber, isObject, merge, pick, pushUnique, relativeLength } = U;
|
|
9959
|
+
const { addEvent, clamp, crisp, defined, extend, find, isNumber, isObject, merge, pick, pushUnique, relativeLength } = U;
|
|
8985
9960
|
/* *
|
|
8986
9961
|
*
|
|
8987
9962
|
* Functions
|
|
@@ -9128,7 +10103,7 @@
|
|
|
9128
10103
|
translatePoint(point) {
|
|
9129
10104
|
const xAxis = this.xAxis, yAxis = this.yAxis, metrics = this.columnMetrics, options = this.options, minPointLength = options.minPointLength || 0, oldColWidth = (point.shapeArgs && point.shapeArgs.width || 0) / 2, seriesXOffset = this.pointXOffset = metrics.offset, posX = pick(point.x2, point.x + (point.len || 0)), borderRadius = options.borderRadius, plotTop = this.chart.plotTop, plotLeft = this.chart.plotLeft;
|
|
9130
10105
|
let plotX = point.plotX, plotX2 = xAxis.translate(posX, 0, 0, 0, 1);
|
|
9131
|
-
const length = Math.abs(plotX2 - plotX), inverted = this.chart.inverted, borderWidth = pick(options.borderWidth, 1)
|
|
10106
|
+
const length = Math.abs(plotX2 - plotX), inverted = this.chart.inverted, borderWidth = pick(options.borderWidth, 1);
|
|
9132
10107
|
let widthDifference, partialFill, yOffset = metrics.offset, pointHeight = Math.round(metrics.width), dlLeft, dlRight, dlWidth, clipRectWidth;
|
|
9133
10108
|
if (minPointLength) {
|
|
9134
10109
|
widthDifference = minPointLength - length;
|
|
@@ -9151,13 +10126,13 @@
|
|
|
9151
10126
|
yAxis.categories) {
|
|
9152
10127
|
point.plotY = yAxis.translate(point.y, 0, 1, 0, 1, options.pointPlacement);
|
|
9153
10128
|
}
|
|
9154
|
-
const x =
|
|
10129
|
+
const x = crisp(Math.min(plotX, plotX2), borderWidth), x2 = crisp(Math.max(plotX, plotX2), borderWidth), width = x2 - x;
|
|
9155
10130
|
const r = Math.min(relativeLength((typeof borderRadius === 'object' ?
|
|
9156
10131
|
borderRadius.radius :
|
|
9157
10132
|
borderRadius || 0), pointHeight), Math.min(width, pointHeight) / 2);
|
|
9158
10133
|
const shapeArgs = {
|
|
9159
10134
|
x,
|
|
9160
|
-
y:
|
|
10135
|
+
y: crisp((point.plotY || 0) + yOffset, borderWidth),
|
|
9161
10136
|
width,
|
|
9162
10137
|
height: pointHeight,
|
|
9163
10138
|
r
|
|
@@ -10601,7 +11576,7 @@
|
|
|
10601
11576
|
const linePath = axis.getLinePath(lineWidth), startPoint = linePath[0], endPoint = linePath[1],
|
|
10602
11577
|
// Negate distance if top or left axis
|
|
10603
11578
|
// Subtract 1px to draw the line at the end of the tick
|
|
10604
|
-
tickLength = (axis.tickSize('tick') || [1])[0], distance =
|
|
11579
|
+
tickLength = (axis.tickSize('tick') || [1])[0], distance = tickLength * ((axis.side === GridAxisSide.top ||
|
|
10605
11580
|
axis.side === GridAxisSide.left) ? -1 : 1);
|
|
10606
11581
|
// If axis is horizontal, reposition line path vertically
|
|
10607
11582
|
if (startPoint[0] === 'M' && endPoint[0] === 'L') {
|