@highcharts/grid-pro 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +6 -0
- package/README.md +15 -9
- package/css/grid-pro.css +1289 -1153
- package/css/modules/grid-base-variables.css +131 -0
- package/css/modules/grid-button-variables.css +140 -0
- package/css/modules/grid-caption-variables.css +11 -0
- package/css/modules/grid-description-variables.css +11 -0
- package/css/modules/grid-input-variables.css +114 -0
- package/css/modules/grid-link-variables.css +18 -0
- package/css/modules/grid-menu-variables.css +50 -0
- package/css/modules/grid-pagination-variables.css +12 -0
- package/css/modules/grid-popup-variables.css +24 -0
- package/css/modules/grid-pro.css +234 -0
- package/css/modules/grid-table-variables.css +385 -0
- package/css/modules/grid-theme-default.css +55 -0
- package/es-modules/Accessibility/A11yI18n.js +4 -5
- package/es-modules/Accessibility/Accessibility.js +5 -5
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +3 -3
- package/es-modules/Accessibility/AccessibilityComponent.js +4 -3
- package/es-modules/Accessibility/Components/AnnotationsA11y.js +4 -3
- package/es-modules/Accessibility/Components/ContainerComponent.js +4 -3
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +9 -9
- package/es-modules/Accessibility/Components/LegendComponent.js +5 -5
- package/es-modules/Accessibility/Components/MenuComponent.js +5 -5
- package/es-modules/Accessibility/Components/NavigatorComponent.js +6 -7
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +5 -5
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +15 -5
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +7 -7
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +4 -3
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +7 -7
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +5 -5
- package/es-modules/Accessibility/Components/ZoomComponent.js +5 -5
- package/es-modules/Accessibility/FocusBorder.js +5 -5
- package/es-modules/Accessibility/HighContrastMode.js +4 -3
- package/es-modules/Accessibility/HighContrastTheme.js +4 -3
- package/es-modules/Accessibility/KeyboardNavigation.js +5 -5
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +5 -5
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +15 -3
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +11 -5
- package/es-modules/Accessibility/Options/LangDefaults.js +13 -3
- package/es-modules/Accessibility/ProxyElement.js +6 -8
- package/es-modules/Accessibility/ProxyProvider.js +5 -5
- package/es-modules/Accessibility/Utils/Announcer.js +6 -6
- package/es-modules/Accessibility/Utils/ChartUtilities.js +5 -5
- package/es-modules/Accessibility/Utils/DOMElementProvider.js +4 -3
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +3 -3
- package/es-modules/Accessibility/Utils/EventProvider.js +10 -5
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +5 -5
- package/es-modules/Core/Animation/AnimationOptions.d.ts +42 -0
- package/es-modules/Core/Animation/AnimationOptions.js +10 -0
- package/es-modules/Core/Animation/AnimationUtilities.js +40 -5
- package/es-modules/Core/Animation/Fx.d.ts +1 -130
- package/es-modules/Core/Animation/Fx.js +14 -8
- package/es-modules/Core/Animation/FxBase.d.ts +1 -0
- package/es-modules/Core/Animation/FxBase.js +11 -0
- package/es-modules/Core/Callback.d.ts +56 -0
- package/es-modules/Core/Callback.js +10 -0
- package/es-modules/Core/Chart/Chart.d.ts +659 -400
- package/es-modules/Core/Chart/Chart.js +112 -95
- package/es-modules/Core/Chart/Chart3D.d.ts +123 -233
- package/es-modules/Core/Chart/Chart3D.js +23 -37
- package/es-modules/Core/Chart/ChartBase.d.ts +3 -0
- package/es-modules/Core/Chart/ChartBase.js +11 -0
- package/es-modules/Core/Chart/ChartDefaults.js +18 -12
- package/es-modules/Core/Chart/ChartNavigationComposition.d.ts +1 -55
- package/es-modules/Core/Chart/ChartNavigationComposition.js +13 -13
- package/es-modules/Core/Chart/ChartOptions.d.ts +1225 -0
- package/es-modules/Core/Chart/ChartOptions.js +10 -0
- package/es-modules/Core/Chart/GanttChart.d.ts +0 -38
- package/es-modules/Core/Chart/GanttChart.js +5 -5
- package/es-modules/Core/Chart/MapChart.d.ts +9 -4
- package/es-modules/Core/Chart/MapChart.js +14 -5
- package/es-modules/Core/Chart/StockChart.d.ts +0 -85
- package/es-modules/Core/Chart/StockChart.js +35 -18
- package/es-modules/Core/Color/Color.d.ts +16 -24
- package/es-modules/Core/Color/Color.js +27 -10
- package/es-modules/Core/Color/ColorString.d.ts +0 -23
- package/es-modules/Core/Color/ColorString.js +11 -0
- package/es-modules/Core/Color/ColorType.d.ts +0 -33
- package/es-modules/Core/Color/ColorType.js +11 -0
- package/es-modules/Core/Color/GradientColor.d.ts +0 -33
- package/es-modules/Core/Color/GradientColor.js +11 -0
- package/es-modules/Core/Color/Palettes.d.ts +1 -84
- package/es-modules/Core/Color/Palettes.js +2 -1
- package/es-modules/Core/Defaults.d.ts +6 -0
- package/es-modules/Core/Defaults.js +66 -75
- package/es-modules/Core/Delaunay.d.ts +52 -0
- package/es-modules/Core/Delaunay.js +310 -0
- package/es-modules/Core/Foundation.d.ts +1 -19
- package/es-modules/Core/Foundation.js +8 -6
- package/es-modules/Core/Geometry/CircleObject.d.ts +5 -0
- package/es-modules/Core/Geometry/CircleObject.js +10 -0
- package/es-modules/Core/Geometry/CircleUtilities.d.ts +1 -189
- package/es-modules/Core/Geometry/CircleUtilities.js +18 -17
- package/es-modules/Core/Geometry/GeometryObject.d.ts +7 -0
- package/es-modules/Core/Geometry/GeometryObject.js +10 -0
- package/es-modules/Core/Geometry/GeometryUtilities.d.ts +1 -48
- package/es-modules/Core/Geometry/GeometryUtilities.js +9 -7
- package/es-modules/Core/Geometry/IntersectionObject.d.ts +7 -0
- package/es-modules/Core/Geometry/IntersectionObject.js +10 -0
- package/es-modules/Core/Geometry/PolygonClip.d.ts +1 -19
- package/es-modules/Core/Geometry/PolygonClip.js +9 -7
- package/es-modules/Core/Globals.d.ts +9 -31
- package/es-modules/Core/Globals.js +9 -10
- package/es-modules/Core/GlobalsBase.d.ts +35 -0
- package/es-modules/Core/GlobalsBase.js +11 -0
- package/es-modules/Core/HttpUtilities.d.ts +54 -17
- package/es-modules/Core/HttpUtilities.js +16 -16
- package/es-modules/Core/JSON.d.ts +29 -0
- package/es-modules/Core/JSON.js +13 -0
- package/es-modules/Core/KeyboardEvent.d.ts +1 -0
- package/es-modules/Core/KeyboardEvent.js +11 -0
- package/es-modules/Core/MSPointer.d.ts +1 -74
- package/es-modules/Core/MSPointer.js +24 -15
- package/es-modules/Core/Math3D.d.ts +1 -117
- package/es-modules/Core/Math3D.js +14 -12
- package/es-modules/Core/Options.d.ts +338 -0
- package/es-modules/Core/Options.js +10 -0
- package/es-modules/Core/Pointer.d.ts +71 -445
- package/es-modules/Core/Pointer.js +74 -69
- package/es-modules/Core/PointerEvent.d.ts +20 -0
- package/es-modules/Core/PointerEvent.js +11 -0
- package/es-modules/Core/Renderer/AlignObject.d.ts +25 -27
- package/es-modules/Core/Renderer/AlignObject.js +11 -0
- package/es-modules/Core/Renderer/BBoxObject.d.ts +20 -31
- package/es-modules/Core/Renderer/BBoxObject.js +11 -0
- package/es-modules/Core/Renderer/CSSObject.d.ts +268 -59
- package/es-modules/Core/Renderer/CSSObject.js +10 -0
- package/es-modules/Core/Renderer/DOMElementType.d.ts +1 -33
- package/es-modules/Core/Renderer/DOMElementType.js +11 -0
- package/es-modules/Core/Renderer/DashStyleValue.d.ts +1 -27
- package/es-modules/Core/Renderer/DashStyleValue.js +11 -0
- package/es-modules/Core/Renderer/FontMetricsObject.d.ts +6 -26
- package/es-modules/Core/Renderer/FontMetricsObject.js +11 -0
- package/es-modules/Core/Renderer/HTML/AST.d.ts +3 -15
- package/es-modules/Core/Renderer/HTML/AST.js +24 -15
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +1 -25
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.js +11 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.d.ts +0 -54
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +28 -24
- package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +15 -12
- package/es-modules/Core/Renderer/PolygonBoxObject.js +11 -0
- package/es-modules/Core/Renderer/Position3DObject.d.ts +6 -30
- package/es-modules/Core/Renderer/Position3DObject.js +11 -0
- package/es-modules/Core/Renderer/PositionObject.d.ts +9 -23
- package/es-modules/Core/Renderer/PositionObject.js +11 -0
- package/es-modules/Core/Renderer/RectangleObject.d.ts +6 -30
- package/es-modules/Core/Renderer/RectangleObject.js +11 -0
- package/es-modules/Core/Renderer/RendererRegistry.d.ts +1 -29
- package/es-modules/Core/Renderer/RendererRegistry.js +6 -3
- package/es-modules/Core/Renderer/RendererType.d.ts +1 -53
- package/es-modules/Core/Renderer/RendererType.js +11 -0
- package/es-modules/Core/Renderer/RendererUtilities.d.ts +1 -26
- package/es-modules/Core/Renderer/RendererUtilities.js +41 -23
- package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +26 -31
- package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +1 -44
- package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +15 -51
- package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +1 -42
- package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +1 -42
- package/es-modules/Core/Renderer/SVG/SVGElement.d.ts +459 -0
- package/es-modules/Core/Renderer/SVG/SVGElement3D.d.ts +1 -0
- package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +0 -23
- package/es-modules/Core/Renderer/SVG/SVGLabel.d.ts +14 -0
- package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +18 -56
- package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +0 -30
- package/es-modules/Core/Renderer/SVG/SVGRenderer.d.ts +652 -0
- package/es-modules/Core/Renderer/SVG/SVGRenderer3D.d.ts +1 -0
- package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +0 -24
- package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +3 -26
- package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +1 -41
- package/es-modules/Core/Renderer/SVG/Symbols.d.ts +146 -0
- package/es-modules/Core/Renderer/SVG/TextBuilder.d.ts +1 -0
- package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +21 -30
- package/es-modules/Core/Renderer/ShadowOptionsObject.js +11 -0
- package/es-modules/Core/Renderer/SizeObject.d.ts +0 -23
- package/es-modules/Core/Renderer/SizeObject.js +11 -0
- package/es-modules/Core/Responsive.d.ts +94 -29
- package/es-modules/Core/Responsive.js +17 -12
- package/es-modules/Core/Templating.d.ts +17 -1
- package/es-modules/Core/Templating.js +12 -8
- package/es-modules/Core/Time.d.ts +18 -1
- package/es-modules/Core/Time.js +6 -5
- package/es-modules/Core/Tooltip.d.ts +67 -123
- package/es-modules/Core/Tooltip.js +161 -108
- package/es-modules/Core/TooltipOptions.d.ts +724 -0
- package/es-modules/Core/TooltipOptions.js +10 -0
- package/es-modules/Core/Utilities.d.ts +32 -703
- package/es-modules/Core/Utilities.js +28 -1443
- package/es-modules/Data/ColumnUtils.d.ts +83 -80
- package/es-modules/Data/ColumnUtils.js +106 -116
- package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/CSVConnector.js +6 -7
- package/es-modules/Data/Connectors/CSVConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Connectors/DataConnector.d.ts +63 -54
- package/es-modules/Data/Connectors/DataConnector.js +67 -56
- package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Connectors/DataConnectorType.d.ts +3 -3
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +76 -91
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +7 -5
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
- package/es-modules/Data/Connectors/HTMLTableConnector.js +6 -7
- package/es-modules/Data/Connectors/HTMLTableConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/JSONConnector.js +6 -7
- package/es-modules/Data/Connectors/JSONConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
- package/es-modules/Data/Converters/CSVConverter.js +6 -7
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +5 -5
- package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
- package/es-modules/Data/Converters/DataConverter.js +29 -56
- package/es-modules/Data/Converters/DataConverterType.d.ts +3 -3
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
- package/es-modules/Data/Converters/DataConverterUtils.js +172 -184
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +6 -6
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +5 -5
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
- package/es-modules/Data/Converters/HTMLTableConverter.js +5 -6
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +5 -5
- package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
- package/es-modules/Data/Converters/JSONConverter.js +9 -9
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +5 -5
- package/es-modules/Data/DataCursor.d.ts +65 -70
- package/es-modules/Data/DataCursor.js +122 -142
- package/es-modules/Data/DataEvent.d.ts +55 -57
- package/es-modules/Data/DataEvent.js +3 -3
- package/es-modules/Data/DataPool.d.ts +10 -17
- package/es-modules/Data/DataPool.js +23 -12
- package/es-modules/Data/DataPoolOptions.d.ts +3 -3
- package/es-modules/Data/DataTable.d.ts +115 -117
- package/es-modules/Data/DataTable.js +67 -33
- package/es-modules/Data/DataTableCore.d.ts +11 -11
- package/es-modules/Data/DataTableCore.js +7 -7
- package/es-modules/Data/DataTableOptions.js +3 -3
- package/es-modules/Data/Formula/Formula.js +3 -3
- package/es-modules/Data/Formula/FormulaParser.js +4 -5
- package/es-modules/Data/Formula/FormulaProcessor.js +4 -5
- package/es-modules/Data/Formula/FormulaTypes.js +3 -3
- package/es-modules/Data/Formula/Functions/ABS.js +3 -3
- package/es-modules/Data/Formula/Functions/AND.js +3 -3
- package/es-modules/Data/Formula/Functions/AVERAGE.js +3 -3
- package/es-modules/Data/Formula/Functions/AVERAGEA.js +3 -3
- package/es-modules/Data/Formula/Functions/COUNT.js +3 -3
- package/es-modules/Data/Formula/Functions/COUNTA.js +3 -3
- package/es-modules/Data/Formula/Functions/IF.js +3 -3
- package/es-modules/Data/Formula/Functions/ISNA.js +3 -3
- package/es-modules/Data/Formula/Functions/MAX.js +3 -3
- package/es-modules/Data/Formula/Functions/MEDIAN.js +3 -3
- package/es-modules/Data/Formula/Functions/MIN.js +3 -3
- package/es-modules/Data/Formula/Functions/MOD.js +3 -3
- package/es-modules/Data/Formula/Functions/MODE.js +3 -3
- package/es-modules/Data/Formula/Functions/NOT.js +3 -3
- package/es-modules/Data/Formula/Functions/OR.js +3 -3
- package/es-modules/Data/Formula/Functions/PRODUCT.js +3 -3
- package/es-modules/Data/Formula/Functions/SUM.js +3 -3
- package/es-modules/Data/Formula/Functions/XOR.js +3 -3
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
- package/es-modules/Data/Modifiers/ChainModifier.js +10 -11
- package/es-modules/Data/Modifiers/ChainModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
- package/es-modules/Data/Modifiers/DataModifier.js +34 -56
- package/es-modules/Data/Modifiers/DataModifierEvent.js +3 -3
- package/es-modules/Data/Modifiers/DataModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/DataModifierType.d.ts +3 -3
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/FilterModifier.js +6 -7
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
- package/es-modules/Data/Modifiers/FilterModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/InvertModifier.js +6 -7
- package/es-modules/Data/Modifiers/InvertModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
- package/es-modules/Data/Modifiers/MathModifier.js +3 -3
- package/es-modules/Data/Modifiers/MathModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/RangeModifier.js +6 -7
- package/es-modules/Data/Modifiers/RangeModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
- package/es-modules/Data/Modifiers/SortModifier.js +35 -10
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +43 -6
- package/es-modules/Data/Modifiers/SortModifierOptions.js +3 -3
- package/es-modules/Grid/Core/Accessibility/A11yOptions.d.ts +77 -0
- package/es-modules/Grid/Core/Accessibility/A11yOptions.js +4 -3
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +68 -1
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +179 -7
- package/es-modules/Grid/Core/Credits.js +3 -3
- package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
- package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
- package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
- package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
- package/es-modules/Grid/Core/Defaults.js +21 -7
- package/es-modules/Grid/Core/Globals.d.ts +20 -16
- package/es-modules/Grid/Core/Globals.js +13 -11
- package/es-modules/Grid/Core/Grid.d.ts +43 -23
- package/es-modules/Grid/Core/Grid.js +316 -136
- package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
- package/es-modules/Grid/Core/GridUtils.js +53 -6
- package/es-modules/Grid/Core/Options.d.ts +162 -5
- package/es-modules/Grid/Core/Options.js +3 -3
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +66 -26
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -40
- package/es-modules/Grid/Core/Pagination/PaginationOptions.js +11 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +4 -5
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +2 -2
- package/es-modules/Grid/Core/Querying/PaginationController.js +6 -6
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
- package/es-modules/Grid/Core/Querying/QueryingController.js +5 -29
- package/es-modules/Grid/Core/Querying/SortingController.d.ts +15 -0
- package/es-modules/Grid/Core/Querying/SortingController.js +89 -51
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +229 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +5 -6
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +3 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +6 -7
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +5 -5
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.js +3 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +29 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +136 -26
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +4 -6
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +94 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +481 -91
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +36 -15
- package/es-modules/Grid/Core/Table/Body/TableCell.js +89 -33
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +15 -5
- package/es-modules/Grid/Core/Table/Body/TableRow.js +70 -19
- package/es-modules/Grid/Core/Table/Cell.d.ts +16 -10
- package/es-modules/Grid/Core/Table/Cell.js +41 -6
- package/es-modules/Grid/Core/Table/CellContent/CellContent.js +3 -3
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +7 -12
- package/es-modules/Grid/Core/Table/Column.d.ts +11 -5
- package/es-modules/Grid/Core/Table/Column.js +26 -37
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +3 -3
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +3 -3
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +3 -3
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +12 -11
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +7 -6
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +21 -7
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.d.ts +9 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +37 -9
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuPopup.js +5 -4
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +11 -7
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +4 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +88 -15
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +8 -3
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +36 -15
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +7 -8
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +6 -6
- package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Row.js +5 -5
- package/es-modules/Grid/Core/Table/Table.d.ts +68 -12
- package/es-modules/Grid/Core/Table/Table.js +296 -92
- package/es-modules/Grid/Core/UI/Button.js +3 -3
- package/es-modules/Grid/Core/UI/ContextMenu.js +3 -3
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +8 -6
- package/es-modules/Grid/Core/UI/Popup.js +10 -12
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
- package/es-modules/Grid/Core/UI/SvgIcons.js +209 -36
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
- package/es-modules/Grid/Core/UI/Toolbar.js +3 -3
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
- package/es-modules/Grid/Core/UI/ToolbarButton.js +11 -29
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +4 -45
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.js +16 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +13 -13
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/CellContentPro.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/CellRendererType.d.ts +1 -34
- package/es-modules/Grid/Pro/CellRendering/CellRendererType.js +15 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +7 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +7 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +4 -4
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +10 -1
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +56 -12
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +6 -7
- package/es-modules/Grid/Pro/Credits/CreditsPro.js +3 -3
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +4 -6
- package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
- package/es-modules/Grid/Pro/Data/DataSourceHelper.js +246 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +5 -7
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +4 -5
- package/es-modules/Grid/Pro/GridEvents.d.ts +1 -0
- package/es-modules/Grid/Pro/GridEvents.js +4 -5
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +4 -5
- package/es-modules/Grid/index.js +3 -3
- package/es-modules/Shared/BaseForm.js +4 -5
- package/es-modules/Shared/DownloadURL.d.ts +1 -85
- package/es-modules/Shared/DownloadURL.js +15 -13
- package/es-modules/Shared/LangOptionsCore.d.ts +4 -3
- package/es-modules/Shared/TimeBase.d.ts +1 -46
- package/es-modules/Shared/TimeBase.js +11 -10
- package/es-modules/Shared/Types.d.ts +11 -3
- package/es-modules/Shared/Utilities.d.ts +576 -0
- package/es-modules/Shared/Utilities.js +1368 -0
- package/es-modules/masters/grid-pro.src.d.ts +18 -19
- package/es-modules/masters/grid-pro.src.js +24 -9
- package/grid-pro.d.ts +18 -19
- package/grid-pro.js +6 -5
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +18 -19
- package/grid-pro.src.js +8132 -4531
- package/package.json +1 -1
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
- package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
- package/es-modules/Grid/Pro/highcharts.d.ts +0 -7
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/* *
|
|
2
2
|
*
|
|
3
|
-
* (c) 2010-
|
|
3
|
+
* (c) 2010-2026 Highsoft AS
|
|
4
|
+
* Author: Torstein Honsi
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
+
* A commercial license may be required depending on use.
|
|
7
|
+
* See www.highcharts.com/license
|
|
6
8
|
*
|
|
7
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
8
9
|
*
|
|
9
10
|
* */
|
|
10
11
|
'use strict';
|
|
12
|
+
import { attr, fireEvent, isNumber, isString, objectEach, pick } from '../Shared/Utilities.js';
|
|
11
13
|
import H from './Globals.js';
|
|
12
|
-
const { charts,
|
|
14
|
+
const { charts, win } = H;
|
|
13
15
|
/* *
|
|
14
16
|
*
|
|
15
17
|
* Functions
|
|
@@ -45,7 +47,7 @@ const { charts, doc, win } = H;
|
|
|
45
47
|
*
|
|
46
48
|
* @return {void}
|
|
47
49
|
*/
|
|
48
|
-
function error(code, stop, chart, params) {
|
|
50
|
+
export function error(code, stop, chart, params) {
|
|
49
51
|
const severity = stop ? 'Highcharts error' : 'Highcharts warning';
|
|
50
52
|
if (code === 32) {
|
|
51
53
|
code = `${severity}: Deprecated member`;
|
|
@@ -84,298 +86,13 @@ function error(code, stop, chart, params) {
|
|
|
84
86
|
(function (error) {
|
|
85
87
|
error.messages = [];
|
|
86
88
|
})(error || (error = {}));
|
|
87
|
-
/**
|
|
88
|
-
* Utility function to deep merge two or more objects and return a third object.
|
|
89
|
-
* If the first argument is true, the contents of the second object is copied
|
|
90
|
-
* into the first object. The merge function can also be used with a single
|
|
91
|
-
* object argument to create a deep copy of an object.
|
|
92
|
-
*
|
|
93
|
-
* @function Highcharts.merge<T>
|
|
94
|
-
*
|
|
95
|
-
* @param {true | T} extendOrSource
|
|
96
|
-
* Whether to extend the left-side object,
|
|
97
|
-
* or the first object to merge as a deep copy.
|
|
98
|
-
*
|
|
99
|
-
* @param {...Array<object|undefined>} [sources]
|
|
100
|
-
* Object(s) to merge into the previous one.
|
|
101
|
-
*
|
|
102
|
-
* @return {T}
|
|
103
|
-
* The merged object. If the first argument is true, the return is the
|
|
104
|
-
* same as the second argument.
|
|
105
|
-
*/
|
|
106
|
-
function merge(extendOrSource, ...sources) {
|
|
107
|
-
let i, args = [extendOrSource, ...sources], ret = {};
|
|
108
|
-
const doCopy = function (copy, original) {
|
|
109
|
-
// An object is replacing a primitive
|
|
110
|
-
if (typeof copy !== 'object') {
|
|
111
|
-
copy = {};
|
|
112
|
-
}
|
|
113
|
-
objectEach(original, function (value, key) {
|
|
114
|
-
// Prototype pollution (#14883)
|
|
115
|
-
if (key === '__proto__' || key === 'constructor') {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
// Copy the contents of objects, but not arrays or DOM nodes
|
|
119
|
-
if (isObject(value, true) &&
|
|
120
|
-
!isClass(value) &&
|
|
121
|
-
!isDOMElement(value)) {
|
|
122
|
-
copy[key] = doCopy(copy[key] || {}, value);
|
|
123
|
-
// Primitives and arrays are copied over directly
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
copy[key] = original[key];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
return copy;
|
|
130
|
-
};
|
|
131
|
-
// If first argument is true, copy into the existing object. Used in
|
|
132
|
-
// setOptions.
|
|
133
|
-
if (extendOrSource === true) {
|
|
134
|
-
ret = args[1];
|
|
135
|
-
args = Array.prototype.slice.call(args, 2);
|
|
136
|
-
}
|
|
137
|
-
// For each argument, extend the return
|
|
138
|
-
const len = args.length;
|
|
139
|
-
for (i = 0; i < len; i++) {
|
|
140
|
-
ret = doCopy(ret, args[i]);
|
|
141
|
-
}
|
|
142
|
-
return ret;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Constrain a value to within a lower and upper threshold.
|
|
146
|
-
*
|
|
147
|
-
* @private
|
|
148
|
-
* @param {number} value The initial value
|
|
149
|
-
* @param {number} min The lower threshold
|
|
150
|
-
* @param {number} max The upper threshold
|
|
151
|
-
* @return {number} Returns a number value within min and max.
|
|
152
|
-
*/
|
|
153
|
-
function clamp(value, min, max) {
|
|
154
|
-
return value > min ? value < max ? value : max : min;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Utility for crisping a line position to the nearest full pixel depening on
|
|
158
|
-
* the line width
|
|
159
|
-
* @param {number} value The raw pixel position
|
|
160
|
-
* @param {number} lineWidth The line width
|
|
161
|
-
* @param {boolean} [inverted] Whether the containing group is inverted.
|
|
162
|
-
* Crisping round numbers on the y-scale need to go
|
|
163
|
-
* to the other side because the coordinate system
|
|
164
|
-
* is flipped (scaleY is -1)
|
|
165
|
-
* @return {number} The pixel position to use for a crisp display
|
|
166
|
-
*/
|
|
167
|
-
function crisp(value, lineWidth = 0, inverted) {
|
|
168
|
-
const mod = lineWidth % 2 / 2, inverter = inverted ? -1 : 1;
|
|
169
|
-
return (Math.round(value * inverter - mod) + mod) * inverter;
|
|
170
|
-
}
|
|
171
|
-
// eslint-disable-next-line valid-jsdoc
|
|
172
|
-
/**
|
|
173
|
-
* Return the deep difference between two objects. It can either return the new
|
|
174
|
-
* properties, or optionally return the old values of new properties.
|
|
175
|
-
* @private
|
|
176
|
-
*/
|
|
177
|
-
function diffObjects(newer, older, keepOlder, collectionsWithUpdate) {
|
|
178
|
-
const ret = {};
|
|
179
|
-
/**
|
|
180
|
-
* Recurse over a set of options and its current values, and store the
|
|
181
|
-
* current values in the ret object.
|
|
182
|
-
*/
|
|
183
|
-
function diff(newer, older, ret, depth) {
|
|
184
|
-
const keeper = keepOlder ? older : newer;
|
|
185
|
-
objectEach(newer, function (newerVal, key) {
|
|
186
|
-
if (!depth &&
|
|
187
|
-
collectionsWithUpdate &&
|
|
188
|
-
collectionsWithUpdate.indexOf(key) > -1 &&
|
|
189
|
-
older[key]) {
|
|
190
|
-
newerVal = splat(newerVal);
|
|
191
|
-
ret[key] = [];
|
|
192
|
-
// Iterate over collections like series, xAxis or yAxis and map
|
|
193
|
-
// the items by index.
|
|
194
|
-
for (let i = 0; i < Math.max(newerVal.length, older[key].length); i++) {
|
|
195
|
-
// Item exists in current data (#6347)
|
|
196
|
-
if (older[key][i]) {
|
|
197
|
-
// If the item is missing from the new data, we need to
|
|
198
|
-
// save the whole config structure. Like when
|
|
199
|
-
// responsively updating from a dual axis layout to a
|
|
200
|
-
// single axis and back (#13544).
|
|
201
|
-
if (newerVal[i] === void 0) {
|
|
202
|
-
ret[key][i] = older[key][i];
|
|
203
|
-
// Otherwise, proceed
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
ret[key][i] = {};
|
|
207
|
-
diff(newerVal[i], older[key][i], ret[key][i], depth + 1);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
else if (isObject(newerVal, true) &&
|
|
213
|
-
!newerVal.nodeType // #10044
|
|
214
|
-
) {
|
|
215
|
-
ret[key] = isArray(newerVal) ? [] : {};
|
|
216
|
-
diff(newerVal, older[key] || {}, ret[key], depth + 1);
|
|
217
|
-
// Delete empty nested objects
|
|
218
|
-
if (Object.keys(ret[key]).length === 0 &&
|
|
219
|
-
// Except colorAxis which is a special case where the empty
|
|
220
|
-
// object means it is enabled. Which is unfortunate and we
|
|
221
|
-
// should try to find a better way.
|
|
222
|
-
!(key === 'colorAxis' && depth === 0)) {
|
|
223
|
-
delete ret[key];
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
else if (newer[key] !== older[key] ||
|
|
227
|
-
// If the newer key is explicitly undefined, keep it (#10525)
|
|
228
|
-
(key in newer && !(key in older))) {
|
|
229
|
-
if (key !== '__proto__' && key !== 'constructor') {
|
|
230
|
-
ret[key] = keeper[key];
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
diff(newer, older, ret, 0);
|
|
236
|
-
return ret;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Shortcut for parseInt
|
|
240
|
-
*
|
|
241
|
-
* @private
|
|
242
|
-
* @function Highcharts.pInt
|
|
243
|
-
*
|
|
244
|
-
* @param {*} s
|
|
245
|
-
* any
|
|
246
|
-
*
|
|
247
|
-
* @param {number} [mag]
|
|
248
|
-
* Magnitude
|
|
249
|
-
*
|
|
250
|
-
* @return {number}
|
|
251
|
-
* number
|
|
252
|
-
*/
|
|
253
|
-
function pInt(s, mag) {
|
|
254
|
-
return parseInt(s, mag || 10);
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Utility function to check for string type.
|
|
258
|
-
*
|
|
259
|
-
* @function Highcharts.isString
|
|
260
|
-
*
|
|
261
|
-
* @param {*} s
|
|
262
|
-
* The item to check.
|
|
263
|
-
*
|
|
264
|
-
* @return {boolean}
|
|
265
|
-
* True if the argument is a string.
|
|
266
|
-
*/
|
|
267
|
-
function isString(s) {
|
|
268
|
-
return typeof s === 'string';
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Utility function to check if an item is an array.
|
|
272
|
-
*
|
|
273
|
-
* @function Highcharts.isArray
|
|
274
|
-
*
|
|
275
|
-
* @param {*} obj
|
|
276
|
-
* The item to check.
|
|
277
|
-
*
|
|
278
|
-
* @return {boolean}
|
|
279
|
-
* True if the argument is an array.
|
|
280
|
-
*/
|
|
281
|
-
function isArray(obj) {
|
|
282
|
-
const str = Object.prototype.toString.call(obj);
|
|
283
|
-
return str === '[object Array]' || str === '[object Array Iterator]';
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Utility function to check if an item is of type object.
|
|
287
|
-
*
|
|
288
|
-
* @function Highcharts.isObject
|
|
289
|
-
*
|
|
290
|
-
* @param {*} obj
|
|
291
|
-
* The item to check.
|
|
292
|
-
*
|
|
293
|
-
* @param {boolean} [strict=false]
|
|
294
|
-
* Also checks that the object is not an array.
|
|
295
|
-
*
|
|
296
|
-
* @return {boolean}
|
|
297
|
-
* True if the argument is an object.
|
|
298
|
-
*/
|
|
299
|
-
function isObject(obj, strict) {
|
|
300
|
-
return (!!obj &&
|
|
301
|
-
typeof obj === 'object' &&
|
|
302
|
-
(!strict || !isArray(obj))); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Utility function to check if an Object is a HTML Element.
|
|
306
|
-
*
|
|
307
|
-
* @function Highcharts.isDOMElement
|
|
308
|
-
*
|
|
309
|
-
* @param {*} obj
|
|
310
|
-
* The item to check.
|
|
311
|
-
*
|
|
312
|
-
* @return {boolean}
|
|
313
|
-
* True if the argument is a HTML Element.
|
|
314
|
-
*/
|
|
315
|
-
function isDOMElement(obj) {
|
|
316
|
-
return isObject(obj) && typeof obj.nodeType === 'number';
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Utility function to check if an Object is a class.
|
|
320
|
-
*
|
|
321
|
-
* @function Highcharts.isClass
|
|
322
|
-
*
|
|
323
|
-
* @param {object|undefined} obj
|
|
324
|
-
* The item to check.
|
|
325
|
-
*
|
|
326
|
-
* @return {boolean}
|
|
327
|
-
* True if the argument is a class.
|
|
328
|
-
*/
|
|
329
|
-
function isClass(obj) {
|
|
330
|
-
const c = obj?.constructor;
|
|
331
|
-
return !!(isObject(obj, true) &&
|
|
332
|
-
!isDOMElement(obj) &&
|
|
333
|
-
(c?.name && c.name !== 'Object'));
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* Utility function to check if an item is a number and it is finite (not NaN,
|
|
337
|
-
* Infinity or -Infinity).
|
|
338
|
-
*
|
|
339
|
-
* @function Highcharts.isNumber
|
|
340
|
-
*
|
|
341
|
-
* @param {*} n
|
|
342
|
-
* The item to check.
|
|
343
|
-
*
|
|
344
|
-
* @return {boolean}
|
|
345
|
-
* True if the item is a finite number
|
|
346
|
-
*/
|
|
347
|
-
function isNumber(n) {
|
|
348
|
-
return typeof n === 'number' && !isNaN(n) && n < Infinity && n > -Infinity;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Remove the last occurence of an item from an array.
|
|
352
|
-
*
|
|
353
|
-
* @function Highcharts.erase
|
|
354
|
-
*
|
|
355
|
-
* @param {Array<*>} arr
|
|
356
|
-
* The array.
|
|
357
|
-
*
|
|
358
|
-
* @param {*} item
|
|
359
|
-
* The item to remove.
|
|
360
|
-
*
|
|
361
|
-
* @return {void}
|
|
362
|
-
*/
|
|
363
|
-
function erase(arr, item) {
|
|
364
|
-
let i = arr.length;
|
|
365
|
-
while (i--) {
|
|
366
|
-
if (arr[i] === item) {
|
|
367
|
-
arr.splice(i, 1);
|
|
368
|
-
break;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
89
|
/**
|
|
373
90
|
* Insert a series or an axis in a collection with other items, either the
|
|
374
91
|
* chart series or yAxis series or axis collections, in the correct order
|
|
375
92
|
* according to the index option and whether it is internal. Used internally
|
|
376
93
|
* when adding series and axes.
|
|
377
94
|
*
|
|
378
|
-
* @
|
|
95
|
+
* @internal
|
|
379
96
|
* @function Highcharts.Chart#insertItem
|
|
380
97
|
* @param {Highcharts.Series|Highcharts.Axis} item
|
|
381
98
|
* The item to insert
|
|
@@ -383,7 +100,7 @@ function erase(arr, item) {
|
|
|
383
100
|
* A collection of items, like `chart.series` or `xAxis.series`.
|
|
384
101
|
* @return {number} The index of the series in the collection.
|
|
385
102
|
*/
|
|
386
|
-
function insertItem(item, collection) {
|
|
103
|
+
export function insertItem(item, collection) {
|
|
387
104
|
const indexOption = item.options.index, length = collection.length;
|
|
388
105
|
let i;
|
|
389
106
|
for (
|
|
@@ -405,595 +122,12 @@ function insertItem(item, collection) {
|
|
|
405
122
|
}
|
|
406
123
|
return i;
|
|
407
124
|
}
|
|
408
|
-
/**
|
|
409
|
-
* Adds an item to an array, if it is not present in the array.
|
|
410
|
-
*
|
|
411
|
-
* @function Highcharts.pushUnique
|
|
412
|
-
*
|
|
413
|
-
* @param {Array<unknown>} array
|
|
414
|
-
* The array to add the item to.
|
|
415
|
-
*
|
|
416
|
-
* @param {unknown} item
|
|
417
|
-
* The item to add.
|
|
418
|
-
*
|
|
419
|
-
* @return {boolean}
|
|
420
|
-
* Returns true, if the item was not present and has been added.
|
|
421
|
-
*/
|
|
422
|
-
function pushUnique(array, item) {
|
|
423
|
-
return array.indexOf(item) < 0 && !!array.push(item);
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Check if an object is null or undefined.
|
|
427
|
-
*
|
|
428
|
-
* @function Highcharts.defined
|
|
429
|
-
*
|
|
430
|
-
* @param {*} obj
|
|
431
|
-
* The object to check.
|
|
432
|
-
*
|
|
433
|
-
* @return {boolean}
|
|
434
|
-
* False if the object is null or undefined, otherwise true.
|
|
435
|
-
*/
|
|
436
|
-
function defined(obj) {
|
|
437
|
-
return typeof obj !== 'undefined' && obj !== null;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Set or get an attribute or an object of attributes.
|
|
441
|
-
*
|
|
442
|
-
* To use as a setter, pass a key and a value, or let the second argument be a
|
|
443
|
-
* collection of keys and values. When using a collection, passing a value of
|
|
444
|
-
* `null` or `undefined` will remove the attribute.
|
|
445
|
-
*
|
|
446
|
-
* To use as a getter, pass only a string as the second argument.
|
|
447
|
-
*
|
|
448
|
-
* @function Highcharts.attr
|
|
449
|
-
*
|
|
450
|
-
* @param {Highcharts.HTMLDOMElement|Highcharts.SVGDOMElement} elem
|
|
451
|
-
* The DOM element to receive the attribute(s).
|
|
452
|
-
*
|
|
453
|
-
* @param {string|Highcharts.HTMLAttributes|Highcharts.SVGAttributes} [keyOrAttribs]
|
|
454
|
-
* The property or an object of key-value pairs.
|
|
455
|
-
*
|
|
456
|
-
* @param {number|string} [value]
|
|
457
|
-
* The value if a single property is set.
|
|
458
|
-
*
|
|
459
|
-
* @return {string|null|undefined}
|
|
460
|
-
* When used as a getter, return the value.
|
|
461
|
-
*/
|
|
462
|
-
function attr(elem, keyOrAttribs, value) {
|
|
463
|
-
const isGetter = isString(keyOrAttribs) && !defined(value);
|
|
464
|
-
let ret;
|
|
465
|
-
const attrSingle = (value, key) => {
|
|
466
|
-
// Set the value
|
|
467
|
-
if (defined(value)) {
|
|
468
|
-
elem.setAttribute(key, value);
|
|
469
|
-
// Get the value
|
|
470
|
-
}
|
|
471
|
-
else if (isGetter) {
|
|
472
|
-
ret = elem.getAttribute(key);
|
|
473
|
-
// IE7 and below cannot get class through getAttribute (#7850)
|
|
474
|
-
if (!ret && key === 'class') {
|
|
475
|
-
ret = elem.getAttribute(key + 'Name');
|
|
476
|
-
}
|
|
477
|
-
// Remove the value
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
elem.removeAttribute(key);
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
// If keyOrAttribs is a string
|
|
484
|
-
if (isString(keyOrAttribs)) {
|
|
485
|
-
attrSingle(value, keyOrAttribs);
|
|
486
|
-
// Else if keyOrAttribs is defined, it is a hash of key/value pairs
|
|
487
|
-
}
|
|
488
|
-
else {
|
|
489
|
-
objectEach(keyOrAttribs, attrSingle);
|
|
490
|
-
}
|
|
491
|
-
return ret;
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* Check if an element is an array, and if not, make it into an array.
|
|
495
|
-
*
|
|
496
|
-
* @function Highcharts.splat
|
|
497
|
-
*
|
|
498
|
-
* @param {*} obj
|
|
499
|
-
* The object to splat.
|
|
500
|
-
*
|
|
501
|
-
* @return {Array}
|
|
502
|
-
* The produced or original array.
|
|
503
|
-
*/
|
|
504
|
-
function splat(obj) {
|
|
505
|
-
return isArray(obj) ? obj : [obj];
|
|
506
|
-
}
|
|
507
|
-
/**
|
|
508
|
-
* Set a timeout if the delay is given, otherwise perform the function
|
|
509
|
-
* synchronously.
|
|
510
|
-
*
|
|
511
|
-
* @function Highcharts.syncTimeout
|
|
512
|
-
*
|
|
513
|
-
* @param {Function} fn
|
|
514
|
-
* The function callback.
|
|
515
|
-
*
|
|
516
|
-
* @param {number} delay
|
|
517
|
-
* Delay in milliseconds.
|
|
518
|
-
*
|
|
519
|
-
* @param {*} [context]
|
|
520
|
-
* An optional context to send to the function callback.
|
|
521
|
-
*
|
|
522
|
-
* @return {number}
|
|
523
|
-
* An identifier for the timeout that can later be cleared with
|
|
524
|
-
* Highcharts.clearTimeout. Returns -1 if there is no timeout.
|
|
525
|
-
*/
|
|
526
|
-
function syncTimeout(fn, delay, context) {
|
|
527
|
-
if (delay > 0) {
|
|
528
|
-
return setTimeout(fn, delay, context);
|
|
529
|
-
}
|
|
530
|
-
fn.call(0, context);
|
|
531
|
-
return -1;
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* Internal clear timeout. The function checks that the `id` was not removed
|
|
535
|
-
* (e.g. by `chart.destroy()`). For the details see
|
|
536
|
-
* [issue #7901](https://github.com/highcharts/highcharts/issues/7901).
|
|
537
|
-
*
|
|
538
|
-
* @function Highcharts.clearTimeout
|
|
539
|
-
*
|
|
540
|
-
* @param {number|undefined} id
|
|
541
|
-
* Id of a timeout.
|
|
542
|
-
*/
|
|
543
|
-
function internalClearTimeout(id) {
|
|
544
|
-
if (defined(id)) {
|
|
545
|
-
clearTimeout(id);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
/* eslint-disable valid-jsdoc */
|
|
549
|
-
/**
|
|
550
|
-
* Utility function to extend an object with the members of another.
|
|
551
|
-
*
|
|
552
|
-
* @function Highcharts.extend<T>
|
|
553
|
-
*
|
|
554
|
-
* @param {T|undefined} a
|
|
555
|
-
* The object to be extended.
|
|
556
|
-
*
|
|
557
|
-
* @param {Partial<T>} b
|
|
558
|
-
* The object to add to the first one.
|
|
559
|
-
*
|
|
560
|
-
* @return {T}
|
|
561
|
-
* Object a, the original object.
|
|
562
|
-
*/
|
|
563
|
-
function extend(a, b) {
|
|
564
|
-
/* eslint-enable valid-jsdoc */
|
|
565
|
-
let n;
|
|
566
|
-
if (!a) {
|
|
567
|
-
a = {};
|
|
568
|
-
}
|
|
569
|
-
for (n in b) { // eslint-disable-line guard-for-in
|
|
570
|
-
a[n] = b[n];
|
|
571
|
-
}
|
|
572
|
-
return a;
|
|
573
|
-
}
|
|
574
|
-
/* eslint-disable valid-jsdoc */
|
|
575
|
-
/**
|
|
576
|
-
* Return the first value that is not null or undefined.
|
|
577
|
-
*
|
|
578
|
-
* @function Highcharts.pick<T>
|
|
579
|
-
*
|
|
580
|
-
* @param {...Array<T|null|undefined>} items
|
|
581
|
-
* Variable number of arguments to inspect.
|
|
582
|
-
*
|
|
583
|
-
* @return {T}
|
|
584
|
-
* The value of the first argument that is not null or undefined.
|
|
585
|
-
*/
|
|
586
|
-
function pick() {
|
|
587
|
-
const args = arguments;
|
|
588
|
-
const length = args.length;
|
|
589
|
-
for (let i = 0; i < length; i++) {
|
|
590
|
-
const arg = args[i];
|
|
591
|
-
if (typeof arg !== 'undefined' && arg !== null) {
|
|
592
|
-
return arg;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Set CSS on a given element.
|
|
598
|
-
*
|
|
599
|
-
* @function Highcharts.css
|
|
600
|
-
*
|
|
601
|
-
* @param {Highcharts.HTMLDOMElement|Highcharts.SVGDOMElement} el
|
|
602
|
-
* An HTML DOM element.
|
|
603
|
-
*
|
|
604
|
-
* @param {Highcharts.CSSObject} styles
|
|
605
|
-
* Style object with camel case property names.
|
|
606
|
-
*
|
|
607
|
-
* @return {void}
|
|
608
|
-
*/
|
|
609
|
-
function css(el, styles) {
|
|
610
|
-
extend(el.style, styles);
|
|
611
|
-
}
|
|
612
|
-
/**
|
|
613
|
-
* Utility function to create an HTML element with attributes and styles.
|
|
614
|
-
*
|
|
615
|
-
* @function Highcharts.createElement
|
|
616
|
-
*
|
|
617
|
-
* @param {string} tag
|
|
618
|
-
* The HTML tag.
|
|
619
|
-
*
|
|
620
|
-
* @param {Highcharts.HTMLAttributes} [attribs]
|
|
621
|
-
* Attributes as an object of key-value pairs.
|
|
622
|
-
*
|
|
623
|
-
* @param {Highcharts.CSSObject} [styles]
|
|
624
|
-
* Styles as an object of key-value pairs.
|
|
625
|
-
*
|
|
626
|
-
* @param {Highcharts.HTMLDOMElement} [parent]
|
|
627
|
-
* The parent HTML object.
|
|
628
|
-
*
|
|
629
|
-
* @param {boolean} [nopad=false]
|
|
630
|
-
* If true, remove all padding, border and margin.
|
|
631
|
-
*
|
|
632
|
-
* @return {Highcharts.HTMLDOMElement}
|
|
633
|
-
* The created DOM element.
|
|
634
|
-
*/
|
|
635
|
-
function createElement(tag, attribs, styles, parent, nopad) {
|
|
636
|
-
const el = doc.createElement(tag);
|
|
637
|
-
if (attribs) {
|
|
638
|
-
extend(el, attribs);
|
|
639
|
-
}
|
|
640
|
-
if (nopad) {
|
|
641
|
-
css(el, { padding: '0', border: 'none', margin: '0' });
|
|
642
|
-
}
|
|
643
|
-
if (styles) {
|
|
644
|
-
css(el, styles);
|
|
645
|
-
}
|
|
646
|
-
if (parent) {
|
|
647
|
-
parent.appendChild(el);
|
|
648
|
-
}
|
|
649
|
-
return el;
|
|
650
|
-
}
|
|
651
|
-
// eslint-disable-next-line valid-jsdoc
|
|
652
|
-
/**
|
|
653
|
-
* Extend a prototyped class by new members.
|
|
654
|
-
*
|
|
655
|
-
* @deprecated
|
|
656
|
-
* @function Highcharts.extendClass<T>
|
|
657
|
-
*
|
|
658
|
-
* @param {Highcharts.Class<T>} parent
|
|
659
|
-
* The parent prototype to inherit.
|
|
660
|
-
*
|
|
661
|
-
* @param {Highcharts.Dictionary<*>} members
|
|
662
|
-
* A collection of prototype members to add or override compared to the
|
|
663
|
-
* parent prototype.
|
|
664
|
-
*
|
|
665
|
-
* @return {Highcharts.Class<T>}
|
|
666
|
-
* A new prototype.
|
|
667
|
-
*/
|
|
668
|
-
function extendClass(parent, members) {
|
|
669
|
-
const obj = (function () { });
|
|
670
|
-
obj.prototype = new parent(); // eslint-disable-line new-cap
|
|
671
|
-
extend(obj.prototype, members);
|
|
672
|
-
return obj;
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
* Left-pad a string to a given length by adding a character repetitively.
|
|
676
|
-
*
|
|
677
|
-
* @function Highcharts.pad
|
|
678
|
-
*
|
|
679
|
-
* @param {number} number
|
|
680
|
-
* The input string or number.
|
|
681
|
-
*
|
|
682
|
-
* @param {number} [length]
|
|
683
|
-
* The desired string length.
|
|
684
|
-
*
|
|
685
|
-
* @param {string} [padder=0]
|
|
686
|
-
* The character to pad with.
|
|
687
|
-
*
|
|
688
|
-
* @return {string}
|
|
689
|
-
* The padded string.
|
|
690
|
-
*/
|
|
691
|
-
function pad(number, length, padder) {
|
|
692
|
-
return new Array((length || 2) +
|
|
693
|
-
1 -
|
|
694
|
-
String(number)
|
|
695
|
-
.replace('-', '')
|
|
696
|
-
.length).join(padder || '0') + number;
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* Return a length based on either the integer value, or a percentage of a base.
|
|
700
|
-
*
|
|
701
|
-
* @function Highcharts.relativeLength
|
|
702
|
-
*
|
|
703
|
-
* @param {Highcharts.RelativeSize} value
|
|
704
|
-
* A percentage string or a number.
|
|
705
|
-
*
|
|
706
|
-
* @param {number} base
|
|
707
|
-
* The full length that represents 100%.
|
|
708
|
-
*
|
|
709
|
-
* @param {number} [offset=0]
|
|
710
|
-
* A pixel offset to apply for percentage values. Used internally in
|
|
711
|
-
* axis positioning.
|
|
712
|
-
*
|
|
713
|
-
* @return {number}
|
|
714
|
-
* The computed length.
|
|
715
|
-
*/
|
|
716
|
-
function relativeLength(value, base, offset) {
|
|
717
|
-
return (/%$/).test(value) ?
|
|
718
|
-
(base * parseFloat(value) / 100) + (offset || 0) :
|
|
719
|
-
parseFloat(value);
|
|
720
|
-
}
|
|
721
|
-
/**
|
|
722
|
-
* Replaces text in a string with a given replacement in a loop to catch nested
|
|
723
|
-
* matches after previous replacements.
|
|
724
|
-
*
|
|
725
|
-
* @function Highcharts.replaceNested
|
|
726
|
-
*
|
|
727
|
-
* @param {string} text
|
|
728
|
-
* Text to search and modify.
|
|
729
|
-
*
|
|
730
|
-
* @param {...Array<(RegExp|string)>} replacements
|
|
731
|
-
* One or multiple tuples with search pattern (`[0]: (string|RegExp)`) and
|
|
732
|
-
* replacement (`[1]: string`) for matching text.
|
|
733
|
-
*
|
|
734
|
-
* @return {string}
|
|
735
|
-
* Text with replacements.
|
|
736
|
-
*/
|
|
737
|
-
function replaceNested(text, ...replacements) {
|
|
738
|
-
let previous, replacement;
|
|
739
|
-
do {
|
|
740
|
-
previous = text;
|
|
741
|
-
for (replacement of replacements) {
|
|
742
|
-
text = text.replace(replacement[0], replacement[1]);
|
|
743
|
-
}
|
|
744
|
-
} while (text !== previous);
|
|
745
|
-
return text;
|
|
746
|
-
}
|
|
747
|
-
/**
|
|
748
|
-
* Wrap a method with extended functionality, preserving the original function.
|
|
749
|
-
*
|
|
750
|
-
* @function Highcharts.wrap
|
|
751
|
-
*
|
|
752
|
-
* @param {*} obj
|
|
753
|
-
* The context object that the method belongs to. In real cases, this is
|
|
754
|
-
* often a prototype.
|
|
755
|
-
*
|
|
756
|
-
* @param {string} method
|
|
757
|
-
* The name of the method to extend.
|
|
758
|
-
*
|
|
759
|
-
* @param {Highcharts.WrapProceedFunction} func
|
|
760
|
-
* A wrapper function callback. This function is called with the same
|
|
761
|
-
* arguments as the original function, except that the original function
|
|
762
|
-
* is unshifted and passed as the first argument.
|
|
763
|
-
*/
|
|
764
|
-
function wrap(obj, method, func) {
|
|
765
|
-
const proceed = obj[method];
|
|
766
|
-
obj[method] = function () {
|
|
767
|
-
const outerArgs = arguments, scope = this;
|
|
768
|
-
return func.apply(this, [
|
|
769
|
-
function () {
|
|
770
|
-
return proceed.apply(scope, arguments.length ? arguments : outerArgs);
|
|
771
|
-
}
|
|
772
|
-
].concat([].slice.call(arguments)));
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
/**
|
|
776
|
-
* Get the magnitude of a number.
|
|
777
|
-
*
|
|
778
|
-
* @function Highcharts.getMagnitude
|
|
779
|
-
*
|
|
780
|
-
* @param {number} num
|
|
781
|
-
* The number.
|
|
782
|
-
*
|
|
783
|
-
* @return {number}
|
|
784
|
-
* The magnitude, where 1-9 are magnitude 1, 10-99 magnitude 2 etc.
|
|
785
|
-
*/
|
|
786
|
-
function getMagnitude(num) {
|
|
787
|
-
return Math.pow(10, Math.floor(Math.log(num) / Math.LN10));
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Take an interval and normalize it to multiples of round numbers.
|
|
791
|
-
*
|
|
792
|
-
* @deprecated
|
|
793
|
-
* @function Highcharts.normalizeTickInterval
|
|
794
|
-
*
|
|
795
|
-
* @param {number} interval
|
|
796
|
-
* The raw, un-rounded interval.
|
|
797
|
-
*
|
|
798
|
-
* @param {Array<*>} [multiples]
|
|
799
|
-
* Allowed multiples.
|
|
800
|
-
*
|
|
801
|
-
* @param {number} [magnitude]
|
|
802
|
-
* The magnitude of the number.
|
|
803
|
-
*
|
|
804
|
-
* @param {boolean} [allowDecimals]
|
|
805
|
-
* Whether to allow decimals.
|
|
806
|
-
*
|
|
807
|
-
* @param {boolean} [hasTickAmount]
|
|
808
|
-
* If it has tickAmount, avoid landing on tick intervals lower than
|
|
809
|
-
* original.
|
|
810
|
-
*
|
|
811
|
-
* @return {number}
|
|
812
|
-
* The normalized interval.
|
|
813
|
-
*
|
|
814
|
-
* @todo
|
|
815
|
-
* Move this function to the Axis prototype. It is here only for historical
|
|
816
|
-
* reasons.
|
|
817
|
-
*/
|
|
818
|
-
function normalizeTickInterval(interval, multiples, magnitude, allowDecimals, hasTickAmount) {
|
|
819
|
-
let i, retInterval = interval;
|
|
820
|
-
// Round to a tenfold of 1, 2, 2.5 or 5
|
|
821
|
-
magnitude = pick(magnitude, getMagnitude(interval));
|
|
822
|
-
const normalized = interval / magnitude;
|
|
823
|
-
// Multiples for a linear scale
|
|
824
|
-
if (!multiples) {
|
|
825
|
-
multiples = hasTickAmount ?
|
|
826
|
-
// Finer grained ticks when the tick amount is hard set, including
|
|
827
|
-
// when alignTicks is true on multiple axes (#4580).
|
|
828
|
-
[1, 1.2, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10] :
|
|
829
|
-
// Else, let ticks fall on rounder numbers
|
|
830
|
-
[1, 2, 2.5, 5, 10];
|
|
831
|
-
// The allowDecimals option
|
|
832
|
-
if (allowDecimals === false) {
|
|
833
|
-
if (magnitude === 1) {
|
|
834
|
-
multiples = multiples.filter(function (num) {
|
|
835
|
-
return num % 1 === 0;
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
else if (magnitude <= 0.1) {
|
|
839
|
-
multiples = [1 / magnitude];
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
// Normalize the interval to the nearest multiple
|
|
844
|
-
for (i = 0; i < multiples.length; i++) {
|
|
845
|
-
retInterval = multiples[i];
|
|
846
|
-
// Only allow tick amounts smaller than natural
|
|
847
|
-
if ((hasTickAmount &&
|
|
848
|
-
retInterval * magnitude >= interval) ||
|
|
849
|
-
(!hasTickAmount &&
|
|
850
|
-
(normalized <=
|
|
851
|
-
(multiples[i] +
|
|
852
|
-
(multiples[i + 1] || multiples[i])) / 2))) {
|
|
853
|
-
break;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
// Multiply back to the correct magnitude. Correct floats to appropriate
|
|
857
|
-
// precision (#6085).
|
|
858
|
-
retInterval = correctFloat(retInterval * magnitude, -Math.round(Math.log(0.001) / Math.LN10));
|
|
859
|
-
return retInterval;
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Sort an object array and keep the order of equal items. The ECMAScript
|
|
863
|
-
* standard does not specify the behaviour when items are equal.
|
|
864
|
-
*
|
|
865
|
-
* @function Highcharts.stableSort
|
|
866
|
-
*
|
|
867
|
-
* @param {Array<*>} arr
|
|
868
|
-
* The array to sort.
|
|
869
|
-
*
|
|
870
|
-
* @param {Function} sortFunction
|
|
871
|
-
* The function to sort it with, like with regular Array.prototype.sort.
|
|
872
|
-
*/
|
|
873
|
-
function stableSort(arr, sortFunction) {
|
|
874
|
-
// @todo It seems like Chrome since v70 sorts in a stable way internally,
|
|
875
|
-
// plus all other browsers do it, so over time we may be able to remove this
|
|
876
|
-
// function
|
|
877
|
-
const length = arr.length;
|
|
878
|
-
let sortValue, i;
|
|
879
|
-
// Add index to each item
|
|
880
|
-
for (i = 0; i < length; i++) {
|
|
881
|
-
arr[i].safeI = i; // Stable sort index
|
|
882
|
-
}
|
|
883
|
-
arr.sort(function (a, b) {
|
|
884
|
-
sortValue = sortFunction(a, b);
|
|
885
|
-
return sortValue === 0 ? a.safeI - b.safeI : sortValue;
|
|
886
|
-
});
|
|
887
|
-
// Remove index from items
|
|
888
|
-
for (i = 0; i < length; i++) {
|
|
889
|
-
delete arr[i].safeI; // Stable sort index
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* Non-recursive method to find the lowest member of an array. `Math.min` raises
|
|
894
|
-
* a maximum call stack size exceeded error in Chrome when trying to apply more
|
|
895
|
-
* than 150.000 points. This method is slightly slower, but safe.
|
|
896
|
-
*
|
|
897
|
-
* @function Highcharts.arrayMin
|
|
898
|
-
*
|
|
899
|
-
* @param {Array<*>} data
|
|
900
|
-
* An array of numbers.
|
|
901
|
-
*
|
|
902
|
-
* @return {number}
|
|
903
|
-
* The lowest number.
|
|
904
|
-
*/
|
|
905
|
-
function arrayMin(data) {
|
|
906
|
-
let i = data.length, min = data[0];
|
|
907
|
-
while (i--) {
|
|
908
|
-
if (data[i] < min) {
|
|
909
|
-
min = data[i];
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
return min;
|
|
913
|
-
}
|
|
914
|
-
/**
|
|
915
|
-
* Non-recursive method to find the lowest member of an array. `Math.max` raises
|
|
916
|
-
* a maximum call stack size exceeded error in Chrome when trying to apply more
|
|
917
|
-
* than 150.000 points. This method is slightly slower, but safe.
|
|
918
|
-
*
|
|
919
|
-
* @function Highcharts.arrayMax
|
|
920
|
-
*
|
|
921
|
-
* @param {Array<*>} data
|
|
922
|
-
* An array of numbers.
|
|
923
|
-
*
|
|
924
|
-
* @return {number}
|
|
925
|
-
* The highest number.
|
|
926
|
-
*/
|
|
927
|
-
function arrayMax(data) {
|
|
928
|
-
let i = data.length, max = data[0];
|
|
929
|
-
while (i--) {
|
|
930
|
-
if (data[i] > max) {
|
|
931
|
-
max = data[i];
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
return max;
|
|
935
|
-
}
|
|
936
|
-
/**
|
|
937
|
-
* Utility method that destroys any SVGElement instances that are properties on
|
|
938
|
-
* the given object. It loops all properties and invokes destroy if there is a
|
|
939
|
-
* destroy method. The property is then delete.
|
|
940
|
-
*
|
|
941
|
-
* @function Highcharts.destroyObjectProperties
|
|
942
|
-
*
|
|
943
|
-
* @param {*} obj
|
|
944
|
-
* The object to destroy properties on.
|
|
945
|
-
*
|
|
946
|
-
* @param {*} [except]
|
|
947
|
-
* Exception, do not destroy this property, only delete it.
|
|
948
|
-
*/
|
|
949
|
-
function destroyObjectProperties(obj, except, destructablesOnly) {
|
|
950
|
-
objectEach(obj, function (val, n) {
|
|
951
|
-
// If the object is non-null and destroy is defined
|
|
952
|
-
if (val !== except && val?.destroy) {
|
|
953
|
-
// Invoke the destroy
|
|
954
|
-
val.destroy();
|
|
955
|
-
}
|
|
956
|
-
// Delete the property from the object
|
|
957
|
-
if (val?.destroy || !destructablesOnly) {
|
|
958
|
-
delete obj[n];
|
|
959
|
-
}
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
/**
|
|
963
|
-
* Discard a HTML element
|
|
964
|
-
*
|
|
965
|
-
* @function Highcharts.discardElement
|
|
966
|
-
*
|
|
967
|
-
* @param {Highcharts.HTMLDOMElement} element
|
|
968
|
-
* The HTML node to discard.
|
|
969
|
-
*/
|
|
970
|
-
function discardElement(element) {
|
|
971
|
-
element?.parentElement?.removeChild(element);
|
|
972
|
-
}
|
|
973
|
-
/**
|
|
974
|
-
* Fix JS round off float errors.
|
|
975
|
-
*
|
|
976
|
-
* @function Highcharts.correctFloat
|
|
977
|
-
*
|
|
978
|
-
* @param {number} num
|
|
979
|
-
* A float number to fix.
|
|
980
|
-
*
|
|
981
|
-
* @param {number} [prec=14]
|
|
982
|
-
* The precision.
|
|
983
|
-
*
|
|
984
|
-
* @return {number}
|
|
985
|
-
* The corrected float number.
|
|
986
|
-
*/
|
|
987
|
-
function correctFloat(num, prec) {
|
|
988
|
-
// When the number is higher than 1e14 use the number (#16275)
|
|
989
|
-
return num > 1e14 ? num : parseFloat(num.toPrecision(prec || 14));
|
|
990
|
-
}
|
|
991
125
|
/**
|
|
992
126
|
* The time unit lookup
|
|
993
127
|
*
|
|
994
128
|
* @ignore
|
|
995
129
|
*/
|
|
996
|
-
const timeUnits = {
|
|
130
|
+
export const timeUnits = {
|
|
997
131
|
millisecond: 1,
|
|
998
132
|
second: 1000,
|
|
999
133
|
minute: 60000,
|
|
@@ -1006,482 +140,18 @@ const timeUnits = {
|
|
|
1006
140
|
/**
|
|
1007
141
|
* Easing definition
|
|
1008
142
|
*
|
|
1009
|
-
* @
|
|
143
|
+
* @internal
|
|
1010
144
|
* @function Math.easeInOutSine
|
|
1011
145
|
*
|
|
1012
146
|
* @param {number} pos
|
|
1013
|
-
*
|
|
147
|
+
* Current position, ranging from 0 to 1.
|
|
1014
148
|
*
|
|
1015
149
|
* @return {number}
|
|
1016
|
-
*
|
|
150
|
+
* Ease result
|
|
1017
151
|
*/
|
|
1018
152
|
Math.easeInOutSine = function (pos) {
|
|
1019
153
|
return -0.5 * (Math.cos(Math.PI * pos) - 1);
|
|
1020
154
|
};
|
|
1021
|
-
/**
|
|
1022
|
-
* Convenience function to get the align factor, used several places for
|
|
1023
|
-
* computing positions
|
|
1024
|
-
* @private
|
|
1025
|
-
*/
|
|
1026
|
-
const getAlignFactor = (align = '') => ({
|
|
1027
|
-
center: 0.5,
|
|
1028
|
-
right: 1,
|
|
1029
|
-
middle: 0.5,
|
|
1030
|
-
bottom: 1
|
|
1031
|
-
}[align] || 0);
|
|
1032
|
-
/**
|
|
1033
|
-
* Find the closest distance between two values of a two-dimensional array
|
|
1034
|
-
* @private
|
|
1035
|
-
* @function Highcharts.getClosestDistance
|
|
1036
|
-
*
|
|
1037
|
-
* @param {Array<Array<number>>} arrays
|
|
1038
|
-
* An array of arrays of numbers
|
|
1039
|
-
*
|
|
1040
|
-
* @return {number | undefined}
|
|
1041
|
-
* The closest distance between values
|
|
1042
|
-
*/
|
|
1043
|
-
function getClosestDistance(arrays, onError) {
|
|
1044
|
-
const allowNegative = !onError;
|
|
1045
|
-
let closest, loopLength, distance, i;
|
|
1046
|
-
arrays.forEach((xData) => {
|
|
1047
|
-
if (xData.length > 1) {
|
|
1048
|
-
loopLength = xData.length - 1;
|
|
1049
|
-
for (i = loopLength; i > 0; i--) {
|
|
1050
|
-
distance = xData[i] - xData[i - 1];
|
|
1051
|
-
if (distance < 0 && !allowNegative) {
|
|
1052
|
-
onError?.();
|
|
1053
|
-
// Only one call
|
|
1054
|
-
onError = void 0;
|
|
1055
|
-
}
|
|
1056
|
-
else if (distance && (typeof closest === 'undefined' || distance < closest)) {
|
|
1057
|
-
closest = distance;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
});
|
|
1062
|
-
return closest;
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* Returns the value of a property path on a given object.
|
|
1066
|
-
*
|
|
1067
|
-
* @private
|
|
1068
|
-
* @function getNestedProperty
|
|
1069
|
-
*
|
|
1070
|
-
* @param {string} path
|
|
1071
|
-
* Path to the property, for example `custom.myValue`.
|
|
1072
|
-
*
|
|
1073
|
-
* @param {unknown} obj
|
|
1074
|
-
* Instance containing the property on the specific path.
|
|
1075
|
-
*
|
|
1076
|
-
* @return {unknown}
|
|
1077
|
-
* The unknown property value.
|
|
1078
|
-
*/
|
|
1079
|
-
function getNestedProperty(path, parent) {
|
|
1080
|
-
const pathElements = path.split('.');
|
|
1081
|
-
while (pathElements.length && defined(parent)) {
|
|
1082
|
-
const pathElement = pathElements.shift();
|
|
1083
|
-
// Filter on the key
|
|
1084
|
-
if (typeof pathElement === 'undefined' ||
|
|
1085
|
-
pathElement === '__proto__') {
|
|
1086
|
-
return; // Undefined
|
|
1087
|
-
}
|
|
1088
|
-
if (pathElement === 'this') {
|
|
1089
|
-
let thisProp;
|
|
1090
|
-
if (isObject(parent)) {
|
|
1091
|
-
thisProp = parent['@this'];
|
|
1092
|
-
}
|
|
1093
|
-
return thisProp ?? parent;
|
|
1094
|
-
}
|
|
1095
|
-
const child = parent[pathElement.replace(/[\\'"]/g, '')];
|
|
1096
|
-
// Filter on the child
|
|
1097
|
-
if (!defined(child) ||
|
|
1098
|
-
typeof child === 'function' ||
|
|
1099
|
-
typeof child.nodeType === 'number' ||
|
|
1100
|
-
child === win) {
|
|
1101
|
-
return; // Undefined
|
|
1102
|
-
}
|
|
1103
|
-
// Else, proceed
|
|
1104
|
-
parent = child;
|
|
1105
|
-
}
|
|
1106
|
-
return parent;
|
|
1107
|
-
}
|
|
1108
|
-
/**
|
|
1109
|
-
* Get the computed CSS value for given element and property, only for numerical
|
|
1110
|
-
* properties. For width and height, the dimension of the inner box (excluding
|
|
1111
|
-
* padding) is returned. Used for fitting the chart within the container.
|
|
1112
|
-
*
|
|
1113
|
-
* @function Highcharts.getStyle
|
|
1114
|
-
*
|
|
1115
|
-
* @param {Highcharts.HTMLDOMElement} el
|
|
1116
|
-
* An HTML element.
|
|
1117
|
-
*
|
|
1118
|
-
* @param {string} prop
|
|
1119
|
-
* The property name.
|
|
1120
|
-
*
|
|
1121
|
-
* @param {boolean} [toInt=true]
|
|
1122
|
-
* Parse to integer.
|
|
1123
|
-
*
|
|
1124
|
-
* @return {number|string|undefined}
|
|
1125
|
-
* The style value.
|
|
1126
|
-
*/
|
|
1127
|
-
function getStyle(el, prop, toInt) {
|
|
1128
|
-
let style;
|
|
1129
|
-
// For width and height, return the actual inner pixel size (#4913)
|
|
1130
|
-
if (prop === 'width') {
|
|
1131
|
-
let offsetWidth = Math.min(el.offsetWidth, el.scrollWidth);
|
|
1132
|
-
// In flex boxes, we need to use getBoundingClientRect and floor it,
|
|
1133
|
-
// because scrollWidth doesn't support subpixel precision (#6427) ...
|
|
1134
|
-
const boundingClientRectWidth = el.getBoundingClientRect?.().width;
|
|
1135
|
-
// ...unless if the containing div or its parents are transform-scaled
|
|
1136
|
-
// down, in which case the boundingClientRect can't be used as it is
|
|
1137
|
-
// also scaled down (#9871, #10498).
|
|
1138
|
-
if (boundingClientRectWidth < offsetWidth &&
|
|
1139
|
-
boundingClientRectWidth >= offsetWidth - 1) {
|
|
1140
|
-
offsetWidth = Math.floor(boundingClientRectWidth);
|
|
1141
|
-
}
|
|
1142
|
-
return Math.max(0, // #8377
|
|
1143
|
-
(offsetWidth -
|
|
1144
|
-
(getStyle(el, 'padding-left', true) || 0) -
|
|
1145
|
-
(getStyle(el, 'padding-right', true) || 0)));
|
|
1146
|
-
}
|
|
1147
|
-
if (prop === 'height') {
|
|
1148
|
-
return Math.max(0, // #8377
|
|
1149
|
-
(Math.min(el.offsetHeight, el.scrollHeight) -
|
|
1150
|
-
(getStyle(el, 'padding-top', true) || 0) -
|
|
1151
|
-
(getStyle(el, 'padding-bottom', true) || 0)));
|
|
1152
|
-
}
|
|
1153
|
-
// Otherwise, get the computed style
|
|
1154
|
-
const css = win.getComputedStyle(el, void 0); // eslint-disable-line no-undefined
|
|
1155
|
-
if (css) {
|
|
1156
|
-
style = css.getPropertyValue(prop);
|
|
1157
|
-
if (pick(toInt, prop !== 'opacity')) {
|
|
1158
|
-
style = pInt(style);
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
return style;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* Return the value of the first element in the array that satisfies the
|
|
1165
|
-
* provided testing function.
|
|
1166
|
-
*
|
|
1167
|
-
* @function Highcharts.find<T>
|
|
1168
|
-
*
|
|
1169
|
-
* @param {Array<T>} arr
|
|
1170
|
-
* The array to test.
|
|
1171
|
-
*
|
|
1172
|
-
* @param {Function} callback
|
|
1173
|
-
* The callback function. The function receives the item as the first
|
|
1174
|
-
* argument. Return `true` if this item satisfies the condition.
|
|
1175
|
-
*
|
|
1176
|
-
* @return {T|undefined}
|
|
1177
|
-
* The value of the element.
|
|
1178
|
-
*/
|
|
1179
|
-
const find = Array.prototype.find ?
|
|
1180
|
-
function (arr, callback) {
|
|
1181
|
-
return arr.find(callback);
|
|
1182
|
-
} :
|
|
1183
|
-
// Legacy implementation. PhantomJS, IE <= 11 etc. #7223.
|
|
1184
|
-
function (arr, callback) {
|
|
1185
|
-
let i;
|
|
1186
|
-
const length = arr.length;
|
|
1187
|
-
for (i = 0; i < length; i++) {
|
|
1188
|
-
if (callback(arr[i], i)) { // eslint-disable-line node/callback-return
|
|
1189
|
-
return arr[i];
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
};
|
|
1193
|
-
/**
|
|
1194
|
-
* Get the element's offset position, corrected for `overflow: auto`.
|
|
1195
|
-
*
|
|
1196
|
-
* @function Highcharts.offset
|
|
1197
|
-
*
|
|
1198
|
-
* @param {global.Element} el
|
|
1199
|
-
* The DOM element.
|
|
1200
|
-
*
|
|
1201
|
-
* @return {Highcharts.OffsetObject}
|
|
1202
|
-
* An object containing `left` and `top` properties for the position in
|
|
1203
|
-
* the page.
|
|
1204
|
-
*/
|
|
1205
|
-
function offset(el) {
|
|
1206
|
-
const docElem = doc.documentElement, box = (el.parentElement || el.parentNode) ?
|
|
1207
|
-
el.getBoundingClientRect() :
|
|
1208
|
-
{ top: 0, left: 0, width: 0, height: 0 };
|
|
1209
|
-
return {
|
|
1210
|
-
top: box.top + (win.pageYOffset || docElem.scrollTop) -
|
|
1211
|
-
(docElem.clientTop || 0),
|
|
1212
|
-
left: box.left + (win.pageXOffset || docElem.scrollLeft) -
|
|
1213
|
-
(docElem.clientLeft || 0),
|
|
1214
|
-
width: box.width,
|
|
1215
|
-
height: box.height
|
|
1216
|
-
};
|
|
1217
|
-
}
|
|
1218
|
-
/* eslint-disable valid-jsdoc */
|
|
1219
|
-
/**
|
|
1220
|
-
* Iterate over object key pairs in an object.
|
|
1221
|
-
*
|
|
1222
|
-
* @function Highcharts.objectEach<T>
|
|
1223
|
-
*
|
|
1224
|
-
* @param {*} obj
|
|
1225
|
-
* The object to iterate over.
|
|
1226
|
-
*
|
|
1227
|
-
* @param {Highcharts.ObjectEachCallbackFunction<T>} fn
|
|
1228
|
-
* The iterator callback. It passes three arguments:
|
|
1229
|
-
* * value - The property value.
|
|
1230
|
-
* * key - The property key.
|
|
1231
|
-
* * obj - The object that objectEach is being applied to.
|
|
1232
|
-
*
|
|
1233
|
-
* @param {T} [ctx]
|
|
1234
|
-
* The context.
|
|
1235
|
-
*/
|
|
1236
|
-
function objectEach(obj, fn, ctx) {
|
|
1237
|
-
/* eslint-enable valid-jsdoc */
|
|
1238
|
-
for (const key in obj) {
|
|
1239
|
-
if (Object.hasOwnProperty.call(obj, key)) {
|
|
1240
|
-
fn.call(ctx || obj[key], obj[key], key, obj);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
/* eslint-disable valid-jsdoc */
|
|
1245
|
-
/**
|
|
1246
|
-
* Add an event listener.
|
|
1247
|
-
*
|
|
1248
|
-
* @function Highcharts.addEvent<T>
|
|
1249
|
-
*
|
|
1250
|
-
* @param {Highcharts.Class<T>|T} el
|
|
1251
|
-
* The element or object to add a listener to. It can be a
|
|
1252
|
-
* {@link HTMLDOMElement}, an {@link SVGElement} or any other object.
|
|
1253
|
-
*
|
|
1254
|
-
* @param {string} type
|
|
1255
|
-
* The event type.
|
|
1256
|
-
*
|
|
1257
|
-
* @param {Highcharts.EventCallbackFunction<T>|Function} fn
|
|
1258
|
-
* The function callback to execute when the event is fired.
|
|
1259
|
-
*
|
|
1260
|
-
* @param {Highcharts.EventOptionsObject} [options]
|
|
1261
|
-
* Options for adding the event.
|
|
1262
|
-
*
|
|
1263
|
-
* @sample highcharts/members/addevent
|
|
1264
|
-
* Use a general `render` event to draw shapes on a chart
|
|
1265
|
-
*
|
|
1266
|
-
* @return {Function}
|
|
1267
|
-
* A callback function to remove the added event.
|
|
1268
|
-
*/
|
|
1269
|
-
function addEvent(el, type, fn, options = {}) {
|
|
1270
|
-
/* eslint-enable valid-jsdoc */
|
|
1271
|
-
// Add hcEvents to either the prototype (in case we're running addEvent on a
|
|
1272
|
-
// class) or the instance. If hasOwnProperty('hcEvents') is false, it is
|
|
1273
|
-
// inherited down the prototype chain, in which case we need to set the
|
|
1274
|
-
// property on this instance (which may itself be a prototype).
|
|
1275
|
-
const owner = typeof el === 'function' && el.prototype || el;
|
|
1276
|
-
if (!Object.hasOwnProperty.call(owner, 'hcEvents')) {
|
|
1277
|
-
owner.hcEvents = {};
|
|
1278
|
-
}
|
|
1279
|
-
const events = owner.hcEvents;
|
|
1280
|
-
// Allow click events added to points, otherwise they will be prevented by
|
|
1281
|
-
// the TouchPointer.pinch function after a pinch zoom operation (#7091).
|
|
1282
|
-
if (H.Point && // Without H a dependency loop occurs
|
|
1283
|
-
el instanceof H.Point &&
|
|
1284
|
-
el.series &&
|
|
1285
|
-
el.series.chart) {
|
|
1286
|
-
el.series.chart.runTrackerClick = true;
|
|
1287
|
-
}
|
|
1288
|
-
// Handle DOM events
|
|
1289
|
-
// If the browser supports passive events, add it to improve performance
|
|
1290
|
-
// on touch events (#11353).
|
|
1291
|
-
const addEventListener = el.addEventListener;
|
|
1292
|
-
if (addEventListener) {
|
|
1293
|
-
addEventListener.call(el, type, fn, H.supportsPassiveEvents ? {
|
|
1294
|
-
passive: options.passive === void 0 ?
|
|
1295
|
-
type.indexOf('touch') !== -1 : options.passive,
|
|
1296
|
-
capture: false
|
|
1297
|
-
} : false);
|
|
1298
|
-
}
|
|
1299
|
-
if (!events[type]) {
|
|
1300
|
-
events[type] = [];
|
|
1301
|
-
}
|
|
1302
|
-
const eventObject = {
|
|
1303
|
-
fn,
|
|
1304
|
-
order: typeof options.order === 'number' ? options.order : Infinity
|
|
1305
|
-
};
|
|
1306
|
-
events[type].push(eventObject);
|
|
1307
|
-
// Order the calls
|
|
1308
|
-
events[type].sort((a, b) => a.order - b.order);
|
|
1309
|
-
// Return a function that can be called to remove this event.
|
|
1310
|
-
return function () {
|
|
1311
|
-
removeEvent(el, type, fn);
|
|
1312
|
-
};
|
|
1313
|
-
}
|
|
1314
|
-
/* eslint-disable valid-jsdoc */
|
|
1315
|
-
/**
|
|
1316
|
-
* Remove an event that was added with {@link Highcharts#addEvent}.
|
|
1317
|
-
*
|
|
1318
|
-
* @function Highcharts.removeEvent<T>
|
|
1319
|
-
*
|
|
1320
|
-
* @param {Highcharts.Class<T>|T} el
|
|
1321
|
-
* The element to remove events on.
|
|
1322
|
-
*
|
|
1323
|
-
* @param {string} [type]
|
|
1324
|
-
* The type of events to remove. If undefined, all events are removed
|
|
1325
|
-
* from the element.
|
|
1326
|
-
*
|
|
1327
|
-
* @param {Highcharts.EventCallbackFunction<T>} [fn]
|
|
1328
|
-
* The specific callback to remove. If undefined, all events that match
|
|
1329
|
-
* the element and optionally the type are removed.
|
|
1330
|
-
*
|
|
1331
|
-
* @return {void}
|
|
1332
|
-
*/
|
|
1333
|
-
function removeEvent(el, type, fn) {
|
|
1334
|
-
/* eslint-enable valid-jsdoc */
|
|
1335
|
-
/**
|
|
1336
|
-
* @private
|
|
1337
|
-
*/
|
|
1338
|
-
function removeOneEvent(type, fn) {
|
|
1339
|
-
const removeEventListener = el.removeEventListener;
|
|
1340
|
-
if (removeEventListener) {
|
|
1341
|
-
removeEventListener.call(el, type, fn, false);
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
/**
|
|
1345
|
-
* @private
|
|
1346
|
-
*/
|
|
1347
|
-
function removeAllEvents(eventCollection) {
|
|
1348
|
-
let types, len;
|
|
1349
|
-
if (!el.nodeName) {
|
|
1350
|
-
return; // Break on non-DOM events
|
|
1351
|
-
}
|
|
1352
|
-
if (type) {
|
|
1353
|
-
types = {};
|
|
1354
|
-
types[type] = true;
|
|
1355
|
-
}
|
|
1356
|
-
else {
|
|
1357
|
-
types = eventCollection;
|
|
1358
|
-
}
|
|
1359
|
-
objectEach(types, function (_val, n) {
|
|
1360
|
-
if (eventCollection[n]) {
|
|
1361
|
-
len = eventCollection[n].length;
|
|
1362
|
-
while (len--) {
|
|
1363
|
-
removeOneEvent(n, eventCollection[n][len].fn);
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
const owner = typeof el === 'function' && el.prototype || el;
|
|
1369
|
-
if (Object.hasOwnProperty.call(owner, 'hcEvents')) {
|
|
1370
|
-
const events = owner.hcEvents;
|
|
1371
|
-
if (type) {
|
|
1372
|
-
const typeEvents = (events[type] || []);
|
|
1373
|
-
if (fn) {
|
|
1374
|
-
events[type] = typeEvents.filter(function (obj) {
|
|
1375
|
-
return fn !== obj.fn;
|
|
1376
|
-
});
|
|
1377
|
-
removeOneEvent(type, fn);
|
|
1378
|
-
}
|
|
1379
|
-
else {
|
|
1380
|
-
removeAllEvents(events);
|
|
1381
|
-
events[type] = [];
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
else {
|
|
1385
|
-
removeAllEvents(events);
|
|
1386
|
-
delete owner.hcEvents;
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
/* eslint-disable valid-jsdoc */
|
|
1391
|
-
/**
|
|
1392
|
-
* Fire an event that was registered with {@link Highcharts#addEvent}.
|
|
1393
|
-
*
|
|
1394
|
-
* @function Highcharts.fireEvent<T>
|
|
1395
|
-
*
|
|
1396
|
-
* @param {T} el
|
|
1397
|
-
* The object to fire the event on. It can be a {@link HTMLDOMElement},
|
|
1398
|
-
* an {@link SVGElement} or any other object.
|
|
1399
|
-
*
|
|
1400
|
-
* @param {string} type
|
|
1401
|
-
* The type of event.
|
|
1402
|
-
*
|
|
1403
|
-
* @param {Highcharts.Dictionary<*>|Event} [eventArguments]
|
|
1404
|
-
* Custom event arguments that are passed on as an argument to the event
|
|
1405
|
-
* handler.
|
|
1406
|
-
*
|
|
1407
|
-
* @param {Highcharts.EventCallbackFunction<T>|Function} [defaultFunction]
|
|
1408
|
-
* The default function to execute if the other listeners haven't
|
|
1409
|
-
* returned false.
|
|
1410
|
-
*
|
|
1411
|
-
* @return {void}
|
|
1412
|
-
*/
|
|
1413
|
-
function fireEvent(el, type, eventArguments, defaultFunction) {
|
|
1414
|
-
/* eslint-enable valid-jsdoc */
|
|
1415
|
-
eventArguments = eventArguments || {};
|
|
1416
|
-
if (doc?.createEvent &&
|
|
1417
|
-
(el.dispatchEvent ||
|
|
1418
|
-
(el.fireEvent &&
|
|
1419
|
-
// Enable firing events on Highcharts instance.
|
|
1420
|
-
el !== H))) {
|
|
1421
|
-
const e = doc.createEvent('Events');
|
|
1422
|
-
e.initEvent(type, true, true);
|
|
1423
|
-
eventArguments = extend(e, eventArguments);
|
|
1424
|
-
if (el.dispatchEvent) {
|
|
1425
|
-
el.dispatchEvent(eventArguments);
|
|
1426
|
-
}
|
|
1427
|
-
else {
|
|
1428
|
-
el.fireEvent(type, eventArguments);
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
else if (el.hcEvents) {
|
|
1432
|
-
if (!eventArguments.target) {
|
|
1433
|
-
// We're running a custom event
|
|
1434
|
-
extend(eventArguments, {
|
|
1435
|
-
// Attach a simple preventDefault function to skip
|
|
1436
|
-
// default handler if called. The built-in
|
|
1437
|
-
// defaultPrevented property is not overwritable (#5112)
|
|
1438
|
-
preventDefault: function () {
|
|
1439
|
-
eventArguments.defaultPrevented = true;
|
|
1440
|
-
},
|
|
1441
|
-
// Setting target to native events fails with clicking
|
|
1442
|
-
// the zoom-out button in Chrome.
|
|
1443
|
-
target: el,
|
|
1444
|
-
// If the type is not set, we're running a custom event
|
|
1445
|
-
// (#2297). If it is set, we're running a browser event.
|
|
1446
|
-
type: type
|
|
1447
|
-
});
|
|
1448
|
-
}
|
|
1449
|
-
const events = [];
|
|
1450
|
-
let object = el;
|
|
1451
|
-
let multilevel = false;
|
|
1452
|
-
// Recurse up the inheritance chain and collect hcEvents set as own
|
|
1453
|
-
// objects on the prototypes.
|
|
1454
|
-
while (object.hcEvents) {
|
|
1455
|
-
if (Object.hasOwnProperty.call(object, 'hcEvents') &&
|
|
1456
|
-
object.hcEvents[type]) {
|
|
1457
|
-
if (events.length) {
|
|
1458
|
-
multilevel = true;
|
|
1459
|
-
}
|
|
1460
|
-
events.unshift.apply(events, object.hcEvents[type]);
|
|
1461
|
-
}
|
|
1462
|
-
object = Object.getPrototypeOf(object);
|
|
1463
|
-
}
|
|
1464
|
-
// For performance reasons, only sort the event handlers in case we are
|
|
1465
|
-
// dealing with multiple levels in the prototype chain. Otherwise, the
|
|
1466
|
-
// events are already sorted in the addEvent function.
|
|
1467
|
-
if (multilevel) {
|
|
1468
|
-
// Order the calls
|
|
1469
|
-
events.sort((a, b) => a.order - b.order);
|
|
1470
|
-
}
|
|
1471
|
-
// Call the collected event handlers
|
|
1472
|
-
events.forEach((obj) => {
|
|
1473
|
-
// If the event handler returns false, prevent the default handler
|
|
1474
|
-
// from executing
|
|
1475
|
-
if (obj.fn.call(el, eventArguments) === false) {
|
|
1476
|
-
eventArguments.preventDefault();
|
|
1477
|
-
}
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
// Run the default if not prevented
|
|
1481
|
-
if (defaultFunction && !eventArguments.defaultPrevented) {
|
|
1482
|
-
defaultFunction.call(el, eventArguments);
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
155
|
let serialMode;
|
|
1486
156
|
/**
|
|
1487
157
|
* Get a unique key for using in internal element id's and pointers. The key is
|
|
@@ -1496,7 +166,7 @@ let serialMode;
|
|
|
1496
166
|
* @return {string}
|
|
1497
167
|
* A unique key.
|
|
1498
168
|
*/
|
|
1499
|
-
const uniqueKey = (function () {
|
|
169
|
+
export const uniqueKey = (function () {
|
|
1500
170
|
const hash = Math.random().toString(36).substring(2, 9) + '-';
|
|
1501
171
|
let id = 0;
|
|
1502
172
|
return function () {
|
|
@@ -1527,17 +197,9 @@ const uniqueKey = (function () {
|
|
|
1527
197
|
* @return {boolean|undefined}
|
|
1528
198
|
* State of the serial mode.
|
|
1529
199
|
*/
|
|
1530
|
-
function useSerialIds(mode) {
|
|
200
|
+
export function useSerialIds(mode) {
|
|
1531
201
|
return (serialMode = pick(mode, serialMode));
|
|
1532
202
|
}
|
|
1533
|
-
function isFunction(obj) {
|
|
1534
|
-
return typeof obj === 'function';
|
|
1535
|
-
}
|
|
1536
|
-
function ucfirst(s) {
|
|
1537
|
-
return ((isString(s) ?
|
|
1538
|
-
s.substring(0, 1).toUpperCase() + s.substring(1) :
|
|
1539
|
-
String(s)));
|
|
1540
|
-
}
|
|
1541
203
|
/* *
|
|
1542
204
|
*
|
|
1543
205
|
* External
|
|
@@ -1595,101 +257,11 @@ if (win.jQuery) {
|
|
|
1595
257
|
}
|
|
1596
258
|
};
|
|
1597
259
|
}
|
|
1598
|
-
/* *
|
|
1599
|
-
*
|
|
1600
|
-
* Default Export
|
|
1601
|
-
*
|
|
1602
|
-
* */
|
|
1603
|
-
// TODO use named exports when supported.
|
|
1604
|
-
const Utilities = {
|
|
1605
|
-
addEvent,
|
|
1606
|
-
arrayMax,
|
|
1607
|
-
arrayMin,
|
|
1608
|
-
attr,
|
|
1609
|
-
clamp,
|
|
1610
|
-
clearTimeout: internalClearTimeout,
|
|
1611
|
-
correctFloat,
|
|
1612
|
-
createElement,
|
|
1613
|
-
crisp,
|
|
1614
|
-
css,
|
|
1615
|
-
defined,
|
|
1616
|
-
destroyObjectProperties,
|
|
1617
|
-
diffObjects,
|
|
1618
|
-
discardElement,
|
|
1619
|
-
erase,
|
|
1620
|
-
error,
|
|
1621
|
-
extend,
|
|
1622
|
-
extendClass,
|
|
1623
|
-
find,
|
|
1624
|
-
fireEvent,
|
|
1625
|
-
getAlignFactor,
|
|
1626
|
-
getClosestDistance,
|
|
1627
|
-
getMagnitude,
|
|
1628
|
-
getNestedProperty,
|
|
1629
|
-
getStyle,
|
|
1630
|
-
insertItem,
|
|
1631
|
-
isArray,
|
|
1632
|
-
isClass,
|
|
1633
|
-
isDOMElement,
|
|
1634
|
-
isFunction,
|
|
1635
|
-
isNumber,
|
|
1636
|
-
isObject,
|
|
1637
|
-
isString,
|
|
1638
|
-
merge,
|
|
1639
|
-
normalizeTickInterval,
|
|
1640
|
-
objectEach,
|
|
1641
|
-
offset,
|
|
1642
|
-
pad,
|
|
1643
|
-
pick,
|
|
1644
|
-
pInt,
|
|
1645
|
-
pushUnique,
|
|
1646
|
-
relativeLength,
|
|
1647
|
-
removeEvent,
|
|
1648
|
-
replaceNested,
|
|
1649
|
-
splat,
|
|
1650
|
-
stableSort,
|
|
1651
|
-
syncTimeout,
|
|
1652
|
-
timeUnits,
|
|
1653
|
-
ucfirst,
|
|
1654
|
-
uniqueKey,
|
|
1655
|
-
useSerialIds,
|
|
1656
|
-
wrap
|
|
1657
|
-
};
|
|
1658
|
-
export default Utilities;
|
|
1659
260
|
/* *
|
|
1660
261
|
*
|
|
1661
262
|
* API Declarations
|
|
1662
263
|
*
|
|
1663
264
|
* */
|
|
1664
|
-
/**
|
|
1665
|
-
* An animation configuration. Animation configurations can also be defined as
|
|
1666
|
-
* booleans, where `false` turns off animation and `true` defaults to a duration
|
|
1667
|
-
* of 500ms and defer of 0ms.
|
|
1668
|
-
*
|
|
1669
|
-
* @interface Highcharts.AnimationOptionsObject
|
|
1670
|
-
*/ /**
|
|
1671
|
-
* A callback function to execute when the animation finishes.
|
|
1672
|
-
* @name Highcharts.AnimationOptionsObject#complete
|
|
1673
|
-
* @type {Function|undefined}
|
|
1674
|
-
*/ /**
|
|
1675
|
-
* The animation defer in milliseconds.
|
|
1676
|
-
* @name Highcharts.AnimationOptionsObject#defer
|
|
1677
|
-
* @type {number|undefined}
|
|
1678
|
-
*/ /**
|
|
1679
|
-
* The animation duration in milliseconds.
|
|
1680
|
-
* @name Highcharts.AnimationOptionsObject#duration
|
|
1681
|
-
* @type {number|undefined}
|
|
1682
|
-
*/ /**
|
|
1683
|
-
* The name of an easing function as defined on the `Math` object.
|
|
1684
|
-
* @name Highcharts.AnimationOptionsObject#easing
|
|
1685
|
-
* @type {string|Function|undefined}
|
|
1686
|
-
*/ /**
|
|
1687
|
-
* A callback function to execute on each step of each attribute or CSS property
|
|
1688
|
-
* that's being animated. The first argument contains information about the
|
|
1689
|
-
* animation and progress.
|
|
1690
|
-
* @name Highcharts.AnimationOptionsObject#step
|
|
1691
|
-
* @type {Function|undefined}
|
|
1692
|
-
*/
|
|
1693
265
|
/**
|
|
1694
266
|
* Creates a frame for the animated SVG element.
|
|
1695
267
|
*
|
|
@@ -1850,6 +422,9 @@ export default Utilities;
|
|
|
1850
422
|
* @name Highcharts.Dictionary<T>#[key:string]
|
|
1851
423
|
* @type {T}
|
|
1852
424
|
*/
|
|
425
|
+
/**
|
|
426
|
+
* @typedef {Highcharts.HTMLDOMElement|Highcharts.SVGDOMElement} Highcharts.DOMElementType
|
|
427
|
+
*/
|
|
1853
428
|
/**
|
|
1854
429
|
* The function callback to execute when the event is fired. The `this` context
|
|
1855
430
|
* contains the instance, that fired the event.
|
|
@@ -1861,6 +436,11 @@ export default Utilities;
|
|
|
1861
436
|
* @param {Highcharts.Dictionary<*>|Event} [eventArguments]
|
|
1862
437
|
* Event arguments.
|
|
1863
438
|
*
|
|
439
|
+
* @param {T} [ctx]
|
|
440
|
+
* Since v12.5.0, the callback context is passed as the last argument,
|
|
441
|
+
* so arrow functions can access the same context as regular functions
|
|
442
|
+
* using `this`.
|
|
443
|
+
*
|
|
1864
444
|
* @return {boolean|void}
|
|
1865
445
|
*/
|
|
1866
446
|
/**
|
|
@@ -1889,6 +469,11 @@ export default Utilities;
|
|
|
1889
469
|
* @param {T} this
|
|
1890
470
|
* Context to format
|
|
1891
471
|
*
|
|
472
|
+
* @param {T} [ctx]
|
|
473
|
+
* Since v12.5.0, the callback context is passed as an extra argument,
|
|
474
|
+
* so arrow functions can access the same context as regular functions
|
|
475
|
+
* using `this`.
|
|
476
|
+
*
|
|
1892
477
|
* @return {string}
|
|
1893
478
|
* Formatted text
|
|
1894
479
|
*/
|