highcharts 8.1.0 → 8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/css/highcharts.css +12 -0
- package/css/highcharts.scss +12 -0
- package/css/themes/dark-unica.css +12 -0
- package/css/themes/grid-light.css +12 -0
- package/css/themes/sand-signika.css +12 -0
- package/es-modules/{modules/accessibility/a11y-i18n.js → Accessibility/A11yI18n.js} +2 -2
- package/es-modules/{modules/accessibility/accessibility.js → Accessibility/Accessibility.js} +24 -21
- package/es-modules/{modules/accessibility → Accessibility}/AccessibilityComponent.js +73 -17
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/AnnotationsA11y.js +2 -4
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/ContainerComponent.js +8 -9
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/InfoRegionsComponent.js +9 -12
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/LegendComponent.js +60 -22
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/MenuComponent.js +4 -11
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/RangeSelectorComponent.js +8 -7
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +171 -0
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/SeriesComponent/NewDataAnnouncer.js +8 -7
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/SeriesComponent/SeriesComponent.js +5 -5
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/SeriesComponent/SeriesDescriber.js +6 -6
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/SeriesComponent/SeriesKeyboardNavigation.js +22 -20
- package/es-modules/{modules/accessibility/components → Accessibility/Components}/ZoomComponent.js +9 -8
- package/es-modules/{modules/accessibility/focusBorder.js → Accessibility/FocusBorder.js} +13 -10
- package/es-modules/{modules/accessibility/high-contrast-mode.js → Accessibility/HighContrastMode.js} +3 -2
- package/es-modules/{modules/accessibility/high-contrast-theme.js → Accessibility/HighContrastTheme.js} +0 -0
- package/es-modules/{modules/accessibility → Accessibility}/KeyboardNavigation.js +35 -22
- package/es-modules/{modules/accessibility → Accessibility}/KeyboardNavigationHandler.js +1 -1
- package/es-modules/{modules/accessibility/options/deprecatedOptions.js → Accessibility/Options/DeprecatedOptions.js} +10 -20
- package/es-modules/{modules/accessibility/options/langOptions.js → Accessibility/Options/LangOptions.js} +1 -1
- package/es-modules/{modules/accessibility/options/options.js → Accessibility/Options/Options.js} +1 -2
- package/es-modules/{modules/accessibility/utils → Accessibility/Utils}/Announcer.js +2 -2
- package/es-modules/{modules/accessibility/utils/chartUtilities.js → Accessibility/Utils/ChartUtilities.js} +8 -9
- package/es-modules/{modules/accessibility/utils → Accessibility/Utils}/DOMElementProvider.js +5 -5
- package/es-modules/{modules/accessibility/utils → Accessibility/Utils}/EventProvider.js +2 -2
- package/es-modules/{modules/accessibility/utils/htmlUtilities.js → Accessibility/Utils/HTMLUtilities.js} +3 -4
- package/es-modules/Core/Animation/AnimationUtilities.js +193 -0
- package/es-modules/Core/Animation/Fx.js +378 -0
- package/es-modules/{parts → Core/Axis}/Axis.js +153 -89
- package/es-modules/{parts-3d → Core/Axis}/Axis3D.js +12 -7
- package/es-modules/{modules/broken-axis.src.js → Core/Axis/BrokenAxis.js} +6 -8
- package/es-modules/{parts-map → Core/Axis}/ColorAxis.js +28 -31
- package/es-modules/{parts → Core/Axis}/DateTimeAxis.js +1 -1
- package/es-modules/{parts-gantt → Core/Axis}/GridAxis.js +136 -39
- package/es-modules/{parts-more → Core/Axis}/HiddenAxis.js +0 -0
- package/es-modules/{parts → Core/Axis}/LogarithmicAxis.js +1 -1
- package/es-modules/{parts-map → Core/Axis}/MapAxis.js +2 -2
- package/es-modules/{parts → Core/Axis}/NavigatorAxis.js +2 -2
- package/es-modules/{parts → Core/Axis}/OrdinalAxis.js +241 -224
- package/es-modules/{parts → Core/Axis}/PlotLineOrBand.js +24 -15
- package/es-modules/{parts-more → Core/Axis}/RadialAxis.js +34 -27
- package/es-modules/{parts → Core/Axis}/ScrollbarAxis.js +2 -2
- package/es-modules/{parts → Core/Axis}/StackingAxis.js +11 -2
- package/es-modules/{parts → Core/Axis}/Tick.js +14 -14
- package/es-modules/{parts-3d → Core/Axis}/Tick3D.js +1 -1
- package/es-modules/{parts-gantt → Core/Axis}/TreeGridAxis.js +81 -15
- package/es-modules/{parts-gantt → Core/Axis}/TreeGridTick.js +1 -1
- package/es-modules/{parts-3d → Core/Axis}/ZAxis.js +2 -2
- package/es-modules/{parts → Core/Chart}/Chart.js +225 -227
- package/es-modules/Core/Chart/Chart3D.js +1674 -0
- package/es-modules/{parts-gantt → Core/Chart}/GanttChart.js +13 -12
- package/es-modules/{parts → Core/Chart}/StockChart.js +26 -25
- package/es-modules/Core/Color/Color.js +419 -0
- package/es-modules/Core/Color/ColorType.js +9 -0
- package/es-modules/{parts → Core}/Color.js +1 -1
- package/es-modules/{parts → Core}/Dynamics.js +91 -61
- package/es-modules/{parts → Core}/Globals.js +9 -1
- package/es-modules/{parts → Core}/Interaction.js +27 -20
- package/es-modules/{parts → Core}/Legend.js +26 -11
- package/es-modules/{parts → Core}/MSPointer.js +2 -2
- package/es-modules/{parts → Core}/Navigator.js +24 -14
- package/es-modules/{parts → Core}/Options.js +157 -69
- package/es-modules/{parts → Core}/Pointer.js +50 -27
- package/es-modules/Core/Renderer/DOMElementType.js +9 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +220 -0
- package/es-modules/{parts/Html.js → Core/Renderer/HTML/HTMLRenderer.js} +16 -207
- package/es-modules/{parts → Core/Renderer/SVG}/SVGElement.js +186 -32
- package/es-modules/Core/Renderer/SVG/SVGLabel.js +410 -0
- package/es-modules/{parts/SvgRenderer.js → Core/Renderer/SVG/SVGRenderer.js} +426 -886
- package/es-modules/{parts-3d/SVGRenderer.js → Core/Renderer/SVG/SVGRenderer3D.js} +31 -23
- package/es-modules/{parts → Core}/Responsive.js +24 -14
- package/es-modules/{parts → Core}/Scrollbar.js +5 -4
- package/es-modules/Core/Series/BaseSeries.js +157 -0
- package/es-modules/{parts/Series.js → Core/Series/CartesianSeries.js} +119 -55
- package/es-modules/{parts → Core/Series}/DataLabels.js +40 -36
- package/es-modules/{parts → Core/Series}/Point.js +8 -10
- package/es-modules/Core/Series/Series.js +158 -0
- package/es-modules/{parts-3d/Series.js → Core/Series/Series3D.js} +5 -3
- package/es-modules/{parts → Core}/Time.js +11 -133
- package/es-modules/{parts → Core}/Tooltip.js +30 -27
- package/es-modules/{parts → Core}/Utilities.js +103 -562
- package/es-modules/{mixins/ajax.js → Extensions/Ajax.js} +9 -4
- package/es-modules/{annotations/annotations.src.js → Extensions/Annotations/Annotations.js} +901 -709
- package/es-modules/{annotations → Extensions/Annotations}/ControlPoint.js +2 -2
- package/es-modules/Extensions/Annotations/Controllables/ControllableCircle.js +117 -0
- package/es-modules/Extensions/Annotations/Controllables/ControllableImage.js +111 -0
- package/es-modules/{annotations/controllable → Extensions/Annotations/Controllables}/ControllableLabel.js +186 -146
- package/es-modules/{annotations/controllable → Extensions/Annotations/Controllables}/ControllablePath.js +81 -42
- package/es-modules/Extensions/Annotations/Controllables/ControllableRect.js +121 -0
- package/es-modules/{annotations/controllable/controllableMixin.js → Extensions/Annotations/Mixins/ControllableMixin.js} +8 -9
- package/es-modules/{annotations/eventEmitterMixin.js → Extensions/Annotations/Mixins/EventEmitterMixin.js} +7 -7
- package/es-modules/{annotations/controllable/markerMixin.js → Extensions/Annotations/Mixins/MarkerMixin.js} +10 -8
- package/es-modules/{annotations → Extensions/Annotations}/MockPoint.js +6 -6
- package/es-modules/{annotations/navigationBindings.js → Extensions/Annotations/NavigationBindings.js} +27 -16
- package/es-modules/{annotations/popup.js → Extensions/Annotations/Popup.js} +9 -9
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/BasicAnnotation.js +68 -20
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/CrookedLine.js +46 -19
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/ElliottWave.js +33 -12
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/Fibonacci.js +54 -22
- package/es-modules/Extensions/Annotations/Types/InfinityLine.js +147 -0
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/Measure.js +82 -52
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/Pitchfork.js +69 -32
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/Tunnel.js +58 -30
- package/es-modules/{annotations/types → Extensions/Annotations/Types}/VerticalLine.js +64 -33
- package/es-modules/{parts-gantt → Extensions}/ArrowSymbols.js +9 -11
- package/es-modules/{modules/boost/boost.js → Extensions/Boost/Boost.js} +8 -8
- package/es-modules/{modules/boost/boost-attach.js → Extensions/Boost/BoostAttach.js} +10 -8
- package/es-modules/{modules/boost/boost-init.js → Extensions/Boost/BoostInit.js} +7 -6
- package/es-modules/{modules/boost/boost-options.js → Extensions/Boost/BoostOptions.js} +1 -1
- package/es-modules/{modules/boost/boost-overrides.js → Extensions/Boost/BoostOverrides.js} +14 -11
- package/es-modules/{modules/boost/boost-utils.js → Extensions/Boost/BoostUtils.js} +6 -6
- package/es-modules/{modules/boost/boostable-map.js → Extensions/Boost/BoostableMap.js} +1 -1
- package/es-modules/{modules/boost/boostables.js → Extensions/Boost/Boostables.js} +0 -0
- package/es-modules/{modules/boost/named-colors.js → Extensions/Boost/NamedColors.js} +1 -1
- package/es-modules/{modules/boost/wgl-renderer.js → Extensions/Boost/WGLRenderer.js} +9 -9
- package/es-modules/{modules/boost/wgl-shader.js → Extensions/Boost/WGLShader.js} +3 -4
- package/es-modules/{modules/boost/wgl-vbuffer.js → Extensions/Boost/WGLVBuffer.js} +0 -0
- package/es-modules/{modules/boost-canvas.src.js → Extensions/BoostCanvas.js} +13 -9
- package/es-modules/{parts-gantt/CurrentDateIndicator.js → Extensions/CurrentDateIndication.js} +5 -7
- package/es-modules/{modules/data.src.js → Extensions/Data.js} +14 -16
- package/es-modules/{parts → Extensions}/DataGrouping.js +12 -9
- package/es-modules/{modules/debugger.src.js → Extensions/Debugger.js} +6 -6
- package/es-modules/{mixins/download-url.js → Extensions/DownloadURL.js} +15 -7
- package/es-modules/{modules/drag-panes.src.js → Extensions/DragPanes.js} +6 -6
- package/es-modules/{modules/draggable-points.src.js → Extensions/DraggablePoints.js} +21 -32
- package/es-modules/{modules/drilldown.src.js → Extensions/Drilldown.js} +64 -43
- package/es-modules/{modules/export-data.src.js → Extensions/ExportData.js} +126 -26
- package/es-modules/{modules/exporting.src.js → Extensions/Exporting.js} +26 -12
- package/es-modules/{modules/full-screen.src.js → Extensions/FullScreen.js} +5 -3
- package/es-modules/{parts-map → Extensions}/GeoJSON.js +112 -7
- package/es-modules/{modules/marker-clusters.src.js → Extensions/MarkerClusters.js} +29 -39
- package/es-modules/{parts-3d/Math.js → Extensions/Math3D.js} +17 -9
- package/es-modules/{modules/no-data-to-display.src.js → Extensions/NoDataToDisplay.js} +14 -15
- package/es-modules/{modules/offline-exporting.src.js → Extensions/OfflineExporting.js} +39 -35
- package/es-modules/{modules/oldie.src.js → Extensions/Oldie/Oldie.js} +19 -12
- package/es-modules/{parts-3d → Extensions/Oldie}/VMLAxis3D.js +1 -1
- package/es-modules/Extensions/Oldie/VMLRenderer3D.js +46 -0
- package/es-modules/{modules/oldie-polyfills.src.js → Extensions/OldiePolyfills.js} +5 -0
- package/es-modules/{modules/overlapping-datalabels.src.js → Extensions/OverlappingDataLabels.js} +14 -13
- package/es-modules/{parts-more → Extensions}/Pane.js +13 -12
- package/es-modules/{modules/parallel-coordinates.src.js → Extensions/ParallelCoordinates.js} +140 -138
- package/es-modules/{modules/pattern-fill.src.js → Extensions/PatternFill.js} +23 -15
- package/es-modules/{parts-more → Extensions}/Polar.js +15 -12
- package/es-modules/{modules/price-indicator.src.js → Extensions/PriceIndication.js} +5 -3
- package/es-modules/{parts → Extensions}/RangeSelector.js +112 -79
- package/es-modules/{parts → Extensions}/ScrollablePlotArea.js +19 -9
- package/es-modules/{modules/series-label.src.js → Extensions/SeriesLabel.js} +14 -10
- package/es-modules/{modules/sonification/chartSonify.js → Extensions/Sonification/ChartSonify.js} +212 -41
- package/es-modules/{modules/sonification → Extensions/Sonification}/Earcon.js +3 -7
- package/es-modules/{modules/sonification → Extensions/Sonification}/Instrument.js +35 -11
- package/es-modules/{modules/sonification/instrumentDefinitions.js → Extensions/Sonification/InstrumentDefinitions.js} +1 -1
- package/es-modules/{modules/sonification/musicalFrequencies.js → Extensions/Sonification/MusicalFrequencies.js} +0 -0
- package/es-modules/Extensions/Sonification/Options.js +34 -0
- package/es-modules/{modules/sonification/pointSonify.js → Extensions/Sonification/PointSonify.js} +43 -28
- package/es-modules/{modules/sonification/sonification.js → Extensions/Sonification/Sonification.js} +16 -12
- package/es-modules/{modules/sonification → Extensions/Sonification}/Timeline.js +25 -6
- package/es-modules/{modules/sonification/utilities.js → Extensions/Sonification/Utilities.js} +8 -5
- package/es-modules/{parts → Extensions}/Stacking.js +57 -18
- package/es-modules/{modules/static-scale.src.js → Extensions/StaticScale.js} +4 -4
- package/es-modules/{themes/avocado.js → Extensions/Themes/Avocado.js} +5 -4
- package/es-modules/{themes/dark-blue.js → Extensions/Themes/DarkBlue.js} +4 -2
- package/es-modules/{themes/dark-green.js → Extensions/Themes/DarkGreen.js} +4 -2
- package/es-modules/{themes/dark-unica.js → Extensions/Themes/DarkUnica.js} +6 -6
- package/es-modules/{themes/gray.js → Extensions/Themes/Gray.js} +5 -4
- package/es-modules/{themes/grid.js → Extensions/Themes/Grid.js} +4 -2
- package/es-modules/{themes/grid-light.js → Extensions/Themes/GridLight.js} +4 -2
- package/es-modules/{themes/high-contrast-dark.js → Extensions/Themes/HighContrastDark.js} +5 -4
- package/es-modules/{themes/high-contrast-light.js → Extensions/Themes/HighContrastLight.js} +4 -2
- package/es-modules/{themes/sand-signika.js → Extensions/Themes/SandSignika.js} +4 -2
- package/es-modules/{themes/skies.js → Extensions/Themes/Skies.js} +5 -3
- package/es-modules/{themes/sunset.js → Extensions/Themes/Sunset.js} +5 -4
- package/es-modules/{parts-gantt/Pathfinder.js → Gantt/Connection.js} +41 -284
- package/es-modules/Gantt/Pathfinder.js +816 -0
- package/es-modules/Gantt/PathfinderAlgorithms.js +659 -0
- package/es-modules/{parts-gantt → Gantt}/Tree.js +1 -1
- package/es-modules/{parts-map → Maps}/Map.js +24 -15
- package/es-modules/{parts-map → Maps}/MapNavigation.js +4 -5
- package/es-modules/{parts-map → Maps}/MapPointer.js +2 -4
- package/es-modules/{mixins/centered-series.js → Mixins/CenteredSeries.js} +7 -5
- package/es-modules/{parts-map/ColorMapSeriesMixin.js → Mixins/ColorMapSeries.js} +10 -6
- package/es-modules/{parts-map/ColorSeriesMixin.js → Mixins/ColorSeries.js} +12 -4
- package/es-modules/{mixins/derived-series.js → Mixins/DerivedSeries.js} +3 -3
- package/es-modules/{mixins/draw-point.js → Mixins/DrawPoint.js} +6 -1
- package/es-modules/{mixins/geometry.js → Mixins/Geometry.js} +0 -0
- package/es-modules/{mixins/geometry-circles.js → Mixins/GeometryCircles.js} +2 -2
- package/es-modules/{mixins/indicator-required.js → Mixins/IndicatorRequired.js} +1 -1
- package/es-modules/{mixins/legend-symbol.js → Mixins/LegendSymbol.js} +6 -10
- package/es-modules/{mixins/multipe-lines.js → Mixins/MultipleLines.js} +2 -2
- package/es-modules/{mixins/navigation.js → Mixins/Navigation.js} +0 -0
- package/es-modules/{mixins/nelder-mead.js → Mixins/NelderMead.js} +2 -2
- package/es-modules/{mixins/nodes.js → Mixins/Nodes.js} +7 -5
- package/es-modules/{mixins/on-series.js → Mixins/OnSeries.js} +3 -2
- package/es-modules/{mixins/polygon.js → Mixins/Polygon.js} +2 -2
- package/es-modules/{mixins/reduce-array.js → Mixins/ReduceArray.js} +1 -1
- package/es-modules/{mixins/tree-series.js → Mixins/TreeSeries.js} +2 -2
- package/es-modules/{parts-more → Series}/AreaRangeSeries.js +75 -38
- package/es-modules/{parts → Series}/AreaSeries.js +43 -25
- package/es-modules/{parts-more → Series}/AreaSplineRangeSeries.js +47 -10
- package/es-modules/{parts → Series}/AreaSplineSeries.js +49 -10
- package/es-modules/{parts → Series}/BarSeries.js +2 -5
- package/es-modules/{modules/bellcurve.src.js → Series/BellcurveSeries.js} +47 -7
- package/es-modules/{parts-more → Series}/BoxPlotSeries.js +18 -13
- package/es-modules/{parts-more → Series/Bubble}/BubbleLegend.js +11 -9
- package/es-modules/{parts-more → Series/Bubble}/BubbleSeries.js +25 -27
- package/es-modules/{modules/bullet.src.js → Series/BulletSeries.js} +9 -8
- package/es-modules/{parts → Series}/CandlestickSeries.js +11 -8
- package/es-modules/{parts-3d/Column.js → Series/Column3DSeries.js} +108 -28
- package/es-modules/{parts-more → Series}/ColumnPyramidSeries.js +9 -9
- package/es-modules/{parts-more → Series}/ColumnRangeSeries.js +21 -18
- package/es-modules/{parts → Series}/ColumnSeries.js +119 -41
- package/es-modules/{modules/cylinder.src.js → Series/CylinderSeries.js} +14 -14
- package/es-modules/{modules/dependency-wheel.src.js → Series/DependencyWheelSeries.js} +14 -12
- package/es-modules/{modules/dotplot.src.js → Series/DotplotSeries.js} +7 -15
- package/es-modules/{modules/dumbbell.src.js → Series/DumbbellSeries.js} +16 -10
- package/es-modules/{parts-more → Series}/ErrorBarSeries.js +8 -8
- package/es-modules/{parts → Series}/FlagsSeries.js +18 -12
- package/es-modules/{modules/funnel3d.src.js → Series/Funnel3DSeries.js} +14 -16
- package/es-modules/{modules/funnel.src.js → Series/FunnelSeries.js} +16 -14
- package/es-modules/{parts-gantt → Series}/GanttSeries.js +21 -20
- package/es-modules/{parts-more → Series}/GaugeSeries.js +14 -12
- package/es-modules/{parts-map → Series}/HeatmapSeries.js +23 -16
- package/es-modules/{modules/histogram.src.js → Series/HistogramSeries.js} +13 -9
- package/es-modules/{modules/item-series.src.js → Series/ItemSeries.js} +22 -14
- package/es-modules/Series/LineSeries.js +13 -0
- package/es-modules/{modules/lollipop.src.js → Series/LollipopSeries.js} +34 -10
- package/es-modules/{parts-map → Series}/MapBubbleSeries.js +8 -9
- package/es-modules/{parts-map → Series}/MapLineSeries.js +5 -7
- package/es-modules/{parts-map → Series}/MapPointSeries.js +9 -8
- package/es-modules/{parts-map → Series}/MapSeries.js +22 -18
- package/es-modules/{modules/networkgraph/draggable-nodes.js → Series/Networkgraph/DraggableNodes.js} +15 -30
- package/es-modules/{modules/networkgraph/integrations.js → Series/Networkgraph/Integrations.js} +1 -1
- package/es-modules/{modules/networkgraph/layouts.js → Series/Networkgraph/Layouts.js} +43 -13
- package/es-modules/{modules/networkgraph/networkgraph.src.js → Series/Networkgraph/Networkgraph.js} +29 -23
- package/es-modules/{modules/networkgraph → Series/Networkgraph}/QuadTree.js +2 -2
- package/es-modules/{parts → Series}/OHLCSeries.js +5 -7
- package/es-modules/{modules/organization.src.js → Series/OrganizationSeries.js} +10 -7
- package/es-modules/{parts-more → Series}/PackedBubbleSeries.js +104 -28
- package/es-modules/{modules/pareto.src.js → Series/ParetoSeries.js} +10 -9
- package/es-modules/{parts-3d/Pie.js → Series/Pie3DSeries.js} +5 -4
- package/es-modules/{parts → Series}/PieSeries.js +66 -31
- package/es-modules/{parts-more → Series}/PolygonSeries.js +13 -13
- package/es-modules/{modules/pyramid3d.src.js → Series/Pyramid3DSeries.js} +5 -7
- package/es-modules/{modules/sankey.src.js → Series/SankeySeries.js} +23 -21
- package/es-modules/{parts-3d/Scatter.js → Series/Scatter3DSeries.js} +10 -9
- package/es-modules/{parts → Series}/ScatterSeries.js +15 -10
- package/es-modules/{modules/solid-gauge.src.js → Series/SolidGaugeSeries.js} +112 -78
- package/es-modules/{parts → Series}/SplineSeries.js +9 -7
- package/es-modules/{modules/streamgraph.src.js → Series/StreamgraphSeries.js} +42 -6
- package/es-modules/{modules/sunburst.src.js → Series/SunburstSeries.js} +20 -13
- package/es-modules/{modules/tilemap.src.js → Series/TilemapSeries.js} +12 -9
- package/es-modules/{modules/timeline.src.js → Series/TimelineSeries.js} +16 -11
- package/es-modules/{modules/treemap.src.js → Series/TreemapSeries.js} +47 -40
- package/es-modules/{modules/variable-pie.src.js → Series/VariablePieSeries.js} +11 -8
- package/es-modules/{modules/variwide.src.js → Series/VariwideSeries.js} +12 -10
- package/es-modules/{modules/vector.src.js → Series/VectorSeries.js} +11 -7
- package/es-modules/{modules/venn.src.js → Series/VennSeries.js} +29 -20
- package/es-modules/{parts-more → Series}/WaterfallSeries.js +145 -66
- package/es-modules/{modules/windbarb.src.js → Series/WindbarbSeries.js} +13 -9
- package/es-modules/{modules/wordcloud.src.js → Series/WordcloudSeries.js} +17 -13
- package/es-modules/{modules/xrange.src.js → Series/XRangeSeries.js} +16 -12
- package/es-modules/{indicators/acceleration-bands.src.js → Stock/Indicators/ABIndicator.js} +8 -8
- package/es-modules/{indicators/accumulation-distribution.src.js → Stock/Indicators/ADIndicator.js} +5 -4
- package/es-modules/{indicators/ao.src.js → Stock/Indicators/AOIndicator.js} +6 -5
- package/es-modules/{indicators/apo.src.js → Stock/Indicators/APOIndicator.js} +8 -8
- package/es-modules/{indicators/atr.src.js → Stock/Indicators/ATRIndicator.js} +6 -6
- package/es-modules/{indicators/aroon.src.js → Stock/Indicators/AroonIndicator.js} +7 -6
- package/es-modules/{indicators/aroon-oscillator.src.js → Stock/Indicators/AroonOscillatorIndicator.js} +8 -8
- package/es-modules/{indicators/bollinger-bands.src.js → Stock/Indicators/BBIndicator.js} +8 -8
- package/es-modules/{indicators/cci.src.js → Stock/Indicators/CCIIndicator.js} +5 -4
- package/es-modules/{indicators/cmf.src.js → Stock/Indicators/CMFIndicator.js} +3 -4
- package/es-modules/{indicators/chaikin.src.js → Stock/Indicators/ChaikinIndicator.js} +10 -9
- package/es-modules/{indicators/dema.src.js → Stock/Indicators/DEMAIndicator.js} +8 -8
- package/es-modules/{indicators/dpo.src.js → Stock/Indicators/DPOIndicator.js} +5 -4
- package/es-modules/{indicators/ema.src.js → Stock/Indicators/EMAIndicator.js} +4 -4
- package/es-modules/{indicators/ichimoku-kinko-hyo.src.js → Stock/Indicators/IKHIndicator.js} +23 -20
- package/es-modules/{indicators/keltner-channels.src.js → Stock/Indicators/KeltnerChannelsIndicator.js} +11 -8
- package/es-modules/{indicators/macd.src.js → Stock/Indicators/MACDIndicator.js} +9 -6
- package/es-modules/{indicators/mfi.src.js → Stock/Indicators/MFIIndicator.js} +5 -4
- package/es-modules/{indicators/momentum.src.js → Stock/Indicators/MomentumIndicator.js} +5 -4
- package/es-modules/{indicators/natr.src.js → Stock/Indicators/NATRIndicator.js} +4 -6
- package/es-modules/{indicators/price-channel.src.js → Stock/Indicators/PCIndicator.js} +9 -8
- package/es-modules/{indicators/ppo.src.js → Stock/Indicators/PPOIndicator.js} +8 -8
- package/es-modules/{indicators/psar.src.js → Stock/Indicators/PSARIndicator.js} +3 -4
- package/es-modules/{indicators/pivot-points.src.js → Stock/Indicators/PivotPointsIndicator.js} +6 -6
- package/es-modules/{indicators/price-envelopes.src.js → Stock/Indicators/PriceEnvelopesIndicator.js} +6 -6
- package/es-modules/{indicators/roc.src.js → Stock/Indicators/ROCIndicator.js} +5 -4
- package/es-modules/{indicators/rsi.src.js → Stock/Indicators/RSIIndicator.js} +5 -4
- package/es-modules/{indicators/regressions.src.js → Stock/Indicators/RegressionIndicators.js} +8 -7
- package/es-modules/{indicators/indicators.src.js → Stock/Indicators/SMAIndicator.js} +12 -8
- package/es-modules/{indicators/slow-stochastic.src.js → Stock/Indicators/SlowStochasticIndicator.js} +6 -8
- package/es-modules/{indicators/stochastic.src.js → Stock/Indicators/StochasticIndicator.js} +9 -9
- package/es-modules/{indicators/supertrend.src.js → Stock/Indicators/SupertrendIndicator.js} +8 -7
- package/es-modules/{indicators/tema.src.js → Stock/Indicators/TEMAIndicator.js} +8 -8
- package/es-modules/{indicators/trix.src.js → Stock/Indicators/TRIXIndicator.js} +8 -8
- package/es-modules/{indicators/trendline.src.js → Stock/Indicators/TrendLineIndicator.js} +5 -4
- package/es-modules/{indicators/volume-by-price.src.js → Stock/Indicators/VBPIndicator.js} +10 -7
- package/es-modules/{indicators/vwap.src.js → Stock/Indicators/VWAPIndicator.js} +5 -4
- package/es-modules/{indicators/wma.src.js → Stock/Indicators/WMAIndicator.js} +5 -4
- package/es-modules/{indicators/williams-r.src.js → Stock/Indicators/WilliamsRIndicator.js} +7 -6
- package/es-modules/{indicators/zigzag.src.js → Stock/Indicators/ZigzagIndicator.js} +5 -7
- package/es-modules/{modules/stock-tools-bindings.js → Stock/StockToolsBindings.js} +22 -7
- package/es-modules/{modules/stock-tools-gui.js → Stock/StockToolsGui.js} +17 -17
- package/es-modules/error-messages.js +7 -2
- package/es-modules/highcharts.src.js +19853 -0
- package/es-modules/masters/highcharts-3d.src.js +11 -12
- package/es-modules/masters/highcharts-gantt.src.js +1 -1
- package/es-modules/masters/highcharts-more.src.js +15 -15
- package/es-modules/masters/highcharts.src.js +28 -27
- 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 +2 -2
- package/es-modules/masters/indicators/accumulation-distribution.src.js +2 -2
- package/es-modules/masters/indicators/ao.src.js +2 -2
- package/es-modules/masters/indicators/apo.src.js +2 -2
- package/es-modules/masters/indicators/aroon-oscillator.src.js +2 -2
- package/es-modules/masters/indicators/aroon.src.js +2 -2
- package/es-modules/masters/indicators/atr.src.js +2 -2
- package/es-modules/masters/indicators/bollinger-bands.src.js +2 -2
- package/es-modules/masters/indicators/cci.src.js +2 -2
- package/es-modules/masters/indicators/chaikin.src.js +2 -2
- package/es-modules/masters/indicators/cmf.src.js +2 -2
- package/es-modules/masters/indicators/dema.src.js +2 -2
- package/es-modules/masters/indicators/dpo.src.js +2 -2
- package/es-modules/masters/indicators/ema.src.js +2 -2
- package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +2 -2
- package/es-modules/masters/indicators/indicators-all.src.js +41 -41
- package/es-modules/masters/indicators/indicators.src.js +2 -2
- package/es-modules/masters/indicators/keltner-channels.src.js +2 -2
- package/es-modules/masters/indicators/macd.src.js +2 -2
- package/es-modules/masters/indicators/mfi.src.js +2 -2
- package/es-modules/masters/indicators/momentum.src.js +2 -2
- package/es-modules/masters/indicators/natr.src.js +2 -2
- package/es-modules/masters/indicators/pivot-points.src.js +2 -2
- package/es-modules/masters/indicators/ppo.src.js +2 -2
- package/es-modules/masters/indicators/price-channel.src.js +2 -2
- package/es-modules/masters/indicators/price-envelopes.src.js +2 -2
- package/es-modules/masters/indicators/psar.src.js +2 -2
- package/es-modules/masters/indicators/regressions.src.js +2 -2
- package/es-modules/masters/indicators/roc.src.js +2 -2
- package/es-modules/masters/indicators/rsi.src.js +2 -2
- package/es-modules/masters/indicators/slow-stochastic.src.js +2 -2
- package/es-modules/masters/indicators/stochastic.src.js +2 -2
- package/es-modules/masters/indicators/supertrend.src.js +2 -2
- package/es-modules/masters/indicators/tema.src.js +2 -2
- package/es-modules/masters/indicators/trendline.src.js +2 -2
- package/es-modules/masters/indicators/trix.src.js +2 -2
- package/es-modules/masters/indicators/volume-by-price.src.js +2 -2
- package/es-modules/masters/indicators/vwap.src.js +2 -2
- package/es-modules/masters/indicators/williams-r.src.js +2 -2
- package/es-modules/masters/indicators/wma.src.js +2 -2
- package/es-modules/masters/indicators/zigzag.src.js +2 -2
- package/es-modules/masters/modules/accessibility.src.js +2 -2
- package/es-modules/masters/modules/annotations-advanced.src.js +13 -13
- package/es-modules/masters/modules/annotations.src.js +4 -4
- package/es-modules/masters/modules/arrow-symbols.src.js +2 -2
- package/es-modules/masters/modules/boost-canvas.src.js +2 -2
- package/es-modules/masters/modules/boost.src.js +2 -2
- package/es-modules/masters/modules/broken-axis.src.js +2 -2
- package/es-modules/masters/modules/bullet.src.js +2 -2
- package/es-modules/masters/modules/coloraxis.src.js +2 -2
- package/es-modules/masters/modules/current-date-indicator.src.js +2 -2
- package/es-modules/masters/modules/cylinder.src.js +2 -2
- package/es-modules/masters/modules/data.src.js +2 -2
- package/es-modules/masters/modules/datagrouping.src.js +2 -2
- package/es-modules/masters/modules/debugger.src.js +2 -2
- package/es-modules/masters/modules/dependency-wheel.src.js +2 -2
- package/es-modules/masters/modules/dotplot.src.js +2 -2
- package/es-modules/masters/modules/drag-panes.src.js +2 -2
- package/es-modules/masters/modules/draggable-points.src.js +2 -2
- package/es-modules/masters/modules/drilldown.src.js +2 -2
- package/es-modules/masters/modules/dumbbell.src.js +2 -2
- package/es-modules/masters/modules/export-data.src.js +2 -2
- package/es-modules/masters/modules/exporting.src.js +3 -3
- package/es-modules/masters/modules/full-screen.src.js +2 -2
- package/es-modules/masters/modules/funnel.src.js +2 -2
- package/es-modules/masters/modules/funnel3d.src.js +2 -2
- package/es-modules/masters/modules/gantt.src.js +6 -6
- package/es-modules/masters/modules/grid-axis.src.js +2 -2
- package/es-modules/masters/modules/heatmap.src.js +4 -4
- package/es-modules/masters/modules/histogram-bellcurve.src.js +3 -3
- package/es-modules/masters/modules/item-series.src.js +2 -2
- package/es-modules/masters/modules/lollipop.src.js +2 -2
- package/es-modules/masters/modules/map.src.js +13 -13
- package/es-modules/masters/modules/marker-clusters.src.js +2 -2
- package/es-modules/masters/modules/networkgraph.src.js +2 -2
- package/es-modules/masters/modules/no-data-to-display.src.js +2 -2
- package/es-modules/masters/modules/offline-exporting.src.js +2 -2
- package/es-modules/masters/modules/oldie-polyfills.src.js +2 -2
- package/es-modules/masters/modules/oldie.src.js +2 -2
- package/es-modules/masters/modules/organization.src.js +2 -2
- package/es-modules/masters/modules/overlapping-datalabels.src.js +2 -2
- package/es-modules/masters/modules/parallel-coordinates.src.js +2 -2
- package/es-modules/masters/modules/pareto.src.js +2 -2
- package/es-modules/masters/modules/pathfinder.src.js +2 -2
- package/es-modules/masters/modules/pattern-fill.src.js +2 -2
- package/es-modules/masters/modules/price-indicator.src.js +2 -2
- package/es-modules/masters/modules/pyramid3d.src.js +2 -2
- package/es-modules/masters/modules/sankey.src.js +2 -2
- package/es-modules/masters/modules/series-label.src.js +2 -2
- package/es-modules/masters/modules/solid-gauge.src.js +2 -2
- package/es-modules/masters/modules/sonification.src.js +2 -2
- package/es-modules/masters/modules/static-scale.src.js +2 -2
- package/es-modules/masters/modules/stock-tools.src.js +3 -3
- package/es-modules/masters/modules/stock.src.js +10 -10
- package/es-modules/masters/modules/streamgraph.src.js +2 -2
- package/es-modules/masters/modules/sunburst.src.js +2 -2
- package/es-modules/masters/modules/tilemap.src.js +2 -2
- package/es-modules/masters/modules/timeline.src.js +2 -2
- package/es-modules/masters/modules/treegrid.src.js +2 -2
- package/es-modules/masters/modules/treemap.src.js +2 -2
- package/es-modules/masters/modules/variable-pie.src.js +2 -2
- package/es-modules/masters/modules/variwide.src.js +2 -2
- package/es-modules/masters/modules/vector.src.js +2 -2
- package/es-modules/masters/modules/venn.src.js +2 -2
- package/es-modules/masters/modules/windbarb.src.js +2 -2
- package/es-modules/masters/modules/wordcloud.src.js +2 -2
- package/es-modules/masters/modules/xrange.src.js +2 -2
- package/es-modules/masters/themes/avocado.src.js +2 -2
- package/es-modules/masters/themes/dark-blue.src.js +2 -2
- package/es-modules/masters/themes/dark-green.src.js +2 -2
- package/es-modules/masters/themes/dark-unica.src.js +2 -2
- package/es-modules/masters/themes/gray.src.js +2 -2
- package/es-modules/masters/themes/grid-light.src.js +2 -2
- package/es-modules/masters/themes/grid.src.js +2 -2
- package/es-modules/masters/themes/high-contrast-dark.src.js +2 -2
- package/es-modules/masters/themes/high-contrast-light.src.js +2 -2
- package/es-modules/masters/themes/sand-signika.src.js +2 -2
- package/es-modules/masters/themes/skies.src.js +2 -2
- package/es-modules/masters/themes/sunset.src.js +2 -2
- package/highcharts-3d.js +86 -88
- package/highcharts-3d.js.map +1 -1
- package/highcharts-3d.src.js +1713 -1615
- package/highcharts-gantt.js +730 -697
- package/highcharts-gantt.js.map +1 -1
- package/highcharts-gantt.src.js +11747 -10110
- package/highcharts-more.js +164 -161
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.js +766 -523
- package/highcharts.d.ts +7728 -1337
- package/highcharts.js +538 -515
- package/highcharts.js.map +1 -1
- package/highcharts.src.d.ts +7728 -1337
- package/highcharts.src.js +8517 -7691
- package/highmaps.js +636 -612
- package/highmaps.js.map +1 -1
- package/highmaps.src.js +9151 -8209
- package/highstock.js +697 -671
- package/highstock.js.map +1 -1
- package/highstock.src.js +8919 -8049
- package/indicators/acceleration-bands.js +8 -8
- package/indicators/acceleration-bands.js.map +1 -1
- package/indicators/acceleration-bands.src.js +8 -8
- package/indicators/accumulation-distribution.js +4 -4
- package/indicators/accumulation-distribution.js.map +1 -1
- package/indicators/accumulation-distribution.src.js +5 -5
- package/indicators/ao.js +5 -5
- package/indicators/ao.js.map +1 -1
- package/indicators/ao.src.js +6 -6
- package/indicators/apo.js +5 -5
- package/indicators/apo.js.map +1 -1
- package/indicators/apo.src.js +8 -9
- package/indicators/aroon-oscillator.js +8 -8
- package/indicators/aroon-oscillator.js.map +1 -1
- package/indicators/aroon-oscillator.src.js +8 -9
- package/indicators/aroon.js +7 -7
- package/indicators/aroon.js.map +1 -1
- package/indicators/aroon.src.js +7 -7
- package/indicators/atr.js +4 -4
- package/indicators/atr.js.map +1 -1
- package/indicators/atr.src.js +6 -14
- package/indicators/bollinger-bands.js +8 -8
- package/indicators/bollinger-bands.js.map +1 -1
- package/indicators/bollinger-bands.src.js +8 -8
- package/indicators/cci.js +4 -4
- package/indicators/cci.js.map +1 -1
- package/indicators/cci.src.js +5 -5
- package/indicators/chaikin.js +6 -6
- package/indicators/chaikin.js.map +1 -1
- package/indicators/chaikin.src.js +75 -75
- package/indicators/cmf.js +4 -4
- package/indicators/cmf.js.map +1 -1
- package/indicators/cmf.src.js +4 -4
- package/indicators/dema.js +5 -5
- package/indicators/dema.js.map +1 -1
- package/indicators/dema.src.js +8 -9
- package/indicators/dpo.js +4 -4
- package/indicators/dpo.js.map +1 -1
- package/indicators/dpo.src.js +5 -5
- package/indicators/ema.js +4 -4
- package/indicators/ema.js.map +1 -1
- package/indicators/ema.src.js +4 -5
- package/indicators/ichimoku-kinko-hyo.js +13 -13
- package/indicators/ichimoku-kinko-hyo.js.map +1 -1
- package/indicators/ichimoku-kinko-hyo.src.js +21 -20
- package/indicators/indicators-all.js +119 -118
- package/indicators/indicators-all.js.map +1 -1
- package/indicators/indicators-all.src.js +231 -240
- package/indicators/indicators.js +9 -9
- package/indicators/indicators.js.map +1 -1
- package/indicators/indicators.src.js +9 -9
- package/indicators/keltner-channels.js +8 -8
- package/indicators/keltner-channels.js.map +1 -1
- package/indicators/keltner-channels.src.js +13 -10
- package/indicators/macd.js +10 -10
- package/indicators/macd.js.map +1 -1
- package/indicators/macd.src.js +8 -7
- package/indicators/mfi.js +4 -4
- package/indicators/mfi.js.map +1 -1
- package/indicators/mfi.src.js +5 -5
- package/indicators/momentum.js +4 -4
- package/indicators/momentum.js.map +1 -1
- package/indicators/momentum.src.js +5 -5
- package/indicators/natr.js +3 -3
- package/indicators/natr.js.map +1 -1
- package/indicators/natr.src.js +5 -5
- package/indicators/pivot-points.js +8 -8
- package/indicators/pivot-points.js.map +1 -1
- package/indicators/pivot-points.src.js +6 -6
- package/indicators/ppo.js +5 -5
- package/indicators/ppo.js.map +1 -1
- package/indicators/ppo.src.js +8 -9
- package/indicators/price-channel.js +8 -8
- package/indicators/price-channel.js.map +1 -1
- package/indicators/price-channel.src.js +66 -66
- package/indicators/price-envelopes.js +6 -6
- package/indicators/price-envelopes.js.map +1 -1
- package/indicators/price-envelopes.src.js +6 -6
- package/indicators/psar.js +3 -3
- package/indicators/psar.js.map +1 -1
- package/indicators/psar.src.js +4 -4
- package/indicators/regressions.js +6 -6
- package/indicators/regressions.js.map +1 -1
- package/indicators/regressions.src.js +8 -8
- package/indicators/roc.js +3 -3
- package/indicators/roc.js.map +1 -1
- package/indicators/roc.src.js +5 -5
- package/indicators/rsi.js +4 -4
- package/indicators/rsi.js.map +1 -1
- package/indicators/rsi.src.js +5 -5
- package/indicators/slow-stochastic.js +5 -5
- package/indicators/slow-stochastic.js.map +1 -1
- package/indicators/slow-stochastic.src.js +7 -7
- package/indicators/stochastic.js +9 -9
- package/indicators/stochastic.js.map +1 -1
- package/indicators/stochastic.src.js +67 -67
- package/indicators/supertrend.js +9 -9
- package/indicators/supertrend.js.map +1 -1
- package/indicators/supertrend.src.js +9 -7
- package/indicators/tema.js +6 -6
- package/indicators/tema.js.map +1 -1
- package/indicators/tema.src.js +8 -9
- package/indicators/trendline.js +3 -3
- package/indicators/trendline.js.map +1 -1
- package/indicators/trendline.src.js +5 -5
- package/indicators/trix.js +4 -4
- package/indicators/trix.js.map +1 -1
- package/indicators/trix.src.js +8 -8
- package/indicators/volume-by-price.js +13 -13
- package/indicators/volume-by-price.js.map +1 -1
- package/indicators/volume-by-price.src.js +7 -8
- package/indicators/vwap.js +4 -4
- package/indicators/vwap.js.map +1 -1
- package/indicators/vwap.src.js +5 -5
- package/indicators/williams-r.js +4 -4
- package/indicators/williams-r.js.map +1 -1
- package/indicators/williams-r.src.js +7 -7
- package/indicators/wma.js +4 -4
- package/indicators/wma.js.map +1 -1
- package/indicators/wma.src.js +5 -5
- package/indicators/zigzag.js +4 -4
- package/indicators/zigzag.js.map +1 -1
- package/indicators/zigzag.src.js +6 -7
- package/modules/accessibility.d.ts +0 -35
- package/modules/accessibility.js +171 -168
- package/modules/accessibility.js.map +1 -1
- package/modules/accessibility.src.d.ts +0 -35
- package/modules/accessibility.src.js +369 -252
- package/modules/annotations-advanced.js +158 -136
- package/modules/annotations-advanced.js.map +1 -1
- package/modules/annotations-advanced.src.js +1929 -1263
- package/modules/annotations.js +105 -94
- package/modules/annotations.js.map +1 -1
- package/modules/annotations.src.js +1485 -1101
- package/modules/arrow-symbols.js +4 -4
- package/modules/arrow-symbols.js.map +1 -1
- package/modules/arrow-symbols.src.js +10 -12
- package/modules/boost-canvas.js +15 -15
- package/modules/boost-canvas.js.map +1 -1
- package/modules/boost-canvas.src.js +17 -17
- package/modules/boost.d.ts +4 -0
- package/modules/boost.js +77 -64
- package/modules/boost.js.map +1 -1
- package/modules/boost.src.d.ts +4 -0
- package/modules/boost.src.js +581 -33
- package/modules/broken-axis.js +10 -10
- package/modules/broken-axis.js.map +1 -1
- package/modules/broken-axis.src.js +4 -5
- package/modules/bullet.js +6 -6
- package/modules/bullet.js.map +1 -1
- package/modules/bullet.src.js +8 -8
- package/modules/coloraxis.js +22 -21
- package/modules/coloraxis.js.map +1 -1
- package/modules/coloraxis.src.js +67 -59
- package/modules/current-date-indicator.js +3 -3
- package/modules/current-date-indicator.js.map +1 -1
- package/modules/current-date-indicator.src.js +4 -5
- package/modules/cylinder.js +8 -8
- package/modules/cylinder.js.map +1 -1
- package/modules/cylinder.src.js +21 -23
- package/modules/data.d.ts +2 -2
- package/modules/data.js +32 -32
- package/modules/data.js.map +1 -1
- package/modules/data.src.d.ts +2 -2
- package/modules/data.src.js +26 -25
- package/modules/datagrouping.js +17 -17
- package/modules/datagrouping.js.map +1 -1
- package/modules/datagrouping.src.js +6 -7
- package/modules/debugger.js +5 -5
- package/modules/debugger.js.map +1 -1
- package/modules/debugger.src.js +13 -8
- package/modules/dependency-wheel.js +8 -8
- package/modules/dependency-wheel.js.map +1 -1
- package/modules/dependency-wheel.src.js +10 -10
- package/modules/dotplot.js +5 -5
- package/modules/dotplot.js.map +1 -1
- package/modules/dotplot.src.js +6 -14
- package/modules/drag-panes.js +10 -10
- package/modules/drag-panes.js.map +1 -1
- package/modules/drag-panes.src.js +4 -6
- package/modules/draggable-points.js +33 -33
- package/modules/draggable-points.js.map +1 -1
- package/modules/draggable-points.src.js +22 -35
- package/modules/drilldown.d.ts +1 -1
- package/modules/drilldown.js +23 -22
- package/modules/drilldown.js.map +1 -1
- package/modules/drilldown.src.d.ts +1 -1
- package/modules/drilldown.src.js +66 -53
- package/modules/dumbbell.d.ts +4 -0
- package/modules/dumbbell.js +24 -9
- package/modules/dumbbell.js.map +1 -1
- package/modules/dumbbell.src.d.ts +4 -0
- package/modules/dumbbell.src.js +1029 -104
- package/modules/export-data.d.ts +4 -29
- package/modules/export-data.js +21 -21
- package/modules/export-data.js.map +1 -1
- package/modules/export-data.src.d.ts +4 -29
- package/modules/export-data.src.js +155 -189
- package/modules/exporting.d.ts +2 -0
- package/modules/exporting.js +33 -33
- package/modules/exporting.js.map +1 -1
- package/modules/exporting.src.d.ts +2 -0
- package/modules/exporting.src.js +40 -30
- package/modules/full-screen.js +7 -7
- package/modules/full-screen.js.map +1 -1
- package/modules/full-screen.src.js +4 -3
- package/modules/funnel.js +9 -9
- package/modules/funnel.js.map +1 -1
- package/modules/funnel.src.js +14 -15
- package/modules/funnel3d.js +17 -17
- package/modules/funnel3d.js.map +1 -1
- package/modules/funnel3d.src.js +12 -14
- package/modules/gantt.js +194 -183
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +2071 -1260
- package/modules/grid-axis.js +22 -19
- package/modules/grid-axis.js.map +1 -1
- package/modules/grid-axis.src.js +149 -43
- package/modules/heatmap.js +33 -32
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +130 -114
- package/modules/histogram-bellcurve.js +10 -10
- package/modules/histogram-bellcurve.js.map +1 -1
- package/modules/histogram-bellcurve.src.js +57 -16
- package/modules/item-series.js +9 -9
- package/modules/item-series.js.map +1 -1
- package/modules/item-series.src.js +20 -13
- package/modules/lollipop.d.ts +20 -1
- package/modules/lollipop.js +26 -4
- package/modules/lollipop.js.map +1 -1
- package/modules/lollipop.src.d.ts +20 -1
- package/modules/lollipop.src.js +1452 -10
- package/modules/map.d.ts +2 -2
- package/modules/map.js +99 -98
- package/modules/map.js.map +1 -1
- package/modules/map.src.d.ts +2 -2
- package/modules/map.src.js +1442 -1326
- package/modules/marker-clusters.js +35 -36
- package/modules/marker-clusters.js.map +1 -1
- package/modules/marker-clusters.src.js +31 -51
- package/modules/networkgraph.js +47 -46
- package/modules/networkgraph.js.map +1 -1
- package/modules/networkgraph.src.js +98 -81
- package/modules/no-data-to-display.js +4 -4
- package/modules/no-data-to-display.js.map +1 -1
- package/modules/no-data-to-display.src.js +17 -13
- package/modules/offline-exporting.js +15 -15
- package/modules/offline-exporting.js.map +1 -1
- package/modules/offline-exporting.src.js +63 -46
- package/modules/oldie-polyfills.js +6 -6
- package/modules/oldie-polyfills.js.map +1 -1
- package/modules/oldie-polyfills.src.js +7 -2
- package/modules/oldie.js +52 -26
- package/modules/oldie.js.map +1 -1
- package/modules/oldie.src.js +1411 -34
- package/modules/organization.js +11 -11
- package/modules/organization.js.map +1 -1
- package/modules/organization.src.js +7 -6
- package/modules/overlapping-datalabels.js +1 -1
- package/modules/overlapping-datalabels.src.js +1 -1
- package/modules/parallel-coordinates.js +11 -11
- package/modules/parallel-coordinates.js.map +1 -1
- package/modules/parallel-coordinates.src.js +144 -136
- package/modules/pareto.js +5 -5
- package/modules/pareto.js.map +1 -1
- package/modules/pareto.src.js +8 -9
- package/modules/pathfinder.js +31 -27
- package/modules/pathfinder.js.map +1 -1
- package/modules/pathfinder.src.js +1589 -985
- package/modules/pattern-fill.js +13 -13
- package/modules/pattern-fill.js.map +1 -1
- package/modules/pattern-fill.src.js +25 -21
- package/modules/price-indicator.js +4 -4
- package/modules/price-indicator.js.map +1 -1
- package/modules/price-indicator.src.js +5 -3
- package/modules/pyramid3d.js +3 -3
- package/modules/pyramid3d.js.map +1 -1
- package/modules/pyramid3d.src.js +4 -5
- package/modules/sankey.js +25 -26
- package/modules/sankey.js.map +1 -1
- package/modules/sankey.src.js +39 -36
- package/modules/series-label.js +17 -17
- package/modules/series-label.js.map +1 -1
- package/modules/series-label.src.js +17 -17
- package/modules/solid-gauge.js +8 -8
- package/modules/solid-gauge.js.map +1 -1
- package/modules/solid-gauge.src.js +123 -91
- package/modules/sonification.d.ts +33 -16
- package/modules/sonification.js +55 -49
- package/modules/sonification.js.map +1 -1
- package/modules/sonification.src.d.ts +33 -16
- package/modules/sonification.src.js +361 -115
- package/modules/static-scale.js +4 -4
- package/modules/static-scale.js.map +1 -1
- package/modules/static-scale.src.js +3 -4
- package/modules/stock-tools.d.ts +23 -1
- package/modules/stock-tools.js +150 -84
- package/modules/stock-tools.js.map +1 -1
- package/modules/stock-tools.src.d.ts +23 -1
- package/modules/stock-tools.src.js +3792 -44
- package/modules/stock.js +161 -158
- package/modules/stock.js.map +1 -1
- package/modules/stock.src.js +456 -412
- package/modules/streamgraph.js +2 -2
- package/modules/streamgraph.js.map +1 -1
- package/modules/streamgraph.src.js +42 -5
- package/modules/sunburst.js +51 -49
- package/modules/sunburst.js.map +1 -1
- package/modules/sunburst.src.js +152 -52
- package/modules/tilemap.js +14 -14
- package/modules/tilemap.js.map +1 -1
- package/modules/tilemap.src.js +12 -11
- package/modules/timeline.js +14 -14
- package/modules/timeline.js.map +1 -1
- package/modules/timeline.src.js +19 -18
- package/modules/treegrid.js +57 -52
- package/modules/treegrid.js.map +1 -1
- package/modules/treegrid.src.js +236 -60
- package/modules/treemap.js +35 -34
- package/modules/treemap.js.map +1 -1
- package/modules/treemap.src.js +213 -118
- package/modules/variable-pie.js +8 -8
- package/modules/variable-pie.js.map +1 -1
- package/modules/variable-pie.src.js +12 -10
- package/modules/variwide.js +8 -8
- package/modules/variwide.js.map +1 -1
- package/modules/variwide.src.js +8 -8
- package/modules/vector.js +6 -6
- package/modules/vector.js.map +1 -1
- package/modules/vector.src.js +9 -9
- package/modules/venn.js +26 -26
- package/modules/venn.js.map +1 -1
- package/modules/venn.src.js +49 -37
- package/modules/windbarb.js +11 -11
- package/modules/windbarb.js.map +1 -1
- package/modules/windbarb.src.js +11 -12
- package/modules/wordcloud.js +19 -19
- package/modules/wordcloud.js.map +1 -1
- package/modules/wordcloud.src.js +26 -18
- package/modules/xrange.js +12 -12
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +19 -20
- package/package.json +1 -1
- package/themes/avocado.js +3 -3
- package/themes/avocado.js.map +1 -1
- package/themes/avocado.src.js +5 -4
- package/themes/dark-blue.js +3 -3
- package/themes/dark-blue.js.map +1 -1
- package/themes/dark-blue.src.js +4 -3
- package/themes/dark-green.js +3 -3
- package/themes/dark-green.js.map +1 -1
- package/themes/dark-green.src.js +4 -3
- package/themes/dark-unica.js +7 -7
- package/themes/dark-unica.js.map +1 -1
- package/themes/dark-unica.src.js +6 -6
- package/themes/gray.js +3 -3
- package/themes/gray.js.map +1 -1
- package/themes/gray.src.js +5 -4
- package/themes/grid-light.js +4 -4
- package/themes/grid-light.js.map +1 -1
- package/themes/grid-light.src.js +4 -3
- package/themes/grid.js +3 -3
- package/themes/grid.js.map +1 -1
- package/themes/grid.src.js +4 -3
- package/themes/high-contrast-dark.js +6 -6
- package/themes/high-contrast-dark.js.map +1 -1
- package/themes/high-contrast-dark.src.js +5 -4
- package/themes/high-contrast-light.js +3 -3
- package/themes/high-contrast-light.js.map +1 -1
- package/themes/high-contrast-light.src.js +4 -3
- package/themes/sand-signika.js +5 -5
- package/themes/sand-signika.js.map +1 -1
- package/themes/sand-signika.src.js +4 -3
- package/themes/skies.js +4 -4
- package/themes/skies.js.map +1 -1
- package/themes/skies.src.js +5 -4
- package/themes/sunset.js +3 -3
- package/themes/sunset.js.map +1 -1
- package/themes/sunset.src.js +5 -4
- package/es-modules/annotations/controllable/ControllableCircle.js +0 -79
- package/es-modules/annotations/controllable/ControllableImage.js +0 -79
- package/es-modules/annotations/controllable/ControllableRect.js +0 -82
- package/es-modules/annotations/types/InfinityLine.js +0 -110
- package/es-modules/masters/modules/map-parser.src.js +0 -12
- package/es-modules/modules/accessibility/components/InfoRegionsComponent/AnnotationsA11y.js +0 -80
- package/es-modules/modules/accessibility/components/InfoRegionsComponent/InfoRegionsComponent.js +0 -499
- package/es-modules/modules/accessibility/components/SeriesComponent/forcedMarkers.js +0 -147
- package/es-modules/modules/map-parser.src.js +0 -365
- package/es-modules/modules/sonification/options.js +0 -36
- package/es-modules/parts-3d/Chart.js +0 -1577
- package/es-modules/parts-3d/VMLRenderer.js +0 -35
- package/es-modules/parts-gantt/PathfinderAlgorithms.js +0 -656
- package/modules/map-parser.d.ts +0 -17
- package/modules/map-parser.js +0 -17
- package/modules/map-parser.js.map +0 -1
- package/modules/map-parser.src.d.ts +0 -17
- package/modules/map-parser.src.js +0 -421
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Highcharts JS v8.
|
|
2
|
+
* @license Highcharts JS v8.2.2 (2020-10-22)
|
|
3
3
|
*
|
|
4
4
|
* Annotations module
|
|
5
5
|
*
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
obj[path] = fn.apply(null, args);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
_registerModule(_modules, '
|
|
31
|
+
_registerModule(_modules, 'Extensions/Annotations/Mixins/EventEmitterMixin.js', [_modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (H, U) {
|
|
32
32
|
/* *
|
|
33
33
|
*
|
|
34
34
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
* */
|
|
37
37
|
var addEvent = U.addEvent,
|
|
38
38
|
fireEvent = U.fireEvent,
|
|
39
|
-
inArray = U.inArray,
|
|
40
39
|
objectEach = U.objectEach,
|
|
41
40
|
pick = U.pick,
|
|
42
41
|
removeEvent = U.removeEvent;
|
|
@@ -59,7 +58,8 @@
|
|
|
59
58
|
addEvents: function () {
|
|
60
59
|
var emitter = this,
|
|
61
60
|
addMouseDownEvent = function (element) {
|
|
62
|
-
addEvent(element,
|
|
61
|
+
addEvent(element,
|
|
62
|
+
H.isTouchDevice ? 'touchstart' : 'mousedown',
|
|
63
63
|
function (e) {
|
|
64
64
|
emitter.onMouseDown(e);
|
|
65
65
|
});
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
emitter.target);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
if (
|
|
82
|
+
if ((emitter.nonDOMEvents || []).indexOf(type) === -1) {
|
|
83
83
|
emitter.graphic.on(type, eventHandler);
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
prevChartY = e.chartY;
|
|
140
140
|
emitter.cancelClick = false;
|
|
141
141
|
emitter.chart.hasDraggedAnnotation = true;
|
|
142
|
-
emitter.removeDrag = addEvent(H.doc, 'mousemove', function (e) {
|
|
142
|
+
emitter.removeDrag = addEvent(H.doc, H.isTouchDevice ? 'touchmove' : 'mousemove', function (e) {
|
|
143
143
|
emitter.hasDragged = true;
|
|
144
144
|
e = pointer.normalize(e);
|
|
145
145
|
e.prevChartX = prevChartX;
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
prevChartX = e.chartX;
|
|
149
149
|
prevChartY = e.chartY;
|
|
150
150
|
});
|
|
151
|
-
emitter.removeMouseUp = addEvent(H.doc, 'mouseup', function (e) {
|
|
151
|
+
emitter.removeMouseUp = addEvent(H.doc, H.isTouchDevice ? 'touchend' : 'mouseup', function (e) {
|
|
152
152
|
emitter.cancelClick = emitter.hasDragged;
|
|
153
153
|
emitter.hasDragged = false;
|
|
154
154
|
emitter.chart.hasDraggedAnnotation = false;
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
|
|
269
269
|
return eventEmitterMixin;
|
|
270
270
|
});
|
|
271
|
-
_registerModule(_modules, '
|
|
271
|
+
_registerModule(_modules, 'Extensions/Annotations/ControlPoint.js', [_modules['Core/Utilities.js'], _modules['Extensions/Annotations/Mixins/EventEmitterMixin.js']], function (U, eventEmitterMixin) {
|
|
272
272
|
/* *
|
|
273
273
|
*
|
|
274
274
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
|
|
421
421
|
return ControlPoint;
|
|
422
422
|
});
|
|
423
|
-
_registerModule(_modules, '
|
|
423
|
+
_registerModule(_modules, 'Extensions/Annotations/MockPoint.js', [_modules['Core/Globals.js'], _modules['Core/Utilities.js'], _modules['Core/Axis/Axis.js']], function (H, U, Axis) {
|
|
424
424
|
/* *
|
|
425
425
|
*
|
|
426
426
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
axisOptions = options[axisName],
|
|
687
687
|
chart = this.series.chart;
|
|
688
688
|
this.series[axisName] =
|
|
689
|
-
axisOptions instanceof
|
|
689
|
+
axisOptions instanceof Axis ?
|
|
690
690
|
axisOptions :
|
|
691
691
|
defined(axisOptions) ?
|
|
692
692
|
(chart[axisName][axisOptions] ||
|
|
@@ -712,7 +712,7 @@
|
|
|
712
712
|
* Returns a label config object - the same as
|
|
713
713
|
* Highcharts.Point.prototype.getLabelConfig
|
|
714
714
|
* @private
|
|
715
|
-
* @return {
|
|
715
|
+
* @return {Highcharts.AnnotationMockLabelOptionsObject} the point's label config
|
|
716
716
|
*/
|
|
717
717
|
MockPoint.prototype.getLabelConfig = function () {
|
|
718
718
|
return {
|
|
@@ -871,12 +871,16 @@
|
|
|
871
871
|
|
|
872
872
|
return MockPoint;
|
|
873
873
|
});
|
|
874
|
-
_registerModule(_modules, '
|
|
874
|
+
_registerModule(_modules, 'Extensions/Annotations/Mixins/ControllableMixin.js', [_modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Tooltip.js'], _modules['Core/Utilities.js']], function (ControlPoint, MockPoint, Tooltip, U) {
|
|
875
875
|
/* *
|
|
876
876
|
*
|
|
877
877
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
878
878
|
*
|
|
879
879
|
* */
|
|
880
|
+
var isObject = U.isObject,
|
|
881
|
+
isString = U.isString,
|
|
882
|
+
merge = U.merge,
|
|
883
|
+
splat = U.splat;
|
|
880
884
|
/**
|
|
881
885
|
* An object which denots a controllable's anchor positions - relative and
|
|
882
886
|
* absolute.
|
|
@@ -911,10 +915,6 @@
|
|
|
911
915
|
* @name Highcharts.AnnotationControllable#points
|
|
912
916
|
* @type {Array<Highcharts.Point>}
|
|
913
917
|
*/
|
|
914
|
-
var isObject = U.isObject,
|
|
915
|
-
isString = U.isString,
|
|
916
|
-
merge = U.merge,
|
|
917
|
-
splat = U.splat;
|
|
918
918
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
919
919
|
/**
|
|
920
920
|
* It provides methods for handling points, control points
|
|
@@ -992,6 +992,7 @@
|
|
|
992
992
|
*/
|
|
993
993
|
anchor: function (point) {
|
|
994
994
|
var plotBox = point.series.getPlotBox(),
|
|
995
|
+
chart = point.series.chart,
|
|
995
996
|
box = point.mock ?
|
|
996
997
|
point.toAnchor() :
|
|
997
998
|
Tooltip.prototype.getAnchor.call({
|
|
@@ -1007,8 +1008,8 @@
|
|
|
1007
1008
|
return {
|
|
1008
1009
|
relativePosition: anchor,
|
|
1009
1010
|
absolutePosition: merge(anchor, {
|
|
1010
|
-
x: anchor.x + plotBox.translateX,
|
|
1011
|
-
y: anchor.y + plotBox.translateY
|
|
1011
|
+
x: anchor.x + (point.mock ? plotBox.translateX : chart.plotLeft),
|
|
1012
|
+
y: anchor.y + (point.mock ? plotBox.translateY : chart.plotTop)
|
|
1012
1013
|
})
|
|
1013
1014
|
};
|
|
1014
1015
|
},
|
|
@@ -1261,7 +1262,7 @@
|
|
|
1261
1262
|
|
|
1262
1263
|
return controllableMixin;
|
|
1263
1264
|
});
|
|
1264
|
-
_registerModule(_modules, '
|
|
1265
|
+
_registerModule(_modules, 'Extensions/Annotations/Mixins/MarkerMixin.js', [_modules['Core/Chart/Chart.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (Chart, SVGRenderer, U) {
|
|
1265
1266
|
/* *
|
|
1266
1267
|
*
|
|
1267
1268
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
@@ -1346,7 +1347,7 @@
|
|
|
1346
1347
|
}]
|
|
1347
1348
|
}
|
|
1348
1349
|
};
|
|
1349
|
-
|
|
1350
|
+
SVGRenderer.prototype.addMarker = function (id, markerOptions) {
|
|
1350
1351
|
var options = { id: id };
|
|
1351
1352
|
var attrs = {
|
|
1352
1353
|
stroke: markerOptions.color || 'none',
|
|
@@ -1368,11 +1369,14 @@
|
|
|
1368
1369
|
return marker;
|
|
1369
1370
|
};
|
|
1370
1371
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1372
|
+
/**
|
|
1373
|
+
* @private
|
|
1374
|
+
*/
|
|
1375
|
+
function createMarkerSetter(markerType) {
|
|
1376
|
+
return function (value) {
|
|
1377
|
+
this.attr(markerType, 'url(#' + value + ')');
|
|
1374
1378
|
};
|
|
1375
|
-
}
|
|
1379
|
+
}
|
|
1376
1380
|
/**
|
|
1377
1381
|
* @private
|
|
1378
1382
|
* @mixin
|
|
@@ -1420,7 +1424,7 @@
|
|
|
1420
1424
|
['markerStart', 'markerEnd'].forEach(setMarker);
|
|
1421
1425
|
}
|
|
1422
1426
|
};
|
|
1423
|
-
addEvent(
|
|
1427
|
+
addEvent(Chart, 'afterGetContainer', function () {
|
|
1424
1428
|
this.options.defs = merge(defaultMarkers, this.options.defs || {});
|
|
1425
1429
|
objectEach(this.options.defs, function (def) {
|
|
1426
1430
|
if (def.tagName === 'marker' && def.render !== false) {
|
|
@@ -1431,14 +1435,13 @@
|
|
|
1431
1435
|
|
|
1432
1436
|
return markerMixin;
|
|
1433
1437
|
});
|
|
1434
|
-
_registerModule(_modules, '
|
|
1438
|
+
_registerModule(_modules, 'Extensions/Annotations/Controllables/ControllablePath.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Core/Globals.js'], _modules['Extensions/Annotations/Mixins/MarkerMixin.js'], _modules['Core/Utilities.js']], function (ControllableMixin, H, MarkerMixin, U) {
|
|
1435
1439
|
/* *
|
|
1436
1440
|
*
|
|
1437
1441
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1438
1442
|
*
|
|
1439
1443
|
* */
|
|
1440
|
-
var extend = U.extend
|
|
1441
|
-
merge = U.merge;
|
|
1444
|
+
var extend = U.extend;
|
|
1442
1445
|
// See TRACKER_FILL in highcharts.src.js
|
|
1443
1446
|
var TRACKER_FILL = 'rgba(192,192,192,' + (H.svg ? 0.0001 : 0.002) + ')';
|
|
1444
1447
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
@@ -1459,41 +1462,57 @@
|
|
|
1459
1462
|
*
|
|
1460
1463
|
* @param {number} index
|
|
1461
1464
|
* Index of the path.
|
|
1462
|
-
**/
|
|
1463
|
-
var ControllablePath = function (annotation,
|
|
1464
|
-
options,
|
|
1465
|
-
index) {
|
|
1466
|
-
this.init(annotation,
|
|
1467
|
-
options,
|
|
1468
|
-
index);
|
|
1469
|
-
this.collection = 'shapes';
|
|
1470
|
-
};
|
|
1471
|
-
/**
|
|
1472
|
-
* A map object which allows to map options attributes to element attributes
|
|
1473
|
-
*
|
|
1474
|
-
* @name Highcharts.AnnotationControllablePath.attrsMap
|
|
1475
|
-
* @type {Highcharts.Dictionary<string>}
|
|
1476
1465
|
*/
|
|
1477
|
-
ControllablePath
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1466
|
+
var ControllablePath = /** @class */ (function () {
|
|
1467
|
+
/* *
|
|
1468
|
+
*
|
|
1469
|
+
* Constructors
|
|
1470
|
+
*
|
|
1471
|
+
* */
|
|
1472
|
+
function ControllablePath(annotation, options, index) {
|
|
1473
|
+
/* *
|
|
1474
|
+
*
|
|
1475
|
+
* Properties
|
|
1476
|
+
*
|
|
1477
|
+
* */
|
|
1478
|
+
this.addControlPoints = ControllableMixin.addControlPoints;
|
|
1479
|
+
this.anchor = ControllableMixin.anchor;
|
|
1480
|
+
this.attr = ControllableMixin.attr;
|
|
1481
|
+
this.attrsFromOptions = ControllableMixin.attrsFromOptions;
|
|
1482
|
+
this.destroy = ControllableMixin.destroy;
|
|
1483
|
+
this.getPointsOptions = ControllableMixin.getPointsOptions;
|
|
1484
|
+
this.init = ControllableMixin.init;
|
|
1485
|
+
this.linkPoints = ControllableMixin.linkPoints;
|
|
1486
|
+
this.point = ControllableMixin.point;
|
|
1487
|
+
this.rotate = ControllableMixin.rotate;
|
|
1488
|
+
this.scale = ControllableMixin.scale;
|
|
1489
|
+
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1490
|
+
this.setMarkers = MarkerMixin.setItemMarkers;
|
|
1491
|
+
this.transform = ControllableMixin.transform;
|
|
1492
|
+
this.transformPoint = ControllableMixin.transformPoint;
|
|
1493
|
+
this.translate = ControllableMixin.translate;
|
|
1494
|
+
this.translatePoint = ControllableMixin.translatePoint;
|
|
1495
|
+
this.translateShape = ControllableMixin.translateShape;
|
|
1496
|
+
this.update = ControllableMixin.update;
|
|
1497
|
+
/**
|
|
1498
|
+
* @type 'path'
|
|
1499
|
+
*/
|
|
1500
|
+
this.type = 'path';
|
|
1501
|
+
this.init(annotation, options, index);
|
|
1502
|
+
this.collection = 'shapes';
|
|
1503
|
+
}
|
|
1504
|
+
/* *
|
|
1505
|
+
*
|
|
1506
|
+
* Functions
|
|
1507
|
+
*
|
|
1508
|
+
* */
|
|
1490
1509
|
/**
|
|
1491
1510
|
* Map the controllable path to 'd' path attribute.
|
|
1492
1511
|
*
|
|
1493
1512
|
* @return {Highcharts.SVGPathArray|null}
|
|
1494
1513
|
* A path's d attribute.
|
|
1495
1514
|
*/
|
|
1496
|
-
toD
|
|
1515
|
+
ControllablePath.prototype.toD = function () {
|
|
1497
1516
|
var dOption = this.options.d;
|
|
1498
1517
|
if (dOption) {
|
|
1499
1518
|
return typeof dOption === 'function' ?
|
|
@@ -1529,11 +1548,11 @@
|
|
|
1529
1548
|
return showPath ?
|
|
1530
1549
|
this.chart.renderer.crispLine(d, this.graphic.strokeWidth()) :
|
|
1531
1550
|
null;
|
|
1532
|
-
}
|
|
1533
|
-
shouldBeDrawn
|
|
1534
|
-
return (
|
|
1535
|
-
}
|
|
1536
|
-
render
|
|
1551
|
+
};
|
|
1552
|
+
ControllablePath.prototype.shouldBeDrawn = function () {
|
|
1553
|
+
return (ControllableMixin.shouldBeDrawn.call(this) || Boolean(this.options.d));
|
|
1554
|
+
};
|
|
1555
|
+
ControllablePath.prototype.render = function (parent) {
|
|
1537
1556
|
var options = this.options,
|
|
1538
1557
|
attrs = this.attrsFromOptions(options);
|
|
1539
1558
|
this.graphic = this.annotation.chart.renderer
|
|
@@ -1559,14 +1578,14 @@
|
|
|
1559
1578
|
options.snap * 2
|
|
1560
1579
|
});
|
|
1561
1580
|
}
|
|
1562
|
-
|
|
1581
|
+
ControllableMixin.render.call(this);
|
|
1563
1582
|
extend(this.graphic, {
|
|
1564
|
-
markerStartSetter:
|
|
1565
|
-
markerEndSetter:
|
|
1583
|
+
markerStartSetter: MarkerMixin.markerStartSetter,
|
|
1584
|
+
markerEndSetter: MarkerMixin.markerEndSetter
|
|
1566
1585
|
});
|
|
1567
1586
|
this.setMarkers(this);
|
|
1568
|
-
}
|
|
1569
|
-
redraw
|
|
1587
|
+
};
|
|
1588
|
+
ControllablePath.prototype.redraw = function (animation) {
|
|
1570
1589
|
var d = this.toD(),
|
|
1571
1590
|
action = animation ? 'animate' : 'attr';
|
|
1572
1591
|
if (d) {
|
|
@@ -1578,19 +1597,44 @@
|
|
|
1578
1597
|
this.tracker.attr({ d: 'M 0 ' + -9e9 });
|
|
1579
1598
|
}
|
|
1580
1599
|
this.graphic.placed = this.tracker.placed = Boolean(d);
|
|
1581
|
-
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1600
|
+
ControllableMixin.redraw.call(this, animation);
|
|
1601
|
+
};
|
|
1602
|
+
/* *
|
|
1603
|
+
*
|
|
1604
|
+
* Static Properties
|
|
1605
|
+
*
|
|
1606
|
+
* */
|
|
1607
|
+
/**
|
|
1608
|
+
* A map object which allows to map options attributes to element attributes
|
|
1609
|
+
*
|
|
1610
|
+
* @name Highcharts.AnnotationControllablePath.attrsMap
|
|
1611
|
+
* @type {Highcharts.Dictionary<string>}
|
|
1612
|
+
*/
|
|
1613
|
+
ControllablePath.attrsMap = {
|
|
1614
|
+
dashStyle: 'dashstyle',
|
|
1615
|
+
strokeWidth: 'stroke-width',
|
|
1616
|
+
stroke: 'stroke',
|
|
1617
|
+
fill: 'fill',
|
|
1618
|
+
zIndex: 'zIndex'
|
|
1619
|
+
};
|
|
1620
|
+
return ControllablePath;
|
|
1621
|
+
}());
|
|
1584
1622
|
|
|
1585
1623
|
return ControllablePath;
|
|
1586
1624
|
});
|
|
1587
|
-
_registerModule(_modules, '
|
|
1625
|
+
_registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableRect.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Core/Utilities.js']], function (ControllableMixin, ControllablePath, U) {
|
|
1588
1626
|
/* *
|
|
1589
1627
|
*
|
|
1590
1628
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1591
1629
|
*
|
|
1592
1630
|
* */
|
|
1593
1631
|
var merge = U.merge;
|
|
1632
|
+
/**
|
|
1633
|
+
* @typedef {Annotation.ControllablePath.AttrsMap}
|
|
1634
|
+
* Annotation.ControllableRect.AttrsMap
|
|
1635
|
+
* @property {string} width=width
|
|
1636
|
+
* @property {string} height=height
|
|
1637
|
+
*/
|
|
1594
1638
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
1595
1639
|
/**
|
|
1596
1640
|
* A controllable rect class.
|
|
@@ -1610,44 +1654,58 @@
|
|
|
1610
1654
|
* @param {number} index
|
|
1611
1655
|
* Index of the rectangle
|
|
1612
1656
|
*/
|
|
1613
|
-
var ControllableRect = function (
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1657
|
+
var ControllableRect = /** @class */ (function () {
|
|
1658
|
+
/* *
|
|
1659
|
+
*
|
|
1660
|
+
* Constructors
|
|
1661
|
+
*
|
|
1662
|
+
* */
|
|
1663
|
+
function ControllableRect(annotation, options, index) {
|
|
1664
|
+
/* *
|
|
1665
|
+
*
|
|
1666
|
+
* Properties
|
|
1667
|
+
*
|
|
1668
|
+
* */
|
|
1669
|
+
this.addControlPoints = ControllableMixin.addControlPoints;
|
|
1670
|
+
this.anchor = ControllableMixin.anchor;
|
|
1671
|
+
this.attr = ControllableMixin.attr;
|
|
1672
|
+
this.attrsFromOptions = ControllableMixin.attrsFromOptions;
|
|
1673
|
+
this.destroy = ControllableMixin.destroy;
|
|
1674
|
+
this.getPointsOptions = ControllableMixin.getPointsOptions;
|
|
1675
|
+
this.init = ControllableMixin.init;
|
|
1676
|
+
this.linkPoints = ControllableMixin.linkPoints;
|
|
1677
|
+
this.point = ControllableMixin.point;
|
|
1678
|
+
this.rotate = ControllableMixin.rotate;
|
|
1679
|
+
this.scale = ControllableMixin.scale;
|
|
1680
|
+
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1681
|
+
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1682
|
+
this.transform = ControllableMixin.transform;
|
|
1683
|
+
this.transformPoint = ControllableMixin.transformPoint;
|
|
1684
|
+
this.translatePoint = ControllableMixin.translatePoint;
|
|
1685
|
+
this.translateShape = ControllableMixin.translateShape;
|
|
1686
|
+
this.update = ControllableMixin.update;
|
|
1687
|
+
/**
|
|
1688
|
+
* @type 'rect'
|
|
1689
|
+
*/
|
|
1690
|
+
this.type = 'rect';
|
|
1691
|
+
this.translate = ControllableMixin.translateShape;
|
|
1692
|
+
this.init(annotation, options, index);
|
|
1693
|
+
this.collection = 'shapes';
|
|
1694
|
+
}
|
|
1695
|
+
/* *
|
|
1696
|
+
*
|
|
1697
|
+
* Functions
|
|
1698
|
+
*
|
|
1699
|
+
* */
|
|
1700
|
+
ControllableRect.prototype.render = function (parent) {
|
|
1643
1701
|
var attrs = this.attrsFromOptions(this.options);
|
|
1644
1702
|
this.graphic = this.annotation.chart.renderer
|
|
1645
1703
|
.rect(0, -9e9, 0, 0)
|
|
1646
1704
|
.attr(attrs)
|
|
1647
1705
|
.add(parent);
|
|
1648
|
-
|
|
1649
|
-
}
|
|
1650
|
-
redraw
|
|
1706
|
+
ControllableMixin.render.call(this);
|
|
1707
|
+
};
|
|
1708
|
+
ControllableRect.prototype.redraw = function (animation) {
|
|
1651
1709
|
var position = this.anchor(this.points[0]).absolutePosition;
|
|
1652
1710
|
if (position) {
|
|
1653
1711
|
this.graphic[animation ? 'animate' : 'attr']({
|
|
@@ -1664,13 +1722,28 @@
|
|
|
1664
1722
|
});
|
|
1665
1723
|
}
|
|
1666
1724
|
this.graphic.placed = Boolean(position);
|
|
1667
|
-
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1725
|
+
ControllableMixin.redraw.call(this, animation);
|
|
1726
|
+
};
|
|
1727
|
+
/* *
|
|
1728
|
+
*
|
|
1729
|
+
* Static Properties
|
|
1730
|
+
*
|
|
1731
|
+
* */
|
|
1732
|
+
/**
|
|
1733
|
+
* A map object which allows to map options attributes to element attributes
|
|
1734
|
+
*
|
|
1735
|
+
* @type {Annotation.ControllableRect.AttrsMap}
|
|
1736
|
+
*/
|
|
1737
|
+
ControllableRect.attrsMap = merge(ControllablePath.attrsMap, {
|
|
1738
|
+
width: 'width',
|
|
1739
|
+
height: 'height'
|
|
1740
|
+
});
|
|
1741
|
+
return ControllableRect;
|
|
1742
|
+
}());
|
|
1670
1743
|
|
|
1671
1744
|
return ControllableRect;
|
|
1672
1745
|
});
|
|
1673
|
-
_registerModule(_modules, '
|
|
1746
|
+
_registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableCircle.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/Controllables/ControllablePath.js'], _modules['Core/Utilities.js']], function (ControllableMixin, ControllablePath, U) {
|
|
1674
1747
|
/* *
|
|
1675
1748
|
*
|
|
1676
1749
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
@@ -1684,45 +1757,65 @@
|
|
|
1684
1757
|
* @requires modules/annotations
|
|
1685
1758
|
*
|
|
1686
1759
|
* @private
|
|
1687
|
-
* @
|
|
1760
|
+
* @class
|
|
1688
1761
|
* @name Highcharts.AnnotationControllableCircle
|
|
1689
1762
|
*
|
|
1690
1763
|
* @param {Highcharts.Annotation} annotation an annotation instance
|
|
1691
1764
|
* @param {Highcharts.AnnotationsShapeOptions} options a shape's options
|
|
1692
1765
|
* @param {number} index of the circle
|
|
1693
|
-
**/
|
|
1694
|
-
var ControllableCircle = function (annotation,
|
|
1695
|
-
options,
|
|
1696
|
-
index) {
|
|
1697
|
-
this.init(annotation,
|
|
1698
|
-
options,
|
|
1699
|
-
index);
|
|
1700
|
-
this.collection = 'shapes';
|
|
1701
|
-
};
|
|
1702
|
-
/**
|
|
1703
|
-
* A map object which allows to map options attributes to element attributes.
|
|
1704
|
-
*
|
|
1705
|
-
* @name Highcharts.AnnotationControllableCircle.attrsMap
|
|
1706
|
-
* @type {Highcharts.Dictionary<string>}
|
|
1707
1766
|
*/
|
|
1708
|
-
ControllableCircle
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1767
|
+
var ControllableCircle = /** @class */ (function () {
|
|
1768
|
+
/* *
|
|
1769
|
+
*
|
|
1770
|
+
* Constructors
|
|
1771
|
+
*
|
|
1772
|
+
* */
|
|
1773
|
+
function ControllableCircle(annotation, options, index) {
|
|
1774
|
+
/* *
|
|
1775
|
+
*
|
|
1776
|
+
* Properties
|
|
1777
|
+
*
|
|
1778
|
+
* */
|
|
1779
|
+
this.addControlPoints = ControllableMixin.addControlPoints;
|
|
1780
|
+
this.anchor = ControllableMixin.anchor;
|
|
1781
|
+
this.attr = ControllableMixin.attr;
|
|
1782
|
+
this.attrsFromOptions = ControllableMixin.attrsFromOptions;
|
|
1783
|
+
this.destroy = ControllableMixin.destroy;
|
|
1784
|
+
this.getPointsOptions = ControllableMixin.getPointsOptions;
|
|
1785
|
+
this.init = ControllableMixin.init;
|
|
1786
|
+
this.linkPoints = ControllableMixin.linkPoints;
|
|
1787
|
+
this.point = ControllableMixin.point;
|
|
1788
|
+
this.rotate = ControllableMixin.rotate;
|
|
1789
|
+
this.scale = ControllableMixin.scale;
|
|
1790
|
+
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1791
|
+
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1792
|
+
this.transform = ControllableMixin.transform;
|
|
1793
|
+
this.transformPoint = ControllableMixin.transformPoint;
|
|
1794
|
+
this.translatePoint = ControllableMixin.translatePoint;
|
|
1795
|
+
this.translateShape = ControllableMixin.translateShape;
|
|
1796
|
+
this.update = ControllableMixin.update;
|
|
1797
|
+
/**
|
|
1798
|
+
* @type 'circle'
|
|
1799
|
+
*/
|
|
1800
|
+
this.type = 'circle';
|
|
1801
|
+
this.translate = ControllableMixin.translateShape;
|
|
1802
|
+
this.init(annotation, options, index);
|
|
1803
|
+
this.collection = 'shapes';
|
|
1804
|
+
}
|
|
1805
|
+
/* *
|
|
1806
|
+
*
|
|
1807
|
+
* Functions
|
|
1808
|
+
*
|
|
1809
|
+
* */
|
|
1810
|
+
ControllableCircle.prototype.render = function (parent) {
|
|
1718
1811
|
var attrs = this.attrsFromOptions(this.options);
|
|
1719
1812
|
this.graphic = this.annotation.chart.renderer
|
|
1720
1813
|
.circle(0, -9e9, 0)
|
|
1721
1814
|
.attr(attrs)
|
|
1722
1815
|
.add(parent);
|
|
1723
|
-
|
|
1724
|
-
}
|
|
1725
|
-
redraw
|
|
1816
|
+
ControllableMixin.render.call(this);
|
|
1817
|
+
};
|
|
1818
|
+
ControllableCircle.prototype.redraw = function (animation) {
|
|
1726
1819
|
var position = this.anchor(this.points[0]).absolutePosition;
|
|
1727
1820
|
if (position) {
|
|
1728
1821
|
this.graphic[animation ? 'animate' : 'attr']({
|
|
@@ -1738,21 +1831,35 @@
|
|
|
1738
1831
|
});
|
|
1739
1832
|
}
|
|
1740
1833
|
this.graphic.placed = Boolean(position);
|
|
1741
|
-
|
|
1742
|
-
}
|
|
1834
|
+
ControllableMixin.redraw.call(this, animation);
|
|
1835
|
+
};
|
|
1743
1836
|
/**
|
|
1744
1837
|
* Set the radius.
|
|
1745
1838
|
*
|
|
1746
1839
|
* @param {number} r a radius to be set
|
|
1747
1840
|
*/
|
|
1748
|
-
setRadius
|
|
1841
|
+
ControllableCircle.prototype.setRadius = function (r) {
|
|
1749
1842
|
this.options.r = r;
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1843
|
+
};
|
|
1844
|
+
/* *
|
|
1845
|
+
*
|
|
1846
|
+
* Static Properties
|
|
1847
|
+
*
|
|
1848
|
+
* */
|
|
1849
|
+
/**
|
|
1850
|
+
* A map object which allows to map options attributes to element
|
|
1851
|
+
* attributes.
|
|
1852
|
+
*
|
|
1853
|
+
* @name Highcharts.AnnotationControllableCircle.attrsMap
|
|
1854
|
+
* @type {Highcharts.Dictionary<string>}
|
|
1855
|
+
*/
|
|
1856
|
+
ControllableCircle.attrsMap = merge(ControllablePath.attrsMap, { r: 'r' });
|
|
1857
|
+
return ControllableCircle;
|
|
1858
|
+
}());
|
|
1752
1859
|
|
|
1753
1860
|
return ControllableCircle;
|
|
1754
1861
|
});
|
|
1755
|
-
_registerModule(_modules, '
|
|
1862
|
+
_registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableLabel.js', [_modules['Extensions/Annotations/Mixins/ControllableMixin.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Tooltip.js'], _modules['Core/Utilities.js']], function (ControllableMixin, MockPoint, SVGRenderer, Tooltip, U) {
|
|
1756
1863
|
/* *
|
|
1757
1864
|
*
|
|
1758
1865
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
@@ -1761,7 +1868,6 @@
|
|
|
1761
1868
|
var extend = U.extend,
|
|
1762
1869
|
format = U.format,
|
|
1763
1870
|
isNumber = U.isNumber,
|
|
1764
|
-
merge = U.merge,
|
|
1765
1871
|
pick = U.pick;
|
|
1766
1872
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
1767
1873
|
/**
|
|
@@ -1780,161 +1886,172 @@
|
|
|
1780
1886
|
* @param {number} index
|
|
1781
1887
|
* Index of the label.
|
|
1782
1888
|
*/
|
|
1783
|
-
var ControllableLabel = function (
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
x = (box.x || 0) + (alignOptions.x || 0),
|
|
1814
|
-
y = (box.y || 0) + (alignOptions.y || 0),
|
|
1815
|
-
alignFactor,
|
|
1816
|
-
vAlignFactor;
|
|
1817
|
-
if (align === 'right') {
|
|
1818
|
-
alignFactor = 1;
|
|
1819
|
-
}
|
|
1820
|
-
else if (align === 'center') {
|
|
1821
|
-
alignFactor = 2;
|
|
1822
|
-
}
|
|
1823
|
-
if (alignFactor) {
|
|
1824
|
-
x += (box.width - (alignOptions.width || 0)) / alignFactor;
|
|
1825
|
-
}
|
|
1826
|
-
if (vAlign === 'bottom') {
|
|
1827
|
-
vAlignFactor = 1;
|
|
1828
|
-
}
|
|
1829
|
-
else if (vAlign === 'middle') {
|
|
1830
|
-
vAlignFactor = 2;
|
|
1831
|
-
}
|
|
1832
|
-
if (vAlignFactor) {
|
|
1833
|
-
y += (box.height - (alignOptions.height || 0)) / vAlignFactor;
|
|
1889
|
+
var ControllableLabel = /** @class */ (function () {
|
|
1890
|
+
/* *
|
|
1891
|
+
*
|
|
1892
|
+
* Constructors
|
|
1893
|
+
*
|
|
1894
|
+
* */
|
|
1895
|
+
function ControllableLabel(annotation, options, index) {
|
|
1896
|
+
/* *
|
|
1897
|
+
*
|
|
1898
|
+
* Properties
|
|
1899
|
+
*
|
|
1900
|
+
* */
|
|
1901
|
+
this.addControlPoints = ControllableMixin.addControlPoints;
|
|
1902
|
+
this.attr = ControllableMixin.attr;
|
|
1903
|
+
this.attrsFromOptions = ControllableMixin.attrsFromOptions;
|
|
1904
|
+
this.destroy = ControllableMixin.destroy;
|
|
1905
|
+
this.getPointsOptions = ControllableMixin.getPointsOptions;
|
|
1906
|
+
this.init = ControllableMixin.init;
|
|
1907
|
+
this.linkPoints = ControllableMixin.linkPoints;
|
|
1908
|
+
this.point = ControllableMixin.point;
|
|
1909
|
+
this.rotate = ControllableMixin.rotate;
|
|
1910
|
+
this.scale = ControllableMixin.scale;
|
|
1911
|
+
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
1912
|
+
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
1913
|
+
this.transform = ControllableMixin.transform;
|
|
1914
|
+
this.transformPoint = ControllableMixin.transformPoint;
|
|
1915
|
+
this.translateShape = ControllableMixin.translateShape;
|
|
1916
|
+
this.update = ControllableMixin.update;
|
|
1917
|
+
this.init(annotation, options, index);
|
|
1918
|
+
this.collection = 'labels';
|
|
1834
1919
|
}
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
height: label.height
|
|
1860
|
-
},
|
|
1861
|
-
//
|
|
1862
|
-
x = alignAttr.x - chart.plotLeft,
|
|
1863
|
-
y = alignAttr.y - chart.plotTop;
|
|
1864
|
-
// Off left
|
|
1865
|
-
off = x + padding;
|
|
1866
|
-
if (off < 0) {
|
|
1920
|
+
/* *
|
|
1921
|
+
*
|
|
1922
|
+
* Static Functions
|
|
1923
|
+
*
|
|
1924
|
+
* */
|
|
1925
|
+
/**
|
|
1926
|
+
* Returns new aligned position based alignment options and box to align to.
|
|
1927
|
+
* It is almost a one-to-one copy from SVGElement.prototype.align
|
|
1928
|
+
* except it does not use and mutate an element
|
|
1929
|
+
*
|
|
1930
|
+
* @param {Highcharts.AnnotationAlignObject} alignOptions
|
|
1931
|
+
*
|
|
1932
|
+
* @param {Highcharts.BBoxObject} box
|
|
1933
|
+
*
|
|
1934
|
+
* @return {Highcharts.PositionObject}
|
|
1935
|
+
* Aligned position.
|
|
1936
|
+
*/
|
|
1937
|
+
ControllableLabel.alignedPosition = function (alignOptions, box) {
|
|
1938
|
+
var align = alignOptions.align,
|
|
1939
|
+
vAlign = alignOptions.verticalAlign,
|
|
1940
|
+
x = (box.x || 0) + (alignOptions.x || 0),
|
|
1941
|
+
y = (box.y || 0) + (alignOptions.y || 0),
|
|
1942
|
+
alignFactor,
|
|
1943
|
+
vAlignFactor;
|
|
1867
1944
|
if (align === 'right') {
|
|
1868
|
-
|
|
1945
|
+
alignFactor = 1;
|
|
1869
1946
|
}
|
|
1870
|
-
else {
|
|
1871
|
-
|
|
1947
|
+
else if (align === 'center') {
|
|
1948
|
+
alignFactor = 2;
|
|
1872
1949
|
}
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
off = x + bBox.width - padding;
|
|
1876
|
-
if (off > chart.plotWidth) {
|
|
1877
|
-
if (align === 'left') {
|
|
1878
|
-
options.align = 'right';
|
|
1950
|
+
if (alignFactor) {
|
|
1951
|
+
x += (box.width - (alignOptions.width || 0)) / alignFactor;
|
|
1879
1952
|
}
|
|
1880
|
-
|
|
1881
|
-
|
|
1953
|
+
if (vAlign === 'bottom') {
|
|
1954
|
+
vAlignFactor = 1;
|
|
1882
1955
|
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
off = y + padding;
|
|
1886
|
-
if (off < 0) {
|
|
1887
|
-
if (verticalAlign === 'bottom') {
|
|
1888
|
-
options.verticalAlign = 'top';
|
|
1956
|
+
else if (vAlign === 'middle') {
|
|
1957
|
+
vAlignFactor = 2;
|
|
1889
1958
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1959
|
+
if (vAlignFactor) {
|
|
1960
|
+
y += (box.height - (alignOptions.height || 0)) / vAlignFactor;
|
|
1892
1961
|
}
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1962
|
+
return {
|
|
1963
|
+
x: Math.round(x),
|
|
1964
|
+
y: Math.round(y)
|
|
1965
|
+
};
|
|
1966
|
+
};
|
|
1967
|
+
/**
|
|
1968
|
+
* Returns new alignment options for a label if the label is outside the
|
|
1969
|
+
* plot area. It is almost a one-to-one copy from
|
|
1970
|
+
* Series.prototype.justifyDataLabel except it does not mutate the label and
|
|
1971
|
+
* it works with absolute instead of relative position.
|
|
1972
|
+
*/
|
|
1973
|
+
ControllableLabel.justifiedOptions = function (chart, label, alignOptions, alignAttr) {
|
|
1974
|
+
var align = alignOptions.align,
|
|
1975
|
+
verticalAlign = alignOptions.verticalAlign,
|
|
1976
|
+
padding = label.box ? 0 : (label.padding || 0),
|
|
1977
|
+
bBox = label.getBBox(),
|
|
1978
|
+
off,
|
|
1979
|
+
//
|
|
1980
|
+
options = {
|
|
1981
|
+
align: align,
|
|
1982
|
+
verticalAlign: verticalAlign,
|
|
1983
|
+
x: alignOptions.x,
|
|
1984
|
+
y: alignOptions.y,
|
|
1985
|
+
width: label.width,
|
|
1986
|
+
height: label.height
|
|
1987
|
+
},
|
|
1988
|
+
//
|
|
1989
|
+
x = alignAttr.x - chart.plotLeft,
|
|
1990
|
+
y = alignAttr.y - chart.plotTop;
|
|
1991
|
+
// Off left
|
|
1992
|
+
off = x + padding;
|
|
1993
|
+
if (off < 0) {
|
|
1994
|
+
if (align === 'right') {
|
|
1995
|
+
options.align = 'left';
|
|
1996
|
+
}
|
|
1997
|
+
else {
|
|
1998
|
+
options.x = -off;
|
|
1999
|
+
}
|
|
1899
2000
|
}
|
|
1900
|
-
|
|
1901
|
-
|
|
2001
|
+
// Off right
|
|
2002
|
+
off = x + bBox.width - padding;
|
|
2003
|
+
if (off > chart.plotWidth) {
|
|
2004
|
+
if (align === 'left') {
|
|
2005
|
+
options.align = 'right';
|
|
2006
|
+
}
|
|
2007
|
+
else {
|
|
2008
|
+
options.x = chart.plotWidth - off;
|
|
2009
|
+
}
|
|
1902
2010
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
2011
|
+
// Off top
|
|
2012
|
+
off = y + padding;
|
|
2013
|
+
if (off < 0) {
|
|
2014
|
+
if (verticalAlign === 'bottom') {
|
|
2015
|
+
options.verticalAlign = 'top';
|
|
2016
|
+
}
|
|
2017
|
+
else {
|
|
2018
|
+
options.y = -off;
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
// Off bottom
|
|
2022
|
+
off = y + bBox.height - padding;
|
|
2023
|
+
if (off > chart.plotHeight) {
|
|
2024
|
+
if (verticalAlign === 'top') {
|
|
2025
|
+
options.verticalAlign = 'bottom';
|
|
2026
|
+
}
|
|
2027
|
+
else {
|
|
2028
|
+
options.y = chart.plotHeight - off;
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
return options;
|
|
2032
|
+
};
|
|
2033
|
+
/* *
|
|
2034
|
+
*
|
|
2035
|
+
* Functions
|
|
2036
|
+
*
|
|
2037
|
+
* */
|
|
1921
2038
|
/**
|
|
1922
2039
|
* Translate the point of the label by deltaX and deltaY translations.
|
|
1923
2040
|
* The point is the label's anchor.
|
|
1924
2041
|
*
|
|
1925
2042
|
* @param {number} dx translation for x coordinate
|
|
1926
2043
|
* @param {number} dy translation for y coordinate
|
|
1927
|
-
|
|
1928
|
-
translatePoint
|
|
1929
|
-
|
|
1930
|
-
}
|
|
2044
|
+
*/
|
|
2045
|
+
ControllableLabel.prototype.translatePoint = function (dx, dy) {
|
|
2046
|
+
ControllableMixin.translatePoint.call(this, dx, dy, 0);
|
|
2047
|
+
};
|
|
1931
2048
|
/**
|
|
1932
2049
|
* Translate x and y position relative to the label's anchor.
|
|
1933
2050
|
*
|
|
1934
2051
|
* @param {number} dx translation for x coordinate
|
|
1935
2052
|
* @param {number} dy translation for y coordinate
|
|
1936
|
-
|
|
1937
|
-
translate
|
|
2053
|
+
*/
|
|
2054
|
+
ControllableLabel.prototype.translate = function (dx, dy) {
|
|
1938
2055
|
var chart = this.annotation.chart,
|
|
1939
2056
|
// Annotation.options
|
|
1940
2057
|
labelOptions = this.annotation.userOptions,
|
|
@@ -1956,8 +2073,8 @@
|
|
|
1956
2073
|
chartOptions[this.collection][this.index].y = this.options.y;
|
|
1957
2074
|
labelOptions[this.collection][this.index].x = this.options.x;
|
|
1958
2075
|
labelOptions[this.collection][this.index].y = this.options.y;
|
|
1959
|
-
}
|
|
1960
|
-
render
|
|
2076
|
+
};
|
|
2077
|
+
ControllableLabel.prototype.render = function (parent) {
|
|
1961
2078
|
var options = this.options,
|
|
1962
2079
|
attrs = this.attrsFromOptions(options),
|
|
1963
2080
|
style = options.style;
|
|
@@ -1978,14 +2095,13 @@
|
|
|
1978
2095
|
this.graphic.addClass(options.className);
|
|
1979
2096
|
}
|
|
1980
2097
|
this.graphic.labelrank = options.labelrank;
|
|
1981
|
-
|
|
1982
|
-
}
|
|
1983
|
-
redraw
|
|
2098
|
+
ControllableMixin.render.call(this);
|
|
2099
|
+
};
|
|
2100
|
+
ControllableLabel.prototype.redraw = function (animation) {
|
|
1984
2101
|
var options = this.options,
|
|
1985
2102
|
text = this.text || options.format || options.text,
|
|
1986
2103
|
label = this.graphic,
|
|
1987
2104
|
point = this.points[0],
|
|
1988
|
-
show = false,
|
|
1989
2105
|
anchor,
|
|
1990
2106
|
attrs;
|
|
1991
2107
|
label.attr({
|
|
@@ -1995,8 +2111,7 @@
|
|
|
1995
2111
|
});
|
|
1996
2112
|
anchor = this.anchor(point);
|
|
1997
2113
|
attrs = this.position(anchor);
|
|
1998
|
-
|
|
1999
|
-
if (show) {
|
|
2114
|
+
if (attrs) {
|
|
2000
2115
|
label.alignAttr = attrs;
|
|
2001
2116
|
attrs.anchorX = anchor.absolutePosition.x;
|
|
2002
2117
|
attrs.anchorY = anchor.absolutePosition.y;
|
|
@@ -2008,16 +2123,16 @@
|
|
|
2008
2123
|
y: -9999 // #10055
|
|
2009
2124
|
});
|
|
2010
2125
|
}
|
|
2011
|
-
label.placed =
|
|
2012
|
-
|
|
2013
|
-
}
|
|
2126
|
+
label.placed = !!attrs;
|
|
2127
|
+
ControllableMixin.redraw.call(this, animation);
|
|
2128
|
+
};
|
|
2014
2129
|
/**
|
|
2015
2130
|
* All basic shapes don't support alignTo() method except label.
|
|
2016
2131
|
* For a controllable label, we need to subtract translation from
|
|
2017
2132
|
* options.
|
|
2018
2133
|
*/
|
|
2019
|
-
anchor
|
|
2020
|
-
var anchor =
|
|
2134
|
+
ControllableLabel.prototype.anchor = function (_point) {
|
|
2135
|
+
var anchor = ControllableMixin.anchor.apply(this,
|
|
2021
2136
|
arguments),
|
|
2022
2137
|
x = this.options.x || 0,
|
|
2023
2138
|
y = this.options.y || 0;
|
|
@@ -2026,7 +2141,7 @@
|
|
|
2026
2141
|
anchor.relativePosition.x -= x;
|
|
2027
2142
|
anchor.relativePosition.y -= y;
|
|
2028
2143
|
return anchor;
|
|
2029
|
-
}
|
|
2144
|
+
};
|
|
2030
2145
|
/**
|
|
2031
2146
|
* Returns the label position relative to its anchor.
|
|
2032
2147
|
*
|
|
@@ -2034,7 +2149,7 @@
|
|
|
2034
2149
|
*
|
|
2035
2150
|
* @return {Highcharts.PositionObject|null}
|
|
2036
2151
|
*/
|
|
2037
|
-
position
|
|
2152
|
+
ControllableLabel.prototype.position = function (anchor) {
|
|
2038
2153
|
var item = this.graphic,
|
|
2039
2154
|
chart = this.annotation.chart,
|
|
2040
2155
|
point = this.points[0],
|
|
@@ -2087,14 +2202,40 @@
|
|
|
2087
2202
|
}
|
|
2088
2203
|
}
|
|
2089
2204
|
return showItem ? itemPosition : null;
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2205
|
+
};
|
|
2206
|
+
/* *
|
|
2207
|
+
*
|
|
2208
|
+
* Static Properties
|
|
2209
|
+
*
|
|
2210
|
+
* */
|
|
2211
|
+
/**
|
|
2212
|
+
* A map object which allows to map options attributes to element attributes
|
|
2213
|
+
*
|
|
2214
|
+
* @type {Highcharts.Dictionary<string>}
|
|
2215
|
+
*/
|
|
2216
|
+
ControllableLabel.attrsMap = {
|
|
2217
|
+
backgroundColor: 'fill',
|
|
2218
|
+
borderColor: 'stroke',
|
|
2219
|
+
borderWidth: 'stroke-width',
|
|
2220
|
+
zIndex: 'zIndex',
|
|
2221
|
+
borderRadius: 'r',
|
|
2222
|
+
padding: 'padding'
|
|
2223
|
+
};
|
|
2224
|
+
/**
|
|
2225
|
+
* Shapes which do not have background - the object is used for proper
|
|
2226
|
+
* setting of the contrast color.
|
|
2227
|
+
*
|
|
2228
|
+
* @type {Array<string>}
|
|
2229
|
+
*/
|
|
2230
|
+
ControllableLabel.shapesWithoutBackground = ['connector'];
|
|
2231
|
+
return ControllableLabel;
|
|
2232
|
+
}());
|
|
2233
|
+
/* ********************************************************************** */
|
|
2234
|
+
/**
|
|
2235
|
+
* General symbol definition for labels with connector
|
|
2236
|
+
* @private
|
|
2096
2237
|
*/
|
|
2097
|
-
|
|
2238
|
+
SVGRenderer.prototype.symbols.connector = function (x, y, w, h, options) {
|
|
2098
2239
|
var anchorX = options && options.anchorX,
|
|
2099
2240
|
anchorY = options && options.anchorY,
|
|
2100
2241
|
path,
|
|
@@ -2132,13 +2273,12 @@
|
|
|
2132
2273
|
|
|
2133
2274
|
return ControllableLabel;
|
|
2134
2275
|
});
|
|
2135
|
-
_registerModule(_modules, '
|
|
2276
|
+
_registerModule(_modules, 'Extensions/Annotations/Controllables/ControllableImage.js', [_modules['Extensions/Annotations/Controllables/ControllableLabel.js'], _modules['Extensions/Annotations/Mixins/ControllableMixin.js']], function (ControllableLabel, ControllableMixin) {
|
|
2136
2277
|
/* *
|
|
2137
2278
|
*
|
|
2138
2279
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
2139
2280
|
*
|
|
2140
2281
|
* */
|
|
2141
|
-
var merge = U.merge;
|
|
2142
2282
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
2143
2283
|
/**
|
|
2144
2284
|
* A controllable image class.
|
|
@@ -2157,33 +2297,46 @@
|
|
|
2157
2297
|
*
|
|
2158
2298
|
* @param {number} index
|
|
2159
2299
|
* Index of the image.
|
|
2160
|
-
**/
|
|
2161
|
-
var ControllableImage = function (annotation,
|
|
2162
|
-
options,
|
|
2163
|
-
index) {
|
|
2164
|
-
this.init(annotation,
|
|
2165
|
-
options,
|
|
2166
|
-
index);
|
|
2167
|
-
this.collection = 'shapes';
|
|
2168
|
-
};
|
|
2169
|
-
/**
|
|
2170
|
-
* A map object which allows to map options attributes to element attributes
|
|
2171
|
-
*
|
|
2172
|
-
* @name Highcharts.AnnotationControllableImage.attrsMap
|
|
2173
|
-
* @type {Highcharts.Dictionary<string>}
|
|
2174
2300
|
*/
|
|
2175
|
-
ControllableImage
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2301
|
+
var ControllableImage = /** @class */ (function () {
|
|
2302
|
+
/* *
|
|
2303
|
+
*
|
|
2304
|
+
* Constructors
|
|
2305
|
+
*
|
|
2306
|
+
* */
|
|
2307
|
+
function ControllableImage(annotation, options, index) {
|
|
2308
|
+
/* *
|
|
2309
|
+
*
|
|
2310
|
+
* Properties
|
|
2311
|
+
*
|
|
2312
|
+
* */
|
|
2313
|
+
this.addControlPoints = ControllableMixin.addControlPoints;
|
|
2314
|
+
this.anchor = ControllableMixin.anchor;
|
|
2315
|
+
this.attr = ControllableMixin.attr;
|
|
2316
|
+
this.attrsFromOptions = ControllableMixin.attrsFromOptions;
|
|
2317
|
+
this.destroy = ControllableMixin.destroy;
|
|
2318
|
+
this.getPointsOptions = ControllableMixin.getPointsOptions;
|
|
2319
|
+
this.init = ControllableMixin.init;
|
|
2320
|
+
this.linkPoints = ControllableMixin.linkPoints;
|
|
2321
|
+
this.point = ControllableMixin.point;
|
|
2322
|
+
this.rotate = ControllableMixin.rotate;
|
|
2323
|
+
this.scale = ControllableMixin.scale;
|
|
2324
|
+
this.setControlPointsVisibility = ControllableMixin.setControlPointsVisibility;
|
|
2325
|
+
this.shouldBeDrawn = ControllableMixin.shouldBeDrawn;
|
|
2326
|
+
this.transform = ControllableMixin.transform;
|
|
2327
|
+
this.transformPoint = ControllableMixin.transformPoint;
|
|
2328
|
+
this.translatePoint = ControllableMixin.translatePoint;
|
|
2329
|
+
this.translateShape = ControllableMixin.translateShape;
|
|
2330
|
+
this.update = ControllableMixin.update;
|
|
2331
|
+
/**
|
|
2332
|
+
* @type 'image'
|
|
2333
|
+
*/
|
|
2334
|
+
this.type = 'image';
|
|
2335
|
+
this.translate = ControllableMixin.translateShape;
|
|
2336
|
+
this.init(annotation, options, index);
|
|
2337
|
+
this.collection = 'shapes';
|
|
2338
|
+
}
|
|
2339
|
+
ControllableImage.prototype.render = function (parent) {
|
|
2187
2340
|
var attrs = this.attrsFromOptions(this.options),
|
|
2188
2341
|
options = this.options;
|
|
2189
2342
|
this.graphic = this.annotation.chart.renderer
|
|
@@ -2192,9 +2345,9 @@
|
|
|
2192
2345
|
.add(parent);
|
|
2193
2346
|
this.graphic.width = options.width;
|
|
2194
2347
|
this.graphic.height = options.height;
|
|
2195
|
-
|
|
2196
|
-
}
|
|
2197
|
-
redraw
|
|
2348
|
+
ControllableMixin.render.call(this);
|
|
2349
|
+
};
|
|
2350
|
+
ControllableImage.prototype.redraw = function (animation) {
|
|
2198
2351
|
var anchor = this.anchor(this.points[0]),
|
|
2199
2352
|
position = ControllableLabel.prototype.position.call(this,
|
|
2200
2353
|
anchor);
|
|
@@ -2211,13 +2364,30 @@
|
|
|
2211
2364
|
});
|
|
2212
2365
|
}
|
|
2213
2366
|
this.graphic.placed = Boolean(position);
|
|
2214
|
-
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2367
|
+
ControllableMixin.redraw.call(this, animation);
|
|
2368
|
+
};
|
|
2369
|
+
/* *
|
|
2370
|
+
*
|
|
2371
|
+
* Static Properties
|
|
2372
|
+
*
|
|
2373
|
+
* */
|
|
2374
|
+
/**
|
|
2375
|
+
* A map object which allows to map options attributes to element attributes
|
|
2376
|
+
*
|
|
2377
|
+
* @name Highcharts.AnnotationControllableImage.attrsMap
|
|
2378
|
+
* @type {Highcharts.Dictionary<string>}
|
|
2379
|
+
*/
|
|
2380
|
+
ControllableImage.attrsMap = {
|
|
2381
|
+
width: 'width',
|
|
2382
|
+
height: 'height',
|
|
2383
|
+
zIndex: 'zIndex'
|
|
2384
|
+
};
|
|
2385
|
+
return ControllableImage;
|
|
2386
|
+
}());
|
|
2217
2387
|
|
|
2218
2388
|
return ControllableImage;
|
|
2219
2389
|
});
|
|
2220
|
-
_registerModule(_modules, '
|
|
2390
|
+
_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']], function (A, Chart, ControllableMixin, ControllableRect, ControllableCircle, ControllablePath, ControllableImage, ControllableLabel, ControlPoint, EventEmitterMixin, H, MockPoint, Pointer, U) {
|
|
2221
2391
|
/* *
|
|
2222
2392
|
*
|
|
2223
2393
|
* (c) 2009-2017 Highsoft, Black Label
|
|
@@ -2227,6 +2397,8 @@
|
|
|
2227
2397
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
2228
2398
|
*
|
|
2229
2399
|
* */
|
|
2400
|
+
var getDeferredAnimation = A.getDeferredAnimation;
|
|
2401
|
+
var chartProto = Chart.prototype;
|
|
2230
2402
|
var addEvent = U.addEvent,
|
|
2231
2403
|
defined = U.defined,
|
|
2232
2404
|
destroyObjectProperties = U.destroyObjectProperties,
|
|
@@ -2238,7 +2410,6 @@
|
|
|
2238
2410
|
pick = U.pick,
|
|
2239
2411
|
splat = U.splat,
|
|
2240
2412
|
wrap = U.wrap;
|
|
2241
|
-
var chartProto = H.Chart.prototype;
|
|
2242
2413
|
/* *********************************************************************
|
|
2243
2414
|
*
|
|
2244
2415
|
* ANNOTATION
|
|
@@ -2287,93 +2458,484 @@
|
|
|
2287
2458
|
* @param {Highcharts.Chart} chart a chart instance
|
|
2288
2459
|
* @param {Highcharts.AnnotationsOptions} userOptions the options object
|
|
2289
2460
|
*/
|
|
2290
|
-
var Annotation =
|
|
2291
|
-
|
|
2461
|
+
var Annotation = /** @class */ (function () {
|
|
2462
|
+
/* *
|
|
2463
|
+
*
|
|
2464
|
+
* Constructors
|
|
2465
|
+
*
|
|
2466
|
+
* */
|
|
2467
|
+
function Annotation(chart, userOptions) {
|
|
2468
|
+
/* *
|
|
2469
|
+
*
|
|
2470
|
+
* Properties
|
|
2471
|
+
*
|
|
2472
|
+
* */
|
|
2473
|
+
this.annotation = void 0;
|
|
2474
|
+
this.coll = 'annotations';
|
|
2475
|
+
this.collection = void 0;
|
|
2476
|
+
this.animationConfig = void 0;
|
|
2477
|
+
this.graphic = void 0;
|
|
2478
|
+
this.group = void 0;
|
|
2479
|
+
this.labelCollector = void 0;
|
|
2480
|
+
this.labelsGroup = void 0;
|
|
2481
|
+
this.shapesGroup = void 0;
|
|
2292
2482
|
var labelsAndShapes;
|
|
2483
|
+
/**
|
|
2484
|
+
* The chart that the annotation belongs to.
|
|
2485
|
+
*
|
|
2486
|
+
* @type {Highcharts.Chart}
|
|
2487
|
+
*/
|
|
2488
|
+
this.chart = chart;
|
|
2489
|
+
/**
|
|
2490
|
+
* The array of points which defines the annotation.
|
|
2491
|
+
*
|
|
2492
|
+
* @type {Array<Highcharts.Point>}
|
|
2493
|
+
*/
|
|
2494
|
+
this.points = [];
|
|
2495
|
+
/**
|
|
2496
|
+
* The array of control points.
|
|
2497
|
+
*
|
|
2498
|
+
* @private
|
|
2499
|
+
* @name Highcharts.Annotation#controlPoints
|
|
2500
|
+
* @type {Array<Annotation.ControlPoint>}
|
|
2501
|
+
*/
|
|
2502
|
+
this.controlPoints = [];
|
|
2503
|
+
this.coll = 'annotations';
|
|
2504
|
+
/**
|
|
2505
|
+
* The array of labels which belong to the annotation.
|
|
2506
|
+
*
|
|
2507
|
+
* @private
|
|
2508
|
+
* @name Highcharts.Annotation#labels
|
|
2509
|
+
* @type {Array<Highcharts.AnnotationLabelType>}
|
|
2510
|
+
*/
|
|
2511
|
+
this.labels = [];
|
|
2512
|
+
/**
|
|
2513
|
+
* The array of shapes which belong to the annotation.
|
|
2514
|
+
*
|
|
2515
|
+
* @private
|
|
2516
|
+
* @name Highcharts.Annotation#shapes
|
|
2517
|
+
* @type {Array<Highcharts.AnnotationShapeType>}
|
|
2518
|
+
*/
|
|
2519
|
+
this.shapes = [];
|
|
2520
|
+
/**
|
|
2521
|
+
* The options for the annotations.
|
|
2522
|
+
*
|
|
2523
|
+
* @name Highcharts.Annotation#options
|
|
2524
|
+
* @type {Highcharts.AnnotationsOptions}
|
|
2525
|
+
*/
|
|
2526
|
+
this.options = merge(this.defaultOptions, userOptions);
|
|
2527
|
+
/**
|
|
2528
|
+
* The user options for the annotations.
|
|
2529
|
+
*
|
|
2530
|
+
* @name Highcharts.Annotation#userOptions
|
|
2531
|
+
* @type {Highcharts.AnnotationsOptions}
|
|
2532
|
+
*/
|
|
2533
|
+
this.userOptions = userOptions;
|
|
2534
|
+
// Handle labels and shapes - those are arrays
|
|
2535
|
+
// Merging does not work with arrays (stores reference)
|
|
2536
|
+
labelsAndShapes = this.getLabelsAndShapesOptions(this.options, userOptions);
|
|
2537
|
+
this.options.labels = labelsAndShapes.labels;
|
|
2538
|
+
this.options.shapes = labelsAndShapes.shapes;
|
|
2539
|
+
/**
|
|
2540
|
+
* The callback that reports to the overlapping-labels module which
|
|
2541
|
+
* labels it should account for.
|
|
2542
|
+
* @private
|
|
2543
|
+
* @name Highcharts.Annotation#labelCollector
|
|
2544
|
+
* @type {Function}
|
|
2545
|
+
*/
|
|
2546
|
+
/**
|
|
2547
|
+
* The group svg element.
|
|
2548
|
+
*
|
|
2549
|
+
* @name Highcharts.Annotation#group
|
|
2550
|
+
* @type {Highcharts.SVGElement}
|
|
2551
|
+
*/
|
|
2552
|
+
/**
|
|
2553
|
+
* The group svg element of the annotation's shapes.
|
|
2554
|
+
*
|
|
2555
|
+
* @name Highcharts.Annotation#shapesGroup
|
|
2556
|
+
* @type {Highcharts.SVGElement}
|
|
2557
|
+
*/
|
|
2558
|
+
/**
|
|
2559
|
+
* The group svg element of the annotation's labels.
|
|
2560
|
+
*
|
|
2561
|
+
* @name Highcharts.Annotation#labelsGroup
|
|
2562
|
+
* @type {Highcharts.SVGElement}
|
|
2563
|
+
*/
|
|
2564
|
+
this.init(chart, this.options);
|
|
2565
|
+
}
|
|
2293
2566
|
/**
|
|
2294
|
-
*
|
|
2295
|
-
*
|
|
2296
|
-
* @type {Highcharts.Chart}
|
|
2297
|
-
*/
|
|
2298
|
-
this.chart = chart;
|
|
2299
|
-
/**
|
|
2300
|
-
* The array of points which defines the annotation.
|
|
2301
|
-
*
|
|
2302
|
-
* @type {Array<Highcharts.Point>}
|
|
2303
|
-
*/
|
|
2304
|
-
this.points = [];
|
|
2305
|
-
/**
|
|
2306
|
-
* The array of control points.
|
|
2307
|
-
*
|
|
2567
|
+
* Initialize the annotation.
|
|
2308
2568
|
* @private
|
|
2309
|
-
* @name Highcharts.Annotation#controlPoints
|
|
2310
|
-
* @type {Array<Annotation.ControlPoint>}
|
|
2311
2569
|
*/
|
|
2312
|
-
|
|
2313
|
-
|
|
2570
|
+
Annotation.prototype.init = function () {
|
|
2571
|
+
var chart = this.chart,
|
|
2572
|
+
animOptions = this.options.animation;
|
|
2573
|
+
this.linkPoints();
|
|
2574
|
+
this.addControlPoints();
|
|
2575
|
+
this.addShapes();
|
|
2576
|
+
this.addLabels();
|
|
2577
|
+
this.setLabelCollector();
|
|
2578
|
+
this.animationConfig = getDeferredAnimation(chart, animOptions);
|
|
2579
|
+
};
|
|
2580
|
+
Annotation.prototype.getLabelsAndShapesOptions = function (baseOptions, newOptions) {
|
|
2581
|
+
var mergedOptions = {};
|
|
2582
|
+
['labels', 'shapes'].forEach(function (name) {
|
|
2583
|
+
if (baseOptions[name]) {
|
|
2584
|
+
mergedOptions[name] = splat(newOptions[name]).map(function (basicOptions, i) {
|
|
2585
|
+
return merge(baseOptions[name][i], basicOptions);
|
|
2586
|
+
});
|
|
2587
|
+
}
|
|
2588
|
+
});
|
|
2589
|
+
return mergedOptions;
|
|
2590
|
+
};
|
|
2591
|
+
Annotation.prototype.addShapes = function () {
|
|
2592
|
+
(this.options.shapes || []).forEach(function (shapeOptions, i) {
|
|
2593
|
+
var shape = this.initShape(shapeOptions,
|
|
2594
|
+
i);
|
|
2595
|
+
merge(true, this.options.shapes[i], shape.options);
|
|
2596
|
+
}, this);
|
|
2597
|
+
};
|
|
2598
|
+
Annotation.prototype.addLabels = function () {
|
|
2599
|
+
(this.options.labels || []).forEach(function (labelsOptions, i) {
|
|
2600
|
+
var labels = this.initLabel(labelsOptions,
|
|
2601
|
+
i);
|
|
2602
|
+
merge(true, this.options.labels[i], labels.options);
|
|
2603
|
+
}, this);
|
|
2604
|
+
};
|
|
2605
|
+
Annotation.prototype.addClipPaths = function () {
|
|
2606
|
+
this.setClipAxes();
|
|
2607
|
+
if (this.clipXAxis && this.clipYAxis) {
|
|
2608
|
+
this.clipRect = this.chart.renderer.clipRect(this.getClipBox());
|
|
2609
|
+
}
|
|
2610
|
+
};
|
|
2611
|
+
Annotation.prototype.setClipAxes = function () {
|
|
2612
|
+
var xAxes = this.chart.xAxis,
|
|
2613
|
+
yAxes = this.chart.yAxis,
|
|
2614
|
+
linkedAxes = (this.options.labels || [])
|
|
2615
|
+
.concat(this.options.shapes || [])
|
|
2616
|
+
.reduce(function (axes,
|
|
2617
|
+
labelOrShape) {
|
|
2618
|
+
return [
|
|
2619
|
+
xAxes[labelOrShape &&
|
|
2620
|
+
labelOrShape.point &&
|
|
2621
|
+
labelOrShape.point.xAxis] || axes[0],
|
|
2622
|
+
yAxes[labelOrShape &&
|
|
2623
|
+
labelOrShape.point &&
|
|
2624
|
+
labelOrShape.point.yAxis] || axes[1]
|
|
2625
|
+
];
|
|
2626
|
+
}, []);
|
|
2627
|
+
this.clipXAxis = linkedAxes[0];
|
|
2628
|
+
this.clipYAxis = linkedAxes[1];
|
|
2629
|
+
};
|
|
2630
|
+
Annotation.prototype.getClipBox = function () {
|
|
2631
|
+
if (this.clipXAxis && this.clipYAxis) {
|
|
2632
|
+
return {
|
|
2633
|
+
x: this.clipXAxis.left,
|
|
2634
|
+
y: this.clipYAxis.top,
|
|
2635
|
+
width: this.clipXAxis.width,
|
|
2636
|
+
height: this.clipYAxis.height
|
|
2637
|
+
};
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
2640
|
+
Annotation.prototype.setLabelCollector = function () {
|
|
2641
|
+
var annotation = this;
|
|
2642
|
+
annotation.labelCollector = function () {
|
|
2643
|
+
return annotation.labels.reduce(function (labels, label) {
|
|
2644
|
+
if (!label.options.allowOverlap) {
|
|
2645
|
+
labels.push(label.graphic);
|
|
2646
|
+
}
|
|
2647
|
+
return labels;
|
|
2648
|
+
}, []);
|
|
2649
|
+
};
|
|
2650
|
+
annotation.chart.labelCollectors.push(annotation.labelCollector);
|
|
2651
|
+
};
|
|
2314
2652
|
/**
|
|
2315
|
-
*
|
|
2316
|
-
*
|
|
2653
|
+
* Set an annotation options.
|
|
2317
2654
|
* @private
|
|
2318
|
-
* @
|
|
2319
|
-
* @type {Array<Highcharts.AnnotationLabelType>}
|
|
2655
|
+
* @param {Highcharts.AnnotationsOptions} - user options for an annotation
|
|
2320
2656
|
*/
|
|
2321
|
-
|
|
2657
|
+
Annotation.prototype.setOptions = function (userOptions) {
|
|
2658
|
+
this.options = merge(this.defaultOptions, userOptions);
|
|
2659
|
+
};
|
|
2660
|
+
Annotation.prototype.redraw = function (animation) {
|
|
2661
|
+
this.linkPoints();
|
|
2662
|
+
if (!this.graphic) {
|
|
2663
|
+
this.render();
|
|
2664
|
+
}
|
|
2665
|
+
if (this.clipRect) {
|
|
2666
|
+
this.clipRect.animate(this.getClipBox());
|
|
2667
|
+
}
|
|
2668
|
+
this.redrawItems(this.shapes, animation);
|
|
2669
|
+
this.redrawItems(this.labels, animation);
|
|
2670
|
+
ControllableMixin.redraw.call(this, animation);
|
|
2671
|
+
};
|
|
2322
2672
|
/**
|
|
2323
|
-
* The array of shapes which belong to the annotation.
|
|
2324
|
-
*
|
|
2325
2673
|
* @private
|
|
2326
|
-
* @
|
|
2327
|
-
* @
|
|
2674
|
+
* @param {Array<Highcharts.AnnotationControllable>} items
|
|
2675
|
+
* @param {boolean} [animation]
|
|
2328
2676
|
*/
|
|
2329
|
-
|
|
2677
|
+
Annotation.prototype.redrawItems = function (items, animation) {
|
|
2678
|
+
var i = items.length;
|
|
2679
|
+
// needs a backward loop
|
|
2680
|
+
// labels/shapes array might be modified
|
|
2681
|
+
// due to destruction of the item
|
|
2682
|
+
while (i--) {
|
|
2683
|
+
this.redrawItem(items[i], animation);
|
|
2684
|
+
}
|
|
2685
|
+
};
|
|
2330
2686
|
/**
|
|
2331
|
-
*
|
|
2332
|
-
*
|
|
2333
|
-
* @name Highcharts.Annotation#options
|
|
2334
|
-
* @type {Highcharts.AnnotationsOptions}
|
|
2687
|
+
* @private
|
|
2688
|
+
* @param {Array<Highcharts.AnnotationControllable>} items
|
|
2335
2689
|
*/
|
|
2336
|
-
|
|
2690
|
+
Annotation.prototype.renderItems = function (items) {
|
|
2691
|
+
var i = items.length;
|
|
2692
|
+
while (i--) {
|
|
2693
|
+
this.renderItem(items[i]);
|
|
2694
|
+
}
|
|
2695
|
+
};
|
|
2696
|
+
Annotation.prototype.render = function () {
|
|
2697
|
+
var renderer = this.chart.renderer;
|
|
2698
|
+
this.graphic = renderer
|
|
2699
|
+
.g('annotation')
|
|
2700
|
+
.attr({
|
|
2701
|
+
opacity: 0,
|
|
2702
|
+
zIndex: this.options.zIndex,
|
|
2703
|
+
visibility: this.options.visible ?
|
|
2704
|
+
'visible' :
|
|
2705
|
+
'hidden'
|
|
2706
|
+
})
|
|
2707
|
+
.add();
|
|
2708
|
+
this.shapesGroup = renderer
|
|
2709
|
+
.g('annotation-shapes')
|
|
2710
|
+
.add(this.graphic)
|
|
2711
|
+
.clip(this.chart.plotBoxClip);
|
|
2712
|
+
this.labelsGroup = renderer
|
|
2713
|
+
.g('annotation-labels')
|
|
2714
|
+
.attr({
|
|
2715
|
+
// hideOverlappingLabels requires translation
|
|
2716
|
+
translateX: 0,
|
|
2717
|
+
translateY: 0
|
|
2718
|
+
})
|
|
2719
|
+
.add(this.graphic);
|
|
2720
|
+
this.addClipPaths();
|
|
2721
|
+
if (this.clipRect) {
|
|
2722
|
+
this.graphic.clip(this.clipRect);
|
|
2723
|
+
}
|
|
2724
|
+
// Render shapes and labels before adding events (#13070).
|
|
2725
|
+
this.renderItems(this.shapes);
|
|
2726
|
+
this.renderItems(this.labels);
|
|
2727
|
+
this.addEvents();
|
|
2728
|
+
ControllableMixin.render.call(this);
|
|
2729
|
+
};
|
|
2337
2730
|
/**
|
|
2338
|
-
*
|
|
2339
|
-
*
|
|
2340
|
-
* @name Highcharts.Annotation#userOptions
|
|
2341
|
-
* @type {Highcharts.AnnotationsOptions}
|
|
2342
|
-
*/
|
|
2343
|
-
this.userOptions = userOptions;
|
|
2344
|
-
// Handle labels and shapes - those are arrays
|
|
2345
|
-
// Merging does not work with arrays (stores reference)
|
|
2346
|
-
labelsAndShapes = this.getLabelsAndShapesOptions(this.options, userOptions);
|
|
2347
|
-
this.options.labels = labelsAndShapes.labels;
|
|
2348
|
-
this.options.shapes = labelsAndShapes.shapes;
|
|
2349
|
-
/**
|
|
2350
|
-
* The callback that reports to the overlapping-labels module which
|
|
2351
|
-
* labels it should account for.
|
|
2731
|
+
* Set the annotation's visibility.
|
|
2352
2732
|
* @private
|
|
2353
|
-
* @
|
|
2354
|
-
*
|
|
2733
|
+
* @param {boolean} [visible]
|
|
2734
|
+
* Whether to show or hide an annotation. If the param is omitted, the
|
|
2735
|
+
* annotation's visibility is toggled.
|
|
2355
2736
|
*/
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2737
|
+
Annotation.prototype.setVisibility = function (visible) {
|
|
2738
|
+
var options = this.options,
|
|
2739
|
+
visibility = pick(visible, !options.visible);
|
|
2740
|
+
this.graphic.attr('visibility', visibility ? 'visible' : 'hidden');
|
|
2741
|
+
if (!visibility) {
|
|
2742
|
+
this.setControlPointsVisibility(false);
|
|
2743
|
+
}
|
|
2744
|
+
options.visible = visibility;
|
|
2745
|
+
};
|
|
2746
|
+
Annotation.prototype.setControlPointsVisibility = function (visible) {
|
|
2747
|
+
var setItemControlPointsVisibility = function (item) {
|
|
2748
|
+
item.setControlPointsVisibility(visible);
|
|
2749
|
+
};
|
|
2750
|
+
ControllableMixin.setControlPointsVisibility.call(this, visible);
|
|
2751
|
+
this.shapes.forEach(setItemControlPointsVisibility);
|
|
2752
|
+
this.labels.forEach(setItemControlPointsVisibility);
|
|
2753
|
+
};
|
|
2754
|
+
/**
|
|
2755
|
+
* Destroy the annotation. This function does not touch the chart
|
|
2756
|
+
* that the annotation belongs to (all annotations are kept in
|
|
2757
|
+
* the chart.annotations array) - it is recommended to use
|
|
2758
|
+
* {@link Highcharts.Chart#removeAnnotation} instead.
|
|
2759
|
+
* @private
|
|
2361
2760
|
*/
|
|
2761
|
+
Annotation.prototype.destroy = function () {
|
|
2762
|
+
var chart = this.chart,
|
|
2763
|
+
destroyItem = function (item) {
|
|
2764
|
+
item.destroy();
|
|
2765
|
+
};
|
|
2766
|
+
this.labels.forEach(destroyItem);
|
|
2767
|
+
this.shapes.forEach(destroyItem);
|
|
2768
|
+
this.clipXAxis = null;
|
|
2769
|
+
this.clipYAxis = null;
|
|
2770
|
+
erase(chart.labelCollectors, this.labelCollector);
|
|
2771
|
+
EventEmitterMixin.destroy.call(this);
|
|
2772
|
+
ControllableMixin.destroy.call(this);
|
|
2773
|
+
destroyObjectProperties(this, chart);
|
|
2774
|
+
};
|
|
2362
2775
|
/**
|
|
2363
|
-
*
|
|
2364
|
-
*
|
|
2365
|
-
* @name Highcharts.Annotation#shapesGroup
|
|
2366
|
-
* @type {Highcharts.SVGElement}
|
|
2776
|
+
* See {@link Highcharts.Chart#removeAnnotation}.
|
|
2777
|
+
* @private
|
|
2367
2778
|
*/
|
|
2779
|
+
Annotation.prototype.remove = function () {
|
|
2780
|
+
// Let chart.update() remove annoations on demand
|
|
2781
|
+
return this.chart.removeAnnotation(this);
|
|
2782
|
+
};
|
|
2368
2783
|
/**
|
|
2369
|
-
*
|
|
2784
|
+
* Updates an annotation.
|
|
2785
|
+
*
|
|
2786
|
+
* @function Highcharts.Annotation#update
|
|
2787
|
+
*
|
|
2788
|
+
* @param {Partial<Highcharts.AnnotationsOptions>} userOptions
|
|
2789
|
+
* New user options for the annotation.
|
|
2370
2790
|
*
|
|
2371
|
-
* @
|
|
2372
|
-
* @type {Highcharts.SVGElement}
|
|
2791
|
+
* @return {void}
|
|
2373
2792
|
*/
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2793
|
+
Annotation.prototype.update = function (userOptions, redraw) {
|
|
2794
|
+
var chart = this.chart,
|
|
2795
|
+
labelsAndShapes = this.getLabelsAndShapesOptions(this.userOptions,
|
|
2796
|
+
userOptions),
|
|
2797
|
+
userOptionsIndex = chart.annotations.indexOf(this),
|
|
2798
|
+
options = merge(true,
|
|
2799
|
+
this.userOptions,
|
|
2800
|
+
userOptions);
|
|
2801
|
+
options.labels = labelsAndShapes.labels;
|
|
2802
|
+
options.shapes = labelsAndShapes.shapes;
|
|
2803
|
+
this.destroy();
|
|
2804
|
+
this.constructor(chart, options);
|
|
2805
|
+
// Update options in chart options, used in exporting (#9767):
|
|
2806
|
+
chart.options.annotations[userOptionsIndex] = options;
|
|
2807
|
+
this.isUpdating = true;
|
|
2808
|
+
if (pick(redraw, true)) {
|
|
2809
|
+
chart.redraw();
|
|
2810
|
+
}
|
|
2811
|
+
fireEvent(this, 'afterUpdate');
|
|
2812
|
+
this.isUpdating = false;
|
|
2813
|
+
};
|
|
2814
|
+
/* *************************************************************
|
|
2815
|
+
* ITEM SECTION
|
|
2816
|
+
* Contains methods for handling a single item in an annotation
|
|
2817
|
+
**************************************************************** */
|
|
2818
|
+
/**
|
|
2819
|
+
* Initialisation of a single shape
|
|
2820
|
+
* @private
|
|
2821
|
+
* @param {Object} shapeOptions - a confg object for a single shape
|
|
2822
|
+
*/
|
|
2823
|
+
Annotation.prototype.initShape = function (shapeOptions, index) {
|
|
2824
|
+
var options = merge(this.options.shapeOptions, {
|
|
2825
|
+
controlPointOptions: this.options.controlPointOptions
|
|
2826
|
+
},
|
|
2827
|
+
shapeOptions),
|
|
2828
|
+
shape = new Annotation.shapesMap[options.type](this,
|
|
2829
|
+
options,
|
|
2830
|
+
index);
|
|
2831
|
+
shape.itemType = 'shape';
|
|
2832
|
+
this.shapes.push(shape);
|
|
2833
|
+
return shape;
|
|
2834
|
+
};
|
|
2835
|
+
/**
|
|
2836
|
+
* Initialisation of a single label
|
|
2837
|
+
* @private
|
|
2838
|
+
*/
|
|
2839
|
+
Annotation.prototype.initLabel = function (labelOptions, index) {
|
|
2840
|
+
var options = merge(this.options.labelOptions, {
|
|
2841
|
+
controlPointOptions: this.options.controlPointOptions
|
|
2842
|
+
},
|
|
2843
|
+
labelOptions),
|
|
2844
|
+
label = new ControllableLabel(this,
|
|
2845
|
+
options,
|
|
2846
|
+
index);
|
|
2847
|
+
label.itemType = 'label';
|
|
2848
|
+
this.labels.push(label);
|
|
2849
|
+
return label;
|
|
2850
|
+
};
|
|
2851
|
+
/**
|
|
2852
|
+
* Redraw a single item.
|
|
2853
|
+
* @private
|
|
2854
|
+
* @param {Annotation.Label|Annotation.Shape} item
|
|
2855
|
+
* @param {boolean} [animation]
|
|
2856
|
+
*/
|
|
2857
|
+
Annotation.prototype.redrawItem = function (item, animation) {
|
|
2858
|
+
item.linkPoints();
|
|
2859
|
+
if (!item.shouldBeDrawn()) {
|
|
2860
|
+
this.destroyItem(item);
|
|
2861
|
+
}
|
|
2862
|
+
else {
|
|
2863
|
+
if (!item.graphic) {
|
|
2864
|
+
this.renderItem(item);
|
|
2865
|
+
}
|
|
2866
|
+
item.redraw(pick(animation, true) && item.graphic.placed);
|
|
2867
|
+
if (item.points.length) {
|
|
2868
|
+
this.adjustVisibility(item);
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
};
|
|
2872
|
+
/**
|
|
2873
|
+
* Hide or show annotaiton attached to points.
|
|
2874
|
+
* @private
|
|
2875
|
+
* @param {Annotation.Label|Annotation.Shape} item
|
|
2876
|
+
*/
|
|
2877
|
+
Annotation.prototype.adjustVisibility = function (item) {
|
|
2878
|
+
var hasVisiblePoints = false,
|
|
2879
|
+
label = item.graphic;
|
|
2880
|
+
item.points.forEach(function (point) {
|
|
2881
|
+
if (point.series.visible !== false &&
|
|
2882
|
+
point.visible !== false) {
|
|
2883
|
+
hasVisiblePoints = true;
|
|
2884
|
+
}
|
|
2885
|
+
});
|
|
2886
|
+
if (!hasVisiblePoints) {
|
|
2887
|
+
label.hide();
|
|
2888
|
+
}
|
|
2889
|
+
else if (label.visibility === 'hidden') {
|
|
2890
|
+
label.show();
|
|
2891
|
+
}
|
|
2892
|
+
};
|
|
2893
|
+
/**
|
|
2894
|
+
* Destroy a single item.
|
|
2895
|
+
* @private
|
|
2896
|
+
* @param {Annotation.Label|Annotation.Shape} item
|
|
2897
|
+
*/
|
|
2898
|
+
Annotation.prototype.destroyItem = function (item) {
|
|
2899
|
+
// erase from shapes or labels array
|
|
2900
|
+
erase(this[item.itemType + 's'], item);
|
|
2901
|
+
item.destroy();
|
|
2902
|
+
};
|
|
2903
|
+
/**
|
|
2904
|
+
* @private
|
|
2905
|
+
*/
|
|
2906
|
+
Annotation.prototype.renderItem = function (item) {
|
|
2907
|
+
item.render(item.itemType === 'label' ?
|
|
2908
|
+
this.labelsGroup :
|
|
2909
|
+
this.shapesGroup);
|
|
2910
|
+
};
|
|
2911
|
+
/**
|
|
2912
|
+
* @private
|
|
2913
|
+
*/
|
|
2914
|
+
Annotation.ControlPoint = ControlPoint;
|
|
2915
|
+
/**
|
|
2916
|
+
* @private
|
|
2917
|
+
*/
|
|
2918
|
+
Annotation.MockPoint = MockPoint;
|
|
2919
|
+
/**
|
|
2920
|
+
* An object uses for mapping between a shape type and a constructor.
|
|
2921
|
+
* To add a new shape type extend this object with type name as a key
|
|
2922
|
+
* and a constructor as its value.
|
|
2923
|
+
*/
|
|
2924
|
+
Annotation.shapesMap = {
|
|
2925
|
+
'rect': ControllableRect,
|
|
2926
|
+
'circle': ControllableCircle,
|
|
2927
|
+
'path': ControllablePath,
|
|
2928
|
+
'image': ControllableImage
|
|
2929
|
+
};
|
|
2930
|
+
/**
|
|
2931
|
+
* @private
|
|
2932
|
+
*/
|
|
2933
|
+
Annotation.types = {};
|
|
2934
|
+
return Annotation;
|
|
2935
|
+
}());
|
|
2936
|
+
merge(true, Annotation.prototype, ControllableMixin, EventEmitterMixin,
|
|
2937
|
+
// restore original Annotation implementation after mixin overwrite
|
|
2938
|
+
merge(Annotation.prototype,
|
|
2377
2939
|
/** @lends Highcharts.Annotation# */
|
|
2378
2940
|
{
|
|
2379
2941
|
/**
|
|
@@ -2409,8 +2971,8 @@
|
|
|
2409
2971
|
*/
|
|
2410
2972
|
defaultOptions: {
|
|
2411
2973
|
/**
|
|
2412
|
-
* Sets an ID for an annotation. Can be user later when
|
|
2413
|
-
* annotation in [Chart#removeAnnotation(id)](
|
|
2974
|
+
* Sets an ID for an annotation. Can be user later when
|
|
2975
|
+
* removing an annotation in [Chart#removeAnnotation(id)](
|
|
2414
2976
|
* /class-reference/Highcharts.Chart#removeAnnotation) method.
|
|
2415
2977
|
*
|
|
2416
2978
|
* @type {number|string}
|
|
@@ -2423,6 +2985,33 @@
|
|
|
2423
2985
|
* Set annotation visibility
|
|
2424
2986
|
*/
|
|
2425
2987
|
visible: true,
|
|
2988
|
+
/**
|
|
2989
|
+
* Enable or disable the initial animation when a series is
|
|
2990
|
+
* displayed for the `annotation`. The animation can also be set
|
|
2991
|
+
* as a configuration object. Please note that this option only
|
|
2992
|
+
* applies to the initial animation.
|
|
2993
|
+
* For other animations, see [chart.animation](#chart.animation)
|
|
2994
|
+
* and the animation parameter under the API methods.
|
|
2995
|
+
* The following properties are supported:
|
|
2996
|
+
*
|
|
2997
|
+
* - `defer`: The animation delay time in milliseconds.
|
|
2998
|
+
*
|
|
2999
|
+
* @sample {highcharts} highcharts/annotations/defer/
|
|
3000
|
+
* Animation defer settings
|
|
3001
|
+
* @type {boolean|Partial<Highcharts.AnimationOptionsObject>}
|
|
3002
|
+
* @since 8.2.0
|
|
3003
|
+
* @apioption annotations.animation
|
|
3004
|
+
*/
|
|
3005
|
+
animation: {},
|
|
3006
|
+
/**
|
|
3007
|
+
* The animation delay time in milliseconds.
|
|
3008
|
+
* Set to `0` renders annotation immediately.
|
|
3009
|
+
* As `undefined` inherits defer time from the [series.animation.defer](#plotOptions.series.animation.defer).
|
|
3010
|
+
*
|
|
3011
|
+
* @type {number}
|
|
3012
|
+
* @since 8.2.0
|
|
3013
|
+
* @apioption annotations.animation.defer
|
|
3014
|
+
*/
|
|
2426
3015
|
/**
|
|
2427
3016
|
* Allow an annotation to be draggable by a user. Possible
|
|
2428
3017
|
* values are `'x'`, `'xy'`, `'y'` and `''` (disabled).
|
|
@@ -2461,7 +3050,8 @@
|
|
|
2461
3050
|
*/
|
|
2462
3051
|
allowOverlap: false,
|
|
2463
3052
|
/**
|
|
2464
|
-
* The background color or gradient for the annotation's
|
|
3053
|
+
* The background color or gradient for the annotation's
|
|
3054
|
+
* label.
|
|
2465
3055
|
*
|
|
2466
3056
|
* @sample highcharts/annotations/label-presentation/
|
|
2467
3057
|
* Set labels graphic options
|
|
@@ -2544,9 +3134,9 @@
|
|
|
2544
3134
|
*/
|
|
2545
3135
|
/**
|
|
2546
3136
|
* Callback JavaScript function to format the annotation's
|
|
2547
|
-
* label. Note that if a `format` or `text` are defined,
|
|
2548
|
-
* format or text take precedence and the formatter is
|
|
2549
|
-
* `This` refers to a point object.
|
|
3137
|
+
* label. Note that if a `format` or `text` are defined,
|
|
3138
|
+
* the format or text take precedence and the formatter is
|
|
3139
|
+
* ignored. `This` refers to a point object.
|
|
2550
3140
|
*
|
|
2551
3141
|
* @sample highcharts/annotations/label-text/
|
|
2552
3142
|
* Set labels text
|
|
@@ -2558,9 +3148,20 @@
|
|
|
2558
3148
|
return defined(this.y) ? this.y : 'Annotation label';
|
|
2559
3149
|
},
|
|
2560
3150
|
/**
|
|
2561
|
-
*
|
|
2562
|
-
*
|
|
2563
|
-
*
|
|
3151
|
+
* Whether the annotation is visible in the exported data
|
|
3152
|
+
* table.
|
|
3153
|
+
*
|
|
3154
|
+
* @sample highcharts/annotations/include-in-data-export/
|
|
3155
|
+
* Do not include in the data export
|
|
3156
|
+
*
|
|
3157
|
+
* @since 8.2.0
|
|
3158
|
+
* @requires modules/export-data
|
|
3159
|
+
*/
|
|
3160
|
+
includeInDataExport: true,
|
|
3161
|
+
/**
|
|
3162
|
+
* How to handle the annotation's label that flow outside
|
|
3163
|
+
* the plot area. The justify option aligns the label inside
|
|
3164
|
+
* the plot area.
|
|
2564
3165
|
*
|
|
2565
3166
|
* @sample highcharts/annotations/label-crop-overflow/
|
|
2566
3167
|
* Crop or justify labels
|
|
@@ -2569,8 +3170,8 @@
|
|
|
2569
3170
|
*/
|
|
2570
3171
|
overflow: 'justify',
|
|
2571
3172
|
/**
|
|
2572
|
-
* When either the borderWidth or the backgroundColor is
|
|
2573
|
-
* this
|
|
3173
|
+
* When either the borderWidth or the backgroundColor is
|
|
3174
|
+
* set, this is the padding within the box.
|
|
2574
3175
|
*
|
|
2575
3176
|
* @sample highcharts/annotations/label-presentation/
|
|
2576
3177
|
* Set labels graphic options
|
|
@@ -2588,8 +3189,9 @@
|
|
|
2588
3189
|
*/
|
|
2589
3190
|
shadow: false,
|
|
2590
3191
|
/**
|
|
2591
|
-
* The name of a symbol to use for the border around the
|
|
2592
|
-
* Symbols are predefined functions on the Renderer
|
|
3192
|
+
* The name of a symbol to use for the border around the
|
|
3193
|
+
* label. Symbols are predefined functions on the Renderer
|
|
3194
|
+
* object.
|
|
2593
3195
|
*
|
|
2594
3196
|
* @sample highcharts/annotations/shapes/
|
|
2595
3197
|
* Available shapes for labels
|
|
@@ -2647,8 +3249,8 @@
|
|
|
2647
3249
|
y: -16
|
|
2648
3250
|
},
|
|
2649
3251
|
/**
|
|
2650
|
-
* An array of labels for the annotation. For options that apply
|
|
2651
|
-
* multiple labels, they can be added to the
|
|
3252
|
+
* An array of labels for the annotation. For options that apply
|
|
3253
|
+
* to multiple labels, they can be added to the
|
|
2652
3254
|
* [labelOptions](annotations.labelOptions.html).
|
|
2653
3255
|
*
|
|
2654
3256
|
* @type {Array<*>}
|
|
@@ -2658,8 +3260,8 @@
|
|
|
2658
3260
|
/**
|
|
2659
3261
|
* This option defines the point to which the label will be
|
|
2660
3262
|
* connected. It can be either the point which exists in the
|
|
2661
|
-
* series - it is referenced by the point's id - or a new point
|
|
2662
|
-
* defined x, y properties and optionally axes.
|
|
3263
|
+
* series - it is referenced by the point's id - or a new point
|
|
3264
|
+
* with defined x, y properties and optionally axes.
|
|
2663
3265
|
*
|
|
2664
3266
|
* @sample highcharts/annotations/mock-point/
|
|
2665
3267
|
* Attach annotation to a mock point
|
|
@@ -2684,26 +3286,28 @@
|
|
|
2684
3286
|
* @apioption annotations.labels.point.y
|
|
2685
3287
|
*/
|
|
2686
3288
|
/**
|
|
2687
|
-
* This number defines which xAxis the point is connected to.
|
|
2688
|
-
* refers to either the axis id or the index of the axis in
|
|
2689
|
-
* xAxis array. If the option is not configured or the axis
|
|
2690
|
-
* found the point's x coordinate refers to the chart
|
|
3289
|
+
* This number defines which xAxis the point is connected to.
|
|
3290
|
+
* It refers to either the axis id or the index of the axis in
|
|
3291
|
+
* the xAxis array. If the option is not configured or the axis
|
|
3292
|
+
* is not found the point's x coordinate refers to the chart
|
|
3293
|
+
* pixels.
|
|
2691
3294
|
*
|
|
2692
3295
|
* @type {number|string|null}
|
|
2693
3296
|
* @apioption annotations.labels.point.xAxis
|
|
2694
3297
|
*/
|
|
2695
3298
|
/**
|
|
2696
|
-
* This number defines which yAxis the point is connected to.
|
|
2697
|
-
* refers to either the axis id or the index of the axis in
|
|
2698
|
-
* yAxis array. If the option is not configured or the axis
|
|
2699
|
-
* found the point's y coordinate refers to the chart
|
|
3299
|
+
* This number defines which yAxis the point is connected to.
|
|
3300
|
+
* It refers to either the axis id or the index of the axis in
|
|
3301
|
+
* the yAxis array. If the option is not configured or the axis
|
|
3302
|
+
* is not found the point's y coordinate refers to the chart
|
|
3303
|
+
* pixels.
|
|
2700
3304
|
*
|
|
2701
3305
|
* @type {number|string|null}
|
|
2702
3306
|
* @apioption annotations.labels.point.yAxis
|
|
2703
3307
|
*/
|
|
2704
3308
|
/**
|
|
2705
|
-
* An array of shapes for the annotation. For options that apply
|
|
2706
|
-
* multiple shapes, then can be added to the
|
|
3309
|
+
* An array of shapes for the annotation. For options that apply
|
|
3310
|
+
* to multiple shapes, then can be added to the
|
|
2707
3311
|
* [shapeOptions](annotations.shapeOptions.html).
|
|
2708
3312
|
*
|
|
2709
3313
|
* @type {Array<*>}
|
|
@@ -2713,8 +3317,8 @@
|
|
|
2713
3317
|
/**
|
|
2714
3318
|
* This option defines the point to which the shape will be
|
|
2715
3319
|
* connected. It can be either the point which exists in the
|
|
2716
|
-
* series - it is referenced by the point's id - or a new point
|
|
2717
|
-
* defined x, y properties and optionally axes.
|
|
3320
|
+
* series - it is referenced by the point's id - or a new point
|
|
3321
|
+
* with defined x, y properties and optionally axes.
|
|
2718
3322
|
*
|
|
2719
3323
|
* @declare Highcharts.AnnotationMockPointOptionsObject
|
|
2720
3324
|
* @type {string|Highcharts.AnnotationMockPointOptionsObject}
|
|
@@ -2722,9 +3326,9 @@
|
|
|
2722
3326
|
* @apioption annotations.shapes.point
|
|
2723
3327
|
*/
|
|
2724
3328
|
/**
|
|
2725
|
-
* An array of points for the shape. This option is available
|
|
2726
|
-
* shapes which can use multiple points such as path. A
|
|
2727
|
-
* either a point object or a point's id.
|
|
3329
|
+
* An array of points for the shape. This option is available
|
|
3330
|
+
* for shapes which can use multiple points such as path. A
|
|
3331
|
+
* point can be either a point object or a point's id.
|
|
2728
3332
|
*
|
|
2729
3333
|
* @see [annotations.shapes.point](annotations.shapes.point.html)
|
|
2730
3334
|
*
|
|
@@ -2745,8 +3349,8 @@
|
|
|
2745
3349
|
* @apioption annotations.shapes.src
|
|
2746
3350
|
*/
|
|
2747
3351
|
/**
|
|
2748
|
-
* Id of the marker which will be drawn at the final vertex of
|
|
2749
|
-
* path. Custom markers can be defined in defs property.
|
|
3352
|
+
* Id of the marker which will be drawn at the final vertex of
|
|
3353
|
+
* the path. Custom markers can be defined in defs property.
|
|
2750
3354
|
*
|
|
2751
3355
|
* @see [defs.markers](defs.markers.html)
|
|
2752
3356
|
*
|
|
@@ -2757,8 +3361,8 @@
|
|
|
2757
3361
|
* @apioption annotations.shapes.markerEnd
|
|
2758
3362
|
*/
|
|
2759
3363
|
/**
|
|
2760
|
-
* Id of the marker which will be drawn at the first vertex of
|
|
2761
|
-
* path. Custom markers can be defined in defs property.
|
|
3364
|
+
* Id of the marker which will be drawn at the first vertex of
|
|
3365
|
+
* the path. Custom markers can be defined in defs property.
|
|
2762
3366
|
*
|
|
2763
3367
|
* @see [defs.markers](defs.markers.html)
|
|
2764
3368
|
*
|
|
@@ -2769,9 +3373,9 @@
|
|
|
2769
3373
|
* @apioption annotations.shapes.markerStart
|
|
2770
3374
|
*/
|
|
2771
3375
|
/**
|
|
2772
|
-
* Options for annotation's shapes. Each shape inherits options
|
|
2773
|
-
* the shapeOptions object. An option from the shapeOptions
|
|
2774
|
-
* overwritten by config for a specific shape.
|
|
3376
|
+
* Options for annotation's shapes. Each shape inherits options
|
|
3377
|
+
* from the shapeOptions object. An option from the shapeOptions
|
|
3378
|
+
* can be overwritten by config for a specific shape.
|
|
2775
3379
|
*
|
|
2776
3380
|
* @requires modules/annotations
|
|
2777
3381
|
*/
|
|
@@ -2801,12 +3405,12 @@
|
|
|
2801
3405
|
* Basic shape annotation
|
|
2802
3406
|
*
|
|
2803
3407
|
* @type {string}
|
|
2804
|
-
* @default
|
|
3408
|
+
* @default rect
|
|
2805
3409
|
* @apioption annotations.shapeOptions.type
|
|
2806
3410
|
*/
|
|
2807
3411
|
/**
|
|
2808
|
-
* The URL for an image to use as the annotation shape.
|
|
2809
|
-
* type has to be set to `'image'`.
|
|
3412
|
+
* The URL for an image to use as the annotation shape.
|
|
3413
|
+
* Note, type has to be set to `'image'`.
|
|
2810
3414
|
*
|
|
2811
3415
|
* @see [annotations.shapeOptions.type](annotations.shapeOptions.type)
|
|
2812
3416
|
* @sample highcharts/annotations/shape-src/
|
|
@@ -2831,452 +3435,97 @@
|
|
|
2831
3435
|
* Basic shape annotation
|
|
2832
3436
|
*
|
|
2833
3437
|
* @type {Highcharts.ColorString}
|
|
2834
|
-
*/
|
|
2835
|
-
stroke: 'rgba(0, 0, 0, 0.75)',
|
|
2836
|
-
/**
|
|
2837
|
-
* The pixel stroke width of the shape.
|
|
2838
|
-
*
|
|
2839
|
-
* @sample highcharts/annotations/shape/
|
|
2840
|
-
* Basic shape annotation
|
|
2841
|
-
*/
|
|
2842
|
-
strokeWidth: 1,
|
|
2843
|
-
/**
|
|
2844
|
-
* The color of the shape's fill.
|
|
2845
|
-
*
|
|
2846
|
-
* @sample highcharts/annotations/shape/
|
|
2847
|
-
* Basic shape annotation
|
|
2848
|
-
*
|
|
2849
|
-
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
2850
|
-
*/
|
|
2851
|
-
fill: 'rgba(0, 0, 0, 0.75)',
|
|
2852
|
-
/**
|
|
2853
|
-
* The radius of the shape.
|
|
2854
|
-
*
|
|
2855
|
-
* @sample highcharts/annotations/shape/
|
|
2856
|
-
* Basic shape annotation
|
|
2857
|
-
*/
|
|
2858
|
-
r: 0,
|
|
2859
|
-
/**
|
|
2860
|
-
* Defines additional snapping area around an annotation
|
|
2861
|
-
* making this annotation to focus. Defined in pixels.
|
|
2862
|
-
*/
|
|
2863
|
-
snap: 2
|
|
2864
|
-
},
|
|
2865
|
-
/**
|
|
2866
|
-
* Options for annotation's control points. Each control point
|
|
2867
|
-
* inherits options from controlPointOptions object.
|
|
2868
|
-
* Options from the controlPointOptions can be overwritten
|
|
2869
|
-
* by options in a specific control point.
|
|
2870
|
-
*
|
|
2871
|
-
* @declare Highcharts.AnnotationControlPointOptionsObject
|
|
2872
|
-
* @requires modules/annotations
|
|
2873
|
-
* @apioption annotations.controlPointOptions
|
|
2874
|
-
*/
|
|
2875
|
-
controlPointOptions: {
|
|
2876
|
-
/**
|
|
2877
|
-
* @type {Highcharts.AnnotationControlPointPositionerFunction}
|
|
2878
|
-
* @apioption annotations.controlPointOptions.positioner
|
|
2879
|
-
*/
|
|
2880
|
-
symbol: 'circle',
|
|
2881
|
-
width: 10,
|
|
2882
|
-
height: 10,
|
|
2883
|
-
style: {
|
|
2884
|
-
stroke: 'black',
|
|
2885
|
-
'stroke-width': 2,
|
|
2886
|
-
fill: 'white'
|
|
2887
|
-
},
|
|
2888
|
-
visible: false,
|
|
2889
|
-
events: {}
|
|
2890
|
-
},
|
|
2891
|
-
/**
|
|
2892
|
-
* Event callback when annotation is added to the chart.
|
|
2893
|
-
*
|
|
2894
|
-
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
2895
|
-
* @since 7.1.0
|
|
2896
|
-
* @apioption annotations.events.add
|
|
2897
|
-
*/
|
|
2898
|
-
/**
|
|
2899
|
-
* Event callback when annotation is updated (e.g. drag and
|
|
2900
|
-
* droppped or resized by control points).
|
|
2901
|
-
*
|
|
2902
|
-
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
2903
|
-
* @since 7.1.0
|
|
2904
|
-
* @apioption annotations.events.afterUpdate
|
|
2905
|
-
*/
|
|
2906
|
-
/**
|
|
2907
|
-
* Event callback when annotation is removed from the chart.
|
|
2908
|
-
*
|
|
2909
|
-
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
2910
|
-
* @since 7.1.0
|
|
2911
|
-
* @apioption annotations.events.remove
|
|
2912
|
-
*/
|
|
2913
|
-
/**
|
|
2914
|
-
* Events available in annotations.
|
|
2915
|
-
*
|
|
2916
|
-
* @requires modules/annotations
|
|
2917
|
-
*/
|
|
2918
|
-
events: {},
|
|
2919
|
-
/**
|
|
2920
|
-
* The Z index of the annotation.
|
|
2921
|
-
*/
|
|
2922
|
-
zIndex: 6
|
|
2923
|
-
},
|
|
2924
|
-
/**
|
|
2925
|
-
* Initialize the annotation.
|
|
2926
|
-
* @private
|
|
2927
|
-
*/
|
|
2928
|
-
init: function () {
|
|
2929
|
-
this.linkPoints();
|
|
2930
|
-
this.addControlPoints();
|
|
2931
|
-
this.addShapes();
|
|
2932
|
-
this.addLabels();
|
|
2933
|
-
this.setLabelCollector();
|
|
2934
|
-
},
|
|
2935
|
-
getLabelsAndShapesOptions: function (baseOptions, newOptions) {
|
|
2936
|
-
var mergedOptions = {};
|
|
2937
|
-
['labels', 'shapes'].forEach(function (name) {
|
|
2938
|
-
if (baseOptions[name]) {
|
|
2939
|
-
mergedOptions[name] = splat(newOptions[name]).map(function (basicOptions, i) {
|
|
2940
|
-
return merge(baseOptions[name][i], basicOptions);
|
|
2941
|
-
});
|
|
2942
|
-
}
|
|
2943
|
-
});
|
|
2944
|
-
return mergedOptions;
|
|
2945
|
-
},
|
|
2946
|
-
addShapes: function () {
|
|
2947
|
-
(this.options.shapes || []).forEach(function (shapeOptions, i) {
|
|
2948
|
-
var shape = this.initShape(shapeOptions,
|
|
2949
|
-
i);
|
|
2950
|
-
merge(true, this.options.shapes[i], shape.options);
|
|
2951
|
-
}, this);
|
|
2952
|
-
},
|
|
2953
|
-
addLabels: function () {
|
|
2954
|
-
(this.options.labels || []).forEach(function (labelsOptions, i) {
|
|
2955
|
-
var labels = this.initLabel(labelsOptions,
|
|
2956
|
-
i);
|
|
2957
|
-
merge(true, this.options.labels[i], labels.options);
|
|
2958
|
-
}, this);
|
|
2959
|
-
},
|
|
2960
|
-
addClipPaths: function () {
|
|
2961
|
-
this.setClipAxes();
|
|
2962
|
-
if (this.clipXAxis && this.clipYAxis) {
|
|
2963
|
-
this.clipRect = this.chart.renderer.clipRect(this.getClipBox());
|
|
2964
|
-
}
|
|
2965
|
-
},
|
|
2966
|
-
setClipAxes: function () {
|
|
2967
|
-
var xAxes = this.chart.xAxis,
|
|
2968
|
-
yAxes = this.chart.yAxis,
|
|
2969
|
-
linkedAxes = (this.options.labels || [])
|
|
2970
|
-
.concat(this.options.shapes || [])
|
|
2971
|
-
.reduce(function (axes,
|
|
2972
|
-
labelOrShape) {
|
|
2973
|
-
return [
|
|
2974
|
-
xAxes[labelOrShape &&
|
|
2975
|
-
labelOrShape.point &&
|
|
2976
|
-
labelOrShape.point.xAxis] || axes[0],
|
|
2977
|
-
yAxes[labelOrShape &&
|
|
2978
|
-
labelOrShape.point &&
|
|
2979
|
-
labelOrShape.point.yAxis] || axes[1]
|
|
2980
|
-
];
|
|
2981
|
-
}, []);
|
|
2982
|
-
this.clipXAxis = linkedAxes[0];
|
|
2983
|
-
this.clipYAxis = linkedAxes[1];
|
|
2984
|
-
},
|
|
2985
|
-
getClipBox: function () {
|
|
2986
|
-
if (this.clipXAxis && this.clipYAxis) {
|
|
2987
|
-
return {
|
|
2988
|
-
x: this.clipXAxis.left,
|
|
2989
|
-
y: this.clipYAxis.top,
|
|
2990
|
-
width: this.clipXAxis.width,
|
|
2991
|
-
height: this.clipYAxis.height
|
|
2992
|
-
};
|
|
2993
|
-
}
|
|
2994
|
-
},
|
|
2995
|
-
setLabelCollector: function () {
|
|
2996
|
-
var annotation = this;
|
|
2997
|
-
annotation.labelCollector = function () {
|
|
2998
|
-
return annotation.labels.reduce(function (labels, label) {
|
|
2999
|
-
if (!label.options.allowOverlap) {
|
|
3000
|
-
labels.push(label.graphic);
|
|
3001
|
-
}
|
|
3002
|
-
return labels;
|
|
3003
|
-
}, []);
|
|
3004
|
-
};
|
|
3005
|
-
annotation.chart.labelCollectors.push(annotation.labelCollector);
|
|
3006
|
-
},
|
|
3007
|
-
/**
|
|
3008
|
-
* Set an annotation options.
|
|
3009
|
-
* @private
|
|
3010
|
-
* @param {Highcharts.AnnotationsOptions} - user options for an annotation
|
|
3011
|
-
*/
|
|
3012
|
-
setOptions: function (userOptions) {
|
|
3013
|
-
this.options = merge(this.defaultOptions, userOptions);
|
|
3014
|
-
},
|
|
3015
|
-
redraw: function (animation) {
|
|
3016
|
-
this.linkPoints();
|
|
3017
|
-
if (!this.graphic) {
|
|
3018
|
-
this.render();
|
|
3019
|
-
}
|
|
3020
|
-
if (this.clipRect) {
|
|
3021
|
-
this.clipRect.animate(this.getClipBox());
|
|
3022
|
-
}
|
|
3023
|
-
this.redrawItems(this.shapes, animation);
|
|
3024
|
-
this.redrawItems(this.labels, animation);
|
|
3025
|
-
controllableMixin.redraw.call(this, animation);
|
|
3026
|
-
},
|
|
3027
|
-
/**
|
|
3028
|
-
* @private
|
|
3029
|
-
* @param {Array<Highcharts.AnnotationControllable>} items
|
|
3030
|
-
* @param {boolean} [animation]
|
|
3031
|
-
*/
|
|
3032
|
-
redrawItems: function (items, animation) {
|
|
3033
|
-
var i = items.length;
|
|
3034
|
-
// needs a backward loop
|
|
3035
|
-
// labels/shapes array might be modified
|
|
3036
|
-
// due to destruction of the item
|
|
3037
|
-
while (i--) {
|
|
3038
|
-
this.redrawItem(items[i], animation);
|
|
3039
|
-
}
|
|
3040
|
-
},
|
|
3041
|
-
/**
|
|
3042
|
-
* @private
|
|
3043
|
-
* @param {Array<Highcharts.AnnotationControllable>} items
|
|
3044
|
-
*/
|
|
3045
|
-
renderItems: function (items) {
|
|
3046
|
-
var i = items.length;
|
|
3047
|
-
while (i--) {
|
|
3048
|
-
this.renderItem(items[i]);
|
|
3049
|
-
}
|
|
3050
|
-
},
|
|
3051
|
-
render: function () {
|
|
3052
|
-
var renderer = this.chart.renderer;
|
|
3053
|
-
this.graphic = renderer
|
|
3054
|
-
.g('annotation')
|
|
3055
|
-
.attr({
|
|
3056
|
-
zIndex: this.options.zIndex,
|
|
3057
|
-
visibility: this.options.visible ?
|
|
3058
|
-
'visible' :
|
|
3059
|
-
'hidden'
|
|
3060
|
-
})
|
|
3061
|
-
.add();
|
|
3062
|
-
this.shapesGroup = renderer
|
|
3063
|
-
.g('annotation-shapes')
|
|
3064
|
-
.add(this.graphic)
|
|
3065
|
-
.clip(this.chart.plotBoxClip);
|
|
3066
|
-
this.labelsGroup = renderer
|
|
3067
|
-
.g('annotation-labels')
|
|
3068
|
-
.attr({
|
|
3069
|
-
// hideOverlappingLabels requires translation
|
|
3070
|
-
translateX: 0,
|
|
3071
|
-
translateY: 0
|
|
3072
|
-
})
|
|
3073
|
-
.add(this.graphic);
|
|
3074
|
-
this.addClipPaths();
|
|
3075
|
-
if (this.clipRect) {
|
|
3076
|
-
this.graphic.clip(this.clipRect);
|
|
3077
|
-
}
|
|
3078
|
-
// Render shapes and labels before adding events (#13070).
|
|
3079
|
-
this.renderItems(this.shapes);
|
|
3080
|
-
this.renderItems(this.labels);
|
|
3081
|
-
this.addEvents();
|
|
3082
|
-
controllableMixin.render.call(this);
|
|
3083
|
-
},
|
|
3084
|
-
/**
|
|
3085
|
-
* Set the annotation's visibility.
|
|
3086
|
-
* @private
|
|
3087
|
-
* @param {boolean} [visible]
|
|
3088
|
-
* Whether to show or hide an annotation. If the param is omitted, the
|
|
3089
|
-
* annotation's visibility is toggled.
|
|
3090
|
-
*/
|
|
3091
|
-
setVisibility: function (visible) {
|
|
3092
|
-
var options = this.options,
|
|
3093
|
-
visibility = pick(visible, !options.visible);
|
|
3094
|
-
this.graphic.attr('visibility', visibility ? 'visible' : 'hidden');
|
|
3095
|
-
if (!visibility) {
|
|
3096
|
-
this.setControlPointsVisibility(false);
|
|
3097
|
-
}
|
|
3098
|
-
options.visible = visibility;
|
|
3099
|
-
},
|
|
3100
|
-
setControlPointsVisibility: function (visible) {
|
|
3101
|
-
var setItemControlPointsVisibility = function (item) {
|
|
3102
|
-
item.setControlPointsVisibility(visible);
|
|
3103
|
-
};
|
|
3104
|
-
controllableMixin.setControlPointsVisibility.call(this, visible);
|
|
3105
|
-
this.shapes.forEach(setItemControlPointsVisibility);
|
|
3106
|
-
this.labels.forEach(setItemControlPointsVisibility);
|
|
3107
|
-
},
|
|
3108
|
-
/**
|
|
3109
|
-
* Destroy the annotation. This function does not touch the chart
|
|
3110
|
-
* that the annotation belongs to (all annotations are kept in
|
|
3111
|
-
* the chart.annotations array) - it is recommended to use
|
|
3112
|
-
* {@link Highcharts.Chart#removeAnnotation} instead.
|
|
3113
|
-
* @private
|
|
3114
|
-
*/
|
|
3115
|
-
destroy: function () {
|
|
3116
|
-
var chart = this.chart,
|
|
3117
|
-
destroyItem = function (item) {
|
|
3118
|
-
item.destroy();
|
|
3119
|
-
};
|
|
3120
|
-
this.labels.forEach(destroyItem);
|
|
3121
|
-
this.shapes.forEach(destroyItem);
|
|
3122
|
-
this.clipXAxis = null;
|
|
3123
|
-
this.clipYAxis = null;
|
|
3124
|
-
erase(chart.labelCollectors, this.labelCollector);
|
|
3125
|
-
eventEmitterMixin.destroy.call(this);
|
|
3126
|
-
controllableMixin.destroy.call(this);
|
|
3127
|
-
destroyObjectProperties(this, chart);
|
|
3128
|
-
},
|
|
3129
|
-
/**
|
|
3130
|
-
* See {@link Highcharts.Chart#removeAnnotation}.
|
|
3131
|
-
* @private
|
|
3132
|
-
*/
|
|
3133
|
-
remove: function () {
|
|
3134
|
-
// Let chart.update() remove annoations on demand
|
|
3135
|
-
return this.chart.removeAnnotation(this);
|
|
3136
|
-
},
|
|
3137
|
-
/**
|
|
3138
|
-
* Updates an annotation.
|
|
3139
|
-
*
|
|
3140
|
-
* @function Highcharts.Annotation#update
|
|
3141
|
-
*
|
|
3142
|
-
* @param {Partial<Highcharts.AnnotationsOptions>} userOptions
|
|
3143
|
-
* New user options for the annotation.
|
|
3144
|
-
*
|
|
3145
|
-
* @return {void}
|
|
3146
|
-
*/
|
|
3147
|
-
update: function (userOptions, redraw) {
|
|
3148
|
-
var chart = this.chart,
|
|
3149
|
-
labelsAndShapes = this.getLabelsAndShapesOptions(this.userOptions,
|
|
3150
|
-
userOptions),
|
|
3151
|
-
userOptionsIndex = chart.annotations.indexOf(this),
|
|
3152
|
-
options = merge(true,
|
|
3153
|
-
this.userOptions,
|
|
3154
|
-
userOptions);
|
|
3155
|
-
options.labels = labelsAndShapes.labels;
|
|
3156
|
-
options.shapes = labelsAndShapes.shapes;
|
|
3157
|
-
this.destroy();
|
|
3158
|
-
this.constructor(chart, options);
|
|
3159
|
-
// Update options in chart options, used in exporting (#9767):
|
|
3160
|
-
chart.options.annotations[userOptionsIndex] = options;
|
|
3161
|
-
this.isUpdating = true;
|
|
3162
|
-
if (pick(redraw, true)) {
|
|
3163
|
-
chart.redraw();
|
|
3164
|
-
}
|
|
3165
|
-
fireEvent(this, 'afterUpdate');
|
|
3166
|
-
this.isUpdating = false;
|
|
3167
|
-
},
|
|
3168
|
-
/* *************************************************************
|
|
3169
|
-
* ITEM SECTION
|
|
3170
|
-
* Contains methods for handling a single item in an annotation
|
|
3171
|
-
**************************************************************** */
|
|
3172
|
-
/**
|
|
3173
|
-
* Initialisation of a single shape
|
|
3174
|
-
* @private
|
|
3175
|
-
* @param {Object} shapeOptions - a confg object for a single shape
|
|
3176
|
-
*/
|
|
3177
|
-
initShape: function (shapeOptions, index) {
|
|
3178
|
-
var options = merge(this.options.shapeOptions, {
|
|
3179
|
-
controlPointOptions: this.options.controlPointOptions
|
|
3180
|
-
},
|
|
3181
|
-
shapeOptions),
|
|
3182
|
-
shape = new Annotation.shapesMap[options.type](this,
|
|
3183
|
-
options,
|
|
3184
|
-
index);
|
|
3185
|
-
shape.itemType = 'shape';
|
|
3186
|
-
this.shapes.push(shape);
|
|
3187
|
-
return shape;
|
|
3188
|
-
},
|
|
3189
|
-
/**
|
|
3190
|
-
* Initialisation of a single label
|
|
3191
|
-
* @private
|
|
3192
|
-
*/
|
|
3193
|
-
initLabel: function (labelOptions, index) {
|
|
3194
|
-
var options = merge(this.options.labelOptions, {
|
|
3195
|
-
controlPointOptions: this.options.controlPointOptions
|
|
3438
|
+
*/
|
|
3439
|
+
stroke: 'rgba(0, 0, 0, 0.75)',
|
|
3440
|
+
/**
|
|
3441
|
+
* The pixel stroke width of the shape.
|
|
3442
|
+
*
|
|
3443
|
+
* @sample highcharts/annotations/shape/
|
|
3444
|
+
* Basic shape annotation
|
|
3445
|
+
*/
|
|
3446
|
+
strokeWidth: 1,
|
|
3447
|
+
/**
|
|
3448
|
+
* The color of the shape's fill.
|
|
3449
|
+
*
|
|
3450
|
+
* @sample highcharts/annotations/shape/
|
|
3451
|
+
* Basic shape annotation
|
|
3452
|
+
*
|
|
3453
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
3454
|
+
*/
|
|
3455
|
+
fill: 'rgba(0, 0, 0, 0.75)',
|
|
3456
|
+
/**
|
|
3457
|
+
* The radius of the shape.
|
|
3458
|
+
*
|
|
3459
|
+
* @sample highcharts/annotations/shape/
|
|
3460
|
+
* Basic shape annotation
|
|
3461
|
+
*/
|
|
3462
|
+
r: 0,
|
|
3463
|
+
/**
|
|
3464
|
+
* Defines additional snapping area around an annotation
|
|
3465
|
+
* making this annotation to focus. Defined in pixels.
|
|
3466
|
+
*/
|
|
3467
|
+
snap: 2
|
|
3468
|
+
},
|
|
3469
|
+
/**
|
|
3470
|
+
* Options for annotation's control points. Each control point
|
|
3471
|
+
* inherits options from controlPointOptions object.
|
|
3472
|
+
* Options from the controlPointOptions can be overwritten
|
|
3473
|
+
* by options in a specific control point.
|
|
3474
|
+
*
|
|
3475
|
+
* @declare Highcharts.AnnotationControlPointOptionsObject
|
|
3476
|
+
* @requires modules/annotations
|
|
3477
|
+
* @apioption annotations.controlPointOptions
|
|
3478
|
+
*/
|
|
3479
|
+
controlPointOptions: {
|
|
3480
|
+
/**
|
|
3481
|
+
* @type {Highcharts.AnnotationControlPointPositionerFunction}
|
|
3482
|
+
* @apioption annotations.controlPointOptions.positioner
|
|
3483
|
+
*/
|
|
3484
|
+
symbol: 'circle',
|
|
3485
|
+
width: 10,
|
|
3486
|
+
height: 10,
|
|
3487
|
+
style: {
|
|
3488
|
+
stroke: 'black',
|
|
3489
|
+
'stroke-width': 2,
|
|
3490
|
+
fill: 'white'
|
|
3196
3491
|
},
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
var hasVisiblePoints = false,
|
|
3233
|
-
label = item.graphic;
|
|
3234
|
-
item.points.forEach(function (point) {
|
|
3235
|
-
if (point.series.visible !== false &&
|
|
3236
|
-
point.visible !== false) {
|
|
3237
|
-
hasVisiblePoints = true;
|
|
3238
|
-
}
|
|
3239
|
-
});
|
|
3240
|
-
if (!hasVisiblePoints) {
|
|
3241
|
-
label.hide();
|
|
3242
|
-
}
|
|
3243
|
-
else if (label.visibility === 'hidden') {
|
|
3244
|
-
label.show();
|
|
3245
|
-
}
|
|
3246
|
-
},
|
|
3247
|
-
/**
|
|
3248
|
-
* Destroy a single item.
|
|
3249
|
-
* @private
|
|
3250
|
-
* @param {Annotation.Label|Annotation.Shape} item
|
|
3251
|
-
*/
|
|
3252
|
-
destroyItem: function (item) {
|
|
3253
|
-
// erase from shapes or labels array
|
|
3254
|
-
erase(this[item.itemType + 's'], item);
|
|
3255
|
-
item.destroy();
|
|
3256
|
-
},
|
|
3257
|
-
/**
|
|
3258
|
-
* @private
|
|
3259
|
-
*/
|
|
3260
|
-
renderItem: function (item) {
|
|
3261
|
-
item.render(item.itemType === 'label' ?
|
|
3262
|
-
this.labelsGroup :
|
|
3263
|
-
this.shapesGroup);
|
|
3492
|
+
visible: false,
|
|
3493
|
+
events: {}
|
|
3494
|
+
},
|
|
3495
|
+
/**
|
|
3496
|
+
* Event callback when annotation is added to the chart.
|
|
3497
|
+
*
|
|
3498
|
+
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
3499
|
+
* @since 7.1.0
|
|
3500
|
+
* @apioption annotations.events.add
|
|
3501
|
+
*/
|
|
3502
|
+
/**
|
|
3503
|
+
* Event callback when annotation is updated (e.g. drag and
|
|
3504
|
+
* droppped or resized by control points).
|
|
3505
|
+
*
|
|
3506
|
+
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
3507
|
+
* @since 7.1.0
|
|
3508
|
+
* @apioption annotations.events.afterUpdate
|
|
3509
|
+
*/
|
|
3510
|
+
/**
|
|
3511
|
+
* Event callback when annotation is removed from the chart.
|
|
3512
|
+
*
|
|
3513
|
+
* @type {Highcharts.EventCallbackFunction<Highcharts.Annotation>}
|
|
3514
|
+
* @since 7.1.0
|
|
3515
|
+
* @apioption annotations.events.remove
|
|
3516
|
+
*/
|
|
3517
|
+
/**
|
|
3518
|
+
* Events available in annotations.
|
|
3519
|
+
*
|
|
3520
|
+
* @requires modules/annotations
|
|
3521
|
+
*/
|
|
3522
|
+
events: {},
|
|
3523
|
+
/**
|
|
3524
|
+
* The Z index of the annotation.
|
|
3525
|
+
*/
|
|
3526
|
+
zIndex: 6
|
|
3264
3527
|
}
|
|
3265
|
-
});
|
|
3266
|
-
/**
|
|
3267
|
-
* An object uses for mapping between a shape type and a constructor.
|
|
3268
|
-
* To add a new shape type extend this object with type name as a key
|
|
3269
|
-
* and a constructor as its value.
|
|
3270
|
-
*/
|
|
3271
|
-
Annotation.shapesMap = {
|
|
3272
|
-
'rect': ControllableRect,
|
|
3273
|
-
'circle': ControllableCircle,
|
|
3274
|
-
'path': ControllablePath,
|
|
3275
|
-
'image': ControllableImage
|
|
3276
|
-
};
|
|
3277
|
-
Annotation.types = {};
|
|
3278
|
-
Annotation.MockPoint = MockPoint;
|
|
3279
|
-
Annotation.ControlPoint = ControlPoint;
|
|
3528
|
+
}));
|
|
3280
3529
|
H.extendAnnotation = function (Constructor, BaseConstructor, prototype, defaultOptions) {
|
|
3281
3530
|
BaseConstructor = BaseConstructor || Annotation;
|
|
3282
3531
|
merge(true, Constructor.prototype, BaseConstructor.prototype, prototype);
|
|
@@ -3309,6 +3558,9 @@
|
|
|
3309
3558
|
this.options.annotations.push(annotation.options);
|
|
3310
3559
|
if (pick(redraw, true)) {
|
|
3311
3560
|
annotation.redraw();
|
|
3561
|
+
annotation.graphic.attr({
|
|
3562
|
+
opacity: 1
|
|
3563
|
+
});
|
|
3312
3564
|
}
|
|
3313
3565
|
return annotation;
|
|
3314
3566
|
},
|
|
@@ -3337,6 +3589,9 @@
|
|
|
3337
3589
|
this.plotBoxClip.attr(this.plotBox);
|
|
3338
3590
|
this.annotations.forEach(function (annotation) {
|
|
3339
3591
|
annotation.redraw();
|
|
3592
|
+
annotation.graphic.animate({
|
|
3593
|
+
opacity: 1
|
|
3594
|
+
}, annotation.animationConfig);
|
|
3340
3595
|
});
|
|
3341
3596
|
}
|
|
3342
3597
|
});
|
|
@@ -3365,28 +3620,203 @@
|
|
|
3365
3620
|
chart.plotBoxClip.destroy();
|
|
3366
3621
|
chart.controlPointsGroup.destroy();
|
|
3367
3622
|
});
|
|
3623
|
+
addEvent(chart, 'exportData', function (event) {
|
|
3624
|
+
var _a,
|
|
3625
|
+
_b,
|
|
3626
|
+
_c,
|
|
3627
|
+
_d,
|
|
3628
|
+
_e,
|
|
3629
|
+
_f,
|
|
3630
|
+
_g,
|
|
3631
|
+
_h;
|
|
3632
|
+
var annotations = chart.annotations,
|
|
3633
|
+
csvColumnHeaderFormatter = ((this.options.exporting &&
|
|
3634
|
+
this.options.exporting.csv) ||
|
|
3635
|
+
{}).columnHeaderFormatter,
|
|
3636
|
+
// If second row doesn't have xValues
|
|
3637
|
+
// then it is a title row thus multiple level header is in use.
|
|
3638
|
+
multiLevelHeaders = !event.dataRows[1].xValues,
|
|
3639
|
+
annotationHeader = (_b = (_a = chart.options.lang) === null || _a === void 0 ? void 0 : _a.exportData) === null || _b === void 0 ? void 0 : _b.annotationHeader,
|
|
3640
|
+
columnHeaderFormatter = function (index) {
|
|
3641
|
+
var s;
|
|
3642
|
+
if (csvColumnHeaderFormatter) {
|
|
3643
|
+
s = csvColumnHeaderFormatter(index);
|
|
3644
|
+
if (s !== false) {
|
|
3645
|
+
return s;
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
s = annotationHeader + ' ' + index;
|
|
3649
|
+
if (multiLevelHeaders) {
|
|
3650
|
+
return {
|
|
3651
|
+
columnTitle: s,
|
|
3652
|
+
topLevelColumnTitle: s
|
|
3653
|
+
};
|
|
3654
|
+
}
|
|
3655
|
+
return s;
|
|
3656
|
+
}, startRowLength = event.dataRows[0].length, annotationSeparator = (_e = (_d = (_c = chart.options.exporting) === null || _c === void 0 ? void 0 : _c.csv) === null || _d === void 0 ? void 0 : _d.annotations) === null || _e === void 0 ? void 0 : _e.itemDelimiter, joinAnnotations = (_h = (_g = (_f = chart.options.exporting) === null || _f === void 0 ? void 0 : _f.csv) === null || _g === void 0 ? void 0 : _g.annotations) === null || _h === void 0 ? void 0 : _h.join;
|
|
3657
|
+
annotations.forEach(function (annotation) {
|
|
3658
|
+
if (annotation.options.labelOptions.includeInDataExport) {
|
|
3659
|
+
annotation.labels.forEach(function (label) {
|
|
3660
|
+
if (label.options.text) {
|
|
3661
|
+
var annotationText_1 = label.options.text;
|
|
3662
|
+
label.points.forEach(function (points) {
|
|
3663
|
+
var annotationX = points.x,
|
|
3664
|
+
xAxisIndex = points.series.xAxis ?
|
|
3665
|
+
points.series.xAxis.options.index :
|
|
3666
|
+
-1;
|
|
3667
|
+
var wasAdded = false;
|
|
3668
|
+
// Annotation not connected to any xAxis -
|
|
3669
|
+
// add new row.
|
|
3670
|
+
if (xAxisIndex === -1) {
|
|
3671
|
+
var n = event.dataRows[0].length,
|
|
3672
|
+
newRow = new Array(n);
|
|
3673
|
+
for (var i = 0; i < n; ++i) {
|
|
3674
|
+
newRow[i] = '';
|
|
3675
|
+
}
|
|
3676
|
+
newRow.push(annotationText_1);
|
|
3677
|
+
newRow.xValues = [];
|
|
3678
|
+
newRow.xValues[xAxisIndex] = annotationX;
|
|
3679
|
+
event.dataRows.push(newRow);
|
|
3680
|
+
wasAdded = true;
|
|
3681
|
+
}
|
|
3682
|
+
// Annotation placed on a exported data point
|
|
3683
|
+
// - add new column
|
|
3684
|
+
if (!wasAdded) {
|
|
3685
|
+
event.dataRows.forEach(function (row, rowIndex) {
|
|
3686
|
+
if (!wasAdded &&
|
|
3687
|
+
row.xValues &&
|
|
3688
|
+
xAxisIndex !== void 0 &&
|
|
3689
|
+
annotationX === row.xValues[xAxisIndex]) {
|
|
3690
|
+
if (joinAnnotations &&
|
|
3691
|
+
row.length > startRowLength) {
|
|
3692
|
+
row[row.length - 1] +=
|
|
3693
|
+
annotationSeparator + annotationText_1;
|
|
3694
|
+
}
|
|
3695
|
+
else {
|
|
3696
|
+
row.push(annotationText_1);
|
|
3697
|
+
}
|
|
3698
|
+
wasAdded = true;
|
|
3699
|
+
}
|
|
3700
|
+
});
|
|
3701
|
+
}
|
|
3702
|
+
// Annotation not placed on any exported data point,
|
|
3703
|
+
// but connected to the xAxis - add new row
|
|
3704
|
+
if (!wasAdded) {
|
|
3705
|
+
var n = event.dataRows[0].length,
|
|
3706
|
+
newRow = new Array(n);
|
|
3707
|
+
for (var i = 0; i < n; ++i) {
|
|
3708
|
+
newRow[i] = '';
|
|
3709
|
+
}
|
|
3710
|
+
newRow[0] = annotationX;
|
|
3711
|
+
newRow.push(annotationText_1);
|
|
3712
|
+
newRow.xValues = [];
|
|
3713
|
+
if (xAxisIndex !== void 0) {
|
|
3714
|
+
newRow.xValues[xAxisIndex] = annotationX;
|
|
3715
|
+
}
|
|
3716
|
+
event.dataRows.push(newRow);
|
|
3717
|
+
}
|
|
3718
|
+
});
|
|
3719
|
+
}
|
|
3720
|
+
});
|
|
3721
|
+
}
|
|
3722
|
+
});
|
|
3723
|
+
var maxRowLen = 0;
|
|
3724
|
+
event.dataRows.forEach(function (row) {
|
|
3725
|
+
maxRowLen = Math.max(maxRowLen, row.length);
|
|
3726
|
+
});
|
|
3727
|
+
var newRows = maxRowLen - event.dataRows[0].length;
|
|
3728
|
+
for (var i = 0; i < newRows; i++) {
|
|
3729
|
+
var header = columnHeaderFormatter(i + 1);
|
|
3730
|
+
if (multiLevelHeaders) {
|
|
3731
|
+
event.dataRows[0].push(header.topLevelColumnTitle);
|
|
3732
|
+
event.dataRows[1].push(header.columnTitle);
|
|
3733
|
+
}
|
|
3734
|
+
else {
|
|
3735
|
+
event.dataRows[0].push(header);
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
});
|
|
3368
3739
|
});
|
|
3369
|
-
wrap(
|
|
3740
|
+
wrap(Pointer.prototype, 'onContainerMouseDown', function (proceed) {
|
|
3370
3741
|
if (!this.chart.hasDraggedAnnotation) {
|
|
3371
3742
|
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
|
3372
3743
|
}
|
|
3373
3744
|
});
|
|
3745
|
+
H.Annotation = Annotation;
|
|
3374
3746
|
|
|
3747
|
+
return Annotation;
|
|
3375
3748
|
});
|
|
3376
|
-
_registerModule(_modules, '
|
|
3749
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/BasicAnnotation.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, MockPoint, U) {
|
|
3377
3750
|
/* *
|
|
3378
3751
|
*
|
|
3379
3752
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3380
3753
|
*
|
|
3381
3754
|
* */
|
|
3382
|
-
var
|
|
3755
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3756
|
+
var extendStatics = function (d,
|
|
3757
|
+
b) {
|
|
3758
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3759
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
3760
|
+
b) { d.__proto__ = b; }) ||
|
|
3761
|
+
function (d,
|
|
3762
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3763
|
+
return extendStatics(d, b);
|
|
3764
|
+
};
|
|
3765
|
+
return function (d, b) {
|
|
3766
|
+
extendStatics(d, b);
|
|
3767
|
+
function __() { this.constructor = d; }
|
|
3768
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3769
|
+
};
|
|
3770
|
+
})();
|
|
3771
|
+
var merge = U.merge;
|
|
3383
3772
|
/* eslint-disable no-invalid-this */
|
|
3384
|
-
var BasicAnnotation = function () {
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3773
|
+
var BasicAnnotation = /** @class */ (function (_super) {
|
|
3774
|
+
__extends(BasicAnnotation, _super);
|
|
3775
|
+
/* *
|
|
3776
|
+
*
|
|
3777
|
+
* Constructors
|
|
3778
|
+
*
|
|
3779
|
+
* */
|
|
3780
|
+
function BasicAnnotation(chart, options) {
|
|
3781
|
+
return _super.call(this, chart, options) || this;
|
|
3782
|
+
}
|
|
3783
|
+
/* *
|
|
3784
|
+
*
|
|
3785
|
+
* Functions
|
|
3786
|
+
*
|
|
3787
|
+
* */
|
|
3788
|
+
BasicAnnotation.prototype.addControlPoints = function () {
|
|
3789
|
+
var options = this.options,
|
|
3790
|
+
controlPoints = BasicAnnotation.basicControlPoints,
|
|
3791
|
+
annotationType = this.basicType,
|
|
3792
|
+
optionsGroup = options.labels || options.shapes;
|
|
3793
|
+
optionsGroup.forEach(function (group) {
|
|
3794
|
+
group.controlPoints = controlPoints[annotationType];
|
|
3795
|
+
});
|
|
3796
|
+
};
|
|
3797
|
+
BasicAnnotation.prototype.init = function () {
|
|
3798
|
+
var options = this.options;
|
|
3799
|
+
if (options.shapes) {
|
|
3800
|
+
delete options.labelOptions;
|
|
3801
|
+
if (options.shapes[0].type === 'circle') {
|
|
3802
|
+
this.basicType = 'circle';
|
|
3803
|
+
}
|
|
3804
|
+
else {
|
|
3805
|
+
this.basicType = 'rectangle';
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
else {
|
|
3809
|
+
delete options.shapes;
|
|
3810
|
+
this.basicType = 'label';
|
|
3811
|
+
}
|
|
3812
|
+
Annotation.prototype.init.apply(this, arguments);
|
|
3813
|
+
};
|
|
3814
|
+
/* *
|
|
3815
|
+
*
|
|
3816
|
+
* Static Properties
|
|
3817
|
+
*
|
|
3818
|
+
* */
|
|
3819
|
+
BasicAnnotation.basicControlPoints = {
|
|
3390
3820
|
label: [{
|
|
3391
3821
|
symbol: 'triangle-down',
|
|
3392
3822
|
positioner: function (target) {
|
|
@@ -3396,7 +3826,7 @@
|
|
|
3396
3826
|
y: -9e7
|
|
3397
3827
|
};
|
|
3398
3828
|
}
|
|
3399
|
-
var xy =
|
|
3829
|
+
var xy = MockPoint
|
|
3400
3830
|
.pointToPixels(target.points[0]);
|
|
3401
3831
|
return {
|
|
3402
3832
|
x: xy.x - this.graphic.width / 2,
|
|
@@ -3443,7 +3873,7 @@
|
|
|
3443
3873
|
}],
|
|
3444
3874
|
rectangle: [{
|
|
3445
3875
|
positioner: function (annotation) {
|
|
3446
|
-
var xy =
|
|
3876
|
+
var xy = MockPoint
|
|
3447
3877
|
.pointToPixels(annotation.points[2]);
|
|
3448
3878
|
return {
|
|
3449
3879
|
x: xy.x - 4,
|
|
@@ -3472,7 +3902,7 @@
|
|
|
3472
3902
|
}],
|
|
3473
3903
|
circle: [{
|
|
3474
3904
|
positioner: function (target) {
|
|
3475
|
-
var xy =
|
|
3905
|
+
var xy = MockPoint.pointToPixels(target.points[0]),
|
|
3476
3906
|
r = target.options.r;
|
|
3477
3907
|
return {
|
|
3478
3908
|
x: xy.x + r * Math.cos(Math.PI / 4) -
|
|
@@ -3497,59 +3927,73 @@
|
|
|
3497
3927
|
}
|
|
3498
3928
|
}
|
|
3499
3929
|
}]
|
|
3500
|
-
}
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
langKey = options.langKey,
|
|
3505
|
-
optionsGroup = options.labels || options.shapes;
|
|
3506
|
-
optionsGroup.forEach(function (group) {
|
|
3507
|
-
if (langKey) {
|
|
3508
|
-
group.controlPoints = controlPoints[langKey];
|
|
3509
|
-
}
|
|
3510
|
-
});
|
|
3511
|
-
}
|
|
3512
|
-
});
|
|
3930
|
+
};
|
|
3931
|
+
return BasicAnnotation;
|
|
3932
|
+
}(Annotation));
|
|
3933
|
+
BasicAnnotation.prototype.defaultOptions = merge(Annotation.prototype.defaultOptions, {});
|
|
3513
3934
|
Annotation.types.basicAnnotation = BasicAnnotation;
|
|
3514
3935
|
|
|
3515
3936
|
return BasicAnnotation;
|
|
3516
3937
|
});
|
|
3517
|
-
_registerModule(_modules, '
|
|
3938
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/CrookedLine.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, ControlPoint, MockPoint, U) {
|
|
3518
3939
|
/* *
|
|
3519
3940
|
*
|
|
3520
3941
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3521
3942
|
*
|
|
3522
3943
|
* */
|
|
3944
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3945
|
+
var extendStatics = function (d,
|
|
3946
|
+
b) {
|
|
3947
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3948
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
3949
|
+
b) { d.__proto__ = b; }) ||
|
|
3950
|
+
function (d,
|
|
3951
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3952
|
+
return extendStatics(d, b);
|
|
3953
|
+
};
|
|
3954
|
+
return function (d, b) {
|
|
3955
|
+
extendStatics(d, b);
|
|
3956
|
+
function __() { this.constructor = d; }
|
|
3957
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3958
|
+
};
|
|
3959
|
+
})();
|
|
3523
3960
|
var merge = U.merge;
|
|
3524
|
-
var Annotation = H.Annotation,
|
|
3525
|
-
MockPoint = Annotation.MockPoint,
|
|
3526
|
-
ControlPoint = Annotation.ControlPoint;
|
|
3527
3961
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
3528
|
-
var CrookedLine = function () {
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3962
|
+
var CrookedLine = /** @class */ (function (_super) {
|
|
3963
|
+
__extends(CrookedLine, _super);
|
|
3964
|
+
/* *
|
|
3965
|
+
*
|
|
3966
|
+
* Constructors
|
|
3967
|
+
*
|
|
3968
|
+
* */
|
|
3969
|
+
function CrookedLine(chart, options) {
|
|
3970
|
+
return _super.call(this, chart, options) || this;
|
|
3971
|
+
}
|
|
3972
|
+
/* *
|
|
3973
|
+
*
|
|
3974
|
+
* Functions
|
|
3975
|
+
*
|
|
3976
|
+
* */
|
|
3533
3977
|
/**
|
|
3534
3978
|
* Overrides default setter to get axes from typeOptions.
|
|
3535
3979
|
* @private
|
|
3536
3980
|
*/
|
|
3537
|
-
setClipAxes
|
|
3981
|
+
CrookedLine.prototype.setClipAxes = function () {
|
|
3538
3982
|
this.clipXAxis = this.chart.xAxis[this.options.typeOptions.xAxis];
|
|
3539
3983
|
this.clipYAxis = this.chart.yAxis[this.options.typeOptions.yAxis];
|
|
3540
|
-
}
|
|
3541
|
-
getPointsOptions
|
|
3984
|
+
};
|
|
3985
|
+
CrookedLine.prototype.getPointsOptions = function () {
|
|
3542
3986
|
var typeOptions = this.options.typeOptions;
|
|
3543
|
-
return typeOptions.points.map(function (pointOptions) {
|
|
3987
|
+
return (typeOptions.points || []).map(function (pointOptions) {
|
|
3544
3988
|
pointOptions.xAxis = typeOptions.xAxis;
|
|
3545
3989
|
pointOptions.yAxis = typeOptions.yAxis;
|
|
3546
3990
|
return pointOptions;
|
|
3547
3991
|
});
|
|
3548
|
-
}
|
|
3549
|
-
getControlPointsOptions
|
|
3992
|
+
};
|
|
3993
|
+
CrookedLine.prototype.getControlPointsOptions = function () {
|
|
3550
3994
|
return this.getPointsOptions();
|
|
3551
|
-
}
|
|
3552
|
-
addControlPoints
|
|
3995
|
+
};
|
|
3996
|
+
CrookedLine.prototype.addControlPoints = function () {
|
|
3553
3997
|
this.getControlPointsOptions().forEach(function (pointOptions, i) {
|
|
3554
3998
|
var controlPoint = new ControlPoint(this.chart,
|
|
3555
3999
|
this,
|
|
@@ -3559,8 +4003,8 @@
|
|
|
3559
4003
|
this.controlPoints.push(controlPoint);
|
|
3560
4004
|
pointOptions.controlPoint = controlPoint.options;
|
|
3561
4005
|
}, this);
|
|
3562
|
-
}
|
|
3563
|
-
addShapes
|
|
4006
|
+
};
|
|
4007
|
+
CrookedLine.prototype.addShapes = function () {
|
|
3564
4008
|
var typeOptions = this.options.typeOptions,
|
|
3565
4009
|
shape = this.initShape(merge(typeOptions.line, {
|
|
3566
4010
|
type: 'path',
|
|
@@ -3572,8 +4016,10 @@
|
|
|
3572
4016
|
})
|
|
3573
4017
|
}), false);
|
|
3574
4018
|
typeOptions.line = shape.options;
|
|
3575
|
-
}
|
|
3576
|
-
|
|
4019
|
+
};
|
|
4020
|
+
return CrookedLine;
|
|
4021
|
+
}(Annotation));
|
|
4022
|
+
CrookedLine.prototype.defaultOptions = merge(Annotation.prototype.defaultOptions,
|
|
3577
4023
|
/**
|
|
3578
4024
|
* A crooked line annotation.
|
|
3579
4025
|
*
|
|
@@ -3668,33 +4114,55 @@
|
|
|
3668
4114
|
|
|
3669
4115
|
return CrookedLine;
|
|
3670
4116
|
});
|
|
3671
|
-
_registerModule(_modules, '
|
|
4117
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/ElliottWave.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/Types/CrookedLine.js'], _modules['Core/Utilities.js']], function (Annotation, CrookedLine, U) {
|
|
3672
4118
|
/* *
|
|
3673
4119
|
*
|
|
3674
4120
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3675
4121
|
*
|
|
3676
4122
|
* */
|
|
4123
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4124
|
+
var extendStatics = function (d,
|
|
4125
|
+
b) {
|
|
4126
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4127
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
4128
|
+
b) { d.__proto__ = b; }) ||
|
|
4129
|
+
function (d,
|
|
4130
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4131
|
+
return extendStatics(d, b);
|
|
4132
|
+
};
|
|
4133
|
+
return function (d, b) {
|
|
4134
|
+
extendStatics(d, b);
|
|
4135
|
+
function __() { this.constructor = d; }
|
|
4136
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4137
|
+
};
|
|
4138
|
+
})();
|
|
3677
4139
|
var merge = U.merge;
|
|
3678
|
-
var Annotation = H.Annotation,
|
|
3679
|
-
CrookedLine = Annotation.types.crookedLine;
|
|
3680
4140
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
3681
|
-
var ElliottWave = function () {
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
4141
|
+
var ElliottWave = /** @class */ (function (_super) {
|
|
4142
|
+
__extends(ElliottWave, _super);
|
|
4143
|
+
function ElliottWave(chart, options) {
|
|
4144
|
+
return _super.call(this, chart, options) || this;
|
|
4145
|
+
}
|
|
4146
|
+
/* *
|
|
4147
|
+
*
|
|
4148
|
+
* Functions
|
|
4149
|
+
*
|
|
4150
|
+
* */
|
|
4151
|
+
ElliottWave.prototype.addLabels = function () {
|
|
3687
4152
|
this.getPointsOptions().forEach(function (point, i) {
|
|
3688
|
-
var
|
|
3689
|
-
|
|
4153
|
+
var typeOptions = this.options.typeOptions,
|
|
4154
|
+
label = this.initLabel(merge(point.label, {
|
|
4155
|
+
text: typeOptions.labels[i],
|
|
3690
4156
|
point: function (target) {
|
|
3691
4157
|
return target.annotation.points[i];
|
|
3692
4158
|
}
|
|
3693
4159
|
}), false);
|
|
3694
4160
|
point.label = label.options;
|
|
3695
4161
|
}, this);
|
|
3696
|
-
}
|
|
3697
|
-
|
|
4162
|
+
};
|
|
4163
|
+
return ElliottWave;
|
|
4164
|
+
}(CrookedLine));
|
|
4165
|
+
ElliottWave.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions,
|
|
3698
4166
|
/**
|
|
3699
4167
|
* An elliott wave annotation.
|
|
3700
4168
|
*
|
|
@@ -3734,17 +4202,29 @@
|
|
|
3734
4202
|
|
|
3735
4203
|
return ElliottWave;
|
|
3736
4204
|
});
|
|
3737
|
-
_registerModule(_modules, '
|
|
4205
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/Tunnel.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Extensions/Annotations/Types/CrookedLine.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, ControlPoint, CrookedLine, MockPoint, U) {
|
|
3738
4206
|
/* *
|
|
3739
4207
|
*
|
|
3740
4208
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3741
4209
|
*
|
|
3742
4210
|
* */
|
|
4211
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4212
|
+
var extendStatics = function (d,
|
|
4213
|
+
b) {
|
|
4214
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4215
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
4216
|
+
b) { d.__proto__ = b; }) ||
|
|
4217
|
+
function (d,
|
|
4218
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4219
|
+
return extendStatics(d, b);
|
|
4220
|
+
};
|
|
4221
|
+
return function (d, b) {
|
|
4222
|
+
extendStatics(d, b);
|
|
4223
|
+
function __() { this.constructor = d; }
|
|
4224
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4225
|
+
};
|
|
4226
|
+
})();
|
|
3743
4227
|
var merge = U.merge;
|
|
3744
|
-
var Annotation = H.Annotation,
|
|
3745
|
-
CrookedLine = Annotation.types.crookedLine,
|
|
3746
|
-
ControlPoint = Annotation.ControlPoint,
|
|
3747
|
-
MockPoint = Annotation.MockPoint;
|
|
3748
4228
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
3749
4229
|
/**
|
|
3750
4230
|
* @private
|
|
@@ -3752,40 +4232,52 @@
|
|
|
3752
4232
|
function getSecondCoordinate(p1, p2, x) {
|
|
3753
4233
|
return (p2.y - p1.y) / (p2.x - p1.x) * (x - p1.x) + p1.y;
|
|
3754
4234
|
}
|
|
3755
|
-
var Tunnel = function () {
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
4235
|
+
var Tunnel = /** @class */ (function (_super) {
|
|
4236
|
+
__extends(Tunnel, _super);
|
|
4237
|
+
/* *
|
|
4238
|
+
*
|
|
4239
|
+
* Constructors
|
|
4240
|
+
*
|
|
4241
|
+
* */
|
|
4242
|
+
function Tunnel(chart, options) {
|
|
4243
|
+
return _super.call(this, chart, options) || this;
|
|
4244
|
+
}
|
|
4245
|
+
/* *
|
|
4246
|
+
*
|
|
4247
|
+
* Functions
|
|
4248
|
+
*
|
|
4249
|
+
* */
|
|
4250
|
+
Tunnel.prototype.getPointsOptions = function () {
|
|
3761
4251
|
var pointsOptions = CrookedLine.prototype.getPointsOptions.call(this);
|
|
3762
4252
|
pointsOptions[2] = this.heightPointOptions(pointsOptions[1]);
|
|
3763
4253
|
pointsOptions[3] = this.heightPointOptions(pointsOptions[0]);
|
|
3764
4254
|
return pointsOptions;
|
|
3765
|
-
}
|
|
3766
|
-
getControlPointsOptions
|
|
4255
|
+
};
|
|
4256
|
+
Tunnel.prototype.getControlPointsOptions = function () {
|
|
3767
4257
|
return this.getPointsOptions().slice(0, 2);
|
|
3768
|
-
}
|
|
3769
|
-
heightPointOptions
|
|
3770
|
-
var heightPointOptions = merge(pointOptions)
|
|
3771
|
-
|
|
4258
|
+
};
|
|
4259
|
+
Tunnel.prototype.heightPointOptions = function (pointOptions) {
|
|
4260
|
+
var heightPointOptions = merge(pointOptions),
|
|
4261
|
+
typeOptions = this.options.typeOptions;
|
|
4262
|
+
heightPointOptions.y += typeOptions.height;
|
|
3772
4263
|
return heightPointOptions;
|
|
3773
|
-
}
|
|
3774
|
-
addControlPoints
|
|
4264
|
+
};
|
|
4265
|
+
Tunnel.prototype.addControlPoints = function () {
|
|
3775
4266
|
CrookedLine.prototype.addControlPoints.call(this);
|
|
3776
4267
|
var options = this.options,
|
|
4268
|
+
typeOptions = options.typeOptions,
|
|
3777
4269
|
controlPoint = new ControlPoint(this.chart,
|
|
3778
4270
|
this,
|
|
3779
4271
|
merge(options.controlPointOptions,
|
|
3780
|
-
|
|
4272
|
+
typeOptions.heightControlPoint), 2);
|
|
3781
4273
|
this.controlPoints.push(controlPoint);
|
|
3782
|
-
|
|
3783
|
-
}
|
|
3784
|
-
addShapes
|
|
4274
|
+
typeOptions.heightControlPoint = controlPoint.options;
|
|
4275
|
+
};
|
|
4276
|
+
Tunnel.prototype.addShapes = function () {
|
|
3785
4277
|
this.addLine();
|
|
3786
4278
|
this.addBackground();
|
|
3787
|
-
}
|
|
3788
|
-
addLine
|
|
4279
|
+
};
|
|
4280
|
+
Tunnel.prototype.addLine = function () {
|
|
3789
4281
|
var line = this.initShape(merge(this.options.typeOptions.line, {
|
|
3790
4282
|
type: 'path',
|
|
3791
4283
|
points: [
|
|
@@ -3800,14 +4292,14 @@
|
|
|
3800
4292
|
]
|
|
3801
4293
|
}), false);
|
|
3802
4294
|
this.options.typeOptions.line = line.options;
|
|
3803
|
-
}
|
|
3804
|
-
addBackground
|
|
4295
|
+
};
|
|
4296
|
+
Tunnel.prototype.addBackground = function () {
|
|
3805
4297
|
var background = this.initShape(merge(this.options.typeOptions.background, {
|
|
3806
4298
|
type: 'path',
|
|
3807
4299
|
points: this.points.slice()
|
|
3808
4300
|
}));
|
|
3809
4301
|
this.options.typeOptions.background = background.options;
|
|
3810
|
-
}
|
|
4302
|
+
};
|
|
3811
4303
|
/**
|
|
3812
4304
|
* Translate start or end ("left" or "right") side of the tunnel.
|
|
3813
4305
|
* @private
|
|
@@ -3815,23 +4307,25 @@
|
|
|
3815
4307
|
* @param {number} dy - the amount of y translation
|
|
3816
4308
|
* @param {boolean} [end] - whether to translate start or end side
|
|
3817
4309
|
*/
|
|
3818
|
-
translateSide
|
|
4310
|
+
Tunnel.prototype.translateSide = function (dx, dy, end) {
|
|
3819
4311
|
var topIndex = Number(end),
|
|
3820
4312
|
bottomIndex = topIndex === 0 ? 3 : 2;
|
|
3821
4313
|
this.translatePoint(dx, dy, topIndex);
|
|
3822
4314
|
this.translatePoint(dx, dy, bottomIndex);
|
|
3823
|
-
}
|
|
4315
|
+
};
|
|
3824
4316
|
/**
|
|
3825
4317
|
* Translate height of the tunnel.
|
|
3826
4318
|
* @private
|
|
3827
4319
|
* @param {number} dh - the amount of height translation
|
|
3828
4320
|
*/
|
|
3829
|
-
translateHeight
|
|
4321
|
+
Tunnel.prototype.translateHeight = function (dh) {
|
|
3830
4322
|
this.translatePoint(0, dh, 2);
|
|
3831
4323
|
this.translatePoint(0, dh, 3);
|
|
3832
4324
|
this.options.typeOptions.height = this.points[3].y - this.points[0].y;
|
|
3833
|
-
}
|
|
3834
|
-
|
|
4325
|
+
};
|
|
4326
|
+
return Tunnel;
|
|
4327
|
+
}(CrookedLine));
|
|
4328
|
+
Tunnel.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions,
|
|
3835
4329
|
/**
|
|
3836
4330
|
* A tunnel annotation.
|
|
3837
4331
|
*
|
|
@@ -3911,109 +4405,134 @@
|
|
|
3911
4405
|
|
|
3912
4406
|
return Tunnel;
|
|
3913
4407
|
});
|
|
3914
|
-
_registerModule(_modules, '
|
|
4408
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/InfinityLine.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/Types/CrookedLine.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, CrookedLine, MockPoint, U) {
|
|
3915
4409
|
/* *
|
|
3916
4410
|
*
|
|
3917
4411
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3918
4412
|
*
|
|
3919
4413
|
* */
|
|
4414
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4415
|
+
var extendStatics = function (d,
|
|
4416
|
+
b) {
|
|
4417
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4418
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
4419
|
+
b) { d.__proto__ = b; }) ||
|
|
4420
|
+
function (d,
|
|
4421
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4422
|
+
return extendStatics(d, b);
|
|
4423
|
+
};
|
|
4424
|
+
return function (d, b) {
|
|
4425
|
+
extendStatics(d, b);
|
|
4426
|
+
function __() { this.constructor = d; }
|
|
4427
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4428
|
+
};
|
|
4429
|
+
})();
|
|
3920
4430
|
var merge = U.merge;
|
|
3921
|
-
var Annotation = H.Annotation,
|
|
3922
|
-
MockPoint = Annotation.MockPoint,
|
|
3923
|
-
CrookedLine = Annotation.types.crookedLine;
|
|
3924
4431
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
3925
|
-
var InfinityLine = function () {
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
(edgePointFirstCoordinate - firstPoint[xOrYOpposite]) /
|
|
3935
|
-
(secondPoint[xOrYOpposite] - firstPoint[xOrYOpposite]) +
|
|
3936
|
-
firstPoint[xOrY]);
|
|
3937
|
-
};
|
|
3938
|
-
InfinityLine.findEdgePoint = function (firstPoint, secondPoint) {
|
|
3939
|
-
var xAxis = firstPoint.series.xAxis,
|
|
3940
|
-
yAxis = secondPoint.series.yAxis,
|
|
3941
|
-
firstPointPixels = MockPoint.pointToPixels(firstPoint),
|
|
3942
|
-
secondPointPixels = MockPoint.pointToPixels(secondPoint),
|
|
3943
|
-
deltaX = secondPointPixels.x - firstPointPixels.x,
|
|
3944
|
-
deltaY = secondPointPixels.y - firstPointPixels.y,
|
|
3945
|
-
xAxisMin = xAxis.left,
|
|
3946
|
-
xAxisMax = xAxisMin + xAxis.width,
|
|
3947
|
-
yAxisMin = yAxis.top,
|
|
3948
|
-
yAxisMax = yAxisMin + yAxis.height,
|
|
3949
|
-
xLimit = deltaX < 0 ? xAxisMin : xAxisMax,
|
|
3950
|
-
yLimit = deltaY < 0 ? yAxisMin : yAxisMax,
|
|
3951
|
-
edgePoint = {
|
|
3952
|
-
x: deltaX === 0 ? firstPointPixels.x : xLimit,
|
|
3953
|
-
y: deltaY === 0 ? firstPointPixels.y : yLimit
|
|
3954
|
-
},
|
|
3955
|
-
edgePointX,
|
|
3956
|
-
edgePointY,
|
|
3957
|
-
swap;
|
|
3958
|
-
if (deltaX !== 0 && deltaY !== 0) {
|
|
3959
|
-
edgePointY = InfinityLine.findEdgeCoordinate(firstPointPixels, secondPointPixels, 'y', xLimit);
|
|
3960
|
-
edgePointX = InfinityLine.findEdgeCoordinate(firstPointPixels, secondPointPixels, 'x', yLimit);
|
|
3961
|
-
if (edgePointY >= yAxisMin && edgePointY <= yAxisMax) {
|
|
3962
|
-
edgePoint.x = xLimit;
|
|
3963
|
-
edgePoint.y = edgePointY;
|
|
3964
|
-
}
|
|
3965
|
-
else {
|
|
3966
|
-
edgePoint.x = edgePointX;
|
|
3967
|
-
edgePoint.y = yLimit;
|
|
3968
|
-
}
|
|
3969
|
-
}
|
|
3970
|
-
edgePoint.x -= xAxisMin;
|
|
3971
|
-
edgePoint.y -= yAxisMin;
|
|
3972
|
-
if (firstPoint.series.chart.inverted) {
|
|
3973
|
-
swap = edgePoint.x;
|
|
3974
|
-
edgePoint.x = edgePoint.y;
|
|
3975
|
-
edgePoint.y = swap;
|
|
4432
|
+
var InfinityLine = /** @class */ (function (_super) {
|
|
4433
|
+
__extends(InfinityLine, _super);
|
|
4434
|
+
/* *
|
|
4435
|
+
*
|
|
4436
|
+
* Constructors
|
|
4437
|
+
*
|
|
4438
|
+
* */
|
|
4439
|
+
function InfinityLine(chart, options) {
|
|
4440
|
+
return _super.call(this, chart, options) || this;
|
|
3976
4441
|
}
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
4442
|
+
/* *
|
|
4443
|
+
*
|
|
4444
|
+
* Static Functions
|
|
4445
|
+
*
|
|
4446
|
+
* */
|
|
4447
|
+
InfinityLine.edgePoint = function (startIndex, endIndex) {
|
|
3981
4448
|
return function (target) {
|
|
3982
4449
|
var annotation = target.annotation,
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4450
|
+
points = annotation.points,
|
|
4451
|
+
type = annotation.options.typeOptions.type;
|
|
4452
|
+
if (type === 'horizontalLine') {
|
|
4453
|
+
// Horizontal line has only one point,
|
|
4454
|
+
// make a copy of it:
|
|
4455
|
+
points = [
|
|
4456
|
+
points[0],
|
|
4457
|
+
new MockPoint(annotation.chart, points[0].target, {
|
|
4458
|
+
x: points[0].x + 1,
|
|
4459
|
+
y: points[0].y,
|
|
4460
|
+
xAxis: points[0].options.xAxis,
|
|
4461
|
+
yAxis: points[0].options.yAxis
|
|
4462
|
+
})
|
|
4463
|
+
];
|
|
4464
|
+
}
|
|
4465
|
+
else if (type === 'verticalLine') {
|
|
4466
|
+
// The same for verticalLine type:
|
|
4467
|
+
points = [
|
|
4468
|
+
points[0],
|
|
4469
|
+
new MockPoint(annotation.chart, points[0].target, {
|
|
4470
|
+
x: points[0].x,
|
|
4471
|
+
y: points[0].y + 1,
|
|
4472
|
+
xAxis: points[0].options.xAxis,
|
|
4473
|
+
yAxis: points[0].options.yAxis
|
|
4474
|
+
})
|
|
4475
|
+
];
|
|
4476
|
+
}
|
|
4477
|
+
return InfinityLine.findEdgePoint(points[startIndex], points[endIndex]);
|
|
4478
|
+
};
|
|
4479
|
+
};
|
|
4480
|
+
InfinityLine.findEdgeCoordinate = function (firstPoint, secondPoint, xOrY, edgePointFirstCoordinate) {
|
|
4481
|
+
var xOrYOpposite = xOrY === 'x' ? 'y' : 'x';
|
|
4482
|
+
// solves equation for x or y
|
|
4483
|
+
// y - y1 = (y2 - y1) / (x2 - x1) * (x - x1)
|
|
4484
|
+
return ((secondPoint[xOrY] - firstPoint[xOrY]) *
|
|
4485
|
+
(edgePointFirstCoordinate - firstPoint[xOrYOpposite]) /
|
|
4486
|
+
(secondPoint[xOrYOpposite] - firstPoint[xOrYOpposite]) +
|
|
4487
|
+
firstPoint[xOrY]);
|
|
4488
|
+
};
|
|
4489
|
+
InfinityLine.findEdgePoint = function (firstPoint, secondPoint) {
|
|
4490
|
+
var xAxis = firstPoint.series.xAxis,
|
|
4491
|
+
yAxis = secondPoint.series.yAxis,
|
|
4492
|
+
firstPointPixels = MockPoint.pointToPixels(firstPoint),
|
|
4493
|
+
secondPointPixels = MockPoint.pointToPixels(secondPoint),
|
|
4494
|
+
deltaX = secondPointPixels.x - firstPointPixels.x,
|
|
4495
|
+
deltaY = secondPointPixels.y - firstPointPixels.y,
|
|
4496
|
+
xAxisMin = xAxis.left,
|
|
4497
|
+
xAxisMax = xAxisMin + xAxis.width,
|
|
4498
|
+
yAxisMin = yAxis.top,
|
|
4499
|
+
yAxisMax = yAxisMin + yAxis.height,
|
|
4500
|
+
xLimit = deltaX < 0 ? xAxisMin : xAxisMax,
|
|
4501
|
+
yLimit = deltaY < 0 ? yAxisMin : yAxisMax,
|
|
4502
|
+
edgePoint = {
|
|
4503
|
+
x: deltaX === 0 ? firstPointPixels.x : xLimit,
|
|
4504
|
+
y: deltaY === 0 ? firstPointPixels.y : yLimit
|
|
4505
|
+
},
|
|
4506
|
+
edgePointX,
|
|
4507
|
+
edgePointY,
|
|
4508
|
+
swap;
|
|
4509
|
+
if (deltaX !== 0 && deltaY !== 0) {
|
|
4510
|
+
edgePointY = InfinityLine.findEdgeCoordinate(firstPointPixels, secondPointPixels, 'y', xLimit);
|
|
4511
|
+
edgePointX = InfinityLine.findEdgeCoordinate(firstPointPixels, secondPointPixels, 'x', yLimit);
|
|
4512
|
+
if (edgePointY >= yAxisMin && edgePointY <= yAxisMax) {
|
|
4513
|
+
edgePoint.x = xLimit;
|
|
4514
|
+
edgePoint.y = edgePointY;
|
|
4515
|
+
}
|
|
4516
|
+
else {
|
|
4517
|
+
edgePoint.x = edgePointX;
|
|
4518
|
+
edgePoint.y = yLimit;
|
|
4519
|
+
}
|
|
3997
4520
|
}
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
y: points[0].y + 1,
|
|
4005
|
-
xAxis: points[0].options.xAxis,
|
|
4006
|
-
yAxis: points[0].options.yAxis
|
|
4007
|
-
})
|
|
4008
|
-
];
|
|
4521
|
+
edgePoint.x -= xAxisMin;
|
|
4522
|
+
edgePoint.y -= yAxisMin;
|
|
4523
|
+
if (firstPoint.series.chart.inverted) {
|
|
4524
|
+
swap = edgePoint.x;
|
|
4525
|
+
edgePoint.x = edgePoint.y;
|
|
4526
|
+
edgePoint.y = swap;
|
|
4009
4527
|
}
|
|
4010
|
-
return
|
|
4528
|
+
return edgePoint;
|
|
4011
4529
|
};
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4530
|
+
/* *
|
|
4531
|
+
*
|
|
4532
|
+
* Functions
|
|
4533
|
+
*
|
|
4534
|
+
* */
|
|
4535
|
+
InfinityLine.prototype.addShapes = function () {
|
|
4017
4536
|
var typeOptions = this.options.typeOptions,
|
|
4018
4537
|
points = [
|
|
4019
4538
|
this.points[0],
|
|
@@ -4028,8 +4547,17 @@
|
|
|
4028
4547
|
}),
|
|
4029
4548
|
false);
|
|
4030
4549
|
typeOptions.line = line.options;
|
|
4031
|
-
}
|
|
4032
|
-
|
|
4550
|
+
};
|
|
4551
|
+
/**
|
|
4552
|
+
*
|
|
4553
|
+
* Static Properties
|
|
4554
|
+
*
|
|
4555
|
+
*/
|
|
4556
|
+
InfinityLine.endEdgePoint = InfinityLine.edgePoint(0, 1);
|
|
4557
|
+
InfinityLine.startEdgePoint = InfinityLine.edgePoint(1, 0);
|
|
4558
|
+
return InfinityLine;
|
|
4559
|
+
}(CrookedLine));
|
|
4560
|
+
InfinityLine.prototype.defaultOptions = merge(CrookedLine.prototype.defaultOptions, {});
|
|
4033
4561
|
/**
|
|
4034
4562
|
* An infinity line annotation.
|
|
4035
4563
|
*
|
|
@@ -4044,16 +4572,29 @@
|
|
|
4044
4572
|
|
|
4045
4573
|
return InfinityLine;
|
|
4046
4574
|
});
|
|
4047
|
-
_registerModule(_modules, '
|
|
4575
|
+
_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) {
|
|
4048
4576
|
/* *
|
|
4049
4577
|
*
|
|
4050
4578
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4051
4579
|
*
|
|
4052
4580
|
* */
|
|
4581
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4582
|
+
var extendStatics = function (d,
|
|
4583
|
+
b) {
|
|
4584
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4585
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
4586
|
+
b) { d.__proto__ = b; }) ||
|
|
4587
|
+
function (d,
|
|
4588
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4589
|
+
return extendStatics(d, b);
|
|
4590
|
+
};
|
|
4591
|
+
return function (d, b) {
|
|
4592
|
+
extendStatics(d, b);
|
|
4593
|
+
function __() { this.constructor = d; }
|
|
4594
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4595
|
+
};
|
|
4596
|
+
})();
|
|
4053
4597
|
var merge = U.merge;
|
|
4054
|
-
var Annotation = H.Annotation,
|
|
4055
|
-
MockPoint = Annotation.MockPoint,
|
|
4056
|
-
Tunnel = Annotation.types.tunnel;
|
|
4057
4598
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4058
4599
|
var createPathDGenerator = function (retracementIndex,
|
|
4059
4600
|
isBackground) {
|
|
@@ -4079,19 +4620,27 @@
|
|
|
4079
4620
|
return d;
|
|
4080
4621
|
};
|
|
4081
4622
|
};
|
|
4082
|
-
var Fibonacci = function () {
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4623
|
+
var Fibonacci = /** @class */ (function (_super) {
|
|
4624
|
+
__extends(Fibonacci, _super);
|
|
4625
|
+
/* *
|
|
4626
|
+
*
|
|
4627
|
+
* Constructors
|
|
4628
|
+
*
|
|
4629
|
+
* */
|
|
4630
|
+
function Fibonacci(chart, options) {
|
|
4631
|
+
return _super.call(this, chart, options) || this;
|
|
4632
|
+
}
|
|
4633
|
+
/* *
|
|
4634
|
+
*
|
|
4635
|
+
* Functions
|
|
4636
|
+
*
|
|
4637
|
+
* */
|
|
4638
|
+
Fibonacci.prototype.linkPoints = function () {
|
|
4639
|
+
_super.prototype.linkPoints.call(this);
|
|
4091
4640
|
this.linkRetracementsPoints();
|
|
4092
4641
|
return;
|
|
4093
|
-
}
|
|
4094
|
-
linkRetracementsPoints
|
|
4642
|
+
};
|
|
4643
|
+
Fibonacci.prototype.linkRetracementsPoints = function () {
|
|
4095
4644
|
var points = this.points,
|
|
4096
4645
|
startDiff = points[0].y - points[3].y,
|
|
4097
4646
|
endDiff = points[1].y - points[2].y,
|
|
@@ -4100,11 +4649,13 @@
|
|
|
4100
4649
|
Fibonacci.levels.forEach(function (level, i) {
|
|
4101
4650
|
var startRetracement = points[0].y - startDiff * level,
|
|
4102
4651
|
endRetracement = points[1].y - endDiff * level;
|
|
4652
|
+
this.startRetracements = this.startRetracements || [];
|
|
4653
|
+
this.endRetracements = this.endRetracements || [];
|
|
4103
4654
|
this.linkRetracementPoint(i, startX, startRetracement, this.startRetracements);
|
|
4104
4655
|
this.linkRetracementPoint(i, endX, endRetracement, this.endRetracements);
|
|
4105
4656
|
}, this);
|
|
4106
|
-
}
|
|
4107
|
-
linkRetracementPoint
|
|
4657
|
+
};
|
|
4658
|
+
Fibonacci.prototype.linkRetracementPoint = function (pointIndex, x, y, retracements) {
|
|
4108
4659
|
var point = retracements[pointIndex],
|
|
4109
4660
|
typeOptions = this.options.typeOptions;
|
|
4110
4661
|
if (!point) {
|
|
@@ -4120,8 +4671,8 @@
|
|
|
4120
4671
|
point.options.y = y;
|
|
4121
4672
|
point.refresh();
|
|
4122
4673
|
}
|
|
4123
|
-
}
|
|
4124
|
-
addShapes
|
|
4674
|
+
};
|
|
4675
|
+
Fibonacci.prototype.addShapes = function () {
|
|
4125
4676
|
Fibonacci.levels.forEach(function (_level, i) {
|
|
4126
4677
|
this.initShape({
|
|
4127
4678
|
type: 'path',
|
|
@@ -4136,8 +4687,8 @@
|
|
|
4136
4687
|
});
|
|
4137
4688
|
}
|
|
4138
4689
|
}, this);
|
|
4139
|
-
}
|
|
4140
|
-
addLabels
|
|
4690
|
+
};
|
|
4691
|
+
Fibonacci.prototype.addLabels = function () {
|
|
4141
4692
|
Fibonacci.levels.forEach(function (level, i) {
|
|
4142
4693
|
var options = this.options.typeOptions,
|
|
4143
4694
|
label = this.initLabel(merge(options.labels[i], {
|
|
@@ -4149,8 +4700,16 @@
|
|
|
4149
4700
|
}));
|
|
4150
4701
|
options.labels[i] = label.options;
|
|
4151
4702
|
}, this);
|
|
4152
|
-
}
|
|
4153
|
-
|
|
4703
|
+
};
|
|
4704
|
+
/* *
|
|
4705
|
+
*
|
|
4706
|
+
* Static properties
|
|
4707
|
+
*
|
|
4708
|
+
* */
|
|
4709
|
+
Fibonacci.levels = [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1];
|
|
4710
|
+
return Fibonacci;
|
|
4711
|
+
}(Tunnel));
|
|
4712
|
+
Fibonacci.prototype.defaultOptions = merge(Tunnel.prototype.defaultOptions,
|
|
4154
4713
|
/**
|
|
4155
4714
|
* A fibonacci annotation.
|
|
4156
4715
|
*
|
|
@@ -4225,46 +4784,72 @@
|
|
|
4225
4784
|
|
|
4226
4785
|
return Fibonacci;
|
|
4227
4786
|
});
|
|
4228
|
-
_registerModule(_modules, '
|
|
4787
|
+
_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) {
|
|
4229
4788
|
/* *
|
|
4230
4789
|
*
|
|
4231
4790
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4232
4791
|
*
|
|
4233
4792
|
* */
|
|
4793
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4794
|
+
var extendStatics = function (d,
|
|
4795
|
+
b) {
|
|
4796
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4797
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
4798
|
+
b) { d.__proto__ = b; }) ||
|
|
4799
|
+
function (d,
|
|
4800
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4801
|
+
return extendStatics(d, b);
|
|
4802
|
+
};
|
|
4803
|
+
return function (d, b) {
|
|
4804
|
+
extendStatics(d, b);
|
|
4805
|
+
function __() { this.constructor = d; }
|
|
4806
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4807
|
+
};
|
|
4808
|
+
})();
|
|
4234
4809
|
var merge = U.merge;
|
|
4235
|
-
var Annotation = H.Annotation,
|
|
4236
|
-
MockPoint = Annotation.MockPoint,
|
|
4237
|
-
InfinityLine = Annotation.types.infinityLine;
|
|
4238
4810
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4239
|
-
var Pitchfork = function () {
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
return InfinityLine.findEdgePoint(points[0], new MockPoint(annotation.chart, target, annotation.midPointOptions()));
|
|
4256
|
-
};
|
|
4257
|
-
var outerLineEdgePoint = function (firstPointIndex) {
|
|
4811
|
+
var Pitchfork = /** @class */ (function (_super) {
|
|
4812
|
+
__extends(Pitchfork, _super);
|
|
4813
|
+
/* *
|
|
4814
|
+
*
|
|
4815
|
+
* Constructors
|
|
4816
|
+
*
|
|
4817
|
+
* */
|
|
4818
|
+
function Pitchfork(chart, options) {
|
|
4819
|
+
return _super.call(this, chart, options) || this;
|
|
4820
|
+
}
|
|
4821
|
+
/* *
|
|
4822
|
+
*
|
|
4823
|
+
* Static Functions
|
|
4824
|
+
*
|
|
4825
|
+
* */
|
|
4826
|
+
Pitchfork.outerLineEdgePoint = function (firstPointIndex) {
|
|
4258
4827
|
return function (target) {
|
|
4259
4828
|
var annotation = target.annotation,
|
|
4260
|
-
|
|
4261
|
-
|
|
4829
|
+
points = annotation.points;
|
|
4830
|
+
return Pitchfork.findEdgePoint(points[firstPointIndex], points[0], new MockPoint(annotation.chart, target, annotation.midPointOptions()));
|
|
4831
|
+
};
|
|
4262
4832
|
};
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4833
|
+
Pitchfork.findEdgePoint = function (point, firstAnglePoint, secondAnglePoint) {
|
|
4834
|
+
var angle = Math.atan2(secondAnglePoint.plotY - firstAnglePoint.plotY,
|
|
4835
|
+
secondAnglePoint.plotX - firstAnglePoint.plotX),
|
|
4836
|
+
distance = 1e7;
|
|
4837
|
+
return {
|
|
4838
|
+
x: point.plotX + distance * Math.cos(angle),
|
|
4839
|
+
y: point.plotY + distance * Math.sin(angle)
|
|
4840
|
+
};
|
|
4841
|
+
};
|
|
4842
|
+
Pitchfork.middleLineEdgePoint = function (target) {
|
|
4843
|
+
var annotation = target.annotation,
|
|
4844
|
+
points = annotation.points;
|
|
4845
|
+
return InfinityLine.findEdgePoint(points[0], new MockPoint(annotation.chart, target, annotation.midPointOptions()));
|
|
4846
|
+
};
|
|
4847
|
+
/* *
|
|
4848
|
+
*
|
|
4849
|
+
* Functions
|
|
4850
|
+
*
|
|
4851
|
+
* */
|
|
4852
|
+
Pitchfork.prototype.midPointOptions = function () {
|
|
4268
4853
|
var points = this.points;
|
|
4269
4854
|
return {
|
|
4270
4855
|
x: (points[1].x + points[2].x) / 2,
|
|
@@ -4272,12 +4857,12 @@
|
|
|
4272
4857
|
xAxis: points[0].series.xAxis,
|
|
4273
4858
|
yAxis: points[0].series.yAxis
|
|
4274
4859
|
};
|
|
4275
|
-
}
|
|
4276
|
-
addShapes
|
|
4860
|
+
};
|
|
4861
|
+
Pitchfork.prototype.addShapes = function () {
|
|
4277
4862
|
this.addLines();
|
|
4278
4863
|
this.addBackgrounds();
|
|
4279
|
-
}
|
|
4280
|
-
addLines
|
|
4864
|
+
};
|
|
4865
|
+
Pitchfork.prototype.addLines = function () {
|
|
4281
4866
|
this.initShape({
|
|
4282
4867
|
type: 'path',
|
|
4283
4868
|
points: [
|
|
@@ -4299,8 +4884,8 @@
|
|
|
4299
4884
|
Pitchfork.bottomLineEdgePoint
|
|
4300
4885
|
]
|
|
4301
4886
|
}, false);
|
|
4302
|
-
}
|
|
4303
|
-
addBackgrounds
|
|
4887
|
+
};
|
|
4888
|
+
Pitchfork.prototype.addBackgrounds = function () {
|
|
4304
4889
|
var shapes = this.shapes,
|
|
4305
4890
|
typeOptions = this.options.typeOptions;
|
|
4306
4891
|
var innerBackground = this.initShape(merge(typeOptions.innerBackground, {
|
|
@@ -4343,8 +4928,17 @@
|
|
|
4343
4928
|
}));
|
|
4344
4929
|
typeOptions.innerBackground = innerBackground.options;
|
|
4345
4930
|
typeOptions.outerBackground = outerBackground.options;
|
|
4346
|
-
}
|
|
4347
|
-
|
|
4931
|
+
};
|
|
4932
|
+
/**
|
|
4933
|
+
*
|
|
4934
|
+
* Static Properties
|
|
4935
|
+
*
|
|
4936
|
+
*/
|
|
4937
|
+
Pitchfork.topLineEdgePoint = Pitchfork.outerLineEdgePoint(1);
|
|
4938
|
+
Pitchfork.bottomLineEdgePoint = Pitchfork.outerLineEdgePoint(0);
|
|
4939
|
+
return Pitchfork;
|
|
4940
|
+
}(InfinityLine));
|
|
4941
|
+
Pitchfork.prototype.defaultOptions = merge(InfinityLine.prototype.defaultOptions,
|
|
4348
4942
|
/**
|
|
4349
4943
|
* A pitchfork annotation.
|
|
4350
4944
|
*
|
|
@@ -4383,58 +4977,87 @@
|
|
|
4383
4977
|
|
|
4384
4978
|
return Pitchfork;
|
|
4385
4979
|
});
|
|
4386
|
-
_registerModule(_modules, '
|
|
4980
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/VerticalLine.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/MockPoint.js'], _modules['Core/Utilities.js']], function (Annotation, MockPoint, U) {
|
|
4387
4981
|
/* *
|
|
4388
4982
|
*
|
|
4389
4983
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4390
4984
|
*
|
|
4391
4985
|
* */
|
|
4986
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4987
|
+
var extendStatics = function (d,
|
|
4988
|
+
b) {
|
|
4989
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4990
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
4991
|
+
b) { d.__proto__ = b; }) ||
|
|
4992
|
+
function (d,
|
|
4993
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4994
|
+
return extendStatics(d, b);
|
|
4995
|
+
};
|
|
4996
|
+
return function (d, b) {
|
|
4997
|
+
extendStatics(d, b);
|
|
4998
|
+
function __() { this.constructor = d; }
|
|
4999
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5000
|
+
};
|
|
5001
|
+
})();
|
|
4392
5002
|
var merge = U.merge;
|
|
4393
|
-
var Annotation = H.Annotation,
|
|
4394
|
-
MockPoint = Annotation.MockPoint;
|
|
4395
5003
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4396
|
-
var VerticalLine = function () {
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
y = xy.y,
|
|
4406
|
-
offset = annotation.options.typeOptions.label.offset;
|
|
4407
|
-
if (annotation.chart.inverted) {
|
|
4408
|
-
y = xy.x;
|
|
5004
|
+
var VerticalLine = /** @class */ (function (_super) {
|
|
5005
|
+
__extends(VerticalLine, _super);
|
|
5006
|
+
/* *
|
|
5007
|
+
*
|
|
5008
|
+
* Constructors
|
|
5009
|
+
*
|
|
5010
|
+
* */
|
|
5011
|
+
function VerticalLine(chart, userOptions) {
|
|
5012
|
+
return _super.call(this, chart, userOptions) || this;
|
|
4409
5013
|
}
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
5014
|
+
/* *
|
|
5015
|
+
*
|
|
5016
|
+
* Static Functions
|
|
5017
|
+
*
|
|
5018
|
+
* */
|
|
5019
|
+
VerticalLine.connectorFirstPoint = function (target) {
|
|
5020
|
+
var annotation = target.annotation,
|
|
5021
|
+
point = annotation.points[0],
|
|
5022
|
+
xy = MockPoint.pointToPixels(point,
|
|
5023
|
+
true),
|
|
5024
|
+
y = xy.y,
|
|
5025
|
+
offset = annotation.options.typeOptions.label.offset;
|
|
5026
|
+
if (annotation.chart.inverted) {
|
|
5027
|
+
y = xy.x;
|
|
5028
|
+
}
|
|
5029
|
+
return {
|
|
5030
|
+
x: point.x,
|
|
5031
|
+
xAxis: point.series.xAxis,
|
|
5032
|
+
y: y + offset
|
|
5033
|
+
};
|
|
4414
5034
|
};
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
5035
|
+
VerticalLine.connectorSecondPoint = function (target) {
|
|
5036
|
+
var annotation = target.annotation,
|
|
5037
|
+
typeOptions = annotation.options.typeOptions,
|
|
5038
|
+
point = annotation.points[0],
|
|
5039
|
+
yOffset = typeOptions.yOffset,
|
|
5040
|
+
xy = MockPoint.pointToPixels(point,
|
|
5041
|
+
true),
|
|
5042
|
+
y = xy[annotation.chart.inverted ? 'x' : 'y'];
|
|
5043
|
+
if (typeOptions.label.offset < 0) {
|
|
5044
|
+
yOffset *= -1;
|
|
5045
|
+
}
|
|
5046
|
+
return {
|
|
5047
|
+
x: point.x,
|
|
5048
|
+
xAxis: point.series.xAxis,
|
|
5049
|
+
y: y + yOffset
|
|
5050
|
+
};
|
|
4431
5051
|
};
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
5052
|
+
/* *
|
|
5053
|
+
*
|
|
5054
|
+
* Functions
|
|
5055
|
+
*
|
|
5056
|
+
* */
|
|
5057
|
+
VerticalLine.prototype.getPointsOptions = function () {
|
|
4435
5058
|
return [this.options.typeOptions.point];
|
|
4436
|
-
}
|
|
4437
|
-
addShapes
|
|
5059
|
+
};
|
|
5060
|
+
VerticalLine.prototype.addShapes = function () {
|
|
4438
5061
|
var typeOptions = this.options.typeOptions,
|
|
4439
5062
|
connector = this.initShape(merge(typeOptions.connector, {
|
|
4440
5063
|
type: 'path',
|
|
@@ -4445,8 +5068,8 @@
|
|
|
4445
5068
|
}),
|
|
4446
5069
|
false);
|
|
4447
5070
|
typeOptions.connector = connector.options;
|
|
4448
|
-
}
|
|
4449
|
-
addLabels
|
|
5071
|
+
};
|
|
5072
|
+
VerticalLine.prototype.addLabels = function () {
|
|
4450
5073
|
var typeOptions = this.options.typeOptions, labelOptions = typeOptions.label, x = 0, y = labelOptions.offset, verticalAlign = labelOptions.offset < 0 ? 'bottom' : 'top', align = 'center';
|
|
4451
5074
|
if (this.chart.inverted) {
|
|
4452
5075
|
x = labelOptions.offset;
|
|
@@ -4461,8 +5084,10 @@
|
|
|
4461
5084
|
y: y
|
|
4462
5085
|
}));
|
|
4463
5086
|
typeOptions.label = label.options;
|
|
4464
|
-
}
|
|
4465
|
-
|
|
5087
|
+
};
|
|
5088
|
+
return VerticalLine;
|
|
5089
|
+
}(Annotation));
|
|
5090
|
+
VerticalLine.prototype.defaultOptions = merge(Annotation.prototype.defaultOptions,
|
|
4466
5091
|
/**
|
|
4467
5092
|
* A vertical line annotation.
|
|
4468
5093
|
*
|
|
@@ -4514,60 +5139,83 @@
|
|
|
4514
5139
|
|
|
4515
5140
|
return VerticalLine;
|
|
4516
5141
|
});
|
|
4517
|
-
_registerModule(_modules, '
|
|
5142
|
+
_registerModule(_modules, 'Extensions/Annotations/Types/Measure.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Extensions/Annotations/ControlPoint.js'], _modules['Core/Utilities.js']], function (Annotation, ControlPoint, U) {
|
|
4518
5143
|
/* *
|
|
4519
5144
|
*
|
|
4520
5145
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4521
5146
|
*
|
|
4522
5147
|
* */
|
|
5148
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5149
|
+
var extendStatics = function (d,
|
|
5150
|
+
b) {
|
|
5151
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5152
|
+
({ __proto__: [] } instanceof Array && function (d,
|
|
5153
|
+
b) { d.__proto__ = b; }) ||
|
|
5154
|
+
function (d,
|
|
5155
|
+
b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
5156
|
+
return extendStatics(d, b);
|
|
5157
|
+
};
|
|
5158
|
+
return function (d, b) {
|
|
5159
|
+
extendStatics(d, b);
|
|
5160
|
+
function __() { this.constructor = d; }
|
|
5161
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5162
|
+
};
|
|
5163
|
+
})();
|
|
4523
5164
|
var extend = U.extend,
|
|
4524
5165
|
isNumber = U.isNumber,
|
|
4525
5166
|
merge = U.merge;
|
|
4526
|
-
var Annotation = H.Annotation,
|
|
4527
|
-
ControlPoint = Annotation.ControlPoint;
|
|
4528
5167
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4529
|
-
var Measure = function () {
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
5168
|
+
var Measure = /** @class */ (function (_super) {
|
|
5169
|
+
__extends(Measure, _super);
|
|
5170
|
+
/* *
|
|
5171
|
+
*
|
|
5172
|
+
* Constructors
|
|
5173
|
+
*
|
|
5174
|
+
* */
|
|
5175
|
+
function Measure(chart, userOptions) {
|
|
5176
|
+
return _super.call(this, chart, userOptions) || this;
|
|
5177
|
+
}
|
|
5178
|
+
/* *
|
|
5179
|
+
*
|
|
5180
|
+
* Functions
|
|
5181
|
+
*
|
|
5182
|
+
* */
|
|
4535
5183
|
/**
|
|
4536
5184
|
* Init annotation object.
|
|
4537
5185
|
* @private
|
|
4538
5186
|
*/
|
|
4539
|
-
init
|
|
4540
|
-
Annotation.prototype.init.
|
|
5187
|
+
Measure.prototype.init = function (annotationOrChart, userOptions, index) {
|
|
5188
|
+
Annotation.prototype.init.call(this, annotationOrChart, userOptions, index);
|
|
4541
5189
|
this.offsetX = 0;
|
|
4542
5190
|
this.offsetY = 0;
|
|
4543
5191
|
this.resizeX = 0;
|
|
4544
5192
|
this.resizeY = 0;
|
|
4545
|
-
|
|
5193
|
+
Measure.calculations.init.call(this);
|
|
4546
5194
|
this.addValues();
|
|
4547
5195
|
this.addShapes();
|
|
4548
|
-
}
|
|
5196
|
+
};
|
|
4549
5197
|
/**
|
|
4550
5198
|
* Overrides default setter to get axes from typeOptions.
|
|
4551
5199
|
* @private
|
|
4552
5200
|
*/
|
|
4553
|
-
setClipAxes
|
|
5201
|
+
Measure.prototype.setClipAxes = function () {
|
|
4554
5202
|
this.clipXAxis = this.chart.xAxis[this.options.typeOptions.xAxis];
|
|
4555
5203
|
this.clipYAxis = this.chart.yAxis[this.options.typeOptions.yAxis];
|
|
4556
|
-
}
|
|
5204
|
+
};
|
|
4557
5205
|
/**
|
|
4558
5206
|
* Get measure points configuration objects.
|
|
4559
5207
|
* @private
|
|
4560
5208
|
* @return {Array<Highcharts.AnnotationMockPointOptionsObject>}
|
|
4561
5209
|
*/
|
|
4562
|
-
pointsOptions
|
|
5210
|
+
Measure.prototype.pointsOptions = function () {
|
|
4563
5211
|
return this.options.points;
|
|
4564
|
-
}
|
|
5212
|
+
};
|
|
4565
5213
|
/**
|
|
4566
5214
|
* Get points configuration objects for shapes.
|
|
4567
5215
|
* @private
|
|
4568
5216
|
* @return {Array<Highcharts.AnnotationMockPointOptionsObject>}
|
|
4569
5217
|
*/
|
|
4570
|
-
shapePointsOptions
|
|
5218
|
+
Measure.prototype.shapePointsOptions = function () {
|
|
4571
5219
|
var options = this.options.typeOptions,
|
|
4572
5220
|
xAxis = options.xAxis,
|
|
4573
5221
|
yAxis = options.yAxis;
|
|
@@ -4597,8 +5245,8 @@
|
|
|
4597
5245
|
yAxis: yAxis
|
|
4598
5246
|
}
|
|
4599
5247
|
];
|
|
4600
|
-
}
|
|
4601
|
-
addControlPoints
|
|
5248
|
+
};
|
|
5249
|
+
Measure.prototype.addControlPoints = function () {
|
|
4602
5250
|
var selectType = this.options.typeOptions.selectType,
|
|
4603
5251
|
controlPoint;
|
|
4604
5252
|
controlPoint = new ControlPoint(this.chart, this, this.options.controlPointOptions, 0);
|
|
@@ -4608,24 +5256,24 @@
|
|
|
4608
5256
|
controlPoint = new ControlPoint(this.chart, this, this.options.controlPointOptions, 1);
|
|
4609
5257
|
this.controlPoints.push(controlPoint);
|
|
4610
5258
|
}
|
|
4611
|
-
}
|
|
5259
|
+
};
|
|
4612
5260
|
/**
|
|
4613
5261
|
* Add label with calculated values (min, max, average, bins).
|
|
4614
5262
|
* @private
|
|
4615
5263
|
* @param {boolean} [resize]
|
|
4616
5264
|
* The flag for resize shape
|
|
4617
5265
|
*/
|
|
4618
|
-
addValues
|
|
5266
|
+
Measure.prototype.addValues = function (resize) {
|
|
4619
5267
|
var typeOptions = this.options.typeOptions,
|
|
4620
5268
|
formatter = typeOptions.label.formatter;
|
|
4621
5269
|
// set xAxisMin, xAxisMax, yAxisMin, yAxisMax
|
|
4622
|
-
|
|
5270
|
+
Measure.calculations.recalculate.call(this, resize);
|
|
4623
5271
|
if (!typeOptions.label.enabled) {
|
|
4624
5272
|
return;
|
|
4625
5273
|
}
|
|
4626
5274
|
if (this.labels.length > 0) {
|
|
4627
5275
|
this.labels[0].text = (formatter && formatter.call(this)) ||
|
|
4628
|
-
|
|
5276
|
+
Measure.calculations.defaultFormatter.call(this);
|
|
4629
5277
|
}
|
|
4630
5278
|
else {
|
|
4631
5279
|
this.initLabel(extend({
|
|
@@ -4654,23 +5302,23 @@
|
|
|
4654
5302
|
};
|
|
4655
5303
|
},
|
|
4656
5304
|
text: (formatter && formatter.call(this)) ||
|
|
4657
|
-
|
|
5305
|
+
Measure.calculations.defaultFormatter.call(this)
|
|
4658
5306
|
}, typeOptions.label));
|
|
4659
5307
|
}
|
|
4660
|
-
}
|
|
5308
|
+
};
|
|
4661
5309
|
/**
|
|
4662
5310
|
* Crosshair, background (rect).
|
|
4663
5311
|
* @private
|
|
4664
5312
|
*/
|
|
4665
|
-
addShapes
|
|
5313
|
+
Measure.prototype.addShapes = function () {
|
|
4666
5314
|
this.addCrosshairs();
|
|
4667
5315
|
this.addBackground();
|
|
4668
|
-
}
|
|
5316
|
+
};
|
|
4669
5317
|
/**
|
|
4670
5318
|
* Add background shape.
|
|
4671
5319
|
* @private
|
|
4672
5320
|
*/
|
|
4673
|
-
addBackground
|
|
5321
|
+
Measure.prototype.addBackground = function () {
|
|
4674
5322
|
var shapePoints = this.shapePointsOptions();
|
|
4675
5323
|
if (typeof shapePoints[0].x === 'undefined') {
|
|
4676
5324
|
return;
|
|
@@ -4679,12 +5327,12 @@
|
|
|
4679
5327
|
type: 'path',
|
|
4680
5328
|
points: this.shapePointsOptions()
|
|
4681
5329
|
}, this.options.typeOptions.background), false);
|
|
4682
|
-
}
|
|
5330
|
+
};
|
|
4683
5331
|
/**
|
|
4684
5332
|
* Add internal crosshair shapes (on top and bottom).
|
|
4685
5333
|
* @private
|
|
4686
5334
|
*/
|
|
4687
|
-
addCrosshairs
|
|
5335
|
+
Measure.prototype.addCrosshairs = function () {
|
|
4688
5336
|
var chart = this.chart,
|
|
4689
5337
|
options = this.options.typeOptions,
|
|
4690
5338
|
point = this.options.typeOptions.point,
|
|
@@ -4752,15 +5400,15 @@
|
|
|
4752
5400
|
d: pathV
|
|
4753
5401
|
}, crosshairOptionsY), false);
|
|
4754
5402
|
}
|
|
4755
|
-
}
|
|
4756
|
-
onDrag
|
|
5403
|
+
};
|
|
5404
|
+
Measure.prototype.onDrag = function (e) {
|
|
4757
5405
|
var translation = this.mouseMoveToTranslation(e), selectType = this.options.typeOptions.selectType, x = selectType === 'y' ? 0 : translation.x, y = selectType === 'x' ? 0 : translation.y;
|
|
4758
5406
|
this.translate(x, y);
|
|
4759
5407
|
this.offsetX += x;
|
|
4760
5408
|
this.offsetY += y;
|
|
4761
5409
|
// animation, resize, setStartPoints
|
|
4762
5410
|
this.redraw(false, false, true);
|
|
4763
|
-
}
|
|
5411
|
+
};
|
|
4764
5412
|
/**
|
|
4765
5413
|
* Translate start or end ("left" or "right") side of the measure.
|
|
4766
5414
|
* Update start points (startXMin, startXMax, startYMin, startYMax)
|
|
@@ -4770,7 +5418,7 @@
|
|
|
4770
5418
|
* @param {number} cpIndex - index of control point
|
|
4771
5419
|
* @param {Highcharts.AnnotationDraggableValue} selectType - x / y / xy
|
|
4772
5420
|
*/
|
|
4773
|
-
resize
|
|
5421
|
+
Measure.prototype.resize = function (dx, dy, cpIndex, selectType) {
|
|
4774
5422
|
// background shape
|
|
4775
5423
|
var bckShape = this.shapes[2];
|
|
4776
5424
|
if (selectType === 'x') {
|
|
@@ -4798,11 +5446,11 @@
|
|
|
4798
5446
|
bckShape.translatePoint(dx, dy, 2);
|
|
4799
5447
|
bckShape.translatePoint(0, dy, 3);
|
|
4800
5448
|
}
|
|
4801
|
-
|
|
5449
|
+
Measure.calculations.updateStartPoints
|
|
4802
5450
|
.call(this, false, true, cpIndex, dx, dy);
|
|
4803
5451
|
this.options.typeOptions.background.height = Math.abs(this.startYMax - this.startYMin);
|
|
4804
5452
|
this.options.typeOptions.background.width = Math.abs(this.startXMax - this.startXMin);
|
|
4805
|
-
}
|
|
5453
|
+
};
|
|
4806
5454
|
/**
|
|
4807
5455
|
* Redraw event which render elements and update start points if needed.
|
|
4808
5456
|
* @private
|
|
@@ -4810,13 +5458,13 @@
|
|
|
4810
5458
|
* @param {boolean} [resize] - flag if resized
|
|
4811
5459
|
* @param {boolean} [setStartPoints] - update position of start points
|
|
4812
5460
|
*/
|
|
4813
|
-
redraw
|
|
5461
|
+
Measure.prototype.redraw = function (animation, resize, setStartPoints) {
|
|
4814
5462
|
this.linkPoints();
|
|
4815
5463
|
if (!this.graphic) {
|
|
4816
5464
|
this.render();
|
|
4817
5465
|
}
|
|
4818
5466
|
if (setStartPoints) {
|
|
4819
|
-
|
|
5467
|
+
Measure.calculations.updateStartPoints.call(this, true, false);
|
|
4820
5468
|
}
|
|
4821
5469
|
// #11174 - clipBox was not recalculate during resize / redraw
|
|
4822
5470
|
if (this.clipRect) {
|
|
@@ -4830,15 +5478,20 @@
|
|
|
4830
5478
|
this.controlPoints.forEach(function (controlPoint) {
|
|
4831
5479
|
controlPoint.redraw();
|
|
4832
5480
|
});
|
|
4833
|
-
}
|
|
4834
|
-
translate
|
|
5481
|
+
};
|
|
5482
|
+
Measure.prototype.translate = function (dx, dy) {
|
|
4835
5483
|
this.shapes.forEach(function (item) {
|
|
4836
5484
|
item.translate(dx, dy);
|
|
4837
5485
|
});
|
|
4838
5486
|
this.options.typeOptions.point.x = this.startXMin;
|
|
4839
5487
|
this.options.typeOptions.point.y = this.startYMin;
|
|
4840
|
-
}
|
|
4841
|
-
|
|
5488
|
+
};
|
|
5489
|
+
/* *
|
|
5490
|
+
*
|
|
5491
|
+
* Static Functions
|
|
5492
|
+
*
|
|
5493
|
+
* */
|
|
5494
|
+
Measure.calculations = {
|
|
4842
5495
|
/**
|
|
4843
5496
|
* Set starting points
|
|
4844
5497
|
* @private
|
|
@@ -4846,7 +5499,7 @@
|
|
|
4846
5499
|
init: function () {
|
|
4847
5500
|
var options = this.options.typeOptions,
|
|
4848
5501
|
chart = this.chart,
|
|
4849
|
-
getPointPos =
|
|
5502
|
+
getPointPos = Measure.calculations.getPointPos,
|
|
4850
5503
|
inverted = chart.inverted,
|
|
4851
5504
|
xAxis = chart.xAxis[options.xAxis],
|
|
4852
5505
|
yAxis = chart.yAxis[options.yAxis],
|
|
@@ -4854,9 +5507,9 @@
|
|
|
4854
5507
|
width = inverted ? bck.height : bck.width,
|
|
4855
5508
|
height = inverted ? bck.width : bck.height,
|
|
4856
5509
|
selectType = options.selectType,
|
|
4857
|
-
top = inverted ?
|
|
4858
|
-
left = inverted ?
|
|
4859
|
-
|
|
5510
|
+
top = inverted ? xAxis.left : yAxis.top, // #13664
|
|
5511
|
+
left = inverted ? yAxis.top : xAxis.left; // #13664
|
|
5512
|
+
this.startXMin = options.point.x;
|
|
4860
5513
|
this.startYMin = options.point.y;
|
|
4861
5514
|
if (isNumber(width)) {
|
|
4862
5515
|
this.startXMax = this.startXMin + width;
|
|
@@ -4888,11 +5541,11 @@
|
|
|
4888
5541
|
* Flag if shape is resized.
|
|
4889
5542
|
*/
|
|
4890
5543
|
recalculate: function (resize) {
|
|
4891
|
-
var calc =
|
|
5544
|
+
var calc = Measure.calculations,
|
|
4892
5545
|
options = this.options.typeOptions,
|
|
4893
5546
|
xAxis = this.chart.xAxis[options.xAxis],
|
|
4894
5547
|
yAxis = this.chart.yAxis[options.yAxis],
|
|
4895
|
-
getPointPos =
|
|
5548
|
+
getPointPos = Measure.calculations.getPointPos,
|
|
4896
5549
|
offsetX = this.offsetX,
|
|
4897
5550
|
offsetY = this.offsetY;
|
|
4898
5551
|
this.xAxisMin = getPointPos(xAxis, this.startXMin, offsetX);
|
|
@@ -4937,7 +5590,7 @@
|
|
|
4937
5590
|
selectType = options.selectType,
|
|
4938
5591
|
xAxis = this.chart.xAxis[options.xAxis],
|
|
4939
5592
|
yAxis = this.chart.yAxis[options.yAxis],
|
|
4940
|
-
getPointPos =
|
|
5593
|
+
getPointPos = Measure.calculations.getPointPos,
|
|
4941
5594
|
startXMin = this.startXMin,
|
|
4942
5595
|
startXMax = this.startXMax,
|
|
4943
5596
|
startYMin = this.startYMin,
|
|
@@ -5005,7 +5658,7 @@
|
|
|
5005
5658
|
min: function () {
|
|
5006
5659
|
var min = Infinity,
|
|
5007
5660
|
series = this.chart.series,
|
|
5008
|
-
ext =
|
|
5661
|
+
ext = Measure.calculations.getExtremes(this.xAxisMin,
|
|
5009
5662
|
this.xAxisMax,
|
|
5010
5663
|
this.yAxisMin,
|
|
5011
5664
|
this.yAxisMax),
|
|
@@ -5034,7 +5687,7 @@
|
|
|
5034
5687
|
max: function () {
|
|
5035
5688
|
var max = -Infinity,
|
|
5036
5689
|
series = this.chart.series,
|
|
5037
|
-
ext =
|
|
5690
|
+
ext = Measure.calculations.getExtremes(this.xAxisMin,
|
|
5038
5691
|
this.xAxisMax,
|
|
5039
5692
|
this.yAxisMin,
|
|
5040
5693
|
this.yAxisMax),
|
|
@@ -5070,7 +5723,7 @@
|
|
|
5070
5723
|
bins: function () {
|
|
5071
5724
|
var bins = 0,
|
|
5072
5725
|
series = this.chart.series,
|
|
5073
|
-
ext =
|
|
5726
|
+
ext = Measure.calculations.getExtremes(this.xAxisMin,
|
|
5074
5727
|
this.xAxisMax,
|
|
5075
5728
|
this.yAxisMin,
|
|
5076
5729
|
this.yAxisMax),
|
|
@@ -5095,8 +5748,10 @@
|
|
|
5095
5748
|
}
|
|
5096
5749
|
return bins;
|
|
5097
5750
|
}
|
|
5098
|
-
}
|
|
5099
|
-
|
|
5751
|
+
};
|
|
5752
|
+
return Measure;
|
|
5753
|
+
}(Annotation));
|
|
5754
|
+
Measure.prototype.defaultOptions = merge(Annotation.prototype.defaultOptions,
|
|
5100
5755
|
/**
|
|
5101
5756
|
* A measure annotation.
|
|
5102
5757
|
*
|
|
@@ -5291,7 +5946,7 @@
|
|
|
5291
5946
|
yAxis = chart.yAxis[typeOptions.yAxis],
|
|
5292
5947
|
targetX = target.xAxisMax,
|
|
5293
5948
|
targetY = target.yAxisMax,
|
|
5294
|
-
ext =
|
|
5949
|
+
ext = Measure.calculations.getExtremes(target.xAxisMin,
|
|
5295
5950
|
target.xAxisMax,
|
|
5296
5951
|
target.yAxisMin,
|
|
5297
5952
|
target.yAxisMax),
|
|
@@ -5340,7 +5995,7 @@
|
|
|
5340
5995
|
|
|
5341
5996
|
return Measure;
|
|
5342
5997
|
});
|
|
5343
|
-
_registerModule(_modules, '
|
|
5998
|
+
_registerModule(_modules, 'Mixins/Navigation.js', [], function () {
|
|
5344
5999
|
/**
|
|
5345
6000
|
*
|
|
5346
6001
|
* (c) 2010-2018 Paweł Fus
|
|
@@ -5399,7 +6054,7 @@
|
|
|
5399
6054
|
|
|
5400
6055
|
return chartNavigation;
|
|
5401
6056
|
});
|
|
5402
|
-
_registerModule(_modules, '
|
|
6057
|
+
_registerModule(_modules, 'Extensions/Annotations/NavigationBindings.js', [_modules['Extensions/Annotations/Annotations.js'], _modules['Core/Chart/Chart.js'], _modules['Mixins/Navigation.js'], _modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (Annotation, Chart, chartNavigationMixin, H, U) {
|
|
5403
6058
|
/* *
|
|
5404
6059
|
*
|
|
5405
6060
|
* (c) 2009-2017 Highsoft, Black Label
|
|
@@ -5409,6 +6064,19 @@
|
|
|
5409
6064
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5410
6065
|
*
|
|
5411
6066
|
* */
|
|
6067
|
+
var addEvent = U.addEvent,
|
|
6068
|
+
attr = U.attr,
|
|
6069
|
+
extend = U.extend,
|
|
6070
|
+
format = U.format,
|
|
6071
|
+
fireEvent = U.fireEvent,
|
|
6072
|
+
isArray = U.isArray,
|
|
6073
|
+
isFunction = U.isFunction,
|
|
6074
|
+
isNumber = U.isNumber,
|
|
6075
|
+
isObject = U.isObject,
|
|
6076
|
+
merge = U.merge,
|
|
6077
|
+
objectEach = U.objectEach,
|
|
6078
|
+
pick = U.pick,
|
|
6079
|
+
setOptions = U.setOptions;
|
|
5412
6080
|
/**
|
|
5413
6081
|
* A config object for navigation bindings in annotations.
|
|
5414
6082
|
*
|
|
@@ -5435,18 +6103,6 @@
|
|
|
5435
6103
|
* @name Highcharts.NavigationBindingsOptionsObject#steps
|
|
5436
6104
|
* @type {Array<Function>|undefined}
|
|
5437
6105
|
*/
|
|
5438
|
-
var addEvent = U.addEvent,
|
|
5439
|
-
attr = U.attr,
|
|
5440
|
-
extend = U.extend,
|
|
5441
|
-
format = U.format,
|
|
5442
|
-
fireEvent = U.fireEvent,
|
|
5443
|
-
isArray = U.isArray,
|
|
5444
|
-
isFunction = U.isFunction,
|
|
5445
|
-
isNumber = U.isNumber,
|
|
5446
|
-
isObject = U.isObject,
|
|
5447
|
-
merge = U.merge,
|
|
5448
|
-
objectEach = U.objectEach,
|
|
5449
|
-
pick = U.pick;
|
|
5450
6106
|
var doc = H.doc,
|
|
5451
6107
|
win = H.win,
|
|
5452
6108
|
PREFIX = 'highcharts-';
|
|
@@ -5604,7 +6260,7 @@
|
|
|
5604
6260
|
navigation.bindingsChartClick(this, e);
|
|
5605
6261
|
}
|
|
5606
6262
|
}));
|
|
5607
|
-
navigation.eventsToUnbind.push(addEvent(chart.container, 'mousemove', function (e) {
|
|
6263
|
+
navigation.eventsToUnbind.push(addEvent(chart.container, H.isTouchDevice ? 'touchmove' : 'mousemove', function (e) {
|
|
5608
6264
|
navigation.bindingsContainerMouseMove(this, e);
|
|
5609
6265
|
}));
|
|
5610
6266
|
};
|
|
@@ -5864,6 +6520,7 @@
|
|
|
5864
6520
|
function traverse(option, key, parentEditables, parent) {
|
|
5865
6521
|
var nextParent;
|
|
5866
6522
|
if (parentEditables &&
|
|
6523
|
+
option &&
|
|
5867
6524
|
nonEditables.indexOf(key) === -1 &&
|
|
5868
6525
|
((parentEditables.indexOf &&
|
|
5869
6526
|
parentEditables.indexOf(key)) >= 0 ||
|
|
@@ -6064,7 +6721,7 @@
|
|
|
6064
6721
|
rect: ['shapes'],
|
|
6065
6722
|
// Crooked lines, elliots, arrows etc:
|
|
6066
6723
|
crookedLine: [],
|
|
6067
|
-
basicAnnotation: []
|
|
6724
|
+
basicAnnotation: ['shapes', 'labelOptions']
|
|
6068
6725
|
};
|
|
6069
6726
|
// Define non editable fields per annotation, for example Rectangle inherits
|
|
6070
6727
|
// options from Measure, but crosshairs are not available
|
|
@@ -6081,7 +6738,7 @@
|
|
|
6081
6738
|
* @type {bindingsUtils}
|
|
6082
6739
|
*/
|
|
6083
6740
|
NavigationBindings.prototype.utils = bindingsUtils;
|
|
6084
|
-
|
|
6741
|
+
Chart.prototype.initNavigationBindings = function () {
|
|
6085
6742
|
var chart = this,
|
|
6086
6743
|
options = chart.options;
|
|
6087
6744
|
if (options && options.navigation && options.navigation.bindings) {
|
|
@@ -6090,10 +6747,10 @@
|
|
|
6090
6747
|
chart.navigationBindings.initUpdate();
|
|
6091
6748
|
}
|
|
6092
6749
|
};
|
|
6093
|
-
addEvent(
|
|
6750
|
+
addEvent(Chart, 'load', function () {
|
|
6094
6751
|
this.initNavigationBindings();
|
|
6095
6752
|
});
|
|
6096
|
-
addEvent(
|
|
6753
|
+
addEvent(Chart, 'destroy', function () {
|
|
6097
6754
|
if (this.navigationBindings) {
|
|
6098
6755
|
this.navigationBindings.destroy();
|
|
6099
6756
|
}
|
|
@@ -6101,7 +6758,7 @@
|
|
|
6101
6758
|
addEvent(NavigationBindings, 'deselectButton', function () {
|
|
6102
6759
|
this.selectedButtonElement = null;
|
|
6103
6760
|
});
|
|
6104
|
-
addEvent(
|
|
6761
|
+
addEvent(Annotation, 'remove', function () {
|
|
6105
6762
|
if (this.chart.navigationBindings) {
|
|
6106
6763
|
this.chart.navigationBindings.deselectAnnotation();
|
|
6107
6764
|
}
|
|
@@ -6121,7 +6778,7 @@
|
|
|
6121
6778
|
navigation = annotation.chart.navigationBindings,
|
|
6122
6779
|
prevAnnotation = navigation.activeAnnotation;
|
|
6123
6780
|
if (originalClick) {
|
|
6124
|
-
originalClick.
|
|
6781
|
+
originalClick.call(annotation, event);
|
|
6125
6782
|
}
|
|
6126
6783
|
if (prevAnnotation !== annotation) {
|
|
6127
6784
|
// Select current:
|
|
@@ -6170,15 +6827,17 @@
|
|
|
6170
6827
|
}
|
|
6171
6828
|
if (H.Annotation) {
|
|
6172
6829
|
// Basic shapes:
|
|
6173
|
-
selectableAnnotation(
|
|
6830
|
+
selectableAnnotation(Annotation);
|
|
6174
6831
|
// Advanced annotations:
|
|
6175
|
-
objectEach(
|
|
6832
|
+
objectEach(Annotation.types, function (annotationType) {
|
|
6176
6833
|
selectableAnnotation(annotationType);
|
|
6177
6834
|
});
|
|
6178
6835
|
}
|
|
6179
|
-
|
|
6836
|
+
setOptions({
|
|
6180
6837
|
/**
|
|
6181
6838
|
* @optionparent lang
|
|
6839
|
+
*
|
|
6840
|
+
* @private
|
|
6182
6841
|
*/
|
|
6183
6842
|
lang: {
|
|
6184
6843
|
/**
|
|
@@ -6228,6 +6887,8 @@
|
|
|
6228
6887
|
/**
|
|
6229
6888
|
* @optionparent navigation
|
|
6230
6889
|
* @product highcharts highstock
|
|
6890
|
+
*
|
|
6891
|
+
* @private
|
|
6231
6892
|
*/
|
|
6232
6893
|
navigation: {
|
|
6233
6894
|
/**
|
|
@@ -6426,7 +7087,7 @@
|
|
|
6426
7087
|
* from a different server.
|
|
6427
7088
|
*
|
|
6428
7089
|
* @type {string}
|
|
6429
|
-
* @default https://code.highcharts.com/8.
|
|
7090
|
+
* @default https://code.highcharts.com/8.2.2/gfx/stock-icons/
|
|
6430
7091
|
* @since 7.1.3
|
|
6431
7092
|
* @apioption navigation.iconsURL
|
|
6432
7093
|
*/
|
|
@@ -6484,13 +7145,17 @@
|
|
|
6484
7145
|
* measure, pitchfork, tunnel, verticalLine, basicAnnotation
|
|
6485
7146
|
* @apioption navigation.annotationsOptions
|
|
6486
7147
|
*/
|
|
6487
|
-
annotationsOptions: {
|
|
7148
|
+
annotationsOptions: {
|
|
7149
|
+
animation: {
|
|
7150
|
+
defer: 0
|
|
7151
|
+
}
|
|
7152
|
+
}
|
|
6488
7153
|
}
|
|
6489
7154
|
});
|
|
6490
7155
|
|
|
6491
7156
|
return NavigationBindings;
|
|
6492
7157
|
});
|
|
6493
|
-
_registerModule(_modules, '
|
|
7158
|
+
_registerModule(_modules, 'Extensions/Annotations/Popup.js', [_modules['Core/Globals.js'], _modules['Extensions/Annotations/NavigationBindings.js'], _modules['Core/Pointer.js'], _modules['Core/Utilities.js']], function (H, NavigationBindings, Pointer, U) {
|
|
6494
7159
|
/* *
|
|
6495
7160
|
*
|
|
6496
7161
|
* Popup generator for Stock tools
|
|
@@ -6505,6 +7170,7 @@
|
|
|
6505
7170
|
var addEvent = U.addEvent,
|
|
6506
7171
|
createElement = U.createElement,
|
|
6507
7172
|
defined = U.defined,
|
|
7173
|
+
getOptions = U.getOptions,
|
|
6508
7174
|
isArray = U.isArray,
|
|
6509
7175
|
isObject = U.isObject,
|
|
6510
7176
|
isString = U.isString,
|
|
@@ -6515,7 +7181,7 @@
|
|
|
6515
7181
|
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
6516
7182
|
// onContainerMouseDown blocks internal popup events, due to e.preventDefault.
|
|
6517
7183
|
// Related issue #4606
|
|
6518
|
-
wrap(
|
|
7184
|
+
wrap(Pointer.prototype, 'onContainerMouseDown', function (proceed, e) {
|
|
6519
7185
|
var popupClass = e.target && e.target.className;
|
|
6520
7186
|
// elements is not in popup
|
|
6521
7187
|
if (!(isString(popupClass) &&
|
|
@@ -6751,7 +7417,7 @@
|
|
|
6751
7417
|
* @return {Highcharts.Dictionary<string>} - elements translations.
|
|
6752
7418
|
*/
|
|
6753
7419
|
getLangpack: function () {
|
|
6754
|
-
return
|
|
7420
|
+
return getOptions().lang.navigation.popup;
|
|
6755
7421
|
},
|
|
6756
7422
|
annotations: {
|
|
6757
7423
|
/**
|
|
@@ -7135,7 +7801,7 @@
|
|
|
7135
7801
|
getAmount: function () {
|
|
7136
7802
|
var series = this.series,
|
|
7137
7803
|
counter = 0;
|
|
7138
|
-
|
|
7804
|
+
series.forEach(function (serie) {
|
|
7139
7805
|
var seriesOptions = serie.options;
|
|
7140
7806
|
if (serie.params ||
|
|
7141
7807
|
seriesOptions && seriesOptions.params) {
|
|
@@ -7264,7 +7930,7 @@
|
|
|
7264
7930
|
this.popup = new H.Popup(this.chart.container, (this.chart.options.navigation.iconsURL ||
|
|
7265
7931
|
(this.chart.options.stockTools &&
|
|
7266
7932
|
this.chart.options.stockTools.gui.iconsURL) ||
|
|
7267
|
-
'https://code.highcharts.com/8.
|
|
7933
|
+
'https://code.highcharts.com/8.2.2/gfx/stock-icons/'));
|
|
7268
7934
|
}
|
|
7269
7935
|
this.popup.showForm(config.formType, this.chart, config.options, config.onSubmit);
|
|
7270
7936
|
});
|