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
package/modules/gantt.src.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Highcharts Gantt JS v8.
|
|
2
|
+
* @license Highcharts Gantt JS v8.2.2 (2020-10-22)
|
|
3
3
|
*
|
|
4
4
|
* Gantt series
|
|
5
5
|
*
|
|
@@ -28,187 +28,7 @@
|
|
|
28
28
|
obj[path] = fn.apply(null, args);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
_registerModule(_modules, '
|
|
32
|
-
/* *
|
|
33
|
-
*
|
|
34
|
-
* (c) 2016-2020 Highsoft AS
|
|
35
|
-
*
|
|
36
|
-
* Author: Lars A. V. Cabrera
|
|
37
|
-
*
|
|
38
|
-
* License: www.highcharts.com/license
|
|
39
|
-
*
|
|
40
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
41
|
-
*
|
|
42
|
-
* */
|
|
43
|
-
var addEvent = U.addEvent,
|
|
44
|
-
merge = U.merge,
|
|
45
|
-
wrap = U.wrap;
|
|
46
|
-
var Axis = H.Axis;
|
|
47
|
-
var defaultConfig = {
|
|
48
|
-
/**
|
|
49
|
-
* Show an indicator on the axis for the current date and time. Can be a
|
|
50
|
-
* boolean or a configuration object similar to
|
|
51
|
-
* [xAxis.plotLines](#xAxis.plotLines).
|
|
52
|
-
*
|
|
53
|
-
* @sample gantt/current-date-indicator/demo
|
|
54
|
-
* Current date indicator enabled
|
|
55
|
-
* @sample gantt/current-date-indicator/object-config
|
|
56
|
-
* Current date indicator with custom options
|
|
57
|
-
*
|
|
58
|
-
* @declare Highcharts.AxisCurrentDateIndicatorOptions
|
|
59
|
-
* @type {boolean|*}
|
|
60
|
-
* @default true
|
|
61
|
-
* @extends xAxis.plotLines
|
|
62
|
-
* @excluding value
|
|
63
|
-
* @product gantt
|
|
64
|
-
* @apioption xAxis.currentDateIndicator
|
|
65
|
-
*/
|
|
66
|
-
currentDateIndicator: true,
|
|
67
|
-
color: '#ccd6eb',
|
|
68
|
-
width: 2,
|
|
69
|
-
/**
|
|
70
|
-
* @declare Highcharts.AxisCurrentDateIndicatorLabelOptions
|
|
71
|
-
*/
|
|
72
|
-
label: {
|
|
73
|
-
/**
|
|
74
|
-
* Format of the label. This options is passed as the fist argument to
|
|
75
|
-
* [dateFormat](/class-reference/Highcharts#dateFormat) function.
|
|
76
|
-
*
|
|
77
|
-
* @type {string}
|
|
78
|
-
* @default '%a, %b %d %Y, %H:%M'
|
|
79
|
-
* @product gantt
|
|
80
|
-
* @apioption xAxis.currentDateIndicator.label.format
|
|
81
|
-
*/
|
|
82
|
-
format: '%a, %b %d %Y, %H:%M',
|
|
83
|
-
formatter: function (value, format) {
|
|
84
|
-
return H.dateFormat(format, value);
|
|
85
|
-
},
|
|
86
|
-
rotation: 0,
|
|
87
|
-
/**
|
|
88
|
-
* @type {Highcharts.CSSObject}
|
|
89
|
-
*/
|
|
90
|
-
style: {
|
|
91
|
-
/** @internal */
|
|
92
|
-
fontSize: '10px'
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
/* eslint-disable no-invalid-this */
|
|
97
|
-
addEvent(Axis, 'afterSetOptions', function () {
|
|
98
|
-
var options = this.options,
|
|
99
|
-
cdiOptions = options.currentDateIndicator;
|
|
100
|
-
if (cdiOptions) {
|
|
101
|
-
cdiOptions = typeof cdiOptions === 'object' ?
|
|
102
|
-
merge(defaultConfig, cdiOptions) : merge(defaultConfig);
|
|
103
|
-
cdiOptions.value = new Date();
|
|
104
|
-
if (!options.plotLines) {
|
|
105
|
-
options.plotLines = [];
|
|
106
|
-
}
|
|
107
|
-
options.plotLines.push(cdiOptions);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
addEvent(PlotLineOrBand, 'render', function () {
|
|
111
|
-
// If the label already exists, update its text
|
|
112
|
-
if (this.label) {
|
|
113
|
-
this.label.attr({
|
|
114
|
-
text: this.getLabelText(this.options.label)
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
wrap(PlotLineOrBand.prototype, 'getLabelText', function (defaultMethod, defaultLabelOptions) {
|
|
119
|
-
var options = this.options;
|
|
120
|
-
if (options.currentDateIndicator && options.label &&
|
|
121
|
-
typeof options.label.formatter === 'function') {
|
|
122
|
-
options.value = new Date();
|
|
123
|
-
return options.label.formatter
|
|
124
|
-
.call(this, options.value, options.label.format);
|
|
125
|
-
}
|
|
126
|
-
return defaultMethod.call(this, defaultLabelOptions);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
});
|
|
130
|
-
_registerModule(_modules, 'modules/static-scale.src.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js']], function (H, U) {
|
|
131
|
-
/* *
|
|
132
|
-
*
|
|
133
|
-
* (c) 2016-2020 Torstein Honsi, Lars Cabrera
|
|
134
|
-
*
|
|
135
|
-
* License: www.highcharts.com/license
|
|
136
|
-
*
|
|
137
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
138
|
-
*
|
|
139
|
-
* */
|
|
140
|
-
var addEvent = U.addEvent,
|
|
141
|
-
defined = U.defined,
|
|
142
|
-
isNumber = U.isNumber,
|
|
143
|
-
pick = U.pick;
|
|
144
|
-
var Chart = H.Chart;
|
|
145
|
-
/* eslint-disable no-invalid-this */
|
|
146
|
-
/**
|
|
147
|
-
* For vertical axes only. Setting the static scale ensures that each tick unit
|
|
148
|
-
* is translated into a fixed pixel height. For example, setting the static
|
|
149
|
-
* scale to 24 results in each Y axis category taking up 24 pixels, and the
|
|
150
|
-
* height of the chart adjusts. Adding or removing items will make the chart
|
|
151
|
-
* resize.
|
|
152
|
-
*
|
|
153
|
-
* @sample gantt/xrange-series/demo/
|
|
154
|
-
* X-range series with static scale
|
|
155
|
-
*
|
|
156
|
-
* @type {number}
|
|
157
|
-
* @default 50
|
|
158
|
-
* @since 6.2.0
|
|
159
|
-
* @product gantt
|
|
160
|
-
* @apioption yAxis.staticScale
|
|
161
|
-
*/
|
|
162
|
-
addEvent(H.Axis, 'afterSetOptions', function () {
|
|
163
|
-
var chartOptions = this.chart.options && this.chart.options.chart;
|
|
164
|
-
if (!this.horiz &&
|
|
165
|
-
isNumber(this.options.staticScale) &&
|
|
166
|
-
(!chartOptions.height ||
|
|
167
|
-
(chartOptions.scrollablePlotArea &&
|
|
168
|
-
chartOptions.scrollablePlotArea.minHeight))) {
|
|
169
|
-
this.staticScale = this.options.staticScale;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
Chart.prototype.adjustHeight = function () {
|
|
173
|
-
if (this.redrawTrigger !== 'adjustHeight') {
|
|
174
|
-
(this.axes || []).forEach(function (axis) {
|
|
175
|
-
var chart = axis.chart,
|
|
176
|
-
animate = !!chart.initiatedScale &&
|
|
177
|
-
chart.options.animation,
|
|
178
|
-
staticScale = axis.options.staticScale,
|
|
179
|
-
height,
|
|
180
|
-
diff;
|
|
181
|
-
if (axis.staticScale && defined(axis.min)) {
|
|
182
|
-
height = pick(axis.brokenAxis && axis.brokenAxis.unitLength, axis.max + axis.tickInterval - axis.min) * staticScale;
|
|
183
|
-
// Minimum height is 1 x staticScale.
|
|
184
|
-
height = Math.max(height, staticScale);
|
|
185
|
-
diff = height - chart.plotHeight;
|
|
186
|
-
if (Math.abs(diff) >= 1) {
|
|
187
|
-
chart.plotHeight = height;
|
|
188
|
-
chart.redrawTrigger = 'adjustHeight';
|
|
189
|
-
chart.setSize(void 0, chart.chartHeight + diff, animate);
|
|
190
|
-
}
|
|
191
|
-
// Make sure clip rects have the right height before initial
|
|
192
|
-
// animation.
|
|
193
|
-
axis.series.forEach(function (series) {
|
|
194
|
-
var clipRect = series.sharedClipKey &&
|
|
195
|
-
chart[series.sharedClipKey];
|
|
196
|
-
if (clipRect) {
|
|
197
|
-
clipRect.attr({
|
|
198
|
-
height: chart.plotHeight
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
this.initiatedScale = true;
|
|
205
|
-
}
|
|
206
|
-
this.redrawTrigger = null;
|
|
207
|
-
};
|
|
208
|
-
addEvent(Chart, 'render', Chart.prototype.adjustHeight);
|
|
209
|
-
|
|
210
|
-
});
|
|
211
|
-
_registerModule(_modules, 'parts-gantt/Tree.js', [_modules['parts/Utilities.js']], function (U) {
|
|
31
|
+
_registerModule(_modules, 'Gantt/Tree.js', [_modules['Core/Utilities.js']], function (U) {
|
|
212
32
|
/* *
|
|
213
33
|
*
|
|
214
34
|
* (c) 2016-2020 Highsoft AS
|
|
@@ -342,7 +162,7 @@
|
|
|
342
162
|
|
|
343
163
|
return Tree;
|
|
344
164
|
});
|
|
345
|
-
_registerModule(_modules, '
|
|
165
|
+
_registerModule(_modules, 'Core/Axis/TreeGridTick.js', [_modules['Core/Utilities.js']], function (U) {
|
|
346
166
|
/* *
|
|
347
167
|
*
|
|
348
168
|
* (c) 2016 Highsoft AS
|
|
@@ -695,7 +515,7 @@
|
|
|
695
515
|
|
|
696
516
|
return TreeGridTick;
|
|
697
517
|
});
|
|
698
|
-
_registerModule(_modules, '
|
|
518
|
+
_registerModule(_modules, 'Mixins/TreeSeries.js', [_modules['Core/Color/Color.js'], _modules['Core/Utilities.js']], function (Color, U) {
|
|
699
519
|
/* *
|
|
700
520
|
*
|
|
701
521
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
@@ -923,7 +743,7 @@
|
|
|
923
743
|
|
|
924
744
|
return result;
|
|
925
745
|
});
|
|
926
|
-
_registerModule(_modules, '
|
|
746
|
+
_registerModule(_modules, 'Core/Axis/GridAxis.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Globals.js'], _modules['Core/Options.js'], _modules['Core/Axis/Tick.js'], _modules['Core/Utilities.js']], function (Axis, H, O, Tick, U) {
|
|
927
747
|
/* *
|
|
928
748
|
*
|
|
929
749
|
* (c) 2016 Highsoft AS
|
|
@@ -934,6 +754,7 @@
|
|
|
934
754
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
935
755
|
*
|
|
936
756
|
* */
|
|
757
|
+
var dateFormat = O.dateFormat;
|
|
937
758
|
var addEvent = U.addEvent,
|
|
938
759
|
defined = U.defined,
|
|
939
760
|
erase = U.erase,
|
|
@@ -946,7 +767,7 @@
|
|
|
946
767
|
wrap = U.wrap;
|
|
947
768
|
var argsToArray = function (args) {
|
|
948
769
|
return Array.prototype.slice.call(args, 1);
|
|
949
|
-
},
|
|
770
|
+
}, isObject = function (x) {
|
|
950
771
|
// Always use strict mode
|
|
951
772
|
return U.isObject(x, true);
|
|
952
773
|
}, Chart = H.Chart;
|
|
@@ -971,6 +792,27 @@
|
|
|
971
792
|
axis.labelRotation = 0;
|
|
972
793
|
options.labels.rotation = 0;
|
|
973
794
|
};
|
|
795
|
+
/**
|
|
796
|
+
* @productdesc {gantt}
|
|
797
|
+
* For grid axes (like in Gantt charts),
|
|
798
|
+
* it is possible to declare as a list to provide different
|
|
799
|
+
* formats depending on available space.
|
|
800
|
+
*
|
|
801
|
+
* Defaults to:
|
|
802
|
+
* ```js
|
|
803
|
+
* {
|
|
804
|
+
* hour: { list: ['%H:%M', '%H'] },
|
|
805
|
+
* day: { list: ['%A, %e. %B', '%a, %e. %b', '%E'] },
|
|
806
|
+
* week: { list: ['Week %W', 'W%W'] },
|
|
807
|
+
* month: { list: ['%B', '%b', '%o'] }
|
|
808
|
+
* }
|
|
809
|
+
* ```
|
|
810
|
+
*
|
|
811
|
+
* @sample {gantt} gantt/grid-axis/date-time-label-formats
|
|
812
|
+
* Gantt chart with custom axis date format.
|
|
813
|
+
*
|
|
814
|
+
* @apioption xAxis.dateTimeLabelFormats
|
|
815
|
+
*/
|
|
974
816
|
/**
|
|
975
817
|
* Set grid options for the axis labels. Requires Highcharts Gantt.
|
|
976
818
|
*
|
|
@@ -1045,23 +887,28 @@
|
|
|
1045
887
|
};
|
|
1046
888
|
tickPositions.forEach(function (pos) {
|
|
1047
889
|
var tick = ticks[pos],
|
|
1048
|
-
|
|
1049
|
-
|
|
890
|
+
labelHeight = 0,
|
|
891
|
+
labelWidth = 0,
|
|
1050
892
|
label;
|
|
1051
893
|
if (isObject(tick)) {
|
|
1052
894
|
label = isObject(tick.label) ? tick.label : {};
|
|
1053
|
-
// Find width and height of
|
|
1054
|
-
|
|
895
|
+
// Find width and height of label
|
|
896
|
+
labelHeight = label.getBBox ? label.getBBox().height : 0;
|
|
1055
897
|
if (label.textStr && !isNumber(label.textPxLength)) {
|
|
1056
898
|
label.textPxLength = label.getBBox().width;
|
|
1057
899
|
}
|
|
1058
|
-
|
|
900
|
+
labelWidth = isNumber(label.textPxLength) ?
|
|
1059
901
|
// Math.round ensures crisp lines
|
|
1060
902
|
Math.round(label.textPxLength) :
|
|
1061
903
|
0;
|
|
904
|
+
if (label.textStr) {
|
|
905
|
+
// Set the tickWidth same as the label width after ellipsis
|
|
906
|
+
// applied #10281
|
|
907
|
+
labelWidth = Math.round(label.getBBox().width);
|
|
908
|
+
}
|
|
1062
909
|
// Update the result if width and/or height are larger
|
|
1063
|
-
dimensions.height = Math.max(
|
|
1064
|
-
dimensions.width = Math.max(
|
|
910
|
+
dimensions.height = Math.max(labelHeight, dimensions.height);
|
|
911
|
+
dimensions.width = Math.max(labelWidth, dimensions.width);
|
|
1065
912
|
}
|
|
1066
913
|
});
|
|
1067
914
|
return dimensions;
|
|
@@ -1084,7 +931,7 @@
|
|
|
1084
931
|
};
|
|
1085
932
|
// First letter of the day of the week, e.g. 'M' for 'Monday'.
|
|
1086
933
|
H.dateFormats.E = function (timestamp) {
|
|
1087
|
-
return dateFormat('%a', timestamp, true).charAt(0);
|
|
934
|
+
return this.dateFormat('%a', timestamp, true).charAt(0);
|
|
1088
935
|
};
|
|
1089
936
|
/* eslint-disable no-invalid-this */
|
|
1090
937
|
addEvent(Chart, 'afterSetChartSize', function () {
|
|
@@ -1247,6 +1094,32 @@
|
|
|
1247
1094
|
return (lastIndex === thisIndex &&
|
|
1248
1095
|
(isNumber(columnIndex) ? columns.length === columnIndex : true));
|
|
1249
1096
|
};
|
|
1097
|
+
/**
|
|
1098
|
+
* Add extra border based on the provided path.
|
|
1099
|
+
* *
|
|
1100
|
+
* @private
|
|
1101
|
+
*
|
|
1102
|
+
* @param {SVGPath} path
|
|
1103
|
+
* The path of the border.
|
|
1104
|
+
*
|
|
1105
|
+
* @return {Highcharts.SVGElement}
|
|
1106
|
+
*/
|
|
1107
|
+
GridAxisAdditions.prototype.renderBorder = function (path) {
|
|
1108
|
+
var axis = this.axis,
|
|
1109
|
+
renderer = axis.chart.renderer,
|
|
1110
|
+
options = axis.options,
|
|
1111
|
+
extraBorderLine = renderer.path(path)
|
|
1112
|
+
.addClass('highcharts-axis-line')
|
|
1113
|
+
.add(axis.axisBorder);
|
|
1114
|
+
if (!renderer.styledMode) {
|
|
1115
|
+
extraBorderLine.attr({
|
|
1116
|
+
stroke: options.lineColor,
|
|
1117
|
+
'stroke-width': options.lineWidth,
|
|
1118
|
+
zIndex: 7
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
return extraBorderLine;
|
|
1122
|
+
};
|
|
1250
1123
|
return GridAxisAdditions;
|
|
1251
1124
|
}());
|
|
1252
1125
|
/**
|
|
@@ -1369,11 +1242,18 @@
|
|
|
1369
1242
|
function (p) {
|
|
1370
1243
|
return p[axis.isXAxis ? 'x' : 'y'] === value;
|
|
1371
1244
|
});
|
|
1245
|
+
var pointCopy;
|
|
1246
|
+
if (point && series.is('gantt')) {
|
|
1247
|
+
// For the Gantt set point aliases to the pointCopy
|
|
1248
|
+
// to do not change the original point
|
|
1249
|
+
pointCopy = merge(point);
|
|
1250
|
+
H.seriesTypes.gantt.prototype.setGanttPointAliases(pointCopy);
|
|
1251
|
+
}
|
|
1372
1252
|
// Make additional properties available for the
|
|
1373
1253
|
// formatter
|
|
1374
1254
|
this.isFirst = isFirst;
|
|
1375
1255
|
this.isLast = isLast;
|
|
1376
|
-
this.point =
|
|
1256
|
+
this.point = pointCopy;
|
|
1377
1257
|
// Call original labelFormatter
|
|
1378
1258
|
return proceed.call(this);
|
|
1379
1259
|
});
|
|
@@ -1388,7 +1268,11 @@
|
|
|
1388
1268
|
gridOptions.columns[gridOptions.columns.length - columnIndex - 1], {
|
|
1389
1269
|
linkedTo: 0,
|
|
1390
1270
|
// Force to behave like category axis
|
|
1391
|
-
type: 'category'
|
|
1271
|
+
type: 'category',
|
|
1272
|
+
// Disable by default the scrollbar on the grid axis
|
|
1273
|
+
scrollbar: {
|
|
1274
|
+
enabled: false
|
|
1275
|
+
}
|
|
1392
1276
|
});
|
|
1393
1277
|
delete columnOptions.grid.columns; // Prevent recursion
|
|
1394
1278
|
var column = new Axis(axis.chart,
|
|
@@ -1417,15 +1301,11 @@
|
|
|
1417
1301
|
* @private
|
|
1418
1302
|
*/
|
|
1419
1303
|
GridAxis.onAfterRender = function () {
|
|
1420
|
-
var
|
|
1421
|
-
var
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
var yStartIndex,
|
|
1426
|
-
yEndIndex,
|
|
1427
|
-
xStartIndex,
|
|
1428
|
-
xEndIndex;
|
|
1304
|
+
var _a;
|
|
1305
|
+
var axis = this,
|
|
1306
|
+
grid = axis.grid,
|
|
1307
|
+
options = axis.options,
|
|
1308
|
+
gridOptions = options.grid || {};
|
|
1429
1309
|
if (gridOptions.enabled === true) {
|
|
1430
1310
|
// @todo acutual label padding (top, bottom, left, right)
|
|
1431
1311
|
axis.maxLabelDimensions = axis.getMaxLabelDimensions(axis.ticks, axis.tickPositions);
|
|
@@ -1444,13 +1324,13 @@
|
|
|
1444
1324
|
if (axis.grid && axis.grid.isOuterAxis() && axis.axisLine) {
|
|
1445
1325
|
var lineWidth = options.lineWidth;
|
|
1446
1326
|
if (lineWidth) {
|
|
1447
|
-
var linePath = axis.getLinePath(lineWidth)
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1327
|
+
var linePath = axis.getLinePath(lineWidth),
|
|
1328
|
+
startPoint = linePath[0],
|
|
1329
|
+
endPoint = linePath[1],
|
|
1330
|
+
// Negate distance if top or left axis
|
|
1331
|
+
// Subtract 1px to draw the line at the end of the tick
|
|
1332
|
+
tickLength = (axis.tickSize('tick') || [1])[0],
|
|
1333
|
+
distance = (tickLength - 1) * ((axis.side === GridAxis.Side.top ||
|
|
1454
1334
|
axis.side === GridAxis.Side.left) ? -1 : 1);
|
|
1455
1335
|
// If axis is horizontal, reposition line path vertically
|
|
1456
1336
|
if (startPoint[0] === 'M' && endPoint[0] === 'L') {
|
|
@@ -1459,27 +1339,36 @@
|
|
|
1459
1339
|
endPoint[2] += distance;
|
|
1460
1340
|
}
|
|
1461
1341
|
else {
|
|
1462
|
-
// If axis is vertical, reposition line path
|
|
1463
|
-
// horizontally
|
|
1464
1342
|
startPoint[1] += distance;
|
|
1465
1343
|
endPoint[1] += distance;
|
|
1466
1344
|
}
|
|
1467
1345
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1346
|
+
// If it doesn't exist, add an upper and lower border
|
|
1347
|
+
// for the vertical grid axis.
|
|
1348
|
+
if (!axis.horiz && axis.chart.marginRight) {
|
|
1349
|
+
var upperBorderStartPoint = startPoint, upperBorderEndPoint = ['L', axis.left, startPoint[2]], upperBorderPath = [upperBorderStartPoint, upperBorderEndPoint], lowerBorderEndPoint = ['L', axis.chart.chartWidth - axis.chart.marginRight, axis.toPixels(axis.max + axis.tickmarkOffset)], lowerBorderStartPoint = ['M', endPoint[1], axis.toPixels(axis.max + axis.tickmarkOffset)], lowerBorderPath = [lowerBorderStartPoint, lowerBorderEndPoint];
|
|
1350
|
+
if (!axis.grid.upperBorder && axis.min % 1 !== 0) {
|
|
1351
|
+
axis.grid.upperBorder = axis.grid.renderBorder(upperBorderPath);
|
|
1352
|
+
}
|
|
1353
|
+
if (axis.grid.upperBorder) {
|
|
1354
|
+
axis.grid.upperBorder.animate({
|
|
1355
|
+
d: upperBorderPath
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
if (!axis.grid.lowerBorder && axis.max % 1 !== 0) {
|
|
1359
|
+
axis.grid.lowerBorder = axis.grid.renderBorder(lowerBorderPath);
|
|
1360
|
+
}
|
|
1361
|
+
if (axis.grid.lowerBorder) {
|
|
1362
|
+
axis.grid.lowerBorder.animate({
|
|
1363
|
+
d: lowerBorderPath
|
|
1480
1364
|
});
|
|
1481
1365
|
}
|
|
1482
1366
|
}
|
|
1367
|
+
// Render an extra line parallel to the existing axes,
|
|
1368
|
+
// to close the grid.
|
|
1369
|
+
if (!axis.grid.axisLineExtra) {
|
|
1370
|
+
axis.grid.axisLineExtra = axis.grid.renderBorder(linePath);
|
|
1371
|
+
}
|
|
1483
1372
|
else {
|
|
1484
1373
|
axis.grid.axisLineExtra.animate({
|
|
1485
1374
|
d: linePath
|
|
@@ -1493,12 +1382,42 @@
|
|
|
1493
1382
|
(grid && grid.columns || []).forEach(function (column) {
|
|
1494
1383
|
column.render();
|
|
1495
1384
|
});
|
|
1385
|
+
// Manipulate the tick mark visibility
|
|
1386
|
+
// based on the axis.max- allows smooth scrolling.
|
|
1387
|
+
if (!axis.horiz && axis.chart.hasRendered && (axis.scrollbar || ((_a = axis.linkedParent) === null || _a === void 0 ? void 0 : _a.scrollbar))) {
|
|
1388
|
+
var max = axis.max,
|
|
1389
|
+
min = axis.min,
|
|
1390
|
+
tickmarkOffset = axis.tickmarkOffset,
|
|
1391
|
+
lastTick = axis.tickPositions[axis.tickPositions.length - 1],
|
|
1392
|
+
firstTick = axis.tickPositions[0];
|
|
1393
|
+
// Hide/show firts tick label.
|
|
1394
|
+
if (min - firstTick > tickmarkOffset) {
|
|
1395
|
+
axis.ticks[firstTick].label.hide();
|
|
1396
|
+
}
|
|
1397
|
+
else {
|
|
1398
|
+
axis.ticks[firstTick].label.show();
|
|
1399
|
+
}
|
|
1400
|
+
// Hide/show last tick mark/label.
|
|
1401
|
+
if (lastTick - max > tickmarkOffset) {
|
|
1402
|
+
axis.ticks[lastTick].label.hide();
|
|
1403
|
+
}
|
|
1404
|
+
else {
|
|
1405
|
+
axis.ticks[lastTick].label.show();
|
|
1406
|
+
}
|
|
1407
|
+
if (lastTick - max < tickmarkOffset && lastTick - max > 0 && axis.ticks[lastTick].isLast) {
|
|
1408
|
+
axis.ticks[lastTick].mark.hide();
|
|
1409
|
+
}
|
|
1410
|
+
else {
|
|
1411
|
+
axis.ticks[lastTick - 1].mark.show();
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1496
1414
|
}
|
|
1497
1415
|
};
|
|
1498
1416
|
/**
|
|
1499
1417
|
* @private
|
|
1500
1418
|
*/
|
|
1501
1419
|
GridAxis.onAfterSetAxisTranslation = function () {
|
|
1420
|
+
var _a;
|
|
1502
1421
|
var axis = this;
|
|
1503
1422
|
var tickInfo = axis.tickPositions && axis.tickPositions.info;
|
|
1504
1423
|
var options = axis.options;
|
|
@@ -1527,6 +1446,13 @@
|
|
|
1527
1446
|
}
|
|
1528
1447
|
}
|
|
1529
1448
|
}
|
|
1449
|
+
else {
|
|
1450
|
+
// Don't trim ticks which not in min/max range but
|
|
1451
|
+
// they are still in the min/max plus tickInterval.
|
|
1452
|
+
if (this.options.type !== 'treegrid' && ((_a = axis.grid) === null || _a === void 0 ? void 0 : _a.columns)) {
|
|
1453
|
+
this.minPointOffset = this.tickInterval;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1530
1456
|
};
|
|
1531
1457
|
/**
|
|
1532
1458
|
* Creates a left and right wall on horizontal axes:
|
|
@@ -1837,7 +1763,7 @@
|
|
|
1837
1763
|
|
|
1838
1764
|
return GridAxis;
|
|
1839
1765
|
});
|
|
1840
|
-
_registerModule(_modules, '
|
|
1766
|
+
_registerModule(_modules, 'Core/Axis/BrokenAxis.js', [_modules['Core/Axis/Axis.js'], _modules['Series/LineSeries.js'], _modules['Extensions/Stacking.js'], _modules['Core/Utilities.js']], function (Axis, LineSeries, StackItem, U) {
|
|
1841
1767
|
/* *
|
|
1842
1768
|
*
|
|
1843
1769
|
* (c) 2009-2020 Torstein Honsi
|
|
@@ -1853,7 +1779,6 @@
|
|
|
1853
1779
|
isArray = U.isArray,
|
|
1854
1780
|
isNumber = U.isNumber,
|
|
1855
1781
|
pick = U.pick;
|
|
1856
|
-
var Series = H.Series;
|
|
1857
1782
|
/* eslint-disable valid-jsdoc */
|
|
1858
1783
|
/**
|
|
1859
1784
|
* Provides support for broken axes.
|
|
@@ -2180,7 +2105,7 @@
|
|
|
2180
2105
|
*/
|
|
2181
2106
|
BrokenAxis.compose = function (AxisClass, SeriesClass) {
|
|
2182
2107
|
AxisClass.keepProps.push('brokenAxis');
|
|
2183
|
-
var seriesProto =
|
|
2108
|
+
var seriesProto = LineSeries.prototype;
|
|
2184
2109
|
/**
|
|
2185
2110
|
* @private
|
|
2186
2111
|
*/
|
|
@@ -2413,11 +2338,11 @@
|
|
|
2413
2338
|
};
|
|
2414
2339
|
return BrokenAxis;
|
|
2415
2340
|
}());
|
|
2416
|
-
BrokenAxis.compose(Axis,
|
|
2341
|
+
BrokenAxis.compose(Axis, LineSeries); // @todo remove automatism
|
|
2417
2342
|
|
|
2418
2343
|
return BrokenAxis;
|
|
2419
2344
|
});
|
|
2420
|
-
_registerModule(_modules, '
|
|
2345
|
+
_registerModule(_modules, 'Core/Axis/TreeGridAxis.js', [_modules['Core/Globals.js'], _modules['Core/Axis/Axis.js'], _modules['Core/Axis/Tick.js'], _modules['Gantt/Tree.js'], _modules['Core/Axis/TreeGridTick.js'], _modules['Mixins/TreeSeries.js'], _modules['Core/Utilities.js']], function (H, Axis, Tick, Tree, TreeGridTick, mixinTreeSeries, U) {
|
|
2421
2346
|
/* *
|
|
2422
2347
|
*
|
|
2423
2348
|
* (c) 2016 Highsoft AS
|
|
@@ -2428,9 +2353,11 @@
|
|
|
2428
2353
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
2429
2354
|
*
|
|
2430
2355
|
* */
|
|
2356
|
+
var getLevelOptions = mixinTreeSeries.getLevelOptions;
|
|
2431
2357
|
var addEvent = U.addEvent,
|
|
2432
2358
|
find = U.find,
|
|
2433
2359
|
fireEvent = U.fireEvent,
|
|
2360
|
+
isArray = U.isArray,
|
|
2434
2361
|
isNumber = U.isNumber,
|
|
2435
2362
|
isObject = U.isObject,
|
|
2436
2363
|
isString = U.isString,
|
|
@@ -2573,6 +2500,7 @@
|
|
|
2573
2500
|
mapOfPosToGridNode[pos] = gridNode = {
|
|
2574
2501
|
depth: parentGridNode ? parentGridNode.depth + 1 : 0,
|
|
2575
2502
|
name: name,
|
|
2503
|
+
id: data.id,
|
|
2576
2504
|
nodes: [node],
|
|
2577
2505
|
children: [],
|
|
2578
2506
|
pos: pos
|
|
@@ -2666,7 +2594,8 @@
|
|
|
2666
2594
|
numberOfSeries = 0,
|
|
2667
2595
|
isDirty,
|
|
2668
2596
|
data,
|
|
2669
|
-
treeGrid
|
|
2597
|
+
treeGrid,
|
|
2598
|
+
max = options.max;
|
|
2670
2599
|
// Check whether any of series is rendering for the first time,
|
|
2671
2600
|
// visibility has changed, or its data is dirty,
|
|
2672
2601
|
// and only then update. #10570, #10580
|
|
@@ -2683,6 +2612,11 @@
|
|
|
2683
2612
|
if (s.visible) {
|
|
2684
2613
|
// Push all data to array
|
|
2685
2614
|
(s.options.data || []).forEach(function (data) {
|
|
2615
|
+
// For using keys - rebuild the data structure
|
|
2616
|
+
if (s.options.keys && s.options.keys.length) {
|
|
2617
|
+
data = s.pointClass.prototype.optionsToObject.call({ series: s }, data);
|
|
2618
|
+
H.seriesTypes.gantt.prototype.setGanttPointAliases(data);
|
|
2619
|
+
}
|
|
2686
2620
|
if (isObject(data, true)) {
|
|
2687
2621
|
// Set series index on data. Removed again
|
|
2688
2622
|
// after use.
|
|
@@ -2697,6 +2631,17 @@
|
|
|
2697
2631
|
}
|
|
2698
2632
|
return arr;
|
|
2699
2633
|
}, []);
|
|
2634
|
+
// If max is higher than set data - add a
|
|
2635
|
+
// dummy data to render categories #10779
|
|
2636
|
+
if (max && data.length < max) {
|
|
2637
|
+
for (var i = data.length; i <= max; i++) {
|
|
2638
|
+
data.push({
|
|
2639
|
+
// Use the zero-width character
|
|
2640
|
+
// to avoid conflict with uniqueNames
|
|
2641
|
+
name: i + '\u200B'
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2700
2645
|
// setScale is fired after all the series is initialized,
|
|
2701
2646
|
// which is an ideal time to update the axis.categories.
|
|
2702
2647
|
treeGrid = getTreeGridFromData(data, uniqueNames || false, (uniqueNames === true) ? numberOfSeries : 1);
|
|
@@ -2707,18 +2652,26 @@
|
|
|
2707
2652
|
axis.treeGrid.tree = treeGrid.tree;
|
|
2708
2653
|
// Update yData now that we have calculated the y values
|
|
2709
2654
|
axis.series.forEach(function (series) {
|
|
2710
|
-
var
|
|
2711
|
-
|
|
2712
|
-
|
|
2655
|
+
var axisData = (series.options.data || []).map(function (d) {
|
|
2656
|
+
if (isArray(d) && series.options.keys && series.options.keys.length) {
|
|
2657
|
+
// Get the axisData from the data array used to
|
|
2658
|
+
// build the treeGrid where has been modified
|
|
2659
|
+
data.forEach(function (point) {
|
|
2660
|
+
if (d.indexOf(point.x) >= 0 && d.indexOf(point.x2) >= 0) {
|
|
2661
|
+
d = point;
|
|
2662
|
+
}
|
|
2663
|
+
});
|
|
2664
|
+
}
|
|
2665
|
+
return isObject(d, true) ? merge(d) : d;
|
|
2713
2666
|
});
|
|
2714
2667
|
// Avoid destroying points when series is not visible
|
|
2715
2668
|
if (series.visible) {
|
|
2716
|
-
series.setData(
|
|
2669
|
+
series.setData(axisData, false);
|
|
2717
2670
|
}
|
|
2718
2671
|
});
|
|
2719
2672
|
// Calculate the label options for each level in the tree.
|
|
2720
2673
|
axis.treeGrid.mapOptionsToLevel =
|
|
2721
|
-
|
|
2674
|
+
getLevelOptions({
|
|
2722
2675
|
defaults: labelOptions,
|
|
2723
2676
|
from: 1,
|
|
2724
2677
|
levels: labelOptions && labelOptions.levels,
|
|
@@ -2848,6 +2801,15 @@
|
|
|
2848
2801
|
});
|
|
2849
2802
|
}
|
|
2850
2803
|
});
|
|
2804
|
+
// If staticScale is not defined on the yAxis
|
|
2805
|
+
// and chart height is set, set axis.isDirty
|
|
2806
|
+
// to ensure collapsing works (#12012)
|
|
2807
|
+
addEvent(axis, 'afterBreaks', function () {
|
|
2808
|
+
var _a;
|
|
2809
|
+
if (axis.coll === 'yAxis' && !axis.staticScale && ((_a = axis.chart.options.chart) === null || _a === void 0 ? void 0 : _a.height)) {
|
|
2810
|
+
axis.isDirty = true;
|
|
2811
|
+
}
|
|
2812
|
+
});
|
|
2851
2813
|
userOptions = merge({
|
|
2852
2814
|
// Default options
|
|
2853
2815
|
grid: {
|
|
@@ -2995,6 +2957,32 @@
|
|
|
2995
2957
|
* Functions
|
|
2996
2958
|
*
|
|
2997
2959
|
* */
|
|
2960
|
+
/**
|
|
2961
|
+
* Set the collapse status.
|
|
2962
|
+
*
|
|
2963
|
+
* @private
|
|
2964
|
+
*
|
|
2965
|
+
* @param {Highcharts.Axis} axis
|
|
2966
|
+
* The axis to check against.
|
|
2967
|
+
*
|
|
2968
|
+
* @param {Highcharts.GridNode} node
|
|
2969
|
+
* The node to collapse.
|
|
2970
|
+
*/
|
|
2971
|
+
Additions.prototype.setCollapsedStatus = function (node) {
|
|
2972
|
+
var axis = this.axis,
|
|
2973
|
+
chart = axis.chart;
|
|
2974
|
+
axis.series.forEach(function (series) {
|
|
2975
|
+
var data = series.options.data;
|
|
2976
|
+
if (node.id && data) {
|
|
2977
|
+
var point = chart.get(node.id),
|
|
2978
|
+
dataPoint = data[series.data.indexOf(point)];
|
|
2979
|
+
if (point && dataPoint) {
|
|
2980
|
+
point.collapsed = node.collapsed;
|
|
2981
|
+
dataPoint.collapsed = node.collapsed;
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
});
|
|
2985
|
+
};
|
|
2998
2986
|
/**
|
|
2999
2987
|
* Calculates the new axis breaks to collapse a node.
|
|
3000
2988
|
*
|
|
@@ -3018,6 +3006,9 @@
|
|
|
3018
3006
|
obj = getBreakFromNode(node,
|
|
3019
3007
|
axis.max);
|
|
3020
3008
|
breaks.push(obj);
|
|
3009
|
+
// Change the collapsed flag #13838
|
|
3010
|
+
node.collapsed = true;
|
|
3011
|
+
axis.treeGrid.setCollapsedStatus(node);
|
|
3021
3012
|
return breaks;
|
|
3022
3013
|
};
|
|
3023
3014
|
/**
|
|
@@ -3042,6 +3033,9 @@
|
|
|
3042
3033
|
breaks = (axis.options.breaks || []),
|
|
3043
3034
|
obj = getBreakFromNode(node,
|
|
3044
3035
|
axis.max);
|
|
3036
|
+
// Change the collapsed flag #13838
|
|
3037
|
+
node.collapsed = false;
|
|
3038
|
+
axis.treeGrid.setCollapsedStatus(node);
|
|
3045
3039
|
// Remove the break from the axis breaks array.
|
|
3046
3040
|
return breaks.reduce(function (arr, b) {
|
|
3047
3041
|
if (b.to !== obj.to || b.from !== obj.from) {
|
|
@@ -3060,11 +3054,13 @@
|
|
|
3060
3054
|
* List of positions.
|
|
3061
3055
|
*/
|
|
3062
3056
|
Additions.prototype.getTickPositions = function () {
|
|
3063
|
-
var axis = this.axis
|
|
3057
|
+
var axis = this.axis,
|
|
3058
|
+
roundedMin = Math.floor(axis.min / axis.tickInterval) * axis.tickInterval,
|
|
3059
|
+
roundedMax = Math.ceil(axis.max / axis.tickInterval) * axis.tickInterval;
|
|
3064
3060
|
return Object.keys(axis.treeGrid.mapOfPosToGridNode || {}).reduce(function (arr, key) {
|
|
3065
3061
|
var pos = +key;
|
|
3066
|
-
if (
|
|
3067
|
-
|
|
3062
|
+
if (pos >= roundedMin &&
|
|
3063
|
+
pos <= roundedMax &&
|
|
3068
3064
|
!(axis.brokenAxis && axis.brokenAxis.isInAnyBreak(pos))) {
|
|
3069
3065
|
arr.push(pos);
|
|
3070
3066
|
}
|
|
@@ -3130,767 +3126,218 @@
|
|
|
3130
3126
|
|
|
3131
3127
|
return TreeGridAxis;
|
|
3132
3128
|
});
|
|
3133
|
-
_registerModule(_modules, '
|
|
3129
|
+
_registerModule(_modules, 'Extensions/CurrentDateIndication.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Utilities.js'], _modules['Core/Axis/PlotLineOrBand.js']], function (Axis, U, PlotLineOrBand) {
|
|
3134
3130
|
/* *
|
|
3135
3131
|
*
|
|
3136
|
-
* (c) 2016 Highsoft AS
|
|
3137
|
-
*
|
|
3132
|
+
* (c) 2016-2020 Highsoft AS
|
|
3133
|
+
*
|
|
3134
|
+
* Author: Lars A. V. Cabrera
|
|
3138
3135
|
*
|
|
3139
3136
|
* License: www.highcharts.com/license
|
|
3140
3137
|
*
|
|
3141
3138
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3142
3139
|
*
|
|
3143
3140
|
* */
|
|
3144
|
-
var
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3141
|
+
var addEvent = U.addEvent,
|
|
3142
|
+
merge = U.merge,
|
|
3143
|
+
wrap = U.wrap;
|
|
3144
|
+
var defaultConfig = {
|
|
3145
|
+
/**
|
|
3146
|
+
* Show an indicator on the axis for the current date and time. Can be a
|
|
3147
|
+
* boolean or a configuration object similar to
|
|
3148
|
+
* [xAxis.plotLines](#xAxis.plotLines).
|
|
3149
|
+
*
|
|
3150
|
+
* @sample gantt/current-date-indicator/demo
|
|
3151
|
+
* Current date indicator enabled
|
|
3152
|
+
* @sample gantt/current-date-indicator/object-config
|
|
3153
|
+
* Current date indicator with custom options
|
|
3154
|
+
*
|
|
3155
|
+
* @declare Highcharts.AxisCurrentDateIndicatorOptions
|
|
3156
|
+
* @type {boolean|*}
|
|
3157
|
+
* @default true
|
|
3158
|
+
* @extends xAxis.plotLines
|
|
3159
|
+
* @excluding value
|
|
3160
|
+
* @product gantt
|
|
3161
|
+
* @apioption xAxis.currentDateIndicator
|
|
3162
|
+
*/
|
|
3163
|
+
currentDateIndicator: true,
|
|
3164
|
+
color: '#ccd6eb',
|
|
3165
|
+
width: 2,
|
|
3166
|
+
/**
|
|
3167
|
+
* @declare Highcharts.AxisCurrentDateIndicatorLabelOptions
|
|
3168
|
+
*/
|
|
3169
|
+
label: {
|
|
3170
|
+
/**
|
|
3171
|
+
* Format of the label. This options is passed as the fist argument to
|
|
3172
|
+
* [dateFormat](/class-reference/Highcharts#dateFormat) function.
|
|
3173
|
+
*
|
|
3174
|
+
* @type {string}
|
|
3175
|
+
* @default %a, %b %d %Y, %H:%M
|
|
3176
|
+
* @product gantt
|
|
3177
|
+
* @apioption xAxis.currentDateIndicator.label.format
|
|
3178
|
+
*/
|
|
3179
|
+
format: '%a, %b %d %Y, %H:%M',
|
|
3180
|
+
formatter: function (value, format) {
|
|
3181
|
+
return this.axis.chart.time.dateFormat(format, value);
|
|
3182
|
+
},
|
|
3183
|
+
rotation: 0,
|
|
3184
|
+
/**
|
|
3185
|
+
* @type {Highcharts.CSSObject}
|
|
3186
|
+
*/
|
|
3187
|
+
style: {
|
|
3188
|
+
/** @internal */
|
|
3189
|
+
fontSize: '10px'
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
};
|
|
3193
|
+
/* eslint-disable no-invalid-this */
|
|
3194
|
+
addEvent(Axis, 'afterSetOptions', function () {
|
|
3195
|
+
var options = this.options,
|
|
3196
|
+
cdiOptions = options.currentDateIndicator;
|
|
3197
|
+
if (cdiOptions) {
|
|
3198
|
+
cdiOptions = typeof cdiOptions === 'object' ?
|
|
3199
|
+
merge(defaultConfig, cdiOptions) : merge(defaultConfig);
|
|
3200
|
+
cdiOptions.value = new Date();
|
|
3201
|
+
if (!options.plotLines) {
|
|
3202
|
+
options.plotLines = [];
|
|
3203
|
+
}
|
|
3204
|
+
options.plotLines.push(cdiOptions);
|
|
3205
|
+
}
|
|
3206
|
+
});
|
|
3207
|
+
addEvent(PlotLineOrBand, 'render', function () {
|
|
3208
|
+
// If the label already exists, update its text
|
|
3209
|
+
if (this.label) {
|
|
3210
|
+
this.label.attr({
|
|
3211
|
+
text: this.getLabelText(this.options.label)
|
|
3212
|
+
});
|
|
3213
|
+
}
|
|
3214
|
+
});
|
|
3215
|
+
wrap(PlotLineOrBand.prototype, 'getLabelText', function (defaultMethod, defaultLabelOptions) {
|
|
3216
|
+
var options = this.options;
|
|
3217
|
+
if (options.currentDateIndicator && options.label &&
|
|
3218
|
+
typeof options.label.formatter === 'function') {
|
|
3219
|
+
options.value = new Date();
|
|
3220
|
+
return options.label.formatter
|
|
3221
|
+
.call(this, options.value, options.label.format);
|
|
3222
|
+
}
|
|
3223
|
+
return defaultMethod.call(this, defaultLabelOptions);
|
|
3224
|
+
});
|
|
3225
|
+
|
|
3226
|
+
});
|
|
3227
|
+
_registerModule(_modules, 'Extensions/StaticScale.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Utilities.js']], function (Axis, Chart, U) {
|
|
3228
|
+
/* *
|
|
3152
3229
|
*
|
|
3153
|
-
*
|
|
3154
|
-
* @function findLastObstacleBefore
|
|
3230
|
+
* (c) 2016-2020 Torstein Honsi, Lars Cabrera
|
|
3155
3231
|
*
|
|
3156
|
-
*
|
|
3157
|
-
* Array of obstacles to search in.
|
|
3232
|
+
* License: www.highcharts.com/license
|
|
3158
3233
|
*
|
|
3159
|
-
*
|
|
3160
|
-
* The xMin threshold.
|
|
3234
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3161
3235
|
*
|
|
3162
|
-
*
|
|
3163
|
-
|
|
3236
|
+
* */
|
|
3237
|
+
var addEvent = U.addEvent,
|
|
3238
|
+
defined = U.defined,
|
|
3239
|
+
isNumber = U.isNumber,
|
|
3240
|
+
pick = U.pick;
|
|
3241
|
+
/* eslint-disable no-invalid-this */
|
|
3242
|
+
/**
|
|
3243
|
+
* For vertical axes only. Setting the static scale ensures that each tick unit
|
|
3244
|
+
* is translated into a fixed pixel height. For example, setting the static
|
|
3245
|
+
* scale to 24 results in each Y axis category taking up 24 pixels, and the
|
|
3246
|
+
* height of the chart adjusts. Adding or removing items will make the chart
|
|
3247
|
+
* resize.
|
|
3164
3248
|
*
|
|
3165
|
-
* @
|
|
3166
|
-
*
|
|
3249
|
+
* @sample gantt/xrange-series/demo/
|
|
3250
|
+
* X-range series with static scale
|
|
3251
|
+
*
|
|
3252
|
+
* @type {number}
|
|
3253
|
+
* @default 50
|
|
3254
|
+
* @since 6.2.0
|
|
3255
|
+
* @product gantt
|
|
3256
|
+
* @apioption yAxis.staticScale
|
|
3167
3257
|
*/
|
|
3168
|
-
|
|
3169
|
-
var
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
cmp = min - obstacles[cursor].xMin;
|
|
3177
|
-
if (cmp > 0) {
|
|
3178
|
-
left = cursor + 1;
|
|
3179
|
-
}
|
|
3180
|
-
else if (cmp < 0) {
|
|
3181
|
-
right = cursor - 1;
|
|
3182
|
-
}
|
|
3183
|
-
else {
|
|
3184
|
-
return cursor;
|
|
3185
|
-
}
|
|
3258
|
+
addEvent(Axis, 'afterSetOptions', function () {
|
|
3259
|
+
var chartOptions = this.chart.options && this.chart.options.chart;
|
|
3260
|
+
if (!this.horiz &&
|
|
3261
|
+
isNumber(this.options.staticScale) &&
|
|
3262
|
+
(!chartOptions.height ||
|
|
3263
|
+
(chartOptions.scrollablePlotArea &&
|
|
3264
|
+
chartOptions.scrollablePlotArea.minHeight))) {
|
|
3265
|
+
this.staticScale = this.options.staticScale;
|
|
3186
3266
|
}
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3267
|
+
});
|
|
3268
|
+
Chart.prototype.adjustHeight = function () {
|
|
3269
|
+
if (this.redrawTrigger !== 'adjustHeight') {
|
|
3270
|
+
(this.axes || []).forEach(function (axis) {
|
|
3271
|
+
var chart = axis.chart,
|
|
3272
|
+
animate = !!chart.initiatedScale &&
|
|
3273
|
+
chart.options.animation,
|
|
3274
|
+
staticScale = axis.options.staticScale,
|
|
3275
|
+
height,
|
|
3276
|
+
diff;
|
|
3277
|
+
if (axis.staticScale && defined(axis.min)) {
|
|
3278
|
+
height = pick(axis.brokenAxis && axis.brokenAxis.unitLength, axis.max + axis.tickInterval - axis.min) * staticScale;
|
|
3279
|
+
// Minimum height is 1 x staticScale.
|
|
3280
|
+
height = Math.max(height, staticScale);
|
|
3281
|
+
diff = height - chart.plotHeight;
|
|
3282
|
+
if (Math.abs(diff) >= 1) {
|
|
3283
|
+
chart.plotHeight = height;
|
|
3284
|
+
chart.redrawTrigger = 'adjustHeight';
|
|
3285
|
+
chart.setSize(void 0, chart.chartHeight + diff, animate);
|
|
3286
|
+
}
|
|
3287
|
+
// Make sure clip rects have the right height before initial
|
|
3288
|
+
// animation.
|
|
3289
|
+
axis.series.forEach(function (series) {
|
|
3290
|
+
var clipRect = series.sharedClipKey &&
|
|
3291
|
+
chart[series.sharedClipKey];
|
|
3292
|
+
if (clipRect) {
|
|
3293
|
+
clipRect.attr({
|
|
3294
|
+
height: chart.plotHeight
|
|
3295
|
+
});
|
|
3296
|
+
}
|
|
3297
|
+
});
|
|
3298
|
+
}
|
|
3299
|
+
});
|
|
3300
|
+
this.initiatedScale = true;
|
|
3301
|
+
}
|
|
3302
|
+
this.redrawTrigger = null;
|
|
3303
|
+
};
|
|
3304
|
+
addEvent(Chart, 'render', Chart.prototype.adjustHeight);
|
|
3305
|
+
|
|
3306
|
+
});
|
|
3307
|
+
_registerModule(_modules, 'Extensions/ArrowSymbols.js', [_modules['Core/Renderer/SVG/SVGRenderer.js']], function (SVGRenderer) {
|
|
3308
|
+
/* *
|
|
3191
3309
|
*
|
|
3192
|
-
*
|
|
3193
|
-
*
|
|
3310
|
+
* (c) 2017 Highsoft AS
|
|
3311
|
+
* Authors: Lars A. V. Cabrera
|
|
3194
3312
|
*
|
|
3195
|
-
*
|
|
3196
|
-
* Obstacle to test.
|
|
3313
|
+
* License: www.highcharts.com/license
|
|
3197
3314
|
*
|
|
3198
|
-
*
|
|
3199
|
-
* Point with x/y props.
|
|
3315
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3200
3316
|
*
|
|
3201
|
-
*
|
|
3202
|
-
* Whether point is within the obstacle or not.
|
|
3203
|
-
*/
|
|
3204
|
-
function pointWithinObstacle(obstacle, point) {
|
|
3205
|
-
return (point.x <= obstacle.xMax &&
|
|
3206
|
-
point.x >= obstacle.xMin &&
|
|
3207
|
-
point.y <= obstacle.yMax &&
|
|
3208
|
-
point.y >= obstacle.yMin);
|
|
3209
|
-
}
|
|
3317
|
+
* */
|
|
3210
3318
|
/**
|
|
3211
|
-
*
|
|
3212
|
-
*
|
|
3319
|
+
* Creates an arrow symbol. Like a triangle, except not filled.
|
|
3320
|
+
* ```
|
|
3321
|
+
* o
|
|
3322
|
+
* o
|
|
3323
|
+
* o
|
|
3324
|
+
* o
|
|
3325
|
+
* o
|
|
3326
|
+
* o
|
|
3327
|
+
* o
|
|
3328
|
+
* ```
|
|
3213
3329
|
*
|
|
3214
3330
|
* @private
|
|
3215
|
-
* @function
|
|
3216
|
-
*
|
|
3217
|
-
* @param {Array<object>} obstacles
|
|
3218
|
-
* Obstacles to test.
|
|
3331
|
+
* @function
|
|
3219
3332
|
*
|
|
3220
|
-
* @param {
|
|
3221
|
-
*
|
|
3333
|
+
* @param {number} x
|
|
3334
|
+
* x position of the arrow
|
|
3222
3335
|
*
|
|
3223
|
-
* @
|
|
3224
|
-
*
|
|
3225
|
-
*/
|
|
3226
|
-
function findObstacleFromPoint(obstacles, point) {
|
|
3227
|
-
var i = findLastObstacleBefore(obstacles,
|
|
3228
|
-
point.x + 1) + 1;
|
|
3229
|
-
while (i--) {
|
|
3230
|
-
if (obstacles[i].xMax >= point.x &&
|
|
3231
|
-
// optimization using lazy evaluation
|
|
3232
|
-
pointWithinObstacle(obstacles[i], point)) {
|
|
3233
|
-
return i;
|
|
3234
|
-
}
|
|
3235
|
-
}
|
|
3236
|
-
return -1;
|
|
3237
|
-
}
|
|
3238
|
-
/**
|
|
3239
|
-
* Get SVG path array from array of line segments.
|
|
3336
|
+
* @param {number} y
|
|
3337
|
+
* y position of the arrow
|
|
3240
3338
|
*
|
|
3241
|
-
* @
|
|
3242
|
-
*
|
|
3243
|
-
*
|
|
3244
|
-
* @param {Array<object>} segments
|
|
3245
|
-
* The segments to build the path from.
|
|
3246
|
-
*
|
|
3247
|
-
* @return {Highcharts.SVGPathArray}
|
|
3248
|
-
* SVG path array as accepted by the SVG Renderer.
|
|
3249
|
-
*/
|
|
3250
|
-
function pathFromSegments(segments) {
|
|
3251
|
-
var path = [];
|
|
3252
|
-
if (segments.length) {
|
|
3253
|
-
path.push(['M', segments[0].start.x, segments[0].start.y]);
|
|
3254
|
-
for (var i = 0; i < segments.length; ++i) {
|
|
3255
|
-
path.push(['L', segments[i].end.x, segments[i].end.y]);
|
|
3256
|
-
}
|
|
3257
|
-
}
|
|
3258
|
-
return path;
|
|
3259
|
-
}
|
|
3260
|
-
/**
|
|
3261
|
-
* Limits obstacle max/mins in all directions to bounds. Modifies input
|
|
3262
|
-
* obstacle.
|
|
3263
|
-
*
|
|
3264
|
-
* @private
|
|
3265
|
-
* @function limitObstacleToBounds
|
|
3266
|
-
*
|
|
3267
|
-
* @param {object} obstacle
|
|
3268
|
-
* Obstacle to limit.
|
|
3269
|
-
*
|
|
3270
|
-
* @param {object} bounds
|
|
3271
|
-
* Bounds to use as limit.
|
|
3272
|
-
*
|
|
3273
|
-
* @return {void}
|
|
3274
|
-
*/
|
|
3275
|
-
function limitObstacleToBounds(obstacle, bounds) {
|
|
3276
|
-
obstacle.yMin = max(obstacle.yMin, bounds.yMin);
|
|
3277
|
-
obstacle.yMax = min(obstacle.yMax, bounds.yMax);
|
|
3278
|
-
obstacle.xMin = max(obstacle.xMin, bounds.xMin);
|
|
3279
|
-
obstacle.xMax = min(obstacle.xMax, bounds.xMax);
|
|
3280
|
-
}
|
|
3281
|
-
// Define the available pathfinding algorithms.
|
|
3282
|
-
// Algorithms take up to 3 arguments: starting point, ending point, and an
|
|
3283
|
-
// options object.
|
|
3284
|
-
var algorithms = {
|
|
3285
|
-
/**
|
|
3286
|
-
* Get an SVG path from a starting coordinate to an ending coordinate.
|
|
3287
|
-
* Draws a straight line.
|
|
3288
|
-
*
|
|
3289
|
-
* @function Highcharts.Pathfinder.algorithms.straight
|
|
3290
|
-
*
|
|
3291
|
-
* @param {Highcharts.PositionObject} start
|
|
3292
|
-
* Starting coordinate,
|
|
3293
|
-
object with x/y props.
|
|
3294
|
-
*
|
|
3295
|
-
* @param {Highcharts.PositionObject} end
|
|
3296
|
-
* Ending coordinate,
|
|
3297
|
-
object with x/y props.
|
|
3298
|
-
*
|
|
3299
|
-
* @return {object}
|
|
3300
|
-
* An object with the SVG path in Array form as accepted by the SVG
|
|
3301
|
-
* renderer,
|
|
3302
|
-
as well as an array of new obstacles making up this
|
|
3303
|
-
* path.
|
|
3304
|
-
*/
|
|
3305
|
-
straight: function (start,
|
|
3306
|
-
end) {
|
|
3307
|
-
return {
|
|
3308
|
-
path: [
|
|
3309
|
-
['M',
|
|
3310
|
-
start.x,
|
|
3311
|
-
start.y],
|
|
3312
|
-
['L',
|
|
3313
|
-
end.x,
|
|
3314
|
-
end.y]
|
|
3315
|
-
],
|
|
3316
|
-
obstacles: [{ start: start,
|
|
3317
|
-
end: end }]
|
|
3318
|
-
};
|
|
3319
|
-
},
|
|
3320
|
-
/**
|
|
3321
|
-
* Find a path from a starting coordinate to an ending coordinate, using
|
|
3322
|
-
* right angles only, and taking only starting/ending obstacle into
|
|
3323
|
-
* consideration.
|
|
3324
|
-
*
|
|
3325
|
-
* @function Highcharts.Pathfinder.algorithms.simpleConnect
|
|
3326
|
-
*
|
|
3327
|
-
* @param {Highcharts.PositionObject} start
|
|
3328
|
-
* Starting coordinate, object with x/y props.
|
|
3329
|
-
*
|
|
3330
|
-
* @param {Highcharts.PositionObject} end
|
|
3331
|
-
* Ending coordinate, object with x/y props.
|
|
3332
|
-
*
|
|
3333
|
-
* @param {object} options
|
|
3334
|
-
* Options for the algorithm:
|
|
3335
|
-
* - chartObstacles: Array of chart obstacles to avoid
|
|
3336
|
-
* - startDirectionX: Optional. True if starting in the X direction.
|
|
3337
|
-
* If not provided, the algorithm starts in the direction that is
|
|
3338
|
-
* the furthest between start/end.
|
|
3339
|
-
*
|
|
3340
|
-
* @return {object}
|
|
3341
|
-
* An object with the SVG path in Array form as accepted by the SVG
|
|
3342
|
-
* renderer, as well as an array of new obstacles making up this
|
|
3343
|
-
* path.
|
|
3344
|
-
*/
|
|
3345
|
-
simpleConnect: extend(function (start, end, options) {
|
|
3346
|
-
var segments = [],
|
|
3347
|
-
endSegment,
|
|
3348
|
-
dir = pick(options.startDirectionX,
|
|
3349
|
-
abs(end.x - start.x) > abs(end.y - start.y)) ? 'x' : 'y',
|
|
3350
|
-
chartObstacles = options.chartObstacles,
|
|
3351
|
-
startObstacleIx = findObstacleFromPoint(chartObstacles,
|
|
3352
|
-
start),
|
|
3353
|
-
endObstacleIx = findObstacleFromPoint(chartObstacles,
|
|
3354
|
-
end),
|
|
3355
|
-
startObstacle,
|
|
3356
|
-
endObstacle,
|
|
3357
|
-
prevWaypoint,
|
|
3358
|
-
waypoint,
|
|
3359
|
-
waypoint2,
|
|
3360
|
-
useMax,
|
|
3361
|
-
endPoint;
|
|
3362
|
-
// eslint-disable-next-line valid-jsdoc
|
|
3363
|
-
/**
|
|
3364
|
-
* Return a clone of a point with a property set from a target object,
|
|
3365
|
-
* optionally with an offset
|
|
3366
|
-
* @private
|
|
3367
|
-
*/
|
|
3368
|
-
function copyFromPoint(from, fromKey, to, toKey, offset) {
|
|
3369
|
-
var point = {
|
|
3370
|
-
x: from.x,
|
|
3371
|
-
y: from.y
|
|
3372
|
-
};
|
|
3373
|
-
point[fromKey] = to[toKey || fromKey] + (offset || 0);
|
|
3374
|
-
return point;
|
|
3375
|
-
}
|
|
3376
|
-
// eslint-disable-next-line valid-jsdoc
|
|
3377
|
-
/**
|
|
3378
|
-
* Return waypoint outside obstacle.
|
|
3379
|
-
* @private
|
|
3380
|
-
*/
|
|
3381
|
-
function getMeOut(obstacle, point, direction) {
|
|
3382
|
-
var useMax = abs(point[direction] - obstacle[direction + 'Min']) >
|
|
3383
|
-
abs(point[direction] - obstacle[direction + 'Max']);
|
|
3384
|
-
return copyFromPoint(point, direction, obstacle, direction + (useMax ? 'Max' : 'Min'), useMax ? 1 : -1);
|
|
3385
|
-
}
|
|
3386
|
-
// Pull out end point
|
|
3387
|
-
if (endObstacleIx > -1) {
|
|
3388
|
-
endObstacle = chartObstacles[endObstacleIx];
|
|
3389
|
-
waypoint = getMeOut(endObstacle, end, dir);
|
|
3390
|
-
endSegment = {
|
|
3391
|
-
start: waypoint,
|
|
3392
|
-
end: end
|
|
3393
|
-
};
|
|
3394
|
-
endPoint = waypoint;
|
|
3395
|
-
}
|
|
3396
|
-
else {
|
|
3397
|
-
endPoint = end;
|
|
3398
|
-
}
|
|
3399
|
-
// If an obstacle envelops the start point, add a segment to get out,
|
|
3400
|
-
// and around it.
|
|
3401
|
-
if (startObstacleIx > -1) {
|
|
3402
|
-
startObstacle = chartObstacles[startObstacleIx];
|
|
3403
|
-
waypoint = getMeOut(startObstacle, start, dir);
|
|
3404
|
-
segments.push({
|
|
3405
|
-
start: start,
|
|
3406
|
-
end: waypoint
|
|
3407
|
-
});
|
|
3408
|
-
// If we are going back again, switch direction to get around start
|
|
3409
|
-
// obstacle.
|
|
3410
|
-
if (
|
|
3411
|
-
// Going towards max from start:
|
|
3412
|
-
waypoint[dir] >= start[dir] ===
|
|
3413
|
-
// Going towards min to end:
|
|
3414
|
-
waypoint[dir] >= endPoint[dir]) {
|
|
3415
|
-
dir = dir === 'y' ? 'x' : 'y';
|
|
3416
|
-
useMax = start[dir] < end[dir];
|
|
3417
|
-
segments.push({
|
|
3418
|
-
start: waypoint,
|
|
3419
|
-
end: copyFromPoint(waypoint, dir, startObstacle, dir + (useMax ? 'Max' : 'Min'), useMax ? 1 : -1)
|
|
3420
|
-
});
|
|
3421
|
-
// Switch direction again
|
|
3422
|
-
dir = dir === 'y' ? 'x' : 'y';
|
|
3423
|
-
}
|
|
3424
|
-
}
|
|
3425
|
-
// We are around the start obstacle. Go towards the end in one
|
|
3426
|
-
// direction.
|
|
3427
|
-
prevWaypoint = segments.length ?
|
|
3428
|
-
segments[segments.length - 1].end :
|
|
3429
|
-
start;
|
|
3430
|
-
waypoint = copyFromPoint(prevWaypoint, dir, endPoint);
|
|
3431
|
-
segments.push({
|
|
3432
|
-
start: prevWaypoint,
|
|
3433
|
-
end: waypoint
|
|
3434
|
-
});
|
|
3435
|
-
// Final run to end point in the other direction
|
|
3436
|
-
dir = dir === 'y' ? 'x' : 'y';
|
|
3437
|
-
waypoint2 = copyFromPoint(waypoint, dir, endPoint);
|
|
3438
|
-
segments.push({
|
|
3439
|
-
start: waypoint,
|
|
3440
|
-
end: waypoint2
|
|
3441
|
-
});
|
|
3442
|
-
// Finally add the endSegment
|
|
3443
|
-
segments.push(endSegment);
|
|
3444
|
-
return {
|
|
3445
|
-
path: pathFromSegments(segments),
|
|
3446
|
-
obstacles: segments
|
|
3447
|
-
};
|
|
3448
|
-
}, {
|
|
3449
|
-
requiresObstacles: true
|
|
3450
|
-
}),
|
|
3451
|
-
/**
|
|
3452
|
-
* Find a path from a starting coordinate to an ending coordinate, taking
|
|
3453
|
-
* obstacles into consideration. Might not always find the optimal path,
|
|
3454
|
-
* but is fast, and usually good enough.
|
|
3455
|
-
*
|
|
3456
|
-
* @function Highcharts.Pathfinder.algorithms.fastAvoid
|
|
3457
|
-
*
|
|
3458
|
-
* @param {Highcharts.PositionObject} start
|
|
3459
|
-
* Starting coordinate, object with x/y props.
|
|
3460
|
-
*
|
|
3461
|
-
* @param {Highcharts.PositionObject} end
|
|
3462
|
-
* Ending coordinate, object with x/y props.
|
|
3463
|
-
*
|
|
3464
|
-
* @param {object} options
|
|
3465
|
-
* Options for the algorithm.
|
|
3466
|
-
* - chartObstacles: Array of chart obstacles to avoid
|
|
3467
|
-
* - lineObstacles: Array of line obstacles to jump over
|
|
3468
|
-
* - obstacleMetrics: Object with metrics of chartObstacles cached
|
|
3469
|
-
* - hardBounds: Hard boundaries to not cross
|
|
3470
|
-
* - obstacleOptions: Options for the obstacles, including margin
|
|
3471
|
-
* - startDirectionX: Optional. True if starting in the X direction.
|
|
3472
|
-
* If not provided, the algorithm starts in the
|
|
3473
|
-
* direction that is the furthest between
|
|
3474
|
-
* start/end.
|
|
3475
|
-
*
|
|
3476
|
-
* @return {object}
|
|
3477
|
-
* An object with the SVG path in Array form as accepted by the SVG
|
|
3478
|
-
* renderer, as well as an array of new obstacles making up this
|
|
3479
|
-
* path.
|
|
3480
|
-
*/
|
|
3481
|
-
fastAvoid: extend(function (start, end, options) {
|
|
3482
|
-
/*
|
|
3483
|
-
Algorithm rules/description
|
|
3484
|
-
- Find initial direction
|
|
3485
|
-
- Determine soft/hard max for each direction.
|
|
3486
|
-
- Move along initial direction until obstacle.
|
|
3487
|
-
- Change direction.
|
|
3488
|
-
- If hitting obstacle, first try to change length of previous line
|
|
3489
|
-
before changing direction again.
|
|
3490
|
-
|
|
3491
|
-
Soft min/max x = start/destination x +/- widest obstacle + margin
|
|
3492
|
-
Soft min/max y = start/destination y +/- tallest obstacle + margin
|
|
3493
|
-
|
|
3494
|
-
@todo:
|
|
3495
|
-
- Make retrospective, try changing prev segment to reduce
|
|
3496
|
-
corners
|
|
3497
|
-
- Fix logic for breaking out of end-points - not always picking
|
|
3498
|
-
the best direction currently
|
|
3499
|
-
- When going around the end obstacle we should not always go the
|
|
3500
|
-
shortest route, rather pick the one closer to the end point
|
|
3501
|
-
*/
|
|
3502
|
-
var dirIsX = pick(options.startDirectionX,
|
|
3503
|
-
abs(end.x - start.x) > abs(end.y - start.y)),
|
|
3504
|
-
dir = dirIsX ? 'x' : 'y',
|
|
3505
|
-
segments,
|
|
3506
|
-
useMax,
|
|
3507
|
-
extractedEndPoint,
|
|
3508
|
-
endSegments = [],
|
|
3509
|
-
forceObstacleBreak = false, // Used in clearPathTo to keep track of
|
|
3510
|
-
// when to force break through an obstacle.
|
|
3511
|
-
// Boundaries to stay within. If beyond soft boundary, prefer to
|
|
3512
|
-
// change direction ASAP. If at hard max, always change immediately.
|
|
3513
|
-
metrics = options.obstacleMetrics,
|
|
3514
|
-
softMinX = min(start.x,
|
|
3515
|
-
end.x) - metrics.maxWidth - 10,
|
|
3516
|
-
softMaxX = max(start.x,
|
|
3517
|
-
end.x) + metrics.maxWidth + 10,
|
|
3518
|
-
softMinY = min(start.y,
|
|
3519
|
-
end.y) - metrics.maxHeight - 10,
|
|
3520
|
-
softMaxY = max(start.y,
|
|
3521
|
-
end.y) + metrics.maxHeight + 10,
|
|
3522
|
-
// Obstacles
|
|
3523
|
-
chartObstacles = options.chartObstacles,
|
|
3524
|
-
startObstacleIx = findLastObstacleBefore(chartObstacles,
|
|
3525
|
-
softMinX),
|
|
3526
|
-
endObstacleIx = findLastObstacleBefore(chartObstacles,
|
|
3527
|
-
softMaxX);
|
|
3528
|
-
// eslint-disable-next-line valid-jsdoc
|
|
3529
|
-
/**
|
|
3530
|
-
* How far can you go between two points before hitting an obstacle?
|
|
3531
|
-
* Does not work for diagonal lines (because it doesn't have to).
|
|
3532
|
-
* @private
|
|
3533
|
-
*/
|
|
3534
|
-
function pivotPoint(fromPoint, toPoint, directionIsX) {
|
|
3535
|
-
var firstPoint,
|
|
3536
|
-
lastPoint,
|
|
3537
|
-
highestPoint,
|
|
3538
|
-
lowestPoint,
|
|
3539
|
-
i,
|
|
3540
|
-
searchDirection = fromPoint.x < toPoint.x ? 1 : -1;
|
|
3541
|
-
if (fromPoint.x < toPoint.x) {
|
|
3542
|
-
firstPoint = fromPoint;
|
|
3543
|
-
lastPoint = toPoint;
|
|
3544
|
-
}
|
|
3545
|
-
else {
|
|
3546
|
-
firstPoint = toPoint;
|
|
3547
|
-
lastPoint = fromPoint;
|
|
3548
|
-
}
|
|
3549
|
-
if (fromPoint.y < toPoint.y) {
|
|
3550
|
-
lowestPoint = fromPoint;
|
|
3551
|
-
highestPoint = toPoint;
|
|
3552
|
-
}
|
|
3553
|
-
else {
|
|
3554
|
-
lowestPoint = toPoint;
|
|
3555
|
-
highestPoint = fromPoint;
|
|
3556
|
-
}
|
|
3557
|
-
// Go through obstacle range in reverse if toPoint is before
|
|
3558
|
-
// fromPoint in the X-dimension.
|
|
3559
|
-
i = searchDirection < 0 ?
|
|
3560
|
-
// Searching backwards, start at last obstacle before last point
|
|
3561
|
-
min(findLastObstacleBefore(chartObstacles, lastPoint.x), chartObstacles.length - 1) :
|
|
3562
|
-
// Forwards. Since we're not sorted by xMax, we have to look
|
|
3563
|
-
// at all obstacles.
|
|
3564
|
-
0;
|
|
3565
|
-
// Go through obstacles in this X range
|
|
3566
|
-
while (chartObstacles[i] && (searchDirection > 0 && chartObstacles[i].xMin <= lastPoint.x ||
|
|
3567
|
-
searchDirection < 0 && chartObstacles[i].xMax >= firstPoint.x)) {
|
|
3568
|
-
// If this obstacle is between from and to points in a straight
|
|
3569
|
-
// line, pivot at the intersection.
|
|
3570
|
-
if (chartObstacles[i].xMin <= lastPoint.x &&
|
|
3571
|
-
chartObstacles[i].xMax >= firstPoint.x &&
|
|
3572
|
-
chartObstacles[i].yMin <= highestPoint.y &&
|
|
3573
|
-
chartObstacles[i].yMax >= lowestPoint.y) {
|
|
3574
|
-
if (directionIsX) {
|
|
3575
|
-
return {
|
|
3576
|
-
y: fromPoint.y,
|
|
3577
|
-
x: fromPoint.x < toPoint.x ?
|
|
3578
|
-
chartObstacles[i].xMin - 1 :
|
|
3579
|
-
chartObstacles[i].xMax + 1,
|
|
3580
|
-
obstacle: chartObstacles[i]
|
|
3581
|
-
};
|
|
3582
|
-
}
|
|
3583
|
-
// else ...
|
|
3584
|
-
return {
|
|
3585
|
-
x: fromPoint.x,
|
|
3586
|
-
y: fromPoint.y < toPoint.y ?
|
|
3587
|
-
chartObstacles[i].yMin - 1 :
|
|
3588
|
-
chartObstacles[i].yMax + 1,
|
|
3589
|
-
obstacle: chartObstacles[i]
|
|
3590
|
-
};
|
|
3591
|
-
}
|
|
3592
|
-
i += searchDirection;
|
|
3593
|
-
}
|
|
3594
|
-
return toPoint;
|
|
3595
|
-
}
|
|
3596
|
-
/**
|
|
3597
|
-
* Decide in which direction to dodge or get out of an obstacle.
|
|
3598
|
-
* Considers desired direction, which way is shortest, soft and hard
|
|
3599
|
-
* bounds.
|
|
3600
|
-
*
|
|
3601
|
-
* (? Returns a string, either xMin, xMax, yMin or yMax.)
|
|
3602
|
-
*
|
|
3603
|
-
* @private
|
|
3604
|
-
* @function
|
|
3605
|
-
*
|
|
3606
|
-
* @param {object} obstacle
|
|
3607
|
-
* Obstacle to dodge/escape.
|
|
3608
|
-
*
|
|
3609
|
-
* @param {object} fromPoint
|
|
3610
|
-
* Point with x/y props that's dodging/escaping.
|
|
3611
|
-
*
|
|
3612
|
-
* @param {object} toPoint
|
|
3613
|
-
* Goal point.
|
|
3614
|
-
*
|
|
3615
|
-
* @param {boolean} dirIsX
|
|
3616
|
-
* Dodge in X dimension.
|
|
3617
|
-
*
|
|
3618
|
-
* @param {object} bounds
|
|
3619
|
-
* Hard and soft boundaries.
|
|
3620
|
-
*
|
|
3621
|
-
* @return {boolean}
|
|
3622
|
-
* Use max or not.
|
|
3623
|
-
*/
|
|
3624
|
-
function getDodgeDirection(obstacle, fromPoint, toPoint, dirIsX, bounds) {
|
|
3625
|
-
var softBounds = bounds.soft, hardBounds = bounds.hard, dir = dirIsX ? 'x' : 'y', toPointMax = { x: fromPoint.x, y: fromPoint.y }, toPointMin = { x: fromPoint.x, y: fromPoint.y }, minPivot, maxPivot, maxOutOfSoftBounds = obstacle[dir + 'Max'] >=
|
|
3626
|
-
softBounds[dir + 'Max'], minOutOfSoftBounds = obstacle[dir + 'Min'] <=
|
|
3627
|
-
softBounds[dir + 'Min'], maxOutOfHardBounds = obstacle[dir + 'Max'] >=
|
|
3628
|
-
hardBounds[dir + 'Max'], minOutOfHardBounds = obstacle[dir + 'Min'] <=
|
|
3629
|
-
hardBounds[dir + 'Min'],
|
|
3630
|
-
// Find out if we should prefer one direction over the other if
|
|
3631
|
-
// we can choose freely
|
|
3632
|
-
minDistance = abs(obstacle[dir + 'Min'] - fromPoint[dir]), maxDistance = abs(obstacle[dir + 'Max'] - fromPoint[dir]),
|
|
3633
|
-
// If it's a small difference, pick the one leading towards dest
|
|
3634
|
-
// point. Otherwise pick the shortest distance
|
|
3635
|
-
useMax = abs(minDistance - maxDistance) < 10 ?
|
|
3636
|
-
fromPoint[dir] < toPoint[dir] :
|
|
3637
|
-
maxDistance < minDistance;
|
|
3638
|
-
// Check if we hit any obstacles trying to go around in either
|
|
3639
|
-
// direction.
|
|
3640
|
-
toPointMin[dir] = obstacle[dir + 'Min'];
|
|
3641
|
-
toPointMax[dir] = obstacle[dir + 'Max'];
|
|
3642
|
-
minPivot = pivotPoint(fromPoint, toPointMin, dirIsX)[dir] !==
|
|
3643
|
-
toPointMin[dir];
|
|
3644
|
-
maxPivot = pivotPoint(fromPoint, toPointMax, dirIsX)[dir] !==
|
|
3645
|
-
toPointMax[dir];
|
|
3646
|
-
useMax = minPivot ?
|
|
3647
|
-
(maxPivot ? useMax : true) :
|
|
3648
|
-
(maxPivot ? false : useMax);
|
|
3649
|
-
// useMax now contains our preferred choice, bounds not taken into
|
|
3650
|
-
// account. If both or neither direction is out of bounds we want to
|
|
3651
|
-
// use this.
|
|
3652
|
-
// Deal with soft bounds
|
|
3653
|
-
useMax = minOutOfSoftBounds ?
|
|
3654
|
-
(maxOutOfSoftBounds ? useMax : true) : // Out on min
|
|
3655
|
-
(maxOutOfSoftBounds ? false : useMax); // Not out on min
|
|
3656
|
-
// Deal with hard bounds
|
|
3657
|
-
useMax = minOutOfHardBounds ?
|
|
3658
|
-
(maxOutOfHardBounds ? useMax : true) : // Out on min
|
|
3659
|
-
(maxOutOfHardBounds ? false : useMax); // Not out on min
|
|
3660
|
-
return useMax;
|
|
3661
|
-
}
|
|
3662
|
-
// eslint-disable-next-line valid-jsdoc
|
|
3663
|
-
/**
|
|
3664
|
-
* Find a clear path between point.
|
|
3665
|
-
* @private
|
|
3666
|
-
*/
|
|
3667
|
-
function clearPathTo(fromPoint, toPoint, dirIsX) {
|
|
3668
|
-
// Don't waste time if we've hit goal
|
|
3669
|
-
if (fromPoint.x === toPoint.x && fromPoint.y === toPoint.y) {
|
|
3670
|
-
return [];
|
|
3671
|
-
}
|
|
3672
|
-
var dir = dirIsX ? 'x' : 'y',
|
|
3673
|
-
pivot,
|
|
3674
|
-
segments,
|
|
3675
|
-
waypoint,
|
|
3676
|
-
waypointUseMax,
|
|
3677
|
-
envelopingObstacle,
|
|
3678
|
-
secondEnvelopingObstacle,
|
|
3679
|
-
envelopWaypoint,
|
|
3680
|
-
obstacleMargin = options.obstacleOptions.margin,
|
|
3681
|
-
bounds = {
|
|
3682
|
-
soft: {
|
|
3683
|
-
xMin: softMinX,
|
|
3684
|
-
xMax: softMaxX,
|
|
3685
|
-
yMin: softMinY,
|
|
3686
|
-
yMax: softMaxY
|
|
3687
|
-
},
|
|
3688
|
-
hard: options.hardBounds
|
|
3689
|
-
};
|
|
3690
|
-
// If fromPoint is inside an obstacle we have a problem. Break out
|
|
3691
|
-
// by just going to the outside of this obstacle. We prefer to go to
|
|
3692
|
-
// the nearest edge in the chosen direction.
|
|
3693
|
-
envelopingObstacle =
|
|
3694
|
-
findObstacleFromPoint(chartObstacles, fromPoint);
|
|
3695
|
-
if (envelopingObstacle > -1) {
|
|
3696
|
-
envelopingObstacle = chartObstacles[envelopingObstacle];
|
|
3697
|
-
waypointUseMax = getDodgeDirection(envelopingObstacle, fromPoint, toPoint, dirIsX, bounds);
|
|
3698
|
-
// Cut obstacle to hard bounds to make sure we stay within
|
|
3699
|
-
limitObstacleToBounds(envelopingObstacle, options.hardBounds);
|
|
3700
|
-
envelopWaypoint = dirIsX ? {
|
|
3701
|
-
y: fromPoint.y,
|
|
3702
|
-
x: envelopingObstacle[waypointUseMax ? 'xMax' : 'xMin'] +
|
|
3703
|
-
(waypointUseMax ? 1 : -1)
|
|
3704
|
-
} : {
|
|
3705
|
-
x: fromPoint.x,
|
|
3706
|
-
y: envelopingObstacle[waypointUseMax ? 'yMax' : 'yMin'] +
|
|
3707
|
-
(waypointUseMax ? 1 : -1)
|
|
3708
|
-
};
|
|
3709
|
-
// If we crashed into another obstacle doing this, we put the
|
|
3710
|
-
// waypoint between them instead
|
|
3711
|
-
secondEnvelopingObstacle = findObstacleFromPoint(chartObstacles, envelopWaypoint);
|
|
3712
|
-
if (secondEnvelopingObstacle > -1) {
|
|
3713
|
-
secondEnvelopingObstacle = chartObstacles[secondEnvelopingObstacle];
|
|
3714
|
-
// Cut obstacle to hard bounds
|
|
3715
|
-
limitObstacleToBounds(secondEnvelopingObstacle, options.hardBounds);
|
|
3716
|
-
// Modify waypoint to lay between obstacles
|
|
3717
|
-
envelopWaypoint[dir] = waypointUseMax ? max(envelopingObstacle[dir + 'Max'] - obstacleMargin + 1, (secondEnvelopingObstacle[dir + 'Min'] +
|
|
3718
|
-
envelopingObstacle[dir + 'Max']) / 2) :
|
|
3719
|
-
min((envelopingObstacle[dir + 'Min'] + obstacleMargin - 1), ((secondEnvelopingObstacle[dir + 'Max'] +
|
|
3720
|
-
envelopingObstacle[dir + 'Min']) / 2));
|
|
3721
|
-
// We are not going anywhere. If this happens for the first
|
|
3722
|
-
// time, do nothing. Otherwise, try to go to the extreme of
|
|
3723
|
-
// the obstacle pair in the current direction.
|
|
3724
|
-
if (fromPoint.x === envelopWaypoint.x &&
|
|
3725
|
-
fromPoint.y === envelopWaypoint.y) {
|
|
3726
|
-
if (forceObstacleBreak) {
|
|
3727
|
-
envelopWaypoint[dir] = waypointUseMax ?
|
|
3728
|
-
max(envelopingObstacle[dir + 'Max'], secondEnvelopingObstacle[dir + 'Max']) + 1 :
|
|
3729
|
-
min(envelopingObstacle[dir + 'Min'], secondEnvelopingObstacle[dir + 'Min']) - 1;
|
|
3730
|
-
}
|
|
3731
|
-
// Toggle on if off, and the opposite
|
|
3732
|
-
forceObstacleBreak = !forceObstacleBreak;
|
|
3733
|
-
}
|
|
3734
|
-
else {
|
|
3735
|
-
// This point is not identical to previous.
|
|
3736
|
-
// Clear break trigger.
|
|
3737
|
-
forceObstacleBreak = false;
|
|
3738
|
-
}
|
|
3739
|
-
}
|
|
3740
|
-
segments = [{
|
|
3741
|
-
start: fromPoint,
|
|
3742
|
-
end: envelopWaypoint
|
|
3743
|
-
}];
|
|
3744
|
-
}
|
|
3745
|
-
else { // If not enveloping, use standard pivot calculation
|
|
3746
|
-
pivot = pivotPoint(fromPoint, {
|
|
3747
|
-
x: dirIsX ? toPoint.x : fromPoint.x,
|
|
3748
|
-
y: dirIsX ? fromPoint.y : toPoint.y
|
|
3749
|
-
}, dirIsX);
|
|
3750
|
-
segments = [{
|
|
3751
|
-
start: fromPoint,
|
|
3752
|
-
end: {
|
|
3753
|
-
x: pivot.x,
|
|
3754
|
-
y: pivot.y
|
|
3755
|
-
}
|
|
3756
|
-
}];
|
|
3757
|
-
// Pivot before goal, use a waypoint to dodge obstacle
|
|
3758
|
-
if (pivot[dirIsX ? 'x' : 'y'] !== toPoint[dirIsX ? 'x' : 'y']) {
|
|
3759
|
-
// Find direction of waypoint
|
|
3760
|
-
waypointUseMax = getDodgeDirection(pivot.obstacle, pivot, toPoint, !dirIsX, bounds);
|
|
3761
|
-
// Cut waypoint to hard bounds
|
|
3762
|
-
limitObstacleToBounds(pivot.obstacle, options.hardBounds);
|
|
3763
|
-
waypoint = {
|
|
3764
|
-
x: dirIsX ?
|
|
3765
|
-
pivot.x :
|
|
3766
|
-
pivot.obstacle[waypointUseMax ? 'xMax' : 'xMin'] +
|
|
3767
|
-
(waypointUseMax ? 1 : -1),
|
|
3768
|
-
y: dirIsX ?
|
|
3769
|
-
pivot.obstacle[waypointUseMax ? 'yMax' : 'yMin'] +
|
|
3770
|
-
(waypointUseMax ? 1 : -1) :
|
|
3771
|
-
pivot.y
|
|
3772
|
-
};
|
|
3773
|
-
// We're changing direction here, store that to make sure we
|
|
3774
|
-
// also change direction when adding the last segment array
|
|
3775
|
-
// after handling waypoint.
|
|
3776
|
-
dirIsX = !dirIsX;
|
|
3777
|
-
segments = segments.concat(clearPathTo({
|
|
3778
|
-
x: pivot.x,
|
|
3779
|
-
y: pivot.y
|
|
3780
|
-
}, waypoint, dirIsX));
|
|
3781
|
-
}
|
|
3782
|
-
}
|
|
3783
|
-
// Get segments for the other direction too
|
|
3784
|
-
// Recursion is our friend
|
|
3785
|
-
segments = segments.concat(clearPathTo(segments[segments.length - 1].end, toPoint, !dirIsX));
|
|
3786
|
-
return segments;
|
|
3787
|
-
}
|
|
3788
|
-
// eslint-disable-next-line valid-jsdoc
|
|
3789
|
-
/**
|
|
3790
|
-
* Extract point to outside of obstacle in whichever direction is
|
|
3791
|
-
* closest. Returns new point outside obstacle.
|
|
3792
|
-
* @private
|
|
3793
|
-
*/
|
|
3794
|
-
function extractFromObstacle(obstacle, point, goalPoint) {
|
|
3795
|
-
var dirIsX = min(obstacle.xMax - point.x,
|
|
3796
|
-
point.x - obstacle.xMin) <
|
|
3797
|
-
min(obstacle.yMax - point.y,
|
|
3798
|
-
point.y - obstacle.yMin),
|
|
3799
|
-
bounds = {
|
|
3800
|
-
soft: options.hardBounds,
|
|
3801
|
-
hard: options.hardBounds
|
|
3802
|
-
},
|
|
3803
|
-
useMax = getDodgeDirection(obstacle,
|
|
3804
|
-
point,
|
|
3805
|
-
goalPoint,
|
|
3806
|
-
dirIsX,
|
|
3807
|
-
bounds);
|
|
3808
|
-
return dirIsX ? {
|
|
3809
|
-
y: point.y,
|
|
3810
|
-
x: obstacle[useMax ? 'xMax' : 'xMin'] + (useMax ? 1 : -1)
|
|
3811
|
-
} : {
|
|
3812
|
-
x: point.x,
|
|
3813
|
-
y: obstacle[useMax ? 'yMax' : 'yMin'] + (useMax ? 1 : -1)
|
|
3814
|
-
};
|
|
3815
|
-
}
|
|
3816
|
-
// Cut the obstacle array to soft bounds for optimization in large
|
|
3817
|
-
// datasets.
|
|
3818
|
-
chartObstacles =
|
|
3819
|
-
chartObstacles.slice(startObstacleIx, endObstacleIx + 1);
|
|
3820
|
-
// If an obstacle envelops the end point, move it out of there and add
|
|
3821
|
-
// a little segment to where it was.
|
|
3822
|
-
if ((endObstacleIx = findObstacleFromPoint(chartObstacles, end)) > -1) {
|
|
3823
|
-
extractedEndPoint = extractFromObstacle(chartObstacles[endObstacleIx], end, start);
|
|
3824
|
-
endSegments.push({
|
|
3825
|
-
end: end,
|
|
3826
|
-
start: extractedEndPoint
|
|
3827
|
-
});
|
|
3828
|
-
end = extractedEndPoint;
|
|
3829
|
-
}
|
|
3830
|
-
// If it's still inside one or more obstacles, get out of there by
|
|
3831
|
-
// force-moving towards the start point.
|
|
3832
|
-
while ((endObstacleIx = findObstacleFromPoint(chartObstacles, end)) > -1) {
|
|
3833
|
-
useMax = end[dir] - start[dir] < 0;
|
|
3834
|
-
extractedEndPoint = {
|
|
3835
|
-
x: end.x,
|
|
3836
|
-
y: end.y
|
|
3837
|
-
};
|
|
3838
|
-
extractedEndPoint[dir] = chartObstacles[endObstacleIx][useMax ? dir + 'Max' : dir + 'Min'] + (useMax ? 1 : -1);
|
|
3839
|
-
endSegments.push({
|
|
3840
|
-
end: end,
|
|
3841
|
-
start: extractedEndPoint
|
|
3842
|
-
});
|
|
3843
|
-
end = extractedEndPoint;
|
|
3844
|
-
}
|
|
3845
|
-
// Find the path
|
|
3846
|
-
segments = clearPathTo(start, end, dirIsX);
|
|
3847
|
-
// Add the end-point segments
|
|
3848
|
-
segments = segments.concat(endSegments.reverse());
|
|
3849
|
-
return {
|
|
3850
|
-
path: pathFromSegments(segments),
|
|
3851
|
-
obstacles: segments
|
|
3852
|
-
};
|
|
3853
|
-
}, {
|
|
3854
|
-
requiresObstacles: true
|
|
3855
|
-
})
|
|
3856
|
-
};
|
|
3857
|
-
|
|
3858
|
-
return algorithms;
|
|
3859
|
-
});
|
|
3860
|
-
_registerModule(_modules, 'parts-gantt/ArrowSymbols.js', [_modules['parts/Globals.js']], function (H) {
|
|
3861
|
-
/* *
|
|
3862
|
-
*
|
|
3863
|
-
* (c) 2017 Highsoft AS
|
|
3864
|
-
* Authors: Lars A. V. Cabrera
|
|
3865
|
-
*
|
|
3866
|
-
* License: www.highcharts.com/license
|
|
3867
|
-
*
|
|
3868
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
3869
|
-
*
|
|
3870
|
-
* */
|
|
3871
|
-
/**
|
|
3872
|
-
* Creates an arrow symbol. Like a triangle, except not filled.
|
|
3873
|
-
* ```
|
|
3874
|
-
* o
|
|
3875
|
-
* o
|
|
3876
|
-
* o
|
|
3877
|
-
* o
|
|
3878
|
-
* o
|
|
3879
|
-
* o
|
|
3880
|
-
* o
|
|
3881
|
-
* ```
|
|
3882
|
-
*
|
|
3883
|
-
* @private
|
|
3884
|
-
* @function
|
|
3885
|
-
*
|
|
3886
|
-
* @param {number} x
|
|
3887
|
-
* x position of the arrow
|
|
3888
|
-
*
|
|
3889
|
-
* @param {number} y
|
|
3890
|
-
* y position of the arrow
|
|
3891
|
-
*
|
|
3892
|
-
* @param {number} w
|
|
3893
|
-
* width of the arrow
|
|
3339
|
+
* @param {number} w
|
|
3340
|
+
* width of the arrow
|
|
3894
3341
|
*
|
|
3895
3342
|
* @param {number} h
|
|
3896
3343
|
* height of the arrow
|
|
@@ -3898,7 +3345,7 @@
|
|
|
3898
3345
|
* @return {Highcharts.SVGPathArray}
|
|
3899
3346
|
* Path array
|
|
3900
3347
|
*/
|
|
3901
|
-
|
|
3348
|
+
SVGRenderer.prototype.symbols.arrow = function (x, y, w, h) {
|
|
3902
3349
|
return [
|
|
3903
3350
|
['M', x, y + h / 2],
|
|
3904
3351
|
['L', x + w, y],
|
|
@@ -3934,8 +3381,8 @@
|
|
|
3934
3381
|
* @return {Highcharts.SVGPathArray}
|
|
3935
3382
|
* Path array
|
|
3936
3383
|
*/
|
|
3937
|
-
|
|
3938
|
-
return
|
|
3384
|
+
SVGRenderer.prototype.symbols['arrow-half'] = function (x, y, w, h) {
|
|
3385
|
+
return SVGRenderer.prototype.symbols.arrow(x, y, w / 2, h);
|
|
3939
3386
|
};
|
|
3940
3387
|
/**
|
|
3941
3388
|
* Creates a left-oriented triangle.
|
|
@@ -3965,7 +3412,7 @@
|
|
|
3965
3412
|
* @return {Highcharts.SVGPathArray}
|
|
3966
3413
|
* Path array
|
|
3967
3414
|
*/
|
|
3968
|
-
|
|
3415
|
+
SVGRenderer.prototype.symbols['triangle-left'] = function (x, y, w, h) {
|
|
3969
3416
|
return [
|
|
3970
3417
|
['M', x + w, y],
|
|
3971
3418
|
['L', x, y + h / 2],
|
|
@@ -3994,8 +3441,7 @@
|
|
|
3994
3441
|
* @return {Highcharts.SVGPathArray}
|
|
3995
3442
|
* Path array
|
|
3996
3443
|
*/
|
|
3997
|
-
|
|
3998
|
-
H.SVGRenderer.prototype.symbols['triangle-left'];
|
|
3444
|
+
SVGRenderer.prototype.symbols['arrow-filled'] = SVGRenderer.prototype.symbols['triangle-left'];
|
|
3999
3445
|
/**
|
|
4000
3446
|
* Creates a half-width, left-oriented triangle.
|
|
4001
3447
|
* ```
|
|
@@ -4024,8 +3470,8 @@
|
|
|
4024
3470
|
* @return {Highcharts.SVGPathArray}
|
|
4025
3471
|
* Path array
|
|
4026
3472
|
*/
|
|
4027
|
-
|
|
4028
|
-
return
|
|
3473
|
+
SVGRenderer.prototype.symbols['triangle-left-half'] = function (x, y, w, h) {
|
|
3474
|
+
return SVGRenderer.prototype.symbols['triangle-left'](x, y, w / 2, h);
|
|
4029
3475
|
};
|
|
4030
3476
|
/**
|
|
4031
3477
|
* Alias function for triangle-left-half.
|
|
@@ -4048,11 +3494,10 @@
|
|
|
4048
3494
|
* @return {Highcharts.SVGPathArray}
|
|
4049
3495
|
* Path array
|
|
4050
3496
|
*/
|
|
4051
|
-
|
|
4052
|
-
H.SVGRenderer.prototype.symbols['triangle-left-half'];
|
|
3497
|
+
SVGRenderer.prototype.symbols['arrow-filled-half'] = SVGRenderer.prototype.symbols['triangle-left-half'];
|
|
4053
3498
|
|
|
4054
3499
|
});
|
|
4055
|
-
_registerModule(_modules, '
|
|
3500
|
+
_registerModule(_modules, 'Gantt/Connection.js', [_modules['Core/Globals.js'], _modules['Core/Options.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js']], function (H, O, Point, U) {
|
|
4056
3501
|
/* *
|
|
4057
3502
|
*
|
|
4058
3503
|
* (c) 2016 Highsoft AS
|
|
@@ -4086,6 +3531,7 @@
|
|
|
4086
3531
|
* @typedef {"fastAvoid"|"simpleConnect"|"straight"|string} Highcharts.PathfinderTypeValue
|
|
4087
3532
|
*/
|
|
4088
3533
|
''; // detach doclets above
|
|
3534
|
+
var defaultOptions = O.defaultOptions;
|
|
4089
3535
|
var addEvent = U.addEvent,
|
|
4090
3536
|
defined = U.defined,
|
|
4091
3537
|
error = U.error,
|
|
@@ -4104,7 +3550,7 @@
|
|
|
4104
3550
|
and rendering it
|
|
4105
3551
|
*/
|
|
4106
3552
|
// Set default Pathfinder options
|
|
4107
|
-
extend(
|
|
3553
|
+
extend(defaultOptions, {
|
|
4108
3554
|
/**
|
|
4109
3555
|
* The Pathfinder module allows you to define connections between any two
|
|
4110
3556
|
* points, represented as lines - optionally with markers for the start
|
|
@@ -4463,10 +3909,20 @@
|
|
|
4463
3909
|
* @param {Highcharts.ConnectorsOptions} [options]
|
|
4464
3910
|
* Connection options.
|
|
4465
3911
|
*/
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
3912
|
+
var Connection = /** @class */ (function () {
|
|
3913
|
+
function Connection(from, to, options) {
|
|
3914
|
+
/* *
|
|
3915
|
+
*
|
|
3916
|
+
* Properties
|
|
3917
|
+
*
|
|
3918
|
+
* */
|
|
3919
|
+
this.chart = void 0;
|
|
3920
|
+
this.fromPoint = void 0;
|
|
3921
|
+
this.graphics = void 0;
|
|
3922
|
+
this.pathfinder = void 0;
|
|
3923
|
+
this.toPoint = void 0;
|
|
3924
|
+
this.init(from, to, options);
|
|
3925
|
+
}
|
|
4470
3926
|
/**
|
|
4471
3927
|
* Initialize the Connection object. Used as constructor only.
|
|
4472
3928
|
*
|
|
@@ -4481,13 +3937,13 @@
|
|
|
4481
3937
|
* @param {Highcharts.ConnectorsOptions} [options]
|
|
4482
3938
|
* Connection options.
|
|
4483
3939
|
*/
|
|
4484
|
-
init
|
|
3940
|
+
Connection.prototype.init = function (from, to, options) {
|
|
4485
3941
|
this.fromPoint = from;
|
|
4486
3942
|
this.toPoint = to;
|
|
4487
3943
|
this.options = options;
|
|
4488
3944
|
this.chart = from.series.chart;
|
|
4489
3945
|
this.pathfinder = this.chart.pathfinder;
|
|
4490
|
-
}
|
|
3946
|
+
};
|
|
4491
3947
|
/**
|
|
4492
3948
|
* Add (or update) this connection's path on chart. Stores reference to the
|
|
4493
3949
|
* created element on this.graphics.path.
|
|
@@ -4500,10 +3956,10 @@
|
|
|
4500
3956
|
* @param {Highcharts.SVGAttributes} [attribs]
|
|
4501
3957
|
* SVG attributes for the path.
|
|
4502
3958
|
*
|
|
4503
|
-
* @param {Highcharts.AnimationOptionsObject} [animation]
|
|
3959
|
+
* @param {Partial<Highcharts.AnimationOptionsObject>} [animation]
|
|
4504
3960
|
* Animation options for the rendering.
|
|
4505
3961
|
*/
|
|
4506
|
-
renderPath
|
|
3962
|
+
Connection.prototype.renderPath = function (path, attribs, animation) {
|
|
4507
3963
|
var connection = this,
|
|
4508
3964
|
chart = this.chart,
|
|
4509
3965
|
styledMode = chart.styledMode,
|
|
@@ -4542,7 +3998,7 @@
|
|
|
4542
3998
|
// Store reference on connection
|
|
4543
3999
|
this.graphics = this.graphics || {};
|
|
4544
4000
|
this.graphics.path = pathGraphic;
|
|
4545
|
-
}
|
|
4001
|
+
};
|
|
4546
4002
|
/**
|
|
4547
4003
|
* Calculate and add marker graphics for connection to the chart. The
|
|
4548
4004
|
* created/updated elements are stored on this.graphics.start and
|
|
@@ -4561,7 +4017,7 @@
|
|
|
4561
4017
|
* Connection path in array format. This is used to calculate the
|
|
4562
4018
|
* rotation angle of the markers.
|
|
4563
4019
|
*/
|
|
4564
|
-
addMarker
|
|
4020
|
+
Connection.prototype.addMarker = function (type, options, path) {
|
|
4565
4021
|
var connection = this,
|
|
4566
4022
|
chart = connection.fromPoint.series.chart,
|
|
4567
4023
|
pathfinder = chart.pathfinder,
|
|
@@ -4644,7 +4100,7 @@
|
|
|
4644
4100
|
connection.graphics[type].animate(box);
|
|
4645
4101
|
}
|
|
4646
4102
|
}
|
|
4647
|
-
}
|
|
4103
|
+
};
|
|
4648
4104
|
/**
|
|
4649
4105
|
* Calculate and return connection path.
|
|
4650
4106
|
* Note: Recalculates chart obstacles on demand if they aren't calculated.
|
|
@@ -4657,14 +4113,17 @@
|
|
|
4657
4113
|
* @return {object|undefined}
|
|
4658
4114
|
* Calculated SVG path data in array format.
|
|
4659
4115
|
*/
|
|
4660
|
-
getPath
|
|
4116
|
+
Connection.prototype.getPath = function (options) {
|
|
4661
4117
|
var pathfinder = this.pathfinder,
|
|
4662
4118
|
chart = this.chart,
|
|
4663
4119
|
algorithm = pathfinder.algorithms[options.type],
|
|
4664
4120
|
chartObstacles = pathfinder.chartObstacles;
|
|
4665
4121
|
if (typeof algorithm !== 'function') {
|
|
4666
4122
|
error('"' + options.type + '" is not a Pathfinder algorithm.');
|
|
4667
|
-
return
|
|
4123
|
+
return {
|
|
4124
|
+
path: [],
|
|
4125
|
+
obstacles: []
|
|
4126
|
+
};
|
|
4668
4127
|
}
|
|
4669
4128
|
// This function calculates obstacles on demand if they don't exist
|
|
4670
4129
|
if (algorithm.requiresObstacles && !chartObstacles) {
|
|
@@ -4679,92 +4138,1393 @@
|
|
|
4679
4138
|
pathfinder.chartObstacleMetrics =
|
|
4680
4139
|
pathfinder.getObstacleMetrics(chartObstacles);
|
|
4681
4140
|
}
|
|
4682
|
-
// Get the SVG path
|
|
4683
|
-
return algorithm(
|
|
4684
|
-
// From
|
|
4685
|
-
this.fromPoint.getPathfinderAnchorPoint(options.startMarker),
|
|
4686
|
-
// To
|
|
4687
|
-
this.toPoint.getPathfinderAnchorPoint(options.endMarker), merge({
|
|
4688
|
-
chartObstacles: chartObstacles,
|
|
4689
|
-
lineObstacles: pathfinder.lineObstacles || [],
|
|
4690
|
-
obstacleMetrics: pathfinder.chartObstacleMetrics,
|
|
4691
|
-
hardBounds: {
|
|
4692
|
-
xMin: 0,
|
|
4693
|
-
xMax: chart.plotWidth,
|
|
4694
|
-
yMin: 0,
|
|
4695
|
-
yMax: chart.plotHeight
|
|
4696
|
-
},
|
|
4697
|
-
obstacleOptions: {
|
|
4698
|
-
margin: options.algorithmMargin
|
|
4699
|
-
},
|
|
4700
|
-
startDirectionX: pathfinder.getAlgorithmStartDirection(options.startMarker)
|
|
4701
|
-
}, options));
|
|
4702
|
-
}
|
|
4703
|
-
/**
|
|
4704
|
-
* (re)Calculate and (re)draw the connection.
|
|
4705
|
-
*
|
|
4706
|
-
* @function Highcharts.Connection#render
|
|
4707
|
-
*/
|
|
4708
|
-
render
|
|
4709
|
-
var connection = this,
|
|
4710
|
-
fromPoint = connection.fromPoint,
|
|
4711
|
-
series = fromPoint.series,
|
|
4712
|
-
chart = series.chart,
|
|
4713
|
-
pathfinder = chart.pathfinder,
|
|
4714
|
-
pathResult,
|
|
4715
|
-
path,
|
|
4716
|
-
options = merge(chart.options.connectors,
|
|
4717
|
-
series.options.connectors,
|
|
4718
|
-
fromPoint.options.connectors,
|
|
4719
|
-
connection.options),
|
|
4720
|
-
attribs = {};
|
|
4721
|
-
// Set path attribs
|
|
4722
|
-
if (!chart.styledMode) {
|
|
4723
|
-
attribs.stroke = options.lineColor || fromPoint.color;
|
|
4724
|
-
attribs['stroke-width'] = options.lineWidth;
|
|
4725
|
-
if (options.dashStyle) {
|
|
4726
|
-
attribs.dashstyle = options.dashStyle;
|
|
4141
|
+
// Get the SVG path
|
|
4142
|
+
return algorithm(
|
|
4143
|
+
// From
|
|
4144
|
+
this.fromPoint.getPathfinderAnchorPoint(options.startMarker),
|
|
4145
|
+
// To
|
|
4146
|
+
this.toPoint.getPathfinderAnchorPoint(options.endMarker), merge({
|
|
4147
|
+
chartObstacles: chartObstacles,
|
|
4148
|
+
lineObstacles: pathfinder.lineObstacles || [],
|
|
4149
|
+
obstacleMetrics: pathfinder.chartObstacleMetrics,
|
|
4150
|
+
hardBounds: {
|
|
4151
|
+
xMin: 0,
|
|
4152
|
+
xMax: chart.plotWidth,
|
|
4153
|
+
yMin: 0,
|
|
4154
|
+
yMax: chart.plotHeight
|
|
4155
|
+
},
|
|
4156
|
+
obstacleOptions: {
|
|
4157
|
+
margin: options.algorithmMargin
|
|
4158
|
+
},
|
|
4159
|
+
startDirectionX: pathfinder.getAlgorithmStartDirection(options.startMarker)
|
|
4160
|
+
}, options));
|
|
4161
|
+
};
|
|
4162
|
+
/**
|
|
4163
|
+
* (re)Calculate and (re)draw the connection.
|
|
4164
|
+
*
|
|
4165
|
+
* @function Highcharts.Connection#render
|
|
4166
|
+
*/
|
|
4167
|
+
Connection.prototype.render = function () {
|
|
4168
|
+
var connection = this,
|
|
4169
|
+
fromPoint = connection.fromPoint,
|
|
4170
|
+
series = fromPoint.series,
|
|
4171
|
+
chart = series.chart,
|
|
4172
|
+
pathfinder = chart.pathfinder,
|
|
4173
|
+
pathResult,
|
|
4174
|
+
path,
|
|
4175
|
+
options = merge(chart.options.connectors,
|
|
4176
|
+
series.options.connectors,
|
|
4177
|
+
fromPoint.options.connectors,
|
|
4178
|
+
connection.options),
|
|
4179
|
+
attribs = {};
|
|
4180
|
+
// Set path attribs
|
|
4181
|
+
if (!chart.styledMode) {
|
|
4182
|
+
attribs.stroke = options.lineColor || fromPoint.color;
|
|
4183
|
+
attribs['stroke-width'] = options.lineWidth;
|
|
4184
|
+
if (options.dashStyle) {
|
|
4185
|
+
attribs.dashstyle = options.dashStyle;
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4188
|
+
attribs['class'] = // eslint-disable-line dot-notation
|
|
4189
|
+
'highcharts-point-connecting-path ' +
|
|
4190
|
+
'highcharts-color-' + fromPoint.colorIndex;
|
|
4191
|
+
options = merge(attribs, options);
|
|
4192
|
+
// Set common marker options
|
|
4193
|
+
if (!defined(options.marker.radius)) {
|
|
4194
|
+
options.marker.radius = min(max(Math.ceil((options.algorithmMargin || 8) / 2) - 1, 1), 5);
|
|
4195
|
+
}
|
|
4196
|
+
// Get the path
|
|
4197
|
+
pathResult = connection.getPath(options);
|
|
4198
|
+
path = pathResult.path;
|
|
4199
|
+
// Always update obstacle storage with obstacles from this path.
|
|
4200
|
+
// We don't know if future calls will need this for their algorithm.
|
|
4201
|
+
if (pathResult.obstacles) {
|
|
4202
|
+
pathfinder.lineObstacles =
|
|
4203
|
+
pathfinder.lineObstacles || [];
|
|
4204
|
+
pathfinder.lineObstacles =
|
|
4205
|
+
pathfinder.lineObstacles.concat(pathResult.obstacles);
|
|
4206
|
+
}
|
|
4207
|
+
// Add the calculated path to the pathfinder group
|
|
4208
|
+
connection.renderPath(path, attribs, series.options.animation);
|
|
4209
|
+
// Render the markers
|
|
4210
|
+
connection.addMarker('start', merge(options.marker, options.startMarker), path);
|
|
4211
|
+
connection.addMarker('end', merge(options.marker, options.endMarker), path);
|
|
4212
|
+
};
|
|
4213
|
+
/**
|
|
4214
|
+
* Destroy connection by destroying the added graphics elements.
|
|
4215
|
+
*
|
|
4216
|
+
* @function Highcharts.Connection#destroy
|
|
4217
|
+
*/
|
|
4218
|
+
Connection.prototype.destroy = function () {
|
|
4219
|
+
if (this.graphics) {
|
|
4220
|
+
objectEach(this.graphics, function (val) {
|
|
4221
|
+
val.destroy();
|
|
4222
|
+
});
|
|
4223
|
+
delete this.graphics;
|
|
4224
|
+
}
|
|
4225
|
+
};
|
|
4226
|
+
return Connection;
|
|
4227
|
+
}());
|
|
4228
|
+
// Add to Highcharts namespace
|
|
4229
|
+
H.Connection = Connection;
|
|
4230
|
+
// Add pathfinding capabilities to Points
|
|
4231
|
+
extend(Point.prototype, /** @lends Point.prototype */ {
|
|
4232
|
+
/**
|
|
4233
|
+
* Get coordinates of anchor point for pathfinder connection.
|
|
4234
|
+
*
|
|
4235
|
+
* @private
|
|
4236
|
+
* @function Highcharts.Point#getPathfinderAnchorPoint
|
|
4237
|
+
*
|
|
4238
|
+
* @param {Highcharts.ConnectorsMarkerOptions} markerOptions
|
|
4239
|
+
* Connection options for position on point.
|
|
4240
|
+
*
|
|
4241
|
+
* @return {Highcharts.PositionObject}
|
|
4242
|
+
* An object with x/y properties for the position. Coordinates are
|
|
4243
|
+
* in plot values, not relative to point.
|
|
4244
|
+
*/
|
|
4245
|
+
getPathfinderAnchorPoint: function (markerOptions) {
|
|
4246
|
+
var bb = getPointBB(this),
|
|
4247
|
+
x,
|
|
4248
|
+
y;
|
|
4249
|
+
switch (markerOptions.align) { // eslint-disable-line default-case
|
|
4250
|
+
case 'right':
|
|
4251
|
+
x = 'xMax';
|
|
4252
|
+
break;
|
|
4253
|
+
case 'left':
|
|
4254
|
+
x = 'xMin';
|
|
4255
|
+
}
|
|
4256
|
+
switch (markerOptions.verticalAlign) { // eslint-disable-line default-case
|
|
4257
|
+
case 'top':
|
|
4258
|
+
y = 'yMin';
|
|
4259
|
+
break;
|
|
4260
|
+
case 'bottom':
|
|
4261
|
+
y = 'yMax';
|
|
4262
|
+
}
|
|
4263
|
+
return {
|
|
4264
|
+
x: x ? bb[x] : (bb.xMin + bb.xMax) / 2,
|
|
4265
|
+
y: y ? bb[y] : (bb.yMin + bb.yMax) / 2
|
|
4266
|
+
};
|
|
4267
|
+
},
|
|
4268
|
+
/**
|
|
4269
|
+
* Utility to get the angle from one point to another.
|
|
4270
|
+
*
|
|
4271
|
+
* @private
|
|
4272
|
+
* @function Highcharts.Point#getRadiansToVector
|
|
4273
|
+
*
|
|
4274
|
+
* @param {Highcharts.PositionObject} v1
|
|
4275
|
+
* The first vector, as an object with x/y properties.
|
|
4276
|
+
*
|
|
4277
|
+
* @param {Highcharts.PositionObject} v2
|
|
4278
|
+
* The second vector, as an object with x/y properties.
|
|
4279
|
+
*
|
|
4280
|
+
* @return {number}
|
|
4281
|
+
* The angle in degrees
|
|
4282
|
+
*/
|
|
4283
|
+
getRadiansToVector: function (v1, v2) {
|
|
4284
|
+
var box;
|
|
4285
|
+
if (!defined(v2)) {
|
|
4286
|
+
box = getPointBB(this);
|
|
4287
|
+
if (box) {
|
|
4288
|
+
v2 = {
|
|
4289
|
+
x: (box.xMin + box.xMax) / 2,
|
|
4290
|
+
y: (box.yMin + box.yMax) / 2
|
|
4291
|
+
};
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
return Math.atan2(v2.y - v1.y, v1.x - v2.x);
|
|
4295
|
+
},
|
|
4296
|
+
/**
|
|
4297
|
+
* Utility to get the position of the marker, based on the path angle and
|
|
4298
|
+
* the marker's radius.
|
|
4299
|
+
*
|
|
4300
|
+
* @private
|
|
4301
|
+
* @function Highcharts.Point#getMarkerVector
|
|
4302
|
+
*
|
|
4303
|
+
* @param {number} radians
|
|
4304
|
+
* The angle in radians from the point center to another vector.
|
|
4305
|
+
*
|
|
4306
|
+
* @param {number} markerRadius
|
|
4307
|
+
* The radius of the marker, to calculate the additional distance to
|
|
4308
|
+
* the center of the marker.
|
|
4309
|
+
*
|
|
4310
|
+
* @param {object} anchor
|
|
4311
|
+
* The anchor point of the path and marker as an object with x/y
|
|
4312
|
+
* properties.
|
|
4313
|
+
*
|
|
4314
|
+
* @return {object}
|
|
4315
|
+
* The marker vector as an object with x/y properties.
|
|
4316
|
+
*/
|
|
4317
|
+
getMarkerVector: function (radians, markerRadius, anchor) {
|
|
4318
|
+
var twoPI = Math.PI * 2.0,
|
|
4319
|
+
theta = radians,
|
|
4320
|
+
bb = getPointBB(this),
|
|
4321
|
+
rectWidth = bb.xMax - bb.xMin,
|
|
4322
|
+
rectHeight = bb.yMax - bb.yMin,
|
|
4323
|
+
rAtan = Math.atan2(rectHeight,
|
|
4324
|
+
rectWidth),
|
|
4325
|
+
tanTheta = 1,
|
|
4326
|
+
leftOrRightRegion = false,
|
|
4327
|
+
rectHalfWidth = rectWidth / 2.0,
|
|
4328
|
+
rectHalfHeight = rectHeight / 2.0,
|
|
4329
|
+
rectHorizontalCenter = bb.xMin + rectHalfWidth,
|
|
4330
|
+
rectVerticalCenter = bb.yMin + rectHalfHeight,
|
|
4331
|
+
edgePoint = {
|
|
4332
|
+
x: rectHorizontalCenter,
|
|
4333
|
+
y: rectVerticalCenter
|
|
4334
|
+
},
|
|
4335
|
+
markerPoint = {},
|
|
4336
|
+
xFactor = 1,
|
|
4337
|
+
yFactor = 1;
|
|
4338
|
+
while (theta < -Math.PI) {
|
|
4339
|
+
theta += twoPI;
|
|
4340
|
+
}
|
|
4341
|
+
while (theta > Math.PI) {
|
|
4342
|
+
theta -= twoPI;
|
|
4343
|
+
}
|
|
4344
|
+
tanTheta = Math.tan(theta);
|
|
4345
|
+
if ((theta > -rAtan) && (theta <= rAtan)) {
|
|
4346
|
+
// Right side
|
|
4347
|
+
yFactor = -1;
|
|
4348
|
+
leftOrRightRegion = true;
|
|
4349
|
+
}
|
|
4350
|
+
else if (theta > rAtan && theta <= (Math.PI - rAtan)) {
|
|
4351
|
+
// Top side
|
|
4352
|
+
yFactor = -1;
|
|
4353
|
+
}
|
|
4354
|
+
else if (theta > (Math.PI - rAtan) || theta <= -(Math.PI - rAtan)) {
|
|
4355
|
+
// Left side
|
|
4356
|
+
xFactor = -1;
|
|
4357
|
+
leftOrRightRegion = true;
|
|
4358
|
+
}
|
|
4359
|
+
else {
|
|
4360
|
+
// Bottom side
|
|
4361
|
+
xFactor = -1;
|
|
4362
|
+
}
|
|
4363
|
+
// Correct the edgePoint according to the placement of the marker
|
|
4364
|
+
if (leftOrRightRegion) {
|
|
4365
|
+
edgePoint.x += xFactor * (rectHalfWidth);
|
|
4366
|
+
edgePoint.y += yFactor * (rectHalfWidth) * tanTheta;
|
|
4367
|
+
}
|
|
4368
|
+
else {
|
|
4369
|
+
edgePoint.x += xFactor * (rectHeight / (2.0 * tanTheta));
|
|
4370
|
+
edgePoint.y += yFactor * (rectHalfHeight);
|
|
4371
|
+
}
|
|
4372
|
+
if (anchor.x !== rectHorizontalCenter) {
|
|
4373
|
+
edgePoint.x = anchor.x;
|
|
4374
|
+
}
|
|
4375
|
+
if (anchor.y !== rectVerticalCenter) {
|
|
4376
|
+
edgePoint.y = anchor.y;
|
|
4377
|
+
}
|
|
4378
|
+
markerPoint.x = edgePoint.x + (markerRadius * Math.cos(theta));
|
|
4379
|
+
markerPoint.y = edgePoint.y - (markerRadius * Math.sin(theta));
|
|
4380
|
+
return markerPoint;
|
|
4381
|
+
}
|
|
4382
|
+
});
|
|
4383
|
+
/**
|
|
4384
|
+
* Warn if using legacy options. Copy the options over. Note that this will
|
|
4385
|
+
* still break if using the legacy options in chart.update, addSeries etc.
|
|
4386
|
+
* @private
|
|
4387
|
+
*/
|
|
4388
|
+
function warnLegacy(chart) {
|
|
4389
|
+
if (chart.options.pathfinder ||
|
|
4390
|
+
chart.series.reduce(function (acc, series) {
|
|
4391
|
+
if (series.options) {
|
|
4392
|
+
merge(true, (series.options.connectors = series.options.connectors ||
|
|
4393
|
+
{}), series.options.pathfinder);
|
|
4394
|
+
}
|
|
4395
|
+
return acc || series.options && series.options.pathfinder;
|
|
4396
|
+
}, false)) {
|
|
4397
|
+
merge(true, (chart.options.connectors = chart.options.connectors || {}), chart.options.pathfinder);
|
|
4398
|
+
error('WARNING: Pathfinder options have been renamed. ' +
|
|
4399
|
+
'Use "chart.connectors" or "series.connectors" instead.');
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4403
|
+
return Connection;
|
|
4404
|
+
});
|
|
4405
|
+
_registerModule(_modules, 'Gantt/PathfinderAlgorithms.js', [_modules['Core/Utilities.js']], function (U) {
|
|
4406
|
+
/* *
|
|
4407
|
+
*
|
|
4408
|
+
* (c) 2016 Highsoft AS
|
|
4409
|
+
* Author: Øystein Moseng
|
|
4410
|
+
*
|
|
4411
|
+
* License: www.highcharts.com/license
|
|
4412
|
+
*
|
|
4413
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
4414
|
+
*
|
|
4415
|
+
* */
|
|
4416
|
+
var extend = U.extend,
|
|
4417
|
+
pick = U.pick;
|
|
4418
|
+
var min = Math.min,
|
|
4419
|
+
max = Math.max,
|
|
4420
|
+
abs = Math.abs;
|
|
4421
|
+
/**
|
|
4422
|
+
* Get index of last obstacle before xMin. Employs a type of binary search, and
|
|
4423
|
+
* thus requires that obstacles are sorted by xMin value.
|
|
4424
|
+
*
|
|
4425
|
+
* @private
|
|
4426
|
+
* @function findLastObstacleBefore
|
|
4427
|
+
*
|
|
4428
|
+
* @param {Array<object>} obstacles
|
|
4429
|
+
* Array of obstacles to search in.
|
|
4430
|
+
*
|
|
4431
|
+
* @param {number} xMin
|
|
4432
|
+
* The xMin threshold.
|
|
4433
|
+
*
|
|
4434
|
+
* @param {number} [startIx]
|
|
4435
|
+
* Starting index to search from. Must be within array range.
|
|
4436
|
+
*
|
|
4437
|
+
* @return {number}
|
|
4438
|
+
* The index of the last obstacle element before xMin.
|
|
4439
|
+
*/
|
|
4440
|
+
function findLastObstacleBefore(obstacles, xMin, startIx) {
|
|
4441
|
+
var left = startIx || 0, // left limit
|
|
4442
|
+
right = obstacles.length - 1, // right limit
|
|
4443
|
+
min = xMin - 0.0000001, // Make sure we include all obstacles at xMin
|
|
4444
|
+
cursor,
|
|
4445
|
+
cmp;
|
|
4446
|
+
while (left <= right) {
|
|
4447
|
+
cursor = (right + left) >> 1;
|
|
4448
|
+
cmp = min - obstacles[cursor].xMin;
|
|
4449
|
+
if (cmp > 0) {
|
|
4450
|
+
left = cursor + 1;
|
|
4451
|
+
}
|
|
4452
|
+
else if (cmp < 0) {
|
|
4453
|
+
right = cursor - 1;
|
|
4454
|
+
}
|
|
4455
|
+
else {
|
|
4456
|
+
return cursor;
|
|
4457
|
+
}
|
|
4458
|
+
}
|
|
4459
|
+
return left > 0 ? left - 1 : 0;
|
|
4460
|
+
}
|
|
4461
|
+
/**
|
|
4462
|
+
* Test if a point lays within an obstacle.
|
|
4463
|
+
*
|
|
4464
|
+
* @private
|
|
4465
|
+
* @function pointWithinObstacle
|
|
4466
|
+
*
|
|
4467
|
+
* @param {object} obstacle
|
|
4468
|
+
* Obstacle to test.
|
|
4469
|
+
*
|
|
4470
|
+
* @param {Highcharts.Point} point
|
|
4471
|
+
* Point with x/y props.
|
|
4472
|
+
*
|
|
4473
|
+
* @return {boolean}
|
|
4474
|
+
* Whether point is within the obstacle or not.
|
|
4475
|
+
*/
|
|
4476
|
+
function pointWithinObstacle(obstacle, point) {
|
|
4477
|
+
return (point.x <= obstacle.xMax &&
|
|
4478
|
+
point.x >= obstacle.xMin &&
|
|
4479
|
+
point.y <= obstacle.yMax &&
|
|
4480
|
+
point.y >= obstacle.yMin);
|
|
4481
|
+
}
|
|
4482
|
+
/**
|
|
4483
|
+
* Find the index of an obstacle that wraps around a point.
|
|
4484
|
+
* Returns -1 if not found.
|
|
4485
|
+
*
|
|
4486
|
+
* @private
|
|
4487
|
+
* @function findObstacleFromPoint
|
|
4488
|
+
*
|
|
4489
|
+
* @param {Array<object>} obstacles
|
|
4490
|
+
* Obstacles to test.
|
|
4491
|
+
*
|
|
4492
|
+
* @param {Highcharts.Point} point
|
|
4493
|
+
* Point with x/y props.
|
|
4494
|
+
*
|
|
4495
|
+
* @return {number}
|
|
4496
|
+
* Ix of the obstacle in the array, or -1 if not found.
|
|
4497
|
+
*/
|
|
4498
|
+
function findObstacleFromPoint(obstacles, point) {
|
|
4499
|
+
var i = findLastObstacleBefore(obstacles,
|
|
4500
|
+
point.x + 1) + 1;
|
|
4501
|
+
while (i--) {
|
|
4502
|
+
if (obstacles[i].xMax >= point.x &&
|
|
4503
|
+
// optimization using lazy evaluation
|
|
4504
|
+
pointWithinObstacle(obstacles[i], point)) {
|
|
4505
|
+
return i;
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
return -1;
|
|
4509
|
+
}
|
|
4510
|
+
/**
|
|
4511
|
+
* Get SVG path array from array of line segments.
|
|
4512
|
+
*
|
|
4513
|
+
* @private
|
|
4514
|
+
* @function pathFromSegments
|
|
4515
|
+
*
|
|
4516
|
+
* @param {Array<object>} segments
|
|
4517
|
+
* The segments to build the path from.
|
|
4518
|
+
*
|
|
4519
|
+
* @return {Highcharts.SVGPathArray}
|
|
4520
|
+
* SVG path array as accepted by the SVG Renderer.
|
|
4521
|
+
*/
|
|
4522
|
+
function pathFromSegments(segments) {
|
|
4523
|
+
var path = [];
|
|
4524
|
+
if (segments.length) {
|
|
4525
|
+
path.push(['M', segments[0].start.x, segments[0].start.y]);
|
|
4526
|
+
for (var i = 0; i < segments.length; ++i) {
|
|
4527
|
+
path.push(['L', segments[i].end.x, segments[i].end.y]);
|
|
4528
|
+
}
|
|
4529
|
+
}
|
|
4530
|
+
return path;
|
|
4531
|
+
}
|
|
4532
|
+
/**
|
|
4533
|
+
* Limits obstacle max/mins in all directions to bounds. Modifies input
|
|
4534
|
+
* obstacle.
|
|
4535
|
+
*
|
|
4536
|
+
* @private
|
|
4537
|
+
* @function limitObstacleToBounds
|
|
4538
|
+
*
|
|
4539
|
+
* @param {object} obstacle
|
|
4540
|
+
* Obstacle to limit.
|
|
4541
|
+
*
|
|
4542
|
+
* @param {object} bounds
|
|
4543
|
+
* Bounds to use as limit.
|
|
4544
|
+
*
|
|
4545
|
+
* @return {void}
|
|
4546
|
+
*/
|
|
4547
|
+
function limitObstacleToBounds(obstacle, bounds) {
|
|
4548
|
+
obstacle.yMin = max(obstacle.yMin, bounds.yMin);
|
|
4549
|
+
obstacle.yMax = min(obstacle.yMax, bounds.yMax);
|
|
4550
|
+
obstacle.xMin = max(obstacle.xMin, bounds.xMin);
|
|
4551
|
+
obstacle.xMax = min(obstacle.xMax, bounds.xMax);
|
|
4552
|
+
}
|
|
4553
|
+
/**
|
|
4554
|
+
* Get an SVG path from a starting coordinate to an ending coordinate.
|
|
4555
|
+
* Draws a straight line.
|
|
4556
|
+
*
|
|
4557
|
+
* @function Highcharts.Pathfinder.algorithms.straight
|
|
4558
|
+
*
|
|
4559
|
+
* @param {Highcharts.PositionObject} start
|
|
4560
|
+
* Starting coordinate, object with x/y props.
|
|
4561
|
+
*
|
|
4562
|
+
* @param {Highcharts.PositionObject} end
|
|
4563
|
+
* Ending coordinate, object with x/y props.
|
|
4564
|
+
*
|
|
4565
|
+
* @return {object}
|
|
4566
|
+
* An object with the SVG path in Array form as accepted by the SVG
|
|
4567
|
+
* renderer, as well as an array of new obstacles making up this
|
|
4568
|
+
* path.
|
|
4569
|
+
*/
|
|
4570
|
+
function straight(start, end) {
|
|
4571
|
+
return {
|
|
4572
|
+
path: [
|
|
4573
|
+
['M', start.x, start.y],
|
|
4574
|
+
['L', end.x, end.y]
|
|
4575
|
+
],
|
|
4576
|
+
obstacles: [{ start: start, end: end }]
|
|
4577
|
+
};
|
|
4578
|
+
}
|
|
4579
|
+
/**
|
|
4580
|
+
* Find a path from a starting coordinate to an ending coordinate, using
|
|
4581
|
+
* right angles only, and taking only starting/ending obstacle into
|
|
4582
|
+
* consideration.
|
|
4583
|
+
*
|
|
4584
|
+
* @function Highcharts.Pathfinder.algorithms.simpleConnect
|
|
4585
|
+
*
|
|
4586
|
+
* @param {Highcharts.PositionObject} start
|
|
4587
|
+
* Starting coordinate, object with x/y props.
|
|
4588
|
+
*
|
|
4589
|
+
* @param {Highcharts.PositionObject} end
|
|
4590
|
+
* Ending coordinate, object with x/y props.
|
|
4591
|
+
*
|
|
4592
|
+
* @param {object} options
|
|
4593
|
+
* Options for the algorithm:
|
|
4594
|
+
* - chartObstacles: Array of chart obstacles to avoid
|
|
4595
|
+
* - startDirectionX: Optional. True if starting in the X direction.
|
|
4596
|
+
* If not provided, the algorithm starts in the direction that is
|
|
4597
|
+
* the furthest between start/end.
|
|
4598
|
+
*
|
|
4599
|
+
* @return {object}
|
|
4600
|
+
* An object with the SVG path in Array form as accepted by the SVG
|
|
4601
|
+
* renderer, as well as an array of new obstacles making up this
|
|
4602
|
+
* path.
|
|
4603
|
+
*/
|
|
4604
|
+
var simpleConnect = extend(function (start,
|
|
4605
|
+
end,
|
|
4606
|
+
options) {
|
|
4607
|
+
var segments = [],
|
|
4608
|
+
endSegment,
|
|
4609
|
+
dir = pick(options.startDirectionX,
|
|
4610
|
+
abs(end.x - start.x) > abs(end.y - start.y)) ? 'x' : 'y',
|
|
4611
|
+
chartObstacles = options.chartObstacles,
|
|
4612
|
+
startObstacleIx = findObstacleFromPoint(chartObstacles,
|
|
4613
|
+
start),
|
|
4614
|
+
endObstacleIx = findObstacleFromPoint(chartObstacles,
|
|
4615
|
+
end),
|
|
4616
|
+
startObstacle,
|
|
4617
|
+
endObstacle,
|
|
4618
|
+
prevWaypoint,
|
|
4619
|
+
waypoint,
|
|
4620
|
+
waypoint2,
|
|
4621
|
+
useMax,
|
|
4622
|
+
endPoint;
|
|
4623
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4624
|
+
/**
|
|
4625
|
+
* Return a clone of a point with a property set from a target object,
|
|
4626
|
+
* optionally with an offset
|
|
4627
|
+
* @private
|
|
4628
|
+
*/
|
|
4629
|
+
function copyFromPoint(from, fromKey, to, toKey, offset) {
|
|
4630
|
+
var point = {
|
|
4631
|
+
x: from.x,
|
|
4632
|
+
y: from.y
|
|
4633
|
+
};
|
|
4634
|
+
point[fromKey] = to[toKey || fromKey] + (offset || 0);
|
|
4635
|
+
return point;
|
|
4636
|
+
}
|
|
4637
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4638
|
+
/**
|
|
4639
|
+
* Return waypoint outside obstacle.
|
|
4640
|
+
* @private
|
|
4641
|
+
*/
|
|
4642
|
+
function getMeOut(obstacle, point, direction) {
|
|
4643
|
+
var useMax = abs(point[direction] - obstacle[direction + 'Min']) >
|
|
4644
|
+
abs(point[direction] - obstacle[direction + 'Max']);
|
|
4645
|
+
return copyFromPoint(point, direction, obstacle, direction + (useMax ? 'Max' : 'Min'), useMax ? 1 : -1);
|
|
4646
|
+
}
|
|
4647
|
+
// Pull out end point
|
|
4648
|
+
if (endObstacleIx > -1) {
|
|
4649
|
+
endObstacle = chartObstacles[endObstacleIx];
|
|
4650
|
+
waypoint = getMeOut(endObstacle, end, dir);
|
|
4651
|
+
endSegment = {
|
|
4652
|
+
start: waypoint,
|
|
4653
|
+
end: end
|
|
4654
|
+
};
|
|
4655
|
+
endPoint = waypoint;
|
|
4656
|
+
}
|
|
4657
|
+
else {
|
|
4658
|
+
endPoint = end;
|
|
4659
|
+
}
|
|
4660
|
+
// If an obstacle envelops the start point, add a segment to get out,
|
|
4661
|
+
// and around it.
|
|
4662
|
+
if (startObstacleIx > -1) {
|
|
4663
|
+
startObstacle = chartObstacles[startObstacleIx];
|
|
4664
|
+
waypoint = getMeOut(startObstacle, start, dir);
|
|
4665
|
+
segments.push({
|
|
4666
|
+
start: start,
|
|
4667
|
+
end: waypoint
|
|
4668
|
+
});
|
|
4669
|
+
// If we are going back again, switch direction to get around start
|
|
4670
|
+
// obstacle.
|
|
4671
|
+
if (
|
|
4672
|
+
// Going towards max from start:
|
|
4673
|
+
waypoint[dir] >= start[dir] ===
|
|
4674
|
+
// Going towards min to end:
|
|
4675
|
+
waypoint[dir] >= endPoint[dir]) {
|
|
4676
|
+
dir = dir === 'y' ? 'x' : 'y';
|
|
4677
|
+
useMax = start[dir] < end[dir];
|
|
4678
|
+
segments.push({
|
|
4679
|
+
start: waypoint,
|
|
4680
|
+
end: copyFromPoint(waypoint, dir, startObstacle, dir + (useMax ? 'Max' : 'Min'), useMax ? 1 : -1)
|
|
4681
|
+
});
|
|
4682
|
+
// Switch direction again
|
|
4683
|
+
dir = dir === 'y' ? 'x' : 'y';
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
// We are around the start obstacle. Go towards the end in one
|
|
4687
|
+
// direction.
|
|
4688
|
+
prevWaypoint = segments.length ?
|
|
4689
|
+
segments[segments.length - 1].end :
|
|
4690
|
+
start;
|
|
4691
|
+
waypoint = copyFromPoint(prevWaypoint, dir, endPoint);
|
|
4692
|
+
segments.push({
|
|
4693
|
+
start: prevWaypoint,
|
|
4694
|
+
end: waypoint
|
|
4695
|
+
});
|
|
4696
|
+
// Final run to end point in the other direction
|
|
4697
|
+
dir = dir === 'y' ? 'x' : 'y';
|
|
4698
|
+
waypoint2 = copyFromPoint(waypoint, dir, endPoint);
|
|
4699
|
+
segments.push({
|
|
4700
|
+
start: waypoint,
|
|
4701
|
+
end: waypoint2
|
|
4702
|
+
});
|
|
4703
|
+
// Finally add the endSegment
|
|
4704
|
+
segments.push(endSegment);
|
|
4705
|
+
return {
|
|
4706
|
+
path: pathFromSegments(segments),
|
|
4707
|
+
obstacles: segments
|
|
4708
|
+
};
|
|
4709
|
+
}, {
|
|
4710
|
+
requiresObstacles: true
|
|
4711
|
+
});
|
|
4712
|
+
/**
|
|
4713
|
+
* Find a path from a starting coordinate to an ending coordinate, taking
|
|
4714
|
+
* obstacles into consideration. Might not always find the optimal path,
|
|
4715
|
+
* but is fast, and usually good enough.
|
|
4716
|
+
*
|
|
4717
|
+
* @function Highcharts.Pathfinder.algorithms.fastAvoid
|
|
4718
|
+
*
|
|
4719
|
+
* @param {Highcharts.PositionObject} start
|
|
4720
|
+
* Starting coordinate, object with x/y props.
|
|
4721
|
+
*
|
|
4722
|
+
* @param {Highcharts.PositionObject} end
|
|
4723
|
+
* Ending coordinate, object with x/y props.
|
|
4724
|
+
*
|
|
4725
|
+
* @param {object} options
|
|
4726
|
+
* Options for the algorithm.
|
|
4727
|
+
* - chartObstacles: Array of chart obstacles to avoid
|
|
4728
|
+
* - lineObstacles: Array of line obstacles to jump over
|
|
4729
|
+
* - obstacleMetrics: Object with metrics of chartObstacles cached
|
|
4730
|
+
* - hardBounds: Hard boundaries to not cross
|
|
4731
|
+
* - obstacleOptions: Options for the obstacles, including margin
|
|
4732
|
+
* - startDirectionX: Optional. True if starting in the X direction.
|
|
4733
|
+
* If not provided, the algorithm starts in the
|
|
4734
|
+
* direction that is the furthest between
|
|
4735
|
+
* start/end.
|
|
4736
|
+
*
|
|
4737
|
+
* @return {object}
|
|
4738
|
+
* An object with the SVG path in Array form as accepted by the SVG
|
|
4739
|
+
* renderer, as well as an array of new obstacles making up this
|
|
4740
|
+
* path.
|
|
4741
|
+
*/
|
|
4742
|
+
var fastAvoid = extend(function (start,
|
|
4743
|
+
end,
|
|
4744
|
+
options) {
|
|
4745
|
+
/*
|
|
4746
|
+
Algorithm rules/description
|
|
4747
|
+
- Find initial direction
|
|
4748
|
+
- Determine soft/hard max for each direction.
|
|
4749
|
+
- Move along initial direction until obstacle.
|
|
4750
|
+
- Change direction.
|
|
4751
|
+
- If hitting obstacle,
|
|
4752
|
+
first try to change length of previous line
|
|
4753
|
+
before changing direction again.
|
|
4754
|
+
|
|
4755
|
+
Soft min/max x = start/destination x +/- widest obstacle + margin
|
|
4756
|
+
Soft min/max y = start/destination y +/- tallest obstacle + margin
|
|
4757
|
+
|
|
4758
|
+
@todo:
|
|
4759
|
+
- Make retrospective,
|
|
4760
|
+
try changing prev segment to reduce
|
|
4761
|
+
corners
|
|
4762
|
+
- Fix logic for breaking out of end-points - not always picking
|
|
4763
|
+
the best direction currently
|
|
4764
|
+
- When going around the end obstacle we should not always go the
|
|
4765
|
+
shortest route,
|
|
4766
|
+
rather pick the one closer to the end point
|
|
4767
|
+
*/
|
|
4768
|
+
var dirIsX = pick(options.startDirectionX,
|
|
4769
|
+
abs(end.x - start.x) > abs(end.y - start.y)),
|
|
4770
|
+
dir = dirIsX ? 'x' : 'y',
|
|
4771
|
+
segments,
|
|
4772
|
+
useMax,
|
|
4773
|
+
extractedEndPoint,
|
|
4774
|
+
endSegments = [],
|
|
4775
|
+
forceObstacleBreak = false, // Used in clearPathTo to keep track of
|
|
4776
|
+
// when to force break through an obstacle.
|
|
4777
|
+
// Boundaries to stay within. If beyond soft boundary, prefer to
|
|
4778
|
+
// change direction ASAP. If at hard max, always change immediately.
|
|
4779
|
+
metrics = options.obstacleMetrics,
|
|
4780
|
+
softMinX = min(start.x,
|
|
4781
|
+
end.x) - metrics.maxWidth - 10,
|
|
4782
|
+
softMaxX = max(start.x,
|
|
4783
|
+
end.x) + metrics.maxWidth + 10,
|
|
4784
|
+
softMinY = min(start.y,
|
|
4785
|
+
end.y) - metrics.maxHeight - 10,
|
|
4786
|
+
softMaxY = max(start.y,
|
|
4787
|
+
end.y) + metrics.maxHeight + 10,
|
|
4788
|
+
// Obstacles
|
|
4789
|
+
chartObstacles = options.chartObstacles,
|
|
4790
|
+
startObstacleIx = findLastObstacleBefore(chartObstacles,
|
|
4791
|
+
softMinX),
|
|
4792
|
+
endObstacleIx = findLastObstacleBefore(chartObstacles,
|
|
4793
|
+
softMaxX);
|
|
4794
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4795
|
+
/**
|
|
4796
|
+
* How far can you go between two points before hitting an obstacle?
|
|
4797
|
+
* Does not work for diagonal lines (because it doesn't have to).
|
|
4798
|
+
* @private
|
|
4799
|
+
*/
|
|
4800
|
+
function pivotPoint(fromPoint, toPoint, directionIsX) {
|
|
4801
|
+
var firstPoint,
|
|
4802
|
+
lastPoint,
|
|
4803
|
+
highestPoint,
|
|
4804
|
+
lowestPoint,
|
|
4805
|
+
i,
|
|
4806
|
+
searchDirection = fromPoint.x < toPoint.x ? 1 : -1;
|
|
4807
|
+
if (fromPoint.x < toPoint.x) {
|
|
4808
|
+
firstPoint = fromPoint;
|
|
4809
|
+
lastPoint = toPoint;
|
|
4810
|
+
}
|
|
4811
|
+
else {
|
|
4812
|
+
firstPoint = toPoint;
|
|
4813
|
+
lastPoint = fromPoint;
|
|
4814
|
+
}
|
|
4815
|
+
if (fromPoint.y < toPoint.y) {
|
|
4816
|
+
lowestPoint = fromPoint;
|
|
4817
|
+
highestPoint = toPoint;
|
|
4818
|
+
}
|
|
4819
|
+
else {
|
|
4820
|
+
lowestPoint = toPoint;
|
|
4821
|
+
highestPoint = fromPoint;
|
|
4822
|
+
}
|
|
4823
|
+
// Go through obstacle range in reverse if toPoint is before
|
|
4824
|
+
// fromPoint in the X-dimension.
|
|
4825
|
+
i = searchDirection < 0 ?
|
|
4826
|
+
// Searching backwards, start at last obstacle before last point
|
|
4827
|
+
min(findLastObstacleBefore(chartObstacles, lastPoint.x), chartObstacles.length - 1) :
|
|
4828
|
+
// Forwards. Since we're not sorted by xMax, we have to look
|
|
4829
|
+
// at all obstacles.
|
|
4830
|
+
0;
|
|
4831
|
+
// Go through obstacles in this X range
|
|
4832
|
+
while (chartObstacles[i] && (searchDirection > 0 && chartObstacles[i].xMin <= lastPoint.x ||
|
|
4833
|
+
searchDirection < 0 && chartObstacles[i].xMax >= firstPoint.x)) {
|
|
4834
|
+
// If this obstacle is between from and to points in a straight
|
|
4835
|
+
// line, pivot at the intersection.
|
|
4836
|
+
if (chartObstacles[i].xMin <= lastPoint.x &&
|
|
4837
|
+
chartObstacles[i].xMax >= firstPoint.x &&
|
|
4838
|
+
chartObstacles[i].yMin <= highestPoint.y &&
|
|
4839
|
+
chartObstacles[i].yMax >= lowestPoint.y) {
|
|
4840
|
+
if (directionIsX) {
|
|
4841
|
+
return {
|
|
4842
|
+
y: fromPoint.y,
|
|
4843
|
+
x: fromPoint.x < toPoint.x ?
|
|
4844
|
+
chartObstacles[i].xMin - 1 :
|
|
4845
|
+
chartObstacles[i].xMax + 1,
|
|
4846
|
+
obstacle: chartObstacles[i]
|
|
4847
|
+
};
|
|
4848
|
+
}
|
|
4849
|
+
// else ...
|
|
4850
|
+
return {
|
|
4851
|
+
x: fromPoint.x,
|
|
4852
|
+
y: fromPoint.y < toPoint.y ?
|
|
4853
|
+
chartObstacles[i].yMin - 1 :
|
|
4854
|
+
chartObstacles[i].yMax + 1,
|
|
4855
|
+
obstacle: chartObstacles[i]
|
|
4856
|
+
};
|
|
4857
|
+
}
|
|
4858
|
+
i += searchDirection;
|
|
4859
|
+
}
|
|
4860
|
+
return toPoint;
|
|
4861
|
+
}
|
|
4862
|
+
/**
|
|
4863
|
+
* Decide in which direction to dodge or get out of an obstacle.
|
|
4864
|
+
* Considers desired direction, which way is shortest, soft and hard
|
|
4865
|
+
* bounds.
|
|
4866
|
+
*
|
|
4867
|
+
* (? Returns a string, either xMin, xMax, yMin or yMax.)
|
|
4868
|
+
*
|
|
4869
|
+
* @private
|
|
4870
|
+
* @function
|
|
4871
|
+
*
|
|
4872
|
+
* @param {object} obstacle
|
|
4873
|
+
* Obstacle to dodge/escape.
|
|
4874
|
+
*
|
|
4875
|
+
* @param {object} fromPoint
|
|
4876
|
+
* Point with x/y props that's dodging/escaping.
|
|
4877
|
+
*
|
|
4878
|
+
* @param {object} toPoint
|
|
4879
|
+
* Goal point.
|
|
4880
|
+
*
|
|
4881
|
+
* @param {boolean} dirIsX
|
|
4882
|
+
* Dodge in X dimension.
|
|
4883
|
+
*
|
|
4884
|
+
* @param {object} bounds
|
|
4885
|
+
* Hard and soft boundaries.
|
|
4886
|
+
*
|
|
4887
|
+
* @return {boolean}
|
|
4888
|
+
* Use max or not.
|
|
4889
|
+
*/
|
|
4890
|
+
function getDodgeDirection(obstacle, fromPoint, toPoint, dirIsX, bounds) {
|
|
4891
|
+
var softBounds = bounds.soft, hardBounds = bounds.hard, dir = dirIsX ? 'x' : 'y', toPointMax = { x: fromPoint.x, y: fromPoint.y }, toPointMin = { x: fromPoint.x, y: fromPoint.y }, minPivot, maxPivot, maxOutOfSoftBounds = obstacle[dir + 'Max'] >=
|
|
4892
|
+
softBounds[dir + 'Max'], minOutOfSoftBounds = obstacle[dir + 'Min'] <=
|
|
4893
|
+
softBounds[dir + 'Min'], maxOutOfHardBounds = obstacle[dir + 'Max'] >=
|
|
4894
|
+
hardBounds[dir + 'Max'], minOutOfHardBounds = obstacle[dir + 'Min'] <=
|
|
4895
|
+
hardBounds[dir + 'Min'],
|
|
4896
|
+
// Find out if we should prefer one direction over the other if
|
|
4897
|
+
// we can choose freely
|
|
4898
|
+
minDistance = abs(obstacle[dir + 'Min'] - fromPoint[dir]), maxDistance = abs(obstacle[dir + 'Max'] - fromPoint[dir]),
|
|
4899
|
+
// If it's a small difference, pick the one leading towards dest
|
|
4900
|
+
// point. Otherwise pick the shortest distance
|
|
4901
|
+
useMax = abs(minDistance - maxDistance) < 10 ?
|
|
4902
|
+
fromPoint[dir] < toPoint[dir] :
|
|
4903
|
+
maxDistance < minDistance;
|
|
4904
|
+
// Check if we hit any obstacles trying to go around in either
|
|
4905
|
+
// direction.
|
|
4906
|
+
toPointMin[dir] = obstacle[dir + 'Min'];
|
|
4907
|
+
toPointMax[dir] = obstacle[dir + 'Max'];
|
|
4908
|
+
minPivot = pivotPoint(fromPoint, toPointMin, dirIsX)[dir] !==
|
|
4909
|
+
toPointMin[dir];
|
|
4910
|
+
maxPivot = pivotPoint(fromPoint, toPointMax, dirIsX)[dir] !==
|
|
4911
|
+
toPointMax[dir];
|
|
4912
|
+
useMax = minPivot ?
|
|
4913
|
+
(maxPivot ? useMax : true) :
|
|
4914
|
+
(maxPivot ? false : useMax);
|
|
4915
|
+
// useMax now contains our preferred choice, bounds not taken into
|
|
4916
|
+
// account. If both or neither direction is out of bounds we want to
|
|
4917
|
+
// use this.
|
|
4918
|
+
// Deal with soft bounds
|
|
4919
|
+
useMax = minOutOfSoftBounds ?
|
|
4920
|
+
(maxOutOfSoftBounds ? useMax : true) : // Out on min
|
|
4921
|
+
(maxOutOfSoftBounds ? false : useMax); // Not out on min
|
|
4922
|
+
// Deal with hard bounds
|
|
4923
|
+
useMax = minOutOfHardBounds ?
|
|
4924
|
+
(maxOutOfHardBounds ? useMax : true) : // Out on min
|
|
4925
|
+
(maxOutOfHardBounds ? false : useMax); // Not out on min
|
|
4926
|
+
return useMax;
|
|
4927
|
+
}
|
|
4928
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4929
|
+
/**
|
|
4930
|
+
* Find a clear path between point.
|
|
4931
|
+
* @private
|
|
4932
|
+
*/
|
|
4933
|
+
function clearPathTo(fromPoint, toPoint, dirIsX) {
|
|
4934
|
+
// Don't waste time if we've hit goal
|
|
4935
|
+
if (fromPoint.x === toPoint.x && fromPoint.y === toPoint.y) {
|
|
4936
|
+
return [];
|
|
4937
|
+
}
|
|
4938
|
+
var dir = dirIsX ? 'x' : 'y',
|
|
4939
|
+
pivot,
|
|
4940
|
+
segments,
|
|
4941
|
+
waypoint,
|
|
4942
|
+
waypointUseMax,
|
|
4943
|
+
envelopingObstacle,
|
|
4944
|
+
secondEnvelopingObstacle,
|
|
4945
|
+
envelopWaypoint,
|
|
4946
|
+
obstacleMargin = options.obstacleOptions.margin,
|
|
4947
|
+
bounds = {
|
|
4948
|
+
soft: {
|
|
4949
|
+
xMin: softMinX,
|
|
4950
|
+
xMax: softMaxX,
|
|
4951
|
+
yMin: softMinY,
|
|
4952
|
+
yMax: softMaxY
|
|
4953
|
+
},
|
|
4954
|
+
hard: options.hardBounds
|
|
4955
|
+
};
|
|
4956
|
+
// If fromPoint is inside an obstacle we have a problem. Break out
|
|
4957
|
+
// by just going to the outside of this obstacle. We prefer to go to
|
|
4958
|
+
// the nearest edge in the chosen direction.
|
|
4959
|
+
envelopingObstacle =
|
|
4960
|
+
findObstacleFromPoint(chartObstacles, fromPoint);
|
|
4961
|
+
if (envelopingObstacle > -1) {
|
|
4962
|
+
envelopingObstacle = chartObstacles[envelopingObstacle];
|
|
4963
|
+
waypointUseMax = getDodgeDirection(envelopingObstacle, fromPoint, toPoint, dirIsX, bounds);
|
|
4964
|
+
// Cut obstacle to hard bounds to make sure we stay within
|
|
4965
|
+
limitObstacleToBounds(envelopingObstacle, options.hardBounds);
|
|
4966
|
+
envelopWaypoint = dirIsX ? {
|
|
4967
|
+
y: fromPoint.y,
|
|
4968
|
+
x: envelopingObstacle[waypointUseMax ? 'xMax' : 'xMin'] +
|
|
4969
|
+
(waypointUseMax ? 1 : -1)
|
|
4970
|
+
} : {
|
|
4971
|
+
x: fromPoint.x,
|
|
4972
|
+
y: envelopingObstacle[waypointUseMax ? 'yMax' : 'yMin'] +
|
|
4973
|
+
(waypointUseMax ? 1 : -1)
|
|
4974
|
+
};
|
|
4975
|
+
// If we crashed into another obstacle doing this, we put the
|
|
4976
|
+
// waypoint between them instead
|
|
4977
|
+
secondEnvelopingObstacle = findObstacleFromPoint(chartObstacles, envelopWaypoint);
|
|
4978
|
+
if (secondEnvelopingObstacle > -1) {
|
|
4979
|
+
secondEnvelopingObstacle = chartObstacles[secondEnvelopingObstacle];
|
|
4980
|
+
// Cut obstacle to hard bounds
|
|
4981
|
+
limitObstacleToBounds(secondEnvelopingObstacle, options.hardBounds);
|
|
4982
|
+
// Modify waypoint to lay between obstacles
|
|
4983
|
+
envelopWaypoint[dir] = waypointUseMax ? max(envelopingObstacle[dir + 'Max'] - obstacleMargin + 1, (secondEnvelopingObstacle[dir + 'Min'] +
|
|
4984
|
+
envelopingObstacle[dir + 'Max']) / 2) :
|
|
4985
|
+
min((envelopingObstacle[dir + 'Min'] + obstacleMargin - 1), ((secondEnvelopingObstacle[dir + 'Max'] +
|
|
4986
|
+
envelopingObstacle[dir + 'Min']) / 2));
|
|
4987
|
+
// We are not going anywhere. If this happens for the first
|
|
4988
|
+
// time, do nothing. Otherwise, try to go to the extreme of
|
|
4989
|
+
// the obstacle pair in the current direction.
|
|
4990
|
+
if (fromPoint.x === envelopWaypoint.x &&
|
|
4991
|
+
fromPoint.y === envelopWaypoint.y) {
|
|
4992
|
+
if (forceObstacleBreak) {
|
|
4993
|
+
envelopWaypoint[dir] = waypointUseMax ?
|
|
4994
|
+
max(envelopingObstacle[dir + 'Max'], secondEnvelopingObstacle[dir + 'Max']) + 1 :
|
|
4995
|
+
min(envelopingObstacle[dir + 'Min'], secondEnvelopingObstacle[dir + 'Min']) - 1;
|
|
4996
|
+
}
|
|
4997
|
+
// Toggle on if off, and the opposite
|
|
4998
|
+
forceObstacleBreak = !forceObstacleBreak;
|
|
4999
|
+
}
|
|
5000
|
+
else {
|
|
5001
|
+
// This point is not identical to previous.
|
|
5002
|
+
// Clear break trigger.
|
|
5003
|
+
forceObstacleBreak = false;
|
|
5004
|
+
}
|
|
5005
|
+
}
|
|
5006
|
+
segments = [{
|
|
5007
|
+
start: fromPoint,
|
|
5008
|
+
end: envelopWaypoint
|
|
5009
|
+
}];
|
|
5010
|
+
}
|
|
5011
|
+
else { // If not enveloping, use standard pivot calculation
|
|
5012
|
+
pivot = pivotPoint(fromPoint, {
|
|
5013
|
+
x: dirIsX ? toPoint.x : fromPoint.x,
|
|
5014
|
+
y: dirIsX ? fromPoint.y : toPoint.y
|
|
5015
|
+
}, dirIsX);
|
|
5016
|
+
segments = [{
|
|
5017
|
+
start: fromPoint,
|
|
5018
|
+
end: {
|
|
5019
|
+
x: pivot.x,
|
|
5020
|
+
y: pivot.y
|
|
5021
|
+
}
|
|
5022
|
+
}];
|
|
5023
|
+
// Pivot before goal, use a waypoint to dodge obstacle
|
|
5024
|
+
if (pivot[dirIsX ? 'x' : 'y'] !== toPoint[dirIsX ? 'x' : 'y']) {
|
|
5025
|
+
// Find direction of waypoint
|
|
5026
|
+
waypointUseMax = getDodgeDirection(pivot.obstacle, pivot, toPoint, !dirIsX, bounds);
|
|
5027
|
+
// Cut waypoint to hard bounds
|
|
5028
|
+
limitObstacleToBounds(pivot.obstacle, options.hardBounds);
|
|
5029
|
+
waypoint = {
|
|
5030
|
+
x: dirIsX ?
|
|
5031
|
+
pivot.x :
|
|
5032
|
+
pivot.obstacle[waypointUseMax ? 'xMax' : 'xMin'] +
|
|
5033
|
+
(waypointUseMax ? 1 : -1),
|
|
5034
|
+
y: dirIsX ?
|
|
5035
|
+
pivot.obstacle[waypointUseMax ? 'yMax' : 'yMin'] +
|
|
5036
|
+
(waypointUseMax ? 1 : -1) :
|
|
5037
|
+
pivot.y
|
|
5038
|
+
};
|
|
5039
|
+
// We're changing direction here, store that to make sure we
|
|
5040
|
+
// also change direction when adding the last segment array
|
|
5041
|
+
// after handling waypoint.
|
|
5042
|
+
dirIsX = !dirIsX;
|
|
5043
|
+
segments = segments.concat(clearPathTo({
|
|
5044
|
+
x: pivot.x,
|
|
5045
|
+
y: pivot.y
|
|
5046
|
+
}, waypoint, dirIsX));
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
// Get segments for the other direction too
|
|
5050
|
+
// Recursion is our friend
|
|
5051
|
+
segments = segments.concat(clearPathTo(segments[segments.length - 1].end, toPoint, !dirIsX));
|
|
5052
|
+
return segments;
|
|
5053
|
+
}
|
|
5054
|
+
// eslint-disable-next-line valid-jsdoc
|
|
5055
|
+
/**
|
|
5056
|
+
* Extract point to outside of obstacle in whichever direction is
|
|
5057
|
+
* closest. Returns new point outside obstacle.
|
|
5058
|
+
* @private
|
|
5059
|
+
*/
|
|
5060
|
+
function extractFromObstacle(obstacle, point, goalPoint) {
|
|
5061
|
+
var dirIsX = min(obstacle.xMax - point.x,
|
|
5062
|
+
point.x - obstacle.xMin) <
|
|
5063
|
+
min(obstacle.yMax - point.y,
|
|
5064
|
+
point.y - obstacle.yMin),
|
|
5065
|
+
bounds = {
|
|
5066
|
+
soft: options.hardBounds,
|
|
5067
|
+
hard: options.hardBounds
|
|
5068
|
+
},
|
|
5069
|
+
useMax = getDodgeDirection(obstacle,
|
|
5070
|
+
point,
|
|
5071
|
+
goalPoint,
|
|
5072
|
+
dirIsX,
|
|
5073
|
+
bounds);
|
|
5074
|
+
return dirIsX ? {
|
|
5075
|
+
y: point.y,
|
|
5076
|
+
x: obstacle[useMax ? 'xMax' : 'xMin'] + (useMax ? 1 : -1)
|
|
5077
|
+
} : {
|
|
5078
|
+
x: point.x,
|
|
5079
|
+
y: obstacle[useMax ? 'yMax' : 'yMin'] + (useMax ? 1 : -1)
|
|
5080
|
+
};
|
|
5081
|
+
}
|
|
5082
|
+
// Cut the obstacle array to soft bounds for optimization in large
|
|
5083
|
+
// datasets.
|
|
5084
|
+
chartObstacles =
|
|
5085
|
+
chartObstacles.slice(startObstacleIx, endObstacleIx + 1);
|
|
5086
|
+
// If an obstacle envelops the end point, move it out of there and add
|
|
5087
|
+
// a little segment to where it was.
|
|
5088
|
+
if ((endObstacleIx = findObstacleFromPoint(chartObstacles, end)) > -1) {
|
|
5089
|
+
extractedEndPoint = extractFromObstacle(chartObstacles[endObstacleIx], end, start);
|
|
5090
|
+
endSegments.push({
|
|
5091
|
+
end: end,
|
|
5092
|
+
start: extractedEndPoint
|
|
5093
|
+
});
|
|
5094
|
+
end = extractedEndPoint;
|
|
5095
|
+
}
|
|
5096
|
+
// If it's still inside one or more obstacles, get out of there by
|
|
5097
|
+
// force-moving towards the start point.
|
|
5098
|
+
while ((endObstacleIx = findObstacleFromPoint(chartObstacles, end)) > -1) {
|
|
5099
|
+
useMax = end[dir] - start[dir] < 0;
|
|
5100
|
+
extractedEndPoint = {
|
|
5101
|
+
x: end.x,
|
|
5102
|
+
y: end.y
|
|
5103
|
+
};
|
|
5104
|
+
extractedEndPoint[dir] = chartObstacles[endObstacleIx][useMax ? dir + 'Max' : dir + 'Min'] + (useMax ? 1 : -1);
|
|
5105
|
+
endSegments.push({
|
|
5106
|
+
end: end,
|
|
5107
|
+
start: extractedEndPoint
|
|
5108
|
+
});
|
|
5109
|
+
end = extractedEndPoint;
|
|
5110
|
+
}
|
|
5111
|
+
// Find the path
|
|
5112
|
+
segments = clearPathTo(start, end, dirIsX);
|
|
5113
|
+
// Add the end-point segments
|
|
5114
|
+
segments = segments.concat(endSegments.reverse());
|
|
5115
|
+
return {
|
|
5116
|
+
path: pathFromSegments(segments),
|
|
5117
|
+
obstacles: segments
|
|
5118
|
+
};
|
|
5119
|
+
}, {
|
|
5120
|
+
requiresObstacles: true
|
|
5121
|
+
});
|
|
5122
|
+
// Define the available pathfinding algorithms.
|
|
5123
|
+
// Algorithms take up to 3 arguments: starting point, ending point, and an
|
|
5124
|
+
// options object.
|
|
5125
|
+
var algorithms = {
|
|
5126
|
+
fastAvoid: fastAvoid,
|
|
5127
|
+
straight: straight,
|
|
5128
|
+
simpleConnect: simpleConnect
|
|
5129
|
+
};
|
|
5130
|
+
|
|
5131
|
+
return algorithms;
|
|
5132
|
+
});
|
|
5133
|
+
_registerModule(_modules, 'Gantt/Pathfinder.js', [_modules['Gantt/Connection.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Globals.js'], _modules['Core/Options.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js'], _modules['Gantt/PathfinderAlgorithms.js']], function (Connection, Chart, H, O, Point, U, pathfinderAlgorithms) {
|
|
5134
|
+
/* *
|
|
5135
|
+
*
|
|
5136
|
+
* (c) 2016 Highsoft AS
|
|
5137
|
+
* Authors: Øystein Moseng, Lars A. V. Cabrera
|
|
5138
|
+
*
|
|
5139
|
+
* License: www.highcharts.com/license
|
|
5140
|
+
*
|
|
5141
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5142
|
+
*
|
|
5143
|
+
* */
|
|
5144
|
+
/**
|
|
5145
|
+
* The default pathfinder algorithm to use for a chart. It is possible to define
|
|
5146
|
+
* your own algorithms by adding them to the
|
|
5147
|
+
* `Highcharts.Pathfinder.prototype.algorithms`
|
|
5148
|
+
* object before the chart has been created.
|
|
5149
|
+
*
|
|
5150
|
+
* The default algorithms are as follows:
|
|
5151
|
+
*
|
|
5152
|
+
* `straight`: Draws a straight line between the connecting
|
|
5153
|
+
* points. Does not avoid other points when drawing.
|
|
5154
|
+
*
|
|
5155
|
+
* `simpleConnect`: Finds a path between the points using right angles
|
|
5156
|
+
* only. Takes only starting/ending points into
|
|
5157
|
+
* account, and will not avoid other points.
|
|
5158
|
+
*
|
|
5159
|
+
* `fastAvoid`: Finds a path between the points using right angles
|
|
5160
|
+
* only. Will attempt to avoid other points, but its
|
|
5161
|
+
* focus is performance over accuracy. Works well with
|
|
5162
|
+
* less dense datasets.
|
|
5163
|
+
*
|
|
5164
|
+
* @typedef {"fastAvoid"|"simpleConnect"|"straight"|string} Highcharts.PathfinderTypeValue
|
|
5165
|
+
*/
|
|
5166
|
+
''; // detach doclets above
|
|
5167
|
+
var defaultOptions = O.defaultOptions;
|
|
5168
|
+
var addEvent = U.addEvent,
|
|
5169
|
+
defined = U.defined,
|
|
5170
|
+
error = U.error,
|
|
5171
|
+
extend = U.extend,
|
|
5172
|
+
merge = U.merge,
|
|
5173
|
+
objectEach = U.objectEach,
|
|
5174
|
+
pick = U.pick,
|
|
5175
|
+
splat = U.splat;
|
|
5176
|
+
var deg2rad = H.deg2rad,
|
|
5177
|
+
max = Math.max,
|
|
5178
|
+
min = Math.min;
|
|
5179
|
+
/*
|
|
5180
|
+
@todo:
|
|
5181
|
+
- Document how to write your own algorithms
|
|
5182
|
+
- Consider adding a Point.pathTo method that wraps creating a connection
|
|
5183
|
+
and rendering it
|
|
5184
|
+
*/
|
|
5185
|
+
// Set default Pathfinder options
|
|
5186
|
+
extend(defaultOptions, {
|
|
5187
|
+
/**
|
|
5188
|
+
* The Pathfinder module allows you to define connections between any two
|
|
5189
|
+
* points, represented as lines - optionally with markers for the start
|
|
5190
|
+
* and/or end points. Multiple algorithms are available for calculating how
|
|
5191
|
+
* the connecting lines are drawn.
|
|
5192
|
+
*
|
|
5193
|
+
* Connector functionality requires Highcharts Gantt to be loaded. In Gantt
|
|
5194
|
+
* charts, the connectors are used to draw dependencies between tasks.
|
|
5195
|
+
*
|
|
5196
|
+
* @see [dependency](series.gantt.data.dependency)
|
|
5197
|
+
*
|
|
5198
|
+
* @sample gantt/pathfinder/demo
|
|
5199
|
+
* Pathfinder connections
|
|
5200
|
+
*
|
|
5201
|
+
* @declare Highcharts.ConnectorsOptions
|
|
5202
|
+
* @product gantt
|
|
5203
|
+
* @optionparent connectors
|
|
5204
|
+
*/
|
|
5205
|
+
connectors: {
|
|
5206
|
+
/**
|
|
5207
|
+
* Enable connectors for this chart. Requires Highcharts Gantt.
|
|
5208
|
+
*
|
|
5209
|
+
* @type {boolean}
|
|
5210
|
+
* @default true
|
|
5211
|
+
* @since 6.2.0
|
|
5212
|
+
* @apioption connectors.enabled
|
|
5213
|
+
*/
|
|
5214
|
+
/**
|
|
5215
|
+
* Set the default dash style for this chart's connecting lines.
|
|
5216
|
+
*
|
|
5217
|
+
* @type {string}
|
|
5218
|
+
* @default solid
|
|
5219
|
+
* @since 6.2.0
|
|
5220
|
+
* @apioption connectors.dashStyle
|
|
5221
|
+
*/
|
|
5222
|
+
/**
|
|
5223
|
+
* Set the default color for this chart's Pathfinder connecting lines.
|
|
5224
|
+
* Defaults to the color of the point being connected.
|
|
5225
|
+
*
|
|
5226
|
+
* @type {Highcharts.ColorString}
|
|
5227
|
+
* @since 6.2.0
|
|
5228
|
+
* @apioption connectors.lineColor
|
|
5229
|
+
*/
|
|
5230
|
+
/**
|
|
5231
|
+
* Set the default pathfinder margin to use, in pixels. Some Pathfinder
|
|
5232
|
+
* algorithms attempt to avoid obstacles, such as other points in the
|
|
5233
|
+
* chart. These algorithms use this margin to determine how close lines
|
|
5234
|
+
* can be to an obstacle. The default is to compute this automatically
|
|
5235
|
+
* from the size of the obstacles in the chart.
|
|
5236
|
+
*
|
|
5237
|
+
* To draw connecting lines close to existing points, set this to a low
|
|
5238
|
+
* number. For more space around existing points, set this number
|
|
5239
|
+
* higher.
|
|
5240
|
+
*
|
|
5241
|
+
* @sample gantt/pathfinder/algorithm-margin
|
|
5242
|
+
* Small algorithmMargin
|
|
5243
|
+
*
|
|
5244
|
+
* @type {number}
|
|
5245
|
+
* @since 6.2.0
|
|
5246
|
+
* @apioption connectors.algorithmMargin
|
|
5247
|
+
*/
|
|
5248
|
+
/**
|
|
5249
|
+
* Set the default pathfinder algorithm to use for this chart. It is
|
|
5250
|
+
* possible to define your own algorithms by adding them to the
|
|
5251
|
+
* Highcharts.Pathfinder.prototype.algorithms object before the chart
|
|
5252
|
+
* has been created.
|
|
5253
|
+
*
|
|
5254
|
+
* The default algorithms are as follows:
|
|
5255
|
+
*
|
|
5256
|
+
* `straight`: Draws a straight line between the connecting
|
|
5257
|
+
* points. Does not avoid other points when drawing.
|
|
5258
|
+
*
|
|
5259
|
+
* `simpleConnect`: Finds a path between the points using right angles
|
|
5260
|
+
* only. Takes only starting/ending points into
|
|
5261
|
+
* account, and will not avoid other points.
|
|
5262
|
+
*
|
|
5263
|
+
* `fastAvoid`: Finds a path between the points using right angles
|
|
5264
|
+
* only. Will attempt to avoid other points, but its
|
|
5265
|
+
* focus is performance over accuracy. Works well with
|
|
5266
|
+
* less dense datasets.
|
|
5267
|
+
*
|
|
5268
|
+
* Default value: `straight` is used as default for most series types,
|
|
5269
|
+
* while `simpleConnect` is used as default for Gantt series, to show
|
|
5270
|
+
* dependencies between points.
|
|
5271
|
+
*
|
|
5272
|
+
* @sample gantt/pathfinder/demo
|
|
5273
|
+
* Different types used
|
|
5274
|
+
*
|
|
5275
|
+
* @type {Highcharts.PathfinderTypeValue}
|
|
5276
|
+
* @default undefined
|
|
5277
|
+
* @since 6.2.0
|
|
5278
|
+
*/
|
|
5279
|
+
type: 'straight',
|
|
5280
|
+
/**
|
|
5281
|
+
* Set the default pixel width for this chart's Pathfinder connecting
|
|
5282
|
+
* lines.
|
|
5283
|
+
*
|
|
5284
|
+
* @since 6.2.0
|
|
5285
|
+
*/
|
|
5286
|
+
lineWidth: 1,
|
|
5287
|
+
/**
|
|
5288
|
+
* Marker options for this chart's Pathfinder connectors. Note that
|
|
5289
|
+
* this option is overridden by the `startMarker` and `endMarker`
|
|
5290
|
+
* options.
|
|
5291
|
+
*
|
|
5292
|
+
* @declare Highcharts.ConnectorsMarkerOptions
|
|
5293
|
+
* @since 6.2.0
|
|
5294
|
+
*/
|
|
5295
|
+
marker: {
|
|
5296
|
+
/**
|
|
5297
|
+
* Set the radius of the connector markers. The default is
|
|
5298
|
+
* automatically computed based on the algorithmMargin setting.
|
|
5299
|
+
*
|
|
5300
|
+
* Setting marker.width and marker.height will override this
|
|
5301
|
+
* setting.
|
|
5302
|
+
*
|
|
5303
|
+
* @type {number}
|
|
5304
|
+
* @since 6.2.0
|
|
5305
|
+
* @apioption connectors.marker.radius
|
|
5306
|
+
*/
|
|
5307
|
+
/**
|
|
5308
|
+
* Set the width of the connector markers. If not supplied, this
|
|
5309
|
+
* is inferred from the marker radius.
|
|
5310
|
+
*
|
|
5311
|
+
* @type {number}
|
|
5312
|
+
* @since 6.2.0
|
|
5313
|
+
* @apioption connectors.marker.width
|
|
5314
|
+
*/
|
|
5315
|
+
/**
|
|
5316
|
+
* Set the height of the connector markers. If not supplied, this
|
|
5317
|
+
* is inferred from the marker radius.
|
|
5318
|
+
*
|
|
5319
|
+
* @type {number}
|
|
5320
|
+
* @since 6.2.0
|
|
5321
|
+
* @apioption connectors.marker.height
|
|
5322
|
+
*/
|
|
5323
|
+
/**
|
|
5324
|
+
* Set the color of the connector markers. By default this is the
|
|
5325
|
+
* same as the connector color.
|
|
5326
|
+
*
|
|
5327
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
5328
|
+
* @since 6.2.0
|
|
5329
|
+
* @apioption connectors.marker.color
|
|
5330
|
+
*/
|
|
5331
|
+
/**
|
|
5332
|
+
* Set the line/border color of the connector markers. By default
|
|
5333
|
+
* this is the same as the marker color.
|
|
5334
|
+
*
|
|
5335
|
+
* @type {Highcharts.ColorString}
|
|
5336
|
+
* @since 6.2.0
|
|
5337
|
+
* @apioption connectors.marker.lineColor
|
|
5338
|
+
*/
|
|
5339
|
+
/**
|
|
5340
|
+
* Enable markers for the connectors.
|
|
5341
|
+
*/
|
|
5342
|
+
enabled: false,
|
|
5343
|
+
/**
|
|
5344
|
+
* Horizontal alignment of the markers relative to the points.
|
|
5345
|
+
*
|
|
5346
|
+
* @type {Highcharts.AlignValue}
|
|
5347
|
+
*/
|
|
5348
|
+
align: 'center',
|
|
5349
|
+
/**
|
|
5350
|
+
* Vertical alignment of the markers relative to the points.
|
|
5351
|
+
*
|
|
5352
|
+
* @type {Highcharts.VerticalAlignValue}
|
|
5353
|
+
*/
|
|
5354
|
+
verticalAlign: 'middle',
|
|
5355
|
+
/**
|
|
5356
|
+
* Whether or not to draw the markers inside the points.
|
|
5357
|
+
*/
|
|
5358
|
+
inside: false,
|
|
5359
|
+
/**
|
|
5360
|
+
* Set the line/border width of the pathfinder markers.
|
|
5361
|
+
*/
|
|
5362
|
+
lineWidth: 1
|
|
5363
|
+
},
|
|
5364
|
+
/**
|
|
5365
|
+
* Marker options specific to the start markers for this chart's
|
|
5366
|
+
* Pathfinder connectors. Overrides the generic marker options.
|
|
5367
|
+
*
|
|
5368
|
+
* @declare Highcharts.ConnectorsStartMarkerOptions
|
|
5369
|
+
* @extends connectors.marker
|
|
5370
|
+
* @since 6.2.0
|
|
5371
|
+
*/
|
|
5372
|
+
startMarker: {
|
|
5373
|
+
/**
|
|
5374
|
+
* Set the symbol of the connector start markers.
|
|
5375
|
+
*/
|
|
5376
|
+
symbol: 'diamond'
|
|
5377
|
+
},
|
|
5378
|
+
/**
|
|
5379
|
+
* Marker options specific to the end markers for this chart's
|
|
5380
|
+
* Pathfinder connectors. Overrides the generic marker options.
|
|
5381
|
+
*
|
|
5382
|
+
* @declare Highcharts.ConnectorsEndMarkerOptions
|
|
5383
|
+
* @extends connectors.marker
|
|
5384
|
+
* @since 6.2.0
|
|
5385
|
+
*/
|
|
5386
|
+
endMarker: {
|
|
5387
|
+
/**
|
|
5388
|
+
* Set the symbol of the connector end markers.
|
|
5389
|
+
*/
|
|
5390
|
+
symbol: 'arrow-filled'
|
|
5391
|
+
}
|
|
5392
|
+
}
|
|
5393
|
+
});
|
|
5394
|
+
/**
|
|
5395
|
+
* Override Pathfinder connector options for a series. Requires Highcharts Gantt
|
|
5396
|
+
* to be loaded.
|
|
5397
|
+
*
|
|
5398
|
+
* @declare Highcharts.SeriesConnectorsOptionsObject
|
|
5399
|
+
* @extends connectors
|
|
5400
|
+
* @since 6.2.0
|
|
5401
|
+
* @excluding enabled, algorithmMargin
|
|
5402
|
+
* @product gantt
|
|
5403
|
+
* @apioption plotOptions.series.connectors
|
|
5404
|
+
*/
|
|
5405
|
+
/**
|
|
5406
|
+
* Connect to a point. This option can be either a string, referring to the ID
|
|
5407
|
+
* of another point, or an object, or an array of either. If the option is an
|
|
5408
|
+
* array, each element defines a connection.
|
|
5409
|
+
*
|
|
5410
|
+
* @sample gantt/pathfinder/demo
|
|
5411
|
+
* Different connection types
|
|
5412
|
+
*
|
|
5413
|
+
* @declare Highcharts.XrangePointConnectorsOptionsObject
|
|
5414
|
+
* @type {string|Array<string|*>|*}
|
|
5415
|
+
* @extends plotOptions.series.connectors
|
|
5416
|
+
* @since 6.2.0
|
|
5417
|
+
* @excluding enabled
|
|
5418
|
+
* @product gantt
|
|
5419
|
+
* @requires highcharts-gantt
|
|
5420
|
+
* @apioption series.xrange.data.connect
|
|
5421
|
+
*/
|
|
5422
|
+
/**
|
|
5423
|
+
* The ID of the point to connect to.
|
|
5424
|
+
*
|
|
5425
|
+
* @type {string}
|
|
5426
|
+
* @since 6.2.0
|
|
5427
|
+
* @product gantt
|
|
5428
|
+
* @apioption series.xrange.data.connect.to
|
|
5429
|
+
*/
|
|
5430
|
+
/**
|
|
5431
|
+
* Get point bounding box using plotX/plotY and shapeArgs. If using
|
|
5432
|
+
* graphic.getBBox() directly, the bbox will be affected by animation.
|
|
5433
|
+
*
|
|
5434
|
+
* @private
|
|
5435
|
+
* @function
|
|
5436
|
+
*
|
|
5437
|
+
* @param {Highcharts.Point} point
|
|
5438
|
+
* The point to get BB of.
|
|
5439
|
+
*
|
|
5440
|
+
* @return {Highcharts.Dictionary<number>|null}
|
|
5441
|
+
* Result xMax, xMin, yMax, yMin.
|
|
5442
|
+
*/
|
|
5443
|
+
function getPointBB(point) {
|
|
5444
|
+
var shapeArgs = point.shapeArgs,
|
|
5445
|
+
bb;
|
|
5446
|
+
// Prefer using shapeArgs (columns)
|
|
5447
|
+
if (shapeArgs) {
|
|
5448
|
+
return {
|
|
5449
|
+
xMin: shapeArgs.x,
|
|
5450
|
+
xMax: shapeArgs.x + shapeArgs.width,
|
|
5451
|
+
yMin: shapeArgs.y,
|
|
5452
|
+
yMax: shapeArgs.y + shapeArgs.height
|
|
5453
|
+
};
|
|
5454
|
+
}
|
|
5455
|
+
// Otherwise use plotX/plotY and bb
|
|
5456
|
+
bb = point.graphic && point.graphic.getBBox();
|
|
5457
|
+
return bb ? {
|
|
5458
|
+
xMin: point.plotX - bb.width / 2,
|
|
5459
|
+
xMax: point.plotX + bb.width / 2,
|
|
5460
|
+
yMin: point.plotY - bb.height / 2,
|
|
5461
|
+
yMax: point.plotY + bb.height / 2
|
|
5462
|
+
} : null;
|
|
5463
|
+
}
|
|
5464
|
+
/**
|
|
5465
|
+
* Calculate margin to place around obstacles for the pathfinder in pixels.
|
|
5466
|
+
* Returns a minimum of 1 pixel margin.
|
|
5467
|
+
*
|
|
5468
|
+
* @private
|
|
5469
|
+
* @function
|
|
5470
|
+
*
|
|
5471
|
+
* @param {Array<object>} obstacles
|
|
5472
|
+
* Obstacles to calculate margin from.
|
|
5473
|
+
*
|
|
5474
|
+
* @return {number}
|
|
5475
|
+
* The calculated margin in pixels. At least 1.
|
|
5476
|
+
*/
|
|
5477
|
+
function calculateObstacleMargin(obstacles) {
|
|
5478
|
+
var len = obstacles.length,
|
|
5479
|
+
i = 0,
|
|
5480
|
+
j,
|
|
5481
|
+
obstacleDistance,
|
|
5482
|
+
distances = [],
|
|
5483
|
+
// Compute smallest distance between two rectangles
|
|
5484
|
+
distance = function (a,
|
|
5485
|
+
b,
|
|
5486
|
+
bbMargin) {
|
|
5487
|
+
// Count the distance even if we are slightly off
|
|
5488
|
+
var margin = pick(bbMargin, 10),
|
|
5489
|
+
yOverlap = a.yMax + margin > b.yMin - margin &&
|
|
5490
|
+
a.yMin - margin < b.yMax + margin,
|
|
5491
|
+
xOverlap = a.xMax + margin > b.xMin - margin &&
|
|
5492
|
+
a.xMin - margin < b.xMax + margin,
|
|
5493
|
+
xDistance = yOverlap ? (a.xMin > b.xMax ? a.xMin - b.xMax : b.xMin - a.xMax) : Infinity,
|
|
5494
|
+
yDistance = xOverlap ? (a.yMin > b.yMax ? a.yMin - b.yMax : b.yMin - a.yMax) : Infinity;
|
|
5495
|
+
// If the rectangles collide, try recomputing with smaller margin.
|
|
5496
|
+
// If they collide anyway, discard the obstacle.
|
|
5497
|
+
if (xOverlap && yOverlap) {
|
|
5498
|
+
return (margin ?
|
|
5499
|
+
distance(a, b, Math.floor(margin / 2)) :
|
|
5500
|
+
Infinity);
|
|
5501
|
+
}
|
|
5502
|
+
return min(xDistance, yDistance);
|
|
5503
|
+
};
|
|
5504
|
+
// Go over all obstacles and compare them to the others.
|
|
5505
|
+
for (; i < len; ++i) {
|
|
5506
|
+
// Compare to all obstacles ahead. We will already have compared this
|
|
5507
|
+
// obstacle to the ones before.
|
|
5508
|
+
for (j = i + 1; j < len; ++j) {
|
|
5509
|
+
obstacleDistance = distance(obstacles[i], obstacles[j]);
|
|
5510
|
+
// TODO: Magic number 80
|
|
5511
|
+
if (obstacleDistance < 80) { // Ignore large distances
|
|
5512
|
+
distances.push(obstacleDistance);
|
|
4727
5513
|
}
|
|
4728
5514
|
}
|
|
4729
|
-
attribs['class'] = // eslint-disable-line dot-notation
|
|
4730
|
-
'highcharts-point-connecting-path ' +
|
|
4731
|
-
'highcharts-color-' + fromPoint.colorIndex;
|
|
4732
|
-
options = merge(attribs, options);
|
|
4733
|
-
// Set common marker options
|
|
4734
|
-
if (!defined(options.marker.radius)) {
|
|
4735
|
-
options.marker.radius = min(max(Math.ceil((options.algorithmMargin || 8) / 2) - 1, 1), 5);
|
|
4736
|
-
}
|
|
4737
|
-
// Get the path
|
|
4738
|
-
pathResult = connection.getPath(options);
|
|
4739
|
-
path = pathResult.path;
|
|
4740
|
-
// Always update obstacle storage with obstacles from this path.
|
|
4741
|
-
// We don't know if future calls will need this for their algorithm.
|
|
4742
|
-
if (pathResult.obstacles) {
|
|
4743
|
-
pathfinder.lineObstacles =
|
|
4744
|
-
pathfinder.lineObstacles || [];
|
|
4745
|
-
pathfinder.lineObstacles =
|
|
4746
|
-
pathfinder.lineObstacles.concat(pathResult.obstacles);
|
|
4747
|
-
}
|
|
4748
|
-
// Add the calculated path to the pathfinder group
|
|
4749
|
-
connection.renderPath(path, attribs, series.options.animation);
|
|
4750
|
-
// Render the markers
|
|
4751
|
-
connection.addMarker('start', merge(options.marker, options.startMarker), path);
|
|
4752
|
-
connection.addMarker('end', merge(options.marker, options.endMarker), path);
|
|
4753
|
-
},
|
|
4754
|
-
/**
|
|
4755
|
-
* Destroy connection by destroying the added graphics elements.
|
|
4756
|
-
*
|
|
4757
|
-
* @function Highcharts.Connection#destroy
|
|
4758
|
-
*/
|
|
4759
|
-
destroy: function () {
|
|
4760
|
-
if (this.graphics) {
|
|
4761
|
-
objectEach(this.graphics, function (val) {
|
|
4762
|
-
val.destroy();
|
|
4763
|
-
});
|
|
4764
|
-
delete this.graphics;
|
|
4765
|
-
}
|
|
4766
5515
|
}
|
|
4767
|
-
|
|
5516
|
+
// Ensure we always have at least one value, even in very spaceous charts
|
|
5517
|
+
distances.push(80);
|
|
5518
|
+
return max(Math.floor(distances.sort(function (a, b) {
|
|
5519
|
+
return (a - b);
|
|
5520
|
+
})[
|
|
5521
|
+
// Discard first 10% of the relevant distances, and then grab
|
|
5522
|
+
// the smallest one.
|
|
5523
|
+
Math.floor(distances.length / 10)] / 2 - 1 // Divide the distance by 2 and subtract 1.
|
|
5524
|
+
), 1 // 1 is the minimum margin
|
|
5525
|
+
);
|
|
5526
|
+
}
|
|
5527
|
+
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
4768
5528
|
/**
|
|
4769
5529
|
* The Pathfinder class.
|
|
4770
5530
|
*
|
|
@@ -4775,15 +5535,25 @@
|
|
|
4775
5535
|
* @param {Highcharts.Chart} chart
|
|
4776
5536
|
* The chart to operate on.
|
|
4777
5537
|
*/
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
5538
|
+
var Pathfinder = /** @class */ (function () {
|
|
5539
|
+
function Pathfinder(chart) {
|
|
5540
|
+
/* *
|
|
5541
|
+
*
|
|
5542
|
+
* Properties
|
|
5543
|
+
*
|
|
5544
|
+
* */
|
|
5545
|
+
this.chart = void 0;
|
|
5546
|
+
this.chartObstacles = void 0;
|
|
5547
|
+
this.chartObstacleMetrics = void 0;
|
|
5548
|
+
this.connections = void 0;
|
|
5549
|
+
this.group = void 0;
|
|
5550
|
+
this.lineObstacles = void 0;
|
|
5551
|
+
this.init(chart);
|
|
5552
|
+
}
|
|
4782
5553
|
/**
|
|
4783
5554
|
* @name Highcharts.Pathfinder#algorithms
|
|
4784
5555
|
* @type {Highcharts.Dictionary<Function>}
|
|
4785
5556
|
*/
|
|
4786
|
-
algorithms: pathfinderAlgorithms,
|
|
4787
5557
|
/**
|
|
4788
5558
|
* Initialize the Pathfinder object.
|
|
4789
5559
|
*
|
|
@@ -4792,7 +5562,7 @@
|
|
|
4792
5562
|
* @param {Highcharts.Chart} chart
|
|
4793
5563
|
* The chart context.
|
|
4794
5564
|
*/
|
|
4795
|
-
init
|
|
5565
|
+
Pathfinder.prototype.init = function (chart) {
|
|
4796
5566
|
// Initialize pathfinder with chart context
|
|
4797
5567
|
this.chart = chart;
|
|
4798
5568
|
// Init connection reference list
|
|
@@ -4801,7 +5571,7 @@
|
|
|
4801
5571
|
addEvent(chart, 'redraw', function () {
|
|
4802
5572
|
this.pathfinder.update();
|
|
4803
5573
|
});
|
|
4804
|
-
}
|
|
5574
|
+
};
|
|
4805
5575
|
/**
|
|
4806
5576
|
* Update Pathfinder connections from scratch.
|
|
4807
5577
|
*
|
|
@@ -4811,7 +5581,7 @@
|
|
|
4811
5581
|
* Whether or not to defer rendering of connections until
|
|
4812
5582
|
* series.afterAnimate event has fired. Used on first render.
|
|
4813
5583
|
*/
|
|
4814
|
-
update
|
|
5584
|
+
Pathfinder.prototype.update = function (deferRender) {
|
|
4815
5585
|
var chart = this.chart,
|
|
4816
5586
|
pathfinder = this,
|
|
4817
5587
|
oldConnections = pathfinder.connections;
|
|
@@ -4820,6 +5590,12 @@
|
|
|
4820
5590
|
chart.series.forEach(function (series) {
|
|
4821
5591
|
if (series.visible && !series.options.isInternal) {
|
|
4822
5592
|
series.points.forEach(function (point) {
|
|
5593
|
+
var ganttPointOptions = point.options;
|
|
5594
|
+
// For Gantt series the connect could be
|
|
5595
|
+
// defined as a dependency
|
|
5596
|
+
if (ganttPointOptions && ganttPointOptions.dependency) {
|
|
5597
|
+
ganttPointOptions.connect = ganttPointOptions.dependency;
|
|
5598
|
+
}
|
|
4823
5599
|
var to,
|
|
4824
5600
|
connects = (point.options &&
|
|
4825
5601
|
point.options.connect &&
|
|
@@ -4869,7 +5645,7 @@
|
|
|
4869
5645
|
delete this.lineObstacles;
|
|
4870
5646
|
// Draw the pending connections
|
|
4871
5647
|
pathfinder.renderConnections(deferRender);
|
|
4872
|
-
}
|
|
5648
|
+
};
|
|
4873
5649
|
/**
|
|
4874
5650
|
* Draw the chart's connecting paths.
|
|
4875
5651
|
*
|
|
@@ -4879,7 +5655,7 @@
|
|
|
4879
5655
|
* Whether or not to defer render until series animation is finished.
|
|
4880
5656
|
* Used on first render.
|
|
4881
5657
|
*/
|
|
4882
|
-
renderConnections
|
|
5658
|
+
Pathfinder.prototype.renderConnections = function (deferRender) {
|
|
4883
5659
|
if (deferRender) {
|
|
4884
5660
|
// Render after series are done animating
|
|
4885
5661
|
this.chart.series.forEach(function (series) {
|
|
@@ -4913,7 +5689,7 @@
|
|
|
4913
5689
|
connection.render();
|
|
4914
5690
|
});
|
|
4915
5691
|
}
|
|
4916
|
-
}
|
|
5692
|
+
};
|
|
4917
5693
|
/**
|
|
4918
5694
|
* Get obstacles for the points in the chart. Does not include connecting
|
|
4919
5695
|
* lines from Pathfinder. Applies algorithmMargin to the obstacles.
|
|
@@ -4928,7 +5704,7 @@
|
|
|
4928
5704
|
* An array of calculated obstacles. Each obstacle is defined as an
|
|
4929
5705
|
* object with xMin, xMax, yMin and yMax properties.
|
|
4930
5706
|
*/
|
|
4931
|
-
getChartObstacles
|
|
5707
|
+
Pathfinder.prototype.getChartObstacles = function (options) {
|
|
4932
5708
|
var obstacles = [],
|
|
4933
5709
|
series = this.chart.series,
|
|
4934
5710
|
margin = pick(options.algorithmMargin, 0),
|
|
@@ -4968,7 +5744,7 @@
|
|
|
4968
5744
|
});
|
|
4969
5745
|
}
|
|
4970
5746
|
return obstacles;
|
|
4971
|
-
}
|
|
5747
|
+
};
|
|
4972
5748
|
/**
|
|
4973
5749
|
* Utility function to get metrics for obstacles:
|
|
4974
5750
|
* - Widest obstacle width
|
|
@@ -4983,7 +5759,7 @@
|
|
|
4983
5759
|
* The calculated metrics, as an object with maxHeight and maxWidth
|
|
4984
5760
|
* properties.
|
|
4985
5761
|
*/
|
|
4986
|
-
getObstacleMetrics
|
|
5762
|
+
Pathfinder.prototype.getObstacleMetrics = function (obstacles) {
|
|
4987
5763
|
var maxWidth = 0,
|
|
4988
5764
|
maxHeight = 0,
|
|
4989
5765
|
width,
|
|
@@ -5003,7 +5779,7 @@
|
|
|
5003
5779
|
maxHeight: maxHeight,
|
|
5004
5780
|
maxWidth: maxWidth
|
|
5005
5781
|
};
|
|
5006
|
-
}
|
|
5782
|
+
};
|
|
5007
5783
|
/**
|
|
5008
5784
|
* Utility to get which direction to start the pathfinding algorithm
|
|
5009
5785
|
* (X vs Y), calculated from a set of marker options.
|
|
@@ -5016,17 +5792,18 @@
|
|
|
5016
5792
|
* @return {boolean}
|
|
5017
5793
|
* Returns true for X, false for Y, and undefined for autocalculate.
|
|
5018
5794
|
*/
|
|
5019
|
-
getAlgorithmStartDirection
|
|
5795
|
+
Pathfinder.prototype.getAlgorithmStartDirection = function (markerOptions) {
|
|
5020
5796
|
var xCenter = markerOptions.align !== 'left' &&
|
|
5021
5797
|
markerOptions.align !== 'right', yCenter = markerOptions.verticalAlign !== 'top' &&
|
|
5022
5798
|
markerOptions.verticalAlign !== 'bottom', undef;
|
|
5023
5799
|
return xCenter ?
|
|
5024
5800
|
(yCenter ? undef : false) : // x is centered
|
|
5025
5801
|
(yCenter ? true : undef); // x is off-center
|
|
5026
|
-
}
|
|
5027
|
-
|
|
5802
|
+
};
|
|
5803
|
+
return Pathfinder;
|
|
5804
|
+
}());
|
|
5805
|
+
Pathfinder.prototype.algorithms = pathfinderAlgorithms;
|
|
5028
5806
|
// Add to Highcharts namespace
|
|
5029
|
-
H.Connection = Connection;
|
|
5030
5807
|
H.Pathfinder = Pathfinder;
|
|
5031
5808
|
// Add pathfinding capabilities to Points
|
|
5032
5809
|
extend(Point.prototype, /** @lends Point.prototype */ {
|
|
@@ -5201,7 +5978,7 @@
|
|
|
5201
5978
|
}
|
|
5202
5979
|
}
|
|
5203
5980
|
// Initialize Pathfinder for charts
|
|
5204
|
-
|
|
5981
|
+
Chart.prototype.callbacks.push(function (chart) {
|
|
5205
5982
|
var options = chart.options;
|
|
5206
5983
|
if (options.connectors.enabled !== false) {
|
|
5207
5984
|
warnLegacy(chart);
|
|
@@ -5210,8 +5987,9 @@
|
|
|
5210
5987
|
}
|
|
5211
5988
|
});
|
|
5212
5989
|
|
|
5990
|
+
return Pathfinder;
|
|
5213
5991
|
});
|
|
5214
|
-
_registerModule(_modules, '
|
|
5992
|
+
_registerModule(_modules, 'Series/XRangeSeries.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Series/Series.js'], _modules['Core/Globals.js'], _modules['Core/Color/Color.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js']], function (Axis, BaseSeries, H, Color, Point, U) {
|
|
5215
5993
|
/* *
|
|
5216
5994
|
*
|
|
5217
5995
|
* X-range series module
|
|
@@ -5223,14 +6001,6 @@
|
|
|
5223
6001
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5224
6002
|
*
|
|
5225
6003
|
* */
|
|
5226
|
-
/* *
|
|
5227
|
-
* @interface Highcharts.PointOptionsObject in parts/Point.ts
|
|
5228
|
-
*/ /**
|
|
5229
|
-
* The ending X value of the range point.
|
|
5230
|
-
* @name Highcharts.PointOptionsObject#x2
|
|
5231
|
-
* @type {number|undefined}
|
|
5232
|
-
* @requires modules/xrange
|
|
5233
|
-
*/
|
|
5234
6004
|
var color = Color.parse;
|
|
5235
6005
|
var addEvent = U.addEvent,
|
|
5236
6006
|
clamp = U.clamp,
|
|
@@ -5240,12 +6010,18 @@
|
|
|
5240
6010
|
isNumber = U.isNumber,
|
|
5241
6011
|
isObject = U.isObject,
|
|
5242
6012
|
merge = U.merge,
|
|
5243
|
-
pick = U.pick
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
6013
|
+
pick = U.pick;
|
|
6014
|
+
/* *
|
|
6015
|
+
* @interface Highcharts.PointOptionsObject in parts/Point.ts
|
|
6016
|
+
*/ /**
|
|
6017
|
+
* The ending X value of the range point.
|
|
6018
|
+
* @name Highcharts.PointOptionsObject#x2
|
|
6019
|
+
* @type {number|undefined}
|
|
6020
|
+
* @requires modules/xrange
|
|
6021
|
+
*/
|
|
6022
|
+
var Series = H.Series,
|
|
6023
|
+
seriesTypes = BaseSeries.seriesTypes,
|
|
6024
|
+
columnType = seriesTypes.column;
|
|
5249
6025
|
/**
|
|
5250
6026
|
* Return color of a point based on its category.
|
|
5251
6027
|
*
|
|
@@ -5280,7 +6056,7 @@
|
|
|
5280
6056
|
*
|
|
5281
6057
|
* @augments Highcharts.Series
|
|
5282
6058
|
*/
|
|
5283
|
-
seriesType('xrange', 'column'
|
|
6059
|
+
BaseSeries.seriesType('xrange', 'column'
|
|
5284
6060
|
/**
|
|
5285
6061
|
* The X-range series displays ranges on the X axis, typically time
|
|
5286
6062
|
* intervals with a start and end date.
|
|
@@ -5299,7 +6075,7 @@
|
|
|
5299
6075
|
* edgeWidth, findNearestPointBy, getExtremesFromAll,
|
|
5300
6076
|
* negativeColor, pointInterval, pointIntervalUnit,
|
|
5301
6077
|
* pointPlacement, pointRange, pointStart, softThreshold,
|
|
5302
|
-
* stacking, threshold, data, dataSorting
|
|
6078
|
+
* stacking, threshold, data, dataSorting, boostBlending
|
|
5303
6079
|
* @requires modules/xrange
|
|
5304
6080
|
* @optionparent plotOptions.xrange
|
|
5305
6081
|
*/
|
|
@@ -5679,7 +6455,7 @@
|
|
|
5679
6455
|
pfOptions = {};
|
|
5680
6456
|
}
|
|
5681
6457
|
if (isObject(seriesOpts.partialFill)) {
|
|
5682
|
-
pfOptions = merge(
|
|
6458
|
+
pfOptions = merge(seriesOpts.partialFill, pfOptions);
|
|
5683
6459
|
}
|
|
5684
6460
|
fill = (pfOptions.fill ||
|
|
5685
6461
|
color(pointAttr.fill).brighten(-0.3).get() ||
|
|
@@ -5856,7 +6632,8 @@
|
|
|
5856
6632
|
* @excluding boostThreshold, crisp, cropThreshold, depth, edgeColor, edgeWidth,
|
|
5857
6633
|
* findNearestPointBy, getExtremesFromAll, negativeColor,
|
|
5858
6634
|
* pointInterval, pointIntervalUnit, pointPlacement, pointRange,
|
|
5859
|
-
* pointStart, softThreshold, stacking, threshold, dataSorting
|
|
6635
|
+
* pointStart, softThreshold, stacking, threshold, dataSorting,
|
|
6636
|
+
* boostBlending
|
|
5860
6637
|
* @product highcharts highstock gantt
|
|
5861
6638
|
* @requires modules/xrange
|
|
5862
6639
|
* @apioption series.xrange
|
|
@@ -5953,7 +6730,7 @@
|
|
|
5953
6730
|
''; // adds doclets above to transpiled file
|
|
5954
6731
|
|
|
5955
6732
|
});
|
|
5956
|
-
_registerModule(_modules, '
|
|
6733
|
+
_registerModule(_modules, 'Series/GanttSeries.js', [_modules['Core/Series/Series.js'], _modules['Core/Globals.js'], _modules['Core/Options.js'], _modules['Core/Utilities.js']], function (BaseSeries, H, O, U) {
|
|
5957
6734
|
/* *
|
|
5958
6735
|
*
|
|
5959
6736
|
* (c) 2016-2020 Highsoft AS
|
|
@@ -5965,14 +6742,13 @@
|
|
|
5965
6742
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
5966
6743
|
*
|
|
5967
6744
|
* */
|
|
6745
|
+
var dateFormat = O.dateFormat;
|
|
5968
6746
|
var isNumber = U.isNumber,
|
|
5969
6747
|
merge = U.merge,
|
|
5970
6748
|
pick = U.pick,
|
|
5971
|
-
seriesType = U.seriesType,
|
|
5972
6749
|
splat = U.splat;
|
|
5973
|
-
var
|
|
5974
|
-
seriesTypes =
|
|
5975
|
-
Series = H.Series,
|
|
6750
|
+
var Series = H.Series,
|
|
6751
|
+
seriesTypes = BaseSeries.seriesTypes,
|
|
5976
6752
|
parent = seriesTypes.xrange;
|
|
5977
6753
|
/**
|
|
5978
6754
|
* @private
|
|
@@ -5981,7 +6757,7 @@
|
|
|
5981
6757
|
*
|
|
5982
6758
|
* @augments Highcharts.Series
|
|
5983
6759
|
*/
|
|
5984
|
-
seriesType('gantt', 'xrange'
|
|
6760
|
+
BaseSeries.seriesType('gantt', 'xrange'
|
|
5985
6761
|
/**
|
|
5986
6762
|
* A `gantt` series. If the [type](#series.gantt.type) option is not specified,
|
|
5987
6763
|
* it is inherited from [chart.type](#chart.type).
|
|
@@ -6019,8 +6795,8 @@
|
|
|
6019
6795
|
if (!format) {
|
|
6020
6796
|
format = splat(tooltip.getDateFormat(xAxis.closestPointRange, point.start, startOfWeek, formats))[0];
|
|
6021
6797
|
}
|
|
6022
|
-
start = dateFormat(format, point.start);
|
|
6023
|
-
end = dateFormat(format, point.end);
|
|
6798
|
+
start = series.chart.time.dateFormat(format, point.start);
|
|
6799
|
+
end = series.chart.time.dateFormat(format, point.end);
|
|
6024
6800
|
retVal += '<br/>';
|
|
6025
6801
|
if (!milestone) {
|
|
6026
6802
|
retVal += 'Start: ' + start + '<br/>';
|
|
@@ -6151,7 +6927,6 @@
|
|
|
6151
6927
|
addIfExists('x', pick(options.start, options.x));
|
|
6152
6928
|
addIfExists('x2', pick(options.end, options.x2));
|
|
6153
6929
|
addIfExists('partialFill', pick(options.completed, options.partialFill));
|
|
6154
|
-
addIfExists('connect', pick(options.dependency, options.connect));
|
|
6155
6930
|
}
|
|
6156
6931
|
/* eslint-enable valid-jsdoc */
|
|
6157
6932
|
}, merge(parent.prototype.pointClass.prototype, {
|
|
@@ -6175,11 +6950,11 @@
|
|
|
6175
6950
|
*/
|
|
6176
6951
|
applyOptions: function (options, x) {
|
|
6177
6952
|
var point = this,
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
return
|
|
6953
|
+
ganttPoint;
|
|
6954
|
+
ganttPoint = parent.prototype.pointClass.prototype.applyOptions
|
|
6955
|
+
.call(point, options, x);
|
|
6956
|
+
H.seriesTypes.gantt.prototype.setGanttPointAliases(ganttPoint);
|
|
6957
|
+
return ganttPoint;
|
|
6183
6958
|
},
|
|
6184
6959
|
isValid: function () {
|
|
6185
6960
|
return ((typeof this.start === 'number' ||
|
|
@@ -6207,7 +6982,7 @@
|
|
|
6207
6982
|
* @declare Highcharts.GanttPointOptionsObject
|
|
6208
6983
|
* @type {Array<*>}
|
|
6209
6984
|
* @extends series.xrange.data
|
|
6210
|
-
* @excluding className, color, colorIndex, connect, dataLabels, events,
|
|
6985
|
+
* @excluding className, color, colorIndex, connect, dataLabels, events,
|
|
6211
6986
|
* partialFill, selected, x, x2
|
|
6212
6987
|
* @product gantt
|
|
6213
6988
|
* @apioption series.gantt.data
|
|
@@ -6327,7 +7102,7 @@
|
|
|
6327
7102
|
''; // adds doclets above to the transpiled file
|
|
6328
7103
|
|
|
6329
7104
|
});
|
|
6330
|
-
_registerModule(_modules, '
|
|
7105
|
+
_registerModule(_modules, 'Core/Chart/GanttChart.js', [_modules['Core/Chart/Chart.js'], _modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (Chart, H, U) {
|
|
6331
7106
|
/* *
|
|
6332
7107
|
*
|
|
6333
7108
|
* (c) 2016-2020 Highsoft AS
|
|
@@ -6339,10 +7114,10 @@
|
|
|
6339
7114
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
6340
7115
|
*
|
|
6341
7116
|
* */
|
|
6342
|
-
var
|
|
7117
|
+
var getOptions = U.getOptions,
|
|
7118
|
+
isArray = U.isArray,
|
|
6343
7119
|
merge = U.merge,
|
|
6344
7120
|
splat = U.splat;
|
|
6345
|
-
var Chart = H.Chart;
|
|
6346
7121
|
/**
|
|
6347
7122
|
* Factory function for Gantt charts.
|
|
6348
7123
|
*
|
|
@@ -6377,7 +7152,7 @@
|
|
|
6377
7152
|
H.ganttChart = function (renderTo, options, callback) {
|
|
6378
7153
|
var hasRenderToArg = typeof renderTo === 'string' || renderTo.nodeName,
|
|
6379
7154
|
seriesOptions = options.series,
|
|
6380
|
-
defaultOptions =
|
|
7155
|
+
defaultOptions = getOptions(),
|
|
6381
7156
|
defaultLinkedTo,
|
|
6382
7157
|
userOptions = options;
|
|
6383
7158
|
options = arguments[hasRenderToArg ? 1 : 0];
|
|
@@ -6427,6 +7202,13 @@
|
|
|
6427
7202
|
},
|
|
6428
7203
|
legend: {
|
|
6429
7204
|
enabled: false
|
|
7205
|
+
},
|
|
7206
|
+
navigator: {
|
|
7207
|
+
series: { type: 'gantt' },
|
|
7208
|
+
// Bars were clipped, #14060.
|
|
7209
|
+
yAxis: {
|
|
7210
|
+
type: 'category'
|
|
7211
|
+
}
|
|
6430
7212
|
}
|
|
6431
7213
|
}, options, // user's options
|
|
6432
7214
|
// forced options
|
|
@@ -6434,18 +7216,13 @@
|
|
|
6434
7216
|
isGantt: true
|
|
6435
7217
|
});
|
|
6436
7218
|
options.series = userOptions.series = seriesOptions;
|
|
6437
|
-
options.series.forEach(function (series) {
|
|
6438
|
-
series.data.forEach(function (point) {
|
|
6439
|
-
H.seriesTypes.gantt.prototype.setGanttPointAliases(point);
|
|
6440
|
-
});
|
|
6441
|
-
});
|
|
6442
7219
|
return hasRenderToArg ?
|
|
6443
7220
|
new Chart(renderTo, options, callback) :
|
|
6444
7221
|
new Chart(options, options); // @todo does not look correct
|
|
6445
7222
|
};
|
|
6446
7223
|
|
|
6447
7224
|
});
|
|
6448
|
-
_registerModule(_modules, '
|
|
7225
|
+
_registerModule(_modules, 'Core/Axis/ScrollbarAxis.js', [_modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (H, U) {
|
|
6449
7226
|
/* *
|
|
6450
7227
|
*
|
|
6451
7228
|
* (c) 2010-2020 Torstein Honsi
|
|
@@ -6630,7 +7407,7 @@
|
|
|
6630
7407
|
|
|
6631
7408
|
return ScrollbarAxis;
|
|
6632
7409
|
});
|
|
6633
|
-
_registerModule(_modules, '
|
|
7410
|
+
_registerModule(_modules, 'Core/Scrollbar.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Globals.js'], _modules['Core/Axis/ScrollbarAxis.js'], _modules['Core/Utilities.js'], _modules['Core/Options.js']], function (Axis, H, ScrollbarAxis, U, O) {
|
|
6634
7411
|
/* *
|
|
6635
7412
|
*
|
|
6636
7413
|
* (c) 2010-2020 Torstein Honsi
|
|
@@ -6648,8 +7425,8 @@
|
|
|
6648
7425
|
merge = U.merge,
|
|
6649
7426
|
pick = U.pick,
|
|
6650
7427
|
removeEvent = U.removeEvent;
|
|
6651
|
-
var defaultOptions =
|
|
6652
|
-
|
|
7428
|
+
var defaultOptions = O.defaultOptions;
|
|
7429
|
+
var hasTouch = H.hasTouch,
|
|
6653
7430
|
isTouchDevice = H.isTouchDevice;
|
|
6654
7431
|
/**
|
|
6655
7432
|
* When we have vertical scrollbar, rifles and arrow in buttons should be
|
|
@@ -7494,7 +8271,7 @@
|
|
|
7494
8271
|
|
|
7495
8272
|
return H.Scrollbar;
|
|
7496
8273
|
});
|
|
7497
|
-
_registerModule(_modules, '
|
|
8274
|
+
_registerModule(_modules, 'Extensions/RangeSelector.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Globals.js'], _modules['Core/Options.js'], _modules['Core/Renderer/SVG/SVGElement.js'], _modules['Core/Utilities.js']], function (Axis, Chart, H, O, SVGElement, U) {
|
|
7498
8275
|
/* *
|
|
7499
8276
|
*
|
|
7500
8277
|
* (c) 2010-2020 Torstein Honsi
|
|
@@ -7504,6 +8281,21 @@
|
|
|
7504
8281
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
7505
8282
|
*
|
|
7506
8283
|
* */
|
|
8284
|
+
var defaultOptions = O.defaultOptions;
|
|
8285
|
+
var addEvent = U.addEvent,
|
|
8286
|
+
createElement = U.createElement,
|
|
8287
|
+
css = U.css,
|
|
8288
|
+
defined = U.defined,
|
|
8289
|
+
destroyObjectProperties = U.destroyObjectProperties,
|
|
8290
|
+
discardElement = U.discardElement,
|
|
8291
|
+
extend = U.extend,
|
|
8292
|
+
fireEvent = U.fireEvent,
|
|
8293
|
+
isNumber = U.isNumber,
|
|
8294
|
+
merge = U.merge,
|
|
8295
|
+
objectEach = U.objectEach,
|
|
8296
|
+
pick = U.pick,
|
|
8297
|
+
pInt = U.pInt,
|
|
8298
|
+
splat = U.splat;
|
|
7507
8299
|
/**
|
|
7508
8300
|
* Define the time span for the button
|
|
7509
8301
|
*
|
|
@@ -7532,23 +8324,6 @@
|
|
|
7532
8324
|
* @return {number}
|
|
7533
8325
|
* Parsed JavaScript time value.
|
|
7534
8326
|
*/
|
|
7535
|
-
var addEvent = U.addEvent,
|
|
7536
|
-
createElement = U.createElement,
|
|
7537
|
-
css = U.css,
|
|
7538
|
-
defined = U.defined,
|
|
7539
|
-
destroyObjectProperties = U.destroyObjectProperties,
|
|
7540
|
-
discardElement = U.discardElement,
|
|
7541
|
-
extend = U.extend,
|
|
7542
|
-
fireEvent = U.fireEvent,
|
|
7543
|
-
isNumber = U.isNumber,
|
|
7544
|
-
merge = U.merge,
|
|
7545
|
-
objectEach = U.objectEach,
|
|
7546
|
-
pick = U.pick,
|
|
7547
|
-
pInt = U.pInt,
|
|
7548
|
-
splat = U.splat;
|
|
7549
|
-
var Axis = H.Axis,
|
|
7550
|
-
Chart = H.Chart,
|
|
7551
|
-
defaultOptions = H.defaultOptions;
|
|
7552
8327
|
/* ************************************************************************** *
|
|
7553
8328
|
* Start Range Selector code *
|
|
7554
8329
|
* ************************************************************************** */
|
|
@@ -7855,6 +8630,8 @@
|
|
|
7855
8630
|
/**
|
|
7856
8631
|
* A custom callback function to parse values entered in the input boxes
|
|
7857
8632
|
* and return a valid JavaScript time as milliseconds since 1970.
|
|
8633
|
+
* The first argument passed is a value to parse,
|
|
8634
|
+
* second is a boolean indicating use of the UTC time.
|
|
7858
8635
|
*
|
|
7859
8636
|
* @sample {highstock} stock/rangeselector/input-format/
|
|
7860
8637
|
* Milliseconds in the range selector
|
|
@@ -8029,11 +8806,20 @@
|
|
|
8029
8806
|
* @name Highcharts.RangeSelector
|
|
8030
8807
|
* @param {Highcharts.Chart} chart
|
|
8031
8808
|
*/
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8809
|
+
var RangeSelector = /** @class */ (function () {
|
|
8810
|
+
function RangeSelector(chart) {
|
|
8811
|
+
/* *
|
|
8812
|
+
*
|
|
8813
|
+
* Properties
|
|
8814
|
+
*
|
|
8815
|
+
* */
|
|
8816
|
+
this.buttons = void 0;
|
|
8817
|
+
this.buttonOptions = RangeSelector.prototype.defaultButtons;
|
|
8818
|
+
this.options = void 0;
|
|
8819
|
+
this.chart = chart;
|
|
8820
|
+
// Run RangeSelector
|
|
8821
|
+
this.init(chart);
|
|
8822
|
+
}
|
|
8037
8823
|
/**
|
|
8038
8824
|
* The method to run when one of the buttons in the range selectors is
|
|
8039
8825
|
* clicked
|
|
@@ -8045,7 +8831,7 @@
|
|
|
8045
8831
|
* @param {boolean} [redraw]
|
|
8046
8832
|
* @return {void}
|
|
8047
8833
|
*/
|
|
8048
|
-
clickButton
|
|
8834
|
+
RangeSelector.prototype.clickButton = function (i, redraw) {
|
|
8049
8835
|
var rangeSelector = this,
|
|
8050
8836
|
chart = rangeSelector.chart,
|
|
8051
8837
|
rangeOptions = rangeSelector.buttonOptions[i],
|
|
@@ -8140,8 +8926,12 @@
|
|
|
8140
8926
|
newMin = dataMin;
|
|
8141
8927
|
newMax = dataMax;
|
|
8142
8928
|
}
|
|
8143
|
-
newMin
|
|
8144
|
-
|
|
8929
|
+
if (defined(newMin)) {
|
|
8930
|
+
newMin += rangeOptions._offsetMin;
|
|
8931
|
+
}
|
|
8932
|
+
if (defined(newMax)) {
|
|
8933
|
+
newMax += rangeOptions._offsetMax;
|
|
8934
|
+
}
|
|
8145
8935
|
rangeSelector.setSelected(i);
|
|
8146
8936
|
// Update the chart
|
|
8147
8937
|
if (!baseAxis) {
|
|
@@ -8165,7 +8955,7 @@
|
|
|
8165
8955
|
rangeSelectorButton: rangeOptions
|
|
8166
8956
|
});
|
|
8167
8957
|
}
|
|
8168
|
-
}
|
|
8958
|
+
};
|
|
8169
8959
|
/**
|
|
8170
8960
|
* Set the selected option. This method only sets the internal flag, it
|
|
8171
8961
|
* doesn't update the buttons or the actual zoomed range.
|
|
@@ -8175,35 +8965,9 @@
|
|
|
8175
8965
|
* @param {number} [selected]
|
|
8176
8966
|
* @return {void}
|
|
8177
8967
|
*/
|
|
8178
|
-
setSelected
|
|
8968
|
+
RangeSelector.prototype.setSelected = function (selected) {
|
|
8179
8969
|
this.selected = this.options.selected = selected;
|
|
8180
|
-
}
|
|
8181
|
-
/**
|
|
8182
|
-
* The default buttons for pre-selecting time frames
|
|
8183
|
-
*/
|
|
8184
|
-
defaultButtons: [{
|
|
8185
|
-
type: 'month',
|
|
8186
|
-
count: 1,
|
|
8187
|
-
text: '1m'
|
|
8188
|
-
}, {
|
|
8189
|
-
type: 'month',
|
|
8190
|
-
count: 3,
|
|
8191
|
-
text: '3m'
|
|
8192
|
-
}, {
|
|
8193
|
-
type: 'month',
|
|
8194
|
-
count: 6,
|
|
8195
|
-
text: '6m'
|
|
8196
|
-
}, {
|
|
8197
|
-
type: 'ytd',
|
|
8198
|
-
text: 'YTD'
|
|
8199
|
-
}, {
|
|
8200
|
-
type: 'year',
|
|
8201
|
-
count: 1,
|
|
8202
|
-
text: '1y'
|
|
8203
|
-
}, {
|
|
8204
|
-
type: 'all',
|
|
8205
|
-
text: 'All'
|
|
8206
|
-
}],
|
|
8970
|
+
};
|
|
8207
8971
|
/**
|
|
8208
8972
|
* Initialize the range selector
|
|
8209
8973
|
*
|
|
@@ -8212,11 +8976,10 @@
|
|
|
8212
8976
|
* @param {Highcharts.Chart} chart
|
|
8213
8977
|
* @return {void}
|
|
8214
8978
|
*/
|
|
8215
|
-
init
|
|
8979
|
+
RangeSelector.prototype.init = function (chart) {
|
|
8216
8980
|
var rangeSelector = this,
|
|
8217
8981
|
options = chart.options.rangeSelector,
|
|
8218
|
-
buttonOptions = options.buttons ||
|
|
8219
|
-
[].concat(rangeSelector.defaultButtons),
|
|
8982
|
+
buttonOptions = options.buttons || rangeSelector.defaultButtons.slice(),
|
|
8220
8983
|
selectedOption = options.selected,
|
|
8221
8984
|
blurInputs = function () {
|
|
8222
8985
|
var minInput = rangeSelector.minInput,
|
|
@@ -8258,7 +9021,7 @@
|
|
|
8258
9021
|
});
|
|
8259
9022
|
}
|
|
8260
9023
|
});
|
|
8261
|
-
}
|
|
9024
|
+
};
|
|
8262
9025
|
/**
|
|
8263
9026
|
* Dynamically update the range selector buttons after a new range has been
|
|
8264
9027
|
* set
|
|
@@ -8267,7 +9030,7 @@
|
|
|
8267
9030
|
* @function Highcharts.RangeSelector#updateButtonStates
|
|
8268
9031
|
* @return {void}
|
|
8269
9032
|
*/
|
|
8270
|
-
updateButtonStates
|
|
9033
|
+
RangeSelector.prototype.updateButtonStates = function () {
|
|
8271
9034
|
var rangeSelector = this,
|
|
8272
9035
|
chart = this.chart,
|
|
8273
9036
|
baseAxis = chart.xAxis[0],
|
|
@@ -8357,7 +9120,7 @@
|
|
|
8357
9120
|
}
|
|
8358
9121
|
}
|
|
8359
9122
|
});
|
|
8360
|
-
}
|
|
9123
|
+
};
|
|
8361
9124
|
/**
|
|
8362
9125
|
* Compute and cache the range for an individual button
|
|
8363
9126
|
*
|
|
@@ -8366,7 +9129,7 @@
|
|
|
8366
9129
|
* @param {Highcharts.RangeSelectorButtonsOptions} rangeOptions
|
|
8367
9130
|
* @return {void}
|
|
8368
9131
|
*/
|
|
8369
|
-
computeButtonRange
|
|
9132
|
+
RangeSelector.prototype.computeButtonRange = function (rangeOptions) {
|
|
8370
9133
|
var type = rangeOptions.type,
|
|
8371
9134
|
count = rangeOptions.count || 1,
|
|
8372
9135
|
// these time intervals have a fixed number of milliseconds, as
|
|
@@ -8393,7 +9156,7 @@
|
|
|
8393
9156
|
rangeOptions._offsetMax = pick(rangeOptions.offsetMax, 0);
|
|
8394
9157
|
rangeOptions._range +=
|
|
8395
9158
|
rangeOptions._offsetMax - rangeOptions._offsetMin;
|
|
8396
|
-
}
|
|
9159
|
+
};
|
|
8397
9160
|
/**
|
|
8398
9161
|
* Set the internal and displayed value of a HTML input for the dates
|
|
8399
9162
|
*
|
|
@@ -8403,7 +9166,7 @@
|
|
|
8403
9166
|
* @param {number} [inputTime]
|
|
8404
9167
|
* @return {void}
|
|
8405
9168
|
*/
|
|
8406
|
-
setInputValue
|
|
9169
|
+
RangeSelector.prototype.setInputValue = function (name, inputTime) {
|
|
8407
9170
|
var options = this.chart.options.rangeSelector,
|
|
8408
9171
|
time = this.chart.time,
|
|
8409
9172
|
input = this[name + 'Input'];
|
|
@@ -8415,14 +9178,14 @@
|
|
|
8415
9178
|
this[name + 'DateBox'].attr({
|
|
8416
9179
|
text: time.dateFormat(options.inputDateFormat || '%b %e, %Y', input.HCTime)
|
|
8417
9180
|
});
|
|
8418
|
-
}
|
|
9181
|
+
};
|
|
8419
9182
|
/**
|
|
8420
9183
|
* @private
|
|
8421
9184
|
* @function Highcharts.RangeSelector#showInput
|
|
8422
9185
|
* @param {string} name
|
|
8423
9186
|
* @return {void}
|
|
8424
9187
|
*/
|
|
8425
|
-
showInput
|
|
9188
|
+
RangeSelector.prototype.showInput = function (name) {
|
|
8426
9189
|
var inputGroup = this.inputGroup,
|
|
8427
9190
|
dateBox = this[name + 'DateBox'];
|
|
8428
9191
|
css(this[name + 'Input'], {
|
|
@@ -8432,21 +9195,35 @@
|
|
|
8432
9195
|
height: (dateBox.height - 2) + 'px',
|
|
8433
9196
|
border: '2px solid silver'
|
|
8434
9197
|
});
|
|
8435
|
-
}
|
|
9198
|
+
};
|
|
8436
9199
|
/**
|
|
8437
9200
|
* @private
|
|
8438
9201
|
* @function Highcharts.RangeSelector#hideInput
|
|
8439
9202
|
* @param {string} name
|
|
8440
9203
|
* @return {void}
|
|
8441
9204
|
*/
|
|
8442
|
-
hideInput
|
|
9205
|
+
RangeSelector.prototype.hideInput = function (name) {
|
|
8443
9206
|
css(this[name + 'Input'], {
|
|
8444
9207
|
border: 0,
|
|
8445
9208
|
width: '1px',
|
|
8446
9209
|
height: '1px'
|
|
8447
9210
|
});
|
|
8448
9211
|
this.setInputValue(name);
|
|
8449
|
-
}
|
|
9212
|
+
};
|
|
9213
|
+
/**
|
|
9214
|
+
* @private
|
|
9215
|
+
* @function Highcharts.RangeSelector#defaultInputDateParser
|
|
9216
|
+
*/
|
|
9217
|
+
RangeSelector.prototype.defaultInputDateParser = function (inputDate, useUTC) {
|
|
9218
|
+
var date = new Date();
|
|
9219
|
+
if (H.isSafari) {
|
|
9220
|
+
return Date.parse(inputDate.split(' ').join('T'));
|
|
9221
|
+
}
|
|
9222
|
+
if (useUTC) {
|
|
9223
|
+
return Date.parse(inputDate + 'Z');
|
|
9224
|
+
}
|
|
9225
|
+
return Date.parse(inputDate) - date.getTimezoneOffset() * 60 * 1000;
|
|
9226
|
+
};
|
|
8450
9227
|
/**
|
|
8451
9228
|
* Draw either the 'from' or the 'to' HTML input box of the range selector
|
|
8452
9229
|
*
|
|
@@ -8455,7 +9232,7 @@
|
|
|
8455
9232
|
* @param {string} name
|
|
8456
9233
|
* @return {void}
|
|
8457
9234
|
*/
|
|
8458
|
-
drawInput
|
|
9235
|
+
RangeSelector.prototype.drawInput = function (name) {
|
|
8459
9236
|
var rangeSelector = this,
|
|
8460
9237
|
chart = rangeSelector.chart,
|
|
8461
9238
|
chartStyle = chart.renderer.style || {},
|
|
@@ -8467,19 +9244,21 @@
|
|
|
8467
9244
|
input,
|
|
8468
9245
|
label,
|
|
8469
9246
|
dateBox,
|
|
8470
|
-
inputGroup = this.inputGroup
|
|
9247
|
+
inputGroup = this.inputGroup,
|
|
9248
|
+
defaultInputDateParser = this.defaultInputDateParser;
|
|
8471
9249
|
/**
|
|
8472
9250
|
* @private
|
|
8473
9251
|
*/
|
|
8474
9252
|
function updateExtremes() {
|
|
8475
9253
|
var inputValue = input.value,
|
|
8476
|
-
value
|
|
9254
|
+
value,
|
|
8477
9255
|
chartAxis = chart.xAxis[0],
|
|
8478
9256
|
dataAxis = chart.scroller && chart.scroller.xAxis ?
|
|
8479
9257
|
chart.scroller.xAxis :
|
|
8480
9258
|
chartAxis,
|
|
8481
9259
|
dataMin = dataAxis.dataMin,
|
|
8482
9260
|
dataMax = dataAxis.dataMax;
|
|
9261
|
+
value = (options.inputDateParser || defaultInputDateParser)(inputValue, chart.time.useUTC);
|
|
8483
9262
|
if (value !== input.previousValue) {
|
|
8484
9263
|
input.previousValue = value;
|
|
8485
9264
|
// If the value isn't parsed directly to a value by the
|
|
@@ -8605,7 +9384,7 @@
|
|
|
8605
9384
|
updateExtremes();
|
|
8606
9385
|
}
|
|
8607
9386
|
};
|
|
8608
|
-
}
|
|
9387
|
+
};
|
|
8609
9388
|
/**
|
|
8610
9389
|
* Get the position of the range selector buttons and inputs. This can be
|
|
8611
9390
|
* overridden from outside for custom positioning.
|
|
@@ -8615,7 +9394,7 @@
|
|
|
8615
9394
|
*
|
|
8616
9395
|
* @return {Highcharts.Dictionary<number>}
|
|
8617
9396
|
*/
|
|
8618
|
-
getPosition
|
|
9397
|
+
RangeSelector.prototype.getPosition = function () {
|
|
8619
9398
|
var chart = this.chart,
|
|
8620
9399
|
options = chart.options.rangeSelector,
|
|
8621
9400
|
top = options.verticalAlign === 'top' ?
|
|
@@ -8625,7 +9404,7 @@
|
|
|
8625
9404
|
buttonTop: top + options.buttonPosition.y,
|
|
8626
9405
|
inputTop: top + options.inputPosition.y - 10
|
|
8627
9406
|
};
|
|
8628
|
-
}
|
|
9407
|
+
};
|
|
8629
9408
|
/**
|
|
8630
9409
|
* Get the extremes of YTD. Will choose dataMax if its value is lower than
|
|
8631
9410
|
* the current timestamp. Will choose dataMin if its value is higher than
|
|
@@ -8641,7 +9420,7 @@
|
|
|
8641
9420
|
* @return {*}
|
|
8642
9421
|
* Returns min and max for the YTD
|
|
8643
9422
|
*/
|
|
8644
|
-
getYTDExtremes
|
|
9423
|
+
RangeSelector.prototype.getYTDExtremes = function (dataMax, dataMin, useUTC) {
|
|
8645
9424
|
var time = this.chart.time,
|
|
8646
9425
|
min,
|
|
8647
9426
|
now = new time.Date(dataMax),
|
|
@@ -8656,7 +9435,7 @@
|
|
|
8656
9435
|
max: Math.min(dataMax || now, now),
|
|
8657
9436
|
min: min
|
|
8658
9437
|
};
|
|
8659
|
-
}
|
|
9438
|
+
};
|
|
8660
9439
|
/**
|
|
8661
9440
|
* Render the range selector including the buttons and the inputs. The first
|
|
8662
9441
|
* time render is called, the elements are created and positioned. On
|
|
@@ -8670,7 +9449,7 @@
|
|
|
8670
9449
|
* X axis maximum
|
|
8671
9450
|
* @return {void}
|
|
8672
9451
|
*/
|
|
8673
|
-
render
|
|
9452
|
+
RangeSelector.prototype.render = function (min, max) {
|
|
8674
9453
|
var rangeSelector = this,
|
|
8675
9454
|
chart = rangeSelector.chart,
|
|
8676
9455
|
renderer = chart.renderer,
|
|
@@ -8940,7 +9719,7 @@
|
|
|
8940
9719
|
rangeSelector.group.translateY + 'px';
|
|
8941
9720
|
}
|
|
8942
9721
|
rangeSelector.rendered = true;
|
|
8943
|
-
}
|
|
9722
|
+
};
|
|
8944
9723
|
/**
|
|
8945
9724
|
* Extracts height of range selector
|
|
8946
9725
|
*
|
|
@@ -8949,7 +9728,7 @@
|
|
|
8949
9728
|
* @return {number}
|
|
8950
9729
|
* Returns rangeSelector height
|
|
8951
9730
|
*/
|
|
8952
|
-
getHeight
|
|
9731
|
+
RangeSelector.prototype.getHeight = function () {
|
|
8953
9732
|
var rangeSelector = this,
|
|
8954
9733
|
options = rangeSelector.options,
|
|
8955
9734
|
rangeSelectorGroup = rangeSelector.group,
|
|
@@ -8974,7 +9753,7 @@
|
|
|
8974
9753
|
rangeSelectorHeight += Math.abs(minPosition);
|
|
8975
9754
|
}
|
|
8976
9755
|
return rangeSelectorHeight;
|
|
8977
|
-
}
|
|
9756
|
+
};
|
|
8978
9757
|
/**
|
|
8979
9758
|
* Detect collision with title or subtitle
|
|
8980
9759
|
*
|
|
@@ -8986,10 +9765,10 @@
|
|
|
8986
9765
|
* @return {boolean}
|
|
8987
9766
|
* Returns collision status
|
|
8988
9767
|
*/
|
|
8989
|
-
titleCollision
|
|
9768
|
+
RangeSelector.prototype.titleCollision = function (chart) {
|
|
8990
9769
|
return !(chart.options.title.text ||
|
|
8991
9770
|
chart.options.subtitle.text);
|
|
8992
|
-
}
|
|
9771
|
+
};
|
|
8993
9772
|
/**
|
|
8994
9773
|
* Update the range selector with new options
|
|
8995
9774
|
*
|
|
@@ -8998,20 +9777,20 @@
|
|
|
8998
9777
|
* @param {Highcharts.RangeSelectorOptions} options
|
|
8999
9778
|
* @return {void}
|
|
9000
9779
|
*/
|
|
9001
|
-
update
|
|
9780
|
+
RangeSelector.prototype.update = function (options) {
|
|
9002
9781
|
var chart = this.chart;
|
|
9003
9782
|
merge(true, chart.options.rangeSelector, options);
|
|
9004
9783
|
this.destroy();
|
|
9005
9784
|
this.init(chart);
|
|
9006
9785
|
chart.rangeSelector.render();
|
|
9007
|
-
}
|
|
9786
|
+
};
|
|
9008
9787
|
/**
|
|
9009
9788
|
* Destroys allocated elements.
|
|
9010
9789
|
*
|
|
9011
9790
|
* @private
|
|
9012
9791
|
* @function Highcharts.RangeSelector#destroy
|
|
9013
9792
|
*/
|
|
9014
|
-
destroy
|
|
9793
|
+
RangeSelector.prototype.destroy = function () {
|
|
9015
9794
|
var rSelector = this,
|
|
9016
9795
|
minInput = rSelector.minInput,
|
|
9017
9796
|
maxInput = rSelector.maxInput;
|
|
@@ -9029,21 +9808,48 @@
|
|
|
9029
9808
|
// Destroy HTML and SVG elements
|
|
9030
9809
|
objectEach(rSelector, function (val, key) {
|
|
9031
9810
|
if (val && key !== 'chart') {
|
|
9032
|
-
if (val
|
|
9811
|
+
if (val instanceof SVGElement) {
|
|
9033
9812
|
// SVGElement
|
|
9034
9813
|
val.destroy();
|
|
9035
9814
|
}
|
|
9036
|
-
else if (val.
|
|
9815
|
+
else if (val instanceof window.HTMLElement) {
|
|
9037
9816
|
// HTML element
|
|
9038
|
-
discardElement(
|
|
9817
|
+
discardElement(val);
|
|
9039
9818
|
}
|
|
9040
9819
|
}
|
|
9041
9820
|
if (val !== RangeSelector.prototype[key]) {
|
|
9042
9821
|
rSelector[key] = null;
|
|
9043
9822
|
}
|
|
9044
9823
|
}, this);
|
|
9045
|
-
}
|
|
9046
|
-
|
|
9824
|
+
};
|
|
9825
|
+
return RangeSelector;
|
|
9826
|
+
}());
|
|
9827
|
+
/**
|
|
9828
|
+
* The default buttons for pre-selecting time frames
|
|
9829
|
+
*/
|
|
9830
|
+
RangeSelector.prototype.defaultButtons = [{
|
|
9831
|
+
type: 'month',
|
|
9832
|
+
count: 1,
|
|
9833
|
+
text: '1m'
|
|
9834
|
+
}, {
|
|
9835
|
+
type: 'month',
|
|
9836
|
+
count: 3,
|
|
9837
|
+
text: '3m'
|
|
9838
|
+
}, {
|
|
9839
|
+
type: 'month',
|
|
9840
|
+
count: 6,
|
|
9841
|
+
text: '6m'
|
|
9842
|
+
}, {
|
|
9843
|
+
type: 'ytd',
|
|
9844
|
+
text: 'YTD'
|
|
9845
|
+
}, {
|
|
9846
|
+
type: 'year',
|
|
9847
|
+
count: 1,
|
|
9848
|
+
text: '1y'
|
|
9849
|
+
}, {
|
|
9850
|
+
type: 'all',
|
|
9851
|
+
text: 'All'
|
|
9852
|
+
}];
|
|
9047
9853
|
/**
|
|
9048
9854
|
* Get the axis min value based on the range option and the current max. For
|
|
9049
9855
|
* stock charts this is extended via the {@link RangeSelector} so that if the
|
|
@@ -9254,8 +10060,9 @@
|
|
|
9254
10060
|
H.RangeSelector = RangeSelector;
|
|
9255
10061
|
}
|
|
9256
10062
|
|
|
10063
|
+
return H.RangeSelector;
|
|
9257
10064
|
});
|
|
9258
|
-
_registerModule(_modules, '
|
|
10065
|
+
_registerModule(_modules, 'Core/Axis/NavigatorAxis.js', [_modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (H, U) {
|
|
9259
10066
|
/* *
|
|
9260
10067
|
*
|
|
9261
10068
|
* (c) 2010-2020 Torstein Honsi
|
|
@@ -9431,7 +10238,7 @@
|
|
|
9431
10238
|
|
|
9432
10239
|
return NavigatorAxis;
|
|
9433
10240
|
});
|
|
9434
|
-
_registerModule(_modules, '
|
|
10241
|
+
_registerModule(_modules, 'Core/Navigator.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Series/Series.js'], _modules['Core/Chart/Chart.js'], _modules['Core/Color/Color.js'], _modules['Core/Globals.js'], _modules['Series/LineSeries.js'], _modules['Core/Axis/NavigatorAxis.js'], _modules['Core/Options.js'], _modules['Core/Scrollbar.js'], _modules['Core/Utilities.js']], function (Axis, BaseSeries, Chart, Color, H, LineSeries, NavigatorAxis, O, Scrollbar, U) {
|
|
9435
10242
|
/* *
|
|
9436
10243
|
*
|
|
9437
10244
|
* (c) 2010-2020 Torstein Honsi
|
|
@@ -9441,7 +10248,11 @@
|
|
|
9441
10248
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
9442
10249
|
*
|
|
9443
10250
|
* */
|
|
10251
|
+
var seriesTypes = BaseSeries.seriesTypes;
|
|
9444
10252
|
var color = Color.parse;
|
|
10253
|
+
var hasTouch = H.hasTouch,
|
|
10254
|
+
isTouchDevice = H.isTouchDevice;
|
|
10255
|
+
var defaultOptions = O.defaultOptions;
|
|
9445
10256
|
var addEvent = U.addEvent,
|
|
9446
10257
|
clamp = U.clamp,
|
|
9447
10258
|
correctFloat = U.correctFloat,
|
|
@@ -9456,13 +10267,7 @@
|
|
|
9456
10267
|
pick = U.pick,
|
|
9457
10268
|
removeEvent = U.removeEvent,
|
|
9458
10269
|
splat = U.splat;
|
|
9459
|
-
var
|
|
9460
|
-
defaultOptions = H.defaultOptions,
|
|
9461
|
-
hasTouch = H.hasTouch,
|
|
9462
|
-
isTouchDevice = H.isTouchDevice,
|
|
9463
|
-
Series = H.Series,
|
|
9464
|
-
seriesTypes = H.seriesTypes,
|
|
9465
|
-
defaultSeriesType,
|
|
10270
|
+
var defaultSeriesType,
|
|
9466
10271
|
// Finding the min or max of a set of variables where we don't know if they
|
|
9467
10272
|
// are defined, is a pattern that is repeated several places in Highcharts.
|
|
9468
10273
|
// Consider making this a global utility method.
|
|
@@ -9724,8 +10529,7 @@
|
|
|
9724
10529
|
*/
|
|
9725
10530
|
series: {
|
|
9726
10531
|
/**
|
|
9727
|
-
* The type of the navigator series.
|
|
9728
|
-
* defined, otherwise `line`.
|
|
10532
|
+
* The type of the navigator series.
|
|
9729
10533
|
*
|
|
9730
10534
|
* Heads up:
|
|
9731
10535
|
* In column-type navigator, zooming is limited to at least one
|
|
@@ -9735,7 +10539,8 @@
|
|
|
9735
10539
|
* Column type navigator
|
|
9736
10540
|
*
|
|
9737
10541
|
* @type {string}
|
|
9738
|
-
* @default areaspline
|
|
10542
|
+
* @default {highstock} `areaspline` if defined, otherwise `line`
|
|
10543
|
+
* @default {gantt} gantt
|
|
9739
10544
|
*/
|
|
9740
10545
|
type: defaultSeriesType,
|
|
9741
10546
|
/**
|
|
@@ -9939,9 +10744,9 @@
|
|
|
9939
10744
|
* Path to be used in a handle
|
|
9940
10745
|
*/
|
|
9941
10746
|
H.Renderer.prototype.symbols['navigator-handle'] = function (x, y, w, h, options) {
|
|
9942
|
-
var halfWidth = options.width / 2,
|
|
10747
|
+
var halfWidth = (options && options.width || 0) / 2,
|
|
9943
10748
|
markerPosition = Math.round(halfWidth / 3) + 0.5,
|
|
9944
|
-
height = options.height || 0;
|
|
10749
|
+
height = options && options.height || 0;
|
|
9945
10750
|
return [
|
|
9946
10751
|
['M', -halfWidth - 1, 0.5],
|
|
9947
10752
|
['L', halfWidth, 0.5],
|
|
@@ -10654,8 +11459,8 @@
|
|
|
10654
11459
|
inverted = chart.inverted,
|
|
10655
11460
|
verb = navigator.rendered && !navigator.hasDragged ?
|
|
10656
11461
|
'animate' : 'attr',
|
|
10657
|
-
zoomedMax
|
|
10658
|
-
zoomedMin
|
|
11462
|
+
zoomedMax,
|
|
11463
|
+
zoomedMin,
|
|
10659
11464
|
unionExtremes,
|
|
10660
11465
|
fixedMin,
|
|
10661
11466
|
fixedMax,
|
|
@@ -10706,7 +11511,11 @@
|
|
|
10706
11511
|
navigator.hasDragged = navigator.dragOffset = null;
|
|
10707
11512
|
}
|
|
10708
11513
|
// Update position of navigator shades, outline and handles (#12573)
|
|
10709
|
-
if (navigator.navigatorEnabled
|
|
11514
|
+
if (navigator.navigatorEnabled &&
|
|
11515
|
+
isNumber(navigator.zoomedMin) &&
|
|
11516
|
+
isNumber(navigator.zoomedMax)) {
|
|
11517
|
+
zoomedMin = Math.round(navigator.zoomedMin);
|
|
11518
|
+
zoomedMax = Math.round(navigator.zoomedMax);
|
|
10710
11519
|
if (navigator.shades) {
|
|
10711
11520
|
navigator.drawMasks(zoomedMin, zoomedMax, inverted, verb);
|
|
10712
11521
|
}
|
|
@@ -10828,6 +11637,7 @@
|
|
|
10828
11637
|
offset: 0,
|
|
10829
11638
|
index: yAxisIndex,
|
|
10830
11639
|
isInternal: true,
|
|
11640
|
+
reversed: pick((navigatorOptions.yAxis && navigatorOptions.yAxis.reversed), (chart.yAxis[0] && chart.yAxis[0].reversed), false),
|
|
10831
11641
|
zoomEnabled: false
|
|
10832
11642
|
}, chart.inverted ? {
|
|
10833
11643
|
width: height
|
|
@@ -11427,6 +12237,7 @@
|
|
|
11427
12237
|
0) -
|
|
11428
12238
|
((legendOptions &&
|
|
11429
12239
|
legendOptions.verticalAlign === 'bottom' &&
|
|
12240
|
+
legendOptions.layout !== 'proximate' && // #13392
|
|
11430
12241
|
legendOptions.enabled &&
|
|
11431
12242
|
!legendOptions.floating) ?
|
|
11432
12243
|
legend.legendHeight +
|
|
@@ -11477,7 +12288,7 @@
|
|
|
11477
12288
|
}
|
|
11478
12289
|
});
|
|
11479
12290
|
// Handle updating series
|
|
11480
|
-
addEvent(
|
|
12291
|
+
addEvent(LineSeries, 'afterUpdate', function () {
|
|
11481
12292
|
if (this.chart.navigator && !this.options.isInternal) {
|
|
11482
12293
|
this.chart.navigator.setBaseSeries(null, false);
|
|
11483
12294
|
}
|