@highcharts/grid-pro 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/css/grid-pro.css +1756 -0
- package/es-modules/Accessibility/A11yI18n.d.ts +95 -0
- package/es-modules/Accessibility/A11yI18n.js +290 -0
- package/es-modules/Accessibility/Accessibility.d.ts +116 -0
- package/es-modules/Accessibility/Accessibility.js +402 -0
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +97 -0
- package/es-modules/Accessibility/AccessibilityComponent.js +147 -0
- package/es-modules/Accessibility/Components/AnnotationsA11y.d.ts +43 -0
- package/es-modules/Accessibility/Components/AnnotationsA11y.js +160 -0
- package/es-modules/Accessibility/Components/ContainerComponent.d.ts +48 -0
- package/es-modules/Accessibility/Components/ContainerComponent.js +142 -0
- package/es-modules/Accessibility/Components/InfoRegionsComponent.d.ts +144 -0
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +555 -0
- package/es-modules/Accessibility/Components/LegendComponent.d.ts +124 -0
- package/es-modules/Accessibility/Components/LegendComponent.js +474 -0
- package/es-modules/Accessibility/Components/MenuComponent.d.ts +93 -0
- package/es-modules/Accessibility/Components/MenuComponent.js +430 -0
- package/es-modules/Accessibility/Components/NavigatorComponent.d.ts +57 -0
- package/es-modules/Accessibility/Components/NavigatorComponent.js +235 -0
- package/es-modules/Accessibility/Components/RangeSelectorComponent.d.ts +126 -0
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +473 -0
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.d.ts +18 -0
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +234 -0
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.d.ts +87 -0
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +309 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.d.ts +53 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +130 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.d.ts +28 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +415 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.d.ts +114 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +721 -0
- package/es-modules/Accessibility/Components/ZoomComponent.d.ts +96 -0
- package/es-modules/Accessibility/Components/ZoomComponent.js +314 -0
- package/es-modules/Accessibility/FocusBorder.d.ts +40 -0
- package/es-modules/Accessibility/FocusBorder.js +301 -0
- package/es-modules/Accessibility/HighContrastMode.d.ts +35 -0
- package/es-modules/Accessibility/HighContrastMode.js +100 -0
- package/es-modules/Accessibility/HighContrastTheme.d.ts +11 -0
- package/es-modules/Accessibility/HighContrastTheme.js +212 -0
- package/es-modules/Accessibility/KeyboardNavigation.d.ts +133 -0
- package/es-modules/Accessibility/KeyboardNavigation.js +450 -0
- package/es-modules/Accessibility/KeyboardNavigationHandler.d.ts +48 -0
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +126 -0
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +68 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +971 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +22 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +265 -0
- package/es-modules/Accessibility/Options/LangDefaults.d.ts +4 -0
- package/es-modules/Accessibility/Options/LangDefaults.js +440 -0
- package/es-modules/Accessibility/ProxyElement.d.ts +78 -0
- package/es-modules/Accessibility/ProxyElement.js +223 -0
- package/es-modules/Accessibility/ProxyProvider.d.ts +90 -0
- package/es-modules/Accessibility/ProxyProvider.js +315 -0
- package/es-modules/Accessibility/Utils/Announcer.d.ts +26 -0
- package/es-modules/Accessibility/Utils/Announcer.js +90 -0
- package/es-modules/Accessibility/Utils/ChartUtilities.d.ts +90 -0
- package/es-modules/Accessibility/Utils/ChartUtilities.js +298 -0
- package/es-modules/Accessibility/Utils/DOMElementProvider.d.ts +20 -0
- package/es-modules/Accessibility/Utils/DOMElementProvider.js +69 -0
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +26 -0
- package/es-modules/Accessibility/Utils/EventProvider.js +65 -0
- package/es-modules/Accessibility/Utils/HTMLUtilities.d.ts +108 -0
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +319 -0
- package/es-modules/Core/Animation/AnimationUtilities.d.ts +107 -0
- package/es-modules/Core/Animation/AnimationUtilities.js +200 -0
- package/es-modules/Core/Animation/Fx.d.ts +130 -0
- package/es-modules/Core/Animation/Fx.js +388 -0
- package/es-modules/Core/Chart/Chart.d.ts +1009 -0
- package/es-modules/Core/Chart/Chart.js +3008 -0
- package/es-modules/Core/Chart/Chart3D.d.ts +276 -0
- package/es-modules/Core/Chart/Chart3D.js +1686 -0
- package/es-modules/Core/Chart/ChartDefaults.d.ts +8 -0
- package/es-modules/Core/Chart/ChartDefaults.js +1304 -0
- package/es-modules/Core/Chart/ChartNavigationComposition.d.ts +55 -0
- package/es-modules/Core/Chart/ChartNavigationComposition.js +90 -0
- package/es-modules/Core/Chart/GanttChart.d.ts +74 -0
- package/es-modules/Core/Chart/GanttChart.js +189 -0
- package/es-modules/Core/Chart/MapChart.d.ts +132 -0
- package/es-modules/Core/Chart/MapChart.js +232 -0
- package/es-modules/Core/Chart/StockChart.d.ts +117 -0
- package/es-modules/Core/Chart/StockChart.js +641 -0
- package/es-modules/Core/Color/Color.d.ts +112 -0
- package/es-modules/Core/Color/Color.js +418 -0
- package/es-modules/Core/Color/Palettes.d.ts +84 -0
- package/es-modules/Core/Color/Palettes.js +23 -0
- package/es-modules/Core/Defaults.d.ts +42 -0
- package/es-modules/Core/Defaults.js +2977 -0
- package/es-modules/Core/Foundation.d.ts +19 -0
- package/es-modules/Core/Foundation.js +63 -0
- package/es-modules/Core/Geometry/CircleUtilities.d.ts +189 -0
- package/es-modules/Core/Geometry/CircleUtilities.js +388 -0
- package/es-modules/Core/Geometry/GeometryUtilities.d.ts +48 -0
- package/es-modules/Core/Geometry/GeometryUtilities.js +105 -0
- package/es-modules/Core/Geometry/PolygonClip.d.ts +19 -0
- package/es-modules/Core/Geometry/PolygonClip.js +96 -0
- package/es-modules/Core/Globals.d.ts +110 -0
- package/es-modules/Core/Globals.js +127 -0
- package/es-modules/Core/HttpUtilities.d.ts +61 -0
- package/es-modules/Core/HttpUtilities.js +214 -0
- package/es-modules/Core/MSPointer.d.ts +74 -0
- package/es-modules/Core/MSPointer.js +218 -0
- package/es-modules/Core/Math3D.d.ts +117 -0
- package/es-modules/Core/Math3D.js +250 -0
- package/es-modules/Core/Pointer.d.ts +590 -0
- package/es-modules/Core/Pointer.js +1631 -0
- package/es-modules/Core/Renderer/HTML/AST.d.ts +163 -0
- package/es-modules/Core/Renderer/HTML/AST.js +562 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.d.ts +76 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +471 -0
- package/es-modules/Core/Renderer/RendererRegistry.d.ts +29 -0
- package/es-modules/Core/Renderer/RendererRegistry.js +76 -0
- package/es-modules/Core/Renderer/RendererUtilities.d.ts +26 -0
- package/es-modules/Core/Renderer/RendererUtilities.js +172 -0
- package/es-modules/Core/Responsive.d.ts +55 -0
- package/es-modules/Core/Responsive.js +260 -0
- package/es-modules/Core/Templating.d.ts +125 -0
- package/es-modules/Core/Templating.js +428 -0
- package/es-modules/Core/Time.d.ts +69 -0
- package/es-modules/Core/Time.js +172 -0
- package/es-modules/Core/Tooltip.d.ts +297 -0
- package/es-modules/Core/Tooltip.js +1377 -0
- package/es-modules/Core/Utilities.d.ts +770 -0
- package/es-modules/Core/Utilities.js +1989 -0
- package/es-modules/Data/ColumnUtils.d.ts +87 -0
- package/es-modules/Data/ColumnUtils.js +140 -0
- package/es-modules/Data/Connectors/CSVConnector.d.ts +63 -0
- package/es-modules/Data/Connectors/CSVConnector.js +149 -0
- package/es-modules/Data/Connectors/CSVConnectorOptions.d.ts +149 -0
- package/es-modules/Data/Connectors/DataConnector.d.ts +204 -0
- package/es-modules/Data/Connectors/DataConnector.js +345 -0
- package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +87 -0
- package/es-modules/Data/Connectors/DataConnectorType.d.ts +45 -0
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +65 -0
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +226 -0
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +167 -0
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +77 -0
- package/es-modules/Data/Connectors/HTMLTableConnector.js +119 -0
- package/es-modules/Data/Connectors/HTMLTableConnectorOptions.d.ts +49 -0
- package/es-modules/Data/Connectors/JSONConnector.d.ts +64 -0
- package/es-modules/Data/Connectors/JSONConnector.js +156 -0
- package/es-modules/Data/Connectors/JSONConnectorOptions.d.ts +185 -0
- package/es-modules/Data/Converters/CSVConverter.d.ts +64 -0
- package/es-modules/Data/Converters/CSVConverter.js +374 -0
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +53 -0
- package/es-modules/Data/Converters/DataConverter.d.ts +168 -0
- package/es-modules/Data/Converters/DataConverter.js +387 -0
- package/es-modules/Data/Converters/DataConverterType.d.ts +40 -0
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +82 -0
- package/es-modules/Data/Converters/DataConverterUtils.js +216 -0
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +46 -0
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +135 -0
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +52 -0
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +72 -0
- package/es-modules/Data/Converters/HTMLTableConverter.js +362 -0
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +51 -0
- package/es-modules/Data/Converters/JSONConverter.d.ts +99 -0
- package/es-modules/Data/Converters/JSONConverter.js +239 -0
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +52 -0
- package/es-modules/Data/DataCursor.d.ts +176 -0
- package/es-modules/Data/DataCursor.js +379 -0
- package/es-modules/Data/DataEvent.d.ts +81 -0
- package/es-modules/Data/DataEvent.js +14 -0
- package/es-modules/Data/DataPool.d.ts +130 -0
- package/es-modules/Data/DataPool.js +257 -0
- package/es-modules/Data/DataPoolOptions.d.ts +66 -0
- package/es-modules/Data/DataTable.d.ts +563 -0
- package/es-modules/Data/DataTable.js +930 -0
- package/es-modules/Data/DataTableCore.d.ts +165 -0
- package/es-modules/Data/DataTableCore.js +316 -0
- package/es-modules/Data/DataTableOptions.d.ts +25 -0
- package/es-modules/Data/DataTableOptions.js +15 -0
- package/es-modules/Data/Formula/Formula.d.ts +21 -0
- package/es-modules/Data/Formula/Formula.js +54 -0
- package/es-modules/Data/Formula/FormulaParser.d.ts +31 -0
- package/es-modules/Data/Formula/FormulaParser.js +488 -0
- package/es-modules/Data/Formula/FormulaProcessor.d.ts +155 -0
- package/es-modules/Data/Formula/FormulaProcessor.js +529 -0
- package/es-modules/Data/Formula/FormulaTypes.d.ts +138 -0
- package/es-modules/Data/Formula/FormulaTypes.js +135 -0
- package/es-modules/Data/Formula/Functions/ABS.d.ts +19 -0
- package/es-modules/Data/Formula/Functions/ABS.js +67 -0
- package/es-modules/Data/Formula/Functions/AND.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/AND.js +59 -0
- package/es-modules/Data/Formula/Functions/AVERAGE.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/AVERAGE.js +74 -0
- package/es-modules/Data/Formula/Functions/AVERAGEA.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/AVERAGEA.js +90 -0
- package/es-modules/Data/Formula/Functions/COUNT.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/COUNT.js +65 -0
- package/es-modules/Data/Formula/Functions/COUNTA.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/COUNTA.js +71 -0
- package/es-modules/Data/Formula/Functions/IF.d.ts +21 -0
- package/es-modules/Data/Formula/Functions/IF.js +54 -0
- package/es-modules/Data/Formula/Functions/ISNA.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/ISNA.js +52 -0
- package/es-modules/Data/Formula/Functions/MAX.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MAX.js +69 -0
- package/es-modules/Data/Formula/Functions/MEDIAN.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MEDIAN.js +78 -0
- package/es-modules/Data/Formula/Functions/MIN.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MIN.js +69 -0
- package/es-modules/Data/Formula/Functions/MOD.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MOD.js +63 -0
- package/es-modules/Data/Formula/Functions/MODE.d.ts +41 -0
- package/es-modules/Data/Formula/Functions/MODE.js +149 -0
- package/es-modules/Data/Formula/Functions/NOT.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/NOT.js +60 -0
- package/es-modules/Data/Formula/Functions/OR.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/OR.js +62 -0
- package/es-modules/Data/Formula/Functions/PRODUCT.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/PRODUCT.js +68 -0
- package/es-modules/Data/Formula/Functions/SUM.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/SUM.js +65 -0
- package/es-modules/Data/Formula/Functions/XOR.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/XOR.js +81 -0
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +128 -0
- package/es-modules/Data/Modifiers/ChainModifier.js +231 -0
- package/es-modules/Data/Modifiers/ChainModifierOptions.d.ts +20 -0
- package/es-modules/Data/Modifiers/ChainModifierOptions.js +14 -0
- package/es-modules/Data/Modifiers/DataModifier.d.ts +117 -0
- package/es-modules/Data/Modifiers/DataModifier.js +202 -0
- package/es-modules/Data/Modifiers/DataModifierEvent.d.ts +28 -0
- package/es-modules/Data/Modifiers/DataModifierEvent.js +15 -0
- package/es-modules/Data/Modifiers/DataModifierOptions.d.ts +11 -0
- package/es-modules/Data/Modifiers/DataModifierOptions.js +15 -0
- package/es-modules/Data/Modifiers/DataModifierType.d.ts +44 -0
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +53 -0
- package/es-modules/Data/Modifiers/FilterModifier.js +172 -0
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +110 -0
- package/es-modules/Data/Modifiers/FilterModifierOptions.js +14 -0
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +48 -0
- package/es-modules/Data/Modifiers/InvertModifier.js +116 -0
- package/es-modules/Data/Modifiers/InvertModifierOptions.d.ts +11 -0
- package/es-modules/Data/Modifiers/InvertModifierOptions.js +15 -0
- package/es-modules/Data/Modifiers/MathModifier.d.ts +68 -0
- package/es-modules/Data/Modifiers/MathModifier.js +165 -0
- package/es-modules/Data/Modifiers/MathModifierOptions.d.ts +50 -0
- package/es-modules/Data/Modifiers/MathModifierOptions.js +14 -0
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +46 -0
- package/es-modules/Data/Modifiers/RangeModifier.js +96 -0
- package/es-modules/Data/Modifiers/RangeModifierOptions.d.ts +22 -0
- package/es-modules/Data/Modifiers/RangeModifierOptions.js +15 -0
- package/es-modules/Data/Modifiers/SortModifier.d.ts +54 -0
- package/es-modules/Data/Modifiers/SortModifier.js +144 -0
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +44 -0
- package/es-modules/Data/Modifiers/SortModifierOptions.js +14 -0
- package/es-modules/Grid/Core/Accessibility/A11yOptions.d.ts +148 -0
- package/es-modules/Grid/Core/Accessibility/A11yOptions.js +17 -0
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +115 -0
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +231 -0
- package/es-modules/Grid/Core/Credits.d.ts +57 -0
- package/es-modules/Grid/Core/Credits.js +125 -0
- package/es-modules/Grid/Core/Defaults.d.ts +20 -0
- package/es-modules/Grid/Core/Defaults.js +148 -0
- package/es-modules/Grid/Core/Globals.d.ts +103 -0
- package/es-modules/Grid/Core/Globals.js +134 -0
- package/es-modules/Grid/Core/Grid.d.ts +295 -0
- package/es-modules/Grid/Core/Grid.js +730 -0
- package/es-modules/Grid/Core/GridUtils.d.ts +110 -0
- package/es-modules/Grid/Core/GridUtils.js +191 -0
- package/es-modules/Grid/Core/Options.d.ts +599 -0
- package/es-modules/Grid/Core/Options.js +16 -0
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +7 -0
- package/es-modules/Grid/Core/Pagination/Icons.js +7 -0
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +278 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +842 -0
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +228 -0
- package/es-modules/Grid/Core/Querying/FilteringController.d.ts +66 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +256 -0
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +50 -0
- package/es-modules/Grid/Core/Querying/PaginationController.js +101 -0
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +58 -0
- package/es-modules/Grid/Core/Querying/QueryingController.js +127 -0
- package/es-modules/Grid/Core/Querying/SortingController.d.ts +67 -0
- package/es-modules/Grid/Core/Querying/SortingController.js +136 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.d.ts +114 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +351 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +14 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +86 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +19 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +80 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.d.ts +52 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.js +81 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +56 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +170 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.d.ts +55 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +182 -0
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +87 -0
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +346 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +88 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.js +231 -0
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +79 -0
- package/es-modules/Grid/Core/Table/Body/TableRow.js +177 -0
- package/es-modules/Grid/Core/Table/Cell.d.ts +92 -0
- package/es-modules/Grid/Core/Table/Cell.js +223 -0
- package/es-modules/Grid/Core/Table/CellContent/CellContent.d.ts +30 -0
- package/es-modules/Grid/Core/Table/CellContent/CellContent.js +40 -0
- package/es-modules/Grid/Core/Table/CellContent/TextContent.d.ts +19 -0
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +98 -0
- package/es-modules/Grid/Core/Table/Column.d.ts +136 -0
- package/es-modules/Grid/Core/Table/Column.js +230 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.d.ts +7 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +62 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.d.ts +32 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +68 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.d.ts +7 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +53 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.d.ts +7 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +63 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.d.ts +92 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +194 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +68 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +187 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.d.ts +29 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +77 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.d.ts +13 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +79 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +71 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuPopup.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuPopup.js +66 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.d.ts +25 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +65 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +81 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +80 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +81 -0
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +70 -0
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +225 -0
- package/es-modules/Grid/Core/Table/Header/HeaderRow.d.ts +53 -0
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +182 -0
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +65 -0
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +159 -0
- package/es-modules/Grid/Core/Table/Row.d.ts +76 -0
- package/es-modules/Grid/Core/Table/Row.js +131 -0
- package/es-modules/Grid/Core/Table/Table.d.ts +181 -0
- package/es-modules/Grid/Core/Table/Table.js +399 -0
- package/es-modules/Grid/Core/UI/Button.d.ts +31 -0
- package/es-modules/Grid/Core/UI/Button.js +16 -0
- package/es-modules/Grid/Core/UI/ContextMenu.d.ts +38 -0
- package/es-modules/Grid/Core/UI/ContextMenu.js +132 -0
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +126 -0
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +183 -0
- package/es-modules/Grid/Core/UI/Popup.d.ts +149 -0
- package/es-modules/Grid/Core/UI/Popup.js +271 -0
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +53 -0
- package/es-modules/Grid/Core/UI/SvgIcons.js +158 -0
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +16 -0
- package/es-modules/Grid/Core/UI/Toolbar.js +16 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +135 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.js +191 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +112 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditing.d.ts +80 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +211 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.d.ts +123 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +198 -0
- package/es-modules/Grid/Pro/CellRendering/CellContentPro.d.ts +23 -0
- package/es-modules/Grid/Pro/CellRendering/CellContentPro.js +45 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.d.ts +50 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +41 -0
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.d.ts +18 -0
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +58 -0
- package/es-modules/Grid/Pro/CellRendering/CellRendererType.d.ts +48 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +18 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +79 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +30 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +122 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.d.ts +12 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.js +39 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.d.ts +66 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +145 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.d.ts +12 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.js +38 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.d.ts +58 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +158 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +58 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +173 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +28 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +157 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +58 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +168 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.d.ts +13 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.js +41 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.d.ts +50 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +65 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.d.ts +37 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +65 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.d.ts +26 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.js +16 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.d.ts +37 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +64 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.d.ts +52 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +64 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.d.ts +74 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +66 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +45 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +89 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.d.ts +54 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +65 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.d.ts +43 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +74 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.d.ts +37 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +64 -0
- package/es-modules/Grid/Pro/ColumnTypes/ColumnDataType.d.ts +29 -0
- package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +118 -0
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +270 -0
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +32 -0
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +63 -0
- package/es-modules/Grid/Pro/Credits/CreditsPro.d.ts +35 -0
- package/es-modules/Grid/Pro/Credits/CreditsPro.js +112 -0
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +28 -0
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +61 -0
- package/es-modules/Grid/Pro/Export/Exporting.d.ts +68 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +202 -0
- package/es-modules/Grid/Pro/Export/ExportingComposition.d.ts +68 -0
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +55 -0
- package/es-modules/Grid/Pro/GridEvents.d.ts +119 -0
- package/es-modules/Grid/Pro/GridEvents.js +107 -0
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +75 -0
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +76 -0
- package/es-modules/Grid/Pro/highcharts.d.ts +7 -0
- package/es-modules/Grid/index.d.ts +5 -0
- package/es-modules/Grid/index.js +19 -0
- package/es-modules/Shared/BaseForm.d.ts +49 -0
- package/es-modules/Shared/BaseForm.js +126 -0
- package/es-modules/Shared/DownloadURL.d.ts +85 -0
- package/es-modules/Shared/DownloadURL.js +198 -0
- package/es-modules/Shared/LangOptionsCore.d.ts +27 -0
- package/es-modules/Shared/TimeBase.d.ts +353 -0
- package/es-modules/Shared/TimeBase.js +830 -0
- package/es-modules/Shared/Types.d.ts +48 -0
- package/es-modules/masters/grid-pro.src.d.ts +99 -0
- package/es-modules/masters/grid-pro.src.js +129 -0
- package/grid-pro.d.ts +50 -0
- package/grid-pro.js +12 -0
- package/grid-pro.js.map +1 -0
- package/grid-pro.src.d.ts +50 -0
- package/grid-pro.src.js +26623 -0
- package/package.json +21 -0
|
@@ -0,0 +1,1989 @@
|
|
|
1
|
+
/* *
|
|
2
|
+
*
|
|
3
|
+
* (c) 2010-2025 Torstein Honsi
|
|
4
|
+
*
|
|
5
|
+
* License: www.highcharts.com/license
|
|
6
|
+
*
|
|
7
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
8
|
+
*
|
|
9
|
+
* */
|
|
10
|
+
'use strict';
|
|
11
|
+
import H from './Globals.js';
|
|
12
|
+
const { charts, doc, win } = H;
|
|
13
|
+
/* *
|
|
14
|
+
*
|
|
15
|
+
* Functions
|
|
16
|
+
*
|
|
17
|
+
* */
|
|
18
|
+
/**
|
|
19
|
+
* Provide error messages for debugging, with links to online explanation. This
|
|
20
|
+
* function can be overridden to provide custom error handling.
|
|
21
|
+
*
|
|
22
|
+
* @sample highcharts/chart/highcharts-error/
|
|
23
|
+
* Custom error handler
|
|
24
|
+
*
|
|
25
|
+
* @function Highcharts.error
|
|
26
|
+
*
|
|
27
|
+
* @param {number|string} code
|
|
28
|
+
* The error code. See
|
|
29
|
+
* [errors.xml](https://github.com/highcharts/highcharts/blob/master/errors/errors.xml)
|
|
30
|
+
* for available codes. If it is a string, the error message is printed
|
|
31
|
+
* directly in the console.
|
|
32
|
+
*
|
|
33
|
+
* @param {boolean} [stop=false]
|
|
34
|
+
* Whether to throw an error or just log a warning in the console.
|
|
35
|
+
*
|
|
36
|
+
* @param {Highcharts.Chart} [chart]
|
|
37
|
+
* Reference to the chart that causes the error. Used in 'debugger'
|
|
38
|
+
* module to display errors directly on the chart.
|
|
39
|
+
* Important note: This argument is undefined for errors that lack
|
|
40
|
+
* access to the Chart instance. In such case, the error will be
|
|
41
|
+
* displayed on the last created chart.
|
|
42
|
+
*
|
|
43
|
+
* @param {Highcharts.Dictionary<string>} [params]
|
|
44
|
+
* Additional parameters for the generated message.
|
|
45
|
+
*
|
|
46
|
+
* @return {void}
|
|
47
|
+
*/
|
|
48
|
+
function error(code, stop, chart, params) {
|
|
49
|
+
const severity = stop ? 'Highcharts error' : 'Highcharts warning';
|
|
50
|
+
if (code === 32) {
|
|
51
|
+
code = `${severity}: Deprecated member`;
|
|
52
|
+
}
|
|
53
|
+
const isCode = isNumber(code);
|
|
54
|
+
let message = isCode ?
|
|
55
|
+
`${severity} #${code}: www.highcharts.com/errors/${code}/` :
|
|
56
|
+
code.toString();
|
|
57
|
+
const defaultHandler = function () {
|
|
58
|
+
if (stop) {
|
|
59
|
+
throw new Error(message);
|
|
60
|
+
}
|
|
61
|
+
// Else ...
|
|
62
|
+
if (win.console &&
|
|
63
|
+
error.messages.indexOf(message) === -1 // Prevent console flooting
|
|
64
|
+
) {
|
|
65
|
+
console.warn(message); // eslint-disable-line no-console
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (typeof params !== 'undefined') {
|
|
69
|
+
let additionalMessages = '';
|
|
70
|
+
if (isCode) {
|
|
71
|
+
message += '?';
|
|
72
|
+
}
|
|
73
|
+
objectEach(params, function (value, key) {
|
|
74
|
+
additionalMessages += `\n - ${key}: ${value}`;
|
|
75
|
+
if (isCode) {
|
|
76
|
+
message += encodeURI(key) + '=' + encodeURI(value);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
message += additionalMessages;
|
|
80
|
+
}
|
|
81
|
+
fireEvent(H, 'displayError', { chart, code, message, params }, defaultHandler);
|
|
82
|
+
error.messages.push(message);
|
|
83
|
+
}
|
|
84
|
+
(function (error) {
|
|
85
|
+
error.messages = [];
|
|
86
|
+
})(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
|
+
/**
|
|
373
|
+
* Insert a series or an axis in a collection with other items, either the
|
|
374
|
+
* chart series or yAxis series or axis collections, in the correct order
|
|
375
|
+
* according to the index option and whether it is internal. Used internally
|
|
376
|
+
* when adding series and axes.
|
|
377
|
+
*
|
|
378
|
+
* @private
|
|
379
|
+
* @function Highcharts.Chart#insertItem
|
|
380
|
+
* @param {Highcharts.Series|Highcharts.Axis} item
|
|
381
|
+
* The item to insert
|
|
382
|
+
* @param {Array<Highcharts.Series>|Array<Highcharts.Axis>} collection
|
|
383
|
+
* A collection of items, like `chart.series` or `xAxis.series`.
|
|
384
|
+
* @return {number} The index of the series in the collection.
|
|
385
|
+
*/
|
|
386
|
+
function insertItem(item, collection) {
|
|
387
|
+
const indexOption = item.options.index, length = collection.length;
|
|
388
|
+
let i;
|
|
389
|
+
for (
|
|
390
|
+
// Internal item (navigator) should always be pushed to the end
|
|
391
|
+
i = item.options.isInternal ? length : 0; i < length + 1; i++) {
|
|
392
|
+
if (
|
|
393
|
+
// No index option, reached the end of the collection,
|
|
394
|
+
// equivalent to pushing
|
|
395
|
+
!collection[i] ||
|
|
396
|
+
// Handle index option, the element to insert has lower index
|
|
397
|
+
(isNumber(indexOption) &&
|
|
398
|
+
indexOption < pick(collection[i].options.index, collection[i]._i)) ||
|
|
399
|
+
// Insert the new item before other internal items
|
|
400
|
+
// (navigator)
|
|
401
|
+
collection[i].options.isInternal) {
|
|
402
|
+
collection.splice(i, 0, item);
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return i;
|
|
407
|
+
}
|
|
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
|
+
/**
|
|
992
|
+
* The time unit lookup
|
|
993
|
+
*
|
|
994
|
+
* @ignore
|
|
995
|
+
*/
|
|
996
|
+
const timeUnits = {
|
|
997
|
+
millisecond: 1,
|
|
998
|
+
second: 1000,
|
|
999
|
+
minute: 60000,
|
|
1000
|
+
hour: 3600000,
|
|
1001
|
+
day: 24 * 3600000,
|
|
1002
|
+
week: 7 * 24 * 3600000,
|
|
1003
|
+
month: 28 * 24 * 3600000,
|
|
1004
|
+
year: 364 * 24 * 3600000
|
|
1005
|
+
};
|
|
1006
|
+
/**
|
|
1007
|
+
* Easing definition
|
|
1008
|
+
*
|
|
1009
|
+
* @private
|
|
1010
|
+
* @function Math.easeInOutSine
|
|
1011
|
+
*
|
|
1012
|
+
* @param {number} pos
|
|
1013
|
+
* Current position, ranging from 0 to 1.
|
|
1014
|
+
*
|
|
1015
|
+
* @return {number}
|
|
1016
|
+
* Ease result
|
|
1017
|
+
*/
|
|
1018
|
+
Math.easeInOutSine = function (pos) {
|
|
1019
|
+
return -0.5 * (Math.cos(Math.PI * pos) - 1);
|
|
1020
|
+
};
|
|
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
|
+
let serialMode;
|
|
1486
|
+
/**
|
|
1487
|
+
* Get a unique key for using in internal element id's and pointers. The key is
|
|
1488
|
+
* composed of a random hash specific to this Highcharts instance, and a
|
|
1489
|
+
* counter.
|
|
1490
|
+
*
|
|
1491
|
+
* @example
|
|
1492
|
+
* let id = uniqueKey(); // => 'highcharts-x45f6hp-0'
|
|
1493
|
+
*
|
|
1494
|
+
* @function Highcharts.uniqueKey
|
|
1495
|
+
*
|
|
1496
|
+
* @return {string}
|
|
1497
|
+
* A unique key.
|
|
1498
|
+
*/
|
|
1499
|
+
const uniqueKey = (function () {
|
|
1500
|
+
const hash = Math.random().toString(36).substring(2, 9) + '-';
|
|
1501
|
+
let id = 0;
|
|
1502
|
+
return function () {
|
|
1503
|
+
return 'highcharts-' + (serialMode ? '' : hash) + id++;
|
|
1504
|
+
};
|
|
1505
|
+
}());
|
|
1506
|
+
/**
|
|
1507
|
+
* Activates a serial mode for element IDs provided by
|
|
1508
|
+
* {@link Highcharts.uniqueKey}. This mode can be used in automated tests, where
|
|
1509
|
+
* a simple comparison of two rendered SVG graphics is needed.
|
|
1510
|
+
*
|
|
1511
|
+
* **Note:** This is only for testing purposes and will break functionality in
|
|
1512
|
+
* webpages with multiple charts.
|
|
1513
|
+
*
|
|
1514
|
+
* @example
|
|
1515
|
+
* if (
|
|
1516
|
+
* process &&
|
|
1517
|
+
* process.env.NODE_ENV === 'development'
|
|
1518
|
+
* ) {
|
|
1519
|
+
* Highcharts.useSerialIds(true);
|
|
1520
|
+
* }
|
|
1521
|
+
*
|
|
1522
|
+
* @function Highcharts.useSerialIds
|
|
1523
|
+
*
|
|
1524
|
+
* @param {boolean} [mode]
|
|
1525
|
+
* Changes the state of serial mode.
|
|
1526
|
+
*
|
|
1527
|
+
* @return {boolean|undefined}
|
|
1528
|
+
* State of the serial mode.
|
|
1529
|
+
*/
|
|
1530
|
+
function useSerialIds(mode) {
|
|
1531
|
+
return (serialMode = pick(mode, serialMode));
|
|
1532
|
+
}
|
|
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
|
+
/* *
|
|
1542
|
+
*
|
|
1543
|
+
* External
|
|
1544
|
+
*
|
|
1545
|
+
* */
|
|
1546
|
+
// Register Highcharts as a plugin in jQuery
|
|
1547
|
+
if (win.jQuery) {
|
|
1548
|
+
/**
|
|
1549
|
+
* Highcharts-extended JQuery.
|
|
1550
|
+
*
|
|
1551
|
+
* @external JQuery
|
|
1552
|
+
*/
|
|
1553
|
+
/**
|
|
1554
|
+
* Helper function to return the chart of the current JQuery selector
|
|
1555
|
+
* element.
|
|
1556
|
+
*
|
|
1557
|
+
* @function external:JQuery#highcharts
|
|
1558
|
+
*
|
|
1559
|
+
* @return {Highcharts.Chart}
|
|
1560
|
+
* The chart that is linked to the JQuery selector element.
|
|
1561
|
+
*/ /**
|
|
1562
|
+
* Factory function to create a chart in the current JQuery selector
|
|
1563
|
+
* element.
|
|
1564
|
+
*
|
|
1565
|
+
* @function external:JQuery#highcharts
|
|
1566
|
+
*
|
|
1567
|
+
* @param {'Chart'|'Map'|'StockChart'|string} [className]
|
|
1568
|
+
* Name of the factory class in the Highcharts namespace.
|
|
1569
|
+
*
|
|
1570
|
+
* @param {Highcharts.Options} [options]
|
|
1571
|
+
* The chart options structure.
|
|
1572
|
+
*
|
|
1573
|
+
* @param {Highcharts.ChartCallbackFunction} [callback]
|
|
1574
|
+
* Function to run when the chart has loaded and all external
|
|
1575
|
+
* images are loaded. Defining a
|
|
1576
|
+
* [chart.events.load](https://api.highcharts.com/highcharts/chart.events.load)
|
|
1577
|
+
* handler is equivalent.
|
|
1578
|
+
*
|
|
1579
|
+
* @return {JQuery}
|
|
1580
|
+
* The current JQuery selector.
|
|
1581
|
+
*/
|
|
1582
|
+
win.jQuery.fn.highcharts = function () {
|
|
1583
|
+
const args = [].slice.call(arguments);
|
|
1584
|
+
if (this[0]) { // `this[0]` is the renderTo div
|
|
1585
|
+
// Create the chart
|
|
1586
|
+
if (args[0]) {
|
|
1587
|
+
new H[ // eslint-disable-line computed-property-spacing, no-new
|
|
1588
|
+
// Constructor defaults to Chart
|
|
1589
|
+
isString(args[0]) ? args.shift() : 'Chart'](this[0], args[0], args[1]);
|
|
1590
|
+
return this;
|
|
1591
|
+
}
|
|
1592
|
+
// When called without parameters or with the return argument,
|
|
1593
|
+
// return an existing chart
|
|
1594
|
+
return charts[attr(this[0], 'data-highcharts-chart')];
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
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
|
+
/* *
|
|
1660
|
+
*
|
|
1661
|
+
* API Declarations
|
|
1662
|
+
*
|
|
1663
|
+
* */
|
|
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
|
+
/**
|
|
1694
|
+
* Creates a frame for the animated SVG element.
|
|
1695
|
+
*
|
|
1696
|
+
* @callback Highcharts.AnimationStepCallbackFunction
|
|
1697
|
+
*
|
|
1698
|
+
* @param {Highcharts.SVGElement} this
|
|
1699
|
+
* The SVG element to animate.
|
|
1700
|
+
*
|
|
1701
|
+
* @return {void}
|
|
1702
|
+
*/
|
|
1703
|
+
/**
|
|
1704
|
+
* Interface description for a class.
|
|
1705
|
+
*
|
|
1706
|
+
* @interface Highcharts.Class<T>
|
|
1707
|
+
* @extends Function
|
|
1708
|
+
*/ /**
|
|
1709
|
+
* Class constructor.
|
|
1710
|
+
* @function Highcharts.Class<T>#new
|
|
1711
|
+
* @param {...Array<*>} args
|
|
1712
|
+
* Constructor arguments.
|
|
1713
|
+
* @return {T}
|
|
1714
|
+
* Class instance.
|
|
1715
|
+
*/
|
|
1716
|
+
/**
|
|
1717
|
+
* A style object with camel case property names to define visual appearance of
|
|
1718
|
+
* a SVG element or HTML element. The properties can be whatever styles are
|
|
1719
|
+
* supported on the given SVG or HTML element.
|
|
1720
|
+
*
|
|
1721
|
+
* @example
|
|
1722
|
+
* {
|
|
1723
|
+
* fontFamily: 'monospace',
|
|
1724
|
+
* fontSize: '1.2em'
|
|
1725
|
+
* }
|
|
1726
|
+
*
|
|
1727
|
+
* @interface Highcharts.CSSObject
|
|
1728
|
+
*/ /**
|
|
1729
|
+
* @name Highcharts.CSSObject#[key:string]
|
|
1730
|
+
* @type {boolean|number|string|undefined}
|
|
1731
|
+
*/ /**
|
|
1732
|
+
* Background style for the element.
|
|
1733
|
+
* @name Highcharts.CSSObject#background
|
|
1734
|
+
* @type {string|undefined}
|
|
1735
|
+
*/ /**
|
|
1736
|
+
* Background color of the element.
|
|
1737
|
+
* @name Highcharts.CSSObject#backgroundColor
|
|
1738
|
+
* @type {Highcharts.ColorString|undefined}
|
|
1739
|
+
*/ /**
|
|
1740
|
+
* Border style for the element.
|
|
1741
|
+
* @name Highcharts.CSSObject#border
|
|
1742
|
+
* @type {string|undefined}
|
|
1743
|
+
*/ /**
|
|
1744
|
+
* Radius of the element border.
|
|
1745
|
+
* @name Highcharts.CSSObject#borderRadius
|
|
1746
|
+
* @type {number|undefined}
|
|
1747
|
+
*/ /**
|
|
1748
|
+
* Color used in the element. The 'contrast' option is a Highcharts custom
|
|
1749
|
+
* property that results in black or white, depending on the background of the
|
|
1750
|
+
* element.
|
|
1751
|
+
* @name Highcharts.CSSObject#color
|
|
1752
|
+
* @type {'contrast'|Highcharts.ColorString|undefined}
|
|
1753
|
+
*/ /**
|
|
1754
|
+
* Style of the mouse cursor when resting over the element.
|
|
1755
|
+
* @name Highcharts.CSSObject#cursor
|
|
1756
|
+
* @type {Highcharts.CursorValue|undefined}
|
|
1757
|
+
*/ /**
|
|
1758
|
+
* Font family of the element text. Multiple values have to be in decreasing
|
|
1759
|
+
* preference order and separated by comma.
|
|
1760
|
+
* @name Highcharts.CSSObject#fontFamily
|
|
1761
|
+
* @type {string|undefined}
|
|
1762
|
+
*/ /**
|
|
1763
|
+
* Font size of the element text.
|
|
1764
|
+
* @name Highcharts.CSSObject#fontSize
|
|
1765
|
+
* @type {string|undefined}
|
|
1766
|
+
*/ /**
|
|
1767
|
+
* Font weight of the element text.
|
|
1768
|
+
* @name Highcharts.CSSObject#fontWeight
|
|
1769
|
+
* @type {string|undefined}
|
|
1770
|
+
*/ /**
|
|
1771
|
+
* Height of the element.
|
|
1772
|
+
* @name Highcharts.CSSObject#height
|
|
1773
|
+
* @type {number|undefined}
|
|
1774
|
+
*/ /**
|
|
1775
|
+
* The maximum number of lines. If lines are cropped away, an ellipsis will be
|
|
1776
|
+
* added.
|
|
1777
|
+
* @name Highcharts.CSSObject#lineClamp
|
|
1778
|
+
* @type {number|undefined}
|
|
1779
|
+
*/ /**
|
|
1780
|
+
* Width of the element border.
|
|
1781
|
+
* @name Highcharts.CSSObject#lineWidth
|
|
1782
|
+
* @type {number|undefined}
|
|
1783
|
+
*/ /**
|
|
1784
|
+
* Opacity of the element.
|
|
1785
|
+
* @name Highcharts.CSSObject#opacity
|
|
1786
|
+
* @type {number|undefined}
|
|
1787
|
+
*/ /**
|
|
1788
|
+
* Space around the element content.
|
|
1789
|
+
* @name Highcharts.CSSObject#padding
|
|
1790
|
+
* @type {string|undefined}
|
|
1791
|
+
*/ /**
|
|
1792
|
+
* Behaviour of the element when the mouse cursor rests over it.
|
|
1793
|
+
* @name Highcharts.CSSObject#pointerEvents
|
|
1794
|
+
* @type {string|undefined}
|
|
1795
|
+
*/ /**
|
|
1796
|
+
* Positioning of the element.
|
|
1797
|
+
* @name Highcharts.CSSObject#position
|
|
1798
|
+
* @type {string|undefined}
|
|
1799
|
+
*/ /**
|
|
1800
|
+
* Alignment of the element text.
|
|
1801
|
+
* @name Highcharts.CSSObject#textAlign
|
|
1802
|
+
* @type {string|undefined}
|
|
1803
|
+
*/ /**
|
|
1804
|
+
* Additional decoration of the element text.
|
|
1805
|
+
* @name Highcharts.CSSObject#textDecoration
|
|
1806
|
+
* @type {string|undefined}
|
|
1807
|
+
*/ /**
|
|
1808
|
+
* Outline style of the element text.
|
|
1809
|
+
* @name Highcharts.CSSObject#textOutline
|
|
1810
|
+
* @type {string|undefined}
|
|
1811
|
+
*/ /**
|
|
1812
|
+
* Line break style of the element text. Highcharts SVG elements support
|
|
1813
|
+
* `ellipsis` when a `width` is set.
|
|
1814
|
+
* @name Highcharts.CSSObject#textOverflow
|
|
1815
|
+
* @type {string|undefined}
|
|
1816
|
+
*/ /**
|
|
1817
|
+
* Top spacing of the element relative to the parent element.
|
|
1818
|
+
* @name Highcharts.CSSObject#top
|
|
1819
|
+
* @type {string|undefined}
|
|
1820
|
+
*/ /**
|
|
1821
|
+
* Animated transition of selected element properties.
|
|
1822
|
+
* @name Highcharts.CSSObject#transition
|
|
1823
|
+
* @type {string|undefined}
|
|
1824
|
+
*/ /**
|
|
1825
|
+
* Line break style of the element text.
|
|
1826
|
+
* @name Highcharts.CSSObject#whiteSpace
|
|
1827
|
+
* @type {string|undefined}
|
|
1828
|
+
*/ /**
|
|
1829
|
+
* Width of the element.
|
|
1830
|
+
* @name Highcharts.CSSObject#width
|
|
1831
|
+
* @type {number|undefined}
|
|
1832
|
+
*/
|
|
1833
|
+
/**
|
|
1834
|
+
* All possible cursor styles.
|
|
1835
|
+
*
|
|
1836
|
+
* @typedef {'alias'|'all-scroll'|'auto'|'cell'|'col-resize'|'context-menu'|'copy'|'crosshair'|'default'|'e-resize'|'ew-resize'|'grab'|'grabbing'|'help'|'move'|'n-resize'|'ne-resize'|'nesw-resize'|'no-drop'|'none'|'not-allowed'|'ns-resize'|'nw-resize'|'nwse-resize'|'pointer'|'progress'|'row-resize'|'s-resize'|'se-resize'|'sw-resize'|'text'|'vertical-text'|'w-resize'|'wait'|'zoom-in'|'zoom-out'} Highcharts.CursorValue
|
|
1837
|
+
*/
|
|
1838
|
+
/**
|
|
1839
|
+
* All possible dash styles.
|
|
1840
|
+
*
|
|
1841
|
+
* @typedef {'Dash'|'DashDot'|'Dot'|'LongDash'|'LongDashDot'|'LongDashDotDot'|'ShortDash'|'ShortDashDot'|'ShortDashDotDot'|'ShortDot'|'Solid'} Highcharts.DashStyleValue
|
|
1842
|
+
*/
|
|
1843
|
+
/**
|
|
1844
|
+
* Generic dictionary in TypeScript notation.
|
|
1845
|
+
* Use the native `AnyRecord` instead.
|
|
1846
|
+
*
|
|
1847
|
+
* @deprecated
|
|
1848
|
+
* @interface Highcharts.Dictionary<T>
|
|
1849
|
+
*/ /**
|
|
1850
|
+
* @name Highcharts.Dictionary<T>#[key:string]
|
|
1851
|
+
* @type {T}
|
|
1852
|
+
*/
|
|
1853
|
+
/**
|
|
1854
|
+
* The function callback to execute when the event is fired. The `this` context
|
|
1855
|
+
* contains the instance, that fired the event.
|
|
1856
|
+
*
|
|
1857
|
+
* @callback Highcharts.EventCallbackFunction<T>
|
|
1858
|
+
*
|
|
1859
|
+
* @param {T} this
|
|
1860
|
+
*
|
|
1861
|
+
* @param {Highcharts.Dictionary<*>|Event} [eventArguments]
|
|
1862
|
+
* Event arguments.
|
|
1863
|
+
*
|
|
1864
|
+
* @return {boolean|void}
|
|
1865
|
+
*/
|
|
1866
|
+
/**
|
|
1867
|
+
* The event options for adding function callback.
|
|
1868
|
+
*
|
|
1869
|
+
* @interface Highcharts.EventOptionsObject
|
|
1870
|
+
*/ /**
|
|
1871
|
+
* The order the event handler should be called. This opens for having one
|
|
1872
|
+
* handler be called before another, independent of in which order they were
|
|
1873
|
+
* added.
|
|
1874
|
+
* @name Highcharts.EventOptionsObject#order
|
|
1875
|
+
* @type {number}
|
|
1876
|
+
*/ /**
|
|
1877
|
+
* Whether an event should be passive or not.
|
|
1878
|
+
* When set to `true`, the function specified by listener will never call
|
|
1879
|
+
* `preventDefault()`.
|
|
1880
|
+
* @name Highcharts.EventOptionsObject#passive
|
|
1881
|
+
* @type boolean
|
|
1882
|
+
*/
|
|
1883
|
+
/**
|
|
1884
|
+
* Formats data as a string. Usually the data is accessible through the `this`
|
|
1885
|
+
* keyword.
|
|
1886
|
+
*
|
|
1887
|
+
* @callback Highcharts.FormatterCallbackFunction<T>
|
|
1888
|
+
*
|
|
1889
|
+
* @param {T} this
|
|
1890
|
+
* Context to format
|
|
1891
|
+
*
|
|
1892
|
+
* @return {string}
|
|
1893
|
+
* Formatted text
|
|
1894
|
+
*/
|
|
1895
|
+
/**
|
|
1896
|
+
* An object of key-value pairs for HTML attributes.
|
|
1897
|
+
*
|
|
1898
|
+
* @typedef {Highcharts.Dictionary<boolean|number|string|Function>} Highcharts.HTMLAttributes
|
|
1899
|
+
*/
|
|
1900
|
+
/**
|
|
1901
|
+
* An HTML DOM element. The type is a reference to the regular HTMLElement in
|
|
1902
|
+
* the global scope.
|
|
1903
|
+
*
|
|
1904
|
+
* @typedef {global.HTMLElement} Highcharts.HTMLDOMElement
|
|
1905
|
+
*
|
|
1906
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
|
1907
|
+
*/
|
|
1908
|
+
/**
|
|
1909
|
+
* The iterator callback.
|
|
1910
|
+
*
|
|
1911
|
+
* @callback Highcharts.ObjectEachCallbackFunction<T>
|
|
1912
|
+
*
|
|
1913
|
+
* @param {T} this
|
|
1914
|
+
* The context.
|
|
1915
|
+
*
|
|
1916
|
+
* @param {*} value
|
|
1917
|
+
* The property value.
|
|
1918
|
+
*
|
|
1919
|
+
* @param {string} key
|
|
1920
|
+
* The property key.
|
|
1921
|
+
*
|
|
1922
|
+
* @param {*} obj
|
|
1923
|
+
* The object that objectEach is being applied to.
|
|
1924
|
+
*/
|
|
1925
|
+
/**
|
|
1926
|
+
* An object containing `left` and `top` properties for the position in the
|
|
1927
|
+
* page.
|
|
1928
|
+
*
|
|
1929
|
+
* @interface Highcharts.OffsetObject
|
|
1930
|
+
*/ /**
|
|
1931
|
+
* Left distance to the page border.
|
|
1932
|
+
* @name Highcharts.OffsetObject#left
|
|
1933
|
+
* @type {number}
|
|
1934
|
+
*/ /**
|
|
1935
|
+
* Top distance to the page border.
|
|
1936
|
+
* @name Highcharts.OffsetObject#top
|
|
1937
|
+
* @type {number}
|
|
1938
|
+
*/
|
|
1939
|
+
/**
|
|
1940
|
+
* Describes a range.
|
|
1941
|
+
*
|
|
1942
|
+
* @interface Highcharts.RangeObject
|
|
1943
|
+
*/ /**
|
|
1944
|
+
* Maximum number of the range.
|
|
1945
|
+
* @name Highcharts.RangeObject#max
|
|
1946
|
+
* @type {number}
|
|
1947
|
+
*/ /**
|
|
1948
|
+
* Minimum number of the range.
|
|
1949
|
+
* @name Highcharts.RangeObject#min
|
|
1950
|
+
* @type {number}
|
|
1951
|
+
*/
|
|
1952
|
+
/**
|
|
1953
|
+
* If a number is given, it defines the pixel length. If a percentage string is
|
|
1954
|
+
* given, like for example `'50%'`, the setting defines a length relative to a
|
|
1955
|
+
* base size, for example the size of a container.
|
|
1956
|
+
*
|
|
1957
|
+
* @typedef {number|string} Highcharts.RelativeSize
|
|
1958
|
+
*/
|
|
1959
|
+
/**
|
|
1960
|
+
* Proceed function to call original (wrapped) function.
|
|
1961
|
+
*
|
|
1962
|
+
* @callback Highcharts.WrapProceedFunction
|
|
1963
|
+
*
|
|
1964
|
+
* @param {*} [arg1]
|
|
1965
|
+
* Optional argument. Without any arguments defaults to first argument of
|
|
1966
|
+
* the wrapping function.
|
|
1967
|
+
*
|
|
1968
|
+
* @param {*} [arg2]
|
|
1969
|
+
* Optional argument. Without any arguments defaults to second argument
|
|
1970
|
+
* of the wrapping function.
|
|
1971
|
+
*
|
|
1972
|
+
* @param {*} [arg3]
|
|
1973
|
+
* Optional argument. Without any arguments defaults to third argument of
|
|
1974
|
+
* the wrapping function.
|
|
1975
|
+
*
|
|
1976
|
+
* @return {*}
|
|
1977
|
+
* Return value of the original function.
|
|
1978
|
+
*/
|
|
1979
|
+
/**
|
|
1980
|
+
* The Highcharts object is the placeholder for all other members, and various
|
|
1981
|
+
* utility functions. The most important member of the namespace would be the
|
|
1982
|
+
* chart constructor.
|
|
1983
|
+
*
|
|
1984
|
+
* @example
|
|
1985
|
+
* let chart = Highcharts.chart('container', { ... });
|
|
1986
|
+
*
|
|
1987
|
+
* @namespace Highcharts
|
|
1988
|
+
*/
|
|
1989
|
+
''; // Detach doclets above
|