@highcharts/grid-pro 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/LICENSE.txt +6 -0
  2. package/README.md +15 -9
  3. package/css/grid-pro.css +1262 -1122
  4. package/css/modules/grid-base-variables.css +131 -0
  5. package/css/modules/grid-button-variables.css +140 -0
  6. package/css/modules/grid-caption-variables.css +11 -0
  7. package/css/modules/grid-description-variables.css +11 -0
  8. package/css/modules/grid-input-variables.css +114 -0
  9. package/css/modules/grid-link-variables.css +18 -0
  10. package/css/modules/grid-menu-variables.css +50 -0
  11. package/css/modules/grid-pagination-variables.css +12 -0
  12. package/css/modules/grid-popup-variables.css +24 -0
  13. package/css/modules/grid-pro.css +234 -0
  14. package/css/modules/grid-table-variables.css +385 -0
  15. package/css/modules/grid-theme-default.css +55 -0
  16. package/es-modules/Accessibility/A11yI18n.js +1 -2
  17. package/es-modules/Accessibility/Accessibility.js +1 -2
  18. package/es-modules/Accessibility/AccessibilityComponent.d.ts +2 -2
  19. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +5 -6
  20. package/es-modules/Accessibility/Components/LegendComponent.js +1 -2
  21. package/es-modules/Accessibility/Components/MenuComponent.js +1 -2
  22. package/es-modules/Accessibility/Components/NavigatorComponent.js +3 -4
  23. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +1 -2
  24. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +1 -2
  25. package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +3 -4
  26. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +3 -4
  27. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +1 -2
  28. package/es-modules/Accessibility/Components/ZoomComponent.js +1 -2
  29. package/es-modules/Accessibility/FocusBorder.js +1 -2
  30. package/es-modules/Accessibility/KeyboardNavigation.js +1 -2
  31. package/es-modules/Accessibility/KeyboardNavigationHandler.js +1 -2
  32. package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
  33. package/es-modules/Accessibility/Options/A11yDefaults.js +11 -0
  34. package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
  35. package/es-modules/Accessibility/Options/DeprecatedOptions.js +7 -2
  36. package/es-modules/Accessibility/Options/LangDefaults.js +9 -0
  37. package/es-modules/Accessibility/ProxyElement.js +2 -5
  38. package/es-modules/Accessibility/ProxyProvider.js +1 -2
  39. package/es-modules/Accessibility/Utils/Announcer.js +2 -3
  40. package/es-modules/Accessibility/Utils/ChartUtilities.js +1 -2
  41. package/es-modules/Accessibility/Utils/EventProvider.d.ts +2 -2
  42. package/es-modules/Accessibility/Utils/EventProvider.js +6 -2
  43. package/es-modules/Accessibility/Utils/HTMLUtilities.js +1 -2
  44. package/es-modules/Core/Animation/AnimationUtilities.js +1 -2
  45. package/es-modules/Core/Animation/Fx.js +1 -2
  46. package/es-modules/Core/Callback.d.ts +9 -2
  47. package/es-modules/Core/Chart/Chart.js +48 -41
  48. package/es-modules/Core/Chart/Chart3D.js +1 -2
  49. package/es-modules/Core/Chart/ChartDefaults.js +11 -0
  50. package/es-modules/Core/Chart/ChartOptions.d.ts +8 -0
  51. package/es-modules/Core/Chart/GanttChart.js +1 -2
  52. package/es-modules/Core/Chart/MapChart.js +1 -2
  53. package/es-modules/Core/Chart/StockChart.js +2 -3
  54. package/es-modules/Core/Color/Color.js +1 -2
  55. package/es-modules/Core/Defaults.js +36 -9
  56. package/es-modules/Core/Delaunay.d.ts +52 -0
  57. package/es-modules/Core/Delaunay.js +310 -0
  58. package/es-modules/Core/Foundation.js +1 -2
  59. package/es-modules/Core/Geometry/CircleUtilities.js +1 -2
  60. package/es-modules/Core/Globals.js +1 -1
  61. package/es-modules/Core/HttpUtilities.js +1 -2
  62. package/es-modules/Core/MSPointer.js +1 -2
  63. package/es-modules/Core/Math3D.js +1 -2
  64. package/es-modules/Core/Options.d.ts +6 -2
  65. package/es-modules/Core/Pointer.js +23 -4
  66. package/es-modules/Core/PointerEvent.d.ts +2 -0
  67. package/es-modules/Core/Renderer/HTML/AST.js +2 -2
  68. package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -2
  69. package/es-modules/Core/Renderer/RendererUtilities.js +34 -19
  70. package/es-modules/Core/Responsive.d.ts +4 -2
  71. package/es-modules/Core/Responsive.js +10 -4
  72. package/es-modules/Core/Templating.d.ts +1 -1
  73. package/es-modules/Core/Templating.js +3 -4
  74. package/es-modules/Core/Time.d.ts +8 -0
  75. package/es-modules/Core/Time.js +2 -2
  76. package/es-modules/Core/Tooltip.d.ts +4 -8
  77. package/es-modules/Core/Tooltip.js +100 -81
  78. package/es-modules/Core/TooltipOptions.d.ts +44 -1
  79. package/es-modules/Core/Utilities.d.ts +25 -665
  80. package/es-modules/Core/Utilities.js +17 -1398
  81. package/es-modules/Data/ColumnUtils.d.ts +83 -80
  82. package/es-modules/Data/ColumnUtils.js +103 -113
  83. package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
  84. package/es-modules/Data/Connectors/CSVConnector.js +3 -4
  85. package/es-modules/Data/Connectors/DataConnector.d.ts +52 -54
  86. package/es-modules/Data/Connectors/DataConnector.js +33 -52
  87. package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
  88. package/es-modules/Data/Connectors/GoogleSheetsConnector.js +73 -88
  89. package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +4 -2
  90. package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
  91. package/es-modules/Data/Connectors/HTMLTableConnector.js +3 -4
  92. package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
  93. package/es-modules/Data/Connectors/JSONConnector.js +3 -4
  94. package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
  95. package/es-modules/Data/Converters/CSVConverter.js +3 -4
  96. package/es-modules/Data/Converters/CSVConverterOptions.d.ts +2 -2
  97. package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
  98. package/es-modules/Data/Converters/DataConverter.js +26 -53
  99. package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
  100. package/es-modules/Data/Converters/DataConverterUtils.js +169 -181
  101. package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
  102. package/es-modules/Data/Converters/GoogleSheetsConverter.js +3 -3
  103. package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +2 -2
  104. package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
  105. package/es-modules/Data/Converters/HTMLTableConverter.js +2 -3
  106. package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +2 -2
  107. package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
  108. package/es-modules/Data/Converters/JSONConverter.js +6 -6
  109. package/es-modules/Data/Converters/JSONConverterOptions.d.ts +2 -2
  110. package/es-modules/Data/DataCursor.d.ts +65 -70
  111. package/es-modules/Data/DataCursor.js +119 -139
  112. package/es-modules/Data/DataEvent.d.ts +55 -57
  113. package/es-modules/Data/DataPool.d.ts +10 -17
  114. package/es-modules/Data/DataPool.js +20 -9
  115. package/es-modules/Data/DataTable.d.ts +111 -113
  116. package/es-modules/Data/DataTable.js +3 -3
  117. package/es-modules/Data/DataTableCore.d.ts +9 -9
  118. package/es-modules/Data/DataTableCore.js +2 -2
  119. package/es-modules/Data/Formula/FormulaParser.js +1 -2
  120. package/es-modules/Data/Formula/FormulaProcessor.js +1 -2
  121. package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
  122. package/es-modules/Data/Modifiers/ChainModifier.js +7 -8
  123. package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
  124. package/es-modules/Data/Modifiers/DataModifier.js +31 -53
  125. package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
  126. package/es-modules/Data/Modifiers/FilterModifier.js +3 -4
  127. package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
  128. package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
  129. package/es-modules/Data/Modifiers/InvertModifier.js +3 -4
  130. package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
  131. package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
  132. package/es-modules/Data/Modifiers/RangeModifier.js +3 -4
  133. package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
  134. package/es-modules/Data/Modifiers/SortModifier.js +3 -4
  135. package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +3 -3
  136. package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +1 -1
  137. package/es-modules/Grid/Core/Accessibility/Accessibility.js +5 -6
  138. package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
  139. package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
  140. package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
  141. package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
  142. package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
  143. package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
  144. package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
  145. package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
  146. package/es-modules/Grid/Core/Defaults.js +4 -2
  147. package/es-modules/Grid/Core/Globals.d.ts +20 -16
  148. package/es-modules/Grid/Core/Globals.js +10 -8
  149. package/es-modules/Grid/Core/Grid.d.ts +31 -22
  150. package/es-modules/Grid/Core/Grid.js +214 -136
  151. package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
  152. package/es-modules/Grid/Core/GridUtils.js +50 -3
  153. package/es-modules/Grid/Core/Options.d.ts +145 -4
  154. package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
  155. package/es-modules/Grid/Core/Pagination/Pagination.js +63 -23
  156. package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -0
  157. package/es-modules/Grid/Core/Querying/FilteringController.js +1 -2
  158. package/es-modules/Grid/Core/Querying/PaginationController.d.ts +2 -2
  159. package/es-modules/Grid/Core/Querying/PaginationController.js +3 -3
  160. package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
  161. package/es-modules/Grid/Core/Querying/QueryingController.js +2 -26
  162. package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
  163. package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +229 -0
  164. package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
  165. package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
  166. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +2 -3
  167. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +1 -1
  168. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +3 -4
  169. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
  170. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +2 -2
  171. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +17 -1
  172. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +58 -15
  173. package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +1 -3
  174. package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +57 -3
  175. package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +397 -118
  176. package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
  177. package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
  178. package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +27 -13
  179. package/es-modules/Grid/Core/Table/Body/TableCell.js +74 -25
  180. package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +7 -15
  181. package/es-modules/Grid/Core/Table/Body/TableRow.js +24 -19
  182. package/es-modules/Grid/Core/Table/Cell.d.ts +16 -3
  183. package/es-modules/Grid/Core/Table/Cell.js +36 -3
  184. package/es-modules/Grid/Core/Table/CellContent/TextContent.js +3 -8
  185. package/es-modules/Grid/Core/Table/Column.d.ts +10 -4
  186. package/es-modules/Grid/Core/Table/Column.js +23 -34
  187. package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +9 -8
  188. package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +4 -3
  189. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
  190. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +7 -2
  191. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +1 -2
  192. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +1 -2
  193. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +2 -3
  194. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +1 -2
  195. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +1 -2
  196. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +0 -1
  197. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +4 -14
  198. package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +6 -1
  199. package/es-modules/Grid/Core/Table/Header/HeaderCell.js +33 -13
  200. package/es-modules/Grid/Core/Table/Header/HeaderRow.js +4 -5
  201. package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
  202. package/es-modules/Grid/Core/Table/Header/TableHeader.js +3 -3
  203. package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
  204. package/es-modules/Grid/Core/Table/Row.js +2 -2
  205. package/es-modules/Grid/Core/Table/Table.d.ts +38 -12
  206. package/es-modules/Grid/Core/Table/Table.js +184 -91
  207. package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
  208. package/es-modules/Grid/Core/UI/ContextMenuButton.js +5 -3
  209. package/es-modules/Grid/Core/UI/Popup.js +7 -9
  210. package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
  211. package/es-modules/Grid/Core/UI/SvgIcons.js +206 -33
  212. package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
  213. package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
  214. package/es-modules/Grid/Core/UI/ToolbarButton.js +8 -26
  215. package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +2 -2
  216. package/es-modules/Grid/Pro/CellEditing/CellEditing.js +10 -10
  217. package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +1 -2
  218. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
  219. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +4 -2
  220. package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
  221. package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +1 -2
  222. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
  223. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +1 -2
  224. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
  225. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +1 -2
  226. package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +1 -2
  227. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +1 -2
  228. package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +1 -2
  229. package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +1 -2
  230. package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +1 -2
  231. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +2 -2
  232. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +1 -2
  233. package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +1 -2
  234. package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +1 -2
  235. package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +1 -2
  236. package/es-modules/Grid/Pro/ColumnTypes/Validator.js +34 -32
  237. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
  238. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +3 -4
  239. package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +1 -3
  240. package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
  241. package/es-modules/Grid/Pro/Data/DataSourceHelper.js +246 -0
  242. package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
  243. package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
  244. package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
  245. package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
  246. package/es-modules/Grid/Pro/Export/Exporting.js +1 -2
  247. package/es-modules/Grid/Pro/Export/ExportingComposition.js +1 -2
  248. package/es-modules/Grid/Pro/GridEvents.js +1 -2
  249. package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
  250. package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +1 -2
  251. package/es-modules/Shared/BaseForm.js +1 -2
  252. package/es-modules/Shared/DownloadURL.js +1 -2
  253. package/es-modules/Shared/TimeBase.js +3 -3
  254. package/es-modules/Shared/Types.d.ts +7 -0
  255. package/es-modules/Shared/Utilities.d.ts +576 -0
  256. package/es-modules/Shared/Utilities.js +1368 -0
  257. package/es-modules/masters/grid-pro.src.d.ts +15 -11
  258. package/es-modules/masters/grid-pro.src.js +12 -5
  259. package/grid-pro.d.ts +15 -11
  260. package/grid-pro.js +3 -3
  261. package/grid-pro.js.map +1 -1
  262. package/grid-pro.src.d.ts +15 -11
  263. package/grid-pro.src.js +10408 -8009
  264. package/package.json +1 -1
  265. package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
  266. package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
