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) {
|
|
@@ -3898,10 +4162,11 @@
|
|
|
3898
4162
|
var options = this.options;
|
|
3899
4163
|
if (options.shapes) {
|
|
3900
4164
|
delete options.labelOptions;
|
|
3901
|
-
if (options.shapes[0].type
|
|
3902
|
-
this.basicType =
|
|
4165
|
+
if (options.shapes[0].type) {
|
|
4166
|
+
this.basicType = options.shapes[0].type;
|
|
3903
4167
|
}
|
|
3904
4168
|
else {
|
|
4169
|
+
// Defalut shape would be rectangle.
|
|
3905
4170
|
this.basicType = 'rectangle';
|
|
3906
4171
|
}
|
|
3907
4172
|
}
|
|
@@ -4026,6 +4291,64 @@
|
|
|
4026
4291
|
target.redraw(false);
|
|
4027
4292
|
}
|
|
4028
4293
|
}
|
|
4294
|
+
}],
|
|
4295
|
+
ellipse: [{
|
|
4296
|
+
positioner: function (target) {
|
|
4297
|
+
var position = target.getAbsolutePosition(target.points[0]);
|
|
4298
|
+
return {
|
|
4299
|
+
x: position.x - this.graphic.width / 2,
|
|
4300
|
+
y: position.y - this.graphic.height / 2
|
|
4301
|
+
};
|
|
4302
|
+
},
|
|
4303
|
+
events: {
|
|
4304
|
+
drag: function (e, target) {
|
|
4305
|
+
var position = target.getAbsolutePosition(target.points[0]);
|
|
4306
|
+
target.translatePoint(e.chartX - position.x, e.chartY - position.y, 0);
|
|
4307
|
+
target.redraw(false);
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
}, {
|
|
4311
|
+
positioner: function (target) {
|
|
4312
|
+
var position = target.getAbsolutePosition(target.points[1]);
|
|
4313
|
+
return {
|
|
4314
|
+
x: position.x - this.graphic.width / 2,
|
|
4315
|
+
y: position.y - this.graphic.height / 2
|
|
4316
|
+
};
|
|
4317
|
+
},
|
|
4318
|
+
events: {
|
|
4319
|
+
drag: function (e, target) {
|
|
4320
|
+
var position = target.getAbsolutePosition(target.points[1]);
|
|
4321
|
+
target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
|
|
4322
|
+
target.redraw(false);
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4325
|
+
}, {
|
|
4326
|
+
positioner: function (target) {
|
|
4327
|
+
var position = target.getAbsolutePosition(target.points[0]),
|
|
4328
|
+
position2 = target.getAbsolutePosition(target.points[1]),
|
|
4329
|
+
attrs = target.getAttrs(position,
|
|
4330
|
+
position2);
|
|
4331
|
+
return {
|
|
4332
|
+
x: attrs.cx - this.graphic.width / 2 +
|
|
4333
|
+
attrs.ry * Math.sin((attrs.angle * Math.PI) / 180),
|
|
4334
|
+
y: attrs.cy - this.graphic.height / 2 -
|
|
4335
|
+
attrs.ry * Math.cos((attrs.angle * Math.PI) / 180)
|
|
4336
|
+
};
|
|
4337
|
+
},
|
|
4338
|
+
events: {
|
|
4339
|
+
drag: function (e, target) {
|
|
4340
|
+
var position = target.getAbsolutePosition(target.points[0]),
|
|
4341
|
+
position2 = target.getAbsolutePosition(target.points[1]),
|
|
4342
|
+
newR = target.getDistanceFromLine(position,
|
|
4343
|
+
position2,
|
|
4344
|
+
e.chartX,
|
|
4345
|
+
e.chartY),
|
|
4346
|
+
yAxis = target.getYAxis(),
|
|
4347
|
+
newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
|
|
4348
|
+
target.setYRadius(newRY);
|
|
4349
|
+
target.redraw(false);
|
|
4350
|
+
}
|
|
4351
|
+
}
|
|
4029
4352
|
}]
|
|
4030
4353
|
};
|
|
4031
4354
|
return BasicAnnotation;
|
|
@@ -4124,7 +4447,7 @@
|
|
|
4124
4447
|
return target.annotation.points[i];
|
|
4125
4448
|
};
|
|
4126
4449
|
})
|
|
4127
|
-
}),
|
|
4450
|
+
}), 0);
|
|
4128
4451
|
typeOptions.line = shape.options;
|
|
4129
4452
|
};
|
|
4130
4453
|
return CrookedLine;
|
|
@@ -4422,14 +4745,14 @@
|
|
|
4422
4745
|
},
|
|
4423
4746
|
this.points[3]
|
|
4424
4747
|
]
|
|
4425
|
-
}),
|
|
4748
|
+
}), 0);
|
|
4426
4749
|
this.options.typeOptions.line = line.options;
|
|
4427
4750
|
};
|
|
4428
4751
|
Tunnel.prototype.addBackground = function () {
|
|
4429
4752
|
var background = this.initShape(merge(this.options.typeOptions.background, {
|
|
4430
4753
|
type: 'path',
|
|
4431
4754
|
points: this.points.slice()
|
|
4432
|
-
}));
|
|
4755
|
+
}), 1);
|
|
4433
4756
|
this.options.typeOptions.background = background.options;
|
|
4434
4757
|
};
|
|
4435
4758
|
/**
|
|
@@ -4469,8 +4792,6 @@
|
|
|
4469
4792
|
*/
|
|
4470
4793
|
{
|
|
4471
4794
|
typeOptions: {
|
|
4472
|
-
xAxis: 0,
|
|
4473
|
-
yAxis: 0,
|
|
4474
4795
|
/**
|
|
4475
4796
|
* Background options.
|
|
4476
4797
|
*
|
|
@@ -4530,7 +4851,7 @@
|
|
|
4530
4851
|
visiblePlotOnly: true
|
|
4531
4852
|
})) {
|
|
4532
4853
|
var translation = this.mouseMoveToTranslation(e);
|
|
4533
|
-
target.translateSide(translation.x, translation.y, this.index);
|
|
4854
|
+
target.translateSide(translation.x, translation.y, !!this.index);
|
|
4534
4855
|
target.redraw(false);
|
|
4535
4856
|
}
|
|
4536
4857
|
}
|
|
@@ -4689,8 +5010,7 @@
|
|
|
4689
5010
|
var line = this.initShape(merge(typeOptions.line, {
|
|
4690
5011
|
type: 'path',
|
|
4691
5012
|
points: points
|
|
4692
|
-
}),
|
|
4693
|
-
false);
|
|
5013
|
+
}), 0);
|
|
4694
5014
|
typeOptions.line = line.options;
|
|
4695
5015
|
};
|
|
4696
5016
|
/**
|
|
@@ -4733,8 +5053,10 @@
|
|
|
4733
5053
|
|
|
4734
5054
|
return InfinityLine;
|
|
4735
5055
|
});
|
|
4736
|
-
_registerModule(_modules, 'Extensions/Annotations/Types/
|
|
5056
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/TimeCycles.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/Types/CrookedLine.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Core/Utilities.js']], function (Annotation, CrookedLine, ControlPoint, U) {
|
|
4737
5057
|
/* *
|
|
5058
|
+
*
|
|
5059
|
+
* Authors: Rafal Sebestjanski and Pawel Lysy
|
|
4738
5060
|
*
|
|
4739
5061
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4740
5062
|
*
|
|
@@ -4755,74 +5077,301 @@
|
|
|
4755
5077
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4756
5078
|
};
|
|
4757
5079
|
})();
|
|
4758
|
-
var merge = U.merge
|
|
5080
|
+
var merge = U.merge,
|
|
5081
|
+
isNumber = U.isNumber,
|
|
5082
|
+
defined = U.defined;
|
|
5083
|
+
/**
|
|
5084
|
+
* Function to create start of the path.
|
|
5085
|
+
* @param {number} x x position of the TimeCycles
|
|
5086
|
+
* @param {number} y y position of the TimeCycles
|
|
5087
|
+
* @return {string} path
|
|
5088
|
+
*/
|
|
5089
|
+
function getStartingPath(x, y) {
|
|
5090
|
+
return ['M', x, y];
|
|
5091
|
+
}
|
|
5092
|
+
/**
|
|
5093
|
+
* Function which generates the path of the halfcircle.
|
|
5094
|
+
*
|
|
5095
|
+
* @param {number} pixelInterval diameter of the circle in pixels
|
|
5096
|
+
* @param {number} numberOfCircles number of cricles
|
|
5097
|
+
* @param {number} startX x position of the first circle
|
|
5098
|
+
* @param {number} y y position of the bottom of the timeCycles
|
|
5099
|
+
* @return {string} path
|
|
5100
|
+
*
|
|
5101
|
+
*/
|
|
5102
|
+
function getCirclePath(pixelInterval, numberOfCircles, startX, y) {
|
|
5103
|
+
var strToRepeat = function (i) { return [
|
|
5104
|
+
'A',
|
|
5105
|
+
pixelInterval / 2,
|
|
5106
|
+
pixelInterval / 2,
|
|
5107
|
+
0,
|
|
5108
|
+
1,
|
|
5109
|
+
1,
|
|
5110
|
+
startX + i * pixelInterval,
|
|
5111
|
+
y
|
|
5112
|
+
]; };
|
|
5113
|
+
var path = [];
|
|
5114
|
+
for (var i = 1; i <= numberOfCircles; i++) {
|
|
5115
|
+
path.push(strToRepeat(i));
|
|
5116
|
+
}
|
|
5117
|
+
return path;
|
|
5118
|
+
}
|
|
5119
|
+
/* *
|
|
5120
|
+
*
|
|
5121
|
+
* Class
|
|
5122
|
+
*
|
|
5123
|
+
* */
|
|
4759
5124
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4760
|
-
var
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
5125
|
+
var TimeCycles = /** @class */ (function (_super) {
|
|
5126
|
+
__extends(TimeCycles, _super);
|
|
5127
|
+
function TimeCycles() {
|
|
5128
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5129
|
+
}
|
|
5130
|
+
TimeCycles.prototype.init = function (annotation, options, index) {
|
|
5131
|
+
if (defined(options.yAxis)) {
|
|
5132
|
+
options.points.forEach(function (point) {
|
|
5133
|
+
point.yAxis = options.yAxis;
|
|
5134
|
+
});
|
|
4766
5135
|
}
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
Math.round(leftTop.x),
|
|
4772
|
-
Math.round(leftTop.y)],
|
|
4773
|
-
['L',
|
|
4774
|
-
Math.round(rightTop.x),
|
|
4775
|
-
Math.round(rightTop.y)]
|
|
4776
|
-
],
|
|
4777
|
-
rightBottom,
|
|
4778
|
-
leftBottom;
|
|
4779
|
-
if (isBackground) {
|
|
4780
|
-
rightBottom = this.anchor(annotation.endRetracements[retracementIndex - 1]).absolutePosition;
|
|
4781
|
-
leftBottom = this.anchor(annotation.startRetracements[retracementIndex - 1]).absolutePosition;
|
|
4782
|
-
d.push(['L', Math.round(rightBottom.x), Math.round(rightBottom.y)], ['L', Math.round(leftBottom.x), Math.round(leftBottom.y)]);
|
|
5136
|
+
if (defined(options.xAxis)) {
|
|
5137
|
+
options.points.forEach(function (point) {
|
|
5138
|
+
point.xAxis = options.xAxis;
|
|
5139
|
+
});
|
|
4783
5140
|
}
|
|
4784
|
-
|
|
5141
|
+
_super.prototype.init.call(this, annotation, options, index);
|
|
4785
5142
|
};
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
__extends(Fibonacci, _super);
|
|
4789
|
-
/* *
|
|
4790
|
-
*
|
|
4791
|
-
* Constructors
|
|
4792
|
-
*
|
|
4793
|
-
* */
|
|
4794
|
-
function Fibonacci(chart, options) {
|
|
4795
|
-
return _super.call(this, chart, options) || this;
|
|
4796
|
-
}
|
|
4797
|
-
/* *
|
|
4798
|
-
*
|
|
4799
|
-
* Functions
|
|
4800
|
-
*
|
|
4801
|
-
* */
|
|
4802
|
-
Fibonacci.prototype.linkPoints = function () {
|
|
4803
|
-
_super.prototype.linkPoints.call(this);
|
|
4804
|
-
this.linkRetracementsPoints();
|
|
4805
|
-
return;
|
|
5143
|
+
TimeCycles.prototype.setPath = function () {
|
|
5144
|
+
this.shapes[0].options.d = this.getPath();
|
|
4806
5145
|
};
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
startDiff = points[0].y - points[3].y,
|
|
4810
|
-
endDiff = points[1].y - points[2].y,
|
|
4811
|
-
startX = points[0].x,
|
|
4812
|
-
endX = points[1].x;
|
|
4813
|
-
Fibonacci.levels.forEach(function (level, i) {
|
|
4814
|
-
var startRetracement = points[0].y - startDiff * level,
|
|
4815
|
-
endRetracement = points[1].y - endDiff * level;
|
|
4816
|
-
this.startRetracements = this.startRetracements || [];
|
|
4817
|
-
this.endRetracements = this.endRetracements || [];
|
|
4818
|
-
this.linkRetracementPoint(i, startX, startRetracement, this.startRetracements);
|
|
4819
|
-
this.linkRetracementPoint(i, endX, endRetracement, this.endRetracements);
|
|
4820
|
-
}, this);
|
|
5146
|
+
TimeCycles.prototype.getPath = function () {
|
|
5147
|
+
return [getStartingPath(this.startX, this.y)].concat(getCirclePath(this.pixelInterval, this.numberOfCircles, this.startX, this.y));
|
|
4821
5148
|
};
|
|
4822
|
-
|
|
4823
|
-
var
|
|
4824
|
-
|
|
4825
|
-
|
|
5149
|
+
TimeCycles.prototype.addShapes = function () {
|
|
5150
|
+
var typeOptions = this.options.typeOptions;
|
|
5151
|
+
this.setPathProperties();
|
|
5152
|
+
var shape = this.initShape(merge(typeOptions.line, {
|
|
5153
|
+
type: 'path',
|
|
5154
|
+
d: this.getPath(),
|
|
5155
|
+
points: this.options.points
|
|
5156
|
+
}), 0);
|
|
5157
|
+
typeOptions.line = shape.options;
|
|
5158
|
+
};
|
|
5159
|
+
TimeCycles.prototype.addControlPoints = function () {
|
|
5160
|
+
var _this = this;
|
|
5161
|
+
var options = this.options,
|
|
5162
|
+
typeOptions = options.typeOptions;
|
|
5163
|
+
options.controlPointOptions.style.cursor = this.chart.inverted ? 'ns-resize' : 'ew-resize';
|
|
5164
|
+
typeOptions.controlPointOptions.forEach(function (option) {
|
|
5165
|
+
var controlPointsOptions = merge(options.controlPointOptions,
|
|
5166
|
+
option);
|
|
5167
|
+
var controlPoint = new ControlPoint(_this.chart,
|
|
5168
|
+
_this,
|
|
5169
|
+
controlPointsOptions, 0);
|
|
5170
|
+
_this.controlPoints.push(controlPoint);
|
|
5171
|
+
});
|
|
5172
|
+
};
|
|
5173
|
+
TimeCycles.prototype.setPathProperties = function () {
|
|
5174
|
+
var options = this.options.typeOptions,
|
|
5175
|
+
points = options.points;
|
|
5176
|
+
if (!points) {
|
|
5177
|
+
return;
|
|
5178
|
+
}
|
|
5179
|
+
var point1 = points[0],
|
|
5180
|
+
point2 = points[1],
|
|
5181
|
+
xAxisNumber = options.xAxis || 0,
|
|
5182
|
+
yAxisNumber = options.yAxis || 0,
|
|
5183
|
+
xAxis = this.chart.xAxis[xAxisNumber],
|
|
5184
|
+
yAxis = this.chart.yAxis[yAxisNumber],
|
|
5185
|
+
xValue1 = point1.x,
|
|
5186
|
+
yValue = point1.y,
|
|
5187
|
+
xValue2 = point2.x;
|
|
5188
|
+
if (!xValue1 || !xValue2) {
|
|
5189
|
+
return;
|
|
5190
|
+
}
|
|
5191
|
+
var y = isNumber(yValue) ? yAxis.toPixels(yValue) : yAxis.top + yAxis.height,
|
|
5192
|
+
x = isNumber(xValue1) ? xAxis.toPixels(xValue1) : xAxis.left,
|
|
5193
|
+
x2 = isNumber(xValue2) ? xAxis.toPixels(xValue2) : xAxis.left + 30,
|
|
5194
|
+
xAxisLength = xAxis.len,
|
|
5195
|
+
pixelInterval = Math.round(Math.max(Math.abs(x2 - x), 2)),
|
|
5196
|
+
// There can be 2 not full circles on the chart, so add 2.
|
|
5197
|
+
numberOfCircles = Math.floor(xAxisLength / pixelInterval) + 2,
|
|
5198
|
+
// Calculate where the annotation should start drawing
|
|
5199
|
+
// relative to first point.
|
|
5200
|
+
pixelShift = (Math.floor((x - xAxis.left) / pixelInterval) + 1) * pixelInterval;
|
|
5201
|
+
this.startX = x - pixelShift;
|
|
5202
|
+
this.y = y;
|
|
5203
|
+
this.pixelInterval = pixelInterval;
|
|
5204
|
+
this.numberOfCircles = numberOfCircles;
|
|
5205
|
+
};
|
|
5206
|
+
TimeCycles.prototype.redraw = function (animation) {
|
|
5207
|
+
this.setPathProperties();
|
|
5208
|
+
this.setPath();
|
|
5209
|
+
_super.prototype.redraw.call(this, animation);
|
|
5210
|
+
};
|
|
5211
|
+
return TimeCycles;
|
|
5212
|
+
}(CrookedLine));
|
|
5213
|
+
TimeCycles.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions, {
|
|
5214
|
+
typeOptions: {
|
|
5215
|
+
controlPointOptions: [{
|
|
5216
|
+
positioner: function (target) {
|
|
5217
|
+
var point = target.points[0],
|
|
5218
|
+
position = target.anchor(point).absolutePosition;
|
|
5219
|
+
return {
|
|
5220
|
+
x: position.x - this.graphic.width / 2,
|
|
5221
|
+
y: target.y - this.graphic.height
|
|
5222
|
+
};
|
|
5223
|
+
},
|
|
5224
|
+
events: {
|
|
5225
|
+
drag: function (e, target) {
|
|
5226
|
+
var position = target.anchor(target.points[0]).absolutePosition;
|
|
5227
|
+
target.translatePoint(e.chartX - position.x, 0, 0);
|
|
5228
|
+
target.redraw(false);
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
}, {
|
|
5232
|
+
positioner: function (target) {
|
|
5233
|
+
var point = target.points[1],
|
|
5234
|
+
position = target.anchor(point).absolutePosition;
|
|
5235
|
+
return {
|
|
5236
|
+
x: position.x - this.graphic.width / 2,
|
|
5237
|
+
y: target.y - this.graphic.height
|
|
5238
|
+
};
|
|
5239
|
+
},
|
|
5240
|
+
events: {
|
|
5241
|
+
drag: function (e, target) {
|
|
5242
|
+
var position = target.anchor(target.points[1]).absolutePosition;
|
|
5243
|
+
target.translatePoint(e.chartX - position.x, 0, 1);
|
|
5244
|
+
target.redraw(false);
|
|
5245
|
+
}
|
|
5246
|
+
}
|
|
5247
|
+
}]
|
|
5248
|
+
}
|
|
5249
|
+
});
|
|
5250
|
+
/* *
|
|
5251
|
+
*
|
|
5252
|
+
* Registry
|
|
5253
|
+
*
|
|
5254
|
+
* */
|
|
5255
|
+
Annotation.types.timeCycles = TimeCycles;
|
|
5256
|
+
/* *
|
|
5257
|
+
*
|
|
5258
|
+
* Default Export
|
|
5259
|
+
*
|
|
5260
|
+
* */
|
|
5261
|
+
/* *
|
|
5262
|
+
*
|
|
5263
|
+
* API Declarations
|
|
5264
|
+
*
|
|
5265
|
+
* */
|
|
5266
|
+
/**
|
|
5267
|
+
* The TimeCycles Annotation
|
|
5268
|
+
* @sample highcharts/annotations-advanced/time-cycles/
|
|
5269
|
+
* Time Cycles annotation
|
|
5270
|
+
*
|
|
5271
|
+
* @extends annotations.crookedLine
|
|
5272
|
+
* @product highstock
|
|
5273
|
+
* @exclude labelOptions
|
|
5274
|
+
* @apioption annotations.timeCycles
|
|
5275
|
+
*/
|
|
5276
|
+
/**
|
|
5277
|
+
* @exclude y
|
|
5278
|
+
* @product highstock
|
|
5279
|
+
* @apioption annotations.timeCycles.typeOptions.points
|
|
5280
|
+
*/
|
|
5281
|
+
(''); // keeps doclets above in transpiled file
|
|
5282
|
+
|
|
5283
|
+
return TimeCycles;
|
|
5284
|
+
});
|
|
5285
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/Fibonacci.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Extensions/Annotations/Types/Tunnel.js'], _modules['Core/Utilities.js']], function (Annotation, MockPoint, Tunnel, U) {
|
|
5286
|
+
/* *
|
|
5287
|
+
*
|
|
5288
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5289
|
+
*
|
|
5290
|
+
* */
|
|
5291
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5292
|
+
var extendStatics = function (d,
|
|
5293
|
+
b) {
|
|
5294
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5295
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
5296
|
+
b) { d.__proto__ = b; }) ||
|
|
5297
|
+
function (d,
|
|
5298
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
5299
|
+
return extendStatics(d, b);
|
|
5300
|
+
};
|
|
5301
|
+
return function (d, b) {
|
|
5302
|
+
extendStatics(d, b);
|
|
5303
|
+
function __() { this.constructor = d; }
|
|
5304
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5305
|
+
};
|
|
5306
|
+
})();
|
|
5307
|
+
var merge = U.merge;
|
|
5308
|
+
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
5309
|
+
var createPathDGenerator = function (retracementIndex,
|
|
5310
|
+
isBackground) {
|
|
5311
|
+
return function () {
|
|
5312
|
+
var annotation = this.annotation;
|
|
5313
|
+
if (!annotation.startRetracements || !annotation.endRetracements) {
|
|
5314
|
+
return [];
|
|
5315
|
+
}
|
|
5316
|
+
var leftTop = this.anchor(annotation.startRetracements[retracementIndex]).absolutePosition,
|
|
5317
|
+
rightTop = this.anchor(annotation.endRetracements[retracementIndex]).absolutePosition,
|
|
5318
|
+
d = [
|
|
5319
|
+
['M',
|
|
5320
|
+
Math.round(leftTop.x),
|
|
5321
|
+
Math.round(leftTop.y)],
|
|
5322
|
+
['L',
|
|
5323
|
+
Math.round(rightTop.x),
|
|
5324
|
+
Math.round(rightTop.y)]
|
|
5325
|
+
],
|
|
5326
|
+
rightBottom,
|
|
5327
|
+
leftBottom;
|
|
5328
|
+
if (isBackground) {
|
|
5329
|
+
rightBottom = this.anchor(annotation.endRetracements[retracementIndex - 1]).absolutePosition;
|
|
5330
|
+
leftBottom = this.anchor(annotation.startRetracements[retracementIndex - 1]).absolutePosition;
|
|
5331
|
+
d.push(['L', Math.round(rightBottom.x), Math.round(rightBottom.y)], ['L', Math.round(leftBottom.x), Math.round(leftBottom.y)]);
|
|
5332
|
+
}
|
|
5333
|
+
return d;
|
|
5334
|
+
};
|
|
5335
|
+
};
|
|
5336
|
+
var Fibonacci = /** @class */ (function (_super) {
|
|
5337
|
+
__extends(Fibonacci, _super);
|
|
5338
|
+
/* *
|
|
5339
|
+
*
|
|
5340
|
+
* Constructors
|
|
5341
|
+
*
|
|
5342
|
+
* */
|
|
5343
|
+
function Fibonacci(chart, options) {
|
|
5344
|
+
return _super.call(this, chart, options) || this;
|
|
5345
|
+
}
|
|
5346
|
+
/* *
|
|
5347
|
+
*
|
|
5348
|
+
* Functions
|
|
5349
|
+
*
|
|
5350
|
+
* */
|
|
5351
|
+
Fibonacci.prototype.linkPoints = function () {
|
|
5352
|
+
_super.prototype.linkPoints.call(this);
|
|
5353
|
+
this.linkRetracementsPoints();
|
|
5354
|
+
return;
|
|
5355
|
+
};
|
|
5356
|
+
Fibonacci.prototype.linkRetracementsPoints = function () {
|
|
5357
|
+
var points = this.points,
|
|
5358
|
+
startDiff = points[0].y - points[3].y,
|
|
5359
|
+
endDiff = points[1].y - points[2].y,
|
|
5360
|
+
startX = points[0].x,
|
|
5361
|
+
endX = points[1].x;
|
|
5362
|
+
Fibonacci.levels.forEach(function (level, i) {
|
|
5363
|
+
var startRetracement = points[0].y - startDiff * level,
|
|
5364
|
+
endRetracement = points[1].y - endDiff * level;
|
|
5365
|
+
this.startRetracements = this.startRetracements || [];
|
|
5366
|
+
this.endRetracements = this.endRetracements || [];
|
|
5367
|
+
this.linkRetracementPoint(i, startX, startRetracement, this.startRetracements);
|
|
5368
|
+
this.linkRetracementPoint(i, endX, endRetracement, this.endRetracements);
|
|
5369
|
+
}, this);
|
|
5370
|
+
};
|
|
5371
|
+
Fibonacci.prototype.linkRetracementPoint = function (pointIndex, x, y, retracements) {
|
|
5372
|
+
var point = retracements[pointIndex],
|
|
5373
|
+
typeOptions = this.options.typeOptions;
|
|
5374
|
+
if (!point) {
|
|
4826
5375
|
retracements[pointIndex] = new MockPoint(this.chart, this, {
|
|
4827
5376
|
x: x,
|
|
4828
5377
|
y: y,
|
|
@@ -4846,7 +5395,7 @@
|
|
|
4846
5395
|
type: 'path',
|
|
4847
5396
|
d: createPathDGenerator(i),
|
|
4848
5397
|
stroke: lineColors[i] || lineColor
|
|
4849
|
-
},
|
|
5398
|
+
}, i);
|
|
4850
5399
|
if (i > 0) {
|
|
4851
5400
|
this.initShape({
|
|
4852
5401
|
type: 'path',
|
|
@@ -4920,7 +5469,7 @@
|
|
|
4920
5469
|
/**
|
|
4921
5470
|
* The color of line.
|
|
4922
5471
|
*/
|
|
4923
|
-
lineColor:
|
|
5472
|
+
lineColor: "#999999" /* neutralColor40 */,
|
|
4924
5473
|
/**
|
|
4925
5474
|
* An array of colors for the lines.
|
|
4926
5475
|
*/
|
|
@@ -4958,6 +5507,243 @@
|
|
|
4958
5507
|
|
|
4959
5508
|
return Fibonacci;
|
|
4960
5509
|
});
|
|
5510
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/FibonacciTimeZones.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/Types/CrookedLine.js'], _modules['Extensions/Annotations/Types/InfinityLine.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, ControlPoint, CrookedLine, InfinityLine, MockPoint, U) {
|
|
5511
|
+
/* *
|
|
5512
|
+
*
|
|
5513
|
+
* Author: Rafal Sebestjanski
|
|
5514
|
+
*
|
|
5515
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5516
|
+
*
|
|
5517
|
+
* */
|
|
5518
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5519
|
+
var extendStatics = function (d,
|
|
5520
|
+
b) {
|
|
5521
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5522
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
5523
|
+
b) { d.__proto__ = b; }) ||
|
|
5524
|
+
function (d,
|
|
5525
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
5526
|
+
return extendStatics(d, b);
|
|
5527
|
+
};
|
|
5528
|
+
return function (d, b) {
|
|
5529
|
+
extendStatics(d, b);
|
|
5530
|
+
function __() { this.constructor = d; }
|
|
5531
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5532
|
+
};
|
|
5533
|
+
})();
|
|
5534
|
+
var merge = U.merge;
|
|
5535
|
+
/* *
|
|
5536
|
+
*
|
|
5537
|
+
* Class
|
|
5538
|
+
*
|
|
5539
|
+
* */
|
|
5540
|
+
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
5541
|
+
var FibonacciTimeZones = /** @class */ (function (_super) {
|
|
5542
|
+
__extends(FibonacciTimeZones, _super);
|
|
5543
|
+
function FibonacciTimeZones() {
|
|
5544
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5545
|
+
}
|
|
5546
|
+
/* *
|
|
5547
|
+
*
|
|
5548
|
+
* Functions
|
|
5549
|
+
*
|
|
5550
|
+
* */
|
|
5551
|
+
/*
|
|
5552
|
+
Method taken (and slightly changed) from the InfinityLine annotation.
|
|
5553
|
+
|
|
5554
|
+
It uses x coordinate to create two mock points on the same x. Then,
|
|
5555
|
+
it uses some logic from InfinityLine to find equation of the line passing
|
|
5556
|
+
through our two points and, using that equation, it finds and returns
|
|
5557
|
+
the coordinates of where the line intersects the plot area edges.
|
|
5558
|
+
|
|
5559
|
+
This is being done for each fibonacci time zone line.
|
|
5560
|
+
|
|
5561
|
+
|
|
5562
|
+
this point here is found
|
|
5563
|
+
|
|
|
5564
|
+
v
|
|
5565
|
+
|---------*--------------------------------------------------------|
|
|
5566
|
+
| |
|
|
5567
|
+
| |
|
|
5568
|
+
| |
|
|
5569
|
+
| |
|
|
5570
|
+
| * copy of the primary point |
|
|
5571
|
+
| |
|
|
5572
|
+
| * primary point (e.g. the one given in options) |
|
|
5573
|
+
| |
|
|
5574
|
+
|---------*--------------------------------------------------------|
|
|
5575
|
+
and this point here is found (intersection with the plot area edge)
|
|
5576
|
+
|
|
5577
|
+
*/
|
|
5578
|
+
FibonacciTimeZones.prototype.edgePoint = function (startIndex, endIndex, fibonacciIndex) {
|
|
5579
|
+
return function (target) {
|
|
5580
|
+
var chart = target.annotation.chart,
|
|
5581
|
+
plotLeftOrTop = chart.inverted ? chart.plotTop : chart.plotLeft;
|
|
5582
|
+
var points = target.annotation.points;
|
|
5583
|
+
var xAxis = points[0].series.xAxis,
|
|
5584
|
+
// Distance between the two first lines in pixels
|
|
5585
|
+
deltaX = points.length > 1 ?
|
|
5586
|
+
points[1].plotX - points[0].plotX : 0,
|
|
5587
|
+
// firstLine.x + fibb * offset
|
|
5588
|
+
x = xAxis.toValue(points[0].plotX + plotLeftOrTop + fibonacciIndex * deltaX);
|
|
5589
|
+
// We need 2 mock points with the same x coordinate, different y
|
|
5590
|
+
points = [
|
|
5591
|
+
new MockPoint(chart, points[0].target, {
|
|
5592
|
+
x: x,
|
|
5593
|
+
y: 0,
|
|
5594
|
+
xAxis: points[0].options.xAxis,
|
|
5595
|
+
yAxis: points[0].options.yAxis
|
|
5596
|
+
}),
|
|
5597
|
+
new MockPoint(chart, points[0].target, {
|
|
5598
|
+
x: x,
|
|
5599
|
+
y: 1,
|
|
5600
|
+
xAxis: points[0].options.xAxis,
|
|
5601
|
+
yAxis: points[0].options.yAxis
|
|
5602
|
+
})
|
|
5603
|
+
];
|
|
5604
|
+
return InfinityLine.findEdgePoint(points[startIndex], points[endIndex]);
|
|
5605
|
+
};
|
|
5606
|
+
};
|
|
5607
|
+
FibonacciTimeZones.prototype.addShapes = function () {
|
|
5608
|
+
var numberOfLines = 11;
|
|
5609
|
+
var fibb = 1,
|
|
5610
|
+
nextFibb = 1;
|
|
5611
|
+
for (var i = 0; i < numberOfLines; i++) {
|
|
5612
|
+
// The fibb variable equals to 1 twice - correct it in the first
|
|
5613
|
+
// iteration so the lines don't overlap
|
|
5614
|
+
var correctedFibb = !i ? 0 : fibb,
|
|
5615
|
+
points = [
|
|
5616
|
+
this.edgePoint(1, 0,
|
|
5617
|
+
correctedFibb),
|
|
5618
|
+
this.edgePoint(0, 1,
|
|
5619
|
+
correctedFibb)
|
|
5620
|
+
];
|
|
5621
|
+
// Calculate fibbonacci
|
|
5622
|
+
nextFibb = fibb + nextFibb;
|
|
5623
|
+
fibb = nextFibb - fibb;
|
|
5624
|
+
// Save the second line for the control point
|
|
5625
|
+
if (i === 1) {
|
|
5626
|
+
this.secondLineEdgePoints = [points[0], points[1]];
|
|
5627
|
+
}
|
|
5628
|
+
this.initShape(merge(this.options.typeOptions.line, {
|
|
5629
|
+
type: 'path',
|
|
5630
|
+
points: points
|
|
5631
|
+
}), i // shape's index. Can be found in annotation.shapes[i].index
|
|
5632
|
+
);
|
|
5633
|
+
}
|
|
5634
|
+
};
|
|
5635
|
+
FibonacciTimeZones.prototype.addControlPoints = function () {
|
|
5636
|
+
var options = this.options,
|
|
5637
|
+
typeOptions = options.typeOptions,
|
|
5638
|
+
controlPoint = new ControlPoint(this.chart,
|
|
5639
|
+
this,
|
|
5640
|
+
merge(options.controlPointOptions,
|
|
5641
|
+
typeOptions.controlPointOptions), 0);
|
|
5642
|
+
this.controlPoints.push(controlPoint);
|
|
5643
|
+
typeOptions.controlPointOptions = controlPoint.options;
|
|
5644
|
+
};
|
|
5645
|
+
return FibonacciTimeZones;
|
|
5646
|
+
}(CrookedLine));
|
|
5647
|
+
FibonacciTimeZones.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions, {
|
|
5648
|
+
typeOptions: {
|
|
5649
|
+
// Options for showing in popup edit
|
|
5650
|
+
line: {
|
|
5651
|
+
/**
|
|
5652
|
+
* The color of the lines.
|
|
5653
|
+
*
|
|
5654
|
+
* @type {string}
|
|
5655
|
+
* @since 9.3.0
|
|
5656
|
+
* @default 'rgba(0, 0, 0, 0.75)'
|
|
5657
|
+
* @apioption annotations.fibonacciTimeZones.typeOptions.line.stroke
|
|
5658
|
+
*/
|
|
5659
|
+
stroke: 'rgba(0, 0, 0, 0.75)',
|
|
5660
|
+
/**
|
|
5661
|
+
* The width of the lines.
|
|
5662
|
+
*
|
|
5663
|
+
* @type {number}
|
|
5664
|
+
* @since 9.3.0
|
|
5665
|
+
* @default 1
|
|
5666
|
+
* @apioption annotations.fibonacciTimeZones.typeOptions.line.strokeWidth
|
|
5667
|
+
*/
|
|
5668
|
+
strokeWidth: 1,
|
|
5669
|
+
// Don't inherit fill (don't display in popup edit)
|
|
5670
|
+
fill: void 0
|
|
5671
|
+
},
|
|
5672
|
+
controlPointOptions: {
|
|
5673
|
+
positioner: function () {
|
|
5674
|
+
var _a;
|
|
5675
|
+
// The control point is in the middle of the second line
|
|
5676
|
+
var target = this.target,
|
|
5677
|
+
graphic = this.graphic,
|
|
5678
|
+
edgePoints = target.secondLineEdgePoints,
|
|
5679
|
+
args = { annotation: target },
|
|
5680
|
+
firstEdgePointY = edgePoints[0](args).y,
|
|
5681
|
+
secondEdgePointY = edgePoints[1](args).y,
|
|
5682
|
+
plotLeft = this.chart.plotLeft,
|
|
5683
|
+
plotTop = this.chart.plotTop;
|
|
5684
|
+
var x = edgePoints[0](args).x,
|
|
5685
|
+
y = (firstEdgePointY + secondEdgePointY) / 2;
|
|
5686
|
+
if (this.chart.inverted) {
|
|
5687
|
+
_a = [y, x], x = _a[0], y = _a[1];
|
|
5688
|
+
}
|
|
5689
|
+
return {
|
|
5690
|
+
x: plotLeft + x - graphic.width / 2,
|
|
5691
|
+
y: plotTop + y - graphic.height / 2
|
|
5692
|
+
};
|
|
5693
|
+
},
|
|
5694
|
+
events: {
|
|
5695
|
+
drag: function (e, target) {
|
|
5696
|
+
var isInsidePlot = target.chart.isInsidePlot(e.chartX - target.chart.plotLeft,
|
|
5697
|
+
e.chartY - target.chart.plotTop, {
|
|
5698
|
+
visiblePlotOnly: true
|
|
5699
|
+
});
|
|
5700
|
+
if (isInsidePlot) {
|
|
5701
|
+
var translation = this.mouseMoveToTranslation(e);
|
|
5702
|
+
target.translatePoint(translation.x, 0, 1);
|
|
5703
|
+
target.redraw(false);
|
|
5704
|
+
}
|
|
5705
|
+
}
|
|
5706
|
+
}
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
});
|
|
5710
|
+
/* *
|
|
5711
|
+
*
|
|
5712
|
+
* Registry
|
|
5713
|
+
*
|
|
5714
|
+
* */
|
|
5715
|
+
Annotation.types.fibonacciTimeZones = FibonacciTimeZones;
|
|
5716
|
+
/* *
|
|
5717
|
+
*
|
|
5718
|
+
* Default Export
|
|
5719
|
+
*
|
|
5720
|
+
* */
|
|
5721
|
+
/* *
|
|
5722
|
+
*
|
|
5723
|
+
* API Declarations
|
|
5724
|
+
*
|
|
5725
|
+
* */
|
|
5726
|
+
/**
|
|
5727
|
+
* The Fibonacci Time Zones annotation.
|
|
5728
|
+
*
|
|
5729
|
+
* @sample highcharts/annotations-advanced/fibonacci-time-zones/
|
|
5730
|
+
* Fibonacci Time Zones
|
|
5731
|
+
*
|
|
5732
|
+
* @extends annotations.crookedLine
|
|
5733
|
+
* @since 9.3.0
|
|
5734
|
+
* @product highstock
|
|
5735
|
+
* @apioption annotations.fibonacciTimeZones
|
|
5736
|
+
*/
|
|
5737
|
+
/**
|
|
5738
|
+
* @exclude y
|
|
5739
|
+
* @since 9.3.0
|
|
5740
|
+
* @product highstock
|
|
5741
|
+
* @apioption annotations.fibonacciTimeZones.typeOptions.points
|
|
5742
|
+
*/
|
|
5743
|
+
(''); // keeps doclets above in transpiled file
|
|
5744
|
+
|
|
5745
|
+
return FibonacciTimeZones;
|
|
5746
|
+
});
|
|
4961
5747
|
_registerModule(_modules, 'Extensions/Annotations/Types/Pitchfork.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/Types/InfinityLine.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, InfinityLine, MockPoint, U) {
|
|
4962
5748
|
/* *
|
|
4963
5749
|
*
|
|
@@ -5043,21 +5829,21 @@
|
|
|
5043
5829
|
this.points[0],
|
|
5044
5830
|
Pitchfork.middleLineEdgePoint
|
|
5045
5831
|
]
|
|
5046
|
-
},
|
|
5832
|
+
}, 0);
|
|
5047
5833
|
this.initShape({
|
|
5048
5834
|
type: 'path',
|
|
5049
5835
|
points: [
|
|
5050
5836
|
this.points[1],
|
|
5051
5837
|
Pitchfork.topLineEdgePoint
|
|
5052
5838
|
]
|
|
5053
|
-
},
|
|
5839
|
+
}, 1);
|
|
5054
5840
|
this.initShape({
|
|
5055
5841
|
type: 'path',
|
|
5056
5842
|
points: [
|
|
5057
5843
|
this.points[2],
|
|
5058
5844
|
Pitchfork.bottomLineEdgePoint
|
|
5059
5845
|
]
|
|
5060
|
-
},
|
|
5846
|
+
}, 2);
|
|
5061
5847
|
};
|
|
5062
5848
|
Pitchfork.prototype.addBackgrounds = function () {
|
|
5063
5849
|
var shapes = this.shapes,
|
|
@@ -5090,7 +5876,7 @@
|
|
|
5090
5876
|
};
|
|
5091
5877
|
}
|
|
5092
5878
|
]
|
|
5093
|
-
}));
|
|
5879
|
+
}), 3);
|
|
5094
5880
|
var outerBackground = this.initShape(merge(typeOptions.outerBackground, {
|
|
5095
5881
|
type: 'path',
|
|
5096
5882
|
points: [
|
|
@@ -5099,7 +5885,7 @@
|
|
|
5099
5885
|
shapes[2].points[1],
|
|
5100
5886
|
this.points[2]
|
|
5101
5887
|
]
|
|
5102
|
-
}));
|
|
5888
|
+
}), 4);
|
|
5103
5889
|
typeOptions.innerBackground = innerBackground.options;
|
|
5104
5890
|
typeOptions.outerBackground = outerBackground.options;
|
|
5105
5891
|
};
|
|
@@ -5255,8 +6041,7 @@
|
|
|
5255
6041
|
VerticalLine.connectorFirstPoint,
|
|
5256
6042
|
VerticalLine.connectorSecondPoint
|
|
5257
6043
|
]
|
|
5258
|
-
}),
|
|
5259
|
-
false);
|
|
6044
|
+
}), 0);
|
|
5260
6045
|
typeOptions.connector = connector.options;
|
|
5261
6046
|
};
|
|
5262
6047
|
VerticalLine.prototype.addLabels = function () {
|
|
@@ -5361,7 +6146,8 @@
|
|
|
5361
6146
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5362
6147
|
};
|
|
5363
6148
|
})();
|
|
5364
|
-
var
|
|
6149
|
+
var defined = U.defined,
|
|
6150
|
+
extend = U.extend,
|
|
5365
6151
|
isNumber = U.isNumber,
|
|
5366
6152
|
merge = U.merge,
|
|
5367
6153
|
pick = U.pick;
|
|
@@ -5448,8 +6234,19 @@
|
|
|
5448
6234
|
];
|
|
5449
6235
|
};
|
|
5450
6236
|
Measure.prototype.addControlPoints = function () {
|
|
6237
|
+
var inverted = this.chart.inverted,
|
|
6238
|
+
options = this.options.controlPointOptions;
|
|
5451
6239
|
var selectType = this.options.typeOptions.selectType,
|
|
5452
6240
|
controlPoint;
|
|
6241
|
+
if (!defined(this.userOptions.controlPointOptions &&
|
|
6242
|
+
this.userOptions.controlPointOptions.style.cursor)) {
|
|
6243
|
+
if (selectType === 'x') {
|
|
6244
|
+
options.style.cursor = inverted ? 'ns-resize' : 'ew-resize';
|
|
6245
|
+
}
|
|
6246
|
+
else if (selectType === 'y') {
|
|
6247
|
+
options.style.cursor = inverted ? 'ew-resize' : 'ns-resize';
|
|
6248
|
+
}
|
|
6249
|
+
}
|
|
5453
6250
|
controlPoint = new ControlPoint(this.chart, this, this.options.controlPointOptions, 0);
|
|
5454
6251
|
this.controlPoints.push(controlPoint);
|
|
5455
6252
|
// add extra controlPoint for horizontal and vertical range
|
|
@@ -5526,7 +6323,7 @@
|
|
|
5526
6323
|
this.initShape(extend({
|
|
5527
6324
|
type: 'path',
|
|
5528
6325
|
points: this.shapePointsOptions()
|
|
5529
|
-
}, this.options.typeOptions.background),
|
|
6326
|
+
}, this.options.typeOptions.background), 2);
|
|
5530
6327
|
};
|
|
5531
6328
|
/**
|
|
5532
6329
|
* Add internal crosshair shapes (on top and bottom).
|
|
@@ -5593,12 +6390,8 @@
|
|
|
5593
6390
|
// Add new crosshairs
|
|
5594
6391
|
crosshairOptionsX = merge(defaultOptions, options.crosshairX);
|
|
5595
6392
|
crosshairOptionsY = merge(defaultOptions, options.crosshairY);
|
|
5596
|
-
this.initShape(extend({
|
|
5597
|
-
|
|
5598
|
-
}, crosshairOptionsX), false);
|
|
5599
|
-
this.initShape(extend({
|
|
5600
|
-
d: pathV
|
|
5601
|
-
}, crosshairOptionsY), false);
|
|
6393
|
+
this.initShape(extend({ d: pathH }, crosshairOptionsX), 0);
|
|
6394
|
+
this.initShape(extend({ d: pathV }, crosshairOptionsY), 1);
|
|
5602
6395
|
}
|
|
5603
6396
|
};
|
|
5604
6397
|
Measure.prototype.onDrag = function (e) {
|
|
@@ -6205,66 +6998,101 @@
|
|
|
6205
6998
|
|
|
6206
6999
|
return Measure;
|
|
6207
7000
|
});
|
|
6208
|
-
_registerModule(_modules, '
|
|
7001
|
+
_registerModule(_modules, 'Core/Chart/ChartNavigationComposition.js', [], function () {
|
|
6209
7002
|
/**
|
|
6210
7003
|
*
|
|
6211
7004
|
* (c) 2010-2021 Paweł Fus
|
|
6212
7005
|
*
|
|
6213
7006
|
* License: www.highcharts.com/license
|
|
6214
7007
|
*
|
|
6215
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
7008
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
7009
|
+
*
|
|
7010
|
+
* */
|
|
7011
|
+
/* *
|
|
7012
|
+
*
|
|
7013
|
+
* Composition
|
|
6216
7014
|
*
|
|
6217
7015
|
* */
|
|
6218
|
-
var
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
* @private
|
|
6224
|
-
* @param {Highcharts.Chart} chart
|
|
6225
|
-
* The chart instance.
|
|
6226
|
-
* @return {void}
|
|
6227
|
-
*/
|
|
6228
|
-
initUpdate: function (chart) {
|
|
6229
|
-
if (!chart.navigation) {
|
|
6230
|
-
chart.navigation = {
|
|
6231
|
-
updates: [],
|
|
6232
|
-
update: function (options,
|
|
6233
|
-
redraw) {
|
|
6234
|
-
this.updates.forEach(function (updateConfig) {
|
|
6235
|
-
updateConfig.update.call(updateConfig.context,
|
|
6236
|
-
options,
|
|
6237
|
-
redraw);
|
|
6238
|
-
});
|
|
6239
|
-
}
|
|
6240
|
-
};
|
|
6241
|
-
}
|
|
6242
|
-
},
|
|
6243
|
-
/**
|
|
6244
|
-
* Registers an `update()` method in the `chart.navigation` object.
|
|
7016
|
+
var ChartNavigationComposition;
|
|
7017
|
+
(function (ChartNavigationComposition) {
|
|
7018
|
+
/* *
|
|
7019
|
+
*
|
|
7020
|
+
* Declarations
|
|
6245
7021
|
*
|
|
7022
|
+
* */
|
|
7023
|
+
/* *
|
|
7024
|
+
*
|
|
7025
|
+
* Functions
|
|
7026
|
+
*
|
|
7027
|
+
* */
|
|
7028
|
+
/* eslint-disable valid-jsdoc */
|
|
7029
|
+
/**
|
|
6246
7030
|
* @private
|
|
6247
|
-
* @param {Highcharts.ChartNavigationUpdateFunction} update
|
|
6248
|
-
* The `update()` method that will be called in `chart.update()`.
|
|
6249
|
-
* @param {Highcharts.Chart} chart
|
|
6250
|
-
* The chart instance. `update()` will use that as a context
|
|
6251
|
-
* (`this`).
|
|
6252
|
-
* @return {void}
|
|
6253
7031
|
*/
|
|
6254
|
-
|
|
7032
|
+
function compose(chart) {
|
|
6255
7033
|
if (!chart.navigation) {
|
|
6256
|
-
|
|
7034
|
+
chart.navigation = new Additions(chart);
|
|
6257
7035
|
}
|
|
6258
|
-
chart
|
|
6259
|
-
update: update,
|
|
6260
|
-
context: chart
|
|
6261
|
-
});
|
|
7036
|
+
return chart;
|
|
6262
7037
|
}
|
|
6263
|
-
|
|
7038
|
+
ChartNavigationComposition.compose = compose;
|
|
7039
|
+
/* *
|
|
7040
|
+
*
|
|
7041
|
+
* Class
|
|
7042
|
+
*
|
|
7043
|
+
* */
|
|
7044
|
+
/**
|
|
7045
|
+
* Initializes `chart.navigation` object which delegates `update()` methods
|
|
7046
|
+
* to all other common classes (used in exporting and navigationBindings).
|
|
7047
|
+
* @private
|
|
7048
|
+
*/
|
|
7049
|
+
var Additions = /** @class */ (function () {
|
|
7050
|
+
/* *
|
|
7051
|
+
*
|
|
7052
|
+
* Constructor
|
|
7053
|
+
*
|
|
7054
|
+
* */
|
|
7055
|
+
function Additions(chart) {
|
|
7056
|
+
this.updates = [];
|
|
7057
|
+
this.chart = chart;
|
|
7058
|
+
}
|
|
7059
|
+
/* *
|
|
7060
|
+
*
|
|
7061
|
+
* Functions
|
|
7062
|
+
*
|
|
7063
|
+
* */
|
|
7064
|
+
/**
|
|
7065
|
+
* Registers an `update()` method in the `chart.navigation` object.
|
|
7066
|
+
*
|
|
7067
|
+
* @private
|
|
7068
|
+
* @param {UpdateFunction} updateFn
|
|
7069
|
+
* The `update()` method that will be called in `chart.update()`.
|
|
7070
|
+
*/
|
|
7071
|
+
Additions.prototype.addUpdate = function (updateFn) {
|
|
7072
|
+
this.chart.navigation.updates.push(updateFn);
|
|
7073
|
+
};
|
|
7074
|
+
/**
|
|
7075
|
+
* @private
|
|
7076
|
+
*/
|
|
7077
|
+
Additions.prototype.update = function (options, redraw) {
|
|
7078
|
+
var _this = this;
|
|
7079
|
+
this.updates.forEach(function (updateFn) {
|
|
7080
|
+
updateFn.call(_this.chart, options, redraw);
|
|
7081
|
+
});
|
|
7082
|
+
};
|
|
7083
|
+
return Additions;
|
|
7084
|
+
}());
|
|
7085
|
+
ChartNavigationComposition.Additions = Additions;
|
|
7086
|
+
})(ChartNavigationComposition || (ChartNavigationComposition = {}));
|
|
7087
|
+
/* *
|
|
7088
|
+
*
|
|
7089
|
+
* Default Export
|
|
7090
|
+
*
|
|
7091
|
+
* */
|
|
6264
7092
|
|
|
6265
|
-
return
|
|
7093
|
+
return ChartNavigationComposition;
|
|
6266
7094
|
});
|
|
6267
|
-
_registerModule(_modules, 'Extensions/Annotations/NavigationBindings.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Core/Chart/Chart.js'], _modules['
|
|
7095
|
+
_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) {
|
|
6268
7096
|
/* *
|
|
6269
7097
|
*
|
|
6270
7098
|
* (c) 2009-2021 Highsoft, Black Label
|
|
@@ -6412,8 +7240,9 @@
|
|
|
6412
7240
|
*/
|
|
6413
7241
|
getAssignedAxis: function (coords) {
|
|
6414
7242
|
return coords.filter(function (coord) {
|
|
6415
|
-
var
|
|
6416
|
-
|
|
7243
|
+
var extremes = coord.axis.getExtremes(),
|
|
7244
|
+
axisMin = extremes.min,
|
|
7245
|
+
axisMax = extremes.max,
|
|
6417
7246
|
// Correct axis edges when axis has series
|
|
6418
7247
|
// with pointRange (like column)
|
|
6419
7248
|
minPointOffset = pick(coord.axis.minPointOffset, 0);
|
|
@@ -6514,9 +7343,11 @@
|
|
|
6514
7343
|
*/
|
|
6515
7344
|
NavigationBindings.prototype.initUpdate = function () {
|
|
6516
7345
|
var navigation = this;
|
|
6517
|
-
|
|
7346
|
+
ChartNavigationComposition
|
|
7347
|
+
.compose(this.chart).navigation
|
|
7348
|
+
.addUpdate(function (options) {
|
|
6518
7349
|
navigation.update(options);
|
|
6519
|
-
}
|
|
7350
|
+
});
|
|
6520
7351
|
};
|
|
6521
7352
|
/**
|
|
6522
7353
|
* Hook for click on a button, method selcts/unselects buttons,
|
|
@@ -6961,6 +7792,7 @@
|
|
|
6961
7792
|
},
|
|
6962
7793
|
// Simple shapes:
|
|
6963
7794
|
circle: ['shapes'],
|
|
7795
|
+
ellipse: ['shapes'],
|
|
6964
7796
|
verticalLine: [],
|
|
6965
7797
|
label: ['labelOptions'],
|
|
6966
7798
|
// Measure
|
|
@@ -6977,7 +7809,9 @@
|
|
|
6977
7809
|
// Define non editable fields per annotation, for example Rectangle inherits
|
|
6978
7810
|
// options from Measure, but crosshairs are not available
|
|
6979
7811
|
NavigationBindings.annotationsNonEditable = {
|
|
6980
|
-
rectangle: ['crosshairX', 'crosshairY', '
|
|
7812
|
+
rectangle: ['crosshairX', 'crosshairY', 'labelOptions'],
|
|
7813
|
+
ellipse: ['labelOptions'],
|
|
7814
|
+
circle: ['labelOptions']
|
|
6981
7815
|
};
|
|
6982
7816
|
return NavigationBindings;
|
|
6983
7817
|
}());
|
|
@@ -7094,7 +7928,6 @@
|
|
|
7094
7928
|
* Configure the Popup strings in the chart. Requires the
|
|
7095
7929
|
* `annotations.js` or `annotations-advanced.src.js` module to be
|
|
7096
7930
|
* loaded.
|
|
7097
|
-
*
|
|
7098
7931
|
* @since 7.0.0
|
|
7099
7932
|
* @product highcharts highstock
|
|
7100
7933
|
*/
|
|
@@ -7108,6 +7941,7 @@
|
|
|
7108
7941
|
simpleShapes: 'Simple shapes',
|
|
7109
7942
|
lines: 'Lines',
|
|
7110
7943
|
circle: 'Circle',
|
|
7944
|
+
ellipse: 'Ellipse',
|
|
7111
7945
|
rectangle: 'Rectangle',
|
|
7112
7946
|
label: 'Label',
|
|
7113
7947
|
shapeOptions: 'Shape options',
|
|
@@ -7168,9 +8002,16 @@
|
|
|
7168
8002
|
* - `end`: last event to be called after last step event
|
|
7169
8003
|
*
|
|
7170
8004
|
* @type {Highcharts.Dictionary<Highcharts.NavigationBindingsOptionsObject>|*}
|
|
7171
|
-
*
|
|
7172
|
-
*
|
|
8005
|
+
*
|
|
8006
|
+
* @sample {highstock} stock/stocktools/stocktools-thresholds
|
|
8007
|
+
* Custom bindings
|
|
8008
|
+
* @sample {highcharts} highcharts/annotations/bindings/
|
|
8009
|
+
* Simple binding
|
|
8010
|
+
* @sample {highcharts} highcharts/annotations/bindings-custom-annotation/
|
|
8011
|
+
* Custom annotation binding
|
|
8012
|
+
*
|
|
7173
8013
|
* @since 7.0.0
|
|
8014
|
+
* @requires modules/annotations
|
|
7174
8015
|
* @product highcharts highstock
|
|
7175
8016
|
*/
|
|
7176
8017
|
bindings: {
|
|
@@ -7207,27 +8048,21 @@
|
|
|
7207
8048
|
},
|
|
7208
8049
|
r: 5
|
|
7209
8050
|
}]
|
|
7210
|
-
}, navigation
|
|
7211
|
-
.annotationsOptions, navigation
|
|
7212
|
-
.bindings
|
|
7213
|
-
.circleAnnotation
|
|
7214
|
-
.annotationsOptions));
|
|
8051
|
+
}, navigation.annotationsOptions, navigation.bindings.circleAnnotation.annotationsOptions));
|
|
7215
8052
|
},
|
|
7216
8053
|
/** @ignore-option */
|
|
7217
8054
|
steps: [
|
|
7218
8055
|
function (e, annotation) {
|
|
7219
8056
|
var mockPointOpts = annotation.options.shapes[0]
|
|
7220
8057
|
.point,
|
|
7221
|
-
inverted = this.chart.inverted,
|
|
7222
|
-
x,
|
|
7223
|
-
y,
|
|
7224
8058
|
distance;
|
|
7225
8059
|
if (isNumber(mockPointOpts.xAxis) &&
|
|
7226
8060
|
isNumber(mockPointOpts.yAxis)) {
|
|
7227
|
-
|
|
7228
|
-
.
|
|
7229
|
-
|
|
7230
|
-
.
|
|
8061
|
+
var inverted = this.chart.inverted,
|
|
8062
|
+
x = this.chart.xAxis[mockPointOpts.xAxis]
|
|
8063
|
+
.toPixels(mockPointOpts.x),
|
|
8064
|
+
y = this.chart.yAxis[mockPointOpts.yAxis]
|
|
8065
|
+
.toPixels(mockPointOpts.y);
|
|
7231
8066
|
distance = Math.max(Math.sqrt(Math.pow(inverted ? y - e.chartX : x - e.chartX, 2) +
|
|
7232
8067
|
Math.pow(inverted ? x - e.chartY : y - e.chartY, 2)), 5);
|
|
7233
8068
|
}
|
|
@@ -7239,6 +8074,58 @@
|
|
|
7239
8074
|
}
|
|
7240
8075
|
]
|
|
7241
8076
|
},
|
|
8077
|
+
ellipseAnnotation: {
|
|
8078
|
+
className: 'highcharts-ellipse-annotation',
|
|
8079
|
+
start: function (e) {
|
|
8080
|
+
var coords = this.chart.pointer.getCoordinates(e),
|
|
8081
|
+
coordsX = this.utils.getAssignedAxis(coords.xAxis),
|
|
8082
|
+
coordsY = this.utils.getAssignedAxis(coords.yAxis),
|
|
8083
|
+
navigation = this.chart.options.navigation;
|
|
8084
|
+
if (!coordsX || !coordsY) {
|
|
8085
|
+
return;
|
|
8086
|
+
}
|
|
8087
|
+
return this.chart.addAnnotation(merge({
|
|
8088
|
+
langKey: 'ellipse',
|
|
8089
|
+
type: 'basicAnnotation',
|
|
8090
|
+
shapes: [
|
|
8091
|
+
{
|
|
8092
|
+
type: 'ellipse',
|
|
8093
|
+
xAxis: coordsX.axis.options.index,
|
|
8094
|
+
yAxis: coordsY.axis.options.index,
|
|
8095
|
+
points: [{
|
|
8096
|
+
x: coordsX.value,
|
|
8097
|
+
y: coordsY.value
|
|
8098
|
+
}, {
|
|
8099
|
+
x: coordsX.value,
|
|
8100
|
+
y: coordsY.value
|
|
8101
|
+
}],
|
|
8102
|
+
ry: 1
|
|
8103
|
+
}
|
|
8104
|
+
]
|
|
8105
|
+
}, navigation.annotationsOptions, navigation.bindings.ellipseAnnotation.annotationOptions));
|
|
8106
|
+
},
|
|
8107
|
+
steps: [
|
|
8108
|
+
function (e, annotation) {
|
|
8109
|
+
var target = annotation.shapes[0],
|
|
8110
|
+
position = target.getAbsolutePosition(target.points[1]);
|
|
8111
|
+
target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
|
|
8112
|
+
target.redraw(false);
|
|
8113
|
+
},
|
|
8114
|
+
function (e, annotation) {
|
|
8115
|
+
var target = annotation.shapes[0],
|
|
8116
|
+
position = target.getAbsolutePosition(target.points[0]),
|
|
8117
|
+
position2 = target.getAbsolutePosition(target.points[1]),
|
|
8118
|
+
newR = target.getDistanceFromLine(position,
|
|
8119
|
+
position2,
|
|
8120
|
+
e.chartX,
|
|
8121
|
+
e.chartY),
|
|
8122
|
+
yAxis = target.getYAxis(),
|
|
8123
|
+
newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
|
|
8124
|
+
target.setYRadius(newRY);
|
|
8125
|
+
target.redraw(false);
|
|
8126
|
+
}
|
|
8127
|
+
]
|
|
8128
|
+
},
|
|
7242
8129
|
/**
|
|
7243
8130
|
* A rectangle annotation bindings. Includes `start` and one event
|
|
7244
8131
|
* in `steps` array.
|
|
@@ -7272,7 +8159,8 @@
|
|
|
7272
8159
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
7273
8160
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
7274
8161
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
7275
|
-
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y }
|
|
8162
|
+
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
8163
|
+
{ command: 'Z' }
|
|
7276
8164
|
]
|
|
7277
8165
|
}]
|
|
7278
8166
|
}, navigation
|
|
@@ -7357,7 +8245,7 @@
|
|
|
7357
8245
|
* from a different server.
|
|
7358
8246
|
*
|
|
7359
8247
|
* @type {string}
|
|
7360
|
-
* @default https://code.highcharts.com/9.
|
|
8248
|
+
* @default https://code.highcharts.com/9.3.0/gfx/stock-icons/
|
|
7361
8249
|
* @since 7.1.3
|
|
7362
8250
|
* @apioption navigation.iconsURL
|
|
7363
8251
|
*/
|
|
@@ -7413,6 +8301,7 @@
|
|
|
7413
8301
|
* @extends annotations
|
|
7414
8302
|
* @exclude crookedLine, elliottWave, fibonacci, infinityLine,
|
|
7415
8303
|
* measure, pitchfork, tunnel, verticalLine, basicAnnotation
|
|
8304
|
+
* @requires modules/annotations
|
|
7416
8305
|
* @apioption navigation.annotationsOptions
|
|
7417
8306
|
*/
|
|
7418
8307
|
annotationsOptions: {
|
|
@@ -7497,20 +8386,34 @@
|
|
|
7497
8386
|
fireEvent = U.fireEvent,
|
|
7498
8387
|
isArray = U.isArray,
|
|
7499
8388
|
isObject = U.isObject,
|
|
7500
|
-
isString = U.isString,
|
|
7501
8389
|
objectEach = U.objectEach,
|
|
7502
8390
|
pick = U.pick,
|
|
7503
8391
|
stableSort = U.stableSort,
|
|
7504
8392
|
wrap = U.wrap;
|
|
7505
|
-
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';
|
|
8393
|
+
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';
|
|
8394
|
+
/**
|
|
8395
|
+
* Enum for properties which should have dropdown list.
|
|
8396
|
+
* @private
|
|
8397
|
+
*/
|
|
8398
|
+
var DropdownProperties;
|
|
8399
|
+
(function (DropdownProperties) {
|
|
8400
|
+
DropdownProperties[DropdownProperties["params.algorithm"] = 0] = "params.algorithm";
|
|
8401
|
+
DropdownProperties[DropdownProperties["params.average"] = 1] = "params.average";
|
|
8402
|
+
})(DropdownProperties || (DropdownProperties = {}));
|
|
8403
|
+
/**
|
|
8404
|
+
* List of available algorithms for the specific indicator.
|
|
8405
|
+
* @private
|
|
8406
|
+
*/
|
|
8407
|
+
var dropdownParameters = {
|
|
8408
|
+
'algorithm-pivotpoints': ['standard', 'fibonacci', 'camarilla'],
|
|
8409
|
+
'average-disparityindex': ['sma', 'ema', 'dema', 'tema', 'wma']
|
|
8410
|
+
};
|
|
7506
8411
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
7507
8412
|
// onContainerMouseDown blocks internal popup events, due to e.preventDefault.
|
|
7508
8413
|
// Related issue #4606
|
|
7509
8414
|
wrap(Pointer.prototype, 'onContainerMouseDown', function (proceed, e) {
|
|
7510
|
-
var popupClass = e.target && e.target.className;
|
|
7511
8415
|
// elements is not in popup
|
|
7512
|
-
if (!(
|
|
7513
|
-
popupClass.indexOf(PREFIX + 'popup-field') >= 0)) {
|
|
8416
|
+
if (!this.inClass(e.target, PREFIX + 'popup')) {
|
|
7514
8417
|
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
|
7515
8418
|
}
|
|
7516
8419
|
});
|
|
@@ -7531,7 +8434,22 @@
|
|
|
7531
8434
|
// create popup div
|
|
7532
8435
|
this.container = createElement(DIV, {
|
|
7533
8436
|
className: PREFIX + 'popup highcharts-no-tooltip'
|
|
7534
|
-
},
|
|
8437
|
+
}, void 0, parentDiv);
|
|
8438
|
+
addEvent(this.container, 'mousedown', function () {
|
|
8439
|
+
var activeAnnotation = chart &&
|
|
8440
|
+
chart.navigationBindings &&
|
|
8441
|
+
chart.navigationBindings.activeAnnotation;
|
|
8442
|
+
if (activeAnnotation) {
|
|
8443
|
+
activeAnnotation.cancelClick = true;
|
|
8444
|
+
var unbind_1 = addEvent(H.doc, 'click',
|
|
8445
|
+
function () {
|
|
8446
|
+
setTimeout(function () {
|
|
8447
|
+
activeAnnotation.cancelClick = false;
|
|
8448
|
+
}, 0);
|
|
8449
|
+
unbind_1();
|
|
8450
|
+
});
|
|
8451
|
+
}
|
|
8452
|
+
});
|
|
7535
8453
|
this.lang = this.getLangpack();
|
|
7536
8454
|
this.iconsURL = iconsURL;
|
|
7537
8455
|
// add close button
|
|
@@ -7548,7 +8466,7 @@
|
|
|
7548
8466
|
// create close popup btn
|
|
7549
8467
|
closeBtn = createElement(DIV, {
|
|
7550
8468
|
className: PREFIX + 'popup-close'
|
|
7551
|
-
},
|
|
8469
|
+
}, void 0, this.container);
|
|
7552
8470
|
closeBtn.style['background-image'] = 'url(' +
|
|
7553
8471
|
(iconsURL.match(/png|svg|jpeg|jpg|gif/ig) ?
|
|
7554
8472
|
iconsURL : iconsURL + 'close.svg') + ')';
|
|
@@ -7577,15 +8495,15 @@
|
|
|
7577
8495
|
// left column
|
|
7578
8496
|
lhsCol = createElement(DIV, {
|
|
7579
8497
|
className: PREFIX + 'popup-lhs-col'
|
|
7580
|
-
},
|
|
8498
|
+
}, void 0, container);
|
|
7581
8499
|
// right column
|
|
7582
8500
|
rhsCol = createElement(DIV, {
|
|
7583
8501
|
className: PREFIX + 'popup-rhs-col'
|
|
7584
|
-
},
|
|
8502
|
+
}, void 0, container);
|
|
7585
8503
|
// wrapper content
|
|
7586
8504
|
createElement(DIV, {
|
|
7587
8505
|
className: PREFIX + 'popup-rhs-col-wrapper'
|
|
7588
|
-
},
|
|
8506
|
+
}, void 0, rhsCol);
|
|
7589
8507
|
return {
|
|
7590
8508
|
lhsCol: lhsCol,
|
|
7591
8509
|
rhsCol: rhsCol
|
|
@@ -7593,34 +8511,43 @@
|
|
|
7593
8511
|
},
|
|
7594
8512
|
/**
|
|
7595
8513
|
* Create input with label.
|
|
8514
|
+
*
|
|
7596
8515
|
* @private
|
|
8516
|
+
*
|
|
7597
8517
|
* @param {string} option
|
|
7598
|
-
*
|
|
7599
|
-
*
|
|
7600
|
-
*
|
|
7601
|
-
*
|
|
7602
|
-
*
|
|
7603
|
-
* @param {
|
|
7604
|
-
*
|
|
7605
|
-
*
|
|
8518
|
+
* Chain of fields i.e params.styles.fontSize separeted by the dot.
|
|
8519
|
+
*
|
|
8520
|
+
* @param {string} indicatorType
|
|
8521
|
+
* Type of the indicator i.e. sma, ema...
|
|
8522
|
+
*
|
|
8523
|
+
* @param {HTMLDOMElement} parentDiv
|
|
8524
|
+
* HTML parent element.
|
|
8525
|
+
*
|
|
8526
|
+
* @param {Highcharts.InputAttributes} inputAttributes
|
|
8527
|
+
* Attributes of the input.
|
|
8528
|
+
*
|
|
8529
|
+
* @return {HTMLInputElement}
|
|
8530
|
+
* Return created input element.
|
|
7606
8531
|
*/
|
|
7607
|
-
addInput: function (option,
|
|
7608
|
-
var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX +
|
|
8532
|
+
addInput: function (option, indicatorType, parentDiv, inputAttributes) {
|
|
8533
|
+
var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX + indicatorType + '-' + pick(inputAttributes.htmlFor, optionName);
|
|
8534
|
+
var input;
|
|
7609
8535
|
if (!inputName.match(indexFilter)) {
|
|
7610
8536
|
// add label
|
|
7611
8537
|
createElement(LABEL, {
|
|
7612
|
-
htmlFor: inputName
|
|
8538
|
+
htmlFor: inputName,
|
|
8539
|
+
className: inputAttributes.labelClassName
|
|
7613
8540
|
}, void 0, parentDiv).appendChild(doc.createTextNode(lang[optionName] || optionName));
|
|
7614
8541
|
}
|
|
7615
8542
|
// add input
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
8543
|
+
input = createElement(INPUT, {
|
|
8544
|
+
name: inputName,
|
|
8545
|
+
value: inputAttributes.value,
|
|
8546
|
+
type: inputAttributes.type,
|
|
8547
|
+
className: PREFIX + 'popup-field'
|
|
8548
|
+
}, void 0, parentDiv);
|
|
8549
|
+
input.setAttribute(PREFIX + 'data-name', option);
|
|
8550
|
+
return input;
|
|
7624
8551
|
},
|
|
7625
8552
|
/**
|
|
7626
8553
|
* Create button.
|
|
@@ -7638,38 +8565,46 @@
|
|
|
7638
8565
|
* @return {Highcharts.HTMLDOMElement}
|
|
7639
8566
|
* HTML button
|
|
7640
8567
|
*/
|
|
7641
|
-
addButton: function (parentDiv, label, type,
|
|
8568
|
+
addButton: function (parentDiv, label, type, fieldsDiv, callback) {
|
|
7642
8569
|
var _self = this,
|
|
7643
8570
|
closePopup = this.closePopup,
|
|
7644
8571
|
getFields = this.getFields,
|
|
7645
8572
|
button;
|
|
7646
8573
|
button = createElement(BUTTON, void 0, void 0, parentDiv);
|
|
7647
8574
|
button.appendChild(doc.createTextNode(label));
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
8575
|
+
if (callback) {
|
|
8576
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
8577
|
+
addEvent(button, eventName, function () {
|
|
8578
|
+
closePopup.call(_self);
|
|
8579
|
+
return callback(getFields(fieldsDiv, type));
|
|
8580
|
+
});
|
|
7652
8581
|
});
|
|
7653
|
-
}
|
|
8582
|
+
}
|
|
7654
8583
|
return button;
|
|
7655
8584
|
},
|
|
7656
8585
|
/**
|
|
7657
|
-
* Get values from all inputs and create JSON.
|
|
8586
|
+
* Get values from all inputs and selections then create JSON.
|
|
8587
|
+
*
|
|
7658
8588
|
* @private
|
|
7659
|
-
*
|
|
7660
|
-
* @param {
|
|
7661
|
-
*
|
|
8589
|
+
*
|
|
8590
|
+
* @param {Highcharts.HTMLDOMElement} parentDiv
|
|
8591
|
+
* The container where inputs and selections are created.
|
|
8592
|
+
*
|
|
8593
|
+
* @param {string} type
|
|
8594
|
+
* Type of the popup bookmark (add|edit|remove).
|
|
8595
|
+
*
|
|
8596
|
+
* @return {Highcharts.PopupFieldsObject}
|
|
7662
8597
|
*/
|
|
7663
8598
|
getFields: function (parentDiv, type) {
|
|
7664
|
-
var inputList = parentDiv.querySelectorAll(
|
|
8599
|
+
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];
|
|
8600
|
+
var fieldsOutput;
|
|
7665
8601
|
fieldsOutput = {
|
|
7666
8602
|
actionType: type,
|
|
7667
|
-
linkedTo: linkedTo && linkedTo.getAttribute('value'),
|
|
8603
|
+
linkedTo: linkedTo && linkedTo.getAttribute('value') || '',
|
|
7668
8604
|
fields: {}
|
|
7669
8605
|
};
|
|
7670
|
-
|
|
7671
|
-
param = input.getAttribute(PREFIX + 'data-name');
|
|
7672
|
-
seriesId = input.getAttribute(PREFIX + 'data-series-id');
|
|
8606
|
+
inputList.forEach(function (input) {
|
|
8607
|
+
var param = input.getAttribute(PREFIX + 'data-name'), seriesId = input.getAttribute(PREFIX + 'data-series-id');
|
|
7673
8608
|
// params
|
|
7674
8609
|
if (seriesId) {
|
|
7675
8610
|
fieldsOutput.seriesId = input.value;
|
|
@@ -7682,8 +8617,16 @@
|
|
|
7682
8617
|
fieldsOutput.type = input.value;
|
|
7683
8618
|
}
|
|
7684
8619
|
});
|
|
8620
|
+
selectList.forEach(function (select) {
|
|
8621
|
+
var id = select.id;
|
|
8622
|
+
// Get inputs only for the parameters, not for series and volume.
|
|
8623
|
+
if (id !== PREFIX + 'select-series' && id !== PREFIX + 'select-volume') {
|
|
8624
|
+
var parameter = id.split('highcharts-select-')[1];
|
|
8625
|
+
fieldsOutput.fields[parameter] = select.value;
|
|
8626
|
+
}
|
|
8627
|
+
});
|
|
7685
8628
|
if (volumeTo) {
|
|
7686
|
-
fieldsOutput.fields['params.volumeSeriesID'] = volumeTo.getAttribute('value');
|
|
8629
|
+
fieldsOutput.fields['params.volumeSeriesID'] = volumeTo.getAttribute('value') || '';
|
|
7687
8630
|
}
|
|
7688
8631
|
return fieldsOutput;
|
|
7689
8632
|
},
|
|
@@ -7793,13 +8736,13 @@
|
|
|
7793
8736
|
// Basic shapes:
|
|
7794
8737
|
options.shapes && options.shapes[0].type)));
|
|
7795
8738
|
// add buttons
|
|
7796
|
-
button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove',
|
|
8739
|
+
button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove', popupDiv, callback);
|
|
7797
8740
|
button.className += ' ' + PREFIX + 'annotation-remove-button';
|
|
7798
8741
|
button.style['background-image'] = 'url(' +
|
|
7799
8742
|
this.iconsURL + 'destroy.svg)';
|
|
7800
|
-
button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', function () {
|
|
8743
|
+
button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', popupDiv, function () {
|
|
7801
8744
|
showForm.call(_self, 'annotation-edit', chart, options, callback);
|
|
7802
|
-
}
|
|
8745
|
+
});
|
|
7803
8746
|
button.className += ' ' + PREFIX + 'annotation-edit-button';
|
|
7804
8747
|
button.style['background-image'] = 'url(' +
|
|
7805
8748
|
this.iconsURL + 'edit.svg)';
|
|
@@ -7833,14 +8776,14 @@
|
|
|
7833
8776
|
// left column
|
|
7834
8777
|
lhsCol = createElement(DIV, {
|
|
7835
8778
|
className: PREFIX + 'popup-lhs-col ' + PREFIX + 'popup-lhs-full'
|
|
7836
|
-
},
|
|
8779
|
+
}, void 0, popupDiv);
|
|
7837
8780
|
bottomRow = createElement(DIV, {
|
|
7838
8781
|
className: PREFIX + 'popup-bottom-row'
|
|
7839
|
-
},
|
|
8782
|
+
}, void 0, popupDiv);
|
|
7840
8783
|
this.annotations.addFormFields.call(this, lhsCol, chart, '', options, [], true);
|
|
7841
8784
|
this.addButton(bottomRow, isInit ?
|
|
7842
8785
|
(lang.addButton || 'add') :
|
|
7843
|
-
(lang.saveButton || 'save'), isInit ? 'add' : 'save',
|
|
8786
|
+
(lang.saveButton || 'save'), isInit ? 'add' : 'save', popupDiv, callback);
|
|
7844
8787
|
},
|
|
7845
8788
|
/**
|
|
7846
8789
|
* Create annotation's form fields.
|
|
@@ -7913,6 +8856,10 @@
|
|
|
7913
8856
|
}, void 0, genInput[2]).appendChild(doc.createTextNode(genInput[1]));
|
|
7914
8857
|
}
|
|
7915
8858
|
else {
|
|
8859
|
+
genInput[4] = {
|
|
8860
|
+
value: genInput[4][0],
|
|
8861
|
+
type: genInput[4][1]
|
|
8862
|
+
};
|
|
7916
8863
|
addInput.apply(genInput[0], genInput.splice(1));
|
|
7917
8864
|
}
|
|
7918
8865
|
});
|
|
@@ -7940,138 +8887,431 @@
|
|
|
7940
8887
|
.querySelectorAll('.' + PREFIX + 'tab-item-content');
|
|
7941
8888
|
// ADD tab
|
|
7942
8889
|
this.addColsContainer(tabsContainers[0]);
|
|
8890
|
+
indicators.addSearchBox.call(this, chart, tabsContainers[0]);
|
|
7943
8891
|
indicators.addIndicatorList.call(this, chart, tabsContainers[0], 'add');
|
|
7944
8892
|
buttonParentDiv = tabsContainers[0]
|
|
7945
8893
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
|
|
7946
|
-
this.addButton(buttonParentDiv, lang.addButton || 'add', 'add',
|
|
8894
|
+
this.addButton(buttonParentDiv, lang.addButton || 'add', 'add', buttonParentDiv, callback);
|
|
7947
8895
|
// EDIT tab
|
|
7948
8896
|
this.addColsContainer(tabsContainers[1]);
|
|
7949
8897
|
indicators.addIndicatorList.call(this, chart, tabsContainers[1], 'edit');
|
|
7950
8898
|
buttonParentDiv = tabsContainers[1]
|
|
7951
8899
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
|
|
7952
|
-
this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit',
|
|
7953
|
-
this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove',
|
|
8900
|
+
this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit', buttonParentDiv, callback);
|
|
8901
|
+
this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove', buttonParentDiv, callback);
|
|
8902
|
+
},
|
|
8903
|
+
/**
|
|
8904
|
+
* Filter object of series which are not indicators.
|
|
8905
|
+
* If the filter string exists, check against it.
|
|
8906
|
+
*
|
|
8907
|
+
* @private
|
|
8908
|
+
*
|
|
8909
|
+
* @param {Highcharts.FilteredSeries} series
|
|
8910
|
+
* All series are available in the plotOptions.
|
|
8911
|
+
*
|
|
8912
|
+
* @param {string|undefined} filter
|
|
8913
|
+
* Applied filter string from the input.
|
|
8914
|
+
* For the first iteration, it's an empty string.
|
|
8915
|
+
*
|
|
8916
|
+
* @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
|
|
8917
|
+
* Returns array of filtered series based on filter string.
|
|
8918
|
+
*/
|
|
8919
|
+
filterSeries: function (series, filter) {
|
|
8920
|
+
var popup = this,
|
|
8921
|
+
indicators = popup.indicators,
|
|
8922
|
+
lang = popup.chart && popup.chart.options.lang,
|
|
8923
|
+
indicatorAliases = lang &&
|
|
8924
|
+
lang.navigation &&
|
|
8925
|
+
lang.navigation.popup &&
|
|
8926
|
+
lang.navigation.popup.indicatorAliases;
|
|
8927
|
+
var filteredSeriesArray = [],
|
|
8928
|
+
filteredSeries;
|
|
8929
|
+
objectEach(series, function (series, value) {
|
|
8930
|
+
var seriesOptions = series.options;
|
|
8931
|
+
// Allow only indicators.
|
|
8932
|
+
if (series.params || seriesOptions &&
|
|
8933
|
+
seriesOptions.params) {
|
|
8934
|
+
var _a = indicators.getNameType(series,
|
|
8935
|
+
value),
|
|
8936
|
+
indicatorFullName = _a.indicatorFullName,
|
|
8937
|
+
indicatorType = _a.indicatorType;
|
|
8938
|
+
if (filter) {
|
|
8939
|
+
// Replace invalid characters.
|
|
8940
|
+
var validFilter = filter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
8941
|
+
var regex = new RegExp(validFilter, 'i'),
|
|
8942
|
+
alias = indicatorAliases &&
|
|
8943
|
+
indicatorAliases[indicatorType] &&
|
|
8944
|
+
indicatorAliases[indicatorType].join(' ') || '';
|
|
8945
|
+
if (indicatorFullName.match(regex) || alias.match(regex)) {
|
|
8946
|
+
filteredSeries = {
|
|
8947
|
+
indicatorFullName: indicatorFullName,
|
|
8948
|
+
indicatorType: indicatorType,
|
|
8949
|
+
series: series
|
|
8950
|
+
};
|
|
8951
|
+
filteredSeriesArray.push(filteredSeries);
|
|
8952
|
+
}
|
|
8953
|
+
}
|
|
8954
|
+
else {
|
|
8955
|
+
filteredSeries = {
|
|
8956
|
+
indicatorFullName: indicatorFullName,
|
|
8957
|
+
indicatorType: indicatorType,
|
|
8958
|
+
series: series
|
|
8959
|
+
};
|
|
8960
|
+
filteredSeriesArray.push(filteredSeries);
|
|
8961
|
+
}
|
|
8962
|
+
}
|
|
8963
|
+
});
|
|
8964
|
+
return filteredSeriesArray;
|
|
8965
|
+
},
|
|
8966
|
+
/**
|
|
8967
|
+
* Filter an array of series and map its names and types.
|
|
8968
|
+
*
|
|
8969
|
+
* @private
|
|
8970
|
+
*
|
|
8971
|
+
* @param {Highcharts.FilteredSeries} series
|
|
8972
|
+
* All series that are available in the plotOptions.
|
|
8973
|
+
*
|
|
8974
|
+
* @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
|
|
8975
|
+
* Returns array of filtered series based on filter string.
|
|
8976
|
+
*/
|
|
8977
|
+
filterSeriesArray: function (series) {
|
|
8978
|
+
var filteredSeriesArray = [],
|
|
8979
|
+
filteredSeries;
|
|
8980
|
+
// Allow only indicators.
|
|
8981
|
+
series.forEach(function (series) {
|
|
8982
|
+
var seriesOptions = series.options;
|
|
8983
|
+
if (series.is('sma')) {
|
|
8984
|
+
filteredSeries = {
|
|
8985
|
+
indicatorFullName: series.name,
|
|
8986
|
+
indicatorType: series.type,
|
|
8987
|
+
series: series
|
|
8988
|
+
};
|
|
8989
|
+
filteredSeriesArray.push(filteredSeries);
|
|
8990
|
+
}
|
|
8991
|
+
});
|
|
8992
|
+
return filteredSeriesArray;
|
|
7954
8993
|
},
|
|
7955
8994
|
/**
|
|
7956
8995
|
* Create HTML list of all indicators (ADD mode) or added indicators
|
|
7957
8996
|
* (EDIT mode).
|
|
8997
|
+
*
|
|
7958
8998
|
* @private
|
|
8999
|
+
*
|
|
9000
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9001
|
+
* The chart object.
|
|
9002
|
+
*
|
|
9003
|
+
* @param {string} [optionName]
|
|
9004
|
+
* Name of the option into which selection is being added.
|
|
9005
|
+
*
|
|
9006
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
9007
|
+
* HTML parent element.
|
|
9008
|
+
*
|
|
9009
|
+
* @param {string} listType
|
|
9010
|
+
* Type of list depending on the selected bookmark.
|
|
9011
|
+
* Might be 'add' or 'edit'.
|
|
9012
|
+
*
|
|
9013
|
+
* @param {string|undefined} filter
|
|
9014
|
+
* Applied filter string from the input.
|
|
9015
|
+
* For the first iteration, it's an empty string.
|
|
7959
9016
|
*/
|
|
7960
|
-
addIndicatorList: function (chart, parentDiv, listType) {
|
|
7961
|
-
var
|
|
9017
|
+
addIndicatorList: function (chart, parentDiv, listType, filter) {
|
|
9018
|
+
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 ?
|
|
7962
9019
|
chart.series : // EDIT mode
|
|
7963
|
-
chart.options.plotOptions // ADD mode
|
|
7964
|
-
)
|
|
7965
|
-
if (!chart) {
|
|
9020
|
+
chart.options.plotOptions || {} // ADD mode
|
|
9021
|
+
);
|
|
9022
|
+
if (!chart && series) {
|
|
7966
9023
|
return;
|
|
7967
9024
|
}
|
|
7968
|
-
|
|
9025
|
+
var rhsColWrapper,
|
|
9026
|
+
indicatorList,
|
|
9027
|
+
item,
|
|
9028
|
+
filteredSeriesArray = [];
|
|
9029
|
+
// Filter and sort the series.
|
|
9030
|
+
if (!isEdit && !isArray(series)) {
|
|
9031
|
+
// Apply filters only for the 'add' indicator list.
|
|
9032
|
+
filteredSeriesArray = indicators.filterSeries.call(this, series, filter);
|
|
9033
|
+
}
|
|
9034
|
+
else if (isArray(series)) {
|
|
9035
|
+
filteredSeriesArray = indicators.filterSeriesArray.call(this, series);
|
|
9036
|
+
}
|
|
9037
|
+
// Sort indicators alphabeticaly.
|
|
9038
|
+
stableSort(filteredSeriesArray, function (a, b) {
|
|
9039
|
+
var seriesAName = a.indicatorFullName.toLowerCase(),
|
|
9040
|
+
seriesBName = b.indicatorFullName.toLowerCase();
|
|
9041
|
+
return (seriesAName < seriesBName) ?
|
|
9042
|
+
-1 : (seriesAName > seriesBName) ? 1 : 0;
|
|
9043
|
+
});
|
|
9044
|
+
// If the list exists remove it from the DOM
|
|
9045
|
+
// in order to create a new one with different filters.
|
|
9046
|
+
if (lhsCol.children[1]) {
|
|
9047
|
+
lhsCol.children[1].remove();
|
|
9048
|
+
}
|
|
9049
|
+
// Create wrapper for list.
|
|
7969
9050
|
indicatorList = createElement(UL, {
|
|
7970
9051
|
className: PREFIX + 'indicator-list'
|
|
7971
|
-
},
|
|
9052
|
+
}, void 0, lhsCol);
|
|
7972
9053
|
rhsColWrapper = rhsCol
|
|
7973
9054
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col-wrapper')[0];
|
|
7974
|
-
|
|
7975
|
-
var
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
});
|
|
9055
|
+
filteredSeriesArray.forEach(function (seriesSet) {
|
|
9056
|
+
var indicatorFullName = seriesSet.indicatorFullName,
|
|
9057
|
+
indicatorType = seriesSet.indicatorType,
|
|
9058
|
+
series = seriesSet.series;
|
|
9059
|
+
item = createElement(LI, {
|
|
9060
|
+
className: PREFIX + 'indicator-list'
|
|
9061
|
+
}, void 0, indicatorList);
|
|
9062
|
+
item.appendChild(doc.createTextNode(indicatorFullName));
|
|
9063
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
9064
|
+
addEvent(item, eventName, function () {
|
|
9065
|
+
var button = rhsColWrapper.parentNode.children[1];
|
|
9066
|
+
addFormFields.call(popup, chart, series, indicatorType, rhsColWrapper);
|
|
9067
|
+
if (button) {
|
|
9068
|
+
button.style.display = 'block';
|
|
9069
|
+
}
|
|
9070
|
+
// add hidden input with series.id
|
|
9071
|
+
if (isEdit && series.options) {
|
|
9072
|
+
createElement(INPUT, {
|
|
9073
|
+
type: 'hidden',
|
|
9074
|
+
name: PREFIX + 'id-' + indicatorType,
|
|
9075
|
+
value: series.options.id
|
|
9076
|
+
}, void 0, rhsColWrapper).setAttribute(PREFIX + 'data-series-id', series.options.id);
|
|
9077
|
+
}
|
|
7998
9078
|
});
|
|
7999
|
-
}
|
|
9079
|
+
});
|
|
8000
9080
|
});
|
|
8001
9081
|
// select first item from the list
|
|
8002
9082
|
if (indicatorList.childNodes.length > 0) {
|
|
8003
9083
|
indicatorList.childNodes[0].click();
|
|
8004
9084
|
}
|
|
9085
|
+
else if (!isEdit) {
|
|
9086
|
+
rhsColWrapper.parentNode.children[0].innerHTML = lang.noFilterMatch || '';
|
|
9087
|
+
rhsColWrapper.parentNode.children[1].style.display = 'none';
|
|
9088
|
+
}
|
|
9089
|
+
},
|
|
9090
|
+
/**
|
|
9091
|
+
* Add searchbox HTML element and its' label.
|
|
9092
|
+
*
|
|
9093
|
+
* @private
|
|
9094
|
+
*
|
|
9095
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9096
|
+
* The chart object.
|
|
9097
|
+
*
|
|
9098
|
+
* @param {HTMLDOMElement} parentDiv
|
|
9099
|
+
* HTML parent element.
|
|
9100
|
+
*/
|
|
9101
|
+
addSearchBox: function (chart, parentDiv) {
|
|
9102
|
+
var popup = this, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], options = 'searchIndicators', inputAttributes = {
|
|
9103
|
+
value: '',
|
|
9104
|
+
type: 'text',
|
|
9105
|
+
htmlFor: 'search-indicators',
|
|
9106
|
+
labelClassName: 'highcharts-input-search-indicators-label'
|
|
9107
|
+
}, clearFilterText = this.lang.clearFilter, inputWrapper = createElement(DIV, {
|
|
9108
|
+
className: 'highcharts-input-wrapper'
|
|
9109
|
+
}, void 0, lhsCol);
|
|
9110
|
+
var handleInputChange = function (inputText) {
|
|
9111
|
+
// Apply some filters.
|
|
9112
|
+
popup.indicators.addIndicatorList.call(popup,
|
|
9113
|
+
chart,
|
|
9114
|
+
popup.container, 'add',
|
|
9115
|
+
inputText);
|
|
9116
|
+
};
|
|
9117
|
+
// Add input field with the label and button.
|
|
9118
|
+
var input = this.addInput(options,
|
|
9119
|
+
INPUT,
|
|
9120
|
+
inputWrapper,
|
|
9121
|
+
inputAttributes),
|
|
9122
|
+
button = createElement(A, {
|
|
9123
|
+
textContent: clearFilterText
|
|
9124
|
+
},
|
|
9125
|
+
void 0,
|
|
9126
|
+
inputWrapper);
|
|
9127
|
+
input.classList.add('highcharts-input-search-indicators');
|
|
9128
|
+
button.classList.add('clear-filter-button');
|
|
9129
|
+
// Add input change events.
|
|
9130
|
+
addEvent(input, 'input', function (e) {
|
|
9131
|
+
handleInputChange(this.value);
|
|
9132
|
+
// Show clear filter button.
|
|
9133
|
+
if (this.value.length) {
|
|
9134
|
+
button.style.display = 'inline-block';
|
|
9135
|
+
}
|
|
9136
|
+
else {
|
|
9137
|
+
button.style.display = 'none';
|
|
9138
|
+
}
|
|
9139
|
+
});
|
|
9140
|
+
// Add clear filter click event.
|
|
9141
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
9142
|
+
addEvent(button, eventName, function () {
|
|
9143
|
+
// Clear the input.
|
|
9144
|
+
input.value = '';
|
|
9145
|
+
handleInputChange('');
|
|
9146
|
+
// Hide clear filter button- no longer nececary.
|
|
9147
|
+
button.style.display = 'none';
|
|
9148
|
+
});
|
|
9149
|
+
});
|
|
9150
|
+
},
|
|
9151
|
+
/**
|
|
9152
|
+
* Add selection HTML element and its' label.
|
|
9153
|
+
*
|
|
9154
|
+
* @private
|
|
9155
|
+
*
|
|
9156
|
+
* @param {string} indicatorType
|
|
9157
|
+
* Type of the indicator i.e. sma, ema...
|
|
9158
|
+
*
|
|
9159
|
+
* @param {string} [optionName]
|
|
9160
|
+
* Name of the option into which selection is being added.
|
|
9161
|
+
*
|
|
9162
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
9163
|
+
* HTML parent element.
|
|
9164
|
+
*
|
|
9165
|
+
* @return {HTMLSelectElement}
|
|
9166
|
+
*/
|
|
9167
|
+
addSelection: function (indicatorType, optionName, parentDiv) {
|
|
9168
|
+
var optionParamList = optionName.split('.'),
|
|
9169
|
+
labelText = optionParamList[optionParamList.length - 1];
|
|
9170
|
+
var selectName = PREFIX + optionName + '-type-' + indicatorType,
|
|
9171
|
+
lang = this.lang,
|
|
9172
|
+
selectBox;
|
|
9173
|
+
// Add a label for the selection box.
|
|
9174
|
+
createElement(LABEL, {
|
|
9175
|
+
htmlFor: selectName
|
|
9176
|
+
}, null, parentDiv).appendChild(doc.createTextNode(lang[labelText] || optionName));
|
|
9177
|
+
// Create a selection box.
|
|
9178
|
+
selectBox = createElement(SELECT, {
|
|
9179
|
+
name: selectName,
|
|
9180
|
+
className: PREFIX + 'popup-field',
|
|
9181
|
+
id: PREFIX + 'select-' + optionName
|
|
9182
|
+
}, null, parentDiv);
|
|
9183
|
+
selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
|
|
9184
|
+
return selectBox;
|
|
9185
|
+
},
|
|
9186
|
+
/**
|
|
9187
|
+
* Get and add selection options.
|
|
9188
|
+
*
|
|
9189
|
+
* @private
|
|
9190
|
+
*
|
|
9191
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9192
|
+
* The chart object.
|
|
9193
|
+
*
|
|
9194
|
+
* @param {string} [optionName]
|
|
9195
|
+
* Name of the option into which selection is being added.
|
|
9196
|
+
*
|
|
9197
|
+
* @param {HTMLSelectElement} [selectBox]
|
|
9198
|
+
* HTML select box element to which the options are being added.
|
|
9199
|
+
*
|
|
9200
|
+
* @param {string|undefined} indicatorType
|
|
9201
|
+
* Type of the indicator i.e. sma, ema...
|
|
9202
|
+
*
|
|
9203
|
+
* @param {string|undefined} parameterName
|
|
9204
|
+
* Name of the parameter which should be applied.
|
|
9205
|
+
*
|
|
9206
|
+
* @param {string|undefined} selectedOption
|
|
9207
|
+
* Default value in dropdown.
|
|
9208
|
+
*/
|
|
9209
|
+
addSelectionOptions: function (chart, optionName, selectBox, indicatorType, parameterName, selectedOption, currentSeries) {
|
|
9210
|
+
var popup = this;
|
|
9211
|
+
// Get and apply selection options for the possible series.
|
|
9212
|
+
if (optionName === 'series' || optionName === 'volume') {
|
|
9213
|
+
// List all series which have id - mandatory for indicator.
|
|
9214
|
+
chart.series.forEach(function (series) {
|
|
9215
|
+
var seriesOptions = series.options,
|
|
9216
|
+
seriesName = seriesOptions.name ||
|
|
9217
|
+
seriesOptions.params ? series.name : seriesOptions.id || '';
|
|
9218
|
+
if (seriesOptions.id !== PREFIX + 'navigator-series' &&
|
|
9219
|
+
seriesOptions.id !== (currentSeries && currentSeries.options && currentSeries.options.id)) {
|
|
9220
|
+
if (!defined(selectedOption) &&
|
|
9221
|
+
optionName === 'volume' &&
|
|
9222
|
+
series.type === 'column') {
|
|
9223
|
+
selectedOption = seriesOptions.id;
|
|
9224
|
+
}
|
|
9225
|
+
createElement(OPTION, {
|
|
9226
|
+
value: seriesOptions.id
|
|
9227
|
+
}, void 0, selectBox).appendChild(doc.createTextNode(seriesName));
|
|
9228
|
+
}
|
|
9229
|
+
});
|
|
9230
|
+
}
|
|
9231
|
+
else if (indicatorType && parameterName) {
|
|
9232
|
+
// Get and apply options for the possible parameters.
|
|
9233
|
+
var dropdownKey = parameterName + '-' + indicatorType,
|
|
9234
|
+
parameterOption = dropdownParameters[dropdownKey];
|
|
9235
|
+
parameterOption.forEach(function (element) {
|
|
9236
|
+
createElement(OPTION, {
|
|
9237
|
+
value: element
|
|
9238
|
+
}, void 0, selectBox).appendChild(doc.createTextNode(element));
|
|
9239
|
+
});
|
|
9240
|
+
}
|
|
9241
|
+
// Add the default dropdown value if defined.
|
|
9242
|
+
if (defined(selectedOption)) {
|
|
9243
|
+
selectBox.value = selectedOption;
|
|
9244
|
+
}
|
|
8005
9245
|
},
|
|
8006
9246
|
/**
|
|
8007
9247
|
* Extract full name and type of requested indicator.
|
|
9248
|
+
*
|
|
8008
9249
|
* @private
|
|
9250
|
+
*
|
|
8009
9251
|
* @param {Highcharts.Series} series
|
|
8010
|
-
*
|
|
8011
|
-
*
|
|
8012
|
-
*
|
|
8013
|
-
* @
|
|
9252
|
+
* Series which name is needed(EDITmode - defaultOptions.series,
|
|
9253
|
+
* ADDmode - indicator series).
|
|
9254
|
+
*
|
|
9255
|
+
* @param {string} [IndicatorType]
|
|
9256
|
+
* Type of the indicator i.e. sma, ema...
|
|
9257
|
+
*
|
|
9258
|
+
* @return Highcharts.Dictionary<string>
|
|
9259
|
+
* Full name and series type.
|
|
8014
9260
|
*/
|
|
8015
|
-
getNameType: function (series,
|
|
9261
|
+
getNameType: function (series, indicatorType) {
|
|
8016
9262
|
var options = series.options,
|
|
8017
|
-
seriesTypes = H.seriesTypes
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
seriesTypes[
|
|
8021
|
-
|
|
9263
|
+
seriesTypes = H.seriesTypes;
|
|
9264
|
+
// add mode
|
|
9265
|
+
var seriesName = (seriesTypes[indicatorType] &&
|
|
9266
|
+
seriesTypes[indicatorType].prototype.nameBase) ||
|
|
9267
|
+
indicatorType.toUpperCase(),
|
|
9268
|
+
seriesType = indicatorType;
|
|
8022
9269
|
// edit
|
|
8023
9270
|
if (options && options.type) {
|
|
8024
9271
|
seriesType = series.options.type;
|
|
8025
9272
|
seriesName = series.name;
|
|
8026
9273
|
}
|
|
8027
9274
|
return {
|
|
8028
|
-
|
|
8029
|
-
|
|
9275
|
+
indicatorFullName: seriesName,
|
|
9276
|
+
indicatorType: seriesType
|
|
8030
9277
|
};
|
|
8031
9278
|
},
|
|
8032
9279
|
/**
|
|
8033
|
-
*
|
|
8034
|
-
*
|
|
9280
|
+
* Create the selection box for the series,
|
|
9281
|
+
* add options and apply the default one.
|
|
9282
|
+
*
|
|
8035
9283
|
* @private
|
|
8036
|
-
*
|
|
8037
|
-
*
|
|
8038
|
-
*
|
|
8039
|
-
*
|
|
8040
|
-
* @param {
|
|
8041
|
-
*
|
|
8042
|
-
*
|
|
8043
|
-
*
|
|
8044
|
-
*
|
|
8045
|
-
*
|
|
9284
|
+
*
|
|
9285
|
+
* @param {string} indicatorType
|
|
9286
|
+
* Type of the indicator i.e. sma, ema...
|
|
9287
|
+
*
|
|
9288
|
+
* @param {string} [optionName]
|
|
9289
|
+
* Name of the option into which selection is being added.
|
|
9290
|
+
*
|
|
9291
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9292
|
+
* The chart object.
|
|
9293
|
+
*
|
|
9294
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
9295
|
+
* HTML parent element.
|
|
9296
|
+
*
|
|
9297
|
+
* @param {string|undefined} selectedOption
|
|
9298
|
+
* Default value in dropdown.
|
|
8046
9299
|
*/
|
|
8047
|
-
listAllSeries: function (
|
|
8048
|
-
var
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
seriesOptions;
|
|
9300
|
+
listAllSeries: function (indicatorType, optionName, chart, parentDiv, currentSeries, selectedOption) {
|
|
9301
|
+
var popup = this,
|
|
9302
|
+
indicators = popup.indicators;
|
|
9303
|
+
// Won't work without the chart.
|
|
8052
9304
|
if (!chart) {
|
|
8053
9305
|
return;
|
|
8054
9306
|
}
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
|
|
8064
|
-
// list all series which have id - mandatory for creating indicator
|
|
8065
|
-
chart.series.forEach(function (serie) {
|
|
8066
|
-
seriesOptions = serie.options;
|
|
8067
|
-
if (!seriesOptions.params &&
|
|
8068
|
-
seriesOptions.id &&
|
|
8069
|
-
seriesOptions.id !== PREFIX + 'navigator-series') {
|
|
8070
|
-
createElement(OPTION, {
|
|
8071
|
-
value: seriesOptions.id
|
|
8072
|
-
}, null, selectBox).appendChild(doc.createTextNode(seriesOptions.name || seriesOptions.id));
|
|
8073
|
-
}
|
|
8074
|
-
});
|
|
9307
|
+
// Add selection boxes.
|
|
9308
|
+
var selectBox = indicators.addSelection.call(popup,
|
|
9309
|
+
indicatorType,
|
|
9310
|
+
optionName,
|
|
9311
|
+
parentDiv);
|
|
9312
|
+
// Add possible dropdown options.
|
|
9313
|
+
indicators.addSelectionOptions.call(popup, chart, optionName, selectBox, void 0, void 0, void 0, currentSeries);
|
|
9314
|
+
// Add the default dropdown value if defined.
|
|
8075
9315
|
if (defined(selectedOption)) {
|
|
8076
9316
|
selectBox.value = selectedOption;
|
|
8077
9317
|
}
|
|
@@ -8100,17 +9340,17 @@
|
|
|
8100
9340
|
// create title (indicator name in the right column)
|
|
8101
9341
|
createElement(H3, {
|
|
8102
9342
|
className: PREFIX + 'indicator-title'
|
|
8103
|
-
}, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).
|
|
9343
|
+
}, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).indicatorFullName));
|
|
8104
9344
|
// input type
|
|
8105
9345
|
createElement(INPUT, {
|
|
8106
9346
|
type: 'hidden',
|
|
8107
9347
|
name: PREFIX + 'type-' + seriesType,
|
|
8108
9348
|
value: seriesType
|
|
8109
|
-
},
|
|
9349
|
+
}, void 0, rhsColWrapper);
|
|
8110
9350
|
// list all series with id
|
|
8111
|
-
this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series.linkedParent &&
|
|
9351
|
+
this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series, series.linkedParent && series.linkedParent.options.id);
|
|
8112
9352
|
if (fields.volumeSeriesID) {
|
|
8113
|
-
this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series.linkedParent &&
|
|
9353
|
+
this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series, series.linkedParent && fields.volumeSeriesID);
|
|
8114
9354
|
}
|
|
8115
9355
|
// add param fields
|
|
8116
9356
|
this.indicators.addParamInputs.call(this, chart, 'params', fields, seriesType, rhsColWrapper);
|
|
@@ -8132,8 +9372,9 @@
|
|
|
8132
9372
|
* Element where created HTML list is added
|
|
8133
9373
|
*/
|
|
8134
9374
|
addParamInputs: function (chart, parentNode, fields, type, parentDiv) {
|
|
8135
|
-
var
|
|
8136
|
-
|
|
9375
|
+
var popup = this,
|
|
9376
|
+
indicators = popup.indicators;
|
|
9377
|
+
var addParamInputs = this.indicators.addParamInputs,
|
|
8137
9378
|
addInput = this.addInput,
|
|
8138
9379
|
parentFullName;
|
|
8139
9380
|
if (!chart) {
|
|
@@ -8142,16 +9383,33 @@
|
|
|
8142
9383
|
objectEach(fields, function (value, fieldName) {
|
|
8143
9384
|
// create name like params.styles.fontSize
|
|
8144
9385
|
parentFullName = parentNode + '.' + fieldName;
|
|
8145
|
-
if (value
|
|
9386
|
+
if (defined(value) && // skip if field is unnecessary, #15362
|
|
9387
|
+
parentFullName) {
|
|
8146
9388
|
if (isObject(value)) {
|
|
8147
9389
|
addInput.call(// (15733) 'Periods' has an arrayed value. Label must be created here.
|
|
8148
|
-
|
|
8149
|
-
addParamInputs.call(
|
|
9390
|
+
popup, parentFullName, type, parentDiv, {});
|
|
9391
|
+
addParamInputs.call(popup, chart, parentFullName, value, type, parentDiv);
|
|
9392
|
+
}
|
|
9393
|
+
// If the option is listed in dropdown enum,
|
|
9394
|
+
// add the selection box for it.
|
|
9395
|
+
if (parentFullName in DropdownProperties) {
|
|
9396
|
+
// Add selection boxes.
|
|
9397
|
+
var selectBox = indicators.addSelection.call(popup,
|
|
9398
|
+
type,
|
|
9399
|
+
parentFullName,
|
|
9400
|
+
parentDiv);
|
|
9401
|
+
// Add possible dropdown options.
|
|
9402
|
+
indicators.addSelectionOptions.call(popup, chart, parentNode, selectBox, type, fieldName, value);
|
|
8150
9403
|
}
|
|
8151
9404
|
else if (
|
|
8152
|
-
//
|
|
8153
|
-
parentFullName !== 'params.volumeSeriesID'
|
|
8154
|
-
|
|
9405
|
+
// Skip volume field which is created by addFormFields.
|
|
9406
|
+
parentFullName !== 'params.volumeSeriesID' &&
|
|
9407
|
+
!isArray(value) // Skip params declared in array.
|
|
9408
|
+
) {
|
|
9409
|
+
addInput.call(popup, parentFullName, type, parentDiv, {
|
|
9410
|
+
value: value,
|
|
9411
|
+
type: 'text'
|
|
9412
|
+
} // all inputs are text type
|
|
8155
9413
|
);
|
|
8156
9414
|
}
|
|
8157
9415
|
}
|
|
@@ -8234,7 +9492,7 @@
|
|
|
8234
9492
|
var popupDiv = this.popup.container;
|
|
8235
9493
|
return createElement(DIV, {
|
|
8236
9494
|
className: PREFIX + 'tab-item-content ' + PREFIX + 'no-mousewheel' // #12100
|
|
8237
|
-
},
|
|
9495
|
+
}, void 0, popupDiv);
|
|
8238
9496
|
},
|
|
8239
9497
|
/**
|
|
8240
9498
|
* Add click event to each tab
|
|
@@ -8297,7 +9555,7 @@
|
|
|
8297
9555
|
this.popup = new H.Popup(this.chart.container, (this.chart.options.navigation.iconsURL ||
|
|
8298
9556
|
(this.chart.options.stockTools &&
|
|
8299
9557
|
this.chart.options.stockTools.gui.iconsURL) ||
|
|
8300
|
-
'https://code.highcharts.com/9.
|
|
9558
|
+
'https://code.highcharts.com/9.3.0/gfx/stock-icons/'), this.chart);
|
|
8301
9559
|
}
|
|
8302
9560
|
this.popup.showForm(config.formType, this.chart, config.options, config.onSubmit);
|
|
8303
9561
|
});
|