@neo4j-ndl/react-charts 2.1.21 → 2.2.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 (209) hide show
  1. package/lib/LICENSES.txt +0 -295
  2. package/lib/NOTICE.txt +1383 -1392
  3. package/lib/{esm/charts/index.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/defineProperty.js} +13 -5
  4. package/lib/cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js +46 -0
  5. package/lib/{esm/charts/tests/ChartWrapperWithTooltipFormatter.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.js} +12 -13
  6. package/lib/{esm/index.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.js} +13 -2
  7. package/lib/cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPrimitive.js +35 -0
  8. package/lib/{esm/charts/utils/chart-types.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPropertyKey.js} +10 -2
  9. package/lib/cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/typeof.js +37 -0
  10. package/lib/cjs/_virtual/_rolldown/runtime.js +44 -0
  11. package/lib/cjs/charts/Chart.js +121 -111
  12. package/lib/cjs/charts/Chart.js.map +1 -1
  13. package/lib/cjs/charts/ChartContainer.js +67 -62
  14. package/lib/cjs/charts/ChartContainer.js.map +1 -1
  15. package/lib/cjs/charts/ChartEmpty.js +45 -30
  16. package/lib/cjs/charts/ChartEmpty.js.map +1 -1
  17. package/lib/cjs/charts/ChartRender.js +112 -87
  18. package/lib/cjs/charts/ChartRender.js.map +1 -1
  19. package/lib/cjs/charts/ChartTooltip.js +111 -65
  20. package/lib/cjs/charts/ChartTooltip.js.map +1 -1
  21. package/lib/cjs/charts/Legend.js +81 -69
  22. package/lib/cjs/charts/Legend.js.map +1 -1
  23. package/lib/cjs/charts/LegendItem.js +83 -62
  24. package/lib/cjs/charts/LegendItem.js.map +1 -1
  25. package/lib/cjs/charts/LegendLayout.js +330 -348
  26. package/lib/cjs/charts/LegendLayout.js.map +1 -1
  27. package/lib/cjs/charts/hooks/use-chart-instance.js +115 -122
  28. package/lib/cjs/charts/hooks/use-chart-instance.js.map +1 -1
  29. package/lib/cjs/charts/hooks/use-chart-option.js +79 -80
  30. package/lib/cjs/charts/hooks/use-chart-option.js.map +1 -1
  31. package/lib/cjs/charts/hooks/use-chart-refs.js +47 -44
  32. package/lib/cjs/charts/hooks/use-chart-refs.js.map +1 -1
  33. package/lib/cjs/charts/hooks/use-chart-zoom.js +102 -127
  34. package/lib/cjs/charts/hooks/use-chart-zoom.js.map +1 -1
  35. package/lib/cjs/charts/hooks/use-legend-interactions.js +127 -132
  36. package/lib/cjs/charts/hooks/use-legend-interactions.js.map +1 -1
  37. package/lib/cjs/charts/hooks/use-legend-series.js +143 -174
  38. package/lib/cjs/charts/hooks/use-legend-series.js.map +1 -1
  39. package/lib/cjs/charts/hooks/use-legend-visibility.js +66 -85
  40. package/lib/cjs/charts/hooks/use-legend-visibility.js.map +1 -1
  41. package/lib/cjs/charts/index.js +31 -40
  42. package/lib/cjs/charts/index.js.map +1 -1
  43. package/lib/cjs/charts/themes/ndl-echarts-theme.js +136 -168
  44. package/lib/cjs/charts/themes/ndl-echarts-theme.js.map +1 -1
  45. package/lib/cjs/charts/utils/aria-description.js +150 -214
  46. package/lib/cjs/charts/utils/aria-description.js.map +1 -1
  47. package/lib/cjs/charts/utils/build-chart-option.js +166 -174
  48. package/lib/cjs/charts/utils/build-chart-option.js.map +1 -1
  49. package/lib/cjs/charts/utils/chart-tooltip-formatter.js +156 -172
  50. package/lib/cjs/charts/utils/chart-tooltip-formatter.js.map +1 -1
  51. package/lib/cjs/charts/utils/chart-types.js +25 -20
  52. package/lib/cjs/charts/utils/chart-types.js.map +1 -1
  53. package/lib/cjs/charts/utils/defaults.js +69 -67
  54. package/lib/cjs/charts/utils/defaults.js.map +1 -1
  55. package/lib/cjs/charts/utils/format-utils.js +55 -66
  56. package/lib/cjs/charts/utils/format-utils.js.map +1 -1
  57. package/lib/cjs/charts/utils/legend-layout.js +54 -53
  58. package/lib/cjs/charts/utils/legend-layout.js.map +1 -1
  59. package/lib/cjs/charts/utils/legend-utils.js +82 -121
  60. package/lib/cjs/charts/utils/legend-utils.js.map +1 -1
  61. package/lib/cjs/charts/utils/scatter-tooltip-points.js +191 -266
  62. package/lib/cjs/charts/utils/scatter-tooltip-points.js.map +1 -1
  63. package/lib/cjs/charts/utils/threshold.js +89 -102
  64. package/lib/cjs/charts/utils/threshold.js.map +1 -1
  65. package/lib/cjs/charts/utils/user-option-utils.js +419 -347
  66. package/lib/cjs/charts/utils/user-option-utils.js.map +1 -1
  67. package/lib/cjs/index.js +31 -35
  68. package/lib/cjs/index.js.map +1 -1
  69. package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/defineProperty.mjs +11 -0
  70. package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.mjs +24 -0
  71. package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.mjs +12 -0
  72. package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.mjs +11 -0
  73. package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPrimitive.mjs +13 -0
  74. package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPropertyKey.mjs +8 -0
  75. package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/typeof.mjs +10 -0
  76. package/lib/esm/charts/Chart.mjs +123 -0
  77. package/lib/esm/charts/Chart.mjs.map +1 -0
  78. package/lib/esm/charts/ChartContainer.mjs +71 -0
  79. package/lib/esm/charts/ChartContainer.mjs.map +1 -0
  80. package/lib/esm/charts/ChartEmpty.mjs +46 -0
  81. package/lib/esm/charts/ChartEmpty.mjs.map +1 -0
  82. package/lib/esm/charts/ChartRender.mjs +113 -0
  83. package/lib/esm/charts/ChartRender.mjs.map +1 -0
  84. package/lib/esm/charts/ChartTooltip.mjs +109 -0
  85. package/lib/esm/charts/ChartTooltip.mjs.map +1 -0
  86. package/lib/esm/charts/Legend.mjs +82 -0
  87. package/lib/esm/charts/Legend.mjs.map +1 -0
  88. package/lib/esm/charts/LegendItem.mjs +82 -0
  89. package/lib/esm/charts/LegendItem.mjs.map +1 -0
  90. package/lib/esm/charts/LegendLayout.mjs +337 -0
  91. package/lib/esm/charts/LegendLayout.mjs.map +1 -0
  92. package/lib/esm/charts/hooks/use-chart-instance.mjs +119 -0
  93. package/lib/esm/charts/hooks/use-chart-instance.mjs.map +1 -0
  94. package/lib/esm/charts/hooks/use-chart-option.mjs +79 -0
  95. package/lib/esm/charts/hooks/use-chart-option.mjs.map +1 -0
  96. package/lib/esm/charts/hooks/use-chart-refs.mjs +49 -0
  97. package/lib/esm/charts/hooks/use-chart-refs.mjs.map +1 -0
  98. package/lib/esm/charts/hooks/use-chart-zoom.mjs +102 -0
  99. package/lib/esm/charts/hooks/use-chart-zoom.mjs.map +1 -0
  100. package/lib/esm/charts/hooks/use-legend-interactions.mjs +138 -0
  101. package/lib/esm/charts/hooks/use-legend-interactions.mjs.map +1 -0
  102. package/lib/esm/charts/hooks/use-legend-series.mjs +151 -0
  103. package/lib/esm/charts/hooks/use-legend-series.mjs.map +1 -0
  104. package/lib/esm/charts/hooks/use-legend-visibility.mjs +67 -0
  105. package/lib/esm/charts/hooks/use-legend-visibility.mjs.map +1 -0
  106. package/lib/esm/charts/index.mjs +27 -0
  107. package/lib/esm/charts/index.mjs.map +1 -0
  108. package/lib/esm/charts/themes/ndl-echarts-theme.mjs +139 -0
  109. package/lib/esm/charts/themes/ndl-echarts-theme.mjs.map +1 -0
  110. package/lib/esm/charts/utils/aria-description.mjs +162 -0
  111. package/lib/esm/charts/utils/aria-description.mjs.map +1 -0
  112. package/lib/esm/charts/utils/build-chart-option.mjs +184 -0
  113. package/lib/esm/charts/utils/build-chart-option.mjs.map +1 -0
  114. package/lib/esm/charts/utils/chart-tooltip-formatter.mjs +159 -0
  115. package/lib/esm/charts/utils/chart-tooltip-formatter.mjs.map +1 -0
  116. package/lib/esm/charts/utils/chart-types.mjs +24 -0
  117. package/lib/esm/charts/utils/chart-types.mjs.map +1 -0
  118. package/lib/esm/charts/utils/defaults.mjs +73 -0
  119. package/lib/esm/charts/utils/defaults.mjs.map +1 -0
  120. package/lib/esm/charts/utils/format-utils.mjs +61 -0
  121. package/lib/esm/charts/utils/format-utils.mjs.map +1 -0
  122. package/lib/esm/charts/utils/legend-layout.mjs +57 -0
  123. package/lib/esm/charts/utils/legend-layout.mjs.map +1 -0
  124. package/lib/esm/charts/utils/legend-utils.mjs +90 -0
  125. package/lib/esm/charts/utils/legend-utils.mjs.map +1 -0
  126. package/lib/esm/charts/utils/scatter-tooltip-points.mjs +215 -0
  127. package/lib/esm/charts/utils/scatter-tooltip-points.mjs.map +1 -0
  128. package/lib/esm/charts/utils/threshold.mjs +92 -0
  129. package/lib/esm/charts/utils/threshold.mjs.map +1 -0
  130. package/lib/esm/charts/utils/user-option-utils.mjs +445 -0
  131. package/lib/esm/charts/utils/user-option-utils.mjs.map +1 -0
  132. package/lib/esm/index.mjs +27 -0
  133. package/lib/esm/index.mjs.map +1 -0
  134. package/package.json +12 -16
  135. package/skills/ndl-react-charts/SKILL.md +2 -2
  136. package/lib/cjs/charts/tests/ChartWrapperWithTooltipFormatter.js +0 -38
  137. package/lib/cjs/charts/tests/ChartWrapperWithTooltipFormatter.js.map +0 -1
  138. package/lib/cjs/charts/tests/ChartZoomHarness.js +0 -113
  139. package/lib/cjs/charts/tests/ChartZoomHarness.js.map +0 -1
  140. package/lib/cjs/charts/tests/HorizontalBarWithVerticalSlider.js +0 -78
  141. package/lib/cjs/charts/tests/HorizontalBarWithVerticalSlider.js.map +0 -1
  142. package/lib/cjs/charts/tests/PieChartWithRerender.js +0 -46
  143. package/lib/cjs/charts/tests/PieChartWithRerender.js.map +0 -1
  144. package/lib/cjs/charts/tests/chart-test-utils.js +0 -527
  145. package/lib/cjs/charts/tests/chart-test-utils.js.map +0 -1
  146. package/lib/esm/charts/Chart.js +0 -114
  147. package/lib/esm/charts/Chart.js.map +0 -1
  148. package/lib/esm/charts/ChartContainer.js +0 -67
  149. package/lib/esm/charts/ChartContainer.js.map +0 -1
  150. package/lib/esm/charts/ChartEmpty.js +0 -33
  151. package/lib/esm/charts/ChartEmpty.js.map +0 -1
  152. package/lib/esm/charts/ChartRender.js +0 -89
  153. package/lib/esm/charts/ChartRender.js.map +0 -1
  154. package/lib/esm/charts/ChartTooltip.js +0 -64
  155. package/lib/esm/charts/ChartTooltip.js.map +0 -1
  156. package/lib/esm/charts/Legend.js +0 -71
  157. package/lib/esm/charts/Legend.js.map +0 -1
  158. package/lib/esm/charts/LegendItem.js +0 -61
  159. package/lib/esm/charts/LegendItem.js.map +0 -1
  160. package/lib/esm/charts/LegendLayout.js +0 -323
  161. package/lib/esm/charts/LegendLayout.js.map +0 -1
  162. package/lib/esm/charts/hooks/use-chart-instance.js +0 -128
  163. package/lib/esm/charts/hooks/use-chart-instance.js.map +0 -1
  164. package/lib/esm/charts/hooks/use-chart-option.js +0 -82
  165. package/lib/esm/charts/hooks/use-chart-option.js.map +0 -1
  166. package/lib/esm/charts/hooks/use-chart-refs.js +0 -48
  167. package/lib/esm/charts/hooks/use-chart-refs.js.map +0 -1
  168. package/lib/esm/charts/hooks/use-chart-zoom.js +0 -129
  169. package/lib/esm/charts/hooks/use-chart-zoom.js.map +0 -1
  170. package/lib/esm/charts/hooks/use-legend-interactions.js +0 -145
  171. package/lib/esm/charts/hooks/use-legend-interactions.js.map +0 -1
  172. package/lib/esm/charts/hooks/use-legend-series.js +0 -184
  173. package/lib/esm/charts/hooks/use-legend-series.js.map +0 -1
  174. package/lib/esm/charts/hooks/use-legend-visibility.js +0 -87
  175. package/lib/esm/charts/hooks/use-legend-visibility.js.map +0 -1
  176. package/lib/esm/charts/index.js.map +0 -1
  177. package/lib/esm/charts/tests/ChartWrapperWithTooltipFormatter.js.map +0 -1
  178. package/lib/esm/charts/tests/ChartZoomHarness.js +0 -109
  179. package/lib/esm/charts/tests/ChartZoomHarness.js.map +0 -1
  180. package/lib/esm/charts/tests/HorizontalBarWithVerticalSlider.js +0 -74
  181. package/lib/esm/charts/tests/HorizontalBarWithVerticalSlider.js.map +0 -1
  182. package/lib/esm/charts/tests/PieChartWithRerender.js +0 -43
  183. package/lib/esm/charts/tests/PieChartWithRerender.js.map +0 -1
  184. package/lib/esm/charts/tests/chart-test-utils.js +0 -500
  185. package/lib/esm/charts/tests/chart-test-utils.js.map +0 -1
  186. package/lib/esm/charts/themes/ndl-echarts-theme.js +0 -172
  187. package/lib/esm/charts/themes/ndl-echarts-theme.js.map +0 -1
  188. package/lib/esm/charts/utils/aria-description.js +0 -228
  189. package/lib/esm/charts/utils/aria-description.js.map +0 -1
  190. package/lib/esm/charts/utils/build-chart-option.js +0 -193
  191. package/lib/esm/charts/utils/build-chart-option.js.map +0 -1
  192. package/lib/esm/charts/utils/chart-tooltip-formatter.js +0 -177
  193. package/lib/esm/charts/utils/chart-tooltip-formatter.js.map +0 -1
  194. package/lib/esm/charts/utils/chart-types.js.map +0 -1
  195. package/lib/esm/charts/utils/defaults.js +0 -73
  196. package/lib/esm/charts/utils/defaults.js.map +0 -1
  197. package/lib/esm/charts/utils/format-utils.js +0 -74
  198. package/lib/esm/charts/utils/format-utils.js.map +0 -1
  199. package/lib/esm/charts/utils/legend-layout.js +0 -59
  200. package/lib/esm/charts/utils/legend-layout.js.map +0 -1
  201. package/lib/esm/charts/utils/legend-utils.js +0 -131
  202. package/lib/esm/charts/utils/legend-utils.js.map +0 -1
  203. package/lib/esm/charts/utils/scatter-tooltip-points.js +0 -291
  204. package/lib/esm/charts/utils/scatter-tooltip-points.js.map +0 -1
  205. package/lib/esm/charts/utils/threshold.js +0 -106
  206. package/lib/esm/charts/utils/threshold.js.map +0 -1
  207. package/lib/esm/charts/utils/user-option-utils.js +0 -374
  208. package/lib/esm/charts/utils/user-option-utils.js.map +0 -1
  209. package/lib/esm/index.js.map +0 -1