@@ -0,0 +1,310 @@
1
+ /* *
2
+ *
3
+ * (c) 2009-2025 Highsoft AS
4
+ *
5
+ * License: www.highcharts.com/license
6
+ *
7
+ * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
8
+ *
9
+ * Authors:
10
+ * - Dawid Dragula
11
+ *
12
+ * */
13
+ 'use strict';
14
+ /* *
15
+ *
16
+ * Class
17
+ *
18
+ * */
19
+ /**
20
+ * Delaunay triangulation of a 2D point set.
21
+ */
22
+ class Delaunay {
23
+ /* *
24
+ *
25
+ * Constructor
26
+ *
27
+ * */
28
+ /**
29
+ * Create a new Delaunay triangulation.
30
+ *
31
+ * @param {Float32Array|Float64Array} points
32
+ * A 1D array of points in the format [x0, y0, x1, y1, ...].
33
+ */
34
+ constructor(points) {
35
+ this.points = points;
36
+ const n = points.length >>> 1;
37
+ // Floating-point error multiplier used by geometric predicates.
38
+ this.epsilon = 4 * Number.EPSILON;
39
+ let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
40
+ for (let i = 0; i < n; i++) {
41
+ const px = points[i << 1], py = points[(i << 1) + 1];
42
+ if (px < minX) {
43
+ minX = px;
44
+ }
45
+ if (px > maxX) {
46
+ maxX = px;
47
+ }
48
+ if (py < minY) {
49
+ minY = py;
50
+ }
51
+ if (py > maxY) {
52
+ maxY = py;
53
+ }
54
+ }
55
+ const rangeX = maxX - minX || 1, rangeY = maxY - minY || 1;
56
+ this.minX = minX;
57
+ this.minY = minY;
58
+ this.invScaleX = 1 / rangeX;
59
+ this.invScaleY = 1 / rangeY;
60
+ const ids = new Uint32Array(n), x = (i) => (points[i << 1] - minX) * this.invScaleX, y = (i) => (points[(i << 1) + 1] - minY) * this.invScaleY;
61
+ for (let i = 0; i < n; i++) {
62
+ ids[i] = i;
63
+ }
64
+ ids.sort((a, b) => (x(a) - x(b)) || (y(a) - y(b)));
65
+ let m = n ? 1 : 0, pa, pb;
66
+ for (let i = 1; i < n; ++i) {
67
+ pa = ids[m - 1],
68
+ pb = ids[i];
69
+ if (x(pa) !== x(pb) || y(pa) !== y(pb)) {
70
+ ids[m++] = pb;
71
+ }
72
+ }
73
+ this.ids = ids.subarray(0, m);
74
+ this.triangles = this.triangulate();
75
+ }
76
+ /* *
77
+ *
78
+ * Methods
79
+ *
80
+ * */
81
+ /**
82
+ * Triangulate the points.
83
+ *
84
+ * @return {Uint32Array}
85
+ * A 1D array of triangle vertex indices.
86
+ */
87
+ triangulate() {
88
+ const count = this.ids.length;
89
+ if (count < 3) {
90
+ return new Uint32Array(0);
91
+ }
92
+ const points = this.points, { minX, minY, invScaleX, invScaleY } = this, x = (i) => (points[i << 1] - minX) * invScaleX, y = (i) => (points[(i << 1) + 1] - minY) * invScaleY;
93
+ // Determine if three points are in counter-clockwise order.
94
+ const orient = (a, b, c) => {
95
+ const ax = x(a), ay = y(a), bx = x(b) - ax, by = y(b) - ay, cx = x(c) - ax, cy = y(c) - ay, det = bx * cy - by * cx, err = (Math.abs(bx * cy) + Math.abs(by * cx)) * this.epsilon;
96
+ return det > err;
97
+ };
98
+ // Determine if a point (d) is inside the circumcircle of a triangle
99
+ // (a, b, c).
100
+ const inCircle = (a, b, c, d) => {
101
+ if (a === d || b === d || c === d) {
102
+ // Skip if d is one of the triangle vertices.
103
+ return false;
104
+ }
105
+ const ax = x(a) - x(d), ay = y(a) - y(d), bx = x(b) - x(d), by = y(b) - y(d), cx = x(c) - x(d), cy = y(c) - y(d), aa = ax * ax + ay * ay, bb = bx * bx + by * by, cc = cx * cx + cy * cy, term1 = by * cc - bb * cy, term2 = bx * cc - bb * cx, term3 = bx * cy - by * cx, det = ax * term1 - ay * term2 + aa * term3, err = (Math.abs(ax * term1) +
106
+ Math.abs(ay * term2) +
107
+ Math.abs(aa * term3)) * this.epsilon;
108
+ return det > err;
109
+ };
110
+ // Data structures for the quad-edge data structure.
111
+ let cap = Math.max(32, ((8 * count + 7) & ~3)), // Capacity (% 4 = 0)
112
+ on = new Int32Array(cap), // Next edge in same face
113
+ rt = new Int32Array(cap), // Rotation of edge (90 degrees)
114
+ vtx = new Uint32Array(cap), // Origin vertex of edge
115
+ seen = new Uint8Array(cap), // Visited flag for edge traversal
116
+ top = 0; // Next free edge id (% 4 = 0)
117
+ // Ensure the data structures have enough capacity for the required
118
+ // number of edges.
119
+ const ensure = (need) => {
120
+ // If the capacity is sufficient, return.
121
+ if (need <= cap) {
122
+ return;
123
+ }
124
+ // Double capacity until sufficient.
125
+ let ncap = cap << 1;
126
+ while (ncap < need) {
127
+ ncap <<= 1;
128
+ }
129
+ const on2 = new Int32Array(ncap), rt2 = new Int32Array(ncap), v2 = new Uint32Array(ncap), s2 = new Uint8Array(ncap);
130
+ on2.set(on);
131
+ rt2.set(rt);
132
+ v2.set(vtx);
133
+ s2.set(seen);
134
+ on = on2;
135
+ rt = rt2;
136
+ vtx = v2;
137
+ seen = s2;
138
+ cap = ncap;
139
+ };
140
+ const sym = (e) => rt[rt[e]], rotSym = (e) => sym(rt[e]), dest = (e) => vtx[sym(e)], lnext = (e) => rt[on[rotSym(e)]], oprev = (e) => rt[on[rt[e]]], rprev = (e) => on[sym(e)], leftOf = (p, e) => orient(p, vtx[e], dest(e)), rightOf = (p, e) => orient(p, dest(e), vtx[e]), admissible = (e, base) => rightOf(dest(e), base);
141
+ // Create a new edge between two vertices.
142
+ const makeEdge = (a, b) => {
143
+ ensure(top + 4);
144
+ const e0 = top, e1 = top + 1, e2 = top + 2, e3 = top + 3;
145
+ top += 4;
146
+ // Rot cycle
147
+ rt[e0] = e1;
148
+ rt[e1] = e2;
149
+ rt[e2] = e3;
150
+ rt[e3] = e0;
151
+ // Onext initial
152
+ on[e0] = e0;
153
+ on[e2] = e2;
154
+ on[e1] = e3;
155
+ on[e3] = e1;
156
+ // Origins
157
+ vtx[e0] = a;
158
+ vtx[e2] = b;
159
+ vtx[e1] = 0xffffffff;
160
+ vtx[e3] = 0xffffffff;
161
+ return e0;
162
+ };
163
+ // Splice two edges.
164
+ const splice = (a, b) => {
165
+ const alpha = rt[on[a]];
166
+ const beta = rt[on[b]];
167
+ const t2 = on[a];
168
+ const t3 = on[beta];
169
+ const t4 = on[alpha];
170
+ on[a] = on[b];
171
+ on[b] = t2;
172
+ on[alpha] = t3;
173
+ on[beta] = t4;
174
+ };
175
+ // Connect two edges.
176
+ const connect = (a, b) => {
177
+ const q = makeEdge(dest(a), vtx[b]);
178
+ splice(q, lnext(a));
179
+ splice(sym(q), b);
180
+ return q;
181
+ };
182
+ // Removes an edge from both sides.
183
+ const drop = (e) => {
184
+ splice(e, oprev(e));
185
+ const es = sym(e);
186
+ splice(es, oprev(es));
187
+ };
188
+ const A = this.ids;
189
+ // Recursively triangulate a range [lo, hi) of points. Returns the
190
+ // two endpoints [left, right] of the lower common tangent.
191
+ const solve = (lo, hi) => {
192
+ const len = hi - lo;
193
+ // If there are only two points, create a single edge.
194
+ if (len === 2) {
195
+ const a = makeEdge(A[lo], A[lo + 1]);
196
+ return [a, sym(a)];
197
+ }
198
+ // If there are three points, create two edges and connect them.
199
+ if (len === 3) {
200
+ const a = makeEdge(A[lo], A[lo + 1]), b = makeEdge(A[lo + 1], A[lo + 2]);
201
+ splice(sym(a), b);
202
+ const p0 = A[lo], p1 = A[lo + 1], p2 = A[lo + 2];
203
+ if (orient(p0, p1, p2)) {
204
+ connect(b, a);
205
+ return [a, sym(b)];
206
+ }
207
+ if (orient(p0, p2, p1)) {
208
+ const c = connect(b, a);
209
+ return [sym(c), c];
210
+ }
211
+ return [a, sym(b)];
212
+ }
213
+ // Find the midpoint of the range.
214
+ const mid = lo + ((len + 1) >>> 1);
215
+ const L = solve(lo, mid);
216
+ const R = solve(mid, hi);
217
+ let ldo = L[0], ldi = L[1], rdi = R[0], rdo = R[1];
218
+ // Lower common tangent
219
+ for (;;) {
220
+ if (leftOf(vtx[rdi], ldi)) {
221
+ ldi = lnext(ldi);
222
+ }
223
+ else if (rightOf(vtx[ldi], rdi)) {
224
+ rdi = rprev(rdi);
225
+ }
226
+ else {
227
+ break;
228
+ }
229
+ }
230
+ let base = connect(sym(rdi), ldi);
231
+ if (vtx[ldi] === vtx[ldo]) {
232
+ ldo = sym(base);
233
+ }
234
+ if (vtx[rdi] === vtx[rdo]) {
235
+ rdo = base;
236
+ }
237
+ // Merge loop - removing bad edges (inCircle) and adding new edges.
238
+ for (;;) {
239
+ // Left candidate
240
+ let lc = on[sym(base)];
241
+ if (admissible(lc, base)) {
242
+ while (inCircle(dest(base), vtx[base], dest(lc), dest(on[lc]))) {
243
+ const t = on[lc];
244
+ drop(lc);
245
+ lc = t;
246
+ }
247
+ }
248
+ // Right candidate
249
+ let rc = oprev(base);
250
+ if (admissible(rc, base)) {
251
+ while (inCircle(dest(base), vtx[base], dest(rc), dest(oprev(rc)))) {
252
+ const t = oprev(rc);
253
+ drop(rc);
254
+ rc = t;
255
+ }
256
+ }
257
+ if (!admissible(lc, base) && !admissible(rc, base)) {
258
+ break;
259
+ }
260
+ if (!admissible(lc, base) || (admissible(rc, base) &&
261
+ inCircle(dest(lc), vtx[lc], vtx[rc], dest(rc)))) {
262
+ base = connect(rc, sym(base));
263
+ }
264
+ else {
265
+ base = connect(sym(base), sym(lc));
266
+ }
267
+ }
268
+ return [ldo, rdo];
269
+ };
270
+ let e0 = solve(0, count)[0];
271
+ while (leftOf(dest(on[e0]), e0)) {
272
+ e0 = on[e0];
273
+ }
274
+ const Q = [e0];
275
+ let qi = 0;
276
+ {
277
+ let c = e0;
278
+ do {
279
+ Q.push(sym(c));
280
+ seen[c] = 1;
281
+ c = lnext(c);
282
+ } while (c !== e0);
283
+ }
284
+ const faces = [];
285
+ let cur, t;
286
+ while (qi < Q.length) {
287
+ const e = Q[qi++];
288
+ if (seen[e]) {
289
+ continue;
290
+ }
291
+ cur = e;
292
+ do {
293
+ faces.push(vtx[cur]);
294
+ t = sym(cur);
295
+ if (!seen[t]) {
296
+ Q.push(t);
297
+ }
298
+ seen[cur] = 1;
299
+ cur = lnext(cur);
300
+ } while (cur !== e);
301
+ }
302
+ return new Uint32Array(faces);
303
+ }
304
+ }
305
+ /* *
306
+ *
307
+ * Default Export
308
+ *
309
+ * */
310
+ export default Delaunay;
@@ -9,8 +9,7 @@
9
9
  *
