@neo4j-ndl/react-charts 2.1.22 → 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
@@ -18,8 +18,16 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
- export * from './Chart';
22
- export * from './ChartEmpty';
23
- // Export utils and types that were previously exported from Chart.tsx. Not sure that they are needed, but keeping them to not be breaking.
24
- export { defaultThresholdLineSeriesOption } from './utils/defaults';
25
- //# sourceMappingURL=index.js.map
21
+
22
+ "use strict";
23
+ const require_toPropertyKey = require("./toPropertyKey.js");
24
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
25
+ function _defineProperty(e, r, t) {
26
+ return (r = require_toPropertyKey.default(r)) in e ? Object.defineProperty(e, r, {
27
+ value: t,
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0
31
+ }) : e[r] = t, e;
32
+ }
33
+ exports.default = _defineProperty;
@@ -0,0 +1,46 @@
1
+ /*!
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ "use strict";
23
+ const require_defineProperty = require("./defineProperty.js");
24
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/objectSpread2.js
25
+ function ownKeys(e, r) {
26
+ var t = Object.keys(e);
27
+ if (Object.getOwnPropertySymbols) {
28
+ var o = Object.getOwnPropertySymbols(e);
29
+ r && (o = o.filter(function(r) {
30
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
31
+ })), t.push.apply(t, o);
32
+ }
33
+ return t;
34
+ }
35
+ function _objectSpread2(e) {
36
+ for (var r = 1; r < arguments.length; r++) {
37
+ var t = null != arguments[r] ? arguments[r] : {};
38
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
39
+ require_defineProperty.default(e, r, t[r]);
40
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
41
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
42
+ });
43
+ }
44
+ return e;
45
+ }
46
+ exports.default = _objectSpread2;
@@ -19,17 +19,16 @@
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
21
 
22
- import { jsx as _jsx } from "react/jsx-runtime";
23
- import { Chart } from '../Chart';
24
- /** Chart Wrapper is required to get a valid tooltip formatter for the chart
25
- * This is to do with the way Playwright mounts components for testing.
26
- * https://playwright.dev/docs/test-components#test-stories
27
- */
28
- export function ChartWrapperWithTooltipFormatter(props) {
29
- return (_jsx(Chart, Object.assign({}, props, { option: {
30
- tooltip: {
31
- valueFormatter: (value) => `formatted ${value}`,
32
- },
33
- } })));
22
+ "use strict";
23
+ const require_objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose.js");
24
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutProperties.js
25
+ function _objectWithoutProperties(e, t) {
26
+ if (null == e) return {};
27
+ var o, r, i = require_objectWithoutPropertiesLoose.default(e, t);
28
+ if (Object.getOwnPropertySymbols) {
29
+ var s = Object.getOwnPropertySymbols(e);
30
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
31
+ }
32
+ return i;
34
33
  }
35
- //# sourceMappingURL=ChartWrapperWithTooltipFormatter.js.map
34
+ exports.default = _objectWithoutProperties;
@@ -18,5 +18,16 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
- export * from './charts';
22
- //# sourceMappingURL=index.js.map
21
+
22
+ "use strict";
23
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.js
24
+ function _objectWithoutPropertiesLoose(r, e) {
25
+ if (null == r) return {};
26
+ var t = {};
27
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
28
+ if (e.includes(n)) continue;
29
+ t[n] = r[n];
30
+ }
31
+ return t;
32
+ }
33
+ exports.default = _objectWithoutPropertiesLoose;
@@ -0,0 +1,35 @@
1
+ /*!
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ "use strict";
23
+ const require_typeof = require("./typeof.js");
24
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
25
+ function toPrimitive(t, r) {
26
+ if ("object" != require_typeof.default(t) || !t) return t;
27
+ var e = t[Symbol.toPrimitive];
28
+ if (void 0 !== e) {
29
+ var i = e.call(t, r || "default");
30
+ if ("object" != require_typeof.default(i)) return i;
31
+ throw new TypeError("@@toPrimitive must return a primitive value.");
32
+ }
33
+ return ("string" === r ? String : Number)(t);
34
+ }
35
+ exports.default = toPrimitive;
@@ -18,5 +18,13 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
- export {};
22
- //# sourceMappingURL=chart-types.js.map
21
+
22
+ "use strict";
23
+ const require_typeof = require("./typeof.js");
24
+ const require_toPrimitive = require("./toPrimitive.js");
25
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
26
+ function toPropertyKey(t) {
27
+ var i = require_toPrimitive.default(t, "string");
28
+ return "symbol" == require_typeof.default(i) ? i : i + "";
29
+ }
30
+ exports.default = toPropertyKey;
@@ -0,0 +1,37 @@
1
+ /*!
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ "use strict";
23
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
24
+ function _typeof(o) {
25
+ "@babel/helpers - typeof";
26
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
27
+ return typeof o;
28
+ } : function(o) {
29
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
30
+ }, _typeof(o);
31
+ }
32
+ Object.defineProperty(exports, "default", {
33
+ enumerable: true,
34
+ get: function() {
35
+ return _typeof;
36
+ }
37
+ });
@@ -0,0 +1,44 @@
1
+ /*!
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ "use strict";
23
+ // \0rolldown/runtime.js
24
+ var __create = Object.create;
25
+ var __defProp = Object.defineProperty;
26
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
27
+ var __getOwnPropNames = Object.getOwnPropertyNames;
28
+ var __getProtoOf = Object.getPrototypeOf;
29
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
30
+ var __copyProps = (to, from, except, desc) => {
31
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
32
+ key = keys[i];
33
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
34
+ get: ((k) => from[k]).bind(null, key),
35
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
36
+ });
37
+ }
38
+ return to;
39
+ };
40
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
41
+ value: mod,
42
+ enumerable: true
43
+ }) : target, mod));
44
+ exports.__toESM = __toESM;
@@ -1,118 +1,128 @@
1
- /*!
2
- *
3
- * Copyright (c) "Neo4j"
4
- * Neo4j Sweden AB [http://neo4j.com]
5
- *
6
- * This file is part of Neo4j.
7
- *
8
- * Neo4j is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- */
21
-
22
1
  "use strict";
