highcharts 9.2.2 → 9.3.3
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 +46 -1
- package/css/highcharts.scss +40 -0
- package/css/stocktools/gui.css +1 -1
- package/css/themes/dark-unica.css +46 -1
- package/css/themes/grid-light.css +46 -1
- package/css/themes/sand-signika.css +46 -1
- package/es-modules/Accessibility/A11yI18n.js +269 -224
- package/es-modules/Accessibility/Accessibility.js +244 -129
- package/es-modules/Accessibility/AccessibilityComponent.js +78 -313
- package/es-modules/Accessibility/Components/AnnotationsA11y.js +19 -5
- package/es-modules/Accessibility/Components/ContainerComponent.js +53 -28
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +178 -120
- package/es-modules/Accessibility/Components/LegendComponent.js +251 -129
- package/es-modules/Accessibility/Components/MenuComponent.js +250 -154
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +172 -93
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +161 -115
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +138 -69
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +67 -28
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +48 -56
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +387 -343
- package/es-modules/Accessibility/Components/ZoomComponent.js +156 -70
- package/es-modules/Accessibility/FocusBorder.js +192 -152
- package/es-modules/Accessibility/HighContrastMode.js +79 -66
- package/es-modules/Accessibility/HighContrastTheme.js +10 -0
- package/es-modules/Accessibility/KeyboardNavigation.js +151 -75
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +71 -44
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +21 -4
- package/es-modules/Accessibility/Options/LangOptions.js +4 -5
- package/es-modules/Accessibility/Options/Options.js +32 -17
- package/es-modules/Accessibility/ProxyElement.js +218 -0
- package/es-modules/Accessibility/ProxyProvider.js +302 -0
- package/es-modules/Accessibility/Utils/Announcer.js +17 -10
- package/es-modules/Accessibility/Utils/ChartUtilities.js +55 -45
- 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 -42
- package/es-modules/Core/Animation/Fx.js +5 -14
- package/es-modules/Core/Axis/Axis.js +77 -96
- package/es-modules/Core/Axis/Axis3D.js +10 -4
- package/es-modules/Core/Axis/AxisDefaults.js +35 -24
- package/es-modules/Core/Axis/BrokenAxis.js +17 -11
- package/es-modules/Core/Axis/Color/ColorAxis.js +7 -4
- package/es-modules/Core/Axis/Color/ColorAxisComposition.js +55 -5
- package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +5 -5
- package/es-modules/Core/Axis/DateTimeAxis.js +3 -14
- package/es-modules/Core/Axis/GridAxis.js +26 -16
- package/es-modules/Core/Axis/NavigatorAxis.js +0 -5
- package/es-modules/Core/Axis/OrdinalAxis.js +88 -92
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +4 -5
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js +0 -5
- package/es-modules/Core/Axis/RadialAxis.js +7 -28
- package/es-modules/Core/Axis/ScrollbarAxis.js +27 -12
- package/es-modules/Core/Axis/StackingAxis.js +2 -1
- package/es-modules/Core/Axis/Tick.js +2 -4
- package/es-modules/Core/Axis/TreeGridAxis.js +28 -19
- package/es-modules/Core/Axis/TreeGridTick.js +5 -3
- package/es-modules/Core/Axis/WaterfallAxis.js +1 -1
- package/es-modules/Core/Axis/ZAxis.js +1 -1
- package/es-modules/Core/Chart/Chart.js +44 -47
- package/es-modules/Core/Chart/Chart3D.js +23 -10
- package/es-modules/Core/Chart/ChartDefaults.js +3 -4
- package/es-modules/Core/Chart/ChartNavigationComposition.js +92 -0
- package/es-modules/Core/Chart/GanttChart.js +4 -4
- package/es-modules/Core/Chart/MapChart.js +13 -25
- package/es-modules/Core/Chart/StockChart.js +13 -316
- package/es-modules/Core/Color/Palettes.js +22 -0
- package/es-modules/Core/DefaultOptions.js +22 -19
- package/es-modules/Core/Foundation.js +39 -31
- package/es-modules/Core/Geometry/CircleUtilities.js +2 -1
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/HttpUtilities.js +8 -7
- package/es-modules/Core/Legend/Legend.js +19 -16
- package/es-modules/Core/Navigator.js +41 -30
- package/es-modules/Core/Pointer.js +52 -45
- package/es-modules/Core/Renderer/HTML/AST.js +29 -14
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +27 -20
- package/es-modules/Core/Renderer/HTML/HTMLRenderer.js +8 -6
- package/es-modules/Core/Renderer/RendererUtilities.js +2 -2
- package/es-modules/Core/Renderer/SVG/SVGElement.js +11 -20
- package/es-modules/Core/Renderer/SVG/SVGLabel.js +17 -8
- package/es-modules/Core/Renderer/SVG/SVGRenderer.js +25 -29
- package/es-modules/Core/Renderer/SVG/SVGRenderer3D.js +12 -5
- package/es-modules/Core/Renderer/SVG/TextBuilder.js +18 -12
- package/es-modules/Core/Responsive.js +2 -3
- package/es-modules/Core/Scrollbar.js +14 -12
- package/es-modules/Core/ScrollbarDefaults.js +10 -9
- package/es-modules/Core/Series/DataLabel.js +19 -15
- package/es-modules/Core/Series/Point.js +22 -19
- package/es-modules/Core/Series/Series.js +197 -235
- package/es-modules/Core/Series/SeriesDefaults.js +8 -8
- package/es-modules/Core/Series/SeriesRegistry.js +1 -2
- package/es-modules/Core/Time.js +14 -11
- package/es-modules/Core/Tooltip.js +63 -53
- package/es-modules/Core/Utilities.js +20 -24
- package/es-modules/Data/DataConverter.js +483 -0
- package/es-modules/Data/DataPromise.js +252 -0
- package/es-modules/Data/DataSeriesConverter.js +207 -0
- package/es-modules/Data/DataTable.js +1205 -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 +400 -0
- package/es-modules/Data/Parsers/DataParser.js +101 -0
- package/es-modules/Data/Parsers/GoogleSheetsParser.js +223 -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 +169 -0
- package/es-modules/Data/Stores/HTMLTableStore.js +353 -0
- package/es-modules/Extensions/Annotations/Annotations.js +69 -18
- package/es-modules/Extensions/Annotations/ControlPoint.js +1 -3
- package/es-modules/Extensions/Annotations/Controllables/ControllableCircle.js +1 -1
- package/es-modules/Extensions/Annotations/Controllables/ControllableEllipse.js +199 -0
- package/es-modules/Extensions/Annotations/Controllables/ControllableImage.js +1 -1
- package/es-modules/Extensions/Annotations/Controllables/ControllableLabel.js +3 -6
- package/es-modules/Extensions/Annotations/Controllables/ControllablePath.js +3 -2
- package/es-modules/Extensions/Annotations/Controllables/ControllableRect.js +1 -1
- package/es-modules/Extensions/Annotations/Mixins/ControllableMixin.js +13 -4
- package/es-modules/Extensions/Annotations/Mixins/EventEmitterMixin.js +0 -1
- package/es-modules/Extensions/Annotations/Mixins/MarkerMixin.js +5 -4
- package/es-modules/Extensions/Annotations/NavigationBindings.js +120 -53
- package/es-modules/Extensions/Annotations/Popup.js +494 -148
- package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +51 -2
- package/es-modules/Extensions/Annotations/Types/CrookedLine.js +5 -3
- package/es-modules/Extensions/Annotations/Types/ElliottWave.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 +29 -19
- package/es-modules/Extensions/Annotations/Types/Pitchfork.js +7 -6
- package/es-modules/Extensions/Annotations/Types/TimeCycles.js +211 -0
- package/es-modules/Extensions/Annotations/Types/Tunnel.js +13 -10
- package/es-modules/Extensions/Annotations/Types/VerticalLine.js +1 -1
- package/es-modules/Extensions/Boost/BoostOptions.js +2 -2
- package/es-modules/Extensions/Boost/BoostOverrides.js +6 -10
- package/es-modules/Extensions/Boost/BoostUtils.js +0 -6
- package/es-modules/Extensions/Boost/WGLRenderer.js +16 -12
- package/es-modules/Extensions/Boost/WGLShader.js +13 -11
- package/es-modules/Extensions/Boost/WGLVBuffer.js +4 -7
- package/es-modules/Extensions/BoostCanvas.js +1 -2
- package/es-modules/Extensions/CurrentDateIndication.js +2 -3
- package/es-modules/Extensions/Data.js +4 -48
- package/es-modules/Extensions/DataGrouping.js +52 -32
- package/es-modules/Extensions/DownloadURL.js +2 -2
- package/es-modules/Extensions/DragPanes.js +1 -2
- package/es-modules/Extensions/DraggablePoints.js +7 -8
- package/es-modules/Extensions/Drilldown.js +11 -7
- package/es-modules/Extensions/ExportData.js +6 -5
- package/es-modules/Extensions/Exporting/Exporting.js +33 -46
- package/es-modules/Extensions/Exporting/ExportingDefaults.js +8 -15
- package/es-modules/Extensions/FullScreen.js +4 -3
- package/es-modules/Extensions/GeoJSON.js +42 -66
- package/es-modules/Extensions/MarkerClusters.js +118 -98
- package/es-modules/Extensions/Math3D.js +4 -4
- package/es-modules/Extensions/NoDataToDisplay.js +1 -2
- package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +32 -32
- package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +1 -1
- package/es-modules/Extensions/Oldie/Oldie.js +14 -79
- package/es-modules/Extensions/Oldie/VMLAxis3D.js +5 -1
- package/es-modules/Extensions/OverlappingDataLabels.js +10 -6
- package/es-modules/Extensions/Pane.js +11 -12
- package/es-modules/Extensions/ParallelCoordinates.js +5 -3
- package/es-modules/Extensions/PatternFill.js +17 -11
- package/es-modules/Extensions/Polar.js +7 -4
- package/es-modules/Extensions/PriceIndication.js +2 -1
- package/es-modules/Extensions/RangeSelector.js +22 -59
- package/es-modules/Extensions/ScrollablePlotArea.js +2 -2
- package/es-modules/Extensions/SeriesLabel.js +1 -1
- package/es-modules/Extensions/Sonification/ChartSonify.js +279 -663
- package/es-modules/Extensions/Sonification/Earcon.js +136 -102
- package/es-modules/Extensions/Sonification/Instrument.js +493 -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 +207 -152
- package/es-modules/Extensions/Sonification/SeriesSonify.js +474 -0
- package/es-modules/Extensions/Sonification/SignalHandler.js +122 -0
- package/es-modules/Extensions/Sonification/Sonification.js +27 -53
- package/es-modules/Extensions/Sonification/{Utilities.js → SonificationUtilities.js} +70 -88
- package/es-modules/Extensions/Sonification/Timeline.js +250 -567
- package/es-modules/Extensions/Sonification/TimelineEvent.js +157 -0
- package/es-modules/Extensions/Sonification/TimelinePath.js +311 -0
- package/es-modules/Extensions/Stacking.js +5 -23
- package/es-modules/Extensions/Themes/BrandDark.js +293 -0
- package/es-modules/Extensions/Themes/BrandLight.js +259 -0
- package/es-modules/Extensions/Themes/DarkUnica.js +4 -2
- package/es-modules/Extensions/Themes/Grid.js +4 -2
- package/es-modules/Extensions/Themes/GridLight.js +4 -2
- package/es-modules/Gantt/Connection.js +2 -2
- package/es-modules/Gantt/Pathfinder.js +6 -5
- package/es-modules/Gantt/PathfinderAlgorithms.js +12 -12
- package/es-modules/Maps/MapNavigation.js +30 -68
- package/es-modules/Maps/MapNavigationOptionsDefault.js +3 -0
- package/es-modules/Maps/MapPointer.js +8 -5
- package/es-modules/Maps/MapSymbols.js +23 -3
- package/es-modules/Maps/MapView.js +450 -0
- package/es-modules/Maps/MapViewOptionsDefault.js +97 -0
- package/es-modules/Maps/Projection.js +436 -0
- package/es-modules/Maps/ProjectionDefinition.js +9 -0
- package/es-modules/Maps/Projections/EqualEarth.js +42 -0
- package/es-modules/Maps/Projections/LambertConformalConic.js +52 -0
- package/es-modules/Maps/Projections/Miller.js +16 -0
- package/es-modules/Maps/Projections/Orthographic.js +26 -0
- package/es-modules/Maps/Projections/ProjectionRegistry.js +19 -0
- package/es-modules/Maps/Projections/WebMercator.js +24 -0
- package/es-modules/Series/Area/AreaSeries.js +13 -13
- package/es-modules/Series/Area3DSeries.js +4 -2
- package/es-modules/Series/AreaRange/AreaRangeSeries.js +28 -17
- package/es-modules/Series/Bellcurve/BellcurveSeries.js +4 -9
- 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 +5 -15
- 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 -19
- package/es-modules/{Mixins/CenteredSeries.js → Series/CenteredUtilities.js} +45 -23
- package/es-modules/{Mixins/ColorMapSeries.js → Series/ColorMapMixin.js} +10 -8
- package/es-modules/Series/Column/ColumnDataLabel.js +5 -5
- package/es-modules/Series/Column/ColumnSeries.js +19 -18
- package/es-modules/Series/Column3D/Column3DComposition.js +1 -2
- package/es-modules/Series/ColumnPyramid/ColumnPyramidSeries.js +11 -8
- package/es-modules/Series/ColumnRange/ColumnRangeSeries.js +2 -1
- package/es-modules/Series/Cylinder/CylinderComposition.js +36 -4
- package/es-modules/Series/DataModifyComposition.js +539 -0
- package/es-modules/Series/DependencyWheel/DependencyWheelPoint.js +2 -6
- package/es-modules/Series/DependencyWheel/DependencyWheelSeries.js +1 -1
- package/es-modules/Series/DerivedComposition.js +137 -0
- package/es-modules/Series/DrawPointComposition.js +111 -0
- package/es-modules/Series/Dumbbell/DumbbellPoint.js +0 -1
- package/es-modules/Series/Dumbbell/DumbbellSeries.js +2 -6
- package/es-modules/Series/ErrorBar/ErrorBarSeries.js +1 -2
- package/es-modules/Series/Flags/FlagsSeries.js +18 -25
- package/es-modules/Series/Flags/FlagsSymbols.js +2 -2
- package/es-modules/Series/Funnel/FunnelSeries.js +6 -5
- package/es-modules/Series/Funnel3D/Funnel3DComposition.js +14 -8
- package/es-modules/Series/Funnel3D/Funnel3DSeries.js +2 -1
- package/es-modules/Series/Gantt/GanttPoint.js +1 -1
- package/es-modules/Series/Gantt/GanttSeries.js +3 -3
- 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 +378 -0
- package/es-modules/Series/Heatmap/HeatmapPoint.js +13 -14
- package/es-modules/Series/Heatmap/HeatmapSeries.js +24 -12
- package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +10 -9
- package/es-modules/Series/Histogram/HistogramSeries.js +7 -11
- package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +1 -4
- package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +28 -30
- package/es-modules/Series/Item/ItemSeries.js +4 -5
- package/es-modules/Series/Line/LineSeries.js +1 -2
- package/es-modules/Series/Map/MapPoint.js +27 -14
- package/es-modules/Series/Map/MapSeries.js +283 -322
- package/es-modules/Series/MapBubble/MapBubblePoint.js +0 -3
- package/es-modules/Series/MapBubble/MapBubbleSeries.js +10 -1
- package/es-modules/Series/MapLine/MapLineSeries.js +2 -4
- package/es-modules/Series/MapPoint/MapPointPoint.js +5 -1
- package/es-modules/Series/MapPoint/MapPointSeries.js +99 -14
- package/es-modules/Series/Networkgraph/DraggableNodes.js +0 -4
- package/es-modules/Series/Networkgraph/Integrations.js +8 -22
- package/es-modules/Series/Networkgraph/Networkgraph.js +6 -10
- package/es-modules/Series/Networkgraph/QuadTree.js +1 -3
- package/es-modules/{Mixins/Nodes.js → Series/NodesComposition.js} +78 -30
- package/es-modules/Series/OHLC/OHLCPoint.js +2 -7
- 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 +6 -5
- package/es-modules/Series/PackedBubble/PackedBubbleComposition.js +1 -0
- package/es-modules/Series/PackedBubble/PackedBubblePoint.js +1 -1
- package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +48 -10
- package/es-modules/Series/ParetoSeries/ParetoSeries.js +3 -7
- package/es-modules/Series/Pie/PieDataLabel.js +1 -2
- package/es-modules/Series/Pie/PiePoint.js +2 -2
- package/es-modules/Series/Pie/PieSeries.js +7 -8
- package/es-modules/Series/Pie3D/Pie3DComposition.js +2 -1
- package/es-modules/Series/Pie3D/Pie3DPoint.js +2 -1
- package/es-modules/Series/Pie3D/Pie3DSeries.js +1 -1
- package/es-modules/Series/Pyramid3D/Pyramid3DSeries.js +2 -1
- package/es-modules/Series/Sankey/SankeyPoint.js +0 -4
- package/es-modules/Series/Sankey/SankeySeries.js +92 -22
- package/es-modules/Series/SolidGauge/SolidGaugeComposition.js +3 -1
- package/es-modules/Series/Spline/SplineSeries.js +0 -8
- package/es-modules/Series/Sunburst/SunburstPoint.js +2 -3
- package/es-modules/Series/Sunburst/SunburstSeries.js +6 -6
- package/es-modules/Series/Sunburst/SunburstUtilities.js +3 -2
- package/es-modules/Series/Tilemap/TilemapPoint.js +2 -5
- package/es-modules/Series/Tilemap/TilemapShapes.js +0 -7
- package/es-modules/Series/Timeline/TimelineSeries.js +3 -4
- package/es-modules/{Mixins/TreeSeries.js → Series/TreeUtilities.js} +88 -78
- package/es-modules/Series/Treemap/TreemapPoint.js +2 -2
- package/es-modules/Series/Treemap/TreemapSeries.js +22 -25
- package/es-modules/Series/Variwide/VariwideSeries.js +5 -1
- package/es-modules/Series/Venn/VennPoint.js +16 -7
- package/es-modules/Series/Venn/VennSeries.js +11 -17
- package/es-modules/Series/Venn/VennUtils.js +551 -439
- package/es-modules/Series/Waterfall/WaterfallSeries.js +8 -6
- 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 +26 -22
- package/es-modules/Series/Wordcloud/WordcloudUtils.js +669 -484
- package/es-modules/Series/XRange/XRangePoint.js +7 -12
- package/es-modules/Series/XRange/XRangeSeries.js +4 -20
- package/es-modules/Stock/Indicators/ABands/ABandsIndicator.js +15 -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 +4 -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 +39 -11
- package/es-modules/Stock/Indicators/CMF/CMFIndicator.js +35 -15
- 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 +28 -16
- package/es-modules/Stock/Indicators/DisparityIndex/DisparityIndexIndicator.js +18 -11
- package/es-modules/Stock/Indicators/EMA/EMAIndicator.js +1 -3
- package/es-modules/Stock/Indicators/IKH/IKHIndicator.js +6 -6
- package/es-modules/Stock/Indicators/KeltnerChannels/KeltnerChannelsIndicator.js +23 -9
- package/es-modules/Stock/Indicators/Klinger/KlingerIndicator.js +16 -19
- package/es-modules/Stock/Indicators/LinearRegression/LinearRegression.js +32 -14
- 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 +2 -3
- package/es-modules/Stock/Indicators/MultipleLinesComposition.js +294 -0
- package/es-modules/Stock/Indicators/NATR/NATRIndicator.js +1 -3
- package/es-modules/Stock/Indicators/PC/PCIndicator.js +25 -13
- package/es-modules/Stock/Indicators/PPO/PPOIndicator.js +1 -11
- package/es-modules/Stock/Indicators/PivotPoints/PivotPointsIndicator.js +2 -1
- package/es-modules/Stock/Indicators/RSI/RSIIndicator.js +2 -1
- package/es-modules/Stock/Indicators/SMA/SMAComposition.js +0 -26
- package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +32 -50
- package/es-modules/Stock/Indicators/SlowStochastic/SlowStochasticIndicator.js +0 -8
- package/es-modules/Stock/Indicators/Stochastic/StochasticIndicator.js +18 -9
- 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 +26 -10
- package/es-modules/Stock/Indicators/VWAP/VWAPIndicator.js +19 -7
- package/es-modules/Stock/Indicators/WilliamsR/WilliamsRIndicator.js +2 -3
- package/es-modules/Stock/StockToolsBindings.js +156 -47
- package/es-modules/Stock/StockToolsGui.js +442 -37
- 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/brand-dark.src.js +14 -0
- package/es-modules/masters/themes/brand-light.src.js +14 -0
- 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.js.map +1 -1
- package/highcharts-3d.src.js +65 -35
- package/highcharts-gantt.js +800 -803
- package/highcharts-gantt.js.map +1 -1
- package/highcharts-gantt.src.js +1356 -1429
- package/highcharts-more.js +194 -193
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.js +280 -222
- package/highcharts.d.ts +10208 -761
- package/highcharts.js +585 -588
- package/highcharts.js.map +1 -1
- package/highcharts.src.d.ts +10208 -761
- package/highcharts.src.js +992 -1066
- package/highmaps.js +727 -707
- package/highmaps.js.map +1 -1
- package/highmaps.src.js +3240 -2135
- package/highstock.js +788 -783
- package/highstock.js.map +1 -1
- package/highstock.src.js +2487 -1981
- package/indicators/acceleration-bands.d.ts +17 -1
- package/indicators/acceleration-bands.js +11 -9
- package/indicators/acceleration-bands.js.map +1 -1
- package/indicators/acceleration-bands.src.d.ts +17 -1
- package/indicators/acceleration-bands.src.js +238 -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.d.ts +17 -1
- package/indicators/aroon-oscillator.js +10 -9
- package/indicators/aroon-oscillator.js.map +1 -1
- package/indicators/aroon-oscillator.src.d.ts +17 -1
- package/indicators/aroon-oscillator.src.js +230 -177
- package/indicators/aroon.d.ts +17 -1
- package/indicators/aroon.js +11 -9
- package/indicators/aroon.js.map +1 -1
- package/indicators/aroon.src.d.ts +17 -1
- package/indicators/aroon.src.js +227 -112
- package/indicators/atr.js +1 -1
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.d.ts +17 -1
- package/indicators/bollinger-bands.js +12 -9
- package/indicators/bollinger-bands.js.map +1 -1
- package/indicators/bollinger-bands.src.d.ts +17 -1
- package/indicators/bollinger-bands.src.js +262 -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.js.map +1 -1
- package/indicators/cmf.src.js +36 -16
- 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 +20 -74
- package/indicators/dmi.js +12 -11
- package/indicators/dmi.js.map +1 -1
- package/indicators/dmi.src.js +252 -121
- 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.js.map +1 -1
- package/indicators/ichimoku-kinko-hyo.src.js +7 -7
- package/indicators/indicators-all.d.ts +17 -1
- package/indicators/indicators-all.js +198 -203
- package/indicators/indicators-all.js.map +1 -1
- package/indicators/indicators-all.src.d.ts +17 -1
- package/indicators/indicators-all.src.js +892 -777
- package/indicators/indicators.js +12 -12
- package/indicators/indicators.js.map +1 -1
- package/indicators/indicators.src.js +213 -144
- package/indicators/keltner-channels.d.ts +17 -1
- package/indicators/keltner-channels.js +11 -10
- package/indicators/keltner-channels.js.map +1 -1
- package/indicators/keltner-channels.src.d.ts +17 -1
- package/indicators/keltner-channels.src.js +246 -118
- package/indicators/klinger.js +14 -13
- package/indicators/klinger.js.map +1 -1
- package/indicators/klinger.src.js +239 -187
- package/indicators/macd.js +2 -2
- package/indicators/macd.js.map +1 -1
- package/indicators/macd.src.js +3 -4
- 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.js.map +1 -1
- package/indicators/pivot-points.src.js +3 -2
- package/indicators/ppo.js +5 -6
- package/indicators/ppo.js.map +1 -1
- package/indicators/ppo.src.js +3 -75
- package/indicators/price-channel.d.ts +17 -1
- package/indicators/price-channel.js +11 -9
- package/indicators/price-channel.js.map +1 -1
- package/indicators/price-channel.src.d.ts +17 -1
- package/indicators/price-channel.src.js +288 -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.js.map +1 -1
- package/indicators/regressions.src.js +39 -21
- package/indicators/roc.js +1 -1
- package/indicators/roc.src.js +1 -1
- package/indicators/rsi.js +1 -1
- package/indicators/rsi.js.map +1 -1
- package/indicators/rsi.src.js +3 -2
- 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.d.ts +17 -1
- package/indicators/stochastic.js +12 -10
- package/indicators/stochastic.js.map +1 -1
- package/indicators/stochastic.src.d.ts +17 -1
- package/indicators/stochastic.src.js +282 -165
- 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 +27 -10
- package/indicators/vwap.js +1 -1
- package/indicators/vwap.js.map +1 -1
- package/indicators/vwap.src.js +20 -8
- 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 +0 -30
- package/modules/accessibility.js +241 -216
- package/modules/accessibility.js.map +1 -1
- package/modules/accessibility.src.d.ts +0 -30
- package/modules/accessibility.src.js +7818 -6398
- package/modules/annotations-advanced.d.ts +30 -0
- package/modules/annotations-advanced.js +192 -165
- package/modules/annotations-advanced.js.map +1 -1
- package/modules/annotations-advanced.src.d.ts +30 -0
- package/modules/annotations-advanced.src.js +1716 -416
- package/modules/annotations.js +125 -110
- package/modules/annotations.js.map +1 -1
- package/modules/annotations.src.js +1059 -304
- 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 +42 -51
- package/modules/broken-axis.js +1 -1
- package/modules/broken-axis.js.map +1 -1
- package/modules/broken-axis.src.js +18 -12
- 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 +77 -103
- 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.js.map +1 -1
- package/modules/cylinder.src.js +37 -5
- package/modules/data.d.ts +6 -6
- package/modules/data.js +31 -31
- package/modules/data.js.map +1 -1
- package/modules/data.src.d.ts +6 -6
- package/modules/data.src.js +18 -58
- package/modules/datagrouping.js +20 -20
- package/modules/datagrouping.js.map +1 -1
- package/modules/datagrouping.src.js +54 -33
- 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 +5 -8
- 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.js.map +1 -1
- package/modules/draggable-points.src.js +8 -9
- package/modules/drilldown.js +24 -24
- package/modules/drilldown.js.map +1 -1
- package/modules/drilldown.src.js +13 -8
- package/modules/dumbbell.js +17 -17
- package/modules/dumbbell.js.map +1 -1
- package/modules/dumbbell.src.js +4 -8
- package/modules/export-data.js +19 -19
- package/modules/export-data.js.map +1 -1
- package/modules/export-data.src.js +9 -8
- package/modules/exporting.js +39 -38
- package/modules/exporting.js.map +1 -1
- package/modules/exporting.src.js +132 -113
- package/modules/full-screen.js +1 -1
- package/modules/full-screen.js.map +1 -1
- package/modules/full-screen.src.js +5 -4
- 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.js.map +1 -1
- package/modules/funnel3d.src.js +17 -10
- package/modules/gantt.js +217 -218
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +364 -363
- package/modules/grid-axis.js +1 -1
- package/modules/grid-axis.js.map +1 -1
- package/modules/grid-axis.src.js +27 -19
- package/modules/heatmap.js +39 -39
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +132 -141
- package/modules/heikinashi.js +1 -1
- package/modules/heikinashi.js.map +1 -1
- package/modules/heikinashi.src.js +12 -10
- package/modules/histogram-bellcurve.js +13 -13
- package/modules/histogram-bellcurve.js.map +1 -1
- package/modules/histogram-bellcurve.src.js +97 -91
- package/modules/hollowcandlestick.js +9 -9
- package/modules/hollowcandlestick.js.map +1 -1
- package/modules/hollowcandlestick.src.js +31 -35
- package/modules/item-series.js +6 -6
- package/modules/item-series.js.map +1 -1
- package/modules/item-series.src.js +6 -6
- package/modules/lollipop.js +1 -1
- package/modules/lollipop.src.js +1 -1
- package/modules/map.d.ts +138 -14
- package/modules/map.js +144 -122
- package/modules/map.js.map +1 -1
- package/modules/map.src.d.ts +138 -14
- package/modules/map.src.js +2253 -1074
- package/modules/marker-clusters.js +36 -36
- package/modules/marker-clusters.js.map +1 -1
- package/modules/marker-clusters.src.js +176 -143
- 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 +103 -78
- 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 +18 -18
- package/modules/offline-exporting.js.map +1 -1
- package/modules/offline-exporting.src.js +38 -43
- 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 +21 -81
- package/modules/organization.js +13 -13
- package/modules/organization.js.map +1 -1
- package/modules/organization.src.js +8 -6
- 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.js.map +1 -1
- package/modules/parallel-coordinates.src.js +6 -4
- 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.js.map +1 -1
- package/modules/pathfinder.src.js +21 -20
- package/modules/pattern-fill.js +1 -1
- package/modules/pattern-fill.js.map +1 -1
- package/modules/pattern-fill.src.js +18 -12
- package/modules/price-indicator.js +1 -1
- package/modules/price-indicator.js.map +1 -1
- package/modules/price-indicator.src.js +3 -2
- package/modules/pyramid3d.js +1 -1
- package/modules/pyramid3d.js.map +1 -1
- package/modules/pyramid3d.src.js +3 -2
- 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 +307 -181
- package/modules/series-label.js +1 -1
- package/modules/series-label.js.map +1 -1
- package/modules/series-label.src.js +2 -2
- package/modules/solid-gauge.js +1 -1
- package/modules/solid-gauge.js.map +1 -1
- package/modules/solid-gauge.src.js +17 -2
- package/modules/sonification.js +59 -55
- package/modules/sonification.js.map +1 -1
- package/modules/sonification.src.js +3093 -2594
- package/modules/static-scale.js +1 -1
- package/modules/static-scale.src.js +1 -1
- package/modules/stock-tools.js +178 -163
- package/modules/stock-tools.js.map +1 -1
- package/modules/stock-tools.src.js +1136 -229
- 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 +1820 -1240
- package/modules/streamgraph.js +1 -1
- package/modules/streamgraph.src.js +1 -1
- package/modules/sunburst.js +60 -60
- package/modules/sunburst.js.map +1 -1
- package/modules/sunburst.src.js +281 -248
- package/modules/tilemap.js +17 -17
- package/modules/tilemap.js.map +1 -1
- package/modules/tilemap.src.js +3 -13
- 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 +201 -169
- package/modules/treemap.js +41 -41
- package/modules/treemap.js.map +1 -1
- package/modules/treemap.src.js +266 -232
- package/modules/variable-pie.js +1 -1
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.js +1 -1
- package/modules/variwide.js.map +1 -1
- package/modules/variwide.src.js +7 -3
- 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 +740 -731
- 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 +898 -954
- package/modules/xrange.js +2 -2
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +12 -33
- package/package.json +1 -1
- package/themes/avocado.js +1 -1
- package/themes/avocado.src.js +1 -1
- package/themes/brand-dark.js +15 -0
- package/themes/brand-dark.js.map +1 -0
- package/themes/brand-dark.src.js +328 -0
- package/themes/brand-light.js +15 -0
- package/themes/brand-light.js.map +1 -0
- package/themes/brand-light.src.js +294 -0
- 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.js.map +1 -1
- package/themes/dark-unica.src.js +5 -3
- package/themes/gray.js +1 -1
- package/themes/gray.src.js +1 -1
- package/themes/grid-light.js +1 -1
- package/themes/grid-light.js.map +1 -1
- package/themes/grid-light.src.js +5 -3
- package/themes/grid.js +1 -1
- package/themes/grid.js.map +1 -1
- package/themes/grid.src.js +5 -3
- 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/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/MultipleLines.js +0 -181
- 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.3 (2022-02-01)
|
|
3
3
|
*
|
|
4
4
|
* Annotations module
|
|
5
5
|
*
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
*
|
|
50
50
|
* @private
|
|
51
51
|
* @mixin
|
|
52
|
-
* @memberOf Annotation
|
|
53
52
|
*/
|
|
54
53
|
var eventEmitterMixin = {
|
|
55
54
|
/**
|
|
@@ -293,8 +292,7 @@
|
|
|
293
292
|
* @param {Highcharts.AnnotationControllable} target
|
|
294
293
|
* @return {Highcharts.PositionObject}
|
|
295
294
|
*/
|
|
296
|
-
var
|
|
297
|
-
merge = U.merge,
|
|
295
|
+
var merge = U.merge,
|
|
298
296
|
pick = U.pick;
|
|
299
297
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
300
298
|
/**
|
|
@@ -362,7 +360,6 @@
|
|
|
362
360
|
* @param {boolean} visible
|
|
363
361
|
* Visibility of the control point.
|
|
364
362
|
*
|
|
365
|
-
* @return {void}
|
|
366
363
|
*/
|
|
367
364
|
ControlPoint.prototype.setVisibility = function (visible) {
|
|
368
365
|
this.graphic.attr('visibility', visible ? 'visible' : 'hidden');
|
|
@@ -412,7 +409,6 @@
|
|
|
412
409
|
* @param {Partial<Highcharts.AnnotationControlPointOptionsObject>} userOptions
|
|
413
410
|
* New options for the control point.
|
|
414
411
|
*
|
|
415
|
-
* @return {void}
|
|
416
412
|
*/
|
|
417
413
|
ControlPoint.prototype.update = function (userOptions) {
|
|
418
414
|
var chart = this.chart,
|
|
@@ -967,7 +963,8 @@
|
|
|
967
963
|
*/
|
|
968
964
|
getPointsOptions: function () {
|
|
969
965
|
var options = this.options;
|
|
970
|
-
return (options.points ||
|
|
966
|
+
return (options.points ||
|
|
967
|
+
(options.point && splat(options.point)));
|
|
971
968
|
},
|
|
972
969
|
/**
|
|
973
970
|
* Utility function for mapping item's options
|
|
@@ -1188,8 +1185,11 @@
|
|
|
1188
1185
|
*
|
|
1189
1186
|
* @param {number} dx translation for x coordinate
|
|
1190
1187
|
* @param {number} dy translation for y coordinate
|
|
1188
|
+
* @param {boolean|undefined} translateSecondPoint If the shape has two
|
|
1189
|
+
* points attached to it, this option allows you to translate also
|
|
1190
|
+
* the second point
|
|
1191
1191
|
*/
|
|
1192
|
-
translateShape: function (dx, dy) {
|
|
1192
|
+
translateShape: function (dx, dy, translateSecondPoint) {
|
|
1193
1193
|
var chart = this.annotation.chart,
|
|
1194
1194
|
// Annotation.options
|
|
1195
1195
|
shapeOptions = this.annotation.userOptions,
|
|
@@ -1197,11 +1197,16 @@
|
|
|
1197
1197
|
annotationIndex = chart.annotations.indexOf(this.annotation),
|
|
1198
1198
|
chartOptions = chart.options.annotations[annotationIndex];
|
|
1199
1199
|
this.translatePoint(dx, dy, 0);
|
|
1200
|
+
if (translateSecondPoint) {
|
|
1201
|
+
this.translatePoint(dx, dy, 1);
|
|
1202
|
+
}
|
|
1200
1203
|
// Options stored in:
|
|
1201
1204
|
// - chart (for exporting)
|
|
1202
1205
|
// - current config (for redraws)
|
|
1203
|
-
chartOptions[this.collection][this.index]
|
|
1204
|
-
|
|
1206
|
+
chartOptions[this.collection][this.index]
|
|
1207
|
+
.point = this.options.point;
|
|
1208
|
+
shapeOptions[this.collection][this.index]
|
|
1209
|
+
.point = this.options.point;
|
|
1205
1210
|
},
|
|
1206
1211
|
/**
|
|
1207
1212
|
* Rotate a controllable.
|
|
@@ -1419,13 +1424,13 @@
|
|
|
1419
1424
|
fill = itemOptions.fill,
|
|
1420
1425
|
color = defined(fill) && fill !== 'none' ?
|
|
1421
1426
|
fill :
|
|
1422
|
-
itemOptions.stroke
|
|
1423
|
-
|
|
1427
|
+
itemOptions.stroke;
|
|
1428
|
+
var setMarker = function (markerType) {
|
|
1424
1429
|
var markerId = itemOptions[markerType],
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1430
|
+
def,
|
|
1431
|
+
predefinedMarker,
|
|
1432
|
+
key,
|
|
1433
|
+
marker;
|
|
1429
1434
|
if (markerId) {
|
|
1430
1435
|
for (key in defs) { // eslint-disable-line guard-for-in
|
|
1431
1436
|
def = defs[key];
|
|
@@ -1440,13 +1445,13 @@
|
|
|
1440
1445
|
}
|
|
1441
1446
|
if (predefinedMarker) {
|
|
1442
1447
|
marker = item[markerType] = chart.renderer
|
|
1443
|
-
.addMarker((itemOptions.id || uniqueKey()) + '-' +
|
|
1444
|
-
markerId, merge(predefinedMarker, { color: color }));
|
|
1448
|
+
.addMarker((itemOptions.id || uniqueKey()) + '-' + markerId, merge(predefinedMarker, { color: color }));
|
|
1445
1449
|
item.attr(markerType, marker.getAttribute('id'));
|
|
1446
1450
|
}
|
|
1447
1451
|
}
|
|
1448
1452
|
};
|
|
1449
|
-
['markerStart', 'markerEnd']
|
|
1453
|
+
['markerStart', 'markerEnd']
|
|
1454
|
+
.forEach(setMarker);
|
|
1450
1455
|
}
|
|
1451
1456
|
};
|
|
1452
1457
|
addEvent(Chart, 'afterGetContainer', function () {
|
|
@@ -1517,7 +1522,7 @@
|
|
|
1517
1522
|
this.point = ControllableMixin.point;
|
|
1518
1523
|
this.rotate = ControllableMixin.rotate;
|
|
1519
1524
|
this.scale = ControllableMixin.scale;
|
|
1520
|
-
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1525
|
+
this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
|
|
1521
1526
|
this.setMarkers = MarkerMixin.setItemMarkers;
|
|
1522
1527
|
this.transform = ControllableMixin.transform;
|
|
1523
1528
|
this.transformPoint = ControllableMixin.transformPoint;
|
|
@@ -1581,7 +1586,8 @@
|
|
|
1581
1586
|
null;
|
|
1582
1587
|
};
|
|
1583
1588
|
ControllablePath.prototype.shouldBeDrawn = function () {
|
|
1584
|
-
return (ControllableMixin.shouldBeDrawn.call(this) ||
|
|
1589
|
+
return (ControllableMixin.shouldBeDrawn.call(this) ||
|
|
1590
|
+
Boolean(this.options.d));
|
|
1585
1591
|
};
|
|
1586
1592
|
ControllablePath.prototype.render = function (parent) {
|
|
1587
1593
|
var options = this.options,
|
|
@@ -1708,7 +1714,7 @@
|
|
|
1708
1714
|
this.point = ControllableMixin.point;
|
|
1709
1715
|
this.rotate = ControllableMixin.rotate;
|
|
1710
1716
|
this.scale = ControllableMixin.scale;
|
|
1711
|
-
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1717
|
+
this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
|
|
1712
1718
|
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1713
1719
|
this.transform = ControllableMixin.transform;
|
|
1714
1720
|
this.transformPoint = ControllableMixin.transformPoint;
|
|
@@ -1818,7 +1824,7 @@
|
|
|
1818
1824
|
this.point = ControllableMixin.point;
|
|
1819
1825
|
this.rotate = ControllableMixin.rotate;
|
|
1820
1826
|
this.scale = ControllableMixin.scale;
|
|
1821
|
-
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1827
|
+
this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
|
|
1822
1828
|
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1823
1829
|
this.transform = ControllableMixin.transform;
|
|
1824
1830
|
this.transformPoint = ControllableMixin.transformPoint;
|
|
@@ -1890,6 +1896,215 @@
|
|
|
1890
1896
|
|
|
1891
1897
|
return ControllableCircle;
|
|
1892
1898
|
});
|
|
1899
|
+
_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) {
|
|
1900
|
+
/* *
|
|
1901
|
+
*
|
|
1902
|
+
* Author: Pawel Lysy
|
|
1903
|
+
*
|
|
1904
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1905
|
+
*
|
|
1906
|
+
* */
|
|
1907
|
+
var merge = U.merge,
|
|
1908
|
+
defined = U.defined;
|
|
1909
|
+
/**
|
|
1910
|
+
* A controllable ellipse class.
|
|
1911
|
+
*
|
|
1912
|
+
* @requires modules/annotations
|
|
1913
|
+
*
|
|
1914
|
+
* @private
|
|
1915
|
+
* @class
|
|
1916
|
+
* @name Highcharts.AnnotationControllableEllipse
|
|
1917
|
+
*
|
|
1918
|
+
* @param {Highcharts.Annotation} annotation an annotation instance
|
|
1919
|
+
* @param {Highcharts.AnnotationsShapeOptions} options a shape's options
|
|
1920
|
+
* @param {number} index of the Ellipse
|
|
1921
|
+
*/
|
|
1922
|
+
var ControllableEllipse = /** @class */ (function () {
|
|
1923
|
+
/* *
|
|
1924
|
+
*
|
|
1925
|
+
* Constructor
|
|
1926
|
+
*
|
|
1927
|
+
* */
|
|
1928
|
+
function ControllableEllipse(annotation, options, index) {
|
|
1929
|
+
/* *
|
|
1930
|
+
*
|
|
1931
|
+
* Properties
|
|
1932
|
+
*
|
|
1933
|
+
* */
|
|
1934
|
+
this.addControlPoints = ControllableMixin.addControlPoints;
|
|
1935
|
+
this.anchor = ControllableMixin.anchor;
|
|
1936
|
+
this.attr = ControllableMixin.attr;
|
|
1937
|
+
this.attrsFromOptions = ControllableMixin.attrsFromOptions;
|
|
1938
|
+
this.destroy = ControllableMixin.destroy;
|
|
1939
|
+
this.getPointsOptions = ControllableMixin.getPointsOptions;
|
|
1940
|
+
this.linkPoints = ControllableMixin.linkPoints;
|
|
1941
|
+
this.point = ControllableMixin.point;
|
|
1942
|
+
this.scale = ControllableMixin.scale;
|
|
1943
|
+
this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
|
|
1944
|
+
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1945
|
+
this.transform = ControllableMixin.transform;
|
|
1946
|
+
this.translatePoint = ControllableMixin.translatePoint;
|
|
1947
|
+
this.transformPoint = ControllableMixin.transformPoint;
|
|
1948
|
+
/**
|
|
1949
|
+
* @type 'ellipse'
|
|
1950
|
+
*/
|
|
1951
|
+
this.type = 'ellipse';
|
|
1952
|
+
this.init(annotation, options, index);
|
|
1953
|
+
this.collection = 'shapes';
|
|
1954
|
+
}
|
|
1955
|
+
/* *
|
|
1956
|
+
*
|
|
1957
|
+
* Functions
|
|
1958
|
+
*
|
|
1959
|
+
* */
|
|
1960
|
+
ControllableEllipse.prototype.init = function (annotation, options, index) {
|
|
1961
|
+
if (defined(options.yAxis)) {
|
|
1962
|
+
options.points.forEach(function (point) {
|
|
1963
|
+
point.yAxis = options.yAxis;
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
if (defined(options.xAxis)) {
|
|
1967
|
+
options.points.forEach(function (point) {
|
|
1968
|
+
point.xAxis = options.xAxis;
|
|
1969
|
+
});
|
|
1970
|
+
}
|
|
1971
|
+
ControllableMixin.init.call(this, annotation, options, index);
|
|
1972
|
+
};
|
|
1973
|
+
/**
|
|
1974
|
+
*
|
|
1975
|
+
* Render the element
|
|
1976
|
+
* @param parent parent SVG element.
|
|
1977
|
+
*/
|
|
1978
|
+
ControllableEllipse.prototype.render = function (parent) {
|
|
1979
|
+
this.graphic = this.annotation.chart.renderer.createElement('ellipse')
|
|
1980
|
+
.attr(this.attrsFromOptions(this.options))
|
|
1981
|
+
.add(parent);
|
|
1982
|
+
ControllableMixin.render.call(this);
|
|
1983
|
+
};
|
|
1984
|
+
/**
|
|
1985
|
+
* Translate the points.
|
|
1986
|
+
* Mostly used to handle dragging of the ellipse.
|
|
1987
|
+
*/
|
|
1988
|
+
ControllableEllipse.prototype.translate = function (dx, dy) {
|
|
1989
|
+
ControllableMixin.translateShape.call(this, dx, dy, true);
|
|
1990
|
+
};
|
|
1991
|
+
/**
|
|
1992
|
+
* Get the distance from the line to the point.
|
|
1993
|
+
* @param point1 first point which is on the line
|
|
1994
|
+
* @param point2 second point
|
|
1995
|
+
* @param x0 point's x value from which you want to calculate the distance from
|
|
1996
|
+
* @param y0 point's y value from which you want to calculate the distance from
|
|
1997
|
+
*/
|
|
1998
|
+
ControllableEllipse.prototype.getDistanceFromLine = function (point1, point2, x0, y0) {
|
|
1999
|
+
return Math.abs((point2.y - point1.y) * x0 - (point2.x - point1.x) * y0 +
|
|
2000
|
+
point2.x * point1.y - point2.y * point1.x) / Math.sqrt((point2.y - point1.y) * (point2.y - point1.y) +
|
|
2001
|
+
(point2.x - point1.x) * (point2.x - point1.x));
|
|
2002
|
+
};
|
|
2003
|
+
/**
|
|
2004
|
+
* The fuction calculates the svg attributes of the ellipse, and returns all
|
|
2005
|
+
* parameters neccessary to draw the ellipse.
|
|
2006
|
+
* @param position absolute position of the first point in points array
|
|
2007
|
+
* @param position2 absolute position of the second point in points array
|
|
2008
|
+
*/
|
|
2009
|
+
ControllableEllipse.prototype.getAttrs = function (position, position2) {
|
|
2010
|
+
var x1 = position.x,
|
|
2011
|
+
y1 = position.y,
|
|
2012
|
+
x2 = position2.x,
|
|
2013
|
+
y2 = position2.y,
|
|
2014
|
+
cx = (x1 + x2) / 2,
|
|
2015
|
+
cy = (y1 + y2) / 2,
|
|
2016
|
+
rx = Math.sqrt((x1 - x2) * (x1 - x2) / 4 + (y1 - y2) * (y1 - y2) / 4),
|
|
2017
|
+
tan = (y2 - y1) / (x2 - x1);
|
|
2018
|
+
var angle = Math.atan(tan) * 180 / Math.PI;
|
|
2019
|
+
if (cx < x1) {
|
|
2020
|
+
angle += 180;
|
|
2021
|
+
}
|
|
2022
|
+
var ry = this.getRY();
|
|
2023
|
+
return { cx: cx, cy: cy, rx: rx, ry: ry, angle: angle };
|
|
2024
|
+
};
|
|
2025
|
+
/**
|
|
2026
|
+
* Get the value of minor radius of the ellipse.
|
|
2027
|
+
*/
|
|
2028
|
+
ControllableEllipse.prototype.getRY = function () {
|
|
2029
|
+
var yAxis = this.getYAxis();
|
|
2030
|
+
return defined(yAxis) ?
|
|
2031
|
+
Math.abs(yAxis.toPixels(this.options.ry) - yAxis.toPixels(0)) :
|
|
2032
|
+
this.options.ry;
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* get the yAxis object to which the ellipse is pinned.
|
|
2036
|
+
*/
|
|
2037
|
+
ControllableEllipse.prototype.getYAxis = function () {
|
|
2038
|
+
var yAxisIndex = this.options.yAxis;
|
|
2039
|
+
return this.chart.yAxis[yAxisIndex];
|
|
2040
|
+
};
|
|
2041
|
+
/**
|
|
2042
|
+
* Get the absolute coordinates of the MockPoint
|
|
2043
|
+
* @param point MockPoint that is added through options
|
|
2044
|
+
*/
|
|
2045
|
+
ControllableEllipse.prototype.getAbsolutePosition = function (point) {
|
|
2046
|
+
return this.anchor(point).absolutePosition;
|
|
2047
|
+
};
|
|
2048
|
+
/**
|
|
2049
|
+
*
|
|
2050
|
+
* Redraw the element
|
|
2051
|
+
* @param animation display an annimation
|
|
2052
|
+
*/
|
|
2053
|
+
ControllableEllipse.prototype.redraw = function (animation) {
|
|
2054
|
+
var position = this.getAbsolutePosition(this.points[0]),
|
|
2055
|
+
position2 = this.getAbsolutePosition(this.points[1]),
|
|
2056
|
+
attrs = this.getAttrs(position,
|
|
2057
|
+
position2);
|
|
2058
|
+
if (position) {
|
|
2059
|
+
this.graphic[animation ? 'animate' : 'attr']({
|
|
2060
|
+
cx: attrs.cx,
|
|
2061
|
+
cy: attrs.cy,
|
|
2062
|
+
rx: attrs.rx,
|
|
2063
|
+
ry: attrs.ry,
|
|
2064
|
+
rotation: attrs.angle,
|
|
2065
|
+
rotationOriginX: attrs.cx,
|
|
2066
|
+
rotationOriginY: attrs.cy
|
|
2067
|
+
});
|
|
2068
|
+
}
|
|
2069
|
+
else {
|
|
2070
|
+
this.graphic.attr({
|
|
2071
|
+
x: 0,
|
|
2072
|
+
y: -9e9
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
this.graphic.placed = Boolean(position);
|
|
2076
|
+
ControllableMixin.redraw.call(this, animation);
|
|
2077
|
+
};
|
|
2078
|
+
/**
|
|
2079
|
+
* Set the radius Y.
|
|
2080
|
+
*
|
|
2081
|
+
* @param {number} ry a radius in y direction to be set
|
|
2082
|
+
*/
|
|
2083
|
+
ControllableEllipse.prototype.setYRadius = function (ry) {
|
|
2084
|
+
this.options.ry = ry;
|
|
2085
|
+
this.annotation.userOptions.shapes[0].ry = ry;
|
|
2086
|
+
this.annotation.options.shapes[0].ry = ry;
|
|
2087
|
+
};
|
|
2088
|
+
/* *
|
|
2089
|
+
*
|
|
2090
|
+
* Static Properties
|
|
2091
|
+
*
|
|
2092
|
+
* */
|
|
2093
|
+
/**
|
|
2094
|
+
* A map object which allows to map options attributes to element
|
|
2095
|
+
* attributes.
|
|
2096
|
+
*
|
|
2097
|
+
* @name Highcharts.AnnotationControllableEllipse.attrsMap
|
|
2098
|
+
* @type {Highcharts.Dictionary<string>}
|
|
2099
|
+
*/
|
|
2100
|
+
ControllableEllipse.attrsMap = merge(ControllablePath.attrsMap, {
|
|
2101
|
+
ry: 'ry'
|
|
2102
|
+
});
|
|
2103
|
+
return ControllableEllipse;
|
|
2104
|
+
}());
|
|
2105
|
+
|
|
2106
|
+
return ControllableEllipse;
|
|
2107
|
+
});
|
|
1893
2108
|
_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
2109
|
/* *
|
|
1895
2110
|
*
|
|
@@ -1945,7 +2160,7 @@
|
|
|
1945
2160
|
this.point = ControllableMixin.point;
|
|
1946
2161
|
this.rotate = ControllableMixin.rotate;
|
|
1947
2162
|
this.scale = ControllableMixin.scale;
|
|
1948
|
-
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
2163
|
+
this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
|
|
1949
2164
|
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1950
2165
|
this.transform = ControllableMixin.transform;
|
|
1951
2166
|
this.transformPoint = ControllableMixin.transformPoint;
|
|
@@ -2178,10 +2393,6 @@
|
|
|
2178
2393
|
};
|
|
2179
2394
|
/**
|
|
2180
2395
|
* Returns the label position relative to its anchor.
|
|
2181
|
-
*
|
|
2182
|
-
* @param {Highcharts.AnnotationAnchorObject} anchor
|
|
2183
|
-
*
|
|
2184
|
-
* @return {Highcharts.PositionObject|null}
|
|
2185
2396
|
*/
|
|
2186
2397
|
ControllableLabel.prototype.position = function (anchor) {
|
|
2187
2398
|
var item = this.graphic,
|
|
@@ -2210,7 +2421,8 @@
|
|
|
2210
2421
|
plotY: anchorRelativePosition.y,
|
|
2211
2422
|
negative: point.negative,
|
|
2212
2423
|
ttBelow: point.ttBelow,
|
|
2213
|
-
h: (anchorRelativePosition.height ||
|
|
2424
|
+
h: (anchorRelativePosition.height ||
|
|
2425
|
+
anchorRelativePosition.width)
|
|
2214
2426
|
});
|
|
2215
2427
|
}
|
|
2216
2428
|
else if (itemOptions.positioner) {
|
|
@@ -2358,7 +2570,7 @@
|
|
|
2358
2570
|
this.point = ControllableMixin.point;
|
|
2359
2571
|
this.rotate = ControllableMixin.rotate;
|
|
2360
2572
|
this.scale = ControllableMixin.scale;
|
|
2361
|
-
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
2573
|
+
this.setControlPointsVisibility = (ControllableMixin.setControlPointsVisibility);
|
|
2362
2574
|
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
2363
2575
|
this.transform = ControllableMixin.transform;
|
|
2364
2576
|
this.transformPoint = ControllableMixin.transformPoint;
|
|
@@ -2424,7 +2636,7 @@
|
|
|
2424
2636
|
|
|
2425
2637
|
return ControllableImage;
|
|
2426
2638
|
});
|
|
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']
|
|
2639
|
+
_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
2640
|
/* *
|
|
2429
2641
|
*
|
|
2430
2642
|
* (c) 2009-2021 Highsoft, Black Label
|
|
@@ -2646,7 +2858,10 @@
|
|
|
2646
2858
|
};
|
|
2647
2859
|
Annotation.prototype.addClipPaths = function () {
|
|
2648
2860
|
this.setClipAxes();
|
|
2649
|
-
if (this.clipXAxis &&
|
|
2861
|
+
if (this.clipXAxis &&
|
|
2862
|
+
this.clipYAxis &&
|
|
2863
|
+
this.options.crop // #15399
|
|
2864
|
+
) {
|
|
2650
2865
|
this.clipRect = this.chart.renderer.clipRect(this.getClipBox());
|
|
2651
2866
|
}
|
|
2652
2867
|
};
|
|
@@ -2748,8 +2963,10 @@
|
|
|
2748
2963
|
.add();
|
|
2749
2964
|
this.shapesGroup = renderer
|
|
2750
2965
|
.g('annotation-shapes')
|
|
2751
|
-
.add(this.graphic)
|
|
2752
|
-
|
|
2966
|
+
.add(this.graphic);
|
|
2967
|
+
if (this.options.crop) { // #15399
|
|
2968
|
+
this.shapesGroup.clip(this.chart.plotBoxClip);
|
|
2969
|
+
}
|
|
2753
2970
|
this.labelsGroup = renderer
|
|
2754
2971
|
.g('annotation-labels')
|
|
2755
2972
|
.attr({
|
|
@@ -2835,7 +3052,6 @@
|
|
|
2835
3052
|
* @param {Partial<Highcharts.AnnotationsOptions>} userOptions
|
|
2836
3053
|
* New user options for the annotation.
|
|
2837
3054
|
*
|
|
2838
|
-
* @return {void}
|
|
2839
3055
|
*/
|
|
2840
3056
|
Annotation.prototype.update = function (userOptions, redraw) {
|
|
2841
3057
|
var chart = this.chart,
|
|
@@ -2865,7 +3081,11 @@
|
|
|
2865
3081
|
/**
|
|
2866
3082
|
* Initialisation of a single shape
|
|
2867
3083
|
* @private
|
|
2868
|
-
* @param {Object} shapeOptions
|
|
3084
|
+
* @param {Object} shapeOptions
|
|
3085
|
+
* a confg object for a single shape
|
|
3086
|
+
* @param {number} index
|
|
3087
|
+
* annotation may have many shapes, this is the shape's index saved in
|
|
3088
|
+
* shapes.index.
|
|
2869
3089
|
*/
|
|
2870
3090
|
Annotation.prototype.initShape = function (shapeOptions, index) {
|
|
2871
3091
|
var options = merge(this.options.shapeOptions, {
|
|
@@ -2971,6 +3191,7 @@
|
|
|
2971
3191
|
Annotation.shapesMap = {
|
|
2972
3192
|
'rect': ControllableRect,
|
|
2973
3193
|
'circle': ControllableCircle,
|
|
3194
|
+
'ellipse': ControllableEllipse,
|
|
2974
3195
|
'path': ControllablePath,
|
|
2975
3196
|
'image': ControllableImage
|
|
2976
3197
|
};
|
|
@@ -3047,9 +3268,18 @@
|
|
|
3047
3268
|
* Animation defer settings
|
|
3048
3269
|
* @type {boolean|Partial<Highcharts.AnimationOptionsObject>}
|
|
3049
3270
|
* @since 8.2.0
|
|
3050
|
-
* @apioption annotations.animation
|
|
3051
3271
|
*/
|
|
3052
3272
|
animation: {},
|
|
3273
|
+
/**
|
|
3274
|
+
* Whether to hide the part of the annotation
|
|
3275
|
+
* that is outside the plot area.
|
|
3276
|
+
*
|
|
3277
|
+
* @sample highcharts/annotations/label-crop-overflow/
|
|
3278
|
+
* Crop line annotation
|
|
3279
|
+
* @type {boolean}
|
|
3280
|
+
* @since 9.3.0
|
|
3281
|
+
*/
|
|
3282
|
+
crop: true,
|
|
3053
3283
|
/**
|
|
3054
3284
|
* The animation delay time in milliseconds.
|
|
3055
3285
|
* Set to `0` renders annotation immediately.
|
|
@@ -3114,7 +3344,7 @@
|
|
|
3114
3344
|
*
|
|
3115
3345
|
* @type {Highcharts.ColorString}
|
|
3116
3346
|
*/
|
|
3117
|
-
borderColor:
|
|
3347
|
+
borderColor: "#000000" /* neutralColor100 */,
|
|
3118
3348
|
/**
|
|
3119
3349
|
* The border radius in pixels for the annotaiton's label.
|
|
3120
3350
|
*
|
|
@@ -3409,6 +3639,32 @@
|
|
|
3409
3639
|
* @requires modules/annotations
|
|
3410
3640
|
*/
|
|
3411
3641
|
shapeOptions: {
|
|
3642
|
+
/**
|
|
3643
|
+
*
|
|
3644
|
+
* The radius of the shape in y direction.
|
|
3645
|
+
* Used for the ellipse.
|
|
3646
|
+
*
|
|
3647
|
+
* @sample highcharts/annotations/ellipse/
|
|
3648
|
+
* Ellipse annotation
|
|
3649
|
+
*
|
|
3650
|
+
* @type {number}
|
|
3651
|
+
* @apioption annotations.shapeOptions.ry
|
|
3652
|
+
**/
|
|
3653
|
+
/**
|
|
3654
|
+
*
|
|
3655
|
+
* The xAxis index to which the points should be attached.
|
|
3656
|
+
* Used for the ellipse.
|
|
3657
|
+
*
|
|
3658
|
+
* @type {number}
|
|
3659
|
+
* @apioption annotations.shapeOptions.xAxis
|
|
3660
|
+
**/
|
|
3661
|
+
/**
|
|
3662
|
+
* The yAxis index to which the points should be attached.
|
|
3663
|
+
* Used for the ellipse.
|
|
3664
|
+
*
|
|
3665
|
+
* @type {number}
|
|
3666
|
+
* @apioption annotations.shapeOptions.yAxis
|
|
3667
|
+
**/
|
|
3412
3668
|
/**
|
|
3413
3669
|
* The width of the shape.
|
|
3414
3670
|
*
|
|
@@ -3428,11 +3684,15 @@
|
|
|
3428
3684
|
* @apioption annotations.shapeOptions.height
|
|
3429
3685
|
*/
|
|
3430
3686
|
/**
|
|
3431
|
-
* The type of the shape
|
|
3687
|
+
* The type of the shape.
|
|
3688
|
+
* Avaliable options are circle, rect and ellipse.
|
|
3432
3689
|
*
|
|
3433
3690
|
* @sample highcharts/annotations/shape/
|
|
3434
3691
|
* Basic shape annotation
|
|
3435
3692
|
*
|
|
3693
|
+
* @sample highcharts/annotations/ellipse/
|
|
3694
|
+
* Ellipse annotation
|
|
3695
|
+
*
|
|
3436
3696
|
* @type {string}
|
|
3437
3697
|
* @default rect
|
|
3438
3698
|
* @apioption annotations.shapeOptions.type
|
|
@@ -3514,9 +3774,10 @@
|
|
|
3514
3774
|
width: 10,
|
|
3515
3775
|
height: 10,
|
|
3516
3776
|
style: {
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3777
|
+
cursor: 'pointer',
|
|
3778
|
+
fill: "#ffffff" /* backgroundColor */,
|
|
3779
|
+
stroke: "#000000" /* neutralColor100 */,
|
|
3780
|
+
'stroke-width': 2
|
|
3520
3781
|
},
|
|
3521
3782
|
visible: false,
|
|
3522
3783
|
events: {}
|
|
@@ -3567,7 +3828,8 @@
|
|
|
3567
3828
|
******************************************************************** */
|
|
3568
3829
|
extend(chartProto, /** @lends Highcharts.Chart# */ {
|
|
3569
3830
|
initAnnotation: function (userOptions) {
|
|
3570
|
-
var Constructor = Annotation
|
|
3831
|
+
var Constructor = Annotation
|
|
3832
|
+
.types[userOptions.type] || Annotation,
|
|
3571
3833
|
annotation = new Constructor(this,
|
|
3572
3834
|
userOptions);
|
|
3573
3835
|
this.annotations.push(annotation);
|
|
@@ -3579,7 +3841,8 @@
|
|
|
3579
3841
|
* @param {Highcharts.AnnotationsOptions} options
|
|
3580
3842
|
* The annotation options for the new, detailed annotation.
|
|
3581
3843
|
* @param {boolean} [redraw]
|
|
3582
|
-
*
|
|
3844
|
+
* @sample highcharts/annotations/add-annotation/
|
|
3845
|
+
* Add annotation
|
|
3583
3846
|
* @return {Highcharts.Annotation} - The newly generated annotation.
|
|
3584
3847
|
*/
|
|
3585
3848
|
addAnnotation: function (userOptions, redraw) {
|
|
@@ -3601,7 +3864,7 @@
|
|
|
3601
3864
|
*/
|
|
3602
3865
|
removeAnnotation: function (idOrAnnotation) {
|
|
3603
3866
|
var annotations = this.annotations,
|
|
3604
|
-
annotation = idOrAnnotation.coll === 'annotations' ?
|
|
3867
|
+
annotation = (idOrAnnotation.coll === 'annotations') ?
|
|
3605
3868
|
idOrAnnotation :
|
|
3606
3869
|
find(annotations,
|
|
3607
3870
|
function (annotation) {
|
|
@@ -3720,15 +3983,15 @@
|
|
|
3720
3983
|
// Annotation placed on a exported data point
|
|
3721
3984
|
// - add new column
|
|
3722
3985
|
if (!wasAdded) {
|
|
3723
|
-
event.dataRows.forEach(function (row
|
|
3986
|
+
event.dataRows.forEach(function (row) {
|
|
3724
3987
|
if (!wasAdded &&
|
|
3725
3988
|
row.xValues &&
|
|
3726
3989
|
xAxisIndex !== void 0 &&
|
|
3727
3990
|
annotationX === row.xValues[xAxisIndex]) {
|
|
3728
3991
|
if (joinAnnotations &&
|
|
3729
3992
|
row.length > startRowLength) {
|
|
3730
|
-
row[row.length - 1] +=
|
|
3731
|
-
|
|
3993
|
+
row[row.length - 1] += (annotationSeparator +
|
|
3994
|
+
annotationText_1);
|
|
3732
3995
|
}
|
|
3733
3996
|
else {
|
|
3734
3997
|
row.push(annotationText_1);
|
|
@@ -3898,10 +4161,11 @@
|
|
|
3898
4161
|
var options = this.options;
|
|
3899
4162
|
if (options.shapes) {
|
|
3900
4163
|
delete options.labelOptions;
|
|
3901
|
-
if (options.shapes[0].type
|
|
3902
|
-
this.basicType =
|
|
4164
|
+
if (options.shapes[0].type) {
|
|
4165
|
+
this.basicType = options.shapes[0].type;
|
|
3903
4166
|
}
|
|
3904
4167
|
else {
|
|
4168
|
+
// Defalut shape would be rectangle.
|
|
3905
4169
|
this.basicType = 'rectangle';
|
|
3906
4170
|
}
|
|
3907
4171
|
}
|
|
@@ -4026,6 +4290,64 @@
|
|
|
4026
4290
|
target.redraw(false);
|
|
4027
4291
|
}
|
|
4028
4292
|
}
|
|
4293
|
+
}],
|
|
4294
|
+
ellipse: [{
|
|
4295
|
+
positioner: function (target) {
|
|
4296
|
+
var position = target.getAbsolutePosition(target.points[0]);
|
|
4297
|
+
return {
|
|
4298
|
+
x: position.x - this.graphic.width / 2,
|
|
4299
|
+
y: position.y - this.graphic.height / 2
|
|
4300
|
+
};
|
|
4301
|
+
},
|
|
4302
|
+
events: {
|
|
4303
|
+
drag: function (e, target) {
|
|
4304
|
+
var position = target.getAbsolutePosition(target.points[0]);
|
|
4305
|
+
target.translatePoint(e.chartX - position.x, e.chartY - position.y, 0);
|
|
4306
|
+
target.redraw(false);
|
|
4307
|
+
}
|
|
4308
|
+
}
|
|
4309
|
+
}, {
|
|
4310
|
+
positioner: function (target) {
|
|
4311
|
+
var position = target.getAbsolutePosition(target.points[1]);
|
|
4312
|
+
return {
|
|
4313
|
+
x: position.x - this.graphic.width / 2,
|
|
4314
|
+
y: position.y - this.graphic.height / 2
|
|
4315
|
+
};
|
|
4316
|
+
},
|
|
4317
|
+
events: {
|
|
4318
|
+
drag: function (e, target) {
|
|
4319
|
+
var position = target.getAbsolutePosition(target.points[1]);
|
|
4320
|
+
target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
|
|
4321
|
+
target.redraw(false);
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
}, {
|
|
4325
|
+
positioner: function (target) {
|
|
4326
|
+
var position = target.getAbsolutePosition(target.points[0]),
|
|
4327
|
+
position2 = target.getAbsolutePosition(target.points[1]),
|
|
4328
|
+
attrs = target.getAttrs(position,
|
|
4329
|
+
position2);
|
|
4330
|
+
return {
|
|
4331
|
+
x: attrs.cx - this.graphic.width / 2 +
|
|
4332
|
+
attrs.ry * Math.sin((attrs.angle * Math.PI) / 180),
|
|
4333
|
+
y: attrs.cy - this.graphic.height / 2 -
|
|
4334
|
+
attrs.ry * Math.cos((attrs.angle * Math.PI) / 180)
|
|
4335
|
+
};
|
|
4336
|
+
},
|
|
4337
|
+
events: {
|
|
4338
|
+
drag: function (e, target) {
|
|
4339
|
+
var position = target.getAbsolutePosition(target.points[0]),
|
|
4340
|
+
position2 = target.getAbsolutePosition(target.points[1]),
|
|
4341
|
+
newR = target.getDistanceFromLine(position,
|
|
4342
|
+
position2,
|
|
4343
|
+
e.chartX,
|
|
4344
|
+
e.chartY),
|
|
4345
|
+
yAxis = target.getYAxis(),
|
|
4346
|
+
newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
|
|
4347
|
+
target.setYRadius(newRY);
|
|
4348
|
+
target.redraw(false);
|
|
4349
|
+
}
|
|
4350
|
+
}
|
|
4029
4351
|
}]
|
|
4030
4352
|
};
|
|
4031
4353
|
return BasicAnnotation;
|
|
@@ -4124,7 +4446,7 @@
|
|
|
4124
4446
|
return target.annotation.points[i];
|
|
4125
4447
|
};
|
|
4126
4448
|
})
|
|
4127
|
-
}),
|
|
4449
|
+
}), 0);
|
|
4128
4450
|
typeOptions.line = shape.options;
|
|
4129
4451
|
};
|
|
4130
4452
|
return CrookedLine;
|
|
@@ -4214,8 +4536,10 @@
|
|
|
4214
4536
|
var translation = this.mouseMoveToTranslation(e);
|
|
4215
4537
|
target.translatePoint(translation.x, translation.y, this.index);
|
|
4216
4538
|
// Update options:
|
|
4217
|
-
target.options.typeOptions
|
|
4218
|
-
|
|
4539
|
+
target.options.typeOptions
|
|
4540
|
+
.points[this.index].x = target.points[this.index].x;
|
|
4541
|
+
target.options.typeOptions
|
|
4542
|
+
.points[this.index].y = target.points[this.index].y;
|
|
4219
4543
|
target.redraw(false);
|
|
4220
4544
|
}
|
|
4221
4545
|
}
|
|
@@ -4302,7 +4626,7 @@
|
|
|
4302
4626
|
* @apioption annotations.elliottWave.typeOptions.points.label
|
|
4303
4627
|
*/
|
|
4304
4628
|
/**
|
|
4305
|
-
* @ignore-
|
|
4629
|
+
* @ignore-option
|
|
4306
4630
|
*/
|
|
4307
4631
|
labels: ['(0)', '(A)', '(B)', '(C)', '(D)', '(E)'],
|
|
4308
4632
|
line: {
|
|
@@ -4422,22 +4746,25 @@
|
|
|
4422
4746
|
},
|
|
4423
4747
|
this.points[3]
|
|
4424
4748
|
]
|
|
4425
|
-
}),
|
|
4749
|
+
}), 0);
|
|
4426
4750
|
this.options.typeOptions.line = line.options;
|
|
4427
4751
|
};
|
|
4428
4752
|
Tunnel.prototype.addBackground = function () {
|
|
4429
4753
|
var background = this.initShape(merge(this.options.typeOptions.background, {
|
|
4430
4754
|
type: 'path',
|
|
4431
4755
|
points: this.points.slice()
|
|
4432
|
-
}));
|
|
4756
|
+
}), 1);
|
|
4433
4757
|
this.options.typeOptions.background = background.options;
|
|
4434
4758
|
};
|
|
4435
4759
|
/**
|
|
4436
4760
|
* Translate start or end ("left" or "right") side of the tunnel.
|
|
4437
4761
|
* @private
|
|
4438
|
-
* @param {number} dx
|
|
4439
|
-
*
|
|
4440
|
-
* @param {
|
|
4762
|
+
* @param {number} dx
|
|
4763
|
+
* the amount of x translation
|
|
4764
|
+
* @param {number} dy
|
|
4765
|
+
* the amount of y translation
|
|
4766
|
+
* @param {boolean} [end]
|
|
4767
|
+
* whether to translate start or end side
|
|
4441
4768
|
*/
|
|
4442
4769
|
Tunnel.prototype.translateSide = function (dx, dy, end) {
|
|
4443
4770
|
var topIndex = Number(end),
|
|
@@ -4448,12 +4775,14 @@
|
|
|
4448
4775
|
/**
|
|
4449
4776
|
* Translate height of the tunnel.
|
|
4450
4777
|
* @private
|
|
4451
|
-
* @param {number} dh
|
|
4778
|
+
* @param {number} dh
|
|
4779
|
+
* the amount of height translation
|
|
4452
4780
|
*/
|
|
4453
4781
|
Tunnel.prototype.translateHeight = function (dh) {
|
|
4454
4782
|
this.translatePoint(0, dh, 2);
|
|
4455
4783
|
this.translatePoint(0, dh, 3);
|
|
4456
|
-
this.options.typeOptions.height = this.points[3].y -
|
|
4784
|
+
this.options.typeOptions.height = this.points[3].y -
|
|
4785
|
+
this.points[0].y;
|
|
4457
4786
|
};
|
|
4458
4787
|
return Tunnel;
|
|
4459
4788
|
}(CrookedLine));
|
|
@@ -4469,8 +4798,6 @@
|
|
|
4469
4798
|
*/
|
|
4470
4799
|
{
|
|
4471
4800
|
typeOptions: {
|
|
4472
|
-
xAxis: 0,
|
|
4473
|
-
yAxis: 0,
|
|
4474
4801
|
/**
|
|
4475
4802
|
* Background options.
|
|
4476
4803
|
*
|
|
@@ -4530,7 +4857,7 @@
|
|
|
4530
4857
|
visiblePlotOnly: true
|
|
4531
4858
|
})) {
|
|
4532
4859
|
var translation = this.mouseMoveToTranslation(e);
|
|
4533
|
-
target.translateSide(translation.x, translation.y, this.index);
|
|
4860
|
+
target.translateSide(translation.x, translation.y, !!this.index);
|
|
4534
4861
|
target.redraw(false);
|
|
4535
4862
|
}
|
|
4536
4863
|
}
|
|
@@ -4689,8 +5016,7 @@
|
|
|
4689
5016
|
var line = this.initShape(merge(typeOptions.line, {
|
|
4690
5017
|
type: 'path',
|
|
4691
5018
|
points: points
|
|
4692
|
-
}),
|
|
4693
|
-
false);
|
|
5019
|
+
}), 0);
|
|
4694
5020
|
typeOptions.line = line.options;
|
|
4695
5021
|
};
|
|
4696
5022
|
/**
|
|
@@ -4733,8 +5059,10 @@
|
|
|
4733
5059
|
|
|
4734
5060
|
return InfinityLine;
|
|
4735
5061
|
});
|
|
4736
|
-
_registerModule(_modules, 'Extensions/Annotations/Types/
|
|
5062
|
+
_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
5063
|
/* *
|
|
5064
|
+
*
|
|
5065
|
+
* Authors: Rafal Sebestjanski and Pawel Lysy
|
|
4738
5066
|
*
|
|
4739
5067
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4740
5068
|
*
|
|
@@ -4755,71 +5083,302 @@
|
|
|
4755
5083
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4756
5084
|
};
|
|
4757
5085
|
})();
|
|
4758
|
-
var merge = U.merge
|
|
5086
|
+
var merge = U.merge,
|
|
5087
|
+
isNumber = U.isNumber,
|
|
5088
|
+
defined = U.defined;
|
|
5089
|
+
/**
|
|
5090
|
+
* Function to create start of the path.
|
|
5091
|
+
* @param {number} x x position of the TimeCycles
|
|
5092
|
+
* @param {number} y y position of the TimeCycles
|
|
5093
|
+
* @return {string} path
|
|
5094
|
+
*/
|
|
5095
|
+
function getStartingPath(x, y) {
|
|
5096
|
+
return ['M', x, y];
|
|
5097
|
+
}
|
|
5098
|
+
/**
|
|
5099
|
+
* Function which generates the path of the halfcircle.
|
|
5100
|
+
*
|
|
5101
|
+
* @param {number} pixelInterval diameter of the circle in pixels
|
|
5102
|
+
* @param {number} numberOfCircles number of cricles
|
|
5103
|
+
* @param {number} startX x position of the first circle
|
|
5104
|
+
* @param {number} y y position of the bottom of the timeCycles
|
|
5105
|
+
* @return {string} path
|
|
5106
|
+
*
|
|
5107
|
+
*/
|
|
5108
|
+
function getCirclePath(pixelInterval, numberOfCircles, startX, y) {
|
|
5109
|
+
var strToRepeat = function (i) { return [
|
|
5110
|
+
'A',
|
|
5111
|
+
pixelInterval / 2,
|
|
5112
|
+
pixelInterval / 2,
|
|
5113
|
+
0,
|
|
5114
|
+
1,
|
|
5115
|
+
1,
|
|
5116
|
+
startX + i * pixelInterval,
|
|
5117
|
+
y
|
|
5118
|
+
]; };
|
|
5119
|
+
var path = [];
|
|
5120
|
+
for (var i = 1; i <= numberOfCircles; i++) {
|
|
5121
|
+
path.push(strToRepeat(i));
|
|
5122
|
+
}
|
|
5123
|
+
return path;
|
|
5124
|
+
}
|
|
5125
|
+
/* *
|
|
5126
|
+
*
|
|
5127
|
+
* Class
|
|
5128
|
+
*
|
|
5129
|
+
* */
|
|
4759
5130
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4760
|
-
var
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
5131
|
+
var TimeCycles = /** @class */ (function (_super) {
|
|
5132
|
+
__extends(TimeCycles, _super);
|
|
5133
|
+
function TimeCycles() {
|
|
5134
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5135
|
+
}
|
|
5136
|
+
TimeCycles.prototype.init = function (annotation, options, index) {
|
|
5137
|
+
if (defined(options.yAxis)) {
|
|
5138
|
+
options.points.forEach(function (point) {
|
|
5139
|
+
point.yAxis = options.yAxis;
|
|
5140
|
+
});
|
|
4766
5141
|
}
|
|
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)]);
|
|
5142
|
+
if (defined(options.xAxis)) {
|
|
5143
|
+
options.points.forEach(function (point) {
|
|
5144
|
+
point.xAxis = options.xAxis;
|
|
5145
|
+
});
|
|
4783
5146
|
}
|
|
4784
|
-
|
|
5147
|
+
_super.prototype.init.call(this, annotation, options, index);
|
|
4785
5148
|
};
|
|
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;
|
|
5149
|
+
TimeCycles.prototype.setPath = function () {
|
|
5150
|
+
this.shapes[0].options.d = this.getPath();
|
|
4806
5151
|
};
|
|
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);
|
|
5152
|
+
TimeCycles.prototype.getPath = function () {
|
|
5153
|
+
return [getStartingPath(this.startX, this.y)].concat(getCirclePath(this.pixelInterval, this.numberOfCircles, this.startX, this.y));
|
|
4821
5154
|
};
|
|
4822
|
-
|
|
5155
|
+
TimeCycles.prototype.addShapes = function () {
|
|
5156
|
+
var typeOptions = this.options.typeOptions;
|
|
5157
|
+
this.setPathProperties();
|
|
5158
|
+
var shape = this.initShape(merge(typeOptions.line, {
|
|
5159
|
+
type: 'path',
|
|
5160
|
+
d: this.getPath(),
|
|
5161
|
+
points: this.options.points
|
|
5162
|
+
}), 0);
|
|
5163
|
+
typeOptions.line = shape.options;
|
|
5164
|
+
};
|
|
5165
|
+
TimeCycles.prototype.addControlPoints = function () {
|
|
5166
|
+
var _this = this;
|
|
5167
|
+
var options = this.options,
|
|
5168
|
+
typeOptions = options.typeOptions;
|
|
5169
|
+
options.controlPointOptions.style.cursor = this.chart.inverted ?
|
|
5170
|
+
'ns-resize' :
|
|
5171
|
+
'ew-resize';
|
|
5172
|
+
typeOptions.controlPointOptions.forEach(function (option) {
|
|
5173
|
+
var controlPointsOptions = merge(options.controlPointOptions,
|
|
5174
|
+
option);
|
|
5175
|
+
var controlPoint = new ControlPoint(_this.chart,
|
|
5176
|
+
_this,
|
|
5177
|
+
controlPointsOptions, 0);
|
|
5178
|
+
_this.controlPoints.push(controlPoint);
|
|
5179
|
+
});
|
|
5180
|
+
};
|
|
5181
|
+
TimeCycles.prototype.setPathProperties = function () {
|
|
5182
|
+
var options = this.options.typeOptions,
|
|
5183
|
+
points = options.points;
|
|
5184
|
+
if (!points) {
|
|
5185
|
+
return;
|
|
5186
|
+
}
|
|
5187
|
+
var point1 = points[0],
|
|
5188
|
+
point2 = points[1],
|
|
5189
|
+
xAxisNumber = options.xAxis || 0,
|
|
5190
|
+
yAxisNumber = options.yAxis || 0,
|
|
5191
|
+
xAxis = this.chart.xAxis[xAxisNumber],
|
|
5192
|
+
yAxis = this.chart.yAxis[yAxisNumber],
|
|
5193
|
+
xValue1 = point1.x,
|
|
5194
|
+
yValue = point1.y,
|
|
5195
|
+
xValue2 = point2.x;
|
|
5196
|
+
if (!xValue1 || !xValue2) {
|
|
5197
|
+
return;
|
|
5198
|
+
}
|
|
5199
|
+
var y = isNumber(yValue) ?
|
|
5200
|
+
yAxis.toPixels(yValue) :
|
|
5201
|
+
yAxis.top + yAxis.height,
|
|
5202
|
+
x = isNumber(xValue1) ? xAxis.toPixels(xValue1) : xAxis.left,
|
|
5203
|
+
x2 = isNumber(xValue2) ? xAxis.toPixels(xValue2) : xAxis.left + 30,
|
|
5204
|
+
xAxisLength = xAxis.len,
|
|
5205
|
+
pixelInterval = Math.round(Math.max(Math.abs(x2 - x), 2)),
|
|
5206
|
+
// There can be 2 not full circles on the chart, so add 2.
|
|
5207
|
+
numberOfCircles = Math.floor(xAxisLength / pixelInterval) + 2,
|
|
5208
|
+
// Calculate where the annotation should start drawing relative to
|
|
5209
|
+
// first point.
|
|
5210
|
+
pixelShift = (Math.floor((x - xAxis.left) / pixelInterval) + 1) * pixelInterval;
|
|
5211
|
+
this.startX = x - pixelShift;
|
|
5212
|
+
this.y = y;
|
|
5213
|
+
this.pixelInterval = pixelInterval;
|
|
5214
|
+
this.numberOfCircles = numberOfCircles;
|
|
5215
|
+
};
|
|
5216
|
+
TimeCycles.prototype.redraw = function (animation) {
|
|
5217
|
+
this.setPathProperties();
|
|
5218
|
+
this.setPath();
|
|
5219
|
+
_super.prototype.redraw.call(this, animation);
|
|
5220
|
+
};
|
|
5221
|
+
return TimeCycles;
|
|
5222
|
+
}(CrookedLine));
|
|
5223
|
+
TimeCycles.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions, {
|
|
5224
|
+
typeOptions: {
|
|
5225
|
+
controlPointOptions: [{
|
|
5226
|
+
positioner: function (target) {
|
|
5227
|
+
var point = target.points[0],
|
|
5228
|
+
position = target.anchor(point).absolutePosition;
|
|
5229
|
+
return {
|
|
5230
|
+
x: position.x - this.graphic.width / 2,
|
|
5231
|
+
y: target.y - this.graphic.height
|
|
5232
|
+
};
|
|
5233
|
+
},
|
|
5234
|
+
events: {
|
|
5235
|
+
drag: function (e, target) {
|
|
5236
|
+
var position = target.anchor(target.points[0]).absolutePosition;
|
|
5237
|
+
target.translatePoint(e.chartX - position.x, 0, 0);
|
|
5238
|
+
target.redraw(false);
|
|
5239
|
+
}
|
|
5240
|
+
}
|
|
5241
|
+
}, {
|
|
5242
|
+
positioner: function (target) {
|
|
5243
|
+
var point = target.points[1],
|
|
5244
|
+
position = target.anchor(point).absolutePosition;
|
|
5245
|
+
return {
|
|
5246
|
+
x: position.x - this.graphic.width / 2,
|
|
5247
|
+
y: target.y - this.graphic.height
|
|
5248
|
+
};
|
|
5249
|
+
},
|
|
5250
|
+
events: {
|
|
5251
|
+
drag: function (e, target) {
|
|
5252
|
+
var position = target.anchor(target.points[1]).absolutePosition;
|
|
5253
|
+
target.translatePoint(e.chartX - position.x, 0, 1);
|
|
5254
|
+
target.redraw(false);
|
|
5255
|
+
}
|
|
5256
|
+
}
|
|
5257
|
+
}]
|
|
5258
|
+
}
|
|
5259
|
+
});
|
|
5260
|
+
/* *
|
|
5261
|
+
*
|
|
5262
|
+
* Registry
|
|
5263
|
+
*
|
|
5264
|
+
* */
|
|
5265
|
+
Annotation.types.timeCycles = TimeCycles;
|
|
5266
|
+
/* *
|
|
5267
|
+
*
|
|
5268
|
+
* Default Export
|
|
5269
|
+
*
|
|
5270
|
+
* */
|
|
5271
|
+
/* *
|
|
5272
|
+
*
|
|
5273
|
+
* API Declarations
|
|
5274
|
+
*
|
|
5275
|
+
* */
|
|
5276
|
+
/**
|
|
5277
|
+
* The TimeCycles Annotation
|
|
5278
|
+
* @sample highcharts/annotations-advanced/time-cycles/
|
|
5279
|
+
* Time Cycles annotation
|
|
5280
|
+
*
|
|
5281
|
+
* @extends annotations.crookedLine
|
|
5282
|
+
* @product highstock
|
|
5283
|
+
* @exclude labelOptions
|
|
5284
|
+
* @apioption annotations.timeCycles
|
|
5285
|
+
*/
|
|
5286
|
+
/**
|
|
5287
|
+
* @exclude y
|
|
5288
|
+
* @product highstock
|
|
5289
|
+
* @apioption annotations.timeCycles.typeOptions.points
|
|
5290
|
+
*/
|
|
5291
|
+
(''); // keeps doclets above in transpiled file
|
|
5292
|
+
|
|
5293
|
+
return TimeCycles;
|
|
5294
|
+
});
|
|
5295
|
+
_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) {
|
|
5296
|
+
/* *
|
|
5297
|
+
*
|
|
5298
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5299
|
+
*
|
|
5300
|
+
* */
|
|
5301
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5302
|
+
var extendStatics = function (d,
|
|
5303
|
+
b) {
|
|
5304
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5305
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
5306
|
+
b) { d.__proto__ = b; }) ||
|
|
5307
|
+
function (d,
|
|
5308
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
5309
|
+
return extendStatics(d, b);
|
|
5310
|
+
};
|
|
5311
|
+
return function (d, b) {
|
|
5312
|
+
extendStatics(d, b);
|
|
5313
|
+
function __() { this.constructor = d; }
|
|
5314
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5315
|
+
};
|
|
5316
|
+
})();
|
|
5317
|
+
var merge = U.merge;
|
|
5318
|
+
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
5319
|
+
var createPathDGenerator = function (retracementIndex,
|
|
5320
|
+
isBackground) {
|
|
5321
|
+
return function () {
|
|
5322
|
+
var annotation = this.annotation;
|
|
5323
|
+
if (!annotation.startRetracements || !annotation.endRetracements) {
|
|
5324
|
+
return [];
|
|
5325
|
+
}
|
|
5326
|
+
var leftTop = this.anchor(annotation.startRetracements[retracementIndex]).absolutePosition,
|
|
5327
|
+
rightTop = this.anchor(annotation.endRetracements[retracementIndex]).absolutePosition,
|
|
5328
|
+
d = [
|
|
5329
|
+
['M',
|
|
5330
|
+
Math.round(leftTop.x),
|
|
5331
|
+
Math.round(leftTop.y)],
|
|
5332
|
+
['L',
|
|
5333
|
+
Math.round(rightTop.x),
|
|
5334
|
+
Math.round(rightTop.y)]
|
|
5335
|
+
],
|
|
5336
|
+
rightBottom,
|
|
5337
|
+
leftBottom;
|
|
5338
|
+
if (isBackground) {
|
|
5339
|
+
rightBottom = this.anchor(annotation.endRetracements[retracementIndex - 1]).absolutePosition;
|
|
5340
|
+
leftBottom = this.anchor(annotation.startRetracements[retracementIndex - 1]).absolutePosition;
|
|
5341
|
+
d.push(['L', Math.round(rightBottom.x), Math.round(rightBottom.y)], ['L', Math.round(leftBottom.x), Math.round(leftBottom.y)]);
|
|
5342
|
+
}
|
|
5343
|
+
return d;
|
|
5344
|
+
};
|
|
5345
|
+
};
|
|
5346
|
+
var Fibonacci = /** @class */ (function (_super) {
|
|
5347
|
+
__extends(Fibonacci, _super);
|
|
5348
|
+
/* *
|
|
5349
|
+
*
|
|
5350
|
+
* Constructors
|
|
5351
|
+
*
|
|
5352
|
+
* */
|
|
5353
|
+
function Fibonacci(chart, options) {
|
|
5354
|
+
return _super.call(this, chart, options) || this;
|
|
5355
|
+
}
|
|
5356
|
+
/* *
|
|
5357
|
+
*
|
|
5358
|
+
* Functions
|
|
5359
|
+
*
|
|
5360
|
+
* */
|
|
5361
|
+
Fibonacci.prototype.linkPoints = function () {
|
|
5362
|
+
_super.prototype.linkPoints.call(this);
|
|
5363
|
+
this.linkRetracementsPoints();
|
|
5364
|
+
return;
|
|
5365
|
+
};
|
|
5366
|
+
Fibonacci.prototype.linkRetracementsPoints = function () {
|
|
5367
|
+
var points = this.points,
|
|
5368
|
+
startDiff = points[0].y - points[3].y,
|
|
5369
|
+
endDiff = points[1].y - points[2].y,
|
|
5370
|
+
startX = points[0].x,
|
|
5371
|
+
endX = points[1].x;
|
|
5372
|
+
Fibonacci.levels.forEach(function (level, i) {
|
|
5373
|
+
var startRetracement = points[0].y - startDiff * level,
|
|
5374
|
+
endRetracement = points[1].y - endDiff * level;
|
|
5375
|
+
this.startRetracements = this.startRetracements || [];
|
|
5376
|
+
this.endRetracements = this.endRetracements || [];
|
|
5377
|
+
this.linkRetracementPoint(i, startX, startRetracement, this.startRetracements);
|
|
5378
|
+
this.linkRetracementPoint(i, endX, endRetracement, this.endRetracements);
|
|
5379
|
+
}, this);
|
|
5380
|
+
};
|
|
5381
|
+
Fibonacci.prototype.linkRetracementPoint = function (pointIndex, x, y, retracements) {
|
|
4823
5382
|
var point = retracements[pointIndex],
|
|
4824
5383
|
typeOptions = this.options.typeOptions;
|
|
4825
5384
|
if (!point) {
|
|
@@ -4846,7 +5405,7 @@
|
|
|
4846
5405
|
type: 'path',
|
|
4847
5406
|
d: createPathDGenerator(i),
|
|
4848
5407
|
stroke: lineColors[i] || lineColor
|
|
4849
|
-
},
|
|
5408
|
+
}, i);
|
|
4850
5409
|
if (i > 0) {
|
|
4851
5410
|
this.initShape({
|
|
4852
5411
|
type: 'path',
|
|
@@ -4920,7 +5479,7 @@
|
|
|
4920
5479
|
/**
|
|
4921
5480
|
* The color of line.
|
|
4922
5481
|
*/
|
|
4923
|
-
lineColor:
|
|
5482
|
+
lineColor: "#999999" /* neutralColor40 */,
|
|
4924
5483
|
/**
|
|
4925
5484
|
* An array of colors for the lines.
|
|
4926
5485
|
*/
|
|
@@ -4958,6 +5517,243 @@
|
|
|
4958
5517
|
|
|
4959
5518
|
return Fibonacci;
|
|
4960
5519
|
});
|
|
5520
|
+
_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) {
|
|
5521
|
+
/* *
|
|
5522
|
+
*
|
|
5523
|
+
* Author: Rafal Sebestjanski
|
|
5524
|
+
*
|
|
5525
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5526
|
+
*
|
|
5527
|
+
* */
|
|
5528
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5529
|
+
var extendStatics = function (d,
|
|
5530
|
+
b) {
|
|
5531
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5532
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
5533
|
+
b) { d.__proto__ = b; }) ||
|
|
5534
|
+
function (d,
|
|
5535
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
5536
|
+
return extendStatics(d, b);
|
|
5537
|
+
};
|
|
5538
|
+
return function (d, b) {
|
|
5539
|
+
extendStatics(d, b);
|
|
5540
|
+
function __() { this.constructor = d; }
|
|
5541
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5542
|
+
};
|
|
5543
|
+
})();
|
|
5544
|
+
var merge = U.merge;
|
|
5545
|
+
/* *
|
|
5546
|
+
*
|
|
5547
|
+
* Class
|
|
5548
|
+
*
|
|
5549
|
+
* */
|
|
5550
|
+
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
5551
|
+
var FibonacciTimeZones = /** @class */ (function (_super) {
|
|
5552
|
+
__extends(FibonacciTimeZones, _super);
|
|
5553
|
+
function FibonacciTimeZones() {
|
|
5554
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5555
|
+
}
|
|
5556
|
+
/* *
|
|
5557
|
+
*
|
|
5558
|
+
* Functions
|
|
5559
|
+
*
|
|
5560
|
+
* */
|
|
5561
|
+
/*
|
|
5562
|
+
Method taken (and slightly changed) from the InfinityLine annotation.
|
|
5563
|
+
|
|
5564
|
+
It uses x coordinate to create two mock points on the same x. Then,
|
|
5565
|
+
it uses some logic from InfinityLine to find equation of the line passing
|
|
5566
|
+
through our two points and, using that equation, it finds and returns
|
|
5567
|
+
the coordinates of where the line intersects the plot area edges.
|
|
5568
|
+
|
|
5569
|
+
This is being done for each fibonacci time zone line.
|
|
5570
|
+
|
|
5571
|
+
|
|
5572
|
+
this point here is found
|
|
5573
|
+
|
|
|
5574
|
+
v
|
|
5575
|
+
|---------*--------------------------------------------------------|
|
|
5576
|
+
| |
|
|
5577
|
+
| |
|
|
5578
|
+
| |
|
|
5579
|
+
| |
|
|
5580
|
+
| * copy of the primary point |
|
|
5581
|
+
| |
|
|
5582
|
+
| * primary point (e.g. the one given in options) |
|
|
5583
|
+
| |
|
|
5584
|
+
|---------*--------------------------------------------------------|
|
|
5585
|
+
and this point here is found (intersection with the plot area edge)
|
|
5586
|
+
|
|
5587
|
+
*/
|
|
5588
|
+
FibonacciTimeZones.prototype.edgePoint = function (startIndex, endIndex, fibonacciIndex) {
|
|
5589
|
+
return function (target) {
|
|
5590
|
+
var chart = target.annotation.chart,
|
|
5591
|
+
plotLeftOrTop = chart.inverted ? chart.plotTop : chart.plotLeft;
|
|
5592
|
+
var points = target.annotation.points;
|
|
5593
|
+
var xAxis = points[0].series.xAxis,
|
|
5594
|
+
// Distance between the two first lines in pixels
|
|
5595
|
+
deltaX = points.length > 1 ?
|
|
5596
|
+
points[1].plotX - points[0].plotX : 0,
|
|
5597
|
+
// firstLine.x + fibb * offset
|
|
5598
|
+
x = xAxis.toValue(points[0].plotX + plotLeftOrTop + fibonacciIndex * deltaX);
|
|
5599
|
+
// We need 2 mock points with the same x coordinate, different y
|
|
5600
|
+
points = [
|
|
5601
|
+
new MockPoint(chart, points[0].target, {
|
|
5602
|
+
x: x,
|
|
5603
|
+
y: 0,
|
|
5604
|
+
xAxis: points[0].options.xAxis,
|
|
5605
|
+
yAxis: points[0].options.yAxis
|
|
5606
|
+
}),
|
|
5607
|
+
new MockPoint(chart, points[0].target, {
|
|
5608
|
+
x: x,
|
|
5609
|
+
y: 1,
|
|
5610
|
+
xAxis: points[0].options.xAxis,
|
|
5611
|
+
yAxis: points[0].options.yAxis
|
|
5612
|
+
})
|
|
5613
|
+
];
|
|
5614
|
+
return InfinityLine.findEdgePoint(points[startIndex], points[endIndex]);
|
|
5615
|
+
};
|
|
5616
|
+
};
|
|
5617
|
+
FibonacciTimeZones.prototype.addShapes = function () {
|
|
5618
|
+
var numberOfLines = 11;
|
|
5619
|
+
var fibb = 1,
|
|
5620
|
+
nextFibb = 1;
|
|
5621
|
+
for (var i = 0; i < numberOfLines; i++) {
|
|
5622
|
+
// The fibb variable equals to 1 twice - correct it in the first
|
|
5623
|
+
// iteration so the lines don't overlap
|
|
5624
|
+
var correctedFibb = !i ? 0 : fibb,
|
|
5625
|
+
points = [
|
|
5626
|
+
this.edgePoint(1, 0,
|
|
5627
|
+
correctedFibb),
|
|
5628
|
+
this.edgePoint(0, 1,
|
|
5629
|
+
correctedFibb)
|
|
5630
|
+
];
|
|
5631
|
+
// Calculate fibbonacci
|
|
5632
|
+
nextFibb = fibb + nextFibb;
|
|
5633
|
+
fibb = nextFibb - fibb;
|
|
5634
|
+
// Save the second line for the control point
|
|
5635
|
+
if (i === 1) {
|
|
5636
|
+
this.secondLineEdgePoints = [points[0], points[1]];
|
|
5637
|
+
}
|
|
5638
|
+
this.initShape(merge(this.options.typeOptions.line, {
|
|
5639
|
+
type: 'path',
|
|
5640
|
+
points: points
|
|
5641
|
+
}), i // shape's index. Can be found in annotation.shapes[i].index
|
|
5642
|
+
);
|
|
5643
|
+
}
|
|
5644
|
+
};
|
|
5645
|
+
FibonacciTimeZones.prototype.addControlPoints = function () {
|
|
5646
|
+
var options = this.options,
|
|
5647
|
+
typeOptions = options.typeOptions,
|
|
5648
|
+
controlPoint = new ControlPoint(this.chart,
|
|
5649
|
+
this,
|
|
5650
|
+
merge(options.controlPointOptions,
|
|
5651
|
+
typeOptions.controlPointOptions), 0);
|
|
5652
|
+
this.controlPoints.push(controlPoint);
|
|
5653
|
+
typeOptions.controlPointOptions = controlPoint.options;
|
|
5654
|
+
};
|
|
5655
|
+
return FibonacciTimeZones;
|
|
5656
|
+
}(CrookedLine));
|
|
5657
|
+
FibonacciTimeZones.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions, {
|
|
5658
|
+
typeOptions: {
|
|
5659
|
+
// Options for showing in popup edit
|
|
5660
|
+
line: {
|
|
5661
|
+
/**
|
|
5662
|
+
* The color of the lines.
|
|
5663
|
+
*
|
|
5664
|
+
* @type {string}
|
|
5665
|
+
* @since 9.3.0
|
|
5666
|
+
* @default 'rgba(0, 0, 0, 0.75)'
|
|
5667
|
+
* @apioption annotations.fibonacciTimeZones.typeOptions.line.stroke
|
|
5668
|
+
*/
|
|
5669
|
+
stroke: 'rgba(0, 0, 0, 0.75)',
|
|
5670
|
+
/**
|
|
5671
|
+
* The width of the lines.
|
|
5672
|
+
*
|
|
5673
|
+
* @type {number}
|
|
5674
|
+
* @since 9.3.0
|
|
5675
|
+
* @default 1
|
|
5676
|
+
* @apioption annotations.fibonacciTimeZones.typeOptions.line.strokeWidth
|
|
5677
|
+
*/
|
|
5678
|
+
strokeWidth: 1,
|
|
5679
|
+
// Don't inherit fill (don't display in popup edit)
|
|
5680
|
+
fill: void 0
|
|
5681
|
+
},
|
|
5682
|
+
controlPointOptions: {
|
|
5683
|
+
positioner: function () {
|
|
5684
|
+
var _a;
|
|
5685
|
+
// The control point is in the middle of the second line
|
|
5686
|
+
var target = this.target,
|
|
5687
|
+
graphic = this.graphic,
|
|
5688
|
+
edgePoints = target.secondLineEdgePoints,
|
|
5689
|
+
args = { annotation: target },
|
|
5690
|
+
firstEdgePointY = edgePoints[0](args).y,
|
|
5691
|
+
secondEdgePointY = edgePoints[1](args).y,
|
|
5692
|
+
plotLeft = this.chart.plotLeft,
|
|
5693
|
+
plotTop = this.chart.plotTop;
|
|
5694
|
+
var x = edgePoints[0](args).x,
|
|
5695
|
+
y = (firstEdgePointY + secondEdgePointY) / 2;
|
|
5696
|
+
if (this.chart.inverted) {
|
|
5697
|
+
_a = [y, x], x = _a[0], y = _a[1];
|
|
5698
|
+
}
|
|
5699
|
+
return {
|
|
5700
|
+
x: plotLeft + x - graphic.width / 2,
|
|
5701
|
+
y: plotTop + y - graphic.height / 2
|
|
5702
|
+
};
|
|
5703
|
+
},
|
|
5704
|
+
events: {
|
|
5705
|
+
drag: function (e, target) {
|
|
5706
|
+
var isInsidePlot = target.chart.isInsidePlot(e.chartX - target.chart.plotLeft,
|
|
5707
|
+
e.chartY - target.chart.plotTop, {
|
|
5708
|
+
visiblePlotOnly: true
|
|
5709
|
+
});
|
|
5710
|
+
if (isInsidePlot) {
|
|
5711
|
+
var translation = this.mouseMoveToTranslation(e);
|
|
5712
|
+
target.translatePoint(translation.x, 0, 1);
|
|
5713
|
+
target.redraw(false);
|
|
5714
|
+
}
|
|
5715
|
+
}
|
|
5716
|
+
}
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
});
|
|
5720
|
+
/* *
|
|
5721
|
+
*
|
|
5722
|
+
* Registry
|
|
5723
|
+
*
|
|
5724
|
+
* */
|
|
5725
|
+
Annotation.types.fibonacciTimeZones = FibonacciTimeZones;
|
|
5726
|
+
/* *
|
|
5727
|
+
*
|
|
5728
|
+
* Default Export
|
|
5729
|
+
*
|
|
5730
|
+
* */
|
|
5731
|
+
/* *
|
|
5732
|
+
*
|
|
5733
|
+
* API Declarations
|
|
5734
|
+
*
|
|
5735
|
+
* */
|
|
5736
|
+
/**
|
|
5737
|
+
* The Fibonacci Time Zones annotation.
|
|
5738
|
+
*
|
|
5739
|
+
* @sample highcharts/annotations-advanced/fibonacci-time-zones/
|
|
5740
|
+
* Fibonacci Time Zones
|
|
5741
|
+
*
|
|
5742
|
+
* @extends annotations.crookedLine
|
|
5743
|
+
* @since 9.3.0
|
|
5744
|
+
* @product highstock
|
|
5745
|
+
* @apioption annotations.fibonacciTimeZones
|
|
5746
|
+
*/
|
|
5747
|
+
/**
|
|
5748
|
+
* @exclude y
|
|
5749
|
+
* @since 9.3.0
|
|
5750
|
+
* @product highstock
|
|
5751
|
+
* @apioption annotations.fibonacciTimeZones.typeOptions.points
|
|
5752
|
+
*/
|
|
5753
|
+
(''); // keeps doclets above in transpiled file
|
|
5754
|
+
|
|
5755
|
+
return FibonacciTimeZones;
|
|
5756
|
+
});
|
|
4961
5757
|
_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
5758
|
/* *
|
|
4963
5759
|
*
|
|
@@ -5005,7 +5801,8 @@
|
|
|
5005
5801
|
};
|
|
5006
5802
|
};
|
|
5007
5803
|
Pitchfork.findEdgePoint = function (point, firstAnglePoint, secondAnglePoint) {
|
|
5008
|
-
var angle = Math.atan2(secondAnglePoint.plotY -
|
|
5804
|
+
var angle = Math.atan2((secondAnglePoint.plotY -
|
|
5805
|
+
firstAnglePoint.plotY),
|
|
5009
5806
|
secondAnglePoint.plotX - firstAnglePoint.plotX),
|
|
5010
5807
|
distance = 1e7;
|
|
5011
5808
|
return {
|
|
@@ -5043,21 +5840,21 @@
|
|
|
5043
5840
|
this.points[0],
|
|
5044
5841
|
Pitchfork.middleLineEdgePoint
|
|
5045
5842
|
]
|
|
5046
|
-
},
|
|
5843
|
+
}, 0);
|
|
5047
5844
|
this.initShape({
|
|
5048
5845
|
type: 'path',
|
|
5049
5846
|
points: [
|
|
5050
5847
|
this.points[1],
|
|
5051
5848
|
Pitchfork.topLineEdgePoint
|
|
5052
5849
|
]
|
|
5053
|
-
},
|
|
5850
|
+
}, 1);
|
|
5054
5851
|
this.initShape({
|
|
5055
5852
|
type: 'path',
|
|
5056
5853
|
points: [
|
|
5057
5854
|
this.points[2],
|
|
5058
5855
|
Pitchfork.bottomLineEdgePoint
|
|
5059
5856
|
]
|
|
5060
|
-
},
|
|
5857
|
+
}, 2);
|
|
5061
5858
|
};
|
|
5062
5859
|
Pitchfork.prototype.addBackgrounds = function () {
|
|
5063
5860
|
var shapes = this.shapes,
|
|
@@ -5090,7 +5887,7 @@
|
|
|
5090
5887
|
};
|
|
5091
5888
|
}
|
|
5092
5889
|
]
|
|
5093
|
-
}));
|
|
5890
|
+
}), 3);
|
|
5094
5891
|
var outerBackground = this.initShape(merge(typeOptions.outerBackground, {
|
|
5095
5892
|
type: 'path',
|
|
5096
5893
|
points: [
|
|
@@ -5099,7 +5896,7 @@
|
|
|
5099
5896
|
shapes[2].points[1],
|
|
5100
5897
|
this.points[2]
|
|
5101
5898
|
]
|
|
5102
|
-
}));
|
|
5899
|
+
}), 4);
|
|
5103
5900
|
typeOptions.innerBackground = innerBackground.options;
|
|
5104
5901
|
typeOptions.outerBackground = outerBackground.options;
|
|
5105
5902
|
};
|
|
@@ -5255,8 +6052,7 @@
|
|
|
5255
6052
|
VerticalLine.connectorFirstPoint,
|
|
5256
6053
|
VerticalLine.connectorSecondPoint
|
|
5257
6054
|
]
|
|
5258
|
-
}),
|
|
5259
|
-
false);
|
|
6055
|
+
}), 0);
|
|
5260
6056
|
typeOptions.connector = connector.options;
|
|
5261
6057
|
};
|
|
5262
6058
|
VerticalLine.prototype.addLabels = function () {
|
|
@@ -5361,7 +6157,8 @@
|
|
|
5361
6157
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5362
6158
|
};
|
|
5363
6159
|
})();
|
|
5364
|
-
var
|
|
6160
|
+
var defined = U.defined,
|
|
6161
|
+
extend = U.extend,
|
|
5365
6162
|
isNumber = U.isNumber,
|
|
5366
6163
|
merge = U.merge,
|
|
5367
6164
|
pick = U.pick;
|
|
@@ -5406,7 +6203,6 @@
|
|
|
5406
6203
|
/**
|
|
5407
6204
|
* Get measure points configuration objects.
|
|
5408
6205
|
* @private
|
|
5409
|
-
* @return {Array<Highcharts.AnnotationMockPointOptionsObject>}
|
|
5410
6206
|
*/
|
|
5411
6207
|
Measure.prototype.pointsOptions = function () {
|
|
5412
6208
|
return this.options.points;
|
|
@@ -5414,7 +6210,6 @@
|
|
|
5414
6210
|
/**
|
|
5415
6211
|
* Get points configuration objects for shapes.
|
|
5416
6212
|
* @private
|
|
5417
|
-
* @return {Array<Highcharts.AnnotationMockPointOptionsObject>}
|
|
5418
6213
|
*/
|
|
5419
6214
|
Measure.prototype.shapePointsOptions = function () {
|
|
5420
6215
|
var options = this.options.typeOptions,
|
|
@@ -5448,8 +6243,19 @@
|
|
|
5448
6243
|
];
|
|
5449
6244
|
};
|
|
5450
6245
|
Measure.prototype.addControlPoints = function () {
|
|
6246
|
+
var inverted = this.chart.inverted,
|
|
6247
|
+
options = this.options.controlPointOptions;
|
|
5451
6248
|
var selectType = this.options.typeOptions.selectType,
|
|
5452
6249
|
controlPoint;
|
|
6250
|
+
if (!defined(this.userOptions.controlPointOptions &&
|
|
6251
|
+
this.userOptions.controlPointOptions.style.cursor)) {
|
|
6252
|
+
if (selectType === 'x') {
|
|
6253
|
+
options.style.cursor = inverted ? 'ns-resize' : 'ew-resize';
|
|
6254
|
+
}
|
|
6255
|
+
else if (selectType === 'y') {
|
|
6256
|
+
options.style.cursor = inverted ? 'ew-resize' : 'ns-resize';
|
|
6257
|
+
}
|
|
6258
|
+
}
|
|
5453
6259
|
controlPoint = new ControlPoint(this.chart, this, this.options.controlPointOptions, 0);
|
|
5454
6260
|
this.controlPoints.push(controlPoint);
|
|
5455
6261
|
// add extra controlPoint for horizontal and vertical range
|
|
@@ -5473,8 +6279,8 @@
|
|
|
5473
6279
|
return;
|
|
5474
6280
|
}
|
|
5475
6281
|
if (this.labels.length > 0) {
|
|
5476
|
-
this.labels[0].text = (formatter && formatter.call(this)) ||
|
|
5477
|
-
Measure.calculations.defaultFormatter.call(this);
|
|
6282
|
+
this.labels[0].text = ((formatter && formatter.call(this)) ||
|
|
6283
|
+
Measure.calculations.defaultFormatter.call(this));
|
|
5478
6284
|
}
|
|
5479
6285
|
else {
|
|
5480
6286
|
this.initLabel(extend({
|
|
@@ -5526,7 +6332,7 @@
|
|
|
5526
6332
|
this.initShape(extend({
|
|
5527
6333
|
type: 'path',
|
|
5528
6334
|
points: this.shapePointsOptions()
|
|
5529
|
-
}, this.options.typeOptions.background),
|
|
6335
|
+
}, this.options.typeOptions.background), 2);
|
|
5530
6336
|
};
|
|
5531
6337
|
/**
|
|
5532
6338
|
* Add internal crosshair shapes (on top and bottom).
|
|
@@ -5593,12 +6399,8 @@
|
|
|
5593
6399
|
// Add new crosshairs
|
|
5594
6400
|
crosshairOptionsX = merge(defaultOptions, options.crosshairX);
|
|
5595
6401
|
crosshairOptionsY = merge(defaultOptions, options.crosshairY);
|
|
5596
|
-
this.initShape(extend({
|
|
5597
|
-
|
|
5598
|
-
}, crosshairOptionsX), false);
|
|
5599
|
-
this.initShape(extend({
|
|
5600
|
-
d: pathV
|
|
5601
|
-
}, crosshairOptionsY), false);
|
|
6402
|
+
this.initShape(extend({ d: pathH }, crosshairOptionsX), 0);
|
|
6403
|
+
this.initShape(extend({ d: pathV }, crosshairOptionsY), 1);
|
|
5602
6404
|
}
|
|
5603
6405
|
};
|
|
5604
6406
|
Measure.prototype.onDrag = function (e) {
|
|
@@ -5613,10 +6415,14 @@
|
|
|
5613
6415
|
* Translate start or end ("left" or "right") side of the measure.
|
|
5614
6416
|
* Update start points (startXMin, startXMax, startYMin, startYMax)
|
|
5615
6417
|
* @private
|
|
5616
|
-
* @param {number} dx
|
|
5617
|
-
*
|
|
5618
|
-
* @param {number}
|
|
5619
|
-
*
|
|
6418
|
+
* @param {number} dx
|
|
6419
|
+
* the amount of x translation
|
|
6420
|
+
* @param {number} dy
|
|
6421
|
+
* the amount of y translation
|
|
6422
|
+
* @param {number} cpIndex
|
|
6423
|
+
* index of control point
|
|
6424
|
+
* @param {Highcharts.AnnotationDraggableValue} selectType
|
|
6425
|
+
* x / y / xy
|
|
5620
6426
|
*/
|
|
5621
6427
|
Measure.prototype.resize = function (dx, dy, cpIndex, selectType) {
|
|
5622
6428
|
// background shape
|
|
@@ -5655,8 +6461,10 @@
|
|
|
5655
6461
|
* Redraw event which render elements and update start points if needed.
|
|
5656
6462
|
* @private
|
|
5657
6463
|
* @param {boolean} animation
|
|
5658
|
-
* @param {boolean} [resize]
|
|
5659
|
-
*
|
|
6464
|
+
* @param {boolean} [resize]
|
|
6465
|
+
* flag if resized
|
|
6466
|
+
* @param {boolean} [setStartPoints]
|
|
6467
|
+
* update position of start points
|
|
5660
6468
|
*/
|
|
5661
6469
|
Measure.prototype.redraw = function (animation, resize, setStartPoints) {
|
|
5662
6470
|
this.linkPoints();
|
|
@@ -6127,7 +6935,7 @@
|
|
|
6127
6935
|
*
|
|
6128
6936
|
* </table>
|
|
6129
6937
|
*
|
|
6130
|
-
* @type
|
|
6938
|
+
* @type {Function}
|
|
6131
6939
|
*
|
|
6132
6940
|
*/
|
|
6133
6941
|
formatter: void 0
|
|
@@ -6205,66 +7013,101 @@
|
|
|
6205
7013
|
|
|
6206
7014
|
return Measure;
|
|
6207
7015
|
});
|
|
6208
|
-
_registerModule(_modules, '
|
|
7016
|
+
_registerModule(_modules, 'Core/Chart/ChartNavigationComposition.js', [], function () {
|
|
6209
7017
|
/**
|
|
6210
7018
|
*
|
|
6211
7019
|
* (c) 2010-2021 Paweł Fus
|
|
6212
7020
|
*
|
|
6213
|
-
* License: www.highcharts.com/license
|
|
6214
|
-
*
|
|
6215
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
6216
|
-
*
|
|
6217
|
-
* */
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
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.
|
|
7021
|
+
* License: www.highcharts.com/license
|
|
7022
|
+
*
|
|
7023
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
7024
|
+
*
|
|
7025
|
+
* */
|
|
7026
|
+
/* *
|
|
7027
|
+
*
|
|
7028
|
+
* Composition
|
|
7029
|
+
*
|
|
7030
|
+
* */
|
|
7031
|
+
var ChartNavigationComposition;
|
|
7032
|
+
(function (ChartNavigationComposition) {
|
|
7033
|
+
/* *
|
|
7034
|
+
*
|
|
7035
|
+
* Declarations
|
|
7036
|
+
*
|
|
7037
|
+
* */
|
|
7038
|
+
/* *
|
|
7039
|
+
*
|
|
7040
|
+
* Functions
|
|
6245
7041
|
*
|
|
7042
|
+
* */
|
|
7043
|
+
/* eslint-disable valid-jsdoc */
|
|
7044
|
+
/**
|
|
6246
7045
|
* @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
7046
|
*/
|
|
6254
|
-
|
|
7047
|
+
function compose(chart) {
|
|
6255
7048
|
if (!chart.navigation) {
|
|
6256
|
-
|
|
7049
|
+
chart.navigation = new Additions(chart);
|
|
6257
7050
|
}
|
|
6258
|
-
chart
|
|
6259
|
-
update: update,
|
|
6260
|
-
context: chart
|
|
6261
|
-
});
|
|
7051
|
+
return chart;
|
|
6262
7052
|
}
|
|
6263
|
-
|
|
7053
|
+
ChartNavigationComposition.compose = compose;
|
|
7054
|
+
/* *
|
|
7055
|
+
*
|
|
7056
|
+
* Class
|
|
7057
|
+
*
|
|
7058
|
+
* */
|
|
7059
|
+
/**
|
|
7060
|
+
* Initializes `chart.navigation` object which delegates `update()` methods
|
|
7061
|
+
* to all other common classes (used in exporting and navigationBindings).
|
|
7062
|
+
* @private
|
|
7063
|
+
*/
|
|
7064
|
+
var Additions = /** @class */ (function () {
|
|
7065
|
+
/* *
|
|
7066
|
+
*
|
|
7067
|
+
* Constructor
|
|
7068
|
+
*
|
|
7069
|
+
* */
|
|
7070
|
+
function Additions(chart) {
|
|
7071
|
+
this.updates = [];
|
|
7072
|
+
this.chart = chart;
|
|
7073
|
+
}
|
|
7074
|
+
/* *
|
|
7075
|
+
*
|
|
7076
|
+
* Functions
|
|
7077
|
+
*
|
|
7078
|
+
* */
|
|
7079
|
+
/**
|
|
7080
|
+
* Registers an `update()` method in the `chart.navigation` object.
|
|
7081
|
+
*
|
|
7082
|
+
* @private
|
|
7083
|
+
* @param {UpdateFunction} updateFn
|
|
7084
|
+
* The `update()` method that will be called in `chart.update()`.
|
|
7085
|
+
*/
|
|
7086
|
+
Additions.prototype.addUpdate = function (updateFn) {
|
|
7087
|
+
this.chart.navigation.updates.push(updateFn);
|
|
7088
|
+
};
|
|
7089
|
+
/**
|
|
7090
|
+
* @private
|
|
7091
|
+
*/
|
|
7092
|
+
Additions.prototype.update = function (options, redraw) {
|
|
7093
|
+
var _this = this;
|
|
7094
|
+
this.updates.forEach(function (updateFn) {
|
|
7095
|
+
updateFn.call(_this.chart, options, redraw);
|
|
7096
|
+
});
|
|
7097
|
+
};
|
|
7098
|
+
return Additions;
|
|
7099
|
+
}());
|
|
7100
|
+
ChartNavigationComposition.Additions = Additions;
|
|
7101
|
+
})(ChartNavigationComposition || (ChartNavigationComposition = {}));
|
|
7102
|
+
/* *
|
|
7103
|
+
*
|
|
7104
|
+
* Default Export
|
|
7105
|
+
*
|
|
7106
|
+
* */
|
|
6264
7107
|
|
|
6265
|
-
return
|
|
7108
|
+
return ChartNavigationComposition;
|
|
6266
7109
|
});
|
|
6267
|
-
_registerModule(_modules, 'Extensions/Annotations/NavigationBindings.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Core/Chart/Chart.js'], _modules['
|
|
7110
|
+
_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
7111
|
/* *
|
|
6269
7112
|
*
|
|
6270
7113
|
* (c) 2009-2021 Highsoft, Black Label
|
|
@@ -6412,8 +7255,9 @@
|
|
|
6412
7255
|
*/
|
|
6413
7256
|
getAssignedAxis: function (coords) {
|
|
6414
7257
|
return coords.filter(function (coord) {
|
|
6415
|
-
var
|
|
6416
|
-
|
|
7258
|
+
var extremes = coord.axis.getExtremes(),
|
|
7259
|
+
axisMin = extremes.min,
|
|
7260
|
+
axisMax = extremes.max,
|
|
6417
7261
|
// Correct axis edges when axis has series
|
|
6418
7262
|
// with pointRange (like column)
|
|
6419
7263
|
minPointOffset = pick(coord.axis.minPointOffset, 0);
|
|
@@ -6484,7 +7328,9 @@
|
|
|
6484
7328
|
navigation.eventsToUnbind.push(addEvent(subContainer, 'click', function (event) {
|
|
6485
7329
|
var bindings = navigation.getButtonEvents(subContainer,
|
|
6486
7330
|
event);
|
|
6487
|
-
if (bindings &&
|
|
7331
|
+
if (bindings &&
|
|
7332
|
+
bindings.button.className
|
|
7333
|
+
.indexOf('highcharts-disabled-btn') === -1) {
|
|
6488
7334
|
navigation.bindingsButtonClick(bindings.button, bindings.events, event);
|
|
6489
7335
|
}
|
|
6490
7336
|
}));
|
|
@@ -6514,9 +7360,11 @@
|
|
|
6514
7360
|
*/
|
|
6515
7361
|
NavigationBindings.prototype.initUpdate = function () {
|
|
6516
7362
|
var navigation = this;
|
|
6517
|
-
|
|
7363
|
+
ChartNavigationComposition
|
|
7364
|
+
.compose(this.chart).navigation
|
|
7365
|
+
.addUpdate(function (options) {
|
|
6518
7366
|
navigation.update(options);
|
|
6519
|
-
}
|
|
7367
|
+
});
|
|
6520
7368
|
};
|
|
6521
7369
|
/**
|
|
6522
7370
|
* Hook for click on a button, method selcts/unselects buttons,
|
|
@@ -6528,7 +7376,7 @@
|
|
|
6528
7376
|
* @param {Highcharts.HTMLDOMElement} [button]
|
|
6529
7377
|
* Clicked button
|
|
6530
7378
|
*
|
|
6531
|
-
* @param {
|
|
7379
|
+
* @param {Object} events
|
|
6532
7380
|
* Events passed down from bindings (`init`, `start`, `step`, `end`)
|
|
6533
7381
|
*
|
|
6534
7382
|
* @param {Highcharts.PointerEventObject} clickEvent
|
|
@@ -6536,8 +7384,13 @@
|
|
|
6536
7384
|
*/
|
|
6537
7385
|
NavigationBindings.prototype.bindingsButtonClick = function (button, events, clickEvent) {
|
|
6538
7386
|
var navigation = this,
|
|
6539
|
-
chart = navigation.chart
|
|
7387
|
+
chart = navigation.chart,
|
|
7388
|
+
svgContainer = chart.renderer.boxWrapper;
|
|
7389
|
+
var shouldEventBeFired = true;
|
|
6540
7390
|
if (navigation.selectedButtonElement) {
|
|
7391
|
+
if (navigation.selectedButtonElement.classList === button.classList) {
|
|
7392
|
+
shouldEventBeFired = false;
|
|
7393
|
+
}
|
|
6541
7394
|
fireEvent(navigation, 'deselectButton', { button: navigation.selectedButtonElement });
|
|
6542
7395
|
if (navigation.nextEvent) {
|
|
6543
7396
|
// Remove in-progress annotations adders:
|
|
@@ -6548,15 +7401,24 @@
|
|
|
6548
7401
|
navigation.mouseMoveEvent = navigation.nextEvent = false;
|
|
6549
7402
|
}
|
|
6550
7403
|
}
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
events.init
|
|
7404
|
+
if (shouldEventBeFired) {
|
|
7405
|
+
navigation.selectedButton = events;
|
|
7406
|
+
navigation.selectedButtonElement = button;
|
|
7407
|
+
fireEvent(navigation, 'selectButton', { button: button });
|
|
7408
|
+
// Call "init" event, for example to open modal window
|
|
7409
|
+
if (events.init) {
|
|
7410
|
+
events.init.call(navigation, button, clickEvent);
|
|
7411
|
+
}
|
|
7412
|
+
if (events.start || events.steps) {
|
|
7413
|
+
chart.renderer.boxWrapper.addClass(PREFIX + 'draw-mode');
|
|
7414
|
+
}
|
|
6557
7415
|
}
|
|
6558
|
-
|
|
6559
|
-
chart.
|
|
7416
|
+
else {
|
|
7417
|
+
chart.stockTools && chart.stockTools.toggleButtonAciveClass(button);
|
|
7418
|
+
svgContainer.removeClass(PREFIX + 'draw-mode');
|
|
7419
|
+
navigation.nextEvent = false;
|
|
7420
|
+
navigation.mouseMoveEvent = false;
|
|
7421
|
+
navigation.selectedButton = null;
|
|
6560
7422
|
}
|
|
6561
7423
|
};
|
|
6562
7424
|
/**
|
|
@@ -6627,8 +7489,7 @@
|
|
|
6627
7489
|
navigation.stepIndex++;
|
|
6628
7490
|
if (selectedButton.steps[navigation.stepIndex]) {
|
|
6629
7491
|
// If we have more steps, bind them one by one:
|
|
6630
|
-
navigation.mouseMoveEvent = navigation.nextEvent =
|
|
6631
|
-
selectedButton.steps[navigation.stepIndex];
|
|
7492
|
+
navigation.mouseMoveEvent = navigation.nextEvent = selectedButton.steps[navigation.stepIndex];
|
|
6632
7493
|
}
|
|
6633
7494
|
else {
|
|
6634
7495
|
fireEvent(navigation, 'deselectButton', { button: navigation.selectedButtonElement });
|
|
@@ -6762,10 +7623,10 @@
|
|
|
6762
7623
|
* @param {string} key
|
|
6763
7624
|
* Option name, for example "visible" or "x", "y"
|
|
6764
7625
|
*
|
|
6765
|
-
* @param {
|
|
7626
|
+
* @param {Object} parentEditables
|
|
6766
7627
|
* Editables from NavigationBindings.annotationsEditable
|
|
6767
7628
|
*
|
|
6768
|
-
* @param {
|
|
7629
|
+
* @param {Object} parent
|
|
6769
7630
|
* Where new options will be assigned
|
|
6770
7631
|
*/
|
|
6771
7632
|
function traverse(option, key, parentEditables, parent) {
|
|
@@ -6806,7 +7667,9 @@
|
|
|
6806
7667
|
parent[key] = nextParent;
|
|
6807
7668
|
}
|
|
6808
7669
|
objectEach(option, function (nestedOption, nestedKey) {
|
|
6809
|
-
traverse(nestedOption, nestedKey, key === 0 ?
|
|
7670
|
+
traverse(nestedOption, nestedKey, key === 0 ?
|
|
7671
|
+
parentEditables :
|
|
7672
|
+
nestedEditables[key], nextParent);
|
|
6810
7673
|
});
|
|
6811
7674
|
}
|
|
6812
7675
|
else {
|
|
@@ -6845,14 +7708,14 @@
|
|
|
6845
7708
|
*
|
|
6846
7709
|
* @function Highcharts.NavigationBindings#getClickedClassNames
|
|
6847
7710
|
*
|
|
6848
|
-
* @param {Highcharts.HTMLDOMElement}
|
|
6849
|
-
*
|
|
7711
|
+
* @param {Highcharts.HTMLDOMElement} container
|
|
7712
|
+
* Container that event is bound to.
|
|
6850
7713
|
*
|
|
6851
7714
|
* @param {global.Event} event
|
|
6852
|
-
*
|
|
7715
|
+
* Browser's event.
|
|
6853
7716
|
*
|
|
6854
7717
|
* @return {Array<Array<string, Highcharts.HTMLDOMElement>>}
|
|
6855
|
-
*
|
|
7718
|
+
* Array of class names with corresponding elements
|
|
6856
7719
|
*/
|
|
6857
7720
|
NavigationBindings.prototype.getClickedClassNames = function (container, event) {
|
|
6858
7721
|
var element = event.target,
|
|
@@ -6890,7 +7753,7 @@
|
|
|
6890
7753
|
* @param {global.Event} event
|
|
6891
7754
|
* Browser's event.
|
|
6892
7755
|
*
|
|
6893
|
-
* @return {
|
|
7756
|
+
* @return {Object}
|
|
6894
7757
|
* Object with events (init, start, steps, and end)
|
|
6895
7758
|
*/
|
|
6896
7759
|
NavigationBindings.prototype.getButtonEvents = function (container, event) {
|
|
@@ -6961,6 +7824,7 @@
|
|
|
6961
7824
|
},
|
|
6962
7825
|
// Simple shapes:
|
|
6963
7826
|
circle: ['shapes'],
|
|
7827
|
+
ellipse: ['shapes'],
|
|
6964
7828
|
verticalLine: [],
|
|
6965
7829
|
label: ['labelOptions'],
|
|
6966
7830
|
// Measure
|
|
@@ -6977,7 +7841,9 @@
|
|
|
6977
7841
|
// Define non editable fields per annotation, for example Rectangle inherits
|
|
6978
7842
|
// options from Measure, but crosshairs are not available
|
|
6979
7843
|
NavigationBindings.annotationsNonEditable = {
|
|
6980
|
-
rectangle: ['crosshairX', 'crosshairY', '
|
|
7844
|
+
rectangle: ['crosshairX', 'crosshairY', 'labelOptions'],
|
|
7845
|
+
ellipse: ['labelOptions'],
|
|
7846
|
+
circle: ['labelOptions']
|
|
6981
7847
|
};
|
|
6982
7848
|
return NavigationBindings;
|
|
6983
7849
|
}());
|
|
@@ -7054,10 +7920,10 @@
|
|
|
7054
7920
|
if (annotation.options.type === 'measure') {
|
|
7055
7921
|
// Manually disable crooshars according to
|
|
7056
7922
|
// stroke width of the shape:
|
|
7057
|
-
typeOptions.crosshairY.enabled =
|
|
7058
|
-
|
|
7059
|
-
typeOptions.crosshairX.enabled =
|
|
7060
|
-
|
|
7923
|
+
typeOptions.crosshairY.enabled = (typeOptions.crosshairY
|
|
7924
|
+
.strokeWidth !== 0);
|
|
7925
|
+
typeOptions.crosshairX.enabled = (typeOptions.crosshairX
|
|
7926
|
+
.strokeWidth !== 0);
|
|
7061
7927
|
}
|
|
7062
7928
|
annotation.update(config);
|
|
7063
7929
|
}
|
|
@@ -7094,7 +7960,6 @@
|
|
|
7094
7960
|
* Configure the Popup strings in the chart. Requires the
|
|
7095
7961
|
* `annotations.js` or `annotations-advanced.src.js` module to be
|
|
7096
7962
|
* loaded.
|
|
7097
|
-
*
|
|
7098
7963
|
* @since 7.0.0
|
|
7099
7964
|
* @product highcharts highstock
|
|
7100
7965
|
*/
|
|
@@ -7108,6 +7973,7 @@
|
|
|
7108
7973
|
simpleShapes: 'Simple shapes',
|
|
7109
7974
|
lines: 'Lines',
|
|
7110
7975
|
circle: 'Circle',
|
|
7976
|
+
ellipse: 'Ellipse',
|
|
7111
7977
|
rectangle: 'Rectangle',
|
|
7112
7978
|
label: 'Label',
|
|
7113
7979
|
shapeOptions: 'Shape options',
|
|
@@ -7168,9 +8034,16 @@
|
|
|
7168
8034
|
* - `end`: last event to be called after last step event
|
|
7169
8035
|
*
|
|
7170
8036
|
* @type {Highcharts.Dictionary<Highcharts.NavigationBindingsOptionsObject>|*}
|
|
7171
|
-
*
|
|
7172
|
-
*
|
|
8037
|
+
*
|
|
8038
|
+
* @sample {highstock} stock/stocktools/stocktools-thresholds
|
|
8039
|
+
* Custom bindings
|
|
8040
|
+
* @sample {highcharts} highcharts/annotations/bindings/
|
|
8041
|
+
* Simple binding
|
|
8042
|
+
* @sample {highcharts} highcharts/annotations/bindings-custom-annotation/
|
|
8043
|
+
* Custom annotation binding
|
|
8044
|
+
*
|
|
7173
8045
|
* @since 7.0.0
|
|
8046
|
+
* @requires modules/annotations
|
|
7174
8047
|
* @product highcharts highstock
|
|
7175
8048
|
*/
|
|
7176
8049
|
bindings: {
|
|
@@ -7207,10 +8080,7 @@
|
|
|
7207
8080
|
},
|
|
7208
8081
|
r: 5
|
|
7209
8082
|
}]
|
|
7210
|
-
}, navigation
|
|
7211
|
-
.annotationsOptions, navigation
|
|
7212
|
-
.bindings
|
|
7213
|
-
.circleAnnotation
|
|
8083
|
+
}, navigation.annotationsOptions, navigation.bindings.circleAnnotation
|
|
7214
8084
|
.annotationsOptions));
|
|
7215
8085
|
},
|
|
7216
8086
|
/** @ignore-option */
|
|
@@ -7218,16 +8088,14 @@
|
|
|
7218
8088
|
function (e, annotation) {
|
|
7219
8089
|
var mockPointOpts = annotation.options.shapes[0]
|
|
7220
8090
|
.point,
|
|
7221
|
-
inverted = this.chart.inverted,
|
|
7222
|
-
x,
|
|
7223
|
-
y,
|
|
7224
8091
|
distance;
|
|
7225
8092
|
if (isNumber(mockPointOpts.xAxis) &&
|
|
7226
8093
|
isNumber(mockPointOpts.yAxis)) {
|
|
7227
|
-
|
|
7228
|
-
.
|
|
7229
|
-
|
|
7230
|
-
.
|
|
8094
|
+
var inverted = this.chart.inverted,
|
|
8095
|
+
x = this.chart.xAxis[mockPointOpts.xAxis]
|
|
8096
|
+
.toPixels(mockPointOpts.x),
|
|
8097
|
+
y = this.chart.yAxis[mockPointOpts.yAxis]
|
|
8098
|
+
.toPixels(mockPointOpts.y);
|
|
7231
8099
|
distance = Math.max(Math.sqrt(Math.pow(inverted ? y - e.chartX : x - e.chartX, 2) +
|
|
7232
8100
|
Math.pow(inverted ? x - e.chartY : y - e.chartY, 2)), 5);
|
|
7233
8101
|
}
|
|
@@ -7239,6 +8107,59 @@
|
|
|
7239
8107
|
}
|
|
7240
8108
|
]
|
|
7241
8109
|
},
|
|
8110
|
+
ellipseAnnotation: {
|
|
8111
|
+
className: 'highcharts-ellipse-annotation',
|
|
8112
|
+
start: function (e) {
|
|
8113
|
+
var coords = this.chart.pointer.getCoordinates(e),
|
|
8114
|
+
coordsX = this.utils.getAssignedAxis(coords.xAxis),
|
|
8115
|
+
coordsY = this.utils.getAssignedAxis(coords.yAxis),
|
|
8116
|
+
navigation = this.chart.options.navigation;
|
|
8117
|
+
if (!coordsX || !coordsY) {
|
|
8118
|
+
return;
|
|
8119
|
+
}
|
|
8120
|
+
return this.chart.addAnnotation(merge({
|
|
8121
|
+
langKey: 'ellipse',
|
|
8122
|
+
type: 'basicAnnotation',
|
|
8123
|
+
shapes: [
|
|
8124
|
+
{
|
|
8125
|
+
type: 'ellipse',
|
|
8126
|
+
xAxis: coordsX.axis.options.index,
|
|
8127
|
+
yAxis: coordsY.axis.options.index,
|
|
8128
|
+
points: [{
|
|
8129
|
+
x: coordsX.value,
|
|
8130
|
+
y: coordsY.value
|
|
8131
|
+
}, {
|
|
8132
|
+
x: coordsX.value,
|
|
8133
|
+
y: coordsY.value
|
|
8134
|
+
}],
|
|
8135
|
+
ry: 1
|
|
8136
|
+
}
|
|
8137
|
+
]
|
|
8138
|
+
}, navigation.annotationsOptions, navigation.bindings.ellipseAnnotation
|
|
8139
|
+
.annotationOptions));
|
|
8140
|
+
},
|
|
8141
|
+
steps: [
|
|
8142
|
+
function (e, annotation) {
|
|
8143
|
+
var target = annotation.shapes[0],
|
|
8144
|
+
position = target.getAbsolutePosition(target.points[1]);
|
|
8145
|
+
target.translatePoint(e.chartX - position.x, e.chartY - position.y, 1);
|
|
8146
|
+
target.redraw(false);
|
|
8147
|
+
},
|
|
8148
|
+
function (e, annotation) {
|
|
8149
|
+
var target = annotation.shapes[0],
|
|
8150
|
+
position = target.getAbsolutePosition(target.points[0]),
|
|
8151
|
+
position2 = target.getAbsolutePosition(target.points[1]),
|
|
8152
|
+
newR = target.getDistanceFromLine(position,
|
|
8153
|
+
position2,
|
|
8154
|
+
e.chartX,
|
|
8155
|
+
e.chartY),
|
|
8156
|
+
yAxis = target.getYAxis(),
|
|
8157
|
+
newRY = Math.abs(yAxis.toValue(0) - yAxis.toValue(newR));
|
|
8158
|
+
target.setYRadius(newRY);
|
|
8159
|
+
target.redraw(false);
|
|
8160
|
+
}
|
|
8161
|
+
]
|
|
8162
|
+
},
|
|
7242
8163
|
/**
|
|
7243
8164
|
* A rectangle annotation bindings. Includes `start` and one event
|
|
7244
8165
|
* in `steps` array.
|
|
@@ -7272,7 +8193,8 @@
|
|
|
7272
8193
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
7273
8194
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
7274
8195
|
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
7275
|
-
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y }
|
|
8196
|
+
{ xAxis: xAxis, yAxis: yAxis, x: x, y: y },
|
|
8197
|
+
{ command: 'Z' }
|
|
7276
8198
|
]
|
|
7277
8199
|
}]
|
|
7278
8200
|
}, navigation
|
|
@@ -7357,7 +8279,7 @@
|
|
|
7357
8279
|
* from a different server.
|
|
7358
8280
|
*
|
|
7359
8281
|
* @type {string}
|
|
7360
|
-
* @default https://code.highcharts.com/9.
|
|
8282
|
+
* @default https://code.highcharts.com/9.3.3/gfx/stock-icons/
|
|
7361
8283
|
* @since 7.1.3
|
|
7362
8284
|
* @apioption navigation.iconsURL
|
|
7363
8285
|
*/
|
|
@@ -7413,6 +8335,7 @@
|
|
|
7413
8335
|
* @extends annotations
|
|
7414
8336
|
* @exclude crookedLine, elliottWave, fibonacci, infinityLine,
|
|
7415
8337
|
* measure, pitchfork, tunnel, verticalLine, basicAnnotation
|
|
8338
|
+
* @requires modules/annotations
|
|
7416
8339
|
* @apioption navigation.annotationsOptions
|
|
7417
8340
|
*/
|
|
7418
8341
|
annotationsOptions: {
|
|
@@ -7439,28 +8362,29 @@
|
|
|
7439
8362
|
if (chart.navigationBindings &&
|
|
7440
8363
|
chart.navigationBindings.container &&
|
|
7441
8364
|
chart.navigationBindings.container[0]) {
|
|
7442
|
-
// Get the HTML element coresponding to the
|
|
7443
|
-
//
|
|
7444
|
-
var buttonNode = chart.navigationBindings.container[0]
|
|
8365
|
+
// Get the HTML element coresponding to the className taken
|
|
8366
|
+
// from StockToolsBindings.
|
|
8367
|
+
var buttonNode = chart.navigationBindings.container[0]
|
|
8368
|
+
.querySelectorAll('.' + key);
|
|
7445
8369
|
if (buttonNode) {
|
|
7446
8370
|
for (var i = 0; i < buttonNode.length; i++) {
|
|
7447
|
-
var button = buttonNode[i]
|
|
8371
|
+
var button = buttonNode[i],
|
|
8372
|
+
cls = button.className;
|
|
7448
8373
|
if (value.noDataState === 'normal') {
|
|
7449
|
-
// If button has noDataState: 'normal',
|
|
7450
|
-
//
|
|
7451
|
-
|
|
7452
|
-
if (button.className.indexOf(disabledClassName) !== -1) {
|
|
8374
|
+
// If button has noDataState: 'normal', and has
|
|
8375
|
+
// disabledClassName, remove this className.
|
|
8376
|
+
if (cls.indexOf(disabledClassName) !== -1) {
|
|
7453
8377
|
button.classList.remove(disabledClassName);
|
|
7454
8378
|
}
|
|
7455
8379
|
}
|
|
7456
8380
|
else if (!buttonsEnabled_1) {
|
|
7457
|
-
if (
|
|
8381
|
+
if (cls.indexOf(disabledClassName) === -1) {
|
|
7458
8382
|
button.className += ' ' + disabledClassName;
|
|
7459
8383
|
}
|
|
7460
8384
|
}
|
|
7461
8385
|
else {
|
|
7462
8386
|
// Enable all buttons by deleting the className.
|
|
7463
|
-
if (
|
|
8387
|
+
if (cls.indexOf(disabledClassName) !== -1) {
|
|
7464
8388
|
button.classList.remove(disabledClassName);
|
|
7465
8389
|
}
|
|
7466
8390
|
}
|
|
@@ -7476,7 +8400,7 @@
|
|
|
7476
8400
|
|
|
7477
8401
|
return NavigationBindings;
|
|
7478
8402
|
});
|
|
7479
|
-
_registerModule(_modules, 'Extensions/Annotations/Popup.js', [_modules['Core/Globals.js'], _modules['Extensions/Annotations/NavigationBindings.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']], function (H, NavigationBindings, D, Pointer, U) {
|
|
8403
|
+
_registerModule(_modules, 'Extensions/Annotations/Popup.js', [_modules['Core/Renderer/HTML/AST.js'], _modules['Core/Globals.js'], _modules['Extensions/Annotations/NavigationBindings.js'], _modules['Core/DefaultOptions.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']], function (AST, H, NavigationBindings, D, Pointer, U) {
|
|
7480
8404
|
/* *
|
|
7481
8405
|
*
|
|
7482
8406
|
* Popup generator for Stock tools
|
|
@@ -7497,20 +8421,34 @@
|
|
|
7497
8421
|
fireEvent = U.fireEvent,
|
|
7498
8422
|
isArray = U.isArray,
|
|
7499
8423
|
isObject = U.isObject,
|
|
7500
|
-
isString = U.isString,
|
|
7501
8424
|
objectEach = U.objectEach,
|
|
7502
8425
|
pick = U.pick,
|
|
7503
8426
|
stableSort = U.stableSort,
|
|
7504
8427
|
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';
|
|
8428
|
+
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';
|
|
8429
|
+
/**
|
|
8430
|
+
* Enum for properties which should have dropdown list.
|
|
8431
|
+
* @private
|
|
8432
|
+
*/
|
|
8433
|
+
var DropdownProperties;
|
|
8434
|
+
(function (DropdownProperties) {
|
|
8435
|
+
DropdownProperties[DropdownProperties["params.algorithm"] = 0] = "params.algorithm";
|
|
8436
|
+
DropdownProperties[DropdownProperties["params.average"] = 1] = "params.average";
|
|
8437
|
+
})(DropdownProperties || (DropdownProperties = {}));
|
|
8438
|
+
/**
|
|
8439
|
+
* List of available algorithms for the specific indicator.
|
|
8440
|
+
* @private
|
|
8441
|
+
*/
|
|
8442
|
+
var dropdownParameters = {
|
|
8443
|
+
'algorithm-pivotpoints': ['standard', 'fibonacci', 'camarilla'],
|
|
8444
|
+
'average-disparityindex': ['sma', 'ema', 'dema', 'tema', 'wma']
|
|
8445
|
+
};
|
|
7506
8446
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
7507
8447
|
// onContainerMouseDown blocks internal popup events, due to e.preventDefault.
|
|
7508
8448
|
// Related issue #4606
|
|
7509
8449
|
wrap(Pointer.prototype, 'onContainerMouseDown', function (proceed, e) {
|
|
7510
|
-
var popupClass = e.target && e.target.className;
|
|
7511
8450
|
// elements is not in popup
|
|
7512
|
-
if (!(
|
|
7513
|
-
popupClass.indexOf(PREFIX + 'popup-field') >= 0)) {
|
|
8451
|
+
if (!this.inClass(e.target, PREFIX + 'popup')) {
|
|
7514
8452
|
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
|
7515
8453
|
}
|
|
7516
8454
|
});
|
|
@@ -7531,7 +8469,22 @@
|
|
|
7531
8469
|
// create popup div
|
|
7532
8470
|
this.container = createElement(DIV, {
|
|
7533
8471
|
className: PREFIX + 'popup highcharts-no-tooltip'
|
|
7534
|
-
},
|
|
8472
|
+
}, void 0, parentDiv);
|
|
8473
|
+
addEvent(this.container, 'mousedown', function () {
|
|
8474
|
+
var activeAnnotation = chart &&
|
|
8475
|
+
chart.navigationBindings &&
|
|
8476
|
+
chart.navigationBindings.activeAnnotation;
|
|
8477
|
+
if (activeAnnotation) {
|
|
8478
|
+
activeAnnotation.cancelClick = true;
|
|
8479
|
+
var unbind_1 = addEvent(H.doc, 'click',
|
|
8480
|
+
function () {
|
|
8481
|
+
setTimeout(function () {
|
|
8482
|
+
activeAnnotation.cancelClick = false;
|
|
8483
|
+
}, 0);
|
|
8484
|
+
unbind_1();
|
|
8485
|
+
});
|
|
8486
|
+
}
|
|
8487
|
+
});
|
|
7535
8488
|
this.lang = this.getLangpack();
|
|
7536
8489
|
this.iconsURL = iconsURL;
|
|
7537
8490
|
// add close button
|
|
@@ -7548,7 +8501,7 @@
|
|
|
7548
8501
|
// create close popup btn
|
|
7549
8502
|
closeBtn = createElement(DIV, {
|
|
7550
8503
|
className: PREFIX + 'popup-close'
|
|
7551
|
-
},
|
|
8504
|
+
}, void 0, this.container);
|
|
7552
8505
|
closeBtn.style['background-image'] = 'url(' +
|
|
7553
8506
|
(iconsURL.match(/png|svg|jpeg|jpg|gif/ig) ?
|
|
7554
8507
|
iconsURL : iconsURL + 'close.svg') + ')';
|
|
@@ -7577,15 +8530,15 @@
|
|
|
7577
8530
|
// left column
|
|
7578
8531
|
lhsCol = createElement(DIV, {
|
|
7579
8532
|
className: PREFIX + 'popup-lhs-col'
|
|
7580
|
-
},
|
|
8533
|
+
}, void 0, container);
|
|
7581
8534
|
// right column
|
|
7582
8535
|
rhsCol = createElement(DIV, {
|
|
7583
8536
|
className: PREFIX + 'popup-rhs-col'
|
|
7584
|
-
},
|
|
8537
|
+
}, void 0, container);
|
|
7585
8538
|
// wrapper content
|
|
7586
8539
|
createElement(DIV, {
|
|
7587
8540
|
className: PREFIX + 'popup-rhs-col-wrapper'
|
|
7588
|
-
},
|
|
8541
|
+
}, void 0, rhsCol);
|
|
7589
8542
|
return {
|
|
7590
8543
|
lhsCol: lhsCol,
|
|
7591
8544
|
rhsCol: rhsCol
|
|
@@ -7593,34 +8546,43 @@
|
|
|
7593
8546
|
},
|
|
7594
8547
|
/**
|
|
7595
8548
|
* Create input with label.
|
|
8549
|
+
*
|
|
7596
8550
|
* @private
|
|
8551
|
+
*
|
|
7597
8552
|
* @param {string} option
|
|
7598
|
-
*
|
|
7599
|
-
*
|
|
7600
|
-
*
|
|
7601
|
-
*
|
|
7602
|
-
*
|
|
7603
|
-
* @param {
|
|
7604
|
-
*
|
|
7605
|
-
*
|
|
8553
|
+
* Chain of fields i.e params.styles.fontSize separeted by the dot.
|
|
8554
|
+
*
|
|
8555
|
+
* @param {string} indicatorType
|
|
8556
|
+
* Type of the indicator i.e. sma, ema...
|
|
8557
|
+
*
|
|
8558
|
+
* @param {HTMLDOMElement} parentDiv
|
|
8559
|
+
* HTML parent element.
|
|
8560
|
+
*
|
|
8561
|
+
* @param {Highcharts.InputAttributes} inputAttributes
|
|
8562
|
+
* Attributes of the input.
|
|
8563
|
+
*
|
|
8564
|
+
* @return {HTMLInputElement}
|
|
8565
|
+
* Return created input element.
|
|
7606
8566
|
*/
|
|
7607
|
-
addInput: function (option,
|
|
7608
|
-
var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX +
|
|
8567
|
+
addInput: function (option, indicatorType, parentDiv, inputAttributes) {
|
|
8568
|
+
var optionParamList = option.split('.'), optionName = optionParamList[optionParamList.length - 1], lang = this.lang, inputName = PREFIX + indicatorType + '-' + pick(inputAttributes.htmlFor, optionName);
|
|
8569
|
+
var input;
|
|
7609
8570
|
if (!inputName.match(indexFilter)) {
|
|
7610
8571
|
// add label
|
|
7611
8572
|
createElement(LABEL, {
|
|
7612
|
-
htmlFor: inputName
|
|
8573
|
+
htmlFor: inputName,
|
|
8574
|
+
className: inputAttributes.labelClassName
|
|
7613
8575
|
}, void 0, parentDiv).appendChild(doc.createTextNode(lang[optionName] || optionName));
|
|
7614
8576
|
}
|
|
7615
8577
|
// add input
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
8578
|
+
input = createElement(INPUT, {
|
|
8579
|
+
name: inputName,
|
|
8580
|
+
value: inputAttributes.value,
|
|
8581
|
+
type: inputAttributes.type,
|
|
8582
|
+
className: PREFIX + 'popup-field'
|
|
8583
|
+
}, void 0, parentDiv);
|
|
8584
|
+
input.setAttribute(PREFIX + 'data-name', option);
|
|
8585
|
+
return input;
|
|
7624
8586
|
},
|
|
7625
8587
|
/**
|
|
7626
8588
|
* Create button.
|
|
@@ -7638,38 +8600,44 @@
|
|
|
7638
8600
|
* @return {Highcharts.HTMLDOMElement}
|
|
7639
8601
|
* HTML button
|
|
7640
8602
|
*/
|
|
7641
|
-
addButton: function (parentDiv, label, type,
|
|
8603
|
+
addButton: function (parentDiv, label, type, fieldsDiv, callback) {
|
|
7642
8604
|
var _self = this,
|
|
7643
8605
|
closePopup = this.closePopup,
|
|
7644
8606
|
getFields = this.getFields,
|
|
7645
8607
|
button;
|
|
7646
8608
|
button = createElement(BUTTON, void 0, void 0, parentDiv);
|
|
7647
8609
|
button.appendChild(doc.createTextNode(label));
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
8610
|
+
if (callback) {
|
|
8611
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
8612
|
+
addEvent(button, eventName, function () {
|
|
8613
|
+
closePopup.call(_self);
|
|
8614
|
+
return callback(getFields(fieldsDiv, type));
|
|
8615
|
+
});
|
|
7652
8616
|
});
|
|
7653
|
-
}
|
|
8617
|
+
}
|
|
7654
8618
|
return button;
|
|
7655
8619
|
},
|
|
7656
8620
|
/**
|
|
7657
|
-
* Get values from all inputs and create JSON.
|
|
8621
|
+
* Get values from all inputs and selections then create JSON.
|
|
8622
|
+
*
|
|
7658
8623
|
* @private
|
|
7659
|
-
*
|
|
7660
|
-
* @param {
|
|
7661
|
-
*
|
|
8624
|
+
*
|
|
8625
|
+
* @param {Highcharts.HTMLDOMElement} parentDiv
|
|
8626
|
+
* The container where inputs and selections are created.
|
|
8627
|
+
*
|
|
8628
|
+
* @param {string} type
|
|
8629
|
+
* Type of the popup bookmark (add|edit|remove).
|
|
7662
8630
|
*/
|
|
7663
8631
|
getFields: function (parentDiv, type) {
|
|
7664
|
-
var inputList = parentDiv.querySelectorAll(
|
|
8632
|
+
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];
|
|
8633
|
+
var fieldsOutput;
|
|
7665
8634
|
fieldsOutput = {
|
|
7666
8635
|
actionType: type,
|
|
7667
|
-
linkedTo: linkedTo && linkedTo.getAttribute('value'),
|
|
8636
|
+
linkedTo: linkedTo && linkedTo.getAttribute('value') || '',
|
|
7668
8637
|
fields: {}
|
|
7669
8638
|
};
|
|
7670
|
-
|
|
7671
|
-
param = input.getAttribute(PREFIX + 'data-name');
|
|
7672
|
-
seriesId = input.getAttribute(PREFIX + 'data-series-id');
|
|
8639
|
+
inputList.forEach(function (input) {
|
|
8640
|
+
var param = input.getAttribute(PREFIX + 'data-name'), seriesId = input.getAttribute(PREFIX + 'data-series-id');
|
|
7673
8641
|
// params
|
|
7674
8642
|
if (seriesId) {
|
|
7675
8643
|
fieldsOutput.seriesId = input.value;
|
|
@@ -7682,8 +8650,18 @@
|
|
|
7682
8650
|
fieldsOutput.type = input.value;
|
|
7683
8651
|
}
|
|
7684
8652
|
});
|
|
8653
|
+
selectList.forEach(function (select) {
|
|
8654
|
+
var id = select.id;
|
|
8655
|
+
// Get inputs only for the parameters, not for series and volume.
|
|
8656
|
+
if (id !== PREFIX + 'select-series' &&
|
|
8657
|
+
id !== PREFIX + 'select-volume') {
|
|
8658
|
+
var parameter = id.split('highcharts-select-')[1];
|
|
8659
|
+
fieldsOutput.fields[parameter] = select.value;
|
|
8660
|
+
}
|
|
8661
|
+
});
|
|
7685
8662
|
if (volumeTo) {
|
|
7686
|
-
fieldsOutput.fields['params.volumeSeriesID'] = volumeTo
|
|
8663
|
+
fieldsOutput.fields['params.volumeSeriesID'] = volumeTo
|
|
8664
|
+
.getAttribute('value') || '';
|
|
7687
8665
|
}
|
|
7688
8666
|
return fieldsOutput;
|
|
7689
8667
|
},
|
|
@@ -7698,7 +8676,7 @@
|
|
|
7698
8676
|
.querySelectorAll('.' + PREFIX + 'popup-close')[0];
|
|
7699
8677
|
this.formType = void 0;
|
|
7700
8678
|
// reset content
|
|
7701
|
-
popupDiv.innerHTML =
|
|
8679
|
+
popupDiv.innerHTML = AST.emptyHTML;
|
|
7702
8680
|
// reset toolbar styles if exists
|
|
7703
8681
|
if (popupDiv.className.indexOf(toolbarClass) >= 0) {
|
|
7704
8682
|
popupDiv.classList.remove(toolbarClass);
|
|
@@ -7793,13 +8771,13 @@
|
|
|
7793
8771
|
// Basic shapes:
|
|
7794
8772
|
options.shapes && options.shapes[0].type)));
|
|
7795
8773
|
// add buttons
|
|
7796
|
-
button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove',
|
|
8774
|
+
button = this.addButton(popupDiv, lang.removeButton || 'remove', 'remove', popupDiv, callback);
|
|
7797
8775
|
button.className += ' ' + PREFIX + 'annotation-remove-button';
|
|
7798
8776
|
button.style['background-image'] = 'url(' +
|
|
7799
8777
|
this.iconsURL + 'destroy.svg)';
|
|
7800
|
-
button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', function () {
|
|
8778
|
+
button = this.addButton(popupDiv, lang.editButton || 'edit', 'edit', popupDiv, function () {
|
|
7801
8779
|
showForm.call(_self, 'annotation-edit', chart, options, callback);
|
|
7802
|
-
}
|
|
8780
|
+
});
|
|
7803
8781
|
button.className += ' ' + PREFIX + 'annotation-edit-button';
|
|
7804
8782
|
button.style['background-image'] = 'url(' +
|
|
7805
8783
|
this.iconsURL + 'edit.svg)';
|
|
@@ -7832,15 +8810,15 @@
|
|
|
7832
8810
|
lhsCol.appendChild(doc.createTextNode(lang[options.langKey] || options.langKey || ''));
|
|
7833
8811
|
// left column
|
|
7834
8812
|
lhsCol = createElement(DIV, {
|
|
7835
|
-
className: PREFIX + 'popup-lhs-col ' + PREFIX + 'popup-lhs-full'
|
|
7836
|
-
},
|
|
8813
|
+
className: (PREFIX + 'popup-lhs-col ' + PREFIX + 'popup-lhs-full')
|
|
8814
|
+
}, void 0, popupDiv);
|
|
7837
8815
|
bottomRow = createElement(DIV, {
|
|
7838
8816
|
className: PREFIX + 'popup-bottom-row'
|
|
7839
|
-
},
|
|
8817
|
+
}, void 0, popupDiv);
|
|
7840
8818
|
this.annotations.addFormFields.call(this, lhsCol, chart, '', options, [], true);
|
|
7841
8819
|
this.addButton(bottomRow, isInit ?
|
|
7842
8820
|
(lang.addButton || 'add') :
|
|
7843
|
-
(lang.saveButton || 'save'), isInit ? 'add' : 'save',
|
|
8821
|
+
(lang.saveButton || 'save'), isInit ? 'add' : 'save', popupDiv, callback);
|
|
7844
8822
|
},
|
|
7845
8823
|
/**
|
|
7846
8824
|
* Create annotation's form fields.
|
|
@@ -7913,6 +8891,10 @@
|
|
|
7913
8891
|
}, void 0, genInput[2]).appendChild(doc.createTextNode(genInput[1]));
|
|
7914
8892
|
}
|
|
7915
8893
|
else {
|
|
8894
|
+
genInput[4] = {
|
|
8895
|
+
value: genInput[4][0],
|
|
8896
|
+
type: genInput[4][1]
|
|
8897
|
+
};
|
|
7916
8898
|
addInput.apply(genInput[0], genInput.splice(1));
|
|
7917
8899
|
}
|
|
7918
8900
|
});
|
|
@@ -7940,138 +8922,435 @@
|
|
|
7940
8922
|
.querySelectorAll('.' + PREFIX + 'tab-item-content');
|
|
7941
8923
|
// ADD tab
|
|
7942
8924
|
this.addColsContainer(tabsContainers[0]);
|
|
8925
|
+
indicators.addSearchBox.call(this, chart, tabsContainers[0]);
|
|
7943
8926
|
indicators.addIndicatorList.call(this, chart, tabsContainers[0], 'add');
|
|
7944
8927
|
buttonParentDiv = tabsContainers[0]
|
|
7945
8928
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
|
|
7946
|
-
this.addButton(buttonParentDiv, lang.addButton || 'add', 'add',
|
|
8929
|
+
this.addButton(buttonParentDiv, lang.addButton || 'add', 'add', buttonParentDiv, callback);
|
|
7947
8930
|
// EDIT tab
|
|
7948
8931
|
this.addColsContainer(tabsContainers[1]);
|
|
7949
8932
|
indicators.addIndicatorList.call(this, chart, tabsContainers[1], 'edit');
|
|
7950
8933
|
buttonParentDiv = tabsContainers[1]
|
|
7951
8934
|
.querySelectorAll('.' + PREFIX + 'popup-rhs-col')[0];
|
|
7952
|
-
this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit',
|
|
7953
|
-
this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove',
|
|
8935
|
+
this.addButton(buttonParentDiv, lang.saveButton || 'save', 'edit', buttonParentDiv, callback);
|
|
8936
|
+
this.addButton(buttonParentDiv, lang.removeButton || 'remove', 'remove', buttonParentDiv, callback);
|
|
8937
|
+
},
|
|
8938
|
+
/**
|
|
8939
|
+
* Filter object of series which are not indicators.
|
|
8940
|
+
* If the filter string exists, check against it.
|
|
8941
|
+
*
|
|
8942
|
+
* @private
|
|
8943
|
+
*
|
|
8944
|
+
* @param {Highcharts.FilteredSeries} series
|
|
8945
|
+
* All series are available in the plotOptions.
|
|
8946
|
+
*
|
|
8947
|
+
* @param {string|undefined} filter
|
|
8948
|
+
* Applied filter string from the input.
|
|
8949
|
+
* For the first iteration, it's an empty string.
|
|
8950
|
+
*
|
|
8951
|
+
* @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
|
|
8952
|
+
* Returns array of filtered series based on filter string.
|
|
8953
|
+
*/
|
|
8954
|
+
filterSeries: function (series, filter) {
|
|
8955
|
+
var popup = this,
|
|
8956
|
+
indicators = popup.indicators,
|
|
8957
|
+
lang = popup.chart && popup.chart.options.lang,
|
|
8958
|
+
indicatorAliases = lang &&
|
|
8959
|
+
lang.navigation &&
|
|
8960
|
+
lang.navigation.popup &&
|
|
8961
|
+
lang.navigation.popup.indicatorAliases;
|
|
8962
|
+
var filteredSeriesArray = [],
|
|
8963
|
+
filteredSeries;
|
|
8964
|
+
objectEach(series, function (series, value) {
|
|
8965
|
+
var seriesOptions = series.options;
|
|
8966
|
+
// Allow only indicators.
|
|
8967
|
+
if (series.params || seriesOptions &&
|
|
8968
|
+
seriesOptions.params) {
|
|
8969
|
+
var _a = indicators.getNameType(series,
|
|
8970
|
+
value),
|
|
8971
|
+
indicatorFullName = _a.indicatorFullName,
|
|
8972
|
+
indicatorType = _a.indicatorType;
|
|
8973
|
+
if (filter) {
|
|
8974
|
+
// Replace invalid characters.
|
|
8975
|
+
var validFilter = filter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
8976
|
+
var regex = new RegExp(validFilter, 'i'),
|
|
8977
|
+
alias = indicatorAliases &&
|
|
8978
|
+
indicatorAliases[indicatorType] &&
|
|
8979
|
+
indicatorAliases[indicatorType].join(' ') || '';
|
|
8980
|
+
if (indicatorFullName.match(regex) ||
|
|
8981
|
+
alias.match(regex)) {
|
|
8982
|
+
filteredSeries = {
|
|
8983
|
+
indicatorFullName: indicatorFullName,
|
|
8984
|
+
indicatorType: indicatorType,
|
|
8985
|
+
series: series
|
|
8986
|
+
};
|
|
8987
|
+
filteredSeriesArray.push(filteredSeries);
|
|
8988
|
+
}
|
|
8989
|
+
}
|
|
8990
|
+
else {
|
|
8991
|
+
filteredSeries = {
|
|
8992
|
+
indicatorFullName: indicatorFullName,
|
|
8993
|
+
indicatorType: indicatorType,
|
|
8994
|
+
series: series
|
|
8995
|
+
};
|
|
8996
|
+
filteredSeriesArray.push(filteredSeries);
|
|
8997
|
+
}
|
|
8998
|
+
}
|
|
8999
|
+
});
|
|
9000
|
+
return filteredSeriesArray;
|
|
9001
|
+
},
|
|
9002
|
+
/**
|
|
9003
|
+
* Filter an array of series and map its names and types.
|
|
9004
|
+
*
|
|
9005
|
+
* @private
|
|
9006
|
+
*
|
|
9007
|
+
* @param {Highcharts.FilteredSeries} series
|
|
9008
|
+
* All series that are available in the plotOptions.
|
|
9009
|
+
*
|
|
9010
|
+
* @return {Array<Highcharts.FilteredSeries>} filteredSeriesArray
|
|
9011
|
+
* Returns array of filtered series based on filter string.
|
|
9012
|
+
*/
|
|
9013
|
+
filterSeriesArray: function (series) {
|
|
9014
|
+
var filteredSeriesArray = [],
|
|
9015
|
+
filteredSeries;
|
|
9016
|
+
// Allow only indicators.
|
|
9017
|
+
series.forEach(function (series) {
|
|
9018
|
+
var seriesOptions = series.options;
|
|
9019
|
+
if (series.is('sma')) {
|
|
9020
|
+
filteredSeries = {
|
|
9021
|
+
indicatorFullName: series.name,
|
|
9022
|
+
indicatorType: series.type,
|
|
9023
|
+
series: series
|
|
9024
|
+
};
|
|
9025
|
+
filteredSeriesArray.push(filteredSeries);
|
|
9026
|
+
}
|
|
9027
|
+
});
|
|
9028
|
+
return filteredSeriesArray;
|
|
7954
9029
|
},
|
|
7955
9030
|
/**
|
|
7956
9031
|
* Create HTML list of all indicators (ADD mode) or added indicators
|
|
7957
9032
|
* (EDIT mode).
|
|
9033
|
+
*
|
|
7958
9034
|
* @private
|
|
9035
|
+
*
|
|
9036
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9037
|
+
* The chart object.
|
|
9038
|
+
*
|
|
9039
|
+
* @param {string} [optionName]
|
|
9040
|
+
* Name of the option into which selection is being added.
|
|
9041
|
+
*
|
|
9042
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
9043
|
+
* HTML parent element.
|
|
9044
|
+
*
|
|
9045
|
+
* @param {string} listType
|
|
9046
|
+
* Type of list depending on the selected bookmark.
|
|
9047
|
+
* Might be 'add' or 'edit'.
|
|
9048
|
+
*
|
|
9049
|
+
* @param {string|undefined} filter
|
|
9050
|
+
* Applied filter string from the input.
|
|
9051
|
+
* For the first iteration, it's an empty string.
|
|
7959
9052
|
*/
|
|
7960
|
-
addIndicatorList: function (chart, parentDiv, listType) {
|
|
7961
|
-
var
|
|
9053
|
+
addIndicatorList: function (chart, parentDiv, listType, filter) {
|
|
9054
|
+
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
9055
|
chart.series : // EDIT mode
|
|
7963
|
-
chart.options.plotOptions // ADD mode
|
|
7964
|
-
)
|
|
7965
|
-
if (!chart) {
|
|
9056
|
+
chart.options.plotOptions || {} // ADD mode
|
|
9057
|
+
);
|
|
9058
|
+
if (!chart && series) {
|
|
7966
9059
|
return;
|
|
7967
9060
|
}
|
|
7968
|
-
|
|
9061
|
+
var rhsColWrapper,
|
|
9062
|
+
indicatorList,
|
|
9063
|
+
item,
|
|
9064
|
+
filteredSeriesArray = [];
|
|
9065
|
+
// Filter and sort the series.
|
|
9066
|
+
if (!isEdit && !isArray(series)) {
|
|
9067
|
+
// Apply filters only for the 'add' indicator list.
|
|
9068
|
+
filteredSeriesArray = indicators.filterSeries.call(this, series, filter);
|
|
9069
|
+
}
|
|
9070
|
+
else if (isArray(series)) {
|
|
9071
|
+
filteredSeriesArray = indicators.filterSeriesArray.call(this, series);
|
|
9072
|
+
}
|
|
9073
|
+
// Sort indicators alphabeticaly.
|
|
9074
|
+
stableSort(filteredSeriesArray, function (a, b) {
|
|
9075
|
+
var seriesAName = a.indicatorFullName.toLowerCase(),
|
|
9076
|
+
seriesBName = b.indicatorFullName.toLowerCase();
|
|
9077
|
+
return (seriesAName < seriesBName) ?
|
|
9078
|
+
-1 : (seriesAName > seriesBName) ? 1 : 0;
|
|
9079
|
+
});
|
|
9080
|
+
// If the list exists remove it from the DOM
|
|
9081
|
+
// in order to create a new one with different filters.
|
|
9082
|
+
if (lhsCol.children[1]) {
|
|
9083
|
+
lhsCol.children[1].remove();
|
|
9084
|
+
}
|
|
9085
|
+
// Create wrapper for list.
|
|
7969
9086
|
indicatorList = createElement(UL, {
|
|
7970
9087
|
className: PREFIX + 'indicator-list'
|
|
7971
|
-
},
|
|
7972
|
-
rhsColWrapper = rhsCol
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
});
|
|
9088
|
+
}, void 0, lhsCol);
|
|
9089
|
+
rhsColWrapper = rhsCol.querySelectorAll('.' + PREFIX + 'popup-rhs-col-wrapper')[0];
|
|
9090
|
+
filteredSeriesArray.forEach(function (seriesSet) {
|
|
9091
|
+
var indicatorFullName = seriesSet.indicatorFullName,
|
|
9092
|
+
indicatorType = seriesSet.indicatorType,
|
|
9093
|
+
series = seriesSet.series;
|
|
9094
|
+
item = createElement(LI, {
|
|
9095
|
+
className: PREFIX + 'indicator-list'
|
|
9096
|
+
}, void 0, indicatorList);
|
|
9097
|
+
item.appendChild(doc.createTextNode(indicatorFullName));
|
|
9098
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
9099
|
+
addEvent(item, eventName, function () {
|
|
9100
|
+
var button = rhsColWrapper.parentNode
|
|
9101
|
+
.children[1];
|
|
9102
|
+
addFormFields.call(popup, chart, series, indicatorType, rhsColWrapper);
|
|
9103
|
+
if (button) {
|
|
9104
|
+
button.style.display = 'block';
|
|
9105
|
+
}
|
|
9106
|
+
// add hidden input with series.id
|
|
9107
|
+
if (isEdit && series.options) {
|
|
9108
|
+
createElement(INPUT, {
|
|
9109
|
+
type: 'hidden',
|
|
9110
|
+
name: PREFIX + 'id-' + indicatorType,
|
|
9111
|
+
value: series.options.id
|
|
9112
|
+
}, void 0, rhsColWrapper).setAttribute(PREFIX + 'data-series-id', series.options.id);
|
|
9113
|
+
}
|
|
7998
9114
|
});
|
|
7999
|
-
}
|
|
9115
|
+
});
|
|
8000
9116
|
});
|
|
8001
9117
|
// select first item from the list
|
|
8002
9118
|
if (indicatorList.childNodes.length > 0) {
|
|
8003
9119
|
indicatorList.childNodes[0].click();
|
|
8004
9120
|
}
|
|
9121
|
+
else if (!isEdit) {
|
|
9122
|
+
AST.setElementHTML(rhsColWrapper.parentNode.children[0], lang.noFilterMatch || '');
|
|
9123
|
+
rhsColWrapper.parentNode.children[1]
|
|
9124
|
+
.style.display = 'none';
|
|
9125
|
+
}
|
|
9126
|
+
},
|
|
9127
|
+
/**
|
|
9128
|
+
* Add searchbox HTML element and its' label.
|
|
9129
|
+
*
|
|
9130
|
+
* @private
|
|
9131
|
+
*
|
|
9132
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9133
|
+
* The chart object.
|
|
9134
|
+
*
|
|
9135
|
+
* @param {HTMLDOMElement} parentDiv
|
|
9136
|
+
* HTML parent element.
|
|
9137
|
+
*/
|
|
9138
|
+
addSearchBox: function (chart, parentDiv) {
|
|
9139
|
+
var popup = this, lhsCol = parentDiv.querySelectorAll('.' + PREFIX + 'popup-lhs-col')[0], options = 'searchIndicators', inputAttributes = {
|
|
9140
|
+
value: '',
|
|
9141
|
+
type: 'text',
|
|
9142
|
+
htmlFor: 'search-indicators',
|
|
9143
|
+
labelClassName: 'highcharts-input-search-indicators-label'
|
|
9144
|
+
}, clearFilterText = this.lang.clearFilter, inputWrapper = createElement(DIV, {
|
|
9145
|
+
className: 'highcharts-input-wrapper'
|
|
9146
|
+
}, void 0, lhsCol);
|
|
9147
|
+
var handleInputChange = function (inputText) {
|
|
9148
|
+
// Apply some filters.
|
|
9149
|
+
popup.indicators.addIndicatorList.call(popup,
|
|
9150
|
+
chart,
|
|
9151
|
+
popup.container, 'add',
|
|
9152
|
+
inputText);
|
|
9153
|
+
};
|
|
9154
|
+
// Add input field with the label and button.
|
|
9155
|
+
var input = this.addInput(options,
|
|
9156
|
+
INPUT,
|
|
9157
|
+
inputWrapper,
|
|
9158
|
+
inputAttributes),
|
|
9159
|
+
button = createElement(A, {
|
|
9160
|
+
textContent: clearFilterText
|
|
9161
|
+
},
|
|
9162
|
+
void 0,
|
|
9163
|
+
inputWrapper);
|
|
9164
|
+
input.classList.add('highcharts-input-search-indicators');
|
|
9165
|
+
button.classList.add('clear-filter-button');
|
|
9166
|
+
// Add input change events.
|
|
9167
|
+
addEvent(input, 'input', function (e) {
|
|
9168
|
+
handleInputChange(this.value);
|
|
9169
|
+
// Show clear filter button.
|
|
9170
|
+
if (this.value.length) {
|
|
9171
|
+
button.style.display = 'inline-block';
|
|
9172
|
+
}
|
|
9173
|
+
else {
|
|
9174
|
+
button.style.display = 'none';
|
|
9175
|
+
}
|
|
9176
|
+
});
|
|
9177
|
+
// Add clear filter click event.
|
|
9178
|
+
['click', 'touchstart'].forEach(function (eventName) {
|
|
9179
|
+
addEvent(button, eventName, function () {
|
|
9180
|
+
// Clear the input.
|
|
9181
|
+
input.value = '';
|
|
9182
|
+
handleInputChange('');
|
|
9183
|
+
// Hide clear filter button- no longer nececary.
|
|
9184
|
+
button.style.display = 'none';
|
|
9185
|
+
});
|
|
9186
|
+
});
|
|
9187
|
+
},
|
|
9188
|
+
/**
|
|
9189
|
+
* Add selection HTML element and its' label.
|
|
9190
|
+
*
|
|
9191
|
+
* @private
|
|
9192
|
+
*
|
|
9193
|
+
* @param {string} indicatorType
|
|
9194
|
+
* Type of the indicator i.e. sma, ema...
|
|
9195
|
+
*
|
|
9196
|
+
* @param {string} [optionName]
|
|
9197
|
+
* Name of the option into which selection is being added.
|
|
9198
|
+
*
|
|
9199
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
9200
|
+
* HTML parent element.
|
|
9201
|
+
*/
|
|
9202
|
+
addSelection: function (indicatorType, optionName, parentDiv) {
|
|
9203
|
+
var optionParamList = optionName.split('.'),
|
|
9204
|
+
labelText = optionParamList[optionParamList.length - 1];
|
|
9205
|
+
var selectName = PREFIX + optionName + '-type-' + indicatorType,
|
|
9206
|
+
lang = this.lang,
|
|
9207
|
+
selectBox;
|
|
9208
|
+
// Add a label for the selection box.
|
|
9209
|
+
createElement(LABEL, {
|
|
9210
|
+
htmlFor: selectName
|
|
9211
|
+
}, null, parentDiv).appendChild(doc.createTextNode(lang[labelText] || optionName));
|
|
9212
|
+
// Create a selection box.
|
|
9213
|
+
selectBox = createElement(SELECT, {
|
|
9214
|
+
name: selectName,
|
|
9215
|
+
className: PREFIX + 'popup-field',
|
|
9216
|
+
id: PREFIX + 'select-' + optionName
|
|
9217
|
+
}, null, parentDiv);
|
|
9218
|
+
selectBox.setAttribute('id', PREFIX + 'select-' + optionName);
|
|
9219
|
+
return selectBox;
|
|
9220
|
+
},
|
|
9221
|
+
/**
|
|
9222
|
+
* Get and add selection options.
|
|
9223
|
+
*
|
|
9224
|
+
* @private
|
|
9225
|
+
*
|
|
9226
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9227
|
+
* The chart object.
|
|
9228
|
+
*
|
|
9229
|
+
* @param {string} [optionName]
|
|
9230
|
+
* Name of the option into which selection is being added.
|
|
9231
|
+
*
|
|
9232
|
+
* @param {HTMLSelectElement} [selectBox]
|
|
9233
|
+
* HTML select box element to which the options are being added.
|
|
9234
|
+
*
|
|
9235
|
+
* @param {string|undefined} indicatorType
|
|
9236
|
+
* Type of the indicator i.e. sma, ema...
|
|
9237
|
+
*
|
|
9238
|
+
* @param {string|undefined} parameterName
|
|
9239
|
+
* Name of the parameter which should be applied.
|
|
9240
|
+
*
|
|
9241
|
+
* @param {string|undefined} selectedOption
|
|
9242
|
+
* Default value in dropdown.
|
|
9243
|
+
*/
|
|
9244
|
+
addSelectionOptions: function (chart, optionName, selectBox, indicatorType, parameterName, selectedOption, currentSeries) {
|
|
9245
|
+
var popup = this;
|
|
9246
|
+
// Get and apply selection options for the possible series.
|
|
9247
|
+
if (optionName === 'series' || optionName === 'volume') {
|
|
9248
|
+
// List all series which have id - mandatory for indicator.
|
|
9249
|
+
chart.series.forEach(function (series) {
|
|
9250
|
+
var seriesOptions = series.options,
|
|
9251
|
+
seriesName = seriesOptions.name ||
|
|
9252
|
+
seriesOptions.params ?
|
|
9253
|
+
series.name :
|
|
9254
|
+
seriesOptions.id || '';
|
|
9255
|
+
if (seriesOptions.id !== PREFIX + 'navigator-series' &&
|
|
9256
|
+
seriesOptions.id !== (currentSeries &&
|
|
9257
|
+
currentSeries.options &&
|
|
9258
|
+
currentSeries.options.id)) {
|
|
9259
|
+
if (!defined(selectedOption) &&
|
|
9260
|
+
optionName === 'volume' &&
|
|
9261
|
+
series.type === 'column') {
|
|
9262
|
+
selectedOption = seriesOptions.id;
|
|
9263
|
+
}
|
|
9264
|
+
createElement(OPTION, {
|
|
9265
|
+
value: seriesOptions.id
|
|
9266
|
+
}, void 0, selectBox).appendChild(doc.createTextNode(seriesName));
|
|
9267
|
+
}
|
|
9268
|
+
});
|
|
9269
|
+
}
|
|
9270
|
+
else if (indicatorType && parameterName) {
|
|
9271
|
+
// Get and apply options for the possible parameters.
|
|
9272
|
+
var dropdownKey = parameterName + '-' + indicatorType,
|
|
9273
|
+
parameterOption = dropdownParameters[dropdownKey];
|
|
9274
|
+
parameterOption.forEach(function (element) {
|
|
9275
|
+
createElement(OPTION, {
|
|
9276
|
+
value: element
|
|
9277
|
+
}, void 0, selectBox).appendChild(doc.createTextNode(element));
|
|
9278
|
+
});
|
|
9279
|
+
}
|
|
9280
|
+
// Add the default dropdown value if defined.
|
|
9281
|
+
if (defined(selectedOption)) {
|
|
9282
|
+
selectBox.value = selectedOption;
|
|
9283
|
+
}
|
|
8005
9284
|
},
|
|
8006
9285
|
/**
|
|
8007
9286
|
* Extract full name and type of requested indicator.
|
|
9287
|
+
*
|
|
8008
9288
|
* @private
|
|
9289
|
+
*
|
|
8009
9290
|
* @param {Highcharts.Series} series
|
|
8010
|
-
* Series which name is needed
|
|
8011
|
-
*
|
|
8012
|
-
*
|
|
8013
|
-
* @
|
|
9291
|
+
* Series which name is needed(EDITmode - defaultOptions.series,
|
|
9292
|
+
* ADDmode - indicator series).
|
|
9293
|
+
*
|
|
9294
|
+
* @param {string} [indicatorType]
|
|
9295
|
+
* Type of the indicator i.e. sma, ema...
|
|
9296
|
+
*
|
|
9297
|
+
* @return {Highcharts.Dictionary<string>}
|
|
9298
|
+
* Full name and series type.
|
|
8014
9299
|
*/
|
|
8015
|
-
getNameType: function (series,
|
|
9300
|
+
getNameType: function (series, indicatorType) {
|
|
8016
9301
|
var options = series.options,
|
|
8017
|
-
seriesTypes = H.seriesTypes
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
seriesTypes[
|
|
8021
|
-
|
|
9302
|
+
seriesTypes = H.seriesTypes;
|
|
9303
|
+
// add mode
|
|
9304
|
+
var seriesName = (seriesTypes[indicatorType] &&
|
|
9305
|
+
seriesTypes[indicatorType].prototype.nameBase) ||
|
|
9306
|
+
indicatorType.toUpperCase(),
|
|
9307
|
+
seriesType = indicatorType;
|
|
8022
9308
|
// edit
|
|
8023
9309
|
if (options && options.type) {
|
|
8024
9310
|
seriesType = series.options.type;
|
|
8025
9311
|
seriesName = series.name;
|
|
8026
9312
|
}
|
|
8027
9313
|
return {
|
|
8028
|
-
|
|
8029
|
-
|
|
9314
|
+
indicatorFullName: seriesName,
|
|
9315
|
+
indicatorType: seriesType
|
|
8030
9316
|
};
|
|
8031
9317
|
},
|
|
8032
9318
|
/**
|
|
8033
|
-
*
|
|
8034
|
-
*
|
|
9319
|
+
* Create the selection box for the series,
|
|
9320
|
+
* add options and apply the default one.
|
|
9321
|
+
*
|
|
8035
9322
|
* @private
|
|
8036
|
-
*
|
|
8037
|
-
*
|
|
8038
|
-
*
|
|
8039
|
-
*
|
|
8040
|
-
* @param {
|
|
8041
|
-
*
|
|
8042
|
-
*
|
|
8043
|
-
*
|
|
8044
|
-
*
|
|
8045
|
-
*
|
|
9323
|
+
*
|
|
9324
|
+
* @param {string} indicatorType
|
|
9325
|
+
* Type of the indicator i.e. sma, ema...
|
|
9326
|
+
*
|
|
9327
|
+
* @param {string} [optionName]
|
|
9328
|
+
* Name of the option into which selection is being added.
|
|
9329
|
+
*
|
|
9330
|
+
* @param {Highcharts.AnnotationChart} chart
|
|
9331
|
+
* The chart object.
|
|
9332
|
+
*
|
|
9333
|
+
* @param {HTMLDOMElement} [parentDiv]
|
|
9334
|
+
* HTML parent element.
|
|
9335
|
+
*
|
|
9336
|
+
* @param {string|undefined} selectedOption
|
|
9337
|
+
* Default value in dropdown.
|
|
8046
9338
|
*/
|
|
8047
|
-
listAllSeries: function (
|
|
8048
|
-
var
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
seriesOptions;
|
|
9339
|
+
listAllSeries: function (indicatorType, optionName, chart, parentDiv, currentSeries, selectedOption) {
|
|
9340
|
+
var popup = this,
|
|
9341
|
+
indicators = popup.indicators;
|
|
9342
|
+
// Won't work without the chart.
|
|
8052
9343
|
if (!chart) {
|
|
8053
9344
|
return;
|
|
8054
9345
|
}
|
|
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
|
-
});
|
|
9346
|
+
// Add selection boxes.
|
|
9347
|
+
var selectBox = indicators.addSelection.call(popup,
|
|
9348
|
+
indicatorType,
|
|
9349
|
+
optionName,
|
|
9350
|
+
parentDiv);
|
|
9351
|
+
// Add possible dropdown options.
|
|
9352
|
+
indicators.addSelectionOptions.call(popup, chart, optionName, selectBox, void 0, void 0, void 0, currentSeries);
|
|
9353
|
+
// Add the default dropdown value if defined.
|
|
8075
9354
|
if (defined(selectedOption)) {
|
|
8076
9355
|
selectBox.value = selectedOption;
|
|
8077
9356
|
}
|
|
@@ -8096,21 +9375,21 @@
|
|
|
8096
9375
|
var fields = series.params || series.options.params,
|
|
8097
9376
|
getNameType = this.indicators.getNameType;
|
|
8098
9377
|
// reset current content
|
|
8099
|
-
rhsColWrapper.innerHTML =
|
|
9378
|
+
rhsColWrapper.innerHTML = AST.emptyHTML;
|
|
8100
9379
|
// create title (indicator name in the right column)
|
|
8101
9380
|
createElement(H3, {
|
|
8102
9381
|
className: PREFIX + 'indicator-title'
|
|
8103
|
-
}, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).
|
|
9382
|
+
}, void 0, rhsColWrapper).appendChild(doc.createTextNode(getNameType(series, seriesType).indicatorFullName));
|
|
8104
9383
|
// input type
|
|
8105
9384
|
createElement(INPUT, {
|
|
8106
9385
|
type: 'hidden',
|
|
8107
9386
|
name: PREFIX + 'type-' + seriesType,
|
|
8108
9387
|
value: seriesType
|
|
8109
|
-
},
|
|
9388
|
+
}, void 0, rhsColWrapper);
|
|
8110
9389
|
// list all series with id
|
|
8111
|
-
this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series.linkedParent &&
|
|
9390
|
+
this.indicators.listAllSeries.call(this, seriesType, 'series', chart, rhsColWrapper, series, series.linkedParent && series.linkedParent.options.id);
|
|
8112
9391
|
if (fields.volumeSeriesID) {
|
|
8113
|
-
this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series.linkedParent &&
|
|
9392
|
+
this.indicators.listAllSeries.call(this, seriesType, 'volume', chart, rhsColWrapper, series, series.linkedParent && fields.volumeSeriesID);
|
|
8114
9393
|
}
|
|
8115
9394
|
// add param fields
|
|
8116
9395
|
this.indicators.addParamInputs.call(this, chart, 'params', fields, seriesType, rhsColWrapper);
|
|
@@ -8132,8 +9411,9 @@
|
|
|
8132
9411
|
* Element where created HTML list is added
|
|
8133
9412
|
*/
|
|
8134
9413
|
addParamInputs: function (chart, parentNode, fields, type, parentDiv) {
|
|
8135
|
-
var
|
|
8136
|
-
|
|
9414
|
+
var popup = this,
|
|
9415
|
+
indicators = popup.indicators;
|
|
9416
|
+
var addParamInputs = this.indicators.addParamInputs,
|
|
8137
9417
|
addInput = this.addInput,
|
|
8138
9418
|
parentFullName;
|
|
8139
9419
|
if (!chart) {
|
|
@@ -8142,16 +9422,34 @@
|
|
|
8142
9422
|
objectEach(fields, function (value, fieldName) {
|
|
8143
9423
|
// create name like params.styles.fontSize
|
|
8144
9424
|
parentFullName = parentNode + '.' + fieldName;
|
|
8145
|
-
if (value
|
|
9425
|
+
if (defined(value) && // skip if field is unnecessary, #15362
|
|
9426
|
+
parentFullName) {
|
|
8146
9427
|
if (isObject(value)) {
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
9428
|
+
// (15733) 'Periods' has an arrayed value. Label must be
|
|
9429
|
+
// created here.
|
|
9430
|
+
addInput.call(popup, parentFullName, type, parentDiv, {});
|
|
9431
|
+
addParamInputs.call(popup, chart, parentFullName, value, type, parentDiv);
|
|
9432
|
+
}
|
|
9433
|
+
// If the option is listed in dropdown enum,
|
|
9434
|
+
// add the selection box for it.
|
|
9435
|
+
if (parentFullName in DropdownProperties) {
|
|
9436
|
+
// Add selection boxes.
|
|
9437
|
+
var selectBox = indicators.addSelection.call(popup,
|
|
9438
|
+
type,
|
|
9439
|
+
parentFullName,
|
|
9440
|
+
parentDiv);
|
|
9441
|
+
// Add possible dropdown options.
|
|
9442
|
+
indicators.addSelectionOptions.call(popup, chart, parentNode, selectBox, type, fieldName, value);
|
|
8150
9443
|
}
|
|
8151
9444
|
else if (
|
|
8152
|
-
//
|
|
8153
|
-
parentFullName !== 'params.volumeSeriesID'
|
|
8154
|
-
|
|
9445
|
+
// Skip volume field which is created by addFormFields.
|
|
9446
|
+
parentFullName !== 'params.volumeSeriesID' &&
|
|
9447
|
+
!isArray(value) // Skip params declared in array.
|
|
9448
|
+
) {
|
|
9449
|
+
addInput.call(popup, parentFullName, type, parentDiv, {
|
|
9450
|
+
value: value,
|
|
9451
|
+
type: 'text'
|
|
9452
|
+
} // all inputs are text type
|
|
8155
9453
|
);
|
|
8156
9454
|
}
|
|
8157
9455
|
}
|
|
@@ -8233,8 +9531,10 @@
|
|
|
8233
9531
|
addContentItem: function () {
|
|
8234
9532
|
var popupDiv = this.popup.container;
|
|
8235
9533
|
return createElement(DIV, {
|
|
8236
|
-
|
|
8237
|
-
|
|
9534
|
+
// #12100
|
|
9535
|
+
className: PREFIX + 'tab-item-content ' +
|
|
9536
|
+
PREFIX + 'no-mousewheel'
|
|
9537
|
+
}, void 0, popupDiv);
|
|
8238
9538
|
},
|
|
8239
9539
|
/**
|
|
8240
9540
|
* Add click event to each tab
|
|
@@ -8297,7 +9597,7 @@
|
|
|
8297
9597
|
this.popup = new H.Popup(this.chart.container, (this.chart.options.navigation.iconsURL ||
|
|
8298
9598
|
(this.chart.options.stockTools &&
|
|
8299
9599
|
this.chart.options.stockTools.gui.iconsURL) ||
|
|
8300
|
-
'https://code.highcharts.com/9.
|
|
9600
|
+
'https://code.highcharts.com/9.3.3/gfx/stock-icons/'), this.chart);
|
|
8301
9601
|
}
|
|
8302
9602
|
this.popup.showForm(config.formType, this.chart, config.options, config.onSubmit);
|
|
8303
9603
|
});
|