10
10
  * */
11
11
  'use strict';
12
- import U from './Utilities.js';
13
- const { addEvent, isFunction, objectEach, removeEvent } = U;
12
+ import { addEvent, isFunction, objectEach, removeEvent } from '../Shared/Utilities.js';
14
13
  /* *
15
14
  *
16
15
  * Class Namespace
@@ -9,9 +9,8 @@
9
9
  * */
10
10
  'use strict';
11
11
  import Geometry from './GeometryUtilities.js';
12
- import Utilities from '../Utilities';
12
+ import { correctFloat } from '../../Shared/Utilities.js';
13
13
  const { getAngleBetweenPoints, getCenterOfPoints, getDistanceBetweenPoints } = Geometry;
14
- const { correctFloat } = Utilities;
15
14
  /* *
16
15
  *
17
16
  * Namespace
@@ -25,7 +25,7 @@ var Globals;
25
25
  * Constants
26
26
  *
27
27
  * */
28
- Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '2.2.0', Globals.win = (typeof window !== 'undefined' ?
28
+ Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '2.3.0', Globals.win = (typeof window !== 'undefined' ?
29
29
  window :
30
30
  {}), // eslint-disable-line node/no-unsupported-features/es-builtins
31
31
  Globals.doc = Globals.win.document, Globals.svg = !!Globals.doc?.createElementNS?.(Globals.SVG_NS, 'svg')?.createSVGRect, Globals.pageLang = Globals.doc?.documentElement?.closest('[lang]')?.lang, Globals.userAgent = Globals.win.navigator?.userAgent || '', Globals.isChrome = Globals.win.chrome, Globals.isFirefox = Globals.userAgent.indexOf('Firefox') !== -1, Globals.isMS = /(edge|msie|trident)/i.test(Globals.userAgent) && !Globals.win.opera, Globals.isSafari = !Globals.isChrome && Globals.userAgent.indexOf('Safari') !== -1, Globals.isTouchDevice = /(Mobile|Android|Windows Phone)/.test(Globals.userAgent), Globals.isWebKit = Globals.userAgent.indexOf('AppleWebKit') !== -1, Globals.deg2rad = Math.PI * 2 / 360, Globals.marginNames = [
@@ -11,8 +11,7 @@
11
11
  'use strict';
12
12
  import G from '../Core/Globals.js';
13
13
  const { win } = G;
14
- import U from '../Core/Utilities.js';
15
- const { discardElement, objectEach } = U;
14
+ import { discardElement, objectEach } from '../Shared/Utilities.js';
16
15
  /* *
17
16
  *
18
17
  * Functions
@@ -12,8 +12,7 @@
12
12
  import H from './Globals.js';
13
13
  const { charts, composed, doc, noop, win } = H;
14
14
  import Pointer from './Pointer.js';
15
- import U from './Utilities.js';
16
- const { addEvent, attr, css, defined, objectEach, pick, pushUnique, removeEvent } = U;
15
+ import { addEvent, attr, css, defined, objectEach, pick, pushUnique, removeEvent } from '../Shared/Utilities.js';
17
16
  /* *
18
17
  *
19
18
  * Constants
@@ -10,9 +10,8 @@
10
10
  * */
11
11
  'use strict';
12
12
  import H from './Globals.js';
13
+ import { pick } from '../Shared/Utilities.js';
13
14
  const { deg2rad } = H;
14
- import U from './Utilities.js';
15
- const { pick } = U;
16
15
  /* *
17
16
  *
18
17
  * Functions
@@ -194,7 +194,7 @@ export interface LoadingOptions {
194
194
  * @sample highcharts/loading/hideduration/
195
195
  * Fade in and out over a second
196
196
  *
197
- * @default 100
197
+ * @default 0
198
198
  * @since 1.2.0
199
199
  */
200
200
  showDuration?: number;
@@ -233,11 +233,15 @@ export interface LoadingOptions {
233
233
  * The thousands separator, defaults to the one given in the lang options, or a
234
234
  * space character.
235
235
  *
236
+ * @param {Highcharts.Chart} [ctx]
237
+ * Since v12.5.0, the chart context passed as an extra argument for arrow
238
+ * functions.
239
+ *
236
240
  * @return {string}
237
241
  * The formatted number.
238
242
  */
239
243
  export interface NumberFormatterCallbackFunction {
240
- (this: Chart | object | void, number: number, decimals: number, decimalPoint?: string, thousandsSep?: string): string;
244
+ (this: Chart | object | void, number: number, decimals: number, decimalPoint?: string, thousandsSep?: string, ctx?: Chart): string;
241
245
  }
242
246
  /**
243
247
  * Global options for all charts.
@@ -13,8 +13,25 @@ import Color from './Color/Color.js';
13
13
  const { parse: color } = Color;
14
14
  import H from './Globals.js';
15
15
  const { charts, composed, isTouchDevice } = H;
16
- import U from './Utilities.js';
17
- const { addEvent, attr, css, extend, find, fireEvent, isNumber, isObject, objectEach, offset, pick, pushUnique, splat } = U;
16
+ import { addEvent, attr, css, defined, extend, find, fireEvent, isNumber, isObject, objectEach, offset, pick, pushUnique, splat } from '../Shared/Utilities.js';
17
+ /**
18
+ *
19
+ * Functions
20
+ *
21
+ */
22
+ /**
23
+ * Check whether the configured action key allows the interaction.
24
+ *
25
+ * @internal
26
+ * @param {Event} e
27
+ * A mouse event.
28
+ * @param {string | undefined} key
29
+ * Zoom or pan key.
30
+ * @return {boolean}
31
+ * True if the key is undefined
32
+ * or if the action key is pressed. False otherwise.
33
+ */
34
+ const checkActionKey = (e, key) => !defined(key) || e[`${key}Key`];
18
35
  /* *
19
36
  *
20
37
  * Class
@@ -212,7 +229,8 @@ class Pointer {
212
229
  selectionMarker.attr(attrs);
213
230
  }
214
231
  // Panning
215
- if (clickedInside && !selectionMarker && panningEnabled) {
232
+ if (clickedInside && !selectionMarker && panningEnabled &&
233
+ (checkActionKey(e, panKey))) {
216
234
  chart.pan(e, panning);
217
235
  }
218
236
  }
@@ -1444,7 +1462,8 @@ class Pointer {
1444
1462
  this.zoomY = zoomY = /y/.test(zoomType);
1445
1463
  this.zoomHor = (zoomX && !inverted) || (zoomY && inverted);
1446
1464
  this.zoomVert = (zoomY && !inverted) || (zoomX && inverted);
1447
- this.hasZoom = zoomX || zoomY;
1465
+ this.hasZoom = (zoomX || zoomY) &&
1466
+ (checkActionKey(e, chart.zooming.key));
1448
1467
  }
1449
1468
  }
1450
1469
  /** @internal */
@@ -8,10 +8,12 @@ export interface PointerEvent extends globalThis.PointerEvent {
8
8
  accumulate?: boolean;
9
9
  chartX: number;
10
10
  chartY: number;
11
+ DOMType?: string;
11
12
  lat?: number;
12
13
  lon?: number;
13
14
  point?: Point;
14
15
  touches?: Array<Touch>;
16
+ trigger?: string;
15
17
  xAxis?: Array<Pointer.AxisCoordinateObject>;
16
18
  yAxis?: Array<Pointer.AxisCoordinateObject>;
17
19
  }
@@ -11,8 +11,8 @@
11
11
  'use strict';
12
12
  import H from '../../Globals.js';
13
13
  const { SVG_NS, win } = H;
14
- import U from '../../Utilities.js';
15
- const { attr, createElement, css, error, isFunction, isString, objectEach, splat } = U;
14
+ import { attr, createElement, css, isFunction, isString, objectEach, splat } from '../../../Shared/Utilities.js';
15
+ import { error } from '../../Utilities.js';
16
16
  const { trustedTypes } = win;
17
17
  /* *
18
18
  *
@@ -13,8 +13,7 @@ import AST from './AST.js';
13
13
  import H from '../../Globals.js';
14
14
  const { composed, isFirefox } = H;
15
15
  import SVGElement from '../SVG/SVGElement.js';
16
- import U from '../../Utilities.js';
17
- const { attr, css, createElement, defined, extend, getAlignFactor, isNumber, pInt, pushUnique } = U;
16
+ import { attr, createElement, css, defined, extend, getAlignFactor, isNumber, pInt, pushUnique } from '../../../Shared/Utilities.js';
18
17
  /**
19
18
  * The opacity and visibility properties are set as attributes on the main
20
19
  * element and SVG groups, and as identical CSS properties on the HTML element
@@ -14,8 +14,7 @@
14
14
  * Imports
15
15
  *
16
16
  * */
17
- import U from '../Utilities.js';
18
- const { clamp, pick, pushUnique, stableSort } = U;
17
+ import { clamp, pick, pushUnique, stableSort } from '../../Shared/Utilities.js';
19
18
  /* *
20
19
  *
21
20
  * Namespace
@@ -47,7 +46,7 @@ var RendererUtilities;
47
46
  // Original array will be altered with added .pos
48
47
  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
48
  boxesLength = boxes.length, forDeletion = [], push = restBoxes.push;
50
- let i, cursor, step, overlapping = true, box, target, total = 0, equalRank;
49
+ let i, overlapping = true, box, target, total = 0, equalRank;
51
50
  // If the total size exceeds the len, remove those boxes with the lowest
52
51
  // rank
53
52
  i = boxesLength;
@@ -58,23 +57,39 @@ var RendererUtilities;
58
57
  if (total > reducedLen) {
59
58
  stableSort(boxes, sortByRank);
60
59
  equalRank = boxes[0].rank === boxes[boxes.length - 1].rank;
61
- step = equalRank ? boxesLength / 2 : -1;
62
- cursor = equalRank ? step : boxesLength - 1;
63
- // When the boxes have equal rank (pie data labels, flags - #10073),
64
- // decimate the boxes by starting in the middle and gradually remove
65
- // more items inside the array. When they are sorted by rank, just
66
- // remove the ones with the lowest rank from the end.
67
- while (step && total > reducedLen) {
68
- i = Math.floor(cursor);
69
- box = boxes[i];
70
- if (pushUnique(forDeletion, i)) {
71
- total -= box.size;
60
+ // When all boxes have equal rank (pie data labels, flags - #10073),
61
+ // decimate from the center outwards by repeatedly splitting index
62
+ // ranges. This guarantees progress and avoids cursor/step stalling
63
+ // on repeated indices (#23541). When ranks differ, remove the
64
+ // lowest ranked boxes from the end.
65
+ if (equalRank) {
66
+ const ranges = [[0, boxesLength - 1]];
67
+ while (ranges.length && total > reducedLen) {
68
+ const range = ranges.shift();
69
+ if (!range) {
70
+ break;
71
+ }
72
+ i = Math.floor((range[0] + range[1]) / 2);
73
+ box = boxes[i];
74
+ if (pushUnique(forDeletion, i)) {
75
+ total -= box.size;
76
+ }
77
+ if (range[0] < i) {
78
+ ranges.push([range[0], i - 1]);
79
+ }
80
+ if (i < range[1]) {
81
+ ranges.push([i + 1, range[1]]);
82
+ }
72
83
  }
73
- cursor += step;
74
- // Start over the decimation with smaller steps
75
- if (equalRank && cursor >= boxes.length) {
76
- step /= 2;
77
- cursor = step;
84
+ }
85
+ else {
86
+ i = boxesLength - 1;
87
+ while (total > reducedLen && i >= 0) {
88
+ box = boxes[i];
89
+ if (pushUnique(forDeletion, i)) {
90
+ total -= box.size;
91
+ }
92
+ i--;
78
93
  }
79
94
  }
80
95
  // Clean out the boxes marked for deletion
@@ -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 U from './Utilities.js';
13
- const { diffObjects, extend, find, merge, pick, uniqueKey } = U;
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
@@ -110,7 +110,7 @@ declare const Templating: {
110
110
  };
111
111
  declare namespace Templating {
112
112
  interface FormatterCallback<T> {
113
- (this: T): string;
113
+ (this: T, ...args: Array<any>): string;
114
114
  }
115
115
  interface OwnerOptions {
116
116
  /**
@@ -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 U from './Utilities.js';
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