23
- var __rest = (this && this.__rest) || function (s, e) {
24
- var t = {};
25
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
26
- t[p] = s[p];
27
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
28
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
29
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
30
- t[p[i]] = s[p[i]];
31
- }
32
- return t;
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.Chart = void 0;
36
- const jsx_runtime_1 = require("react/jsx-runtime");
37
- const react_1 = require("react");
38
- const ChartContainer_1 = require("./ChartContainer");
39
- const ChartRender_1 = require("./ChartRender");
40
- const use_chart_refs_1 = require("./hooks/use-chart-refs");
41
- const use_legend_series_1 = require("./hooks/use-legend-series");
42
- const Legend_1 = require("./Legend");
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ const require_charts_ChartContainer = require("./ChartContainer.js");
7
+ const require_charts_ChartRender = require("./ChartRender.js");
8
+ const require_charts_hooks_use_chart_refs = require("./hooks/use-chart-refs.js");
9
+ const require_charts_hooks_use_legend_series = require("./hooks/use-legend-series.js");
10
+ const require_charts_Legend = require("./Legend.js");
11
+ const require_objectWithoutProperties = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.js");
12
+ const require_objectSpread2 = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js");
13
+ let react = require("react");
14
+ let react_jsx_runtime = require("react/jsx-runtime");
15
+ // src/charts/Chart.tsx
16
+ const _excluded = ["style", "legend"];
17
+ /*!
18
+ *
19
+ * Copyright (c) "Neo4j"
20
+ * Neo4j Sweden AB [http://neo4j.com]
21
+ *
22
+ * This file is part of Neo4j.
23
+ *
24
+ * Neo4j is free software: you can redistribute it and/or modify
25
+ * it under the terms of the GNU General Public License as published by
26
+ * the Free Software Foundation, either version 3 of the License, or
27
+ * (at your option) any later version.
28
+ *
29
+ * This program is distributed in the hope that it will be useful,
30
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32
+ * GNU General Public License for more details.
33
+ *
34
+ * You should have received a copy of the GNU General Public License
35
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
36
+ */
43
37
  /**
44
- * Bridges the rendered ECharts option into the React legend.
45
- *
46
- * `useLegendSeries` reads the current chart option and ECharts color state to
47
- * derive the legend rows. Rendering is deferred until the chart has completed
48
- * its first resize so the legend does not measure against an uninitialized
49
- * chart instance.
50
- */
51
- const ChartLegend = ({ chartOption, isLayoutReady, isWaitingForFirstResize, onLayoutReady, }) => {
52
- const legendSeries = (0, use_legend_series_1.useLegendSeries)({
53
- chartOption,
54
- isWaitingForFirstResize,
55
- });
56
- if (isWaitingForFirstResize) {
57
- return ((0, jsx_runtime_1.jsx)("div", { "aria-hidden": "true", className: "ndl-chart-legend-container ndl-chart-legend-container-placeholder" }));
58
- }
59
- return ((0, jsx_runtime_1.jsx)(Legend_1.Legend, { series: legendSeries !== null && legendSeries !== void 0 ? legendSeries : [], onLayoutReady: onLayoutReady, isLayoutReady: isLayoutReady }));
38
+ * Bridges the rendered ECharts option into the React legend.
39
+ *
40
+ * `useLegendSeries` reads the current chart option and ECharts color state to
41
+ * derive the legend rows. Rendering is deferred until the chart has completed
42
+ * its first resize so the legend does not measure against an uninitialized
43
+ * chart instance.
44
+ */
45
+ const ChartLegend = ({ chartOption, isLayoutReady, isWaitingForFirstResize, onLayoutReady }) => {
46
+ const legendSeries = require_charts_hooks_use_legend_series.useLegendSeries({
47
+ chartOption,
48
+ isWaitingForFirstResize
49
+ });
50
+ if (isWaitingForFirstResize) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
51
+ "aria-hidden": "true",
52
+ className: "ndl-chart-legend-container ndl-chart-legend-container-placeholder"
53
+ });
54
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_charts_Legend.Legend, {
55
+ series: legendSeries !== null && legendSeries !== void 0 ? legendSeries : [],
56
+ onLayoutReady,
57
+ isLayoutReady
58
+ });
60
59
  };
61
60
  /**
62
- * A chart component powered by Apache ECharts with Needle's customization and theming.
63
- *
64
- * The `Chart` component fills 100% of its parent's width and height. Because it
65
- * relies on the container's `clientHeight` to size the canvas, **the parent element
66
- * must have an explicit height** (e.g. a fixed px/rem value or a viewport unit).
67
- *
68
- * @example
69
- * ```tsx
70
- * <div style={{ height: '350px' }}>
71
- * <Chart dataset={dataset} series={series} xAxis={xAxis} yAxis={yAxis} />
72
- * </div>
73
- * ```
74
- *
75
- * @remarks
76
- * **Data zoom sliders.** A `dataZoom` slider passed through `option` targets
77
- * the x-axis unless it is bound to an axis explicitly, so on a horizontal bar
78
- * chart it zooms the value axis rather than the categories. Bind the slider to
79
- * the category axis with `yAxisIndex: [0]` (or set `orient: 'vertical'`) to
80
- * page through the bars instead; Needle then lays the slider out vertically on
81
- * the right of the chart and reserves grid space for it. Sliders that target a
82
- * continuous (`value`, `time`, or `log`) axis default to `filterMode: 'none'`
83
- * so out-of-window data is clipped rather than removed, while category-axis
84
- * sliders keep ECharts' `'filter'` default so the opposite value axis rescales
85
- * to the visible data.
86
- *
87
- * **Drag-to-zoom.** Dragging in the plot area zooms the axes your `dataZoom`
88
- * config targets: entries bound to a y-axis (`yAxisIndex` or
89
- * `orient: 'vertical'`) make the drag select a y band, entries on both axes
90
- * make it select a rectangle, and without any `dataZoom` config the drag zooms
91
- * the x-axis. Set `toolbox.feature.dataZoom` through `option` to override the
92
- * derived axes explicitly. When every drag-targeted axis is continuous the
93
- * drag defaults to `filterMode: 'none'`, matching the slider rule above.
94
- *
95
- * **Axis-label tooltips.** Hovering a truncated axis label shows its full text
96
- * in a tooltip. Set `xAxis.tooltip.show` or `yAxis.tooltip.show` to `false` to
97
- * disable this behavior for an axis.
98
- */
99
- const Chart = (_a) => {
100
- var { style, legend } = _a, chartProps = __rest(_a, ["style", "legend"]);
101
- const [isWaitingForFirstResize, setIsWaitingForFirstResize] = (0, react_1.useState)(true);
102
- const [chartOption, setChartOption] = (0, react_1.useState)();
103
- const [isLegendLayoutReady, setIsLegendLayoutReady] = (0, react_1.useState)(!(legend === null || legend === void 0 ? void 0 : legend.isVisible));
104
- const handleLegendLayoutReady = (0, react_1.useCallback)(() => {
105
- setIsLegendLayoutReady(true);
106
- }, []);
107
- (0, react_1.useEffect)(() => {
108
- if (!(legend === null || legend === void 0 ? void 0 : legend.isVisible)) {
109
- setIsLegendLayoutReady(true);
110
- }
111
- }, [legend === null || legend === void 0 ? void 0 : legend.isVisible]);
112
- const chartLayoutClassName = (legend === null || legend === void 0 ? void 0 : legend.isVisible) && !isLegendLayoutReady
113
- ? 'ndl-chart-layout ndl-chart-layout-hidden'
114
- : 'ndl-chart-layout';
115
- return ((0, jsx_runtime_1.jsx)(use_chart_refs_1.ChartRefsProvider, { children: (0, jsx_runtime_1.jsxs)(ChartContainer_1.ChartContainer, { style: style, children: [(0, jsx_runtime_1.jsx)("div", { className: chartLayoutClassName, children: (0, jsx_runtime_1.jsx)(ChartRender_1.ChartRender, Object.assign({}, chartProps, { onChartOptionChange: setChartOption, onFirstResizeChange: setIsWaitingForFirstResize })) }), (legend === null || legend === void 0 ? void 0 : legend.isVisible) && ((0, jsx_runtime_1.jsx)(ChartLegend, { chartOption: chartOption, isLayoutReady: isLegendLayoutReady, isWaitingForFirstResize: isWaitingForFirstResize, onLayoutReady: handleLegendLayoutReady }))] }) }));
61
+ * A chart component powered by Apache ECharts with Needle's customization and theming.
62
+ *
63
+ * The `Chart` component fills 100% of its parent's width and height. Because it
64
+ * relies on the container's `clientHeight` to size the canvas, **the parent element
65
+ * must have an explicit height** (e.g. a fixed px/rem value or a viewport unit).
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * <div style={{ height: '350px' }}>
70
+ * <Chart dataset={dataset} series={series} xAxis={xAxis} yAxis={yAxis} />
71
+ * </div>
72
+ * ```
73
+ *
74
+ * @remarks
75
+ * **Data zoom sliders.** A `dataZoom` slider passed through `option` targets
76
+ * the x-axis unless it is bound to an axis explicitly, so on a horizontal bar
77
+ * chart it zooms the value axis rather than the categories. Bind the slider to
78
+ * the category axis with `yAxisIndex: [0]` (or set `orient: 'vertical'`) to
79
+ * page through the bars instead; Needle then lays the slider out vertically on
80
+ * the right of the chart and reserves grid space for it. Sliders that target a
81
+ * continuous (`value`, `time`, or `log`) axis default to `filterMode: 'none'`
82
+ * so out-of-window data is clipped rather than removed, while category-axis
83
+ * sliders keep ECharts' `'filter'` default so the opposite value axis rescales
84
+ * to the visible data.
85
+ *
86
+ * **Drag-to-zoom.** Dragging in the plot area zooms the axes your `dataZoom`
87
+ * config targets: entries bound to a y-axis (`yAxisIndex` or
88
+ * `orient: 'vertical'`) make the drag select a y band, entries on both axes
89
+ * make it select a rectangle, and without any `dataZoom` config the drag zooms
90
+ * the x-axis. Set `toolbox.feature.dataZoom` through `option` to override the
91
+ * derived axes explicitly. When every drag-targeted axis is continuous the
92
+ * drag defaults to `filterMode: 'none'`, matching the slider rule above.
93
+ *
94
+ * **Axis-label tooltips.** Hovering a truncated axis label shows its full text
95
+ * in a tooltip. Set `xAxis.tooltip.show` or `yAxis.tooltip.show` to `false` to
96
+ * disable this behavior for an axis.
97
+ */
98
+ const Chart = (_ref) => {
99
+ let { style, legend } = _ref, chartProps = require_objectWithoutProperties.default(_ref, _excluded);
100
+ const [isWaitingForFirstResize, setIsWaitingForFirstResize] = (0, react.useState)(true);
101
+ const [chartOption, setChartOption] = (0, react.useState)();
102
+ const [isLegendLayoutReady, setIsLegendLayoutReady] = (0, react.useState)(!(legend === null || legend === void 0 ? void 0 : legend.isVisible));
103
+ const handleLegendLayoutReady = (0, react.useCallback)(() => {
104
+ setIsLegendLayoutReady(true);
105
+ }, []);
106
+ (0, react.useEffect)(() => {
107
+ if (!(legend === null || legend === void 0 ? void 0 : legend.isVisible)) setIsLegendLayoutReady(true);
108
+ }, [legend === null || legend === void 0 ? void 0 : legend.isVisible]);
109
+ const chartLayoutClassName = (legend === null || legend === void 0 ? void 0 : legend.isVisible) && !isLegendLayoutReady ? "ndl-chart-layout ndl-chart-layout-hidden" : "ndl-chart-layout";
110
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_charts_hooks_use_chart_refs.ChartRefsProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_charts_ChartContainer.ChartContainer, {
111
+ style,
112
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
113
+ className: chartLayoutClassName,
114
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_charts_ChartRender.ChartRender, require_objectSpread2.default(require_objectSpread2.default({}, chartProps), {}, {
115
+ onChartOptionChange: setChartOption,
116
+ onFirstResizeChange: setIsWaitingForFirstResize
117
+ }))
118
+ }), (legend === null || legend === void 0 ? void 0 : legend.isVisible) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartLegend, {
119
+ chartOption,
120
+ isLayoutReady: isLegendLayoutReady,
121
+ isWaitingForFirstResize,
122
+ onLayoutReady: handleLegendLayoutReady
123
+ })]
124
+ }) });
116
125
  };
117
126
  exports.Chart = Chart;
127
+
118
128
  //# sourceMappingURL=Chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","sourceRoot":"","sources":["../../../src/charts/Chart.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBA,iCAAyD;AAEzD,qDAAkD;AAClD,+CAA4C;AAC5C,2DAA2D;AAC3D,iEAA4D;AAC5D,qCAAkC;AAUlC;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,aAAa,GACI,EAAE,EAAE;IACrB,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC;QACnC,WAAW;QACX,uBAAuB;KACxB,CAAC,CAAC;IAEH,IAAI,uBAAuB,EAAE,CAAC;QAC5B,OAAO,CACL,+CACc,MAAM,EAClB,SAAS,EAAC,mEAAmE,GAC7E,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,uBAAC,eAAM,IACL,MAAM,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,EAC1B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACI,MAAM,KAAK,GAAG,CAAC,EAA4C,EAAE,EAAE;QAAhD,EAAE,KAAK,EAAE,MAAM,OAA6B,EAAxB,UAAU,cAA9B,mBAAgC,CAAF;IAClD,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAC7E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,GAAiB,CAAC;IAChE,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAC5D,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA,CACnB,CAAC;IAEF,MAAM,uBAAuB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC/C,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA,EAAE,CAAC;YACvB,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,CAAC,CAAC;IAExB,MAAM,oBAAoB,GACxB,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,KAAI,CAAC,mBAAmB;QACvC,CAAC,CAAC,0CAA0C;QAC5C,CAAC,CAAC,kBAAkB,CAAC;IAEzB,OAAO,CACL,uBAAC,kCAAiB,cAChB,wBAAC,+BAAc,IAAC,KAAK,EAAE,KAAK,aAC1B,gCAAK,SAAS,EAAE,oBAAoB,YAClC,uBAAC,yBAAW,oBACN,UAAU,IACd,mBAAmB,EAAE,cAAc,EACnC,mBAAmB,EAAE,0BAA0B,IAC/C,GACE,EACL,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,KAAI,CACpB,uBAAC,WAAW,IACV,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,mBAAmB,EAClC,uBAAuB,EAAE,uBAAuB,EAChD,aAAa,EAAE,uBAAuB,GACtC,CACH,IACc,GACC,CACrB,CAAC;AACJ,CAAC,CAAC;AA3CW,QAAA,KAAK,SA2ChB","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 } from 'echarts';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ChartContainer } from './ChartContainer';\nimport { ChartRender } from './ChartRender';\nimport { ChartRefsProvider } from './hooks/use-chart-refs';\nimport { useLegendSeries } from './hooks/use-legend-series';\nimport { Legend } from './Legend';\nimport { type ChartProps } from './utils/chart-types';\n\ntype ChartLegendProps = {\n chartOption: EChartsOption | undefined;\n isLayoutReady: boolean;\n isWaitingForFirstResize: boolean;\n onLayoutReady?: () => void;\n};\n\n/**\n * Bridges the rendered ECharts option into the React legend.\n *\n * `useLegendSeries` reads the current chart option and ECharts color state to\n * derive the legend rows. Rendering is deferred until the chart has completed\n * its first resize so the legend does not measure against an uninitialized\n * chart instance.\n */\nconst ChartLegend = ({\n chartOption,\n isLayoutReady,\n isWaitingForFirstResize,\n onLayoutReady,\n}: ChartLegendProps) => {\n const legendSeries = useLegendSeries({\n chartOption,\n isWaitingForFirstResize,\n });\n\n if (isWaitingForFirstResize) {\n return (\n <div\n aria-hidden=\"true\"\n className=\"ndl-chart-legend-container ndl-chart-legend-container-placeholder\"\n />\n );\n }\n\n return (\n <Legend\n series={legendSeries ?? []}\n onLayoutReady={onLayoutReady}\n isLayoutReady={isLayoutReady}\n />\n );\n};\n\n/**\n * A chart component powered by Apache ECharts with Needle's customization and theming.\n *\n * The `Chart` component fills 100% of its parent's width and height. Because it\n * relies on the container's `clientHeight` to size the canvas, **the parent element\n * must have an explicit height** (e.g. a fixed px/rem value or a viewport unit).\n *\n * @example\n * ```tsx\n * <div style={{ height: '350px' }}>\n * <Chart dataset={dataset} series={series} xAxis={xAxis} yAxis={yAxis} />\n * </div>\n * ```\n *\n * @remarks\n * **Data zoom sliders.** A `dataZoom` slider passed through `option` targets\n * the x-axis unless it is bound to an axis explicitly, so on a horizontal bar\n * chart it zooms the value axis rather than the categories. Bind the slider to\n * the category axis with `yAxisIndex: [0]` (or set `orient: 'vertical'`) to\n * page through the bars instead; Needle then lays the slider out vertically on\n * the right of the chart and reserves grid space for it. Sliders that target a\n * continuous (`value`, `time`, or `log`) axis default to `filterMode: 'none'`\n * so out-of-window data is clipped rather than removed, while category-axis\n * sliders keep ECharts' `'filter'` default so the opposite value axis rescales\n * to the visible data.\n *\n * **Drag-to-zoom.** Dragging in the plot area zooms the axes your `dataZoom`\n * config targets: entries bound to a y-axis (`yAxisIndex` or\n * `orient: 'vertical'`) make the drag select a y band, entries on both axes\n * make it select a rectangle, and without any `dataZoom` config the drag zooms\n * the x-axis. Set `toolbox.feature.dataZoom` through `option` to override the\n * derived axes explicitly. When every drag-targeted axis is continuous the\n * drag defaults to `filterMode: 'none'`, matching the slider rule above.\n *\n * **Axis-label tooltips.** Hovering a truncated axis label shows its full text\n * in a tooltip. Set `xAxis.tooltip.show` or `yAxis.tooltip.show` to `false` to\n * disable this behavior for an axis.\n */\nexport const Chart = ({ style, legend, ...chartProps }: ChartProps) => {\n const [isWaitingForFirstResize, setIsWaitingForFirstResize] = useState(true);\n const [chartOption, setChartOption] = useState<EChartsOption>();\n const [isLegendLayoutReady, setIsLegendLayoutReady] = useState(\n !legend?.isVisible,\n );\n\n const handleLegendLayoutReady = useCallback(() => {\n setIsLegendLayoutReady(true);\n }, []);\n\n useEffect(() => {\n if (!legend?.isVisible) {\n setIsLegendLayoutReady(true);\n }\n }, [legend?.isVisible]);\n\n const chartLayoutClassName =\n legend?.isVisible && !isLegendLayoutReady\n ? 'ndl-chart-layout ndl-chart-layout-hidden'\n : 'ndl-chart-layout';\n\n return (\n <ChartRefsProvider>\n <ChartContainer style={style}>\n <div className={chartLayoutClassName}>\n <ChartRender\n {...chartProps}\n onChartOptionChange={setChartOption}\n onFirstResizeChange={setIsWaitingForFirstResize}\n />\n </div>\n {legend?.isVisible && (\n <ChartLegend\n chartOption={chartOption}\n isLayoutReady={isLegendLayoutReady}\n isWaitingForFirstResize={isWaitingForFirstResize}\n onLayoutReady={handleLegendLayoutReady}\n />\n )}\n </ChartContainer>\n </ChartRefsProvider>\n );\n};\n"]}
1
+ {"version":3,"file":"Chart.js","names":["useLegendSeries","Legend","useState","useCallback","ChartRefsProvider","ChartContainer","ChartRender"],"sources":["../../../src/charts/Chart.tsx"],"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 } from 'echarts';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ChartContainer } from './ChartContainer';\nimport { ChartRender } from './ChartRender';\nimport { ChartRefsProvider } from './hooks/use-chart-refs';\nimport { useLegendSeries } from './hooks/use-legend-series';\nimport { Legend } from './Legend';\nimport { type ChartProps } from './utils/chart-types';\n\ntype ChartLegendProps = {\n chartOption: EChartsOption | undefined;\n isLayoutReady: boolean;\n isWaitingForFirstResize: boolean;\n onLayoutReady?: () => void;\n};\n\n/**\n * Bridges the rendered ECharts option into the React legend.\n *\n * `useLegendSeries` reads the current chart option and ECharts color state to\n * derive the legend rows. Rendering is deferred until the chart has completed\n * its first resize so the legend does not measure against an uninitialized\n * chart instance.\n */\nconst ChartLegend = ({\n chartOption,\n isLayoutReady,\n isWaitingForFirstResize,\n onLayoutReady,\n}: ChartLegendProps) => {\n const legendSeries = useLegendSeries({\n chartOption,\n isWaitingForFirstResize,\n });\n\n if (isWaitingForFirstResize) {\n return (\n <div\n aria-hidden=\"true\"\n className=\"ndl-chart-legend-container ndl-chart-legend-container-placeholder\"\n />\n );\n }\n\n return (\n <Legend\n series={legendSeries ?? []}\n onLayoutReady={onLayoutReady}\n isLayoutReady={isLayoutReady}\n />\n );\n};\n\n/**\n * A chart component powered by Apache ECharts with Needle's customization and theming.\n *\n * The `Chart` component fills 100% of its parent's width and height. Because it\n * relies on the container's `clientHeight` to size the canvas, **the parent element\n * must have an explicit height** (e.g. a fixed px/rem value or a viewport unit).\n *\n * @example\n * ```tsx\n * <div style={{ height: '350px' }}>\n * <Chart dataset={dataset} series={series} xAxis={xAxis} yAxis={yAxis} />\n * </div>\n * ```\n *\n * @remarks\n * **Data zoom sliders.** A `dataZoom` slider passed through `option` targets\n * the x-axis unless it is bound to an axis explicitly, so on a horizontal bar\n * chart it zooms the value axis rather than the categories. Bind the slider to\n * the category axis with `yAxisIndex: [0]` (or set `orient: 'vertical'`) to\n * page through the bars instead; Needle then lays the slider out vertically on\n * the right of the chart and reserves grid space for it. Sliders that target a\n * continuous (`value`, `time`, or `log`) axis default to `filterMode: 'none'`\n * so out-of-window data is clipped rather than removed, while category-axis\n * sliders keep ECharts' `'filter'` default so the opposite value axis rescales\n * to the visible data.\n *\n * **Drag-to-zoom.** Dragging in the plot area zooms the axes your `dataZoom`\n * config targets: entries bound to a y-axis (`yAxisIndex` or\n * `orient: 'vertical'`) make the drag select a y band, entries on both axes\n * make it select a rectangle, and without any `dataZoom` config the drag zooms\n * the x-axis. Set `toolbox.feature.dataZoom` through `option` to override the\n * derived axes explicitly. When every drag-targeted axis is continuous the\n * drag defaults to `filterMode: 'none'`, matching the slider rule above.\n *\n * **Axis-label tooltips.** Hovering a truncated axis label shows its full text\n * in a tooltip. Set `xAxis.tooltip.show` or `yAxis.tooltip.show` to `false` to\n * disable this behavior for an axis.\n */\nexport const Chart = ({ style, legend, ...chartProps }: ChartProps) => {\n const [isWaitingForFirstResize, setIsWaitingForFirstResize] = useState(true);\n const [chartOption, setChartOption] = useState<EChartsOption>();\n const [isLegendLayoutReady, setIsLegendLayoutReady] = useState(\n !legend?.isVisible,\n );\n\n const handleLegendLayoutReady = useCallback(() => {\n setIsLegendLayoutReady(true);\n }, []);\n\n useEffect(() => {\n if (!legend?.isVisible) {\n setIsLegendLayoutReady(true);\n }\n }, [legend?.isVisible]);\n\n const chartLayoutClassName =\n legend?.isVisible && !isLegendLayoutReady\n ? 'ndl-chart-layout ndl-chart-layout-hidden'\n : 'ndl-chart-layout';\n\n return (\n <ChartRefsProvider>\n <ChartContainer style={style}>\n <div className={chartLayoutClassName}>\n <ChartRender\n {...chartProps}\n onChartOptionChange={setChartOption}\n onFirstResizeChange={setIsWaitingForFirstResize}\n />\n </div>\n {legend?.isVisible && (\n <ChartLegend\n chartOption={chartOption}\n isLayoutReady={isLegendLayoutReady}\n isWaitingForFirstResize={isWaitingForFirstResize}\n onLayoutReady={handleLegendLayoutReady}\n />\n )}\n </ChartContainer>\n </ChartRefsProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiHwB,MAAA,YAAA,CAAA,SAAO,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnE/B,MAAM,eAAe,EACnB,aACA,eACA,yBACA,oBACsB;CACtB,MAAM,eAAeA,uCAAAA,gBAAgB;EACnC;EACA;CACF,CAAC;CAED,IAAI,yBACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,eAAY;EACZ,WAAU;CACX,CAAA;CAIL,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,QAAD;EACE,QAAQ,iBAAA,QAAA,iBAAA,KAAA,IAAA,eAAgB,CAAC;EACV;EACA;CAChB,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,SAAS,SAAiD;CAAjD,IAAA,EAAE,OAAO,WAAA,MAAW,aAAA,gCAAA,QAAA,MAAA,SAAA;CACxC,MAAM,CAAC,yBAAyB,+BAAA,GAA8BC,MAAAA,SAAAA,CAAS,IAAI;CAC3E,MAAM,CAAC,aAAa,mBAAA,GAAkBA,MAAAA,SAAAA,CAAwB;CAC9D,MAAM,CAAC,qBAAqB,2BAAA,GAA0BA,MAAAA,SAAAA,CACpD,EAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IAAC,OAAQ,UACX;CAEA,MAAM,2BAAA,GAA0BC,MAAAA,YAAAA,OAAkB;EAChD,uBAAuB,IAAI;CAC7B,GAAG,CAAC,CAAC;CAEL,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,IAAI,EAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IAAC,OAAQ,YACX,uBAAuB,IAAI;CAE/B,GAAG,CAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IAAC,OAAQ,SAAS,CAAC;CAEtB,MAAM,wBAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IACJ,OAAQ,cAAa,CAAC,sBAClB,6CACA;CAEN,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,oCAAAA,mBAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,8BAAAA,gBAAD;EAAuB;EAAvB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAW;GACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,aAAAA,sBAAAA,QAAAA,sBAAAA,QAAAA,CAAAA,GACK,UAAA,GAAA,CAAA,GAAA;IACJ,qBAAqB;IACrB,qBAAqB;GACtB,CAAA,CAAA;EACE,CAAA,IAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IACJ,OAAQ,cACP,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;GACe;GACb,eAAe;GACU;GACzB,eAAe;EAChB,CAAA,CAEW;CACC,CAAA,EAAA,CAAA;AAEvB"}