@highcharts/grid-pro 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +6 -0
- package/README.md +15 -9
- package/css/grid-pro.css +1262 -1122
- package/css/modules/grid-base-variables.css +131 -0
- package/css/modules/grid-button-variables.css +140 -0
- package/css/modules/grid-caption-variables.css +11 -0
- package/css/modules/grid-description-variables.css +11 -0
- package/css/modules/grid-input-variables.css +114 -0
- package/css/modules/grid-link-variables.css +18 -0
- package/css/modules/grid-menu-variables.css +50 -0
- package/css/modules/grid-pagination-variables.css +12 -0
- package/css/modules/grid-popup-variables.css +24 -0
- package/css/modules/grid-pro.css +234 -0
- package/css/modules/grid-table-variables.css +385 -0
- package/css/modules/grid-theme-default.css +55 -0
- package/es-modules/Accessibility/A11yI18n.js +1 -2
- package/es-modules/Accessibility/Accessibility.js +1 -2
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +2 -2
- package/es-modules/Accessibility/Components/ContainerComponent.js +0 -1
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +6 -8
- package/es-modules/Accessibility/Components/LegendComponent.js +1 -2
- package/es-modules/Accessibility/Components/MenuComponent.js +1 -3
- package/es-modules/Accessibility/Components/NavigatorComponent.js +3 -4
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +1 -3
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +22 -11
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +3 -7
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +0 -1
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +3 -5
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +1 -4
- package/es-modules/Accessibility/Components/ZoomComponent.js +1 -2
- package/es-modules/Accessibility/FocusBorder.js +6 -7
- package/es-modules/Accessibility/KeyboardNavigation.js +1 -2
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +1 -2
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +11 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +8 -4
- package/es-modules/Accessibility/Options/LangDefaults.js +9 -0
- package/es-modules/Accessibility/ProxyElement.d.ts +2 -2
- package/es-modules/Accessibility/ProxyElement.js +4 -7
- package/es-modules/Accessibility/ProxyProvider.js +1 -2
- package/es-modules/Accessibility/Utils/Announcer.js +2 -3
- package/es-modules/Accessibility/Utils/ChartUtilities.js +1 -3
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +2 -2
- package/es-modules/Accessibility/Utils/EventProvider.js +6 -2
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +1 -3
- package/es-modules/Core/Animation/AnimationUtilities.js +1 -2
- package/es-modules/Core/Animation/Fx.js +1 -2
- package/es-modules/Core/Callback.d.ts +9 -2
- package/es-modules/Core/Chart/Chart.js +56 -42
- package/es-modules/Core/Chart/Chart3D.js +1 -2
- package/es-modules/Core/Chart/ChartDefaults.js +11 -0
- package/es-modules/Core/Chart/ChartNavigationComposition.js +0 -1
- package/es-modules/Core/Chart/ChartOptions.d.ts +8 -0
- package/es-modules/Core/Chart/GanttChart.js +1 -2
- package/es-modules/Core/Chart/MapChart.js +3 -2
- package/es-modules/Core/Chart/StockChart.js +2 -3
- package/es-modules/Core/Color/Color.js +1 -3
- package/es-modules/Core/Defaults.js +36 -10
- package/es-modules/Core/Delaunay.d.ts +1 -0
- package/es-modules/Core/Delaunay.js +312 -0
- package/es-modules/Core/Foundation.js +1 -3
- package/es-modules/Core/Geometry/CircleUtilities.js +1 -2
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/HttpUtilities.js +1 -2
- package/es-modules/Core/MSPointer.js +1 -3
- package/es-modules/Core/Math3D.js +1 -2
- package/es-modules/Core/Options.d.ts +6 -2
- package/es-modules/Core/Pointer.js +23 -4
- package/es-modules/Core/PointerEvent.d.ts +2 -0
- package/es-modules/Core/Renderer/HTML/AST.js +2 -2
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +3 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -2
- package/es-modules/Core/Renderer/RendererUtilities.js +34 -20
- package/es-modules/Core/Renderer/SVG/SVGRenderer.d.ts +1 -1
- package/es-modules/Core/Renderer/SVG/Symbols.d.ts +2 -2
- package/es-modules/Core/Responsive.d.ts +4 -2
- package/es-modules/Core/Responsive.js +10 -4
- package/es-modules/Core/Templating.d.ts +1 -1
- package/es-modules/Core/Templating.js +3 -4
- package/es-modules/Core/Time.d.ts +8 -0
- package/es-modules/Core/Time.js +2 -2
- package/es-modules/Core/Tooltip.d.ts +4 -8
- package/es-modules/Core/Tooltip.js +100 -81
- package/es-modules/Core/TooltipOptions.d.ts +44 -1
- package/es-modules/Core/Utilities.d.ts +25 -665
- package/es-modules/Core/Utilities.js +21 -1400
- package/es-modules/Data/ColumnUtils.d.ts +83 -80
- package/es-modules/Data/ColumnUtils.js +103 -113
- package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/CSVConnector.js +3 -4
- package/es-modules/Data/Connectors/DataConnector.d.ts +56 -58
- package/es-modules/Data/Connectors/DataConnector.js +37 -56
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +73 -88
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +4 -2
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
- package/es-modules/Data/Connectors/HTMLTableConnector.js +3 -4
- package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/JSONConnector.js +3 -4
- package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
- package/es-modules/Data/Converters/CSVConverter.js +3 -4
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
- package/es-modules/Data/Converters/DataConverter.js +26 -53
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
- package/es-modules/Data/Converters/DataConverterUtils.js +169 -181
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +3 -3
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
- package/es-modules/Data/Converters/HTMLTableConverter.js +2 -3
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
- package/es-modules/Data/Converters/JSONConverter.js +6 -6
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +2 -2
- package/es-modules/Data/DataCursor.d.ts +65 -70
- package/es-modules/Data/DataCursor.js +119 -139
- package/es-modules/Data/DataEvent.d.ts +55 -57
- package/es-modules/Data/DataPool.d.ts +10 -17
- package/es-modules/Data/DataPool.js +21 -10
- package/es-modules/Data/DataTable.d.ts +111 -113
- package/es-modules/Data/DataTable.js +3 -3
- package/es-modules/Data/DataTableCore.d.ts +9 -9
- package/es-modules/Data/DataTableCore.js +2 -2
- package/es-modules/Data/Formula/FormulaParser.js +1 -2
- package/es-modules/Data/Formula/FormulaProcessor.js +1 -2
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
- package/es-modules/Data/Modifiers/ChainModifier.js +7 -8
- package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
- package/es-modules/Data/Modifiers/DataModifier.js +31 -53
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/FilterModifier.js +3 -4
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/InvertModifier.js +3 -4
- package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/RangeModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
- package/es-modules/Data/Modifiers/SortModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +3 -3
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +1 -1
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +5 -6
- package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
- package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
- package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
- package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
- package/es-modules/Grid/Core/Defaults.js +4 -2
- package/es-modules/Grid/Core/Globals.d.ts +20 -16
- package/es-modules/Grid/Core/Globals.js +10 -8
- package/es-modules/Grid/Core/Grid.d.ts +31 -22
- package/es-modules/Grid/Core/Grid.js +217 -139
- package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
- package/es-modules/Grid/Core/GridUtils.js +50 -3
- package/es-modules/Grid/Core/Options.d.ts +145 -4
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +68 -28
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +1 -2
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +3 -3
- package/es-modules/Grid/Core/Querying/PaginationController.js +7 -6
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
- package/es-modules/Grid/Core/Querying/QueryingController.js +2 -26
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +272 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +2 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +3 -4
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +2 -2
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +17 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +58 -15
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +1 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +57 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +411 -118
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +27 -13
- package/es-modules/Grid/Core/Table/Body/TableCell.js +74 -25
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +7 -15
- package/es-modules/Grid/Core/Table/Body/TableRow.js +24 -19
- package/es-modules/Grid/Core/Table/Cell.d.ts +16 -3
- package/es-modules/Grid/Core/Table/Cell.js +36 -3
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +3 -8
- package/es-modules/Grid/Core/Table/Column.d.ts +10 -4
- package/es-modules/Grid/Core/Table/Column.js +23 -34
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +9 -8
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +4 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +7 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +2 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +0 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +4 -14
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +6 -1
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +33 -13
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +4 -5
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +3 -3
- package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Row.js +2 -2
- package/es-modules/Grid/Core/Table/Table.d.ts +38 -12
- package/es-modules/Grid/Core/Table/Table.js +184 -91
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +5 -3
- package/es-modules/Grid/Core/UI/Popup.js +7 -9
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
- package/es-modules/Grid/Core/UI/SvgIcons.js +206 -33
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
- package/es-modules/Grid/Core/UI/ToolbarButton.js +8 -26
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +2 -2
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +10 -10
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +4 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +34 -32
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +3 -4
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +1 -3
- package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
- package/es-modules/Grid/Pro/Data/DataSourceHelper.js +256 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +1 -2
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +1 -2
- package/es-modules/Grid/Pro/GridEvents.js +1 -2
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +1 -2
- package/es-modules/Shared/BaseForm.js +1 -2
- package/es-modules/Shared/DownloadURL.js +1 -2
- package/es-modules/Shared/TimeBase.js +3 -3
- package/es-modules/Shared/Types.d.ts +7 -0
- package/es-modules/Shared/Utilities.d.ts +576 -0
- package/es-modules/Shared/Utilities.js +1360 -0
- package/es-modules/masters/grid-pro.src.d.ts +15 -11
- package/es-modules/masters/grid-pro.src.js +12 -5
- package/grid-pro.d.ts +15 -11
- package/grid-pro.js +3 -3
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +15 -11
- package/grid-pro.src.js +13854 -11395
- package/package.json +1 -1
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
- package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* Imports
|
|
15
15
|
*
|
|
16
16
|
* */
|
|
17
|
-
import
|
|
18
|
-
const { clamp, pick, pushUnique, stableSort } = U;
|
|
17
|
+
import { clamp, pick, pushUnique, stableSort } from '../../Shared/Utilities.js';
|
|
19
18
|
/* *
|
|
20
19
|
*
|
|
21
20
|
* Namespace
|
|
@@ -34,7 +33,6 @@ var RendererUtilities;
|
|
|
34
33
|
* Functions
|
|
35
34
|
*
|
|
36
35
|
* */
|
|
37
|
-
/* eslint-disable valid-jsdoc */
|
|
38
36
|
/**
|
|
39
37
|
* General distribution algorithm for distributing labels of differing size
|
|
40
38
|
* along a confined length in two dimensions. The algorithm takes an array
|
|
@@ -47,7 +45,7 @@ var RendererUtilities;
|
|
|
47
45
|
// Original array will be altered with added .pos
|
|
48
46
|
const origBoxes = boxes, reducedLen = origBoxes.reducedLen || len, sortByRank = (a, b) => (b.rank || 0) - (a.rank || 0), sortByTarget = (a, b) => a.target - b.target, restBoxes = [], // The outranked overshoot
|
|
49
47
|
boxesLength = boxes.length, forDeletion = [], push = restBoxes.push;
|
|
50
|
-
let i,
|
|
48
|
+
let i, overlapping = true, box, target, total = 0, equalRank;
|
|
51
49
|
// If the total size exceeds the len, remove those boxes with the lowest
|
|
52
50
|
// rank
|
|
53
51
|
i = boxesLength;
|
|
@@ -58,23 +56,39 @@ var RendererUtilities;
|
|
|
58
56
|
if (total > reducedLen) {
|
|
59
57
|
stableSort(boxes, sortByRank);
|
|
60
58
|
equalRank = boxes[0].rank === boxes[boxes.length - 1].rank;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
// When all boxes have equal rank (pie data labels, flags - #10073),
|
|
60
|
+
// decimate from the center outwards by repeatedly splitting index
|
|
61
|
+
// ranges. This guarantees progress and avoids cursor/step stalling
|
|
62
|
+
// on repeated indices (#23541). When ranks differ, remove the
|
|
63
|
+
// lowest ranked boxes from the end.
|
|
64
|
+
if (equalRank) {
|
|
65
|
+
const ranges = [[0, boxesLength - 1]];
|
|
66
|
+
while (ranges.length && total > reducedLen) {
|
|
67
|
+
const range = ranges.shift();
|
|
68
|
+
if (!range) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
i = Math.floor((range[0] + range[1]) / 2);
|
|
72
|
+
box = boxes[i];
|
|
73
|
+
if (pushUnique(forDeletion, i)) {
|
|
74
|
+
total -= box.size;
|
|
75
|
+
}
|
|
76
|
+
if (range[0] < i) {
|
|
77
|
+
ranges.push([range[0], i - 1]);
|
|
78
|
+
}
|
|
79
|
+
if (i < range[1]) {
|
|
80
|
+
ranges.push([i + 1, range[1]]);
|
|
81
|
+
}
|
|
72
82
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
i = boxesLength - 1;
|
|
86
|
+
while (total > reducedLen && i >= 0) {
|
|
87
|
+
box = boxes[i];
|
|
88
|
+
if (pushUnique(forDeletion, i)) {
|
|
89
|
+
total -= box.size;
|
|
90
|
+
}
|
|
91
|
+
i--;
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
94
|
// Clean out the boxes marked for deletion
|
|
@@ -251,7 +251,7 @@ declare class SVGRenderer implements SVGRendererBase {
|
|
|
251
251
|
*
|
|
252
252
|
* @function Highcharts.SVGRenderer#path
|
|
253
253
|
*
|
|
254
|
-
* @param {Highcharts.SVGAttributes} [
|
|
254
|
+
* @param {Highcharts.SVGAttributes|Highcharts.SVGPathArray} [path]
|
|
255
255
|
* The initial attributes.
|
|
256
256
|
*
|
|
257
257
|
* @return {Highcharts.SVGElement}
|
|
@@ -21,9 +21,9 @@ declare function arc(cx: number, cy: number, w: number, h: number, options?: Sym
|
|
|
21
21
|
/**
|
|
22
22
|
* Callout shape used for default tooltips.
|
|
23
23
|
*
|
|
24
|
-
* @param {number}
|
|
24
|
+
* @param {number} x
|
|
25
25
|
* Center X
|
|
26
|
-
* @param {number}
|
|
26
|
+
* @param {number} y
|
|
27
27
|
* Center Y
|
|
28
28
|
* @param {number} w
|
|
29
29
|
* Width
|
|
@@ -22,7 +22,7 @@ declare module './Options' {
|
|
|
22
22
|
}
|
|
23
23
|
declare namespace Responsive {
|
|
24
24
|
interface CallbackFunction {
|
|
25
|
-
(this: Chart): boolean;
|
|
25
|
+
(this: Chart, ctx?: Chart): boolean;
|
|
26
26
|
}
|
|
27
27
|
interface Options {
|
|
28
28
|
/**
|
|
@@ -45,7 +45,9 @@ declare namespace Responsive {
|
|
|
45
45
|
* A callback function to gain complete control on when the responsive
|
|
46
46
|
* rule applies. Return `true` if it applies. This opens for checking
|
|
47
47
|
* against other metrics than the chart size, for example the document
|
|
48
|
-
* size or other elements.
|
|
48
|
+
* size or other elements. Since v12.5.0, the callback also receives
|
|
49
|
+
* `ctx` as the first argument, so that arrow functions can access the
|
|
50
|
+
* same context as regular functions using `this`.
|
|
49
51
|
*
|
|
50
52
|
* @since 5.0.0
|
|
51
53
|
* @context Highcharts.Chart
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* */
|
|
11
11
|
'use strict';
|
|
12
|
-
import
|
|
13
|
-
|
|
12
|
+
import { diffObjects, extend, find, merge, pick } from '../Shared/Utilities.js';
|
|
13
|
+
import { uniqueKey } from './Utilities.js';
|
|
14
14
|
/* *
|
|
15
15
|
*
|
|
16
16
|
* Composition
|
|
@@ -55,7 +55,7 @@ var Responsive;
|
|
|
55
55
|
this.chartWidth >= pick(condition.minWidth, 0) &&
|
|
56
56
|
this.chartHeight >= pick(condition.minHeight, 0));
|
|
57
57
|
};
|
|
58
|
-
if (fn.call(this)) {
|
|
58
|
+
if (fn.call(this, this)) {
|
|
59
59
|
matches.push(rule._id);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -140,6 +140,10 @@ export default Responsive;
|
|
|
140
140
|
* @param {Highcharts.Chart} this
|
|
141
141
|
* Chart context.
|
|
142
142
|
*
|
|
143
|
+
* @param {Highcharts.Chart} [ctx]
|
|
144
|
+
* Since v12.5.0, the chart context passed as an extra argument for arrow
|
|
145
|
+
* functions.
|
|
146
|
+
*
|
|
143
147
|
* @return {boolean}
|
|
144
148
|
* Return `true` if it applies.
|
|
145
149
|
*/
|
|
@@ -216,7 +220,9 @@ export default Responsive;
|
|
|
216
220
|
* A callback function to gain complete control on when the responsive
|
|
217
221
|
* rule applies. Return `true` if it applies. This opens for checking
|
|
218
222
|
* against other metrics than the chart size, for example the document
|
|
219
|
-
* size or other elements.
|
|
223
|
+
* size or other elements. Since v12.5.0, the callback also receives `ctx`
|
|
224
|
+
* as the first argument, so that arrow functions can access the same
|
|
225
|
+
* context as regular functions using `this`.
|
|
220
226
|
*
|
|
221
227
|
* @type {Highcharts.ResponsiveCallbackFunction}
|
|
222
228
|
* @since 5.0.0
|
|
@@ -13,8 +13,7 @@ import D from './Defaults.js';
|
|
|
13
13
|
const { defaultOptions, defaultTime } = D;
|
|
14
14
|
import G from './Globals.js';
|
|
15
15
|
const { pageLang } = G;
|
|
16
|
-
import
|
|
17
|
-
const { extend, getNestedProperty, isArray, isNumber, isObject, isString, pick, ucfirst } = U;
|
|
16
|
+
import { extend, getNestedProperty, isArray, isNumber, isObject, isString, pick, ucfirst } from '../Shared/Utilities.js';
|
|
18
17
|
/** @internal */
|
|
19
18
|
const helpers = {
|
|
20
19
|
// Built-in helpers
|
|
@@ -133,12 +132,12 @@ function dateFormat(format, timestamp, upperCaseFirst) {
|
|
|
133
132
|
*/
|
|
134
133
|
function format(str = '', ctx, owner) {
|
|
135
134
|
// eslint-disable-next-line prefer-regex-literals
|
|
136
|
-
const regex = new RegExp('\\{([\\p{L}\\d:\\.,;\\-\\/<>\\[\\]%_@+"\'’= #\\(\\)]+)\\}', 'gu'),
|
|
135
|
+
const regex = new RegExp('\\{([\\p{L}\\p{M}\\d:\\.,;\\-\\/<>\\[\\]%_@+"\'’= #\\(\\)]+)\\}', 'gu'),
|
|
137
136
|
// The sub expression regex is the same as the top expression regex,
|
|
138
137
|
// but except parens and block helpers (#), and surrounded by parens
|
|
139
138
|
// instead of curly brackets.
|
|
140
139
|
// eslint-disable-next-line prefer-regex-literals
|
|
141
|
-
subRegex = new RegExp('\\(([\\p{L}\\d:\\.,;\\-\\/<>\\[\\]%_@+"\'= ]+)\\)', 'gu'), matches = [], floatRegex = /f$/, decRegex = /\.(\d)/, lang = owner?.options?.lang || defaultOptions.lang, time = owner?.time || defaultTime, numberFormatter = owner?.numberFormatter || numberFormat.bind(owner);
|
|
140
|
+
subRegex = new RegExp('\\(([\\p{L}\\p{M}\\d:\\.,;\\-\\/<>\\[\\]%_@+"\'= ]+)\\)', 'gu'), matches = [], floatRegex = /f$/, decRegex = /\.(\d)/, lang = owner?.options?.lang || defaultOptions.lang, time = owner?.time || defaultTime, numberFormatter = owner?.numberFormatter || numberFormat.bind(owner);
|
|
142
141
|
/*
|
|
143
142
|
* Get a literal or variable value inside a template expression. May be
|
|
144
143
|
* extended with other types like string or null if needed, but keep it
|
|
@@ -63,6 +63,14 @@ declare namespace Time {
|
|
|
63
63
|
* The count of the interval.
|
|
64
64
|
*/
|
|
65
65
|
count: number;
|
|
66
|
+
/**
|
|
67
|
+
* A value for how well the returned tick interval fits the input
|
|
68
|
+
* interval. Ranges close to but above 1 indicate that the fit is bad,
|
|
69
|
+
* where 1 is a perfect fit for the _next_ higher interval. For example,
|
|
70
|
+
* if the algorithm lands on weekly ticks but the match is 1.01, it is
|
|
71
|
+
* very close to monthly ticks.
|
|
72
|
+
*/
|
|
73
|
+
match?: number;
|
|
66
74
|
/**
|
|
67
75
|
* The name of the time unit.
|
|
68
76
|
*/
|
package/es-modules/Core/Time.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* */
|
|
11
11
|
'use strict';
|
|
12
12
|
import TimeBase from '../Shared/TimeBase.js';
|
|
13
|
-
import
|
|
14
|
-
|
|
13
|
+
import { defined, extend } from '../Shared/Utilities.js';
|
|
14
|
+
import { timeUnits } from './Utilities.js';
|
|
15
15
|
/* *
|
|
16
16
|
*
|
|
17
17
|
* Constants
|
|
@@ -23,11 +23,6 @@ declare module './Series/SeriesBase' {
|
|
|
23
23
|
tt?: SVGElement;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
declare module './Series/SeriesOptions' {
|
|
27
|
-
interface SeriesOptions {
|
|
28
|
-
tooltip?: Partial<TooltipOptions>;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
26
|
/**
|
|
32
27
|
* Tooltip of a chart.
|
|
33
28
|
*
|
|
@@ -65,6 +60,7 @@ declare class Tooltip {
|
|
|
65
60
|
distance: number;
|
|
66
61
|
followPointer?: boolean;
|
|
67
62
|
hideTimer?: number;
|
|
63
|
+
showTimer?: number;
|
|
68
64
|
isSticky: boolean;
|
|
69
65
|
label?: SVGElement;
|
|
70
66
|
len?: number;
|
|
@@ -133,7 +129,7 @@ declare class Tooltip {
|
|
|
133
129
|
*
|
|
134
130
|
* @function Highcharts.Tooltip#defaultFormatter
|
|
135
131
|
*
|
|
136
|
-
* @param {Highcharts.Tooltip} tooltip
|
|
132
|
+
* @param {Highcharts.Tooltip} tooltip The tooltip instance.
|
|
137
133
|
*
|
|
138
134
|
* @return {string|Array<string>}
|
|
139
135
|
* Returns a string (single tooltip and shared)
|
|
@@ -221,7 +217,7 @@ declare class Tooltip {
|
|
|
221
217
|
}
|
|
222
218
|
declare namespace Tooltip {
|
|
223
219
|
interface FormatterCallbackFunction {
|
|
224
|
-
(this: Point, tooltip: Tooltip): (false | string | Array<string>);
|
|
220
|
+
(this: Point, tooltip: Tooltip, ctx?: Point): (false | string | Array<string>);
|
|
225
221
|
}
|
|
226
222
|
interface HeaderFormatterEventObject {
|
|
227
223
|
isFooter?: boolean;
|
|
@@ -229,7 +225,7 @@ declare namespace Tooltip {
|
|
|
229
225
|
text?: string;
|
|
230
226
|
}
|
|
231
227
|
interface PositionerCallbackFunction {
|
|
232
|
-
(this: Tooltip, labelWidth: number, labelHeight: number, point: (Point | PositionerPointObject), anchor?: [number, number], alignLeft?: boolean): PositionObject;
|
|
228
|
+
(this: Tooltip, labelWidth: number, labelHeight: number, point: (Point | PositionerPointObject), ctx?: Tooltip, anchor?: [number, number], alignLeft?: boolean): PositionObject;
|
|
233
229
|
}
|
|
234
230
|
interface PositionerPointObject {
|
|
235
231
|
isHeader?: boolean;
|
|
@@ -18,8 +18,16 @@ const { composed, dateFormats, doc, isSafari } = H;
|
|
|
18
18
|
import R from './Renderer/RendererUtilities.js';
|
|
19
19
|
const { distribute } = R;
|
|
20
20
|
import RendererRegistry from './Renderer/RendererRegistry.js';
|
|
21
|
-
import
|
|
22
|
-
|
|
21
|
+
import { addEvent, clamp, css, discardElement, extend, fireEvent, getAlignFactor, internalClearTimeout, isArray, isNumber, isObject, isString, merge, pick, pushUnique, splat, syncTimeout } from '../Shared/Utilities.js';
|
|
22
|
+
/**
|
|
23
|
+
* Clear all timeouts for showing and hiding the tooltip.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
const clearTimeouts = (tooltip) => {
|
|
28
|
+
clearTimeout(tooltip.hideTimer);
|
|
29
|
+
clearTimeout(tooltip.showTimer);
|
|
30
|
+
};
|
|
23
31
|
/* *
|
|
24
32
|
*
|
|
25
33
|
* Class
|
|
@@ -118,7 +126,7 @@ class Tooltip {
|
|
|
118
126
|
return points.map((point) => {
|
|
119
127
|
const tooltipOptions = point.series.tooltipOptions, formatPrefix = point.formatPrefix || 'point';
|
|
120
128
|
return (tooltipOptions[formatPrefix + 'Formatter'] ||
|
|
121
|
-
point.tooltipFormatter).call(point, tooltipOptions[formatPrefix + 'Format'] || '');
|
|
129
|
+
point.tooltipFormatter).call(point, tooltipOptions[formatPrefix + 'Format'] || '', point);
|
|
122
130
|
});
|
|
123
131
|
}
|
|
124
132
|
/**
|
|
@@ -150,7 +158,7 @@ class Tooltip {
|
|
|
150
158
|
*
|
|
151
159
|
* @function Highcharts.Tooltip#defaultFormatter
|
|
152
160
|
*
|
|
153
|
-
* @param {Highcharts.Tooltip} tooltip
|
|
161
|
+
* @param {Highcharts.Tooltip} tooltip The tooltip instance.
|
|
154
162
|
*
|
|
155
163
|
* @return {string|Array<string>}
|
|
156
164
|
* Returns a string (single tooltip and shared)
|
|
@@ -187,7 +195,8 @@ class Tooltip {
|
|
|
187
195
|
this.renderer = this.renderer.destroy();
|
|
188
196
|
discardElement(this.container);
|
|
189
197
|
}
|
|
190
|
-
|
|
198
|
+
internalClearTimeout(this.hideTimer);
|
|
199
|
+
clearTimeouts(this);
|
|
191
200
|
}
|
|
192
201
|
/**
|
|
193
202
|
* Extendable method to get the anchor position of the tooltip
|
|
@@ -568,7 +577,7 @@ class Tooltip {
|
|
|
568
577
|
hide(delay) {
|
|
569
578
|
const tooltip = this;
|
|
570
579
|
// Disallow duplicate timers (#1728, #1766)
|
|
571
|
-
|
|
580
|
+
clearTimeouts(this);
|
|
572
581
|
delay = pick(delay, this.options.hideDelay);
|
|
573
582
|
if (!this.isHidden) {
|
|
574
583
|
this.hideTimer = syncTimeout(function () {
|
|
@@ -727,7 +736,7 @@ class Tooltip {
|
|
|
727
736
|
if (!options.enabled || !point.series) { // #16820
|
|
728
737
|
return;
|
|
729
738
|
}
|
|
730
|
-
|
|
739
|
+
clearTimeouts(this);
|
|
731
740
|
// A switch saying if this specific tooltip configuration allows shared
|
|
732
741
|
// or split modes
|
|
733
742
|
tooltip.allowShared = !(!isArray(pointOrPoints) &&
|
|
@@ -747,7 +756,7 @@ class Tooltip {
|
|
|
747
756
|
this.len = points.length; // #6128
|
|
748
757
|
const text = isString(formatString) ?
|
|
749
758
|
format(formatString, point, chart) :
|
|
750
|
-
formatter.call(point, tooltip);
|
|
759
|
+
formatter.call(point, tooltip, point);
|
|
751
760
|
// Reset the preliminary circular references
|
|
752
761
|
point.points = void 0;
|
|
753
762
|
// Register the current series
|
|
@@ -758,79 +767,83 @@ class Tooltip {
|
|
|
758
767
|
this.hide();
|
|
759
768
|
}
|
|
760
769
|
else {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
else {
|
|
766
|
-
let checkX = x;
|
|
767
|
-
let checkY = y;
|
|
768
|
-
if (mouseEvent && pointer.isDirectTouch) {
|
|
769
|
-
checkX = mouseEvent.chartX - chart.plotLeft;
|
|
770
|
-
checkY = mouseEvent.chartY - chart.plotTop;
|
|
770
|
+
this.showTimer = syncTimeout(() => {
|
|
771
|
+
// Update text
|
|
772
|
+
if (tooltip.split && tooltip.allowShared) { // #13868
|
|
773
|
+
tooltip.renderSplit(text, points);
|
|
771
774
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
const label = tooltip.getLabel(wasShared && tooltip.tt || {});
|
|
779
|
-
// Prevent the tooltip from flowing over the chart box
|
|
780
|
-
// (#6659)
|
|
781
|
-
if (!options.style.width || styledMode) {
|
|
782
|
-
label.css({
|
|
783
|
-
width: (this.outside ?
|
|
784
|
-
this.getPlayingField() :
|
|
785
|
-
chart.spacingBox).width + 'px'
|
|
786
|
-
});
|
|
775
|
+
else {
|
|
776
|
+
let checkX = x;
|
|
777
|
+
let checkY = y;
|
|
778
|
+
if (mouseEvent && pointer.isDirectTouch) {
|
|
779
|
+
checkX = mouseEvent.chartX - chart.plotLeft;
|
|
780
|
+
checkY = mouseEvent.chartY - chart.plotTop;
|
|
787
781
|
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
782
|
+
// #11493, #13095
|
|
783
|
+
if (chart.polar ||
|
|
784
|
+
currentSeries.options.clip === false ||
|
|
785
|
+
points.some((p) => // #16004
|
|
786
|
+
pointer.isDirectTouch || // ##17929
|
|
787
|
+
p.series.shouldShowTooltip(checkX, checkY))) {
|
|
788
|
+
const label = tooltip.getLabel(wasShared && tooltip.tt || {});
|
|
789
|
+
// Prevent the tooltip from flowing over the chart box
|
|
790
|
+
// (#6659)
|
|
791
|
+
if (!options.style.width || styledMode) {
|
|
792
|
+
label.css({
|
|
793
|
+
width: (this.outside ?
|
|
794
|
+
this.getPlayingField() :
|
|
795
|
+
chart.spacingBox).width + 'px'
|
|
796
|
+
});
|
|
797
|
+
}
|
|
799
798
|
label.attr({
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
799
|
+
// Add class before the label BBox calculation
|
|
800
|
+
// (#21035)
|
|
801
|
+
'class': tooltip.getClassName(point),
|
|
802
|
+
text: isArray(text) ?
|
|
803
|
+
text.join('') :
|
|
804
|
+
text
|
|
803
805
|
});
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
806
|
+
// When the length of the label has increased,
|
|
807
|
+
// immediately update the x position to prevent
|
|
808
|
+
// tooltip from flowing outside the viewport
|
|
809
|
+
// during animation (#21371)
|
|
810
|
+
if (this.outside) {
|
|
811
|
+
label.attr({
|
|
812
|
+
x: clamp(label.x || 0, 0, this.getPlayingField().width -
|
|
813
|
+
(label.width || 0) -
|
|
814
|
+
1)
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
if (!styledMode) {
|
|
818
|
+
label.attr({
|
|
819
|
+
stroke: (options.borderColor ||
|
|
820
|
+
point.color ||
|
|
821
|
+
currentSeries.color ||
|
|
822
|
+
"#666666" /* Palette.neutralColor60 */)
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
tooltip.updatePosition({
|
|
826
|
+
plotX: x,
|
|
827
|
+
plotY: y,
|
|
828
|
+
negative: point.negative,
|
|
829
|
+
ttBelow: point.ttBelow,
|
|
830
|
+
series: currentSeries,
|
|
831
|
+
h: anchor[2] || 0
|
|
811
832
|
});
|
|
812
833
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
ttBelow: point.ttBelow,
|
|
818
|
-
series: currentSeries,
|
|
819
|
-
h: anchor[2] || 0
|
|
820
|
-
});
|
|
834
|
+
else {
|
|
835
|
+
tooltip.hide();
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
821
838
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
839
|
+
// Show it
|
|
840
|
+
if (tooltip.isHidden && tooltip.label) {
|
|
841
|
+
tooltip.label.attr({
|
|
842
|
+
opacity: 1
|
|
843
|
+
}).show();
|
|
825
844
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
if (tooltip.isHidden && tooltip.label) {
|
|
829
|
-
tooltip.label.attr({
|
|
830
|
-
opacity: 1
|
|
831
|
-
}).show();
|
|
832
|
-
}
|
|
833
|
-
tooltip.isHidden = false;
|
|
845
|
+
tooltip.isHidden = false;
|
|
846
|
+
}, tooltip.isHidden ? options.showDelay || 0 : 0);
|
|
834
847
|
}
|
|
835
848
|
fireEvent(this, 'refresh');
|
|
836
849
|
}
|
|
@@ -905,7 +918,7 @@ class Tooltip {
|
|
|
905
918
|
* Calculate the position of the partial tooltip
|
|
906
919
|
* @internal
|
|
907
920
|
*/
|
|
908
|
-
const defaultPositioner = function (boxWidth, boxHeight, point, anchor = [0, 0], alignedLeft = true) {
|
|
921
|
+
const defaultPositioner = function (boxWidth, boxHeight, point, ctx, anchor = [0, 0], alignedLeft = true) {
|
|
909
922
|
let x, y;
|
|
910
923
|
if (point.isHeader) {
|
|
911
924
|
y = headerTop ? 0 : adjustedPlotHeight;
|
|
@@ -1005,7 +1018,7 @@ class Tooltip {
|
|
|
1005
1018
|
}
|
|
1006
1019
|
const { anchorX, anchorY } = getAnchor(point);
|
|
1007
1020
|
if (typeof anchorY === 'number') {
|
|
1008
|
-
const size = bBox.height + 1, boxPosition = (positioner || defaultPositioner).call(tooltip, boxWidth, size, point, [anchorX, anchorY]);
|
|
1021
|
+
const size = bBox.height + 1, boxPosition = (positioner || defaultPositioner).call(tooltip, boxWidth, size, point, tooltip, [anchorX, anchorY]);
|
|
1009
1022
|
boxes.push({
|
|
1010
1023
|
// 0-align to the top, 1-align to the bottom
|
|
1011
1024
|
align: hasFixedPosition ? 0 : void 0,
|
|
@@ -1043,7 +1056,7 @@ class Tooltip {
|
|
|
1043
1056
|
bounds.right - boxStart > boxStart;
|
|
1044
1057
|
})) {
|
|
1045
1058
|
boxes = boxes.map((box) => {
|
|
1046
|
-
const { x, y } = defaultPositioner.call(this, box.boxWidth, box.size, box.point, [box.anchorX, box.anchorY], false);
|
|
1059
|
+
const { x, y } = defaultPositioner.call(this, box.boxWidth, box.size, box.point, void 0, [box.anchorX, box.anchorY], false);
|
|
1047
1060
|
return extend(box, {
|
|
1048
1061
|
target: y,
|
|
1049
1062
|
x
|
|
@@ -1180,9 +1193,7 @@ class Tooltip {
|
|
|
1180
1193
|
.add(label);
|
|
1181
1194
|
// For a rapid move going outside of the elements keeping the
|
|
1182
1195
|
// tooltip visible, cancel the hide (#23512).
|
|
1183
|
-
addEvent(tooltip.tracker.element, 'mouseenter', () =>
|
|
1184
|
-
clearTimeout(tooltip.hideTimer);
|
|
1185
|
-
});
|
|
1196
|
+
addEvent(tooltip.tracker.element, 'mouseenter', () => clearTimeouts(tooltip));
|
|
1186
1197
|
if (!chart.styledMode) {
|
|
1187
1198
|
tooltip.tracker.attr({
|
|
1188
1199
|
fill: 'rgba(0,0,0,0)'
|
|
@@ -1254,14 +1265,14 @@ class Tooltip {
|
|
|
1254
1265
|
* @internal
|
|
1255
1266
|
* @function Highcharts.Tooltip#updatePosition
|
|
1256
1267
|
*
|
|
1257
|
-
* @param {Highcharts.Point} point
|
|
1268
|
+
* @param {Highcharts.Point} point The point object.
|
|
1258
1269
|
*/
|
|
1259
1270
|
updatePosition(point) {
|
|
1260
1271
|
const { chart, container, distance, options, pointer, renderer } = this, label = this.getLabel(), { height = 0, width = 0 } = label, { fixed, positioner } = options,
|
|
1261
1272
|
// Needed for outside: true (#11688)
|
|
1262
1273
|
{ left, top, scaleX, scaleY } = pointer.getChartPosition(), pos = (positioner ||
|
|
1263
1274
|
(fixed && this.getFixedPosition) ||
|
|
1264
|
-
this.getPosition).call(this, width, height, point), doc = H.doc;
|
|
1275
|
+
this.getPosition).call(this, width, height, point, this), doc = H.doc;
|
|
1265
1276
|
let anchorX = (point.plotX || 0) + chart.plotLeft, anchorY = (point.plotY || 0) + chart.plotTop, pad;
|
|
1266
1277
|
// Set the renderer size dynamically to prevent document size to change.
|
|
1267
1278
|
// Renderer only exists when tooltip is outside.
|
|
@@ -1360,6 +1371,10 @@ export default Tooltip;
|
|
|
1360
1371
|
* @param {Highcharts.Tooltip} tooltip
|
|
1361
1372
|
* The tooltip instance
|
|
1362
1373
|
*
|
|
1374
|
+
* @param {Highcharts.Point} [ctx]
|
|
1375
|
+
* Since v12.5.0, the point context passed as an extra argument for arrow
|
|
1376
|
+
* functions.
|
|
1377
|
+
*
|
|
1363
1378
|
* @return {false|string|Array<(string|null|undefined)>|null|undefined}
|
|
1364
1379
|
* Formatted text or false
|
|
1365
1380
|
*/
|
|
@@ -1380,6 +1395,10 @@ export default Tooltip;
|
|
|
1380
1395
|
* @param {Highcharts.TooltipPositionerPointObject} point
|
|
1381
1396
|
* Point information for positioning a tooltip.
|
|
1382
1397
|
*
|
|
1398
|
+
* @param {Highcharts.Tooltip} [ctx]
|
|
1399
|
+
* Since v12.5.0, the tooltip context passed as an extra argument for arrow
|
|
1400
|
+
* functions.
|
|
1401
|
+
*
|
|
1383
1402
|
* @return {Highcharts.PositionObject}
|
|
1384
1403
|
* New position for the tooltip.
|
|
1385
1404
|
*/
|
|
@@ -14,9 +14,42 @@ declare module './Options' {
|
|
|
14
14
|
}
|
|
15
15
|
declare module './Series/SeriesOptions' {
|
|
16
16
|
interface SeriesOptions {
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* A configuration object for the tooltip rendering of each single
|
|
19
|
+
* series. Properties are inherited from [tooltip](#tooltip), but only
|
|
20
|
+
* the following properties can be defined on a series level.
|
|
21
|
+
*
|
|
22
|
+
* @since 2.3
|
|
23
|
+
*/
|
|
24
|
+
tooltip?: SeriesTooltipOptions;
|
|
18
25
|
}
|
|
19
26
|
}
|
|
27
|
+
export interface SeriesTooltipOptions extends Partial<TooltipOptions> {
|
|
28
|
+
animation?: undefined;
|
|
29
|
+
backgroundColor?: undefined;
|
|
30
|
+
borderColor?: undefined;
|
|
31
|
+
borderRadius?: undefined;
|
|
32
|
+
borderWidth?: undefined;
|
|
33
|
+
className?: undefined;
|
|
34
|
+
crosshairs?: undefined;
|
|
35
|
+
enabled?: undefined;
|
|
36
|
+
fixed?: undefined;
|
|
37
|
+
formatter?: undefined;
|
|
38
|
+
headerShape?: undefined;
|
|
39
|
+
hideDelay?: undefined;
|
|
40
|
+
outside?: undefined;
|
|
41
|
+
padding?: undefined;
|
|
42
|
+
positioner?: undefined;
|
|
43
|
+
shadow?: undefined;
|
|
44
|
+
shape?: undefined;
|
|
45
|
+
shared?: undefined;
|
|
46
|
+
showDelay?: number;
|
|
47
|
+
snap?: undefined;
|
|
48
|
+
split?: undefined;
|
|
49
|
+
stickOnContact?: undefined;
|
|
50
|
+
style?: undefined;
|
|
51
|
+
useHTML?: undefined;
|
|
52
|
+
}
|
|
20
53
|
/**
|
|
21
54
|
* Options for the tooltip that appears when the user hovers over a
|
|
22
55
|
* series or point.
|
|
@@ -532,6 +565,16 @@ export interface TooltipOptions {
|
|
|
532
565
|
* @product highcharts highstock
|
|
533
566
|
*/
|
|
534
567
|
shared: boolean;
|
|
568
|
+
/**
|
|
569
|
+
* The number of milliseconds to wait until the crosshair is shown when
|
|
570
|
+
* mouse over a point. Works on initial hover.
|
|
571
|
+
*
|
|
572
|
+
* @sample {highcharts|highstock} highcharts/tooltip/showdelay/
|
|
573
|
+
*
|
|
574
|
+
* @default 0
|
|
575
|
+
* @since next
|
|
576
|
+
*/
|
|
577
|
+
showDelay?: number;
|
|
535
578
|
/**
|
|
536
579
|
* Proximity snap for graphs or single points. It defaults to 10 for
|
|
537
580
|
* mouse-powered devices and 25 for touch devices.
|