highcharts 9.2.2 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/bower.json +1 -1
- package/css/annotations/popup.css +48 -8
- package/css/annotations/popup.scss +70 -22
- package/css/highcharts.css +45 -0
- package/css/highcharts.scss +40 -0
- package/css/themes/dark-unica.css +45 -0
- package/css/themes/grid-light.css +45 -0
- package/css/themes/sand-signika.css +45 -0
- package/es-modules/Accessibility/A11yI18n.js +273 -224
- package/es-modules/Accessibility/Accessibility.js +233 -128
- package/es-modules/Accessibility/AccessibilityComponent.js +79 -314
- package/es-modules/Accessibility/Components/AnnotationsA11y.js +10 -0
- package/es-modules/Accessibility/Components/ContainerComponent.js +52 -27
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +46 -23
- package/es-modules/Accessibility/Components/LegendComponent.js +97 -65
- package/es-modules/Accessibility/Components/MenuComponent.js +59 -40
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +5 -8
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +152 -115
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +133 -68
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +64 -27
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +38 -21
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +380 -325
- package/es-modules/Accessibility/Components/ZoomComponent.js +28 -20
- package/es-modules/Accessibility/FocusBorder.js +192 -147
- package/es-modules/Accessibility/HighContrastMode.js +78 -66
- package/es-modules/Accessibility/HighContrastTheme.js +10 -0
- package/es-modules/Accessibility/KeyboardNavigation.js +144 -70
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +71 -44
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +11 -1
- package/es-modules/Accessibility/Options/LangOptions.js +1 -2
- package/es-modules/Accessibility/Options/Options.js +32 -17
- package/es-modules/Accessibility/ProxyElement.js +212 -0
- package/es-modules/Accessibility/ProxyProvider.js +305 -0
- package/es-modules/Accessibility/Utils/Announcer.js +15 -8
- package/es-modules/Accessibility/Utils/ChartUtilities.js +41 -16
- package/es-modules/Accessibility/Utils/DOMElementProvider.js +27 -15
- package/es-modules/Accessibility/Utils/EventProvider.js +27 -17
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +125 -30
- package/es-modules/Core/Axis/Axis.js +37 -30
- package/es-modules/Core/Axis/AxisDefaults.js +35 -24
- package/es-modules/Core/Axis/Color/ColorAxisComposition.js +54 -4
- package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +5 -5
- package/es-modules/Core/Axis/OrdinalAxis.js +8 -12
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +4 -5
- package/es-modules/Core/Axis/ScrollbarAxis.js +10 -3
- package/es-modules/Core/Axis/TreeGridAxis.js +2 -2
- package/es-modules/Core/Axis/TreeGridTick.js +1 -2
- package/es-modules/Core/Chart/Chart.js +2 -3
- package/es-modules/Core/Chart/ChartDefaults.js +3 -4
- package/es-modules/Core/Chart/ChartNavigationComposition.js +92 -0
- package/es-modules/Core/Chart/MapChart.js +10 -22
- package/es-modules/Core/Chart/StockChart.js +3 -293
- package/es-modules/Core/Color/Palettes.js +22 -0
- package/es-modules/Core/DefaultOptions.js +19 -17
- package/es-modules/Core/Foundation.js +39 -31
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/HttpUtilities.js +3 -3
- package/es-modules/Core/Legend/Legend.js +7 -3
- package/es-modules/Core/Navigator.js +7 -8
- package/es-modules/Core/Pointer.js +39 -36
- package/es-modules/Core/Renderer/HTML/AST.js +2 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +23 -18
- package/es-modules/Core/Renderer/SVG/SVGElement.js +3 -4
- package/es-modules/Core/Renderer/SVG/SVGRenderer.js +21 -18
- package/es-modules/Core/Renderer/SVG/TextBuilder.js +3 -3
- package/es-modules/Core/ScrollbarDefaults.js +10 -9
- package/es-modules/Core/Series/DataLabel.js +2 -3
- package/es-modules/Core/Series/Point.js +5 -3
- package/es-modules/Core/Series/Series.js +153 -162
- package/es-modules/Core/Series/SeriesDefaults.js +3 -4
- package/es-modules/Core/Series/SeriesRegistry.js +1 -2
- package/es-modules/Core/Tooltip.js +44 -17
- package/es-modules/Core/Utilities.js +15 -7
- package/es-modules/Data/DataConverter.js +489 -0
- package/es-modules/Data/DataPromise.js +252 -0
- package/es-modules/Data/DataSeriesConverter.js +203 -0
- package/es-modules/Data/DataTable.js +1204 -0
- package/es-modules/Data/Modifiers/ChainModifier.js +299 -0
- package/es-modules/Data/Modifiers/DataModifier.js +303 -0
- package/es-modules/Data/Modifiers/GroupModifier.js +144 -0
- package/es-modules/Data/Modifiers/InvertModifier.js +254 -0
- package/es-modules/Data/Modifiers/RangeModifier.js +143 -0
- package/es-modules/Data/Modifiers/SeriesPointsModifier.js +110 -0
- package/es-modules/Data/Modifiers/SortModifier.js +249 -0
- package/es-modules/Data/Parsers/CSVParser.js +399 -0
- package/es-modules/Data/Parsers/DataParser.js +101 -0
- package/es-modules/Data/Parsers/GoogleSheetsParser.js +220 -0
- package/es-modules/Data/Parsers/HTMLTableParser.js +213 -0
- package/es-modules/Data/Stores/CSVStore.js +317 -0
- package/es-modules/Data/Stores/DataStore.js +276 -0
- package/es-modules/Data/Stores/GoogleSheetsStore.js +167 -0
- package/es-modules/Data/Stores/HTMLTableStore.js +351 -0
- package/es-modules/Extensions/Annotations/Annotations.js +61 -11
- package/es-modules/Extensions/Annotations/ControlPoint.js +1 -1
- package/es-modules/Extensions/Annotations/Controllables/ControllableEllipse.js +199 -0
- package/es-modules/Extensions/Annotations/Mixins/ControllableMixin.js +7 -1
- package/es-modules/Extensions/Annotations/NavigationBindings.js +68 -19
- package/es-modules/Extensions/Annotations/Popup.js +479 -141
- package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +51 -2
- package/es-modules/Extensions/Annotations/Types/CrookedLine.js +1 -1
- package/es-modules/Extensions/Annotations/Types/Fibonacci.js +2 -3
- package/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +219 -0
- package/es-modules/Extensions/Annotations/Types/InfinityLine.js +1 -1
- package/es-modules/Extensions/Annotations/Types/Measure.js +14 -8
- package/es-modules/Extensions/Annotations/Types/Pitchfork.js +5 -5
- package/es-modules/Extensions/Annotations/Types/TimeCycles.js +207 -0
- package/es-modules/Extensions/Annotations/Types/Tunnel.js +3 -5
- package/es-modules/Extensions/Annotations/Types/VerticalLine.js +1 -1
- package/es-modules/Extensions/Boost/BoostOverrides.js +3 -1
- package/es-modules/Extensions/Boost/WGLShader.js +4 -3
- package/es-modules/Extensions/BoostCanvas.js +1 -2
- package/es-modules/Extensions/CurrentDateIndication.js +2 -3
- package/es-modules/Extensions/DataGrouping.js +31 -18
- package/es-modules/Extensions/DownloadURL.js +2 -2
- package/es-modules/Extensions/DragPanes.js +1 -2
- package/es-modules/Extensions/Drilldown.js +2 -3
- package/es-modules/Extensions/Exporting/Exporting.js +8 -7
- package/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -15
- package/es-modules/Extensions/GeoJSON.js +39 -63
- package/es-modules/Extensions/MarkerClusters.js +115 -97
- package/es-modules/Extensions/NoDataToDisplay.js +1 -2
- package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +9 -8
- package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
- package/es-modules/Extensions/Oldie/Oldie.js +2 -3
- package/es-modules/Extensions/Pane.js +5 -6
- package/es-modules/Extensions/RangeSelector.js +3 -4
- package/es-modules/Extensions/Sonification/ChartSonify.js +247 -637
- package/es-modules/Extensions/Sonification/Earcon.js +136 -102
- package/es-modules/Extensions/Sonification/Instrument.js +496 -426
- package/es-modules/Extensions/Sonification/MusicalFrequencies.js +10 -0
- package/es-modules/Extensions/Sonification/Options.js +10 -0
- package/es-modules/Extensions/Sonification/PointSonify.js +203 -152
- package/es-modules/Extensions/Sonification/SeriesSonify.js +459 -0
- package/es-modules/Extensions/Sonification/SignalHandler.js +124 -0
- package/es-modules/Extensions/Sonification/Sonification.js +26 -52
- package/es-modules/Extensions/Sonification/{Utilities.js → SonificationUtilities.js} +62 -84
- package/es-modules/Extensions/Sonification/Timeline.js +255 -567
- package/es-modules/Extensions/Sonification/TimelineEvent.js +158 -0
- package/es-modules/Extensions/Sonification/TimelinePath.js +311 -0
- package/es-modules/Maps/MapNavigation.js +27 -64
- package/es-modules/Maps/MapNavigationOptionsDefault.js +3 -0
- package/es-modules/Maps/MapPointer.js +7 -5
- package/es-modules/Maps/MapView.js +450 -0
- package/es-modules/Maps/MapViewOptionsDefault.js +95 -0
- package/es-modules/Maps/Projection.js +433 -0
- package/es-modules/Maps/ProjectionDefinition.js +9 -0
- package/es-modules/Maps/Projections/EqualEarth.js +42 -0
- package/es-modules/Maps/Projections/Miller.js +17 -0
- package/es-modules/Maps/Projections/Orthographic.js +26 -0
- package/es-modules/Maps/Projections/ProjectionRegistry.js +17 -0
- package/es-modules/Maps/Projections/WebMercator.js +25 -0
- package/es-modules/Series/AreaRange/AreaRangeSeries.js +4 -5
- package/es-modules/Series/Bellcurve/BellcurveSeries.js +2 -8
- package/es-modules/Series/BoxPlot/BoxPlotSeries.js +1 -2
- package/es-modules/Series/Bubble/BubbleLegendDefaults.js +1 -2
- package/es-modules/Series/Bubble/BubbleLegendItem.js +3 -3
- package/es-modules/Series/Bubble/BubblePoint.js +5 -0
- package/es-modules/Series/Bubble/BubbleSeries.js +90 -50
- package/es-modules/Series/Candlestick/CandlestickSeries.js +10 -18
- package/es-modules/{Mixins/CenteredSeries.js → Series/CenteredUtilities.js} +45 -23
- package/es-modules/Series/ColorMapComposition.js +109 -0
- package/es-modules/Series/Column/ColumnDataLabel.js +5 -5
- package/es-modules/Series/Column/ColumnSeries.js +3 -4
- package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +6 -6
- package/es-modules/Series/DataModifyComposition.js +539 -0
- package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +2 -6
- package/es-modules/Series/DerivedComposition.js +137 -0
- package/es-modules/Series/DrawPointComposition.js +111 -0
- package/es-modules/Series/Dumbbell/DumbbellSeries.js +2 -3
- package/es-modules/Series/ErrorBar/ErrorBarSeries.js +1 -2
- package/es-modules/Series/Flags/FlagsSeries.js +18 -25
- package/es-modules/Series/Funnel/FunnelSeries.js +6 -5
- package/es-modules/Series/Gantt/GanttSeries.js +0 -2
- package/es-modules/Series/Gauge/GaugePoint.js +1 -1
- package/es-modules/Series/Gauge/GaugeSeries.js +7 -7
- package/es-modules/Series/HLC/HLCPoint.js +55 -0
- package/es-modules/Series/HLC/HLCSeries.js +383 -0
- package/es-modules/Series/Heatmap/HeatmapPoint.js +3 -4
- package/es-modules/Series/Heatmap/HeatmapSeries.js +19 -6
- package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +2 -3
- package/es-modules/Series/Histogram/HistogramSeries.js +3 -7
- package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +9 -10
- package/es-modules/Series/Line/LineSeries.js +1 -2
- package/es-modules/Series/Map/MapPoint.js +23 -16
- package/es-modules/Series/Map/MapSeries.js +268 -309
- package/es-modules/Series/MapBubble/MapBubblePoint.js +0 -3
- package/es-modules/Series/MapBubble/MapBubbleSeries.js +10 -1
- package/es-modules/Series/MapPoint/MapPointPoint.js +5 -1
- package/es-modules/Series/MapPoint/MapPointSeries.js +87 -4
- package/es-modules/Series/Networkgraph/Networkgraph.js +5 -5
- package/es-modules/{Mixins/Nodes.js → Series/NodesComposition.js} +76 -29
- package/es-modules/Series/OHLC/OHLCPoint.js +2 -6
- package/es-modules/Series/OHLC/OHLCSeries.js +55 -183
- package/es-modules/{Mixins/OnSeries.js → Series/OnSeriesComposition.js} +53 -21
- package/es-modules/Series/Organization/OrganizationSeries.js +2 -3
- package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +46 -6
- package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -7
- package/es-modules/Series/Pie/PieDataLabel.js +1 -2
- package/es-modules/Series/Pie/PieSeries.js +6 -7
- package/es-modules/Series/Sankey/SankeyPoint.js +0 -4
- package/es-modules/Series/Sankey/SankeySeries.js +89 -20
- package/es-modules/Series/Sunburst/SunburstPoint.js +2 -3
- package/es-modules/Series/Sunburst/SunburstSeries.js +4 -4
- package/es-modules/Series/Tilemap/TilemapPoint.js +2 -3
- package/es-modules/Series/Timeline/TimelineSeries.js +3 -4
- package/es-modules/{Mixins/TreeSeries.js → Series/TreeUtilities.js} +86 -76
- package/es-modules/Series/Treemap/TreemapPoint.js +2 -2
- package/es-modules/Series/Treemap/TreemapSeries.js +8 -8
- package/es-modules/Series/Venn/VennPoint.js +16 -7
- package/es-modules/Series/Venn/VennSeries.js +5 -8
- package/es-modules/Series/Venn/VennUtils.js +550 -439
- package/es-modules/Series/Waterfall/WaterfallSeries.js +2 -3
- package/es-modules/Series/Windbarb/WindbarbSeries.js +23 -24
- package/es-modules/Series/Wordcloud/WordcloudPoint.js +8 -6
- package/es-modules/Series/Wordcloud/WordcloudSeries.js +24 -20
- package/es-modules/Series/Wordcloud/WordcloudUtils.js +673 -484
- package/es-modules/Series/XRange/XRangePoint.js +1 -0
- package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +3 -6
- package/es-modules/Stock/Indicators/AO/AOIndicator.js +2 -3
- package/es-modules/Stock/Indicators/APO/APOIndicator.js +14 -20
- package/es-modules/Stock/Indicators/Aroon/AroonIndicator.js +3 -6
- package/es-modules/Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js +11 -13
- package/es-modules/Stock/Indicators/ArrayUtilities.js +47 -0
- package/es-modules/Stock/Indicators/BB/BBIndicator.js +27 -11
- package/es-modules/Stock/Indicators/Chaikin/ChaikinIndicator.js +6 -12
- package/es-modules/Stock/Indicators/DEMA/DEMAIndicator.js +1 -11
- package/es-modules/Stock/Indicators/DMI/DMIIndicator.js +19 -11
- package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +17 -11
- package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +1 -3
- package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +11 -9
- package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +8 -16
- package/es-modules/Stock/Indicators/LinearRegression/LinearRegression.js +2 -2
- package/es-modules/Stock/Indicators/LinearRegressionAngle/LinearRegressionAngle.js +2 -2
- package/es-modules/Stock/Indicators/LinearRegressionIntercept/LinearRegressionIntercept.js +2 -2
- package/es-modules/Stock/Indicators/LinearRegressionSlopes/LinearRegressionSlopes.js +2 -2
- package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +1 -2
- package/es-modules/{Mixins/MultipleLines.js → Stock/Indicators/MultipleLinesComposition.js} +136 -87
- package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +1 -3
- package/es-modules/Stock/Indicators/PC/PCIndicator.js +14 -13
- package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +1 -11
- package/es-modules/Stock/Indicators/SMA/SMAComposition.js +0 -26
- package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +9 -32
- package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +0 -8
- package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +15 -8
- package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +4 -6
- package/es-modules/Stock/Indicators/TEMA/TEMAIndicator.js +26 -11
- package/es-modules/Stock/Indicators/TRIX/TRIXIndicator.js +6 -12
- package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +20 -3
- package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +2 -3
- package/es-modules/Stock/StockToolsBindings.js +144 -42
- package/es-modules/Stock/StockToolsGui.js +405 -11
- package/es-modules/masters/highcharts-3d.src.js +1 -1
- package/es-modules/masters/highcharts-gantt.src.js +1 -1
- package/es-modules/masters/highcharts-more.src.js +1 -1
- package/es-modules/masters/highcharts.src.js +1 -1
- package/es-modules/masters/highmaps.src.js +1 -1
- package/es-modules/masters/highstock.src.js +1 -1
- package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
- package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
- package/es-modules/masters/indicators/ao.src.js +1 -1
- package/es-modules/masters/indicators/apo.src.js +1 -1
- package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
- package/es-modules/masters/indicators/aroon.src.js +1 -1
- package/es-modules/masters/indicators/atr.src.js +1 -1
- package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
- package/es-modules/masters/indicators/cci.src.js +1 -1
- package/es-modules/masters/indicators/chaikin.src.js +1 -1
- package/es-modules/masters/indicators/cmf.src.js +1 -1
- package/es-modules/masters/indicators/cmo.src.js +1 -1
- package/es-modules/masters/indicators/dema.src.js +1 -1
- package/es-modules/masters/indicators/disparity-index.src.js +1 -1
- package/es-modules/masters/indicators/dmi.src.js +1 -1
- package/es-modules/masters/indicators/dpo.src.js +1 -1
- package/es-modules/masters/indicators/ema.src.js +4 -10
- package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/es-modules/masters/indicators/indicators-all.src.js +2 -2
- package/es-modules/masters/indicators/indicators.src.js +2 -1
- package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
- package/es-modules/masters/indicators/klinger.src.js +1 -1
- package/es-modules/masters/indicators/macd.src.js +1 -1
- package/es-modules/masters/indicators/mfi.src.js +1 -1
- package/es-modules/masters/indicators/momentum.src.js +1 -1
- package/es-modules/masters/indicators/natr.src.js +1 -1
- package/es-modules/masters/indicators/obv.src.js +1 -1
- package/es-modules/masters/indicators/pivot-points.src.js +1 -1
- package/es-modules/masters/indicators/ppo.src.js +1 -1
- package/es-modules/masters/indicators/price-channel.src.js +1 -1
- package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
- package/es-modules/masters/indicators/psar.src.js +1 -1
- package/es-modules/masters/indicators/regressions.src.js +1 -1
- package/es-modules/masters/indicators/roc.src.js +1 -1
- package/es-modules/masters/indicators/rsi.src.js +1 -1
- package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
- package/es-modules/masters/indicators/stochastic.src.js +1 -1
- package/es-modules/masters/indicators/supertrend.src.js +1 -1
- package/es-modules/masters/indicators/tema.src.js +1 -1
- package/es-modules/masters/indicators/trendline.src.js +1 -1
- package/es-modules/masters/indicators/trix.src.js +1 -1
- package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
- package/es-modules/masters/indicators/vwap.src.js +1 -1
- package/es-modules/masters/indicators/williams-r.src.js +1 -1
- package/es-modules/masters/indicators/wma.src.js +1 -1
- package/es-modules/masters/indicators/zigzag.src.js +1 -1
- package/es-modules/masters/modules/accessibility.src.js +16 -2
- package/es-modules/masters/modules/annotations-advanced.src.js +3 -1
- package/es-modules/masters/modules/annotations.src.js +1 -1
- package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
- package/es-modules/masters/modules/boost-canvas.src.js +1 -1
- package/es-modules/masters/modules/boost.src.js +1 -1
- package/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/es-modules/masters/modules/bullet.src.js +1 -1
- package/es-modules/masters/modules/coloraxis.src.js +1 -1
- package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
- package/es-modules/masters/modules/cylinder.src.js +1 -1
- package/es-modules/masters/modules/data.src.js +6 -3
- package/es-modules/masters/modules/datagrouping.src.js +1 -1
- package/es-modules/masters/modules/debugger.src.js +1 -1
- package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
- package/es-modules/masters/modules/dotplot.src.js +1 -1
- package/es-modules/masters/modules/drag-panes.src.js +1 -1
- package/es-modules/masters/modules/draggable-points.src.js +1 -1
- package/es-modules/masters/modules/drilldown.src.js +1 -1
- package/es-modules/masters/modules/dumbbell.src.js +1 -1
- package/es-modules/masters/modules/export-data.src.js +1 -1
- package/es-modules/masters/modules/exporting.src.js +1 -1
- package/es-modules/masters/modules/full-screen.src.js +1 -1
- package/es-modules/masters/modules/funnel.src.js +1 -1
- package/es-modules/masters/modules/funnel3d.src.js +1 -1
- package/es-modules/masters/modules/gantt.src.js +1 -1
- package/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/es-modules/masters/modules/heatmap.src.js +1 -2
- package/es-modules/masters/modules/heikinashi.src.js +1 -1
- package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
- package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
- package/es-modules/masters/modules/item-series.src.js +1 -1
- package/es-modules/masters/modules/lollipop.src.js +1 -1
- package/es-modules/masters/modules/map.src.js +1 -3
- package/es-modules/masters/modules/marker-clusters.src.js +1 -1
- package/es-modules/masters/modules/networkgraph.src.js +1 -1
- package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
- package/es-modules/masters/modules/offline-exporting.src.js +1 -1
- package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
- package/es-modules/masters/modules/oldie.src.js +1 -1
- package/es-modules/masters/modules/organization.src.js +1 -1
- package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
- package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
- package/es-modules/masters/modules/pareto.src.js +1 -1
- package/es-modules/masters/modules/pathfinder.src.js +1 -1
- package/es-modules/masters/modules/pattern-fill.src.js +1 -1
- package/es-modules/masters/modules/price-indicator.src.js +1 -1
- package/es-modules/masters/modules/pyramid3d.src.js +1 -1
- package/es-modules/masters/modules/sankey.src.js +1 -1
- package/es-modules/masters/modules/series-label.src.js +1 -1
- package/es-modules/masters/modules/solid-gauge.src.js +1 -1
- package/es-modules/masters/modules/sonification.src.js +33 -2
- package/es-modules/masters/modules/static-scale.src.js +1 -1
- package/es-modules/masters/modules/stock-tools.src.js +1 -1
- package/es-modules/masters/modules/stock.src.js +4 -1
- package/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/es-modules/masters/modules/sunburst.src.js +1 -1
- package/es-modules/masters/modules/tilemap.src.js +1 -1
- package/es-modules/masters/modules/timeline.src.js +1 -1
- package/es-modules/masters/modules/treegrid.src.js +1 -1
- package/es-modules/masters/modules/treemap.src.js +1 -1
- package/es-modules/masters/modules/variable-pie.src.js +1 -1
- package/es-modules/masters/modules/variwide.src.js +1 -1
- package/es-modules/masters/modules/vector.src.js +1 -1
- package/es-modules/masters/modules/venn.src.js +1 -1
- package/es-modules/masters/modules/windbarb.src.js +1 -1
- package/es-modules/masters/modules/wordcloud.src.js +1 -1
- package/es-modules/masters/modules/xrange.src.js +1 -1
- package/es-modules/masters/themes/avocado.src.js +1 -1
- package/es-modules/masters/themes/dark-blue.src.js +1 -1
- package/es-modules/masters/themes/dark-green.src.js +1 -1
- package/es-modules/masters/themes/dark-unica.src.js +1 -1
- package/es-modules/masters/themes/gray.src.js +1 -1
- package/es-modules/masters/themes/grid-light.src.js +1 -1
- package/es-modules/masters/themes/grid.src.js +1 -1
- package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
- package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
- package/es-modules/masters/themes/sand-signika.src.js +1 -1
- package/es-modules/masters/themes/skies.src.js +1 -1
- package/es-modules/masters/themes/sunset.src.js +1 -1
- package/highcharts-3d.js +1 -1
- package/highcharts-3d.src.js +1 -1
- package/highcharts-gantt.js +801 -804
- package/highcharts-gantt.js.map +1 -1
- package/highcharts-gantt.src.js +775 -739
- package/highcharts-more.js +194 -193
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.js +207 -119
- package/highcharts.d.ts +9670 -4217
- package/highcharts.js +585 -588
- package/highcharts.js.map +1 -1
- package/highcharts.src.d.ts +9670 -4217
- package/highcharts.src.js +608 -587
- package/highmaps.js +726 -708
- package/highmaps.js.map +1 -1
- package/highmaps.src.js +2708 -1587
- package/highstock.js +788 -783
- package/highstock.js.map +1 -1
- package/highstock.src.js +1896 -1267
- package/indicators/acceleration-bands.js +10 -9
- package/indicators/acceleration-bands.js.map +1 -1
- package/indicators/acceleration-bands.src.js +156 -112
- package/indicators/accumulation-distribution.js +1 -1
- package/indicators/accumulation-distribution.src.js +1 -1
- package/indicators/ao.js +6 -6
- package/indicators/ao.js.map +1 -1
- package/indicators/ao.src.js +4 -4
- package/indicators/apo.js +5 -6
- package/indicators/apo.js.map +1 -1
- package/indicators/apo.src.js +16 -84
- package/indicators/aroon-oscillator.js +9 -9
- package/indicators/aroon-oscillator.js.map +1 -1
- package/indicators/aroon-oscillator.src.js +160 -177
- package/indicators/aroon.js +9 -9
- package/indicators/aroon.js.map +1 -1
- package/indicators/aroon.src.js +156 -112
- package/indicators/atr.js +1 -1
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.js +10 -9
- package/indicators/bollinger-bands.js.map +1 -1
- package/indicators/bollinger-bands.src.js +180 -117
- package/indicators/cci.js +1 -1
- package/indicators/cci.src.js +1 -1
- package/indicators/chaikin.js +8 -9
- package/indicators/chaikin.js.map +1 -1
- package/indicators/chaikin.src.js +8 -76
- package/indicators/cmf.js +1 -1
- package/indicators/cmf.src.js +1 -1
- package/indicators/cmo.js +1 -1
- package/indicators/cmo.src.js +1 -1
- package/indicators/dema.js +5 -6
- package/indicators/dema.js.map +1 -1
- package/indicators/dema.src.js +3 -75
- package/indicators/disparity-index.js +6 -7
- package/indicators/disparity-index.js.map +1 -1
- package/indicators/disparity-index.src.js +19 -74
- package/indicators/dmi.js +11 -11
- package/indicators/dmi.js.map +1 -1
- package/indicators/dmi.src.js +173 -116
- package/indicators/dpo.js +1 -1
- package/indicators/dpo.src.js +1 -1
- package/indicators/ema.js +1 -13
- package/indicators/ema.js.map +1 -1
- package/indicators/ema.src.js +7 -188
- package/indicators/ichimoku-kinko-hyo.js +1 -1
- package/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/indicators/indicators-all.js +197 -203
- package/indicators/indicators-all.js.map +1 -1
- package/indicators/indicators-all.src.js +649 -720
- package/indicators/indicators.js +12 -12
- package/indicators/indicators.js.map +1 -1
- package/indicators/indicators.src.js +188 -124
- package/indicators/keltner-channels.js +10 -10
- package/indicators/keltner-channels.js.map +1 -1
- package/indicators/keltner-channels.src.js +164 -118
- package/indicators/klinger.js +12 -13
- package/indicators/klinger.js.map +1 -1
- package/indicators/klinger.src.js +161 -184
- package/indicators/macd.js +2 -2
- package/indicators/macd.js.map +1 -1
- package/indicators/macd.src.js +2 -3
- package/indicators/mfi.js +1 -1
- package/indicators/mfi.src.js +1 -1
- package/indicators/momentum.js +1 -1
- package/indicators/momentum.src.js +1 -1
- package/indicators/natr.js +3 -3
- package/indicators/natr.js.map +1 -1
- package/indicators/natr.src.js +2 -4
- package/indicators/obv.js +1 -1
- package/indicators/obv.src.js +1 -1
- package/indicators/pivot-points.js +1 -1
- package/indicators/pivot-points.src.js +1 -1
- package/indicators/ppo.js +5 -6
- package/indicators/ppo.js.map +1 -1
- package/indicators/ppo.src.js +3 -75
- package/indicators/price-channel.js +9 -9
- package/indicators/price-channel.js.map +1 -1
- package/indicators/price-channel.src.js +207 -168
- package/indicators/price-envelopes.js +1 -1
- package/indicators/price-envelopes.src.js +1 -1
- package/indicators/psar.js +1 -1
- package/indicators/psar.src.js +1 -1
- package/indicators/regressions.js +1 -1
- package/indicators/regressions.src.js +9 -9
- package/indicators/roc.js +1 -1
- package/indicators/roc.src.js +1 -1
- package/indicators/rsi.js +1 -1
- package/indicators/rsi.src.js +1 -1
- package/indicators/slow-stochastic.js +5 -6
- package/indicators/slow-stochastic.js.map +1 -1
- package/indicators/slow-stochastic.src.js +2 -72
- package/indicators/stochastic.js +10 -10
- package/indicators/stochastic.js.map +1 -1
- package/indicators/stochastic.src.js +209 -164
- package/indicators/supertrend.js +10 -10
- package/indicators/supertrend.js.map +1 -1
- package/indicators/supertrend.src.js +6 -7
- package/indicators/tema.js +6 -7
- package/indicators/tema.js.map +1 -1
- package/indicators/tema.src.js +28 -75
- package/indicators/trendline.js +1 -1
- package/indicators/trendline.src.js +1 -1
- package/indicators/trix.js +4 -5
- package/indicators/trix.js.map +1 -1
- package/indicators/trix.src.js +8 -76
- package/indicators/volume-by-price.js +16 -16
- package/indicators/volume-by-price.js.map +1 -1
- package/indicators/volume-by-price.src.js +21 -3
- package/indicators/vwap.js +1 -1
- package/indicators/vwap.src.js +1 -1
- package/indicators/williams-r.js +5 -6
- package/indicators/williams-r.js.map +1 -1
- package/indicators/williams-r.src.js +41 -51
- package/indicators/wma.js +1 -1
- package/indicators/wma.src.js +1 -1
- package/indicators/zigzag.js +1 -1
- package/indicators/zigzag.src.js +1 -1
- package/modules/accessibility.d.ts +5 -0
- package/modules/accessibility.js +234 -216
- package/modules/accessibility.js.map +1 -1
- package/modules/accessibility.src.d.ts +5 -0
- package/modules/accessibility.src.js +9709 -8608
- package/modules/annotations-advanced.d.ts +30 -0
- package/modules/annotations-advanced.js +191 -165
- package/modules/annotations-advanced.js.map +1 -1
- package/modules/annotations-advanced.src.d.ts +30 -0
- package/modules/annotations-advanced.src.js +1578 -320
- package/modules/annotations.js +121 -107
- package/modules/annotations.js.map +1 -1
- package/modules/annotations.src.js +958 -229
- package/modules/arrow-symbols.js +1 -1
- package/modules/arrow-symbols.src.js +1 -1
- package/modules/boost-canvas.js +15 -15
- package/modules/boost-canvas.js.map +1 -1
- package/modules/boost-canvas.src.js +3 -3
- package/modules/boost.js +79 -79
- package/modules/boost.js.map +1 -1
- package/modules/boost.src.js +10 -9
- package/modules/broken-axis.js +1 -1
- package/modules/broken-axis.src.js +1 -1
- package/modules/bullet.js +1 -1
- package/modules/bullet.src.js +1 -1
- package/modules/coloraxis.js +24 -24
- package/modules/coloraxis.js.map +1 -1
- package/modules/coloraxis.src.js +69 -98
- package/modules/current-date-indicator.js +4 -4
- package/modules/current-date-indicator.js.map +1 -1
- package/modules/current-date-indicator.src.js +4 -4
- package/modules/cylinder.js +1 -1
- package/modules/cylinder.src.js +1 -1
- package/modules/data.js +19 -19
- package/modules/data.js.map +1 -1
- package/modules/data.src.js +9 -6
- package/modules/datagrouping.js +20 -20
- package/modules/datagrouping.js.map +1 -1
- package/modules/datagrouping.src.js +33 -19
- package/modules/debugger.js +1 -1
- package/modules/debugger.src.js +1 -1
- package/modules/dependency-wheel.js +11 -11
- package/modules/dependency-wheel.js.map +1 -1
- package/modules/dependency-wheel.src.js +4 -7
- package/modules/dotplot.js +1 -1
- package/modules/dotplot.src.js +1 -1
- package/modules/drag-panes.js +8 -8
- package/modules/drag-panes.js.map +1 -1
- package/modules/drag-panes.src.js +3 -3
- package/modules/draggable-points.js +1 -1
- package/modules/draggable-points.src.js +1 -1
- package/modules/drilldown.js +24 -24
- package/modules/drilldown.js.map +1 -1
- package/modules/drilldown.src.js +4 -4
- package/modules/dumbbell.js +17 -17
- package/modules/dumbbell.js.map +1 -1
- package/modules/dumbbell.src.js +4 -4
- package/modules/export-data.js +1 -1
- package/modules/export-data.js.map +1 -1
- package/modules/export-data.src.js +3 -3
- package/modules/exporting.js +39 -38
- package/modules/exporting.js.map +1 -1
- package/modules/exporting.src.js +98 -67
- package/modules/full-screen.js +1 -1
- package/modules/full-screen.src.js +1 -1
- package/modules/funnel.js +12 -12
- package/modules/funnel.js.map +1 -1
- package/modules/funnel.src.js +9 -6
- package/modules/funnel3d.js +1 -1
- package/modules/funnel3d.src.js +1 -1
- package/modules/gantt.js +217 -218
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +167 -152
- package/modules/grid-axis.js +1 -1
- package/modules/grid-axis.src.js +1 -1
- package/modules/heatmap.js +39 -39
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +177 -162
- package/modules/heikinashi.js +1 -1
- package/modules/heikinashi.src.js +4 -4
- package/modules/histogram-bellcurve.js +13 -13
- package/modules/histogram-bellcurve.js.map +1 -1
- package/modules/histogram-bellcurve.src.js +91 -86
- package/modules/hollowcandlestick.js +9 -9
- package/modules/hollowcandlestick.js.map +1 -1
- package/modules/hollowcandlestick.src.js +11 -11
- package/modules/item-series.js +1 -1
- package/modules/item-series.src.js +1 -1
- package/modules/lollipop.js +1 -1
- package/modules/lollipop.src.js +1 -1
- package/modules/map.d.ts +136 -14
- package/modules/map.js +142 -122
- package/modules/map.js.map +1 -1
- package/modules/map.src.d.ts +136 -14
- package/modules/map.src.js +2129 -1029
- package/modules/marker-clusters.js +36 -36
- package/modules/marker-clusters.js.map +1 -1
- package/modules/marker-clusters.src.js +173 -142
- package/modules/networkgraph.d.ts +12 -1
- package/modules/networkgraph.js +49 -49
- package/modules/networkgraph.js.map +1 -1
- package/modules/networkgraph.src.d.ts +12 -1
- package/modules/networkgraph.src.js +91 -43
- package/modules/no-data-to-display.js +5 -5
- package/modules/no-data-to-display.js.map +1 -1
- package/modules/no-data-to-display.src.js +3 -3
- package/modules/offline-exporting.js +17 -17
- package/modules/offline-exporting.js.map +1 -1
- package/modules/offline-exporting.src.js +13 -13
- package/modules/oldie-polyfills.js +1 -1
- package/modules/oldie-polyfills.src.js +1 -1
- package/modules/oldie.js +26 -26
- package/modules/oldie.js.map +1 -1
- package/modules/oldie.src.js +4 -4
- package/modules/organization.js +13 -13
- package/modules/organization.js.map +1 -1
- package/modules/organization.src.js +4 -4
- package/modules/overlapping-datalabels.js +1 -1
- package/modules/overlapping-datalabels.src.js +1 -1
- package/modules/parallel-coordinates.js +1 -1
- package/modules/parallel-coordinates.src.js +1 -1
- package/modules/pareto.js +7 -7
- package/modules/pareto.js.map +1 -1
- package/modules/pareto.src.js +89 -78
- package/modules/pathfinder.js +1 -1
- package/modules/pathfinder.src.js +1 -1
- package/modules/pattern-fill.js +1 -1
- package/modules/pattern-fill.src.js +1 -1
- package/modules/price-indicator.js +1 -1
- package/modules/price-indicator.src.js +1 -1
- package/modules/pyramid3d.js +1 -1
- package/modules/pyramid3d.src.js +1 -1
- package/modules/sankey.d.ts +12 -1
- package/modules/sankey.js +29 -29
- package/modules/sankey.js.map +1 -1
- package/modules/sankey.src.d.ts +12 -1
- package/modules/sankey.src.js +300 -176
- package/modules/series-label.js +1 -1
- package/modules/series-label.src.js +1 -1
- package/modules/solid-gauge.js +1 -1
- package/modules/solid-gauge.src.js +1 -1
- package/modules/sonification.js +59 -55
- package/modules/sonification.js.map +1 -1
- package/modules/sonification.src.js +3034 -2553
- package/modules/static-scale.js +1 -1
- package/modules/static-scale.src.js +1 -1
- package/modules/stock-tools.js +177 -164
- package/modules/stock-tools.js.map +1 -1
- package/modules/stock-tools.src.js +1001 -131
- package/modules/stock.d.ts +39 -6
- package/modules/stock.js +204 -196
- package/modules/stock.js.map +1 -1
- package/modules/stock.src.d.ts +39 -6
- package/modules/stock.src.js +1689 -1081
- package/modules/streamgraph.js +1 -1
- package/modules/streamgraph.src.js +1 -1
- package/modules/sunburst.js +61 -60
- package/modules/sunburst.js.map +1 -1
- package/modules/sunburst.src.js +329 -266
- package/modules/tilemap.js +17 -17
- package/modules/tilemap.js.map +1 -1
- package/modules/tilemap.src.js +3 -4
- package/modules/timeline.js +18 -18
- package/modules/timeline.js.map +1 -1
- package/modules/timeline.src.js +5 -5
- package/modules/treegrid.js +56 -57
- package/modules/treegrid.js.map +1 -1
- package/modules/treegrid.src.js +126 -120
- package/modules/treemap.js +41 -41
- package/modules/treemap.js.map +1 -1
- package/modules/treemap.src.js +319 -254
- package/modules/variable-pie.js +1 -1
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.js +1 -1
- package/modules/variwide.src.js +1 -1
- package/modules/vector.js +1 -1
- package/modules/vector.src.js +1 -1
- package/modules/venn.js +31 -31
- package/modules/venn.js.map +1 -1
- package/modules/venn.src.js +731 -721
- package/modules/windbarb.js +15 -15
- package/modules/windbarb.js.map +1 -1
- package/modules/windbarb.src.js +90 -62
- package/modules/wordcloud.js +23 -24
- package/modules/wordcloud.js.map +1 -1
- package/modules/wordcloud.src.js +897 -949
- package/modules/xrange.js +2 -2
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +2 -1
- package/package.json +1 -1
- package/themes/avocado.js +1 -1
- package/themes/avocado.src.js +1 -1
- package/themes/dark-blue.js +1 -1
- package/themes/dark-blue.src.js +1 -1
- package/themes/dark-green.js +1 -1
- package/themes/dark-green.src.js +1 -1
- package/themes/dark-unica.js +1 -1
- package/themes/dark-unica.src.js +1 -1
- package/themes/gray.js +1 -1
- package/themes/gray.src.js +1 -1
- package/themes/grid-light.js +1 -1
- package/themes/grid-light.src.js +1 -1
- package/themes/grid.js +1 -1
- package/themes/grid.src.js +1 -1
- package/themes/high-contrast-dark.js +1 -1
- package/themes/high-contrast-dark.src.js +1 -1
- package/themes/high-contrast-light.js +1 -1
- package/themes/high-contrast-light.src.js +1 -1
- package/themes/sand-signika.js +1 -1
- package/themes/sand-signika.src.js +1 -1
- package/themes/skies.js +1 -1
- package/themes/skies.src.js +1 -1
- package/themes/sunset.js +1 -1
- package/themes/sunset.src.js +1 -1
- package/es-modules/Core/Axis/MapAxis.js +0 -157
- package/es-modules/Core/Color/Palette.js +0 -82
- package/es-modules/Extensions/Sonification/InstrumentDefinitions.js +0 -32
- package/es-modules/Mixins/ColorMapSeries.js +0 -82
- package/es-modules/Mixins/ColorSeries.js +0 -77
- package/es-modules/Mixins/DerivedSeries.js +0 -118
- package/es-modules/Mixins/DrawPoint.js +0 -81
- package/es-modules/Mixins/IndicatorRequired.js +0 -56
- package/es-modules/Mixins/Navigation.js +0 -54
- package/es-modules/Mixins/NelderMead.js +0 -132
- package/es-modules/Mixins/Polygon.js +0 -259
- package/es-modules/Mixins/ReduceArray.js +0 -54
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Highcharts JS v9.
|
|
2
|
+
* @license Highcharts JS v9.3.0 (2021-10-21)
|
|
3
3
|
*
|
|
4
4
|
* Annotations module
|
|
5
5
|
*
|
|
@@ -293,8 +293,7 @@
|
|
|
293
293
|
* @param {Highcharts.AnnotationControllable} target
|
|
294
294
|
* @return {Highcharts.PositionObject}
|
|
295
295
|
*/
|
|
296
|
-
var
|
|
297
|
-
merge = U.merge,
|
|
296
|
+
var merge = U.merge,
|
|
298
297
|
pick = U.pick;
|
|
299
298
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
300
299
|
/**
|
|
@@ -1188,8 +1187,11 @@
|
|
|
1188
1187
|
*
|
|
1189
1188
|
* @param {number} dx translation for x coordinate
|
|
1190
1189
|
* @param {number} dy translation for y coordinate
|
|
1190
|
+
* @param {boolean|undefined} translateSecondPoint If the shape has two
|
|
1191
|
+
* points attached to it, this option allows you to translate also
|
|
1192
|
+
* the second point
|
|
1191
1193
|
*/
|
|
1192
|
-
translateShape: function (dx, dy) {
|
|
1194
|
+
translateShape: function (dx, dy, translateSecondPoint) {
|
|
1193
1195
|
var chart = this.annotation.chart,
|
|
1194
1196
|
// Annotation.options
|
|
1195
1197
|
shapeOptions = this.annotation.userOptions,
|
|
@@ -1197,6 +1199,9 @@
|
|
|
1197
1199
|
annotationIndex = chart.annotations.indexOf(this.annotation),
|
|
1198
1200
|
chartOptions = chart.options.annotations[annotationIndex];
|
|
1199
1201
|
this.translatePoint(dx, dy, 0);
|
|
1202
|
+
if (translateSecondPoint) {
|
|
1203
|
+
this.translatePoint(dx, dy, 1);
|
|
1204
|
+
}
|
|
1200
1205
|
// Options stored in:
|
|
1201
1206
|
// - chart (for exporting)
|
|
1202
1207
|
// - current config (for redraws)
|
|
@@ -1890,6 +1895,215 @@
|
|
|
1890
1895
|
|
|
1891
1896
|
return ControllableCircle;
|
|
1892
1897
|
});
|
|
1898
|
+
_registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableEllipse.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Core/Utilities.js']], function (ControllableMixin, ControllablePath, U) {
|
|
1899
|
+
/* *
|
|
1900
|
+
*
|
|
1901
|
+
* Author: Pawel Lysy
|
|
1902
|
+
*
|
|
1903
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1904
|
+
*
|
|
1905
|
+
* */
|
|
1906
|
+
var merge = U.merge,
|
|
1907
|
+
defined = U.defined;
|
|
1908
|
+
/**
|
|
1909
|
+
* A controllable ellipse class.
|
|
1910
|
+
*
|
|
1911
|
+
* @requires modules/annotations
|
|
1912
|
+
*
|
|
1913
|
+
* @private
|
|
1914
|
+
* @class
|
|
1915
|
+
* @name Highcharts.AnnotationControllableEllipse
|
|
1916
|
+
*
|
|
1917
|
+
* @param {Highcharts.Annotation} annotation an annotation instance
|
|
1918
|
+
* @param {Highcharts.AnnotationsShapeOptions} options a shape's options
|
|
1919
|
+
* @param {number} index of the Ellipse
|
|
1920
|
+
*/
|
|
1921
|
+
var ControllableEllipse = /** @class */ (function () {
|
|
1922
|
+
/* *
|
|
1923
|
+
*
|
|
1924
|
+
* Constructor
|
|
1925
|
+
*
|
|
1926
|
+
* */
|
|
1927
|
+
function ControllableEllipse(annotation, options, index) {
|
|
1928
|
+
/* *
|
|
1929
|
+
*
|
|
1930
|
+
* Properties
|
|
1931
|
+
*
|
|
1932
|
+
* */
|
|
1933
|
+
this.addControlPoints = ControllableMixin.addControlPoints;
|
|
1934
|
+
this.anchor = ControllableMixin.anchor;
|
|
1935
|
+
this.attr = ControllableMixin.attr;
|
|
1936
|
+
this.attrsFromOptions = ControllableMixin.attrsFromOptions;
|
|
1937
|
+
this.destroy = ControllableMixin.destroy;
|
|
1938
|
+
this.getPointsOptions = ControllableMixin.getPointsOptions;
|
|
1939
|
+
this.linkPoints = ControllableMixin.linkPoints;
|
|
1940
|
+
this.point = ControllableMixin.point;
|
|
1941
|
+
this.scale = ControllableMixin.scale;
|
|
1942
|
+
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1943
|
+
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1944
|
+
this.transform = ControllableMixin.transform;
|
|
1945
|
+
this.translatePoint = ControllableMixin.translatePoint;
|
|
1946
|
+
this.transformPoint = ControllableMixin.transformPoint;
|
|
1947
|
+
/**
|
|
1948
|
+
* @type 'ellipse'
|
|
1949
|
+
*/
|
|
1950
|
+
this.type = 'ellipse';
|
|
1951
|
+
this.init(annotation, options, index);
|
|
1952
|
+
this.collection = 'shapes';
|
|
1953
|
+
}
|
|
1954
|
+
/* *
|
|
1955
|
+
*
|
|
1956
|
+
* Functions
|
|
1957
|
+
*
|
|
1958
|
+
* */
|
|
1959
|
+
ControllableEllipse.prototype.init = function (annotation, options, index) {
|
|
1960
|
+
if (defined(options.yAxis)) {
|
|
1961
|
+
options.points.forEach(function (point) {
|
|
1962
|
+
point.yAxis = options.yAxis;
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
if (defined(options.xAxis)) {
|
|
1966
|
+
options.points.forEach(function (point) {
|
|
1967
|
+
point.xAxis = options.xAxis;
|
|
1968
|
+
});
|
|
1969
|
+
}
|
|
1970
|
+
ControllableMixin.init.call(this, annotation, options, index);
|
|
1971
|
+
};
|
|
1972
|
+
/**
|
|
1973
|
+
*
|
|
1974
|
+
* Render the element
|
|
1975
|
+
* @param parent parent SVG element.
|
|
1976
|
+
*/
|
|
1977
|
+
ControllableEllipse.prototype.render = function (parent) {
|
|
1978
|
+
this.graphic = this.annotation.chart.renderer.createElement('ellipse')
|
|
1979
|
+
.attr(this.attrsFromOptions(this.options))
|
|
1980
|
+
.add(parent);
|
|
1981
|
+
ControllableMixin.render.call(this);
|
|
1982
|
+
};
|
|
1983
|
+
/**
|
|
1984
|
+
* Translate the points.
|
|
1985
|
+
* Mostly used to handle dragging of the ellipse.
|
|
1986
|
+
*/
|
|
1987
|
+
ControllableEllipse.prototype.translate = function (dx, dy) {
|
|
1988
|
+
ControllableMixin.translateShape.call(this, dx, dy, true);
|
|
1989
|
+
};
|
|
1990
|
+
/**
|
|
1991
|
+
* Get the distance from the line to the point.
|
|
1992
|
+
* @param point1 first point which is on the line
|
|
1993
|
+
* @param point2 second point
|
|
1994
|
+
* @param x0 point's x value from which you want to calculate the distance from
|
|
1995
|
+
* @param y0 point's y value from which you want to calculate the distance from
|
|
1996
|
+
*/
|
|
1997
|
+
ControllableEllipse.prototype.getDistanceFromLine = function (point1, point2, x0, y0) {
|
|
1998
|
+
return Math.abs((point2.y - point1.y) * x0 - (point2.x - point1.x) * y0 +
|
|
1999
|
+
point2.x * point1.y - point2.y * point1.x) / Math.sqrt((point2.y - point1.y) * (point2.y - point1.y) +
|
|
2000
|
+
(point2.x - point1.x) * (point2.x - point1.x));
|
|
2001
|
+
};
|
|
2002
|
+
/**
|
|
2003
|
+
* The fuction calculates the svg attributes of the ellipse, and returns all
|
|
2004
|
+
* parameters neccessary to draw the ellipse.
|
|
2005
|
+
* @param position absolute position of the first point in points array
|
|
2006
|
+
* @param position2 absolute position of the second point in points array
|
|
2007
|
+
*/
|
|
2008
|
+
ControllableEllipse.prototype.getAttrs = function (position, position2) {
|
|
2009
|
+
var x1 = position.x,
|
|
2010
|
+
y1 = position.y,
|
|
2011
|
+
x2 = position2.x,
|
|
2012
|
+
y2 = position2.y,
|
|
2013
|
+
cx = (x1 + x2) / 2,
|
|
2014
|
+
cy = (y1 + y2) / 2,
|
|
2015
|
+
rx = Math.sqrt((x1 - x2) * (x1 - x2) / 4 + (y1 - y2) * (y1 - y2) / 4),
|
|
2016
|
+
tan = (y2 - y1) / (x2 - x1);
|
|
2017
|
+
var angle = Math.atan(tan) * 180 / Math.PI;
|
|
2018
|
+
if (cx < x1) {
|
|
2019
|
+
angle += 180;
|
|
2020
|
+
}
|
|
2021
|
+
var ry = this.getRY();
|
|
2022
|
+
return { cx: cx, cy: cy, rx: rx, ry: ry, angle: angle };
|
|
2023
|
+
};
|
|
2024
|
+
/**
|
|
2025
|
+
* Get the value of minor radius of the ellipse.
|
|
2026
|
+
*/
|
|
2027
|
+
ControllableEllipse.prototype.getRY = function () {
|
|
2028
|
+
var yAxis = this.getYAxis();
|
|
2029
|
+
return defined(yAxis) ?
|
|
2030
|
+
Math.abs(yAxis.toPixels(this.options.ry) - yAxis.toPixels(0)) :
|
|
2031
|
+
this.options.ry;
|
|
2032
|
+
};
|
|
2033
|
+
/**
|
|
2034
|
+
* get the yAxis object to which the ellipse is pinned.
|
|
2035
|
+
*/
|
|
2036
|
+
ControllableEllipse.prototype.getYAxis = function () {
|
|
2037
|
+
var yAxisIndex = this.options.yAxis;
|
|
2038
|
+
return this.chart.yAxis[yAxisIndex];
|
|
2039
|
+
};
|
|
2040
|
+
/**
|
|
2041
|
+
* Get the absolute coordinates of the MockPoint
|
|
2042
|
+
* @param point MockPoint that is added through options
|
|
2043
|
+
*/
|
|
2044
|
+
ControllableEllipse.prototype.getAbsolutePosition = function (point) {
|
|
2045
|
+
return this.anchor(point).absolutePosition;
|
|
2046
|
+
};
|
|
2047
|
+
/**
|
|
2048
|
+
*
|
|
2049
|
+
* Redraw the element
|
|
2050
|
+
* @param animation display an annimation
|
|
2051
|
+
*/
|
|
2052
|
+
ControllableEllipse.prototype.redraw = function (animation) {
|
|
2053
|
+
var position = this.getAbsolutePosition(this.points[0]),
|
|
2054
|
+
position2 = this.getAbsolutePosition(this.points[1]),
|
|
2055
|
+
attrs = this.getAttrs(position,
|
|
2056
|
+
position2);
|
|
2057
|
+
if (position) {
|
|
2058
|
+
this.graphic[animation ? 'animate' : 'attr']({
|
|
2059
|
+
cx: attrs.cx,
|
|
2060
|
+
cy: attrs.cy,
|
|
2061
|
+
rx: attrs.rx,
|
|
2062
|
+
ry: attrs.ry,
|
|
2063
|
+
rotation: attrs.angle,
|
|
2064
|
+
rotationOriginX: attrs.cx,
|
|
2065
|
+
rotationOriginY: attrs.cy
|
|
2066
|
+
});
|
|
2067
|
+
}
|
|
2068
|
+
else {
|
|
2069
|
+
this.graphic.attr({
|
|
2070
|
+
x: 0,
|
|
2071
|
+
y: -9e9
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
this.graphic.placed = Boolean(position);
|
|
2075
|
+
ControllableMixin.redraw.call(this, animation);
|
|
2076
|
+
};
|
|
2077
|
+
/**
|
|
2078
|
+
* Set the radius Y.
|
|
2079
|
+
*
|
|
2080
|
+
* @param {number} ry a radius in y direction to be set
|
|
2081
|
+
*/
|
|
2082
|
+
ControllableEllipse.prototype.setYRadius = function (ry) {
|
|
2083
|
+
this.options.ry = ry;
|
|
2084
|
+
this.annotation.userOptions.shapes[0].ry = ry;
|
|
2085
|
+
this.annotation.options.shapes[0].ry = ry;
|
|
2086
|
+
};
|
|
2087
|
+
/* *
|
|
2088
|
+
*
|
|
2089
|
+
* Static Properties
|
|
2090
|
+
*
|
|
2091
|
+
* */
|
|
2092
|
+
/**
|
|
2093
|
+
* A map object which allows to map options attributes to element
|
|
2094
|
+
* attributes.
|
|
2095
|
+
*
|
|
2096
|
+
* @name Highcharts.AnnotationControllableEllipse.attrsMap
|
|
2097
|
+
* @type {Highcharts.Dictionary<string>}
|
|
2098
|
+
*/
|
|
2099
|
+
ControllableEllipse.attrsMap = merge(ControllablePath.attrsMap, {
|
|
2100
|
+
ry: 'ry'
|
|
2101
|
+
});
|
|
2102
|
+
return ControllableEllipse;
|
|
2103
|
+
}());
|
|
2104
|
+
|
|
2105
|
+
return ControllableEllipse;
|
|
2106
|
+
});
|
|
1893
2107
|
_registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableLabel.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Core/FormatUtilities.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Tooltip.js'], _modules['Core/Utilities.js']], function (ControllableMixin, F, MockPoint, SVGRenderer, Tooltip, U) {
|
|
1894
2108
|
/* *
|
|
1895
2109
|
*
|
|
@@ -2424,7 +2638,7 @@
|
|
|
2424
2638
|
|
|
2425
2639
|
return ControllableImage;
|
|
2426
2640
|
});
|
|
2427
|
-
_registerModule(_modules, 'Extensions/Annotations/Annotations.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Core/Chart/Chart.js'], _modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllableRect.js'], _modules['Extensions/Annotations/Controllables/ControllableCircle.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Extensions/Annotations/Controllables/ControllableImage.js'], _modules['Extensions/Annotations/Controllables/ControllableLabel.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/Mixins/EventEmitterMixin.js'], _modules['Core/Globals.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']
|
|
2641
|
+
_registerModule(_modules, 'Extensions/Annotations/Annotations.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Core/Chart/Chart.js'], _modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllableRect.js'], _modules['Extensions/Annotations/Controllables/ControllableCircle.js'], _modules['Extensions/Annotations/Controllables/ControllableEllipse.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Extensions/Annotations/Controllables/ControllableImage.js'], _modules['Extensions/Annotations/Controllables/ControllableLabel.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/Mixins/EventEmitterMixin.js'], _modules['Core/Globals.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']], function (A, Chart, ControllableMixin, ControllableRect, ControllableCircle, ControllableEllipse, ControllablePath, ControllableImage, ControllableLabel, ControlPoint, EventEmitterMixin, H, MockPoint, Pointer, U) {
|
|
2428
2642
|
/* *
|
|
2429
2643
|
*
|
|
2430
2644
|
* (c) 2009-2021 Highsoft, Black Label
|
|
@@ -2646,7 +2860,10 @@
|
|
|
2646
2860
|
};
|
|
2647
2861
|
Annotation.prototype.addClipPaths = function () {
|
|
2648
2862
|
this.setClipAxes();
|
|
2649
|
-
if (this.clipXAxis &&
|
|
2863
|
+
if (this.clipXAxis &&
|
|
2864
|
+
this.clipYAxis &&
|
|
2865
|
+
this.options.crop // #15399
|
|
2866
|
+
) {
|
|
2650
2867
|
this.clipRect = this.chart.renderer.clipRect(this.getClipBox());
|
|
2651
2868
|
}
|
|
2652
2869
|
};
|
|
@@ -2748,8 +2965,10 @@
|
|
|
2748
2965
|
.add();
|
|
2749
2966
|
this.shapesGroup = renderer
|
|
2750
2967
|
.g('annotation-shapes')
|
|
2751
|
-
.add(this.graphic)
|
|
2752
|
-
|
|
2968
|
+
.add(this.graphic);
|
|
2969
|
+
if (this.options.crop) { // #15399
|
|
2970
|
+
this.shapesGroup.clip(this.chart.plotBoxClip);
|
|
2971
|
+
}
|
|
2753
2972
|
this.labelsGroup = renderer
|
|
2754
2973
|
.g('annotation-labels')
|
|
2755
2974
|
.attr({
|
|
@@ -2866,6 +3085,9 @@
|
|
|
2866
3085
|
* Initialisation of a single shape
|
|
2867
3086
|
* @private
|
|
2868
3087
|
* @param {Object} shapeOptions - a confg object for a single shape
|
|
3088
|
+
* @param {number} index - annotation may have many shapes,
|
|
3089
|
+
* this is the shape's index saved in shapes.index.
|
|
3090
|
+
|
|
2869
3091
|
*/
|
|
2870
3092
|
Annotation.prototype.initShape = function (shapeOptions, index) {
|
|
2871
3093
|
var options = merge(this.options.shapeOptions, {
|
|
@@ -2971,6 +3193,7 @@
|
|
|
2971
3193
|
Annotation.shapesMap = {
|
|
2972
3194
|
'rect': ControllableRect,
|
|
2973
3195
|
'circle': ControllableCircle,
|
|
3196
|
+
'ellipse': ControllableEllipse,
|
|
2974
3197
|
'path': ControllablePath,
|
|
2975
3198
|
'image': ControllableImage
|
|
2976
3199
|
};
|
|
@@ -3047,9 +3270,18 @@
|
|
|
3047
3270
|
* Animation defer settings
|
|
3048
3271
|
* @type {boolean|Partial<Highcharts.AnimationOptionsObject>}
|
|
3049
3272
|
* @since 8.2.0
|
|
3050
|
-
* @apioption annotations.animation
|
|
3051
3273
|
*/
|
|
3052
3274
|
animation: {},
|
|
3275
|
+
/**
|
|
3276
|
+
* Whether to hide the part of the annotation
|
|
3277
|
+
* that is outside the plot area.
|
|
3278
|
+
*
|
|
3279
|
+
* @sample highcharts/annotations/label-crop-overflow/
|
|
3280
|
+
* Crop line annotation
|
|
3281
|
+
* @type {boolean}
|
|
3282
|
+
* @since 9.3.0
|
|
3283
|
+
*/
|
|
3284
|
+
crop: true,
|
|
3053
3285
|
/**
|
|
3054
3286
|
* The animation delay time in milliseconds.
|
|
3055
3287
|
* Set to `0` renders annotation immediately.
|
|
@@ -3114,7 +3346,7 @@
|
|
|
3114
3346
|
*
|
|
3115
3347
|
* @type {Highcharts.ColorString}
|
|
3116
3348
|
*/
|
|
3117
|
-
borderColor:
|
|
3349
|
+
borderColor: "#000000" /* neutralColor100 */,
|
|
3118
3350
|
/**
|
|
3119
3351
|
* The border radius in pixels for the annotaiton's label.
|
|
3120
3352
|
*
|
|
@@ -3409,6 +3641,32 @@
|
|
|
3409
3641
|
* @requires modules/annotations
|
|
3410
3642
|
*/
|
|
3411
3643
|
shapeOptions: {
|
|
3644
|
+
/**
|
|
3645
|
+
*
|
|
3646
|
+
* The radius of the shape in y direction.
|
|
3647
|
+
* Used for the ellipse.
|
|
3648
|
+
*
|
|
3649
|
+
* @sample highcharts/annotations/ellipse/
|
|
3650
|
+
* Ellipse annotation
|
|
3651
|
+
*
|
|
3652
|
+
* @type {number}
|
|
3653
|
+
* @apioption annotations.shapeOptions.ry
|
|
3654
|
+
**/
|
|
3655
|
+
/**
|
|
3656
|
+
*
|
|
3657
|
+
* The xAxis index to which the points should be attached.
|
|
3658
|
+
* Used for the ellipse.
|
|
3659
|
+
*
|
|
3660
|
+
* @type {number}
|
|
3661
|
+
* @apioption annotations.shapeOptions.xAxis
|
|
3662
|
+
**/
|
|
3663
|
+
/**
|
|
3664
|
+
* The yAxis index to which the points should be attached.
|
|
3665
|
+
* Used for the ellipse.
|
|
3666
|
+
*
|
|
3667
|
+
* @type {number}
|
|
3668
|
+
* @apioption annotations.shapeOptions.yAxis
|
|
3669
|
+
**/
|
|
3412
3670
|
/**
|
|
3413
3671
|
* The width of the shape.
|
|
3414
3672
|
*
|
|
@@ -3428,11 +3686,15 @@
|
|
|
3428
3686
|
* @apioption annotations.shapeOptions.height
|
|
3429
3687
|
*/
|
|
3430
3688
|
/**
|
|
3431
|
-
* The type of the shape
|
|
3689
|
+
* The type of the shape.
|
|
3690
|
+
* Avaliable options are circle, rect and ellipse.
|
|
3432
3691
|
*
|
|
3433
3692
|
* @sample highcharts/annotations/shape/
|
|
3434
3693
|
* Basic shape annotation
|
|
3435
3694
|
*
|
|
3695
|
+
* @sample highcharts/annotations/ellipse/
|
|
3696
|
+
* Ellipse annotation
|
|
3697
|
+
*
|
|
3436
3698
|
* @type {string}
|
|
3437
3699
|
* @default rect
|
|
3438
3700
|
* @apioption annotations.shapeOptions.type
|
|
@@ -3514,9 +3776,10 @@
|
|
|
3514
3776
|
width: 10,
|
|
3515
3777
|
height: 10,
|
|
3516
3778
|
style: {
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3779
|
+
cursor: 'pointer',
|
|
3780
|
+
fill: "#ffffff" /* backgroundColor */,
|
|
3781
|
+
stroke: "#000000" /* neutralColor100 */,
|
|
3782
|
+
'stroke-width': 2
|
|
3520
3783
|
},
|
|
3521
3784
|
visible: false,
|
|
3522
3785
|
events: {}
|
|
@@ -3579,7 +3842,8 @@
|
|
|
3579
3842
|
* @param {Highcharts.AnnotationsOptions} options
|
|
3580
3843
|
* The annotation options for the new, detailed annotation.
|
|
3581
3844
|
* @param {boolean} [redraw]
|
|
3582
|
-
*
|
|
3845
|
+
* @sample highcharts/annotations/add-annotation/
|
|
3846
|
+
* Add annotation
|
|
3583
3847
|
* @return {Highcharts.Annotation} - The newly generated annotation.
|
|
3584
3848
|
*/
|
|
3585
3849
|
addAnnotation: function (userOptions, redraw) {
|
|
@@ -3846,7 +4110,7 @@
|
|
|
3846
4110
|
|
|
3847
4111
|
return Annotation;
|
|
3848
4112
|
});
|
|
3849
|
-
_registerModule(_modules, '
|
|
4113
|
+
_registerModule(_modules, 'Core/Chart/ChartNavigationComposition.js', [], function () {
|
|
3850
4114
|
/**
|
|
3851
4115
|
*
|
|
3852
4116
|
* (c) 2010-2021 Paweł Fus
|
|
@@ -3856,56 +4120,91 @@
|
|
|
3856
4120
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3857
4121
|
*
|
|
3858
4122
|
* */
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
* @return {void}
|
|
3868
|
-
*/
|
|
3869
|
-
initUpdate: function (chart) {
|
|
3870
|
-
if (!chart.navigation) {
|
|
3871
|
-
chart.navigation = {
|
|
3872
|
-
updates: [],
|
|
3873
|
-
update: function (options,
|
|
3874
|
-
redraw) {
|
|
3875
|
-
this.updates.forEach(function (updateConfig) {
|
|
3876
|
-
updateConfig.update.call(updateConfig.context,
|
|
3877
|
-
options,
|
|
3878
|
-
redraw);
|
|
3879
|
-
});
|
|
3880
|
-
}
|
|
3881
|
-
};
|
|
3882
|
-
}
|
|
3883
|
-
},
|
|
3884
|
-
/**
|
|
3885
|
-
* Registers an `update()` method in the `chart.navigation` object.
|
|
4123
|
+
/* *
|
|
4124
|
+
*
|
|
4125
|
+
* Composition
|
|
4126
|
+
*
|
|
4127
|
+
* */
|
|
4128
|
+
var ChartNavigationComposition;
|
|
4129
|
+
(function (ChartNavigationComposition) {
|
|
4130
|
+
/* *
|
|
3886
4131
|
*
|
|
4132
|
+
* Declarations
|
|
4133
|
+
*
|
|
4134
|
+
* */
|
|
4135
|
+
/* *
|
|
4136
|
+
*
|
|
4137
|
+
* Functions
|
|
4138
|
+
*
|
|
4139
|
+
* */
|
|
4140
|
+
/* eslint-disable valid-jsdoc */
|
|
4141
|
+
/**
|
|
3887
4142
|
* @private
|
|
3888
|
-
* @param {Highcharts.ChartNavigationUpdateFunction} update
|
|
3889
|
-
* The `update()` method that will be called in `chart.update()`.
|
|
3890
|
-
* @param {Highcharts.Chart} chart
|
|
3891
|
-
* The chart instance. `update()` will use that as a context
|
|
3892
|
-
* (`this`).
|
|
3893
|
-
* @return {void}
|
|
3894
4143
|
*/
|
|
3895
|
-
|
|
4144
|
+
function compose(chart) {
|
|
3896
4145
|
if (!chart.navigation) {
|
|
3897
|
-
|
|
4146
|
+
chart.navigation = new Additions(chart);
|
|
3898
4147
|
}
|
|
3899
|
-
chart
|
|
3900
|
-
update: update,
|
|
3901
|
-
context: chart
|
|
3902
|
-
});
|
|
4148
|
+
return chart;
|
|
3903
4149
|
}
|
|
3904
|
-
|
|
4150
|
+
ChartNavigationComposition.compose = compose;
|
|
4151
|
+
/* *
|
|
4152
|
+
*
|
|
4153
|
+
* Class
|
|
4154
|
+
*
|
|
4155
|
+
* */
|
|
4156
|
+
/**
|
|
4157
|
+
* Initializes `chart.navigation` object which delegates `update()` methods
|
|
4158
|
+
* to all other common classes (used in exporting and navigationBindings).
|
|
4159
|
+
* @private
|
|
4160
|
+
*/
|
|
4161
|
+
var Additions = /** @class */ (function () {
|
|
4162
|
+
/* *
|
|
4163
|
+
*
|
|
4164
|
+
* Constructor
|
|
4165
|
+
*
|
|
4166
|
+
* */
|
|
4167
|
+
function Additions(chart) {
|
|
4168
|
+
this.updates = [];
|
|
4169
|
+
this.chart = chart;
|
|
4170
|
+
}
|
|
4171
|
+
/* *
|
|
4172
|
+
*
|
|
4173
|
+
* Functions
|
|
4174
|
+
*
|
|
4175
|
+
* */
|
|
4176
|
+
/**
|
|
4177
|
+
* Registers an `update()` method in the `chart.navigation` object.
|
|
4178
|
+
*
|
|
4179
|
+
* @private
|
|
4180
|
+
* @param {UpdateFunction} updateFn
|
|
4181
|
+
* The `update()` method that will be called in `chart.update()`.
|
|
4182
|
+
*/
|
|
4183
|
+
Additions.prototype.addUpdate = function (updateFn) {
|
|
4184
|
+
this.chart.navigation.updates.push(updateFn);
|
|
4185
|
+
};
|
|
4186
|
+
/**
|
|
4187
|
+
* @private
|
|
4188
|
+
*/
|
|
4189
|
+
Additions.prototype.update = function (options, redraw) {
|
|
4190
|
+
var _this = this;
|
|
4191
|
+
this.updates.forEach(function (updateFn) {
|
|
4192
|
+
updateFn.call(_this.chart, options, redraw);
|
|
4193
|
+
});
|
|
4194
|
+
};
|
|
4195
|
+
return Additions;
|
|
4196
|
+
}());
|
|
4197
|
+
ChartNavigationComposition.Additions = Additions;
|
|
4198
|
+
})(ChartNavigationComposition || (ChartNavigationComposition = {}));
|
|
4199
|
+
/* *
|
|
4200
|
+
*
|
|
4201
|
+
* Default Export
|
|
4202
|
+
*
|
|
4203
|
+
* */
|
|
3905
4204
|
|
|
3906
|
-
return
|
|
4205
|
+
return ChartNavigationComposition;
|
|
3907
4206
|
});
|
|
3908
|
-
_registerModule(_modules, 'Extensions/Annotations/NavigationBindings.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Core/Chart/Chart.js'], _modules['
|
|
4207
|
+
_registerModule(_modules, 'Extensions/Annotations/NavigationBindings.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Chart/ChartNavigationComposition.js'], _modules['Core/FormatUtilities.js'], _modules['Core/Globals.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Utilities.js']], function (Annotation, Chart, ChartNavigationComposition, F, H, D, U) {
|
|
3909
4208
|
/* *
|
|
3910
4209
|
*
|
|
3911
4210
|
* (c) 2009-2021 Highsoft, Black Label
|
|
@@ -4053,8 +4352,9 @@
|
|
|
4053
4352
|
*/
|
|
4054
4353
|
getAssignedAxis: function (coords) {
|
|
4055
4354
|
return coords.filter(function (coord) {
|
|
4056
|
-
var
|
|
4057
|
-
|
|
4355
|
+
var extremes = coord.axis.getExtremes(),
|
|
4356
|
+
axisMin = extremes.min,
|
|
4357
|
+
axisMax = extremes.max,
|
|
4058
4358
|
// Correct axis edges when axis has series
|
|
4059
4359
|
// with pointRange (like column)
|
|
4060
4360
|
minPointOffset = pick(coord.axis.minPointOffset, 0);
|
|
@@ -4155,9 +4455,11 @@
|
|
|
4155
4455
|
*/
|
|
4156
4456
|
NavigationBindings.prototype.initUpdate = function () {
|
|
4157
4457
|
var navigation = this;
|
|
4158
|
-
|
|
4458
|
+
ChartNavigationComposition
|
|
4459
|
+
.compose(this.chart).navigation
|
|
4460
|
+
.addUpdate(function (options) {
|
|
4159
4461
|
navigation.update(options);
|
|
4160
|
-
}
|
|
4462
|
+
});
|
|
4161
4463
|
};
|
|
4162
4464
|
/**
|
|
4163
4465
|
* Hook for click on a button, method selcts/unselects buttons,
|
|
@@ -4602,6 +4904,7 @@
|
|
|
4602
4904
|
},
|
|
4603
4905
|
// Simple shapes:
|
|
4604
4906
|
circle: ['shapes'],
|
|
4907
|
+
ellipse: ['shapes'],
|
|
4605
4908
|
verticalLine: [],
|
|
4606
4909
|
label: ['labelOptions'],
|
|
4607
4910
|
// Measure
|
|
@@ -4618,7 +4921,9 @@
|
|
|
4618
4921
|
// Define non editable fields per annotation, for example Rectangle inherits
|
|
4619
4922
|
// options from Measure, but crosshairs are not available
|
|
4620
4923
|
NavigationBindings.annotationsNonEditable = {
|
|
4621
|
-
rectangle: ['crosshairX', 'crosshairY', '
|
|
4924
|
+
rectangle: ['crosshairX', 'crosshairY', 'labelOptions'],
|
|
4925
|
+
ellipse: ['labelOptions'],
|
|
4926
|
+
circle: ['labelOptions']
|
|
4622
4927
|
};
|
|
4623
4928
|
return NavigationBindings;
|
|
4624
4929
|
}());
|
|
@@ -4735,7 +5040,6 @@
|
|
|
4735
5040
|
* Configure the Popup strings in the chart. Requires the
|
|
4736
5041
|
* `annotations.js` or `annotations-advanced.src.js` module to be
|
|
4737
5042
|
* loaded.
|
|
4738
|
-
*
|
|
4739
5043
|
* @since 7.0.0
|
|
4740
5044
|
* @product highcharts highstock
|
|
4741
5045
|
*/
|
|
@@ -4749,6 +5053,7 @@
|
|
|
4749
5053
|
simpleShapes: 'Simple shapes',
|
|
4750
5054
|
lines: 'Lines',
|
|
4751
5055
|
circle: 'Circle',
|
|
5056
|
+
ellipse: 'Ellipse',
|
|
4752
5057
|
rectangle: 'Rectangle',
|
|
4753
5058
|
label: 'Label',
|
|
4754
5059
|
shapeOptions: 'Shape options',
|
|
@@ -4809,9 +5114,16 @@
|
|
|
4809
5114
|
* - `end`: last event to be called after last step event
|
|
4810
5115
|
*
|
|
4811
5116
|
* @type {Highcharts.Dictionary<Highcharts.NavigationBindingsOptionsObject>|*}
|
|
4812
|
-
*
|
|
4813
|
-
*
|
|
5117
|
+
*
|
|
5118
|
+
* @sample {highstock} stock/stocktools/stocktools-thresholds
|
|
5119
|
+
* Custom bindings
|
|
5120
|
+
* @sample {highcharts} highcharts/annotations/bindings/
|
|
5121
|
+
* Simple binding
|
|
5122
|
+
* @sample {highcharts} highcharts/annotations/bindings-custom-annotation/
|
|
5123
|
+
* Custom annotation binding
|
|
5124
|
+
*
|
|
4814
5125
|
* @since 7.0.0
|
|
5126
|
+
* @requires modules/annotations
|
|
4815
5127
|
* @product highcharts highstock
|
|
4816
5128
|
*/
|
|
4817
5129
|
bindings: {
|
|
@@ -4848,27 +5160,21 @@
|
|
|
4848
5160
|
},
|
|
4849
5161
|
r: 5
|
|
4850
5162
|
}]
|
|
4851
|
-
}, navigation
|
|
4852
|
-
.annotationsOptions, navigation
|
|
4853
|
-
.bindings
|
|
4854
|
-
.circleAnnotation
|
|
4855
|
-
.annotationsOptions));
|
|
5163
|
+
}, navigation.annotationsOptions, navigation.bindings.circleAnnotation.annotationsOptions));
|
|
4856
5164
|
},
|
|
4857
5165
|
/** @ignore-option */
|
|
4858
5166
|
steps: [
|
|
4859
5167
|
function (e, annotation) {
|
|
4860
5168
|
var mockPointOpts = annotation.options.shapes[0]
|
|
4861
5169
|
.point,
|
|
4862
|
-
inverted = this.chart.inverted,
|
|
4863
|
-
x,
|
|
4864
|
-
y,
|
|
4865
5170
|
distance;
|
|
4866
5171
|
if (isNumber(mockPointOpts.xAxis) &&
|
|
4867
5172
|
isNumber(mockPointOpts.yAxis)) {
|
|
4868
|
-
|
|
4869
|
-
.
|
|
4870
|
-
|
|
4871
|
-
.
|
|
5173
|
+
var inverted = this.chart.inverted,
|
|
5174
|
+
x = this.chart.xAxis[mockPointOpts.xAxis]
|
|
5175
|
+
.toPixels(mockPointOpts.x),
|
|
5176
|
+
y = this.chart.yAxis[mockPointOpts.yAxis]
|
|
5177
|
+
.toPixels(mockPointOpts.y);
|
|
4872
5178
|
distance = Math.max(Math.sqrt(Math.pow(inverted ? y - e.chartX : x - e.chartX, 2) +
|
|
4873
5179
|
Math.pow(inverted ? x - e.chartY : y - e.chartY, 2)), 5);
|
|
4874
5180
|
}
|
|
@@ -4880,6 +5186,58 @@
|
|
|
4880
5186
|
}
|
|
4881
5187
|
]
|
|
4882
5188
|
},
|
|
5189
|
+
ellipseAnnotation: {
|
|
5190
|
+
className: 'highcharts-ellipse-annotation',
|
|
5191
|
+
start: function (e) {
|
|
5192
|
+
var coords = this.chart.pointer.getCoordinates(e),
|
|
5193
|
+
coordsX = this.utils.getAssignedAxis(coords.xAxis),
|
|
5194
|
+
coordsY = this.utils.getAssignedAxis(coords.yAxis),
|
|
5195
|
+
navigation = this.chart.options.navigation;
|
|
5196
|
+
if (!coordsX || !coordsY) {
|
|
5197
|
+
return;
|
|
5198
|
+
}
|
|
5199
|
+
return this.chart.addAnnotation(merge({
|
|
5200
|
+
langKey: 'ellipse',
|
|
5201
|
+
type: 'basicAnnotation',
|
|
5202
|
+
shapes: [
|
|
5203
|
+
{
|
|
5204
|
+
type: 'ellipse',
|
|
5205
|
+
xAxis: coordsX.axis.options.index,
|
|
5206
|
+
yAxis: coordsY.axis.options.index,
|
|
5207
|
+
points: [{
|
|
5208
|
+
x: coordsX.value,
|
|
5209
|
+
y: coordsY.value
|
|
5210
|
+
}, {
|
|
5211
|
+
x: coordsX.value,
|
|
5212
|
+
y: coordsY.value
|
|
5213
|
+
}],
|
|
5214
|
+
ry: 1
|
|
5215
|
+
}
|
|
5216
|
+
]
|
|
5217
|
+
}, navigation.annotationsOptions, navigation.bindings.ellipseAnnotation.annotationOptions));
|
|
5218
|
+
},
|
|
5219
|
+
steps: [
|
|
5220
|
+
function (e, annotation) {
|
|
5221
|
+
var target = annotation.shapes[0],
|
|
5222
|
+
position = target.getAbsolutePosition(target.points[1]);
|
|
5223
|
+
target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
|
|
5224
|
+
target.redraw(false);
|
|
5225
|
+
},
|
|
5226
|
+
function (e, annotation) {
|
|
5227
|
+
var target = annotation.shapes[0],
|
|
5228
|
+
position = target.getAbsolutePosition(target.points[0]),
|
|
5229
|
+
position2 = target.getAbsolutePosition(target.points[1]),
|
|
5230
|
+
newR = target.getDistanceFromLine(position,
|
|
5231
|
+
position2,
|
|
5232
|
+
e.chartX,
|
|
5233
|
+
e.chartY),
|
|
5234
|
+
yAxis = target.getYAxis(),
|
|
5235
|
+
newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
|
|
5236
|
+
target.setYRadius(newRY);
|
|
5237
|
+
target.redraw(false);
|
|
5238
|
+
}
|
|
5239
|
+
]
|
|
5240
|
+
},
|
|
4883
5241
|
/**
|
|
4884
5242
|
* A rectangle annotation bindings. Includes `start` and one event
|
|
4885
5243
|
* in `steps` array.
|
|
@@ -4913,7 +5271,8 @@
|
|
|
4913
5271
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
4914
5272
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
4915
5273
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
4916
|
-
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y }
|
|
5274
|
+
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
5275
|
+
{ command: 'Z' }
|
|
4917
5276
|
]
|
|
4918
5277
|
}]
|
|
4919
5278
|
}, navigation
|
|
@@ -4998,7 +5357,7 @@
|
|
|
4998
5357
|
* from a different server.
|
|
4999
5358
|
*
|
|
5000
5359
|
* @type {string}
|
|
5001
|
-
* @default https://code.highcharts.com/9.
|
|
5360
|
+
* @default https://code.highcharts.com/9.3.0/gfx/stock-icons/
|
|
5002
5361
|
* @since 7.1.3
|
|
5003
5362
|
* @apioption navigation.iconsURL
|
|
5004
5363
|
*/
|
|
@@ -5054,6 +5413,7 @@
|
|
|
5054
5413
|
* @extends annotations
|
|
5055
5414
|
* @exclude crookedLine, elliottWave, fibonacci, infinityLine,
|
|
5056
5415
|
* measure, pitchfork, tunnel, verticalLine, basicAnnotation
|
|
5416
|
+
* @requires modules/annotations
|
|
5057
5417
|
* @apioption navigation.annotationsOptions
|
|
5058
5418
|
*/
|
|
5059
5419
|
annotationsOptions: {
|
|
@@ -5138,20 +5498,34 @@
|
|
|
5138
5498
|
fireEvent = U.fireEvent,
|
|
5139
5499
|
isArray = U.isArray,
|
|
5140
5500
|
isObject = U.isObject,
|
|
5141
|
-
isString = U.isString,
|
|
5142
5501
|
objectEach = U.objectEach,
|
|
5143
5502
|
pick = U.pick,
|
|
5144
5503
|
stableSort = U.stableSort,
|
|
5145
5504
|
wrap = U.wrap;
|
|
5146
|
-
var indexFilter = /\d/g, PREFIX = 'highcharts-', DIV = 'div', INPUT = 'input', LABEL = 'label', BUTTON = 'button', SELECT = 'select', OPTION = 'option', SPAN = 'span', UL = 'ul', LI = 'li', H3 = 'h3';
|
|
5505
|
+
var indexFilter = /\d/g, PREFIX = 'highcharts-', A = 'a', DIV = 'div', INPUT = 'input', LABEL = 'label', BUTTON = 'button', SELECT = 'select', OPTION = 'option', SPAN = 'span', UL = 'ul', LI = 'li', H3 = 'h3';
|
|
5506
|
+
/**
|
|
5507
|
+
* Enum for properties which should have dropdown list.
|
|
5508
|
+
* @private
|
|
5509
|
+
*/
|
|
5510
|
+
var DropdownProperties;
|
|
5511
|
+
(function (DropdownProperties) {
|
|
5512
|
+
DropdownProperties[DropdownProperties["params.algorithm"] = 0] = "params.algorithm";
|
|
5513
|
+
DropdownProperties[DropdownProperties["params.average"] = 1] = "params.average";
|
|
5514
|
+
})(DropdownProperties || (DropdownProperties = {}));
|
|
5515
|
+
/**
|
|
5516
|
+
* List of available algorithms for the specific indicator.
|
|
5517
|
+
* @private
|
|
5518
|
+
*/
|
|
5519
|
+
var dropdownParameters = {
|
|
5520
|
+
'algorithm-pivotpoints': ['standard', 'fibonacci', 'camarilla'],
|
|
5521
|
+
'average-disparityindex': ['sma', 'ema', 'dema', 'tema', 'wma']
|
|
5522
|
+
};
|
|
5147
5523
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
5148
5524
|
// onContainerMouseDown blocks internal popup events, due to e.preventDefault.
|
|
5149
5525
|
// Related issue #4606
|
|
5150
5526
|
wrap(Pointer.prototype, 'onContainerMouseDown', function (proceed, e) {
|
|
5151
|
-
var popupClass = e.target && e.target.className;
|
|
5152
5527
|
// elements is not in popup
|
|
5153
|
-
if (!(
|
|
5154
|
-
popupClass.indexOf(PREFIX + 'popup-field') >= 0)) {
|
|
5528
|
+
if (!this.inClass(e.target, PREFIX + 'popup')) {
|
|
5155
5529
|
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
|
5156
5530
|
}
|
|
5157
5531
|
});
|
|
@@ -5172,7 +5546,22 @@
|
|
|
5172
5546
|
// create popup div
|
|
5173
5547
|
this.container = createElement(DIV, {
|
|
5174
5548
|
className: PREFIX + 'popup highcharts-no-tooltip'
|
|
5175
|
-
},
|
|
5549
|
+
}, void 0, parentDiv);
|
|
5550
|
+
addEvent(this.container, 'mousedown', function () {
|
|
5551
|
+
var activeAnnotation = chart &&
|
|
5552
|
+
chart.navigationBindings &&
|
|
5553
|
+
chart.navigationBindings.activeAnnotation;
|
|
5554
|
+
if (activeAnnotation) {
|
|
5555
|
+
activeAnnotation.cancelClick = true;
|
|
5556
|
+
var unbind_1 = addEvent(H.doc, 'click',
|
|
5557
|
+
function () {
|
|
5558
|
+
setTimeout(function () {
|
|
5559
|
+
activeAnnotation.cancelClick = false;
|
|
5560
|
+
}, 0);
|
|
5561
|
+
unbind_1();
|
|
5562
|
+
});
|
|
5563
|
+
}
|
|
5564
|
+
});
|
|
5176
5565
|
this.lang = this.getLangpack();
|
|
5177
5566
|
this.iconsURL = iconsURL;
|
|
5178
5567
|
// add close button
|
|
@@ -5189,7 +5578,7 @@
|
|
|
5189
5578
|
// create close popup btn
|
|
5190
5579
|
closeBtn = createElement(DIV, {
|
|
5191
5580
|
className: PREFIX + 'popup-close'
|
|
5192
|
-
},
|
|
5581
|
+
}, void 0, this.container);
|
|
5193
5582
|
closeBtn.style['background-image'] = 'url(' +
|
|
5194
5583
|
(iconsURL.match(/png|svg|jpeg|jpg|gif/ig) ?
|
|
5195
5584
|
iconsURL : iconsURL + 'close.svg') + ')';
|
|
@@ -5218,15 +5607,15 @@
|
|
|
5218
5607
|
// left column
|
|
5219
5608
|
lhsCol = createElement(DIV, {
|
|
5220
5609
|
className: PREFIX + 'popup-lhs-col'
|
|
5221
|
-
},
|
|
5610
|
+
}, void 0, container);
|
|
5222
5611
|
// right column
|
|
5223
5612
|
rhsCol = createElement(DIV, {
|
|
5224
5613
|
className: PREFIX + 'popup-rhs-col'
|
|
5225
|
-
},
|
|
5614
|
+
}, void 0, container);
|
|
5226
5615
|
// wrapper content
|
|
5227
5616
|
createElement(DIV, {
|
|
5228
5617
|
className: PREFIX + 'popup-rhs-col-wrapper'
|
|
5229
|
-
},
|
|
5618
|
+
}, void 0, rhsCol);
|
|
5230
5619
|
return {
|
|
5231
5620
|
lhsCol: lhsCol,
|
|
5232
5621
|
rhsCol: rhsCol
|
|
@@ -5234,34 +5623,43 @@
|
|
|
5234
5623
|
},
|
|
5235
5624
|
/**
|
|
5236
5625
|
* Create input with label.
|
|
5626
|
+
*
|
|
5237
5627
|
* @private
|
|
5628
|
+
*
|
|
5238
5629
|
* @param {string} option
|
|
5239
|
-
*
|
|
5240
|
-
*
|
|
5241
|
-
*
|
|
5242
|
-
*
|
|
5243
|
-
*
|
|
5244
|
-
* @param {
|
|
5245
|
-
*
|
|
5246
|
-
*
|
|
5630
|
+
* Chain of fields i.e params.styles.fontSize separeted by the dot.
|
|
5631
|
+
*
|
|
5632
|
+
* @param {string} indicatorType
|
|
5633
|
+
* Type of the indicator i.e. sma, ema...
|
|
5634
|
+
*
|
|
5635
|
+
* @param {HTMLDOMElement} parentDiv
|
|
5636
|
+
* HTML parent element.
|
|
5637
|
+
*
|
|
5638
|
+
* @param {Highcharts.InputAttributes} inputAttributes
|
|
5639
|
+
* Attributes of the input.
|
|
5640
|
+
*
|
|
5641
|
+
* @return {HTMLInputElement}
|
|
5642
|
+
* Return created input element.
|
|
5247
5643
|
*/
|
|
5248
|
-
addInput: function (option,
|
|
5249
|
-
var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX +
|
|
5644
|
+
addInput: function (option, indicatorType, parentDiv, inputAttributes) {
|
|
5645
|
+
var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX + indicatorType + '-' + pick(inputAttributes.htmlFor, optionName);
|
|
5646
|
+
var input;
|
|
5250
5647
|
if (!inputName.match(indexFilter)) {
|
|
5251
5648
|
// add label
|
|
5252
5649
|
createElement(LABEL, {
|
|
5253
|
-
htmlFor: inputName
|
|
5650
|
+
htmlFor: inputName,
|
|
5651
|
+
className: inputAttributes.labelClassName
|
|
5254
5652
|
}, void 0, parentDiv).appendChild(doc.createTextNode(lang[optionName] || optionName));
|
|
5255
5653
|
}
|
|
5256
5654
|
// add input
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5655
|
+
input = createElement(INPUT, {
|
|
5656
|
+
name: inputName,
|
|
5657
|
+
value: inputAttributes.value,
|
|
5658
|
+
type: inputAttributes.type,
|
|
5659
|
+
className: PREFIX + 'popup-field'
|
|
5660
|
+
}, void 0, parentDiv);
|
|
5661
|
+
input.setAttribute(PREFIX + 'data-name', option);
|
|
5662
|
+
return input;
|
|
5265
5663
|
},
|
|
5266
5664
|
/**
|
|
5267
5665
|
* Create button.
|
|
@@ -5279,38 +5677,46 @@
|
|
|
5279
5677
|
* @return {Highcharts.HTMLDOMElement}
|
|
5280
5678
|
* HTML button
|
|
5281
5679
|
*/
|
|
5282
|
-
addButton: function (parentDiv, label, type,
|
|
5680
|
+
addButton: function (parentDiv, label, type, fieldsDiv, callback) {
|
|
5283
5681
|
var _self = this,
|
|
5284
5682
|
closePopup = this.closePopup,
|
|
5285
5683
|
getFields = this.getFields,
|
|
5286
5684
|
button;
|
|
5287
5685
|
button = createElement(BUTTON, void 0, void 0, parentDiv);
|
|
5288
5686
|
button.appendChild(doc.createTextNode(label));
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5687
|
+
if (callback) {
|
|
5688
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
5689
|
+
addEvent(button, eventName, function () {
|
|
5690
|
+
closePopup.call(_self);
|
|
5691
|
+
return callback(getFields(fieldsDiv, type));
|
|
5692
|
+
});
|
|
5293
5693
|
});
|
|
5294
|
-
}
|
|
5694
|
+
}
|
|
5295
5695
|
return button;
|
|
5296
5696
|
},
|
|
5297
5697
|
/**
|
|
5298
|
-
* Get values from all inputs and create JSON.
|
|
5698
|
+
* Get values from all inputs and selections then create JSON.
|
|
5699
|
+
*
|
|
5299
5700
|
* @private
|
|
5300
|
-
*
|
|
5301
|
-
* @param {
|
|
5302
|
-
*
|
|
5701
|
+
*
|
|
5702
|
+
* @param {Highcharts.HTMLDOMElement} parentDiv
|
|
5703
|
+
* The container where inputs and selections are created.
|
|
5704
|
+
*
|
|
5705
|
+
* @param {string} type
|
|
5706
|
+
* Type of the popup bookmark (add|edit|remove).
|
|
5707
|
+
*
|
|
5708
|
+
* @return {Highcharts.PopupFieldsObject}
|
|
5303
5709
|
*/
|
|
5304
5710
|
getFields: function (parentDiv, type) {
|
|
5305
|
-
var inputList = parentDiv.querySelectorAll(
|
|
5711
|
+
var inputList = Array.prototype.slice.call(parentDiv.querySelectorAll(INPUT)), selectList = Array.prototype.slice.call(parentDiv.querySelectorAll(SELECT)), optionSeries = '#' + PREFIX + 'select-series > option:checked', optionVolume = '#' + PREFIX + 'select-volume > option:checked', linkedTo = parentDiv.querySelectorAll(optionSeries)[0], volumeTo = parentDiv.querySelectorAll(optionVolume)[0];
|
|
5712
|
+
var fieldsOutput;
|
|
5306
5713
|
fieldsOutput = {
|
|
5307
5714
|
actionType: type,
|
|
5308
|
-
linkedTo: linkedTo && linkedTo.getAttribute('value'),
|
|
5715
|
+
linkedTo: linkedTo && linkedTo.getAttribute('value') || '',
|
|
5309
5716
|
fields: {}
|
|
5310
5717
|
};
|
|
5311
|
-
|
|
5312
|
-
param = input.getAttribute(PREFIX + 'data-name');
|
|
5313
|
-
seriesId = input.getAttribute(PREFIX + 'data-series-id');
|
|
5718
|
+
inputList.forEach(function (input) {
|
|
5719
|
+
var param = input.getAttribute(PREFIX + 'data-name'), seriesId = input.getAttribute(PREFIX + 'data-series-id');
|
|
5314
5720
|
// params
|
|
5315
5721
|
if (seriesId) {
|
|
5316
5722
|
fieldsOutput.seriesId = input.value;
|
|
@@ -5323,8 +5729,16 @@
|
|
|
5323
5729
|
fieldsOutput.type = input.value;
|
|
5324
5730
|
}
|
|
5325
5731
|
});
|
|
5732
|
+
selectList.forEach(function (select) {
|
|
5733
|
+
var id = select.id;
|
|
5734
|
+
// Get inputs only for the parameters, not for series and volume.
|
|
5735
|
+
if (id !== PREFIX + 'select-series' && id !== PREFIX + 'select-volume') {
|
|
5736
|
+
var parameter = id.split('highcharts-select-')[1];
|
|
5737
|
+
fieldsOutput.fields[parameter] = select.value;
|
|
5738
|
+
}
|
|
5739
|
+
});
|
|
5326
5740
|
if (volumeTo) {
|
|
5327
|
-
fieldsOutput.fields['params.volumeSeriesID'] = volumeTo.getAttribute('value');
|
|
5741
|
+
fieldsOutput.fields['params.volumeSeriesID'] = volumeTo.getAttribute('value') || '';
|
|
5328
5742
|
}
|
|
5329
5743
|
return fieldsOutput;
|
|
5330
5744
|
},
|
|
@@ -5434,13 +5848,13 @@
|
|
|
5434
5848
|
// Basic shapes:
|
|
5435
5849
|
options.shapes && options.shapes[0].type)));
|
|
5436
5850
|
// add buttons
|
|
5437
|
-
button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove',
|
|
5851
|
+
button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove', popupDiv, callback);
|
|
5438
5852
|
button.className += ' ' + PREFIX + 'annotation-remove-button';
|
|
5439
5853
|
button.style['background-image'] = 'url(' +
|
|
5440
5854
|
this.iconsURL + 'destroy.svg)';
|
|
5441
|
-
button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', function () {
|
|
5855
|
+
button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', popupDiv, function () {
|
|
5442
5856
|
showForm.call(_self, 'annotation-edit', chart, options, callback);
|
|
5443
|
-
}
|
|
5857
|
+
});
|
|
5444
5858
|
button.className += ' ' + PREFIX + 'annotation-edit-button';
|
|
5445
5859
|
button.style['background-image'] = 'url(' +
|
|
5446
5860
|
this.iconsURL + 'edit.svg)';
|
|
@@ -5474,14 +5888,14 @@
|
|
|
5474
5888
|
// left column
|
|
5475
5889
|
lhsCol = createElement(DIV, {
|
|
5476
5890
|
className: PREFIX + 'popup-lhs-col ' + PREFIX + 'popup-lhs-full'
|
|
5477
|
-
},
|
|
5891
|
+
}, void 0, popupDiv);
|
|
5478
5892
|
bottomRow = createElement(DIV, {
|
|
5479
5893
|
className: PREFIX + 'popup-bottom-row'
|
|
5480
|
-
},
|
|
5894
|
+
}, void 0, popupDiv);
|
|
5481
5895
|
this.annotations.addFormFields.call(this, lhsCol, chart, '', options, [], true);
|
|
5482
5896
|
this.addButton(bottomRow, isInit ?
|
|
5483
5897
|
(lang.addButton || 'add') :
|
|
5484
|
-
(lang.saveButton || 'save'), isInit ? 'add' : 'save',
|
|
5898
|
+
(lang.saveButton || 'save'), isInit ? 'add' : 'save', popupDiv, callback);
|
|
5485
5899
|
},
|
|
5486
5900
|
/**
|
|
5487
5901
|
* Create annotation's form fields.
|
|
@@ -5554,6 +5968,10 @@
|
|
|
5554
5968
|
}, void 0, genInput[2]).appendChild(doc.createTextNode(genInput[1]));
|
|
5555
5969
|
}
|
|
5556
5970
|
else {
|
|
5971
|
+
genInput[4] = {
|
|
5972
|
+
value: genInput[4][0],
|
|
5973
|
+
type: genInput[4][1]
|
|
5974
|
+
};
|
|
5557
5975
|
addInput.apply(genInput[0], genInput.splice(1));
|
|
5558
5976
|
}
|
|
5559
5977
|
});
|
|
@@ -5581,138 +5999,431 @@
|
|
|
5581
5999
|
.querySelectorAll('.' + PREFIX + 'tab-item-content');
|
|
5582
6000
|
// ADD tab
|
|
5583
6001
|
this.addColsContainer(tabsContainers[0]);
|
|
6002
|
+
indicators.addSearchBox.call(this, chart, tabsContainers[0]);
|
|
5584
6003
|
indicators.addIndicatorList.call(this, chart, tabsContainers[0], 'add');
|
|
5585
6004
|
buttonParentDiv = tabsContainers[0]
|
|
5586
6005
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
|
|
5587
|
-
this.addButton(buttonParentDiv, lang.addButton || 'add', 'add',
|
|
6006
|
+
this.addButton(buttonParentDiv, lang.addButton || 'add', 'add', buttonParentDiv, callback);
|
|
5588
6007
|
// EDIT tab
|
|
5589
6008
|
this.addColsContainer(tabsContainers[1]);
|
|
5590
6009
|
indicators.addIndicatorList.call(this, chart, tabsContainers[1], 'edit');
|
|
5591
6010
|
buttonParentDiv = tabsContainers[1]
|
|
5592
6011
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
|
|
5593
|
-
this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit',
|
|
5594
|
-
this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove',
|
|
6012
|
+
this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit', buttonParentDiv, callback);
|
|
6013
|
+
this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove', buttonParentDiv, callback);
|
|
6014
|
+
},
|
|
6015
|
+
/**
|
|
6016
|
+
* Filter object of series which are not indicators.
|
|
6017
|
+
* If the filter string exists, check against it.
|
|
6018
|
+
*
|
|
6019
|
+
* @private
|
|
6020
|
+
*
|
|
6021
|
+
* @param {Highcharts.FilteredSeries} series
|
|
6022
|
+
* All series are available in the plotOptions.
|
|
6023
|
+
*
|
|
6024
|
+
* @param {string|undefined} filter
|
|
6025
|
+
* Applied filter string from the input.
|
|
6026
|
+
* For the first iteration, it's an empty string.
|
|
6027
|
+
*
|
|
6028
|
+
* @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
|
|
6029
|
+
* Returns array of filtered series based on filter string.
|
|
6030
|
+
*/
|
|
6031
|
+
filterSeries: function (series, filter) {
|
|
6032
|
+
var popup = this,
|
|
6033
|
+
indicators = popup.indicators,
|
|
6034
|
+
lang = popup.chart && popup.chart.options.lang,
|
|
6035
|
+
indicatorAliases = lang &&
|
|
6036
|
+
lang.navigation &&
|
|
6037
|
+
lang.navigation.popup &&
|
|
6038
|
+
lang.navigation.popup.indicatorAliases;
|
|
6039
|
+
var filteredSeriesArray = [],
|
|
6040
|
+
filteredSeries;
|
|
6041
|
+
objectEach(series, function (series, value) {
|
|
6042
|
+
var seriesOptions = series.options;
|
|
6043
|
+
// Allow only indicators.
|
|
6044
|
+
if (series.params || seriesOptions &&
|
|
6045
|
+
seriesOptions.params) {
|
|
6046
|
+
var _a = indicators.getNameType(series,
|
|
6047
|
+
value),
|
|
6048
|
+
indicatorFullName = _a.indicatorFullName,
|
|
6049
|
+
indicatorType = _a.indicatorType;
|
|
6050
|
+
if (filter) {
|
|
6051
|
+
// Replace invalid characters.
|
|
6052
|
+
var validFilter = filter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
6053
|
+
var regex = new RegExp(validFilter, 'i'),
|
|
6054
|
+
alias = indicatorAliases &&
|
|
6055
|
+
indicatorAliases[indicatorType] &&
|
|
6056
|
+
indicatorAliases[indicatorType].join(' ') || '';
|
|
6057
|
+
if (indicatorFullName.match(regex) || alias.match(regex)) {
|
|
6058
|
+
filteredSeries = {
|
|
6059
|
+
indicatorFullName: indicatorFullName,
|
|
6060
|
+
indicatorType: indicatorType,
|
|
6061
|
+
series: series
|
|
6062
|
+
};
|
|
6063
|
+
filteredSeriesArray.push(filteredSeries);
|
|
6064
|
+
}
|
|
6065
|
+
}
|
|
6066
|
+
else {
|
|
6067
|
+
filteredSeries = {
|
|
6068
|
+
indicatorFullName: indicatorFullName,
|
|
6069
|
+
indicatorType: indicatorType,
|
|
6070
|
+
series: series
|
|
6071
|
+
};
|
|
6072
|
+
filteredSeriesArray.push(filteredSeries);
|
|
6073
|
+
}
|
|
6074
|
+
}
|
|
6075
|
+
});
|
|
6076
|
+
return filteredSeriesArray;
|
|
6077
|
+
},
|
|
6078
|
+
/**
|
|
6079
|
+
* Filter an array of series and map its names and types.
|
|
6080
|
+
*
|
|
6081
|
+
* @private
|
|
6082
|
+
*
|
|
6083
|
+
* @param {Highcharts.FilteredSeries} series
|
|
6084
|
+
* All series that are available in the plotOptions.
|
|
6085
|
+
*
|
|
6086
|
+
* @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
|
|
6087
|
+
* Returns array of filtered series based on filter string.
|
|
6088
|
+
*/
|
|
6089
|
+
filterSeriesArray: function (series) {
|
|
6090
|
+
var filteredSeriesArray = [],
|
|
6091
|
+
filteredSeries;
|
|
6092
|
+
// Allow only indicators.
|
|
6093
|
+
series.forEach(function (series) {
|
|
6094
|
+
var seriesOptions = series.options;
|
|
6095
|
+
if (series.is('sma')) {
|
|
6096
|
+
filteredSeries = {
|
|
6097
|
+
indicatorFullName: series.name,
|
|
6098
|
+
indicatorType: series.type,
|
|
6099
|
+
series: series
|
|
6100
|
+
};
|
|
6101
|
+
filteredSeriesArray.push(filteredSeries);
|
|
6102
|
+
}
|
|
6103
|
+
});
|
|
6104
|
+
return filteredSeriesArray;
|
|
5595
6105
|
},
|
|
5596
6106
|
/**
|
|
5597
6107
|
* Create HTML list of all indicators (ADD mode) or added indicators
|
|
5598
6108
|
* (EDIT mode).
|
|
6109
|
+
*
|
|
5599
6110
|
* @private
|
|
6111
|
+
*
|
|
6112
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
6113
|
+
* The chart object.
|
|
6114
|
+
*
|
|
6115
|
+
* @param {string} [optionName]
|
|
6116
|
+
* Name of the option into which selection is being added.
|
|
6117
|
+
*
|
|
6118
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
6119
|
+
* HTML parent element.
|
|
6120
|
+
*
|
|
6121
|
+
* @param {string} listType
|
|
6122
|
+
* Type of list depending on the selected bookmark.
|
|
6123
|
+
* Might be 'add' or 'edit'.
|
|
6124
|
+
*
|
|
6125
|
+
* @param {string|undefined} filter
|
|
6126
|
+
* Applied filter string from the input.
|
|
6127
|
+
* For the first iteration, it's an empty string.
|
|
5600
6128
|
*/
|
|
5601
|
-
addIndicatorList: function (chart, parentDiv, listType) {
|
|
5602
|
-
var
|
|
6129
|
+
addIndicatorList: function (chart, parentDiv, listType, filter) {
|
|
6130
|
+
var popup = this, indicators = popup.indicators, lang = popup.lang, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], rhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0], isEdit = listType === 'edit', addFormFields = this.indicators.addFormFields, series = (isEdit ?
|
|
5603
6131
|
chart.series : // EDIT mode
|
|
5604
|
-
chart.options.plotOptions // ADD mode
|
|
5605
|
-
)
|
|
5606
|
-
if (!chart) {
|
|
6132
|
+
chart.options.plotOptions || {} // ADD mode
|
|
6133
|
+
);
|
|
6134
|
+
if (!chart && series) {
|
|
5607
6135
|
return;
|
|
5608
6136
|
}
|
|
5609
|
-
|
|
6137
|
+
var rhsColWrapper,
|
|
6138
|
+
indicatorList,
|
|
6139
|
+
item,
|
|
6140
|
+
filteredSeriesArray = [];
|
|
6141
|
+
// Filter and sort the series.
|
|
6142
|
+
if (!isEdit && !isArray(series)) {
|
|
6143
|
+
// Apply filters only for the 'add' indicator list.
|
|
6144
|
+
filteredSeriesArray = indicators.filterSeries.call(this, series, filter);
|
|
6145
|
+
}
|
|
6146
|
+
else if (isArray(series)) {
|
|
6147
|
+
filteredSeriesArray = indicators.filterSeriesArray.call(this, series);
|
|
6148
|
+
}
|
|
6149
|
+
// Sort indicators alphabeticaly.
|
|
6150
|
+
stableSort(filteredSeriesArray, function (a, b) {
|
|
6151
|
+
var seriesAName = a.indicatorFullName.toLowerCase(),
|
|
6152
|
+
seriesBName = b.indicatorFullName.toLowerCase();
|
|
6153
|
+
return (seriesAName < seriesBName) ?
|
|
6154
|
+
-1 : (seriesAName > seriesBName) ? 1 : 0;
|
|
6155
|
+
});
|
|
6156
|
+
// If the list exists remove it from the DOM
|
|
6157
|
+
// in order to create a new one with different filters.
|
|
6158
|
+
if (lhsCol.children[1]) {
|
|
6159
|
+
lhsCol.children[1].remove();
|
|
6160
|
+
}
|
|
6161
|
+
// Create wrapper for list.
|
|
5610
6162
|
indicatorList = createElement(UL, {
|
|
5611
6163
|
className: PREFIX + 'indicator-list'
|
|
5612
|
-
},
|
|
6164
|
+
}, void 0, lhsCol);
|
|
5613
6165
|
rhsColWrapper = rhsCol
|
|
5614
6166
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col-wrapper')[0];
|
|
5615
|
-
|
|
5616
|
-
var
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
});
|
|
6167
|
+
filteredSeriesArray.forEach(function (seriesSet) {
|
|
6168
|
+
var indicatorFullName = seriesSet.indicatorFullName,
|
|
6169
|
+
indicatorType = seriesSet.indicatorType,
|
|
6170
|
+
series = seriesSet.series;
|
|
6171
|
+
item = createElement(LI, {
|
|
6172
|
+
className: PREFIX + 'indicator-list'
|
|
6173
|
+
}, void 0, indicatorList);
|
|
6174
|
+
item.appendChild(doc.createTextNode(indicatorFullName));
|
|
6175
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
6176
|
+
addEvent(item, eventName, function () {
|
|
6177
|
+
var button = rhsColWrapper.parentNode.children[1];
|
|
6178
|
+
addFormFields.call(popup, chart, series, indicatorType, rhsColWrapper);
|
|
6179
|
+
if (button) {
|
|
6180
|
+
button.style.display = 'block';
|
|
6181
|
+
}
|
|
6182
|
+
// add hidden input with series.id
|
|
6183
|
+
if (isEdit && series.options) {
|
|
6184
|
+
createElement(INPUT, {
|
|
6185
|
+
type: 'hidden',
|
|
6186
|
+
name: PREFIX + 'id-' + indicatorType,
|
|
6187
|
+
value: series.options.id
|
|
6188
|
+
}, void 0, rhsColWrapper).setAttribute(PREFIX + 'data-series-id', series.options.id);
|
|
6189
|
+
}
|
|
5639
6190
|
});
|
|
5640
|
-
}
|
|
6191
|
+
});
|
|
5641
6192
|
});
|
|
5642
6193
|
// select first item from the list
|
|
5643
6194
|
if (indicatorList.childNodes.length > 0) {
|
|
5644
6195
|
indicatorList.childNodes[0].click();
|
|
5645
6196
|
}
|
|
6197
|
+
else if (!isEdit) {
|
|
6198
|
+
rhsColWrapper.parentNode.children[0].innerHTML = lang.noFilterMatch || '';
|
|
6199
|
+
rhsColWrapper.parentNode.children[1].style.display = 'none';
|
|
6200
|
+
}
|
|
6201
|
+
},
|
|
6202
|
+
/**
|
|
6203
|
+
* Add searchbox HTML element and its' label.
|
|
6204
|
+
*
|
|
6205
|
+
* @private
|
|
6206
|
+
*
|
|
6207
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
6208
|
+
* The chart object.
|
|
6209
|
+
*
|
|
6210
|
+
* @param {HTMLDOMElement} parentDiv
|
|
6211
|
+
* HTML parent element.
|
|
6212
|
+
*/
|
|
6213
|
+
addSearchBox: function (chart, parentDiv) {
|
|
6214
|
+
var popup = this, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], options = 'searchIndicators', inputAttributes = {
|
|
6215
|
+
value: '',
|
|
6216
|
+
type: 'text',
|
|
6217
|
+
htmlFor: 'search-indicators',
|
|
6218
|
+
labelClassName: 'highcharts-input-search-indicators-label'
|
|
6219
|
+
}, clearFilterText = this.lang.clearFilter, inputWrapper = createElement(DIV, {
|
|
6220
|
+
className: 'highcharts-input-wrapper'
|
|
6221
|
+
}, void 0, lhsCol);
|
|
6222
|
+
var handleInputChange = function (inputText) {
|
|
6223
|
+
// Apply some filters.
|
|
6224
|
+
popup.indicators.addIndicatorList.call(popup,
|
|
6225
|
+
chart,
|
|
6226
|
+
popup.container, 'add',
|
|
6227
|
+
inputText);
|
|
6228
|
+
};
|
|
6229
|
+
// Add input field with the label and button.
|
|
6230
|
+
var input = this.addInput(options,
|
|
6231
|
+
INPUT,
|
|
6232
|
+
inputWrapper,
|
|
6233
|
+
inputAttributes),
|
|
6234
|
+
button = createElement(A, {
|
|
6235
|
+
textContent: clearFilterText
|
|
6236
|
+
},
|
|
6237
|
+
void 0,
|
|
6238
|
+
inputWrapper);
|
|
6239
|
+
input.classList.add('highcharts-input-search-indicators');
|
|
6240
|
+
button.classList.add('clear-filter-button');
|
|
6241
|
+
// Add input change events.
|
|
6242
|
+
addEvent(input, 'input', function (e) {
|
|
6243
|
+
handleInputChange(this.value);
|
|
6244
|
+
// Show clear filter button.
|
|
6245
|
+
if (this.value.length) {
|
|
6246
|
+
button.style.display = 'inline-block';
|
|
6247
|
+
}
|
|
6248
|
+
else {
|
|
6249
|
+
button.style.display = 'none';
|
|
6250
|
+
}
|
|
6251
|
+
});
|
|
6252
|
+
// Add clear filter click event.
|
|
6253
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
6254
|
+
addEvent(button, eventName, function () {
|
|
6255
|
+
// Clear the input.
|
|
6256
|
+
input.value = '';
|
|
6257
|
+
handleInputChange('');
|
|
6258
|
+
// Hide clear filter button- no longer nececary.
|
|
6259
|
+
button.style.display = 'none';
|
|
6260
|
+
});
|
|
6261
|
+
});
|
|
6262
|
+
},
|
|
6263
|
+
/**
|
|
6264
|
+
* Add selection HTML element and its' label.
|
|
6265
|
+
*
|
|
6266
|
+
* @private
|
|
6267
|
+
*
|
|
6268
|
+
* @param {string} indicatorType
|
|
6269
|
+
* Type of the indicator i.e. sma, ema...
|
|
6270
|
+
*
|
|
6271
|
+
* @param {string} [optionName]
|
|
6272
|
+
* Name of the option into which selection is being added.
|
|
6273
|
+
*
|
|
6274
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
6275
|
+
* HTML parent element.
|
|
6276
|
+
*
|
|
6277
|
+
* @return {HTMLSelectElement}
|
|
6278
|
+
*/
|
|
6279
|
+
addSelection: function (indicatorType, optionName, parentDiv) {
|
|
6280
|
+
var optionParamList = optionName.split('.'),
|
|
6281
|
+
labelText = optionParamList[optionParamList.length - 1];
|
|
6282
|
+
var selectName = PREFIX + optionName + '-type-' + indicatorType,
|
|
6283
|
+
lang = this.lang,
|
|
6284
|
+
selectBox;
|
|
6285
|
+
// Add a label for the selection box.
|
|
6286
|
+
createElement(LABEL, {
|
|
6287
|
+
htmlFor: selectName
|
|
6288
|
+
}, null, parentDiv).appendChild(doc.createTextNode(lang[labelText] || optionName));
|
|
6289
|
+
// Create a selection box.
|
|
6290
|
+
selectBox = createElement(SELECT, {
|
|
6291
|
+
name: selectName,
|
|
6292
|
+
className: PREFIX + 'popup-field',
|
|
6293
|
+
id: PREFIX + 'select-' + optionName
|
|
6294
|
+
}, null, parentDiv);
|
|
6295
|
+
selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
|
|
6296
|
+
return selectBox;
|
|
6297
|
+
},
|
|
6298
|
+
/**
|
|
6299
|
+
* Get and add selection options.
|
|
6300
|
+
*
|
|
6301
|
+
* @private
|
|
6302
|
+
*
|
|
6303
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
6304
|
+
* The chart object.
|
|
6305
|
+
*
|
|
6306
|
+
* @param {string} [optionName]
|
|
6307
|
+
* Name of the option into which selection is being added.
|
|
6308
|
+
*
|
|
6309
|
+
* @param {HTMLSelectElement} [selectBox]
|
|
6310
|
+
* HTML select box element to which the options are being added.
|
|
6311
|
+
*
|
|
6312
|
+
* @param {string|undefined} indicatorType
|
|
6313
|
+
* Type of the indicator i.e. sma, ema...
|
|
6314
|
+
*
|
|
6315
|
+
* @param {string|undefined} parameterName
|
|
6316
|
+
* Name of the parameter which should be applied.
|
|
6317
|
+
*
|
|
6318
|
+
* @param {string|undefined} selectedOption
|
|
6319
|
+
* Default value in dropdown.
|
|
6320
|
+
*/
|
|
6321
|
+
addSelectionOptions: function (chart, optionName, selectBox, indicatorType, parameterName, selectedOption, currentSeries) {
|
|
6322
|
+
var popup = this;
|
|
6323
|
+
// Get and apply selection options for the possible series.
|
|
6324
|
+
if (optionName === 'series' || optionName === 'volume') {
|
|
6325
|
+
// List all series which have id - mandatory for indicator.
|
|
6326
|
+
chart.series.forEach(function (series) {
|
|
6327
|
+
var seriesOptions = series.options,
|
|
6328
|
+
seriesName = seriesOptions.name ||
|
|
6329
|
+
seriesOptions.params ? series.name : seriesOptions.id || '';
|
|
6330
|
+
if (seriesOptions.id !== PREFIX + 'navigator-series' &&
|
|
6331
|
+
seriesOptions.id !== (currentSeries && currentSeries.options && currentSeries.options.id)) {
|
|
6332
|
+
if (!defined(selectedOption) &&
|
|
6333
|
+
optionName === 'volume' &&
|
|
6334
|
+
series.type === 'column') {
|
|
6335
|
+
selectedOption = seriesOptions.id;
|
|
6336
|
+
}
|
|
6337
|
+
createElement(OPTION, {
|
|
6338
|
+
value: seriesOptions.id
|
|
6339
|
+
}, void 0, selectBox).appendChild(doc.createTextNode(seriesName));
|
|
6340
|
+
}
|
|
6341
|
+
});
|
|
6342
|
+
}
|
|
6343
|
+
else if (indicatorType && parameterName) {
|
|
6344
|
+
// Get and apply options for the possible parameters.
|
|
6345
|
+
var dropdownKey = parameterName + '-' + indicatorType,
|
|
6346
|
+
parameterOption = dropdownParameters[dropdownKey];
|
|
6347
|
+
parameterOption.forEach(function (element) {
|
|
6348
|
+
createElement(OPTION, {
|
|
6349
|
+
value: element
|
|
6350
|
+
}, void 0, selectBox).appendChild(doc.createTextNode(element));
|
|
6351
|
+
});
|
|
6352
|
+
}
|
|
6353
|
+
// Add the default dropdown value if defined.
|
|
6354
|
+
if (defined(selectedOption)) {
|
|
6355
|
+
selectBox.value = selectedOption;
|
|
6356
|
+
}
|
|
5646
6357
|
},
|
|
5647
6358
|
/**
|
|
5648
6359
|
* Extract full name and type of requested indicator.
|
|
6360
|
+
*
|
|
5649
6361
|
* @private
|
|
6362
|
+
*
|
|
5650
6363
|
* @param {Highcharts.Series} series
|
|
5651
|
-
*
|
|
5652
|
-
*
|
|
5653
|
-
*
|
|
5654
|
-
* @
|
|
6364
|
+
* Series which name is needed(EDITmode - defaultOptions.series,
|
|
6365
|
+
* ADDmode - indicator series).
|
|
6366
|
+
*
|
|
6367
|
+
* @param {string} [IndicatorType]
|
|
6368
|
+
* Type of the indicator i.e. sma, ema...
|
|
6369
|
+
*
|
|
6370
|
+
* @return Highcharts.Dictionary<string>
|
|
6371
|
+
* Full name and series type.
|
|
5655
6372
|
*/
|
|
5656
|
-
getNameType: function (series,
|
|
6373
|
+
getNameType: function (series, indicatorType) {
|
|
5657
6374
|
var options = series.options,
|
|
5658
|
-
seriesTypes = H.seriesTypes
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
seriesTypes[
|
|
5662
|
-
|
|
6375
|
+
seriesTypes = H.seriesTypes;
|
|
6376
|
+
// add mode
|
|
6377
|
+
var seriesName = (seriesTypes[indicatorType] &&
|
|
6378
|
+
seriesTypes[indicatorType].prototype.nameBase) ||
|
|
6379
|
+
indicatorType.toUpperCase(),
|
|
6380
|
+
seriesType = indicatorType;
|
|
5663
6381
|
// edit
|
|
5664
6382
|
if (options && options.type) {
|
|
5665
6383
|
seriesType = series.options.type;
|
|
5666
6384
|
seriesName = series.name;
|
|
5667
6385
|
}
|
|
5668
6386
|
return {
|
|
5669
|
-
|
|
5670
|
-
|
|
6387
|
+
indicatorFullName: seriesName,
|
|
6388
|
+
indicatorType: seriesType
|
|
5671
6389
|
};
|
|
5672
6390
|
},
|
|
5673
6391
|
/**
|
|
5674
|
-
*
|
|
5675
|
-
*
|
|
6392
|
+
* Create the selection box for the series,
|
|
6393
|
+
* add options and apply the default one.
|
|
6394
|
+
*
|
|
5676
6395
|
* @private
|
|
5677
|
-
*
|
|
5678
|
-
*
|
|
5679
|
-
*
|
|
5680
|
-
*
|
|
5681
|
-
* @param {
|
|
5682
|
-
*
|
|
5683
|
-
*
|
|
5684
|
-
*
|
|
5685
|
-
*
|
|
5686
|
-
*
|
|
6396
|
+
*
|
|
6397
|
+
* @param {string} indicatorType
|
|
6398
|
+
* Type of the indicator i.e. sma, ema...
|
|
6399
|
+
*
|
|
6400
|
+
* @param {string} [optionName]
|
|
6401
|
+
* Name of the option into which selection is being added.
|
|
6402
|
+
*
|
|
6403
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
6404
|
+
* The chart object.
|
|
6405
|
+
*
|
|
6406
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
6407
|
+
* HTML parent element.
|
|
6408
|
+
*
|
|
6409
|
+
* @param {string|undefined} selectedOption
|
|
6410
|
+
* Default value in dropdown.
|
|
5687
6411
|
*/
|
|
5688
|
-
listAllSeries: function (
|
|
5689
|
-
var
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
seriesOptions;
|
|
6412
|
+
listAllSeries: function (indicatorType, optionName, chart, parentDiv, currentSeries, selectedOption) {
|
|
6413
|
+
var popup = this,
|
|
6414
|
+
indicators = popup.indicators;
|
|
6415
|
+
// Won't work without the chart.
|
|
5693
6416
|
if (!chart) {
|
|
5694
6417
|
return;
|
|
5695
6418
|
}
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
|
|
5705
|
-
// list all series which have id - mandatory for creating indicator
|
|
5706
|
-
chart.series.forEach(function (serie) {
|
|
5707
|
-
seriesOptions = serie.options;
|
|
5708
|
-
if (!seriesOptions.params &&
|
|
5709
|
-
seriesOptions.id &&
|
|
5710
|
-
seriesOptions.id !== PREFIX + 'navigator-series') {
|
|
5711
|
-
createElement(OPTION, {
|
|
5712
|
-
value: seriesOptions.id
|
|
5713
|
-
}, null, selectBox).appendChild(doc.createTextNode(seriesOptions.name || seriesOptions.id));
|
|
5714
|
-
}
|
|
5715
|
-
});
|
|
6419
|
+
// Add selection boxes.
|
|
6420
|
+
var selectBox = indicators.addSelection.call(popup,
|
|
6421
|
+
indicatorType,
|
|
6422
|
+
optionName,
|
|
6423
|
+
parentDiv);
|
|
6424
|
+
// Add possible dropdown options.
|
|
6425
|
+
indicators.addSelectionOptions.call(popup, chart, optionName, selectBox, void 0, void 0, void 0, currentSeries);
|
|
6426
|
+
// Add the default dropdown value if defined.
|
|
5716
6427
|
if (defined(selectedOption)) {
|
|
5717
6428
|
selectBox.value = selectedOption;
|
|
5718
6429
|
}
|
|
@@ -5741,17 +6452,17 @@
|
|
|
5741
6452
|
// create title (indicator name in the right column)
|
|
5742
6453
|
createElement(H3, {
|
|
5743
6454
|
className: PREFIX + 'indicator-title'
|
|
5744
|
-
}, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).
|
|
6455
|
+
}, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).indicatorFullName));
|
|
5745
6456
|
// input type
|
|
5746
6457
|
createElement(INPUT, {
|
|
5747
6458
|
type: 'hidden',
|
|
5748
6459
|
name: PREFIX + 'type-' + seriesType,
|
|
5749
6460
|
value: seriesType
|
|
5750
|
-
},
|
|
6461
|
+
}, void 0, rhsColWrapper);
|
|
5751
6462
|
// list all series with id
|
|
5752
|
-
this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series.linkedParent &&
|
|
6463
|
+
this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series, series.linkedParent && series.linkedParent.options.id);
|
|
5753
6464
|
if (fields.volumeSeriesID) {
|
|
5754
|
-
this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series.linkedParent &&
|
|
6465
|
+
this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series, series.linkedParent && fields.volumeSeriesID);
|
|
5755
6466
|
}
|
|
5756
6467
|
// add param fields
|
|
5757
6468
|
this.indicators.addParamInputs.call(this, chart, 'params', fields, seriesType, rhsColWrapper);
|
|
@@ -5773,8 +6484,9 @@
|
|
|
5773
6484
|
* Element where created HTML list is added
|
|
5774
6485
|
*/
|
|
5775
6486
|
addParamInputs: function (chart, parentNode, fields, type, parentDiv) {
|
|
5776
|
-
var
|
|
5777
|
-
|
|
6487
|
+
var popup = this,
|
|
6488
|
+
indicators = popup.indicators;
|
|
6489
|
+
var addParamInputs = this.indicators.addParamInputs,
|
|
5778
6490
|
addInput = this.addInput,
|
|
5779
6491
|
parentFullName;
|
|
5780
6492
|
if (!chart) {
|
|
@@ -5783,16 +6495,33 @@
|
|
|
5783
6495
|
objectEach(fields, function (value, fieldName) {
|
|
5784
6496
|
// create name like params.styles.fontSize
|
|
5785
6497
|
parentFullName = parentNode + '.' + fieldName;
|
|
5786
|
-
if (value
|
|
6498
|
+
if (defined(value) && // skip if field is unnecessary, #15362
|
|
6499
|
+
parentFullName) {
|
|
5787
6500
|
if (isObject(value)) {
|
|
5788
6501
|
addInput.call(// (15733) 'Periods' has an arrayed value. Label must be created here.
|
|
5789
|
-
|
|
5790
|
-
addParamInputs.call(
|
|
6502
|
+
popup, parentFullName, type, parentDiv, {});
|
|
6503
|
+
addParamInputs.call(popup, chart, parentFullName, value, type, parentDiv);
|
|
6504
|
+
}
|
|
6505
|
+
// If the option is listed in dropdown enum,
|
|
6506
|
+
// add the selection box for it.
|
|
6507
|
+
if (parentFullName in DropdownProperties) {
|
|
6508
|
+
// Add selection boxes.
|
|
6509
|
+
var selectBox = indicators.addSelection.call(popup,
|
|
6510
|
+
type,
|
|
6511
|
+
parentFullName,
|
|
6512
|
+
parentDiv);
|
|
6513
|
+
// Add possible dropdown options.
|
|
6514
|
+
indicators.addSelectionOptions.call(popup, chart, parentNode, selectBox, type, fieldName, value);
|
|
5791
6515
|
}
|
|
5792
6516
|
else if (
|
|
5793
|
-
//
|
|
5794
|
-
parentFullName !== 'params.volumeSeriesID'
|
|
5795
|
-
|
|
6517
|
+
// Skip volume field which is created by addFormFields.
|
|
6518
|
+
parentFullName !== 'params.volumeSeriesID' &&
|
|
6519
|
+
!isArray(value) // Skip params declared in array.
|
|
6520
|
+
) {
|
|
6521
|
+
addInput.call(popup, parentFullName, type, parentDiv, {
|
|
6522
|
+
value: value,
|
|
6523
|
+
type: 'text'
|
|
6524
|
+
} // all inputs are text type
|
|
5796
6525
|
);
|
|
5797
6526
|
}
|
|
5798
6527
|
}
|
|
@@ -5875,7 +6604,7 @@
|
|
|
5875
6604
|
var popupDiv = this.popup.container;
|
|
5876
6605
|
return createElement(DIV, {
|
|
5877
6606
|
className: PREFIX + 'tab-item-content ' + PREFIX + 'no-mousewheel' // #12100
|
|
5878
|
-
},
|
|
6607
|
+
}, void 0, popupDiv);
|
|
5879
6608
|
},
|
|
5880
6609
|
/**
|
|
5881
6610
|
* Add click event to each tab
|
|
@@ -5938,7 +6667,7 @@
|
|
|
5938
6667
|
this.popup = new H.Popup(this.chart.container, (this.chart.options.navigation.iconsURL ||
|
|
5939
6668
|
(this.chart.options.stockTools &&
|
|
5940
6669
|
this.chart.options.stockTools.gui.iconsURL) ||
|
|
5941
|
-
'https://code.highcharts.com/9.
|
|
6670
|
+
'https://code.highcharts.com/9.3.0/gfx/stock-icons/'), this.chart);
|
|
5942
6671
|
}
|
|
5943
6672
|
this.popup.showForm(config.formType, this.chart, config.options, config.onSubmit);
|
|
5944
6673
|
});
|