@@ -1,231 +1,167 @@
1
1
  "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ const require_charts_utils_defaults = require("./defaults.js");
7
+ const require_charts_utils_threshold = require("./threshold.js");
8
+ // src/charts/utils/aria-description.ts
2
9
  /*!
3
- *
4
- * Copyright (c) "Neo4j"
5
- * Neo4j Sweden AB [http://neo4j.com]
6
- *
7
- * This file is part of Neo4j.
8
- *
9
- * Neo4j is free software: you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation, either version 3 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
- */
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.generateThresholdAriaDescription = generateThresholdAriaDescription;
24
- const defaults_1 = require("./defaults");
25
- const threshold_1 = require("./threshold");
10
+ *
11
+ * Copyright (c) "Neo4j"
12
+ * Neo4j Sweden AB [http://neo4j.com]
13
+ *
14
+ * This file is part of Neo4j.
15
+ *
16
+ * Neo4j is free software: you can redistribute it and/or modify
17
+ * it under the terms of the GNU General Public License as published by
18
+ * the Free Software Foundation, either version 3 of the License, or
19
+ * (at your option) any later version.
20
+ *
21
+ * This program is distributed in the hope that it will be useful,
22
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ * GNU General Public License for more details.
25
+ *
26
+ * You should have received a copy of the GNU General Public License
27
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
26
29
  /**
27
- * Extract numeric y-values from inline series data.
28
- * Handles formats: [x, y], [x, y, ...], or single number.
29
- */
30
+ * Extract numeric y-values from inline series data.
31
+ * Handles formats: [x, y], [x, y, ...], or single number.
32
+ */
30
33
  function extractInlineValues(data, encode) {
31
- if (!Array.isArray(data)) {
32
- return [];
33
- }
34
- const yIndex = (encode === null || encode === void 0 ? void 0 : encode.y) !== undefined && typeof encode.y === 'number' ? encode.y : 1;
35
- const values = [];
36
- for (const point of data) {
37
- if (point === null || point === undefined) {
38
- continue;
39
- }
40
- if (Array.isArray(point)) {
41
- const val = point[yIndex];
42
- if (typeof val === 'number' && !isNaN(val)) {
43
- values.push(val);
44
- }
45
- }
46
- else if (typeof point === 'number' && !isNaN(point)) {
47
- values.push(point);
48
- }
49
- else if (typeof point === 'object' && 'value' in point) {
50
- const val = point.value;
51
- if (typeof val === 'number' && !isNaN(val)) {
52
- values.push(val);
53
- }
54
- else if (Array.isArray(val)) {
55
- const yValue = val[yIndex];
56
- if (typeof yValue === 'number' && !isNaN(yValue)) {
57
- values.push(yValue);
58
- }
59
- }
60
- }
61
- }
62
- return values;
34
+ if (!Array.isArray(data)) return [];
35
+ const yIndex = (encode === null || encode === void 0 ? void 0 : encode.y) !== void 0 && typeof encode.y === "number" ? encode.y : 1;
36
+ const values = [];
37
+ for (const point of data) {
38
+ if (point === null || point === void 0) continue;
39
+ if (Array.isArray(point)) {
40
+ const val = point[yIndex];
41
+ if (typeof val === "number" && !isNaN(val)) values.push(val);
42
+ } else if (typeof point === "number" && !isNaN(point)) values.push(point);
43
+ else if (typeof point === "object" && "value" in point) {
44
+ const val = point.value;
45
+ if (typeof val === "number" && !isNaN(val)) values.push(val);
46
+ else if (Array.isArray(val)) {
47
+ const yValue = val[yIndex];
48
+ if (typeof yValue === "number" && !isNaN(yValue)) values.push(yValue);
49
+ }
50
+ }
51
+ }
52
+ return values;
63
53
  }
64
54
  /**
65
- * Extract numeric y-values from a dataset source for a given series.
66
- */
55
+ * Extract numeric y-values from a dataset source for a given series.
56
+ */
67
57
  function extractDatasetValues(dataset, series) {
68
- if (!dataset) {
69
- return [];
70
- }
71
- const datasets = Array.isArray(dataset) ? dataset : [dataset];
72
- const datasetIndex = 'datasetIndex' in series && typeof series.datasetIndex === 'number'
73
- ? series.datasetIndex
74
- : 0;
75
- const currentDataset = datasets[datasetIndex];
76
- if (!currentDataset || !Array.isArray(currentDataset.source)) {
77
- return [];
78
- }
79
- const source = currentDataset.source;
80
- if (source.length < 1) {
81
- return [];
82
- }
83
- // Determine column names and data start index.
84
- // When `dimensions` is provided, column names come from there and all
85
- // rows in `source` are data. Otherwise the first row is a header.
86
- const dimensions = currentDataset.dimensions;
87
- let columnNames;
88
- let dataStartIndex;
89
- if (Array.isArray(dimensions) && dimensions.length > 0) {
90
- columnNames = dimensions.map((dimension) => typeof dimension === 'string' ? dimension : dimension.name);
91
- dataStartIndex = 0;
92
- }
93
- else {
94
- const headerRow = source[0];
95
- if (!Array.isArray(headerRow) || source.length < 2) {
96
- return [];
97
- }
98
- columnNames = headerRow;
99
- dataStartIndex = 1;
100
- }
101
- // Determine which column contains the y-values
102
- const encode = 'encode' in series ? series.encode : undefined;
103
- let yColumnIndex = -1;
104
- if ((encode === null || encode === void 0 ? void 0 : encode.y) !== undefined) {
105
- if (typeof encode.y === 'number') {
106
- yColumnIndex = encode.y;
107
- }
108
- else if (typeof encode.y === 'string') {
109
- yColumnIndex = columnNames.indexOf(encode.y);
110
- }
111
- }
112
- if (yColumnIndex === -1) {
113
- // Avoid guessing a data column for aria descriptions.
114
- // If we cannot resolve a value column explicitly, return no values.
115
- return [];
116
- }
117
- const values = [];
118
- for (let rowIndex = dataStartIndex; rowIndex < source.length; rowIndex++) {
119
- const row = source[rowIndex];
120
- if (!Array.isArray(row)) {
121
- continue;
122
- }
123
- const val = row[yColumnIndex];
124
- if (typeof val === 'number' && !isNaN(val)) {
125
- values.push(val);
126
- }
127
- }
128
- return values;
58
+ if (!dataset) return [];
59
+ const currentDataset = (Array.isArray(dataset) ? dataset : [dataset])["datasetIndex" in series && typeof series.datasetIndex === "number" ? series.datasetIndex : 0];
60
+ if (!currentDataset || !Array.isArray(currentDataset.source)) return [];
61
+ const source = currentDataset.source;
62
+ if (source.length < 1) return [];
63
+ const dimensions = currentDataset.dimensions;
64
+ let columnNames;
65
+ let dataStartIndex;
66
+ if (Array.isArray(dimensions) && dimensions.length > 0) {
67
+ columnNames = dimensions.map((dimension) => typeof dimension === "string" ? dimension : dimension.name);
68
+ dataStartIndex = 0;
69
+ } else {
70
+ const headerRow = source[0];
71
+ if (!Array.isArray(headerRow) || source.length < 2) return [];
72
+ columnNames = headerRow;
73
+ dataStartIndex = 1;
74
+ }
75
+ const encode = "encode" in series ? series.encode : void 0;
76
+ let yColumnIndex = -1;
77
+ if ((encode === null || encode === void 0 ? void 0 : encode.y) !== void 0) {
78
+ if (typeof encode.y === "number") yColumnIndex = encode.y;
79
+ else if (typeof encode.y === "string") yColumnIndex = columnNames.indexOf(encode.y);
80
+ }
81
+ if (yColumnIndex === -1) return [];
82
+ const values = [];
83
+ for (let rowIndex = dataStartIndex; rowIndex < source.length; rowIndex++) {
84
+ const row = source[rowIndex];
85
+ if (!Array.isArray(row)) continue;
86
+ const val = row[yColumnIndex];
87
+ if (typeof val === "number" && !isNaN(val)) values.push(val);
88
+ }
89
+ return values;
129
90
  }
130
91
  function pluralize(count, singular, plural) {
131
- return count === 1 ? singular : (plural !== null && plural !== void 0 ? plural : `${singular}s`);
92
+ return count === 1 ? singular : plural !== null && plural !== void 0 ? plural : `${singular}s`;
132
93
  }
133
94
  /**
134
- * Resolves y-values for a series from either inline data or a dataset.
135
- */
95
+ * Resolves y-values for a series from either inline data or a dataset.
96
+ */
136
97
  function resolveSeriesValues(series, dataset) {
137
- if ('data' in series && series.data) {
138
- const encode = 'encode' in series
139
- ? series.encode
140
- : undefined;
141
- return extractInlineValues(series.data, encode);
142
- }
143
- return extractDatasetValues(dataset, series);
98
+ if ("data" in series && series.data) {
99
+ const encode = "encode" in series ? series.encode : void 0;
100
+ return extractInlineValues(series.data, encode);
101
+ }
102
+ return extractDatasetValues(dataset, series);
144
103
  }
145
104
  /**
146
- * Generates a human-readable aria-label description for the chart
147
- * that includes meaningful threshold context and data relationships.
148
- */
105
+ * Generates a human-readable aria-label description for the chart
106
+ * that includes meaningful threshold context and data relationships.
107
+ */
149
108
  function generateThresholdAriaDescription(propsSeries, dataset) {
150
- var _a, _b, _c;
151
- const seriesArray = Array.isArray(propsSeries) ? propsSeries : [propsSeries];
152
- // Separate threshold lines from data series
153
- const thresholds = [];
154
- const dataSeries = [];
155
- for (const series of seriesArray) {
156
- if (series.type === 'thresholdLine') {
157
- const threshold = series;
158
- thresholds.push({
159
- condition: (_a = threshold.condition) !== null && _a !== void 0 ? _a : defaults_1.defaultThresholdLineSeriesOption.condition,
160
- customConditionText: threshold.customConditionText,
161
- hasCustomCondition: typeof threshold.customCondition === 'function',
162
- notificationType: threshold.notificationType,
163
- yAxisValue: threshold.yAxis,
164
- });
165
- }
166
- else {
167
- const echartsSeriesOption = series;
168
- const name = typeof echartsSeriesOption.name === 'string'
169
- ? echartsSeriesOption.name
170
- : `Series ${dataSeries.length + 1}`;
171
- const values = resolveSeriesValues(echartsSeriesOption, dataset);
172
- dataSeries.push({
173
- name,
174
- type: (_b = echartsSeriesOption.type) !== null && _b !== void 0 ? _b : 'line',
175
- values,
176
- });
177
- }
178
- }
179
- if (thresholds.length === 0) {
180
- return undefined;
181
- }
182
- const parts = [];
183
- // 1. Overview
184
- const dataSeriesCountText = dataSeries.length === 1
185
- ? '1 data series'
186
- : `${dataSeries.length} data series`;
187
- const thresholdCountText = thresholds.length === 1
188
- ? '1 threshold line'
189
- : `${thresholds.length} threshold lines`;
190
- parts.push(`This chart has ${dataSeriesCountText} and ${thresholdCountText}.`);
191
- // 2. Describe each data series
192
- for (const series of dataSeries) {
193
- const { name, type, values } = series;
194
- if (values.length > 0) {
195
- const min = Math.min(...values);
196
- const max = Math.max(...values);
197
- parts.push(`${name} is a ${type} chart with ${values.length} ${pluralize(values.length, 'data point')} ranging from ${min} to ${max}.`);
198
- }
199
- else {
200
- parts.push(`${name} is a ${type} chart with no resolved data.`);
201
- }
202
- }
203
- // 3. Describe threshold lines
204
- for (const threshold of thresholds) {
205
- const conditionText = threshold.hasCustomCondition
206
- ? ((_c = threshold.customConditionText) !== null && _c !== void 0 ? _c : 'custom condition')
207
- : (0, threshold_1.thresholdConditionToText)(threshold.condition);
208
- parts.push(`${threshold.notificationType === 'warning' ? 'Warning' : 'Danger'} threshold at ${threshold.yAxisValue}: triggers when values are ${conditionText} ${threshold.yAxisValue}.`);
209
- }
210
- // 4. Report threshold violations per data series
211
- for (const series of dataSeries) {
212
- const { name, values } = series;
213
- if (values.length === 0) {
214
- continue;
215
- }
216
- for (const threshold of thresholds) {
217
- // Custom conditions use runtime callbacks that we cannot evaluate
218
- // at description-generation time, so we skip violation reporting.
219
- if (threshold.hasCustomCondition) {
220
- continue;
221
- }
222
- const violatingValues = values.filter((value) => (0, threshold_1.evaluateThresholdCondition)(value, threshold.condition, threshold.yAxisValue).isConditionMet);
223
- if (violatingValues.length > 0) {
224
- const count = violatingValues.length;
225
- parts.push(`${name} has ${count} ${pluralize(count, 'value')} ${(0, threshold_1.thresholdConditionToText)(threshold.condition)} the ${threshold.notificationType} threshold of ${threshold.yAxisValue}.`);
226
- }
227
- }
228
- }
229
- return parts.join(' ');
109
+ const seriesArray = Array.isArray(propsSeries) ? propsSeries : [propsSeries];
110
+ const thresholds = [];
111
+ const dataSeries = [];
112
+ for (const series of seriesArray) if (series.type === "thresholdLine") {
113
+ var _threshold$condition;
114
+ const threshold = series;
115
+ thresholds.push({
116
+ condition: (_threshold$condition = threshold.condition) !== null && _threshold$condition !== void 0 ? _threshold$condition : require_charts_utils_defaults.defaultThresholdLineSeriesOption.condition,
117
+ customConditionText: threshold.customConditionText,
118
+ hasCustomCondition: typeof threshold.customCondition === "function",
119
+ notificationType: threshold.notificationType,
120
+ yAxisValue: threshold.yAxis
121
+ });
122
+ } else {
123
+ var _echartsSeriesOption$;
124
+ const echartsSeriesOption = series;
125
+ const name = typeof echartsSeriesOption.name === "string" ? echartsSeriesOption.name : `Series ${dataSeries.length + 1}`;
126
+ const values = resolveSeriesValues(echartsSeriesOption, dataset);
127
+ dataSeries.push({
128
+ name,
129
+ type: (_echartsSeriesOption$ = echartsSeriesOption.type) !== null && _echartsSeriesOption$ !== void 0 ? _echartsSeriesOption$ : "line",
130
+ values
131
+ });
132
+ }
133
+ if (thresholds.length === 0) return;
134
+ const parts = [];
135
+ const dataSeriesCountText = dataSeries.length === 1 ? "1 data series" : `${dataSeries.length} data series`;
136
+ const thresholdCountText = thresholds.length === 1 ? "1 threshold line" : `${thresholds.length} threshold lines`;
137
+ parts.push(`This chart has ${dataSeriesCountText} and ${thresholdCountText}.`);
138
+ for (const series of dataSeries) {
139
+ const { name, type, values } = series;
140
+ if (values.length > 0) {
141
+ const min = Math.min(...values);
142
+ const max = Math.max(...values);
143
+ parts.push(`${name} is a ${type} chart with ${values.length} ${pluralize(values.length, "data point")} ranging from ${min} to ${max}.`);
144
+ } else parts.push(`${name} is a ${type} chart with no resolved data.`);
145
+ }
146
+ for (const threshold of thresholds) {
147
+ var _threshold$customCond;
148
+ const conditionText = threshold.hasCustomCondition ? (_threshold$customCond = threshold.customConditionText) !== null && _threshold$customCond !== void 0 ? _threshold$customCond : "custom condition" : require_charts_utils_threshold.thresholdConditionToText(threshold.condition);
149
+ parts.push(`${threshold.notificationType === "warning" ? "Warning" : "Danger"} threshold at ${threshold.yAxisValue}: triggers when values are ${conditionText} ${threshold.yAxisValue}.`);
150
+ }
151
+ for (const series of dataSeries) {
152
+ const { name, values } = series;
153
+ if (values.length === 0) continue;
154
+ for (const threshold of thresholds) {
155
+ if (threshold.hasCustomCondition) continue;
156
+ const violatingValues = values.filter((value) => require_charts_utils_threshold.evaluateThresholdCondition(value, threshold.condition, threshold.yAxisValue).isConditionMet);
157
+ if (violatingValues.length > 0) {
158
+ const count = violatingValues.length;
159
+ parts.push(`${name} has ${count} ${pluralize(count, "value")} ${require_charts_utils_threshold.thresholdConditionToText(threshold.condition)} the ${threshold.notificationType} threshold of ${threshold.yAxisValue}.`);
160
+ }
161
+ }
162
+ }
163
+ return parts.join(" ");
230
164
  }
165
+ exports.generateThresholdAriaDescription = generateThresholdAriaDescription;
166
+
231
167
  //# sourceMappingURL=aria-description.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aria-description.js","sourceRoot":"","sources":["../../../../src/charts/utils/aria-description.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AA2LH,4EAmHC;AApSD,yCAA8D;AAC9D,2CAGqB;AAgBrB;;;GAGG;AACH,SAAS,mBAAmB,CAC1B,IAA0B,EAC1B,MAMC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,MAAM,GACV,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,CAAC,MAAK,SAAS,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzE,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC1C,SAAS;QACX,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YAC1B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAA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I,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/B,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC;gBACrC,KAAK,CAAC,IAAI,CACR,GAAG,IAAI,QAAQ,KAAK,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,IAAA,oCAAwB,EAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,SAAS,CAAC,gBAAgB,iBAAiB,SAAS,CAAC,UAAU,GAAG,CAC7K,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type { EChartsOption, SeriesOption } from 'echarts';\n\nimport type {\n Condition,\n NeedleSeries,\n NotificationType,\n ThresholdLineSeriesOption,\n} from './chart-types';\nimport { defaultThresholdLineSeriesOption } from './defaults';\nimport {\n evaluateThresholdCondition,\n thresholdConditionToText,\n} from './threshold';\n\ninterface ResolvedDataSeries {\n name: string;\n type: string;\n values: number[];\n}\n\ninterface ResolvedThreshold {\n notificationType: NotificationType;\n yAxisValue: number;\n condition: Condition;\n hasCustomCondition: boolean;\n customConditionText?: string;\n}\n\n/**\n * Extract numeric y-values from inline series data.\n * Handles formats: [x, y], [x, y, ...], or single number.\n */\nfunction extractInlineValues(\n data: SeriesOption['data'],\n encode?: {\n // E-Charts uses encode.x and encode.y - https://echarts.apache.org/en/option.html#series-line.encode\n // oxlint-disable-next-line id-length\n x?: string | number;\n // oxlint-disable-next-line id-length\n y?: string | number;\n },\n): number[] {\n if (!Array.isArray(data)) {\n return [];\n }\n\n const yIndex =\n encode?.y !== undefined && typeof encode.y === 'number' ? encode.y : 1;\n\n const values: number[] = [];\n for (const point of data) {\n if (point === null || point === undefined) {\n continue;\n }\n if (Array.isArray(point)) {\n const val = point[yIndex];\n if (typeof val === 'number' && !isNaN(val)) {\n values.push(val);\n }\n } else if (typeof point === 'number' && !isNaN(point)) {\n values.push(point);\n } else if (typeof point === 'object' && 'value' in point) {\n const val = point.value;\n if (typeof val === 'number' && !isNaN(val)) {\n values.push(val);\n } else if (Array.isArray(val)) {\n const yValue = val[yIndex];\n if (typeof yValue === 'number' && !isNaN(yValue)) {\n values.push(yValue);\n }\n }\n }\n }\n return values;\n}\n\n/**\n * Extract numeric y-values from a dataset source for a given series.\n */\nfunction extractDatasetValues(\n dataset: EChartsOption['dataset'],\n series: SeriesOption,\n): number[] {\n if (!dataset) {\n return [];\n }\n\n const datasets = Array.isArray(dataset) ? dataset : [dataset];\n const datasetIndex =\n 'datasetIndex' in series && typeof series.datasetIndex === 'number'\n ? series.datasetIndex\n : 0;\n const currentDataset = datasets[datasetIndex];\n\n if (!currentDataset || !Array.isArray(currentDataset.source)) {\n return [];\n }\n\n const source = currentDataset.source as (string | number)[][];\n if (source.length < 1) {\n return [];\n }\n\n // Determine column names and data start index.\n // When `dimensions` is provided, column names come from there and all\n // rows in `source` are data. Otherwise the first row is a header.\n const dimensions = currentDataset.dimensions as\n | (string | { name: string })[]\n | undefined;\n let columnNames: (string | number)[];\n let dataStartIndex: number;\n\n if (Array.isArray(dimensions) && dimensions.length > 0) {\n columnNames = dimensions.map((dimension) =>\n typeof dimension === 'string' ? dimension : dimension.name,\n );\n dataStartIndex = 0;\n } else {\n const headerRow = source[0];\n if (!Array.isArray(headerRow) || source.length < 2) {\n return [];\n }\n columnNames = headerRow;\n dataStartIndex = 1;\n }\n\n // Determine which column contains the y-values\n const encode =\n 'encode' in series ? (series.encode as Record<string, unknown>) : undefined;\n let yColumnIndex = -1;\n\n if (encode?.y !== undefined) {\n if (typeof encode.y === 'number') {\n yColumnIndex = encode.y;\n } else if (typeof encode.y === 'string') {\n yColumnIndex = columnNames.indexOf(encode.y);\n }\n }\n\n if (yColumnIndex === -1) {\n // Avoid guessing a data column for aria descriptions.\n // If we cannot resolve a value column explicitly, return no values.\n return [];\n }\n\n const values: number[] = [];\n for (let rowIndex = dataStartIndex; rowIndex < source.length; rowIndex++) {\n const row = source[rowIndex];\n if (!Array.isArray(row)) {\n continue;\n }\n const val = row[yColumnIndex];\n if (typeof val === 'number' && !isNaN(val)) {\n values.push(val);\n }\n }\n\n return values;\n}\n\nfunction pluralize(count: number, singular: string, plural?: string): string {\n return count === 1 ? singular : (plural ?? `${singular}s`);\n}\n\n/**\n * Resolves y-values for a series from either inline data or a dataset.\n */\nfunction resolveSeriesValues(\n series: SeriesOption,\n dataset: EChartsOption['dataset'],\n): number[] {\n if ('data' in series && series.data) {\n const encode =\n 'encode' in series\n ? (series.encode as Record<string, unknown> | undefined)\n : undefined;\n return extractInlineValues(series.data, encode);\n }\n return extractDatasetValues(dataset, series);\n}\n\n/**\n * Generates a human-readable aria-label description for the chart\n * that includes meaningful threshold context and data relationships.\n */\nexport function generateThresholdAriaDescription(\n propsSeries: NeedleSeries,\n dataset: EChartsOption['dataset'],\n): string | undefined {\n const seriesArray = Array.isArray(propsSeries) ? propsSeries : [propsSeries];\n\n // Separate threshold lines from data series\n const thresholds: ResolvedThreshold[] = [];\n const dataSeries: ResolvedDataSeries[] = [];\n\n for (const series of seriesArray) {\n if (series.type === 'thresholdLine') {\n const threshold = series as ThresholdLineSeriesOption<NotificationType>;\n thresholds.push({\n condition:\n threshold.condition ?? defaultThresholdLineSeriesOption.condition,\n customConditionText: threshold.customConditionText,\n hasCustomCondition: typeof threshold.customCondition === 'function',\n notificationType: threshold.notificationType,\n yAxisValue: threshold.yAxis,\n });\n } else {\n const echartsSeriesOption = series as SeriesOption;\n const name =\n typeof echartsSeriesOption.name === 'string'\n ? echartsSeriesOption.name\n : `Series ${dataSeries.length + 1}`;\n\n const values = resolveSeriesValues(echartsSeriesOption, dataset);\n\n dataSeries.push({\n name,\n type: echartsSeriesOption.type ?? 'line',\n values,\n });\n }\n }\n\n if (thresholds.length === 0) {\n return undefined;\n }\n\n const parts: string[] = [];\n\n // 1. Overview\n const dataSeriesCountText =\n dataSeries.length === 1\n ? '1 data series'\n : `${dataSeries.length} data series`;\n const thresholdCountText =\n thresholds.length === 1\n ? '1 threshold line'\n : `${thresholds.length} threshold lines`;\n parts.push(\n `This chart has ${dataSeriesCountText} and ${thresholdCountText}.`,\n );\n\n // 2. Describe each data series\n for (const series of dataSeries) {\n const { name, type, values } = series;\n if (values.length > 0) {\n const min = Math.min(...values);\n const max = Math.max(...values);\n parts.push(\n `${name} is a ${type} chart with ${values.length} ${pluralize(values.length, 'data point')} ranging from ${min} to ${max}.`,\n );\n } else {\n parts.push(`${name} is a ${type} chart with no resolved data.`);\n }\n }\n\n // 3. Describe threshold lines\n for (const threshold of thresholds) {\n const conditionText = threshold.hasCustomCondition\n ? (threshold.customConditionText ?? 'custom condition')\n : thresholdConditionToText(threshold.condition);\n\n parts.push(\n `${threshold.notificationType === 'warning' ? 'Warning' : 'Danger'} threshold at ${threshold.yAxisValue}: triggers when values are ${conditionText} ${threshold.yAxisValue}.`,\n );\n }\n\n // 4. Report threshold violations per data series\n for (const series of dataSeries) {\n const { name, values } = series;\n if (values.length === 0) {\n continue;\n }\n\n for (const threshold of thresholds) {\n // Custom conditions use runtime callbacks that we cannot evaluate\n // at description-generation time, so we skip violation reporting.\n if (threshold.hasCustomCondition) {\n continue;\n }\n\n const violatingValues = values.filter(\n (value) =>\n evaluateThresholdCondition(\n value,\n threshold.condition,\n threshold.yAxisValue,\n ).isConditionMet,\n );\n\n if (violatingValues.length > 0) {\n const count = violatingValues.length;\n parts.push(\n `${name} has ${count} ${pluralize(count, 'value')} ${thresholdConditionToText(threshold.condition)} the ${threshold.notificationType} threshold of ${threshold.yAxisValue}.`,\n );\n }\n }\n }\n\n return parts.join(' ');\n}\n"]}
1
+ {"version":3,"file":"aria-description.js","names":["defaultThresholdLineSeriesOption","thresholdConditionToText","evaluateThresholdCondition"],"sources":["../../../../src/charts/utils/aria-description.ts"],"sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type { EChartsOption, SeriesOption } from 'echarts';\n\nimport type {\n Condition,\n NeedleSeries,\n NotificationType,\n ThresholdLineSeriesOption,\n} from './chart-types';\nimport { defaultThresholdLineSeriesOption } from './defaults';\nimport {\n evaluateThresholdCondition,\n thresholdConditionToText,\n} from './threshold';\n\ninterface ResolvedDataSeries {\n name: string;\n type: string;\n values: number[];\n}\n\ninterface ResolvedThreshold {\n notificationType: NotificationType;\n yAxisValue: number;\n condition: Condition;\n hasCustomCondition: boolean;\n customConditionText?: string;\n}\n\n/**\n * Extract numeric y-values from inline series data.\n * Handles formats: [x, y], [x, y, ...], or single number.\n */\nfunction extractInlineValues(\n data: SeriesOption['data'],\n encode?: {\n // E-Charts uses encode.x and encode.y - https://echarts.apache.org/en/option.html#series-line.encode\n // oxlint-disable-next-line id-length\n x?: string | number;\n // oxlint-disable-next-line id-length\n y?: string | number;\n },\n): number[] {\n if (!Array.isArray(data)) {\n return [];\n }\n\n const yIndex =\n encode?.y !== undefined && typeof encode.y === 'number' ? encode.y : 1;\n\n const values: number[] = [];\n for (const point of data) {\n if (point === null || point === undefined) {\n continue;\n }\n if (Array.isArray(point)) {\n const val = point[yIndex];\n if (typeof val === 'number' && !isNaN(val)) {\n values.push(val);\n }\n } else if (typeof point === 'number' && !isNaN(point)) {\n values.push(point);\n } else if (typeof point === 'object' && 'value' in point) {\n const val = point.value;\n if (typeof val === 'number' && !isNaN(val)) {\n values.push(val);\n } else if (Array.isArray(val)) {\n const yValue = val[yIndex];\n if (typeof yValue === 'number' && !isNaN(yValue)) {\n values.push(yValue);\n }\n }\n }\n }\n return values;\n}\n\n/**\n * Extract numeric y-values from a dataset source for a given series.\n */\nfunction extractDatasetValues(\n dataset: EChartsOption['dataset'],\n series: SeriesOption,\n): number[] {\n if (!dataset) {\n return [];\n }\n\n const datasets = Array.isArray(dataset) ? dataset : [dataset];\n const datasetIndex =\n 'datasetIndex' in series && typeof series.datasetIndex === 'number'\n ? series.datasetIndex\n : 0;\n const currentDataset = datasets[datasetIndex];\n\n if (!currentDataset || !Array.isArray(currentDataset.source)) {\n return [];\n }\n\n const source = currentDataset.source as (string | number)[][];\n if (source.length < 1) {\n return [];\n }\n\n // Determine column names and data start index.\n // When `dimensions` is provided, column names come from there and all\n // rows in `source` are data. Otherwise the first row is a header.\n const dimensions = currentDataset.dimensions as\n | (string | { name: string })[]\n | undefined;\n let columnNames: (string | number)[];\n let dataStartIndex: number;\n\n if (Array.isArray(dimensions) && dimensions.length > 0) {\n columnNames = dimensions.map((dimension) =>\n typeof dimension === 'string' ? dimension : dimension.name,\n );\n dataStartIndex = 0;\n } else {\n const headerRow = source[0];\n if (!Array.isArray(headerRow) || source.length < 2) {\n return [];\n }\n columnNames = headerRow;\n dataStartIndex = 1;\n }\n\n // Determine which column contains the y-values\n const encode =\n 'encode' in series ? (series.encode as Record<string, unknown>) : undefined;\n let yColumnIndex = -1;\n\n if (encode?.y !== undefined) {\n if (typeof encode.y === 'number') {\n yColumnIndex = encode.y;\n } else if (typeof encode.y === 'string') {\n yColumnIndex = columnNames.indexOf(encode.y);\n }\n }\n\n if (yColumnIndex === -1) {\n // Avoid guessing a data column for aria descriptions.\n // If we cannot resolve a value column explicitly, return no values.\n return [];\n }\n\n const values: number[] = [];\n for (let rowIndex = dataStartIndex; rowIndex < source.length; rowIndex++) {\n const row = source[rowIndex];\n if (!Array.isArray(row)) {\n continue;\n }\n const val = row[yColumnIndex];\n if (typeof val === 'number' && !isNaN(val)) {\n values.push(val);\n }\n }\n\n return values;\n}\n\nfunction pluralize(count: number, singular: string, plural?: string): string {\n return count === 1 ? singular : (plural ?? `${singular}s`);\n}\n\n/**\n * Resolves y-values for a series from either inline data or a dataset.\n */\nfunction resolveSeriesValues(\n series: SeriesOption,\n dataset: EChartsOption['dataset'],\n): number[] {\n if ('data' in series && series.data) {\n const encode =\n 'encode' in series\n ? (series.encode as Record<string, unknown> | undefined)\n : undefined;\n return extractInlineValues(series.data, encode);\n }\n return extractDatasetValues(dataset, series);\n}\n\n/**\n * Generates a human-readable aria-label description for the chart\n * that includes meaningful threshold context and data relationships.\n */\nexport function generateThresholdAriaDescription(\n propsSeries: NeedleSeries,\n dataset: EChartsOption['dataset'],\n): string | undefined {\n const seriesArray = Array.isArray(propsSeries) ? propsSeries : [propsSeries];\n\n // Separate threshold lines from data series\n const thresholds: ResolvedThreshold[] = [];\n const dataSeries: ResolvedDataSeries[] = [];\n\n for (const series of seriesArray) {\n if (series.type === 'thresholdLine') {\n const threshold = series as ThresholdLineSeriesOption<NotificationType>;\n thresholds.push({\n condition:\n threshold.condition ?? defaultThresholdLineSeriesOption.condition,\n customConditionText: threshold.customConditionText,\n hasCustomCondition: typeof threshold.customCondition === 'function',\n notificationType: threshold.notificationType,\n yAxisValue: threshold.yAxis,\n });\n } else {\n const echartsSeriesOption = series as SeriesOption;\n const name =\n typeof echartsSeriesOption.name === 'string'\n ? echartsSeriesOption.name\n : `Series ${dataSeries.length + 1}`;\n\n const values = resolveSeriesValues(echartsSeriesOption, dataset);\n\n dataSeries.push({\n name,\n type: echartsSeriesOption.type ?? 'line',\n values,\n });\n }\n }\n\n if (thresholds.length === 0) {\n return undefined;\n }\n\n const parts: string[] = [];\n\n // 1. Overview\n const dataSeriesCountText =\n dataSeries.length === 1\n ? '1 data series'\n : `${dataSeries.length} data series`;\n const thresholdCountText =\n thresholds.length === 1\n ? '1 threshold line'\n : `${thresholds.length} threshold lines`;\n parts.push(\n `This chart has ${dataSeriesCountText} and ${thresholdCountText}.`,\n );\n\n // 2. Describe each data series\n for (const series of dataSeries) {\n const { name, type, values } = series;\n if (values.length > 0) {\n const min = Math.min(...values);\n const max = Math.max(...values);\n parts.push(\n `${name} is a ${type} chart with ${values.length} ${pluralize(values.length, 'data point')} ranging from ${min} to ${max}.`,\n );\n } else {\n parts.push(`${name} is a ${type} chart with no resolved data.`);\n }\n }\n\n // 3. Describe threshold lines\n for (const threshold of thresholds) {\n const conditionText = threshold.hasCustomCondition\n ? (threshold.customConditionText ?? 'custom condition')\n : thresholdConditionToText(threshold.condition);\n\n parts.push(\n `${threshold.notificationType === 'warning' ? 'Warning' : 'Danger'} threshold at ${threshold.yAxisValue}: triggers when values are ${conditionText} ${threshold.yAxisValue}.`,\n );\n }\n\n // 4. Report threshold violations per data series\n for (const series of dataSeries) {\n const { name, values } = series;\n if (values.length === 0) {\n continue;\n }\n\n for (const threshold of thresholds) {\n // Custom conditions use runtime callbacks that we cannot evaluate\n // at description-generation time, so we skip violation reporting.\n if (threshold.hasCustomCondition) {\n continue;\n }\n\n const violatingValues = values.filter(\n (value) =>\n evaluateThresholdCondition(\n value,\n threshold.condition,\n threshold.yAxisValue,\n ).isConditionMet,\n );\n\n if (violatingValues.length > 0) {\n const count = violatingValues.length;\n parts.push(\n `${name} has ${count} ${pluralize(count, 'value')} ${thresholdConditionToText(threshold.condition)} the ${threshold.notificationType} threshold of ${threshold.yAxisValue}.`,\n );\n }\n }\n }\n\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