@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.
- package/lib/LICENSES.txt +0 -295
- package/lib/NOTICE.txt +1383 -1392
- package/lib/{esm/charts/index.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/defineProperty.js} +13 -5
- package/lib/cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js +46 -0
- package/lib/{esm/charts/tests/ChartWrapperWithTooltipFormatter.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.js} +12 -13
- package/lib/{esm/index.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.js} +13 -2
- package/lib/cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPrimitive.js +35 -0
- package/lib/{esm/charts/utils/chart-types.js → cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPropertyKey.js} +10 -2
- package/lib/cjs/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/typeof.js +37 -0
- package/lib/cjs/_virtual/_rolldown/runtime.js +44 -0
- package/lib/cjs/charts/Chart.js +121 -111
- package/lib/cjs/charts/Chart.js.map +1 -1
- package/lib/cjs/charts/ChartContainer.js +67 -62
- package/lib/cjs/charts/ChartContainer.js.map +1 -1
- package/lib/cjs/charts/ChartEmpty.js +45 -30
- package/lib/cjs/charts/ChartEmpty.js.map +1 -1
- package/lib/cjs/charts/ChartRender.js +112 -87
- package/lib/cjs/charts/ChartRender.js.map +1 -1
- package/lib/cjs/charts/ChartTooltip.js +111 -65
- package/lib/cjs/charts/ChartTooltip.js.map +1 -1
- package/lib/cjs/charts/Legend.js +81 -69
- package/lib/cjs/charts/Legend.js.map +1 -1
- package/lib/cjs/charts/LegendItem.js +83 -62
- package/lib/cjs/charts/LegendItem.js.map +1 -1
- package/lib/cjs/charts/LegendLayout.js +330 -348
- package/lib/cjs/charts/LegendLayout.js.map +1 -1
- package/lib/cjs/charts/hooks/use-chart-instance.js +115 -122
- package/lib/cjs/charts/hooks/use-chart-instance.js.map +1 -1
- package/lib/cjs/charts/hooks/use-chart-option.js +79 -80
- package/lib/cjs/charts/hooks/use-chart-option.js.map +1 -1
- package/lib/cjs/charts/hooks/use-chart-refs.js +47 -44
- package/lib/cjs/charts/hooks/use-chart-refs.js.map +1 -1
- package/lib/cjs/charts/hooks/use-chart-zoom.js +102 -127
- package/lib/cjs/charts/hooks/use-chart-zoom.js.map +1 -1
- package/lib/cjs/charts/hooks/use-legend-interactions.js +127 -132
- package/lib/cjs/charts/hooks/use-legend-interactions.js.map +1 -1
- package/lib/cjs/charts/hooks/use-legend-series.js +143 -174
- package/lib/cjs/charts/hooks/use-legend-series.js.map +1 -1
- package/lib/cjs/charts/hooks/use-legend-visibility.js +66 -85
- package/lib/cjs/charts/hooks/use-legend-visibility.js.map +1 -1
- package/lib/cjs/charts/index.js +31 -40
- package/lib/cjs/charts/index.js.map +1 -1
- package/lib/cjs/charts/themes/ndl-echarts-theme.js +136 -168
- package/lib/cjs/charts/themes/ndl-echarts-theme.js.map +1 -1
- package/lib/cjs/charts/utils/aria-description.js +150 -214
- package/lib/cjs/charts/utils/aria-description.js.map +1 -1
- package/lib/cjs/charts/utils/build-chart-option.js +166 -174
- package/lib/cjs/charts/utils/build-chart-option.js.map +1 -1
- package/lib/cjs/charts/utils/chart-tooltip-formatter.js +156 -172
- package/lib/cjs/charts/utils/chart-tooltip-formatter.js.map +1 -1
- package/lib/cjs/charts/utils/chart-types.js +25 -20
- package/lib/cjs/charts/utils/chart-types.js.map +1 -1
- package/lib/cjs/charts/utils/defaults.js +69 -67
- package/lib/cjs/charts/utils/defaults.js.map +1 -1
- package/lib/cjs/charts/utils/format-utils.js +55 -66
- package/lib/cjs/charts/utils/format-utils.js.map +1 -1
- package/lib/cjs/charts/utils/legend-layout.js +54 -53
- package/lib/cjs/charts/utils/legend-layout.js.map +1 -1
- package/lib/cjs/charts/utils/legend-utils.js +82 -121
- package/lib/cjs/charts/utils/legend-utils.js.map +1 -1
- package/lib/cjs/charts/utils/scatter-tooltip-points.js +191 -266
- package/lib/cjs/charts/utils/scatter-tooltip-points.js.map +1 -1
- package/lib/cjs/charts/utils/threshold.js +89 -102
- package/lib/cjs/charts/utils/threshold.js.map +1 -1
- package/lib/cjs/charts/utils/user-option-utils.js +419 -347
- package/lib/cjs/charts/utils/user-option-utils.js.map +1 -1
- package/lib/cjs/index.js +31 -35
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/defineProperty.mjs +11 -0
- package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.mjs +24 -0
- package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.mjs +12 -0
- package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.mjs +11 -0
- package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPrimitive.mjs +13 -0
- package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/toPropertyKey.mjs +8 -0
- package/lib/esm/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/typeof.mjs +10 -0
- package/lib/esm/charts/Chart.mjs +123 -0
- package/lib/esm/charts/Chart.mjs.map +1 -0
- package/lib/esm/charts/ChartContainer.mjs +71 -0
- package/lib/esm/charts/ChartContainer.mjs.map +1 -0
- package/lib/esm/charts/ChartEmpty.mjs +46 -0
- package/lib/esm/charts/ChartEmpty.mjs.map +1 -0
- package/lib/esm/charts/ChartRender.mjs +113 -0
- package/lib/esm/charts/ChartRender.mjs.map +1 -0
- package/lib/esm/charts/ChartTooltip.mjs +109 -0
- package/lib/esm/charts/ChartTooltip.mjs.map +1 -0
- package/lib/esm/charts/Legend.mjs +82 -0
- package/lib/esm/charts/Legend.mjs.map +1 -0
- package/lib/esm/charts/LegendItem.mjs +82 -0
- package/lib/esm/charts/LegendItem.mjs.map +1 -0
- package/lib/esm/charts/LegendLayout.mjs +337 -0
- package/lib/esm/charts/LegendLayout.mjs.map +1 -0
- package/lib/esm/charts/hooks/use-chart-instance.mjs +119 -0
- package/lib/esm/charts/hooks/use-chart-instance.mjs.map +1 -0
- package/lib/esm/charts/hooks/use-chart-option.mjs +79 -0
- package/lib/esm/charts/hooks/use-chart-option.mjs.map +1 -0
- package/lib/esm/charts/hooks/use-chart-refs.mjs +49 -0
- package/lib/esm/charts/hooks/use-chart-refs.mjs.map +1 -0
- package/lib/esm/charts/hooks/use-chart-zoom.mjs +102 -0
- package/lib/esm/charts/hooks/use-chart-zoom.mjs.map +1 -0
- package/lib/esm/charts/hooks/use-legend-interactions.mjs +138 -0
- package/lib/esm/charts/hooks/use-legend-interactions.mjs.map +1 -0
- package/lib/esm/charts/hooks/use-legend-series.mjs +151 -0
- package/lib/esm/charts/hooks/use-legend-series.mjs.map +1 -0
- package/lib/esm/charts/hooks/use-legend-visibility.mjs +67 -0
- package/lib/esm/charts/hooks/use-legend-visibility.mjs.map +1 -0
- package/lib/esm/charts/index.mjs +27 -0
- package/lib/esm/charts/index.mjs.map +1 -0
- package/lib/esm/charts/themes/ndl-echarts-theme.mjs +139 -0
- package/lib/esm/charts/themes/ndl-echarts-theme.mjs.map +1 -0
- package/lib/esm/charts/utils/aria-description.mjs +162 -0
- package/lib/esm/charts/utils/aria-description.mjs.map +1 -0
- package/lib/esm/charts/utils/build-chart-option.mjs +184 -0
- package/lib/esm/charts/utils/build-chart-option.mjs.map +1 -0
- package/lib/esm/charts/utils/chart-tooltip-formatter.mjs +159 -0
- package/lib/esm/charts/utils/chart-tooltip-formatter.mjs.map +1 -0
- package/lib/esm/charts/utils/chart-types.mjs +24 -0
- package/lib/esm/charts/utils/chart-types.mjs.map +1 -0
- package/lib/esm/charts/utils/defaults.mjs +73 -0
- package/lib/esm/charts/utils/defaults.mjs.map +1 -0
- package/lib/esm/charts/utils/format-utils.mjs +61 -0
- package/lib/esm/charts/utils/format-utils.mjs.map +1 -0
- package/lib/esm/charts/utils/legend-layout.mjs +57 -0
- package/lib/esm/charts/utils/legend-layout.mjs.map +1 -0
- package/lib/esm/charts/utils/legend-utils.mjs +90 -0
- package/lib/esm/charts/utils/legend-utils.mjs.map +1 -0
- package/lib/esm/charts/utils/scatter-tooltip-points.mjs +215 -0
- package/lib/esm/charts/utils/scatter-tooltip-points.mjs.map +1 -0
- package/lib/esm/charts/utils/threshold.mjs +92 -0
- package/lib/esm/charts/utils/threshold.mjs.map +1 -0
- package/lib/esm/charts/utils/user-option-utils.mjs +445 -0
- package/lib/esm/charts/utils/user-option-utils.mjs.map +1 -0
- package/lib/esm/index.mjs +27 -0
- package/lib/esm/index.mjs.map +1 -0
- package/package.json +12 -16
- package/skills/ndl-react-charts/SKILL.md +2 -2
- package/lib/cjs/charts/tests/ChartWrapperWithTooltipFormatter.js +0 -38
- package/lib/cjs/charts/tests/ChartWrapperWithTooltipFormatter.js.map +0 -1
- package/lib/cjs/charts/tests/ChartZoomHarness.js +0 -113
- package/lib/cjs/charts/tests/ChartZoomHarness.js.map +0 -1
- package/lib/cjs/charts/tests/HorizontalBarWithVerticalSlider.js +0 -78
- package/lib/cjs/charts/tests/HorizontalBarWithVerticalSlider.js.map +0 -1
- package/lib/cjs/charts/tests/PieChartWithRerender.js +0 -46
- package/lib/cjs/charts/tests/PieChartWithRerender.js.map +0 -1
- package/lib/cjs/charts/tests/chart-test-utils.js +0 -527
- package/lib/cjs/charts/tests/chart-test-utils.js.map +0 -1
- package/lib/esm/charts/Chart.js +0 -114
- package/lib/esm/charts/Chart.js.map +0 -1
- package/lib/esm/charts/ChartContainer.js +0 -67
- package/lib/esm/charts/ChartContainer.js.map +0 -1
- package/lib/esm/charts/ChartEmpty.js +0 -33
- package/lib/esm/charts/ChartEmpty.js.map +0 -1
- package/lib/esm/charts/ChartRender.js +0 -89
- package/lib/esm/charts/ChartRender.js.map +0 -1
- package/lib/esm/charts/ChartTooltip.js +0 -64
- package/lib/esm/charts/ChartTooltip.js.map +0 -1
- package/lib/esm/charts/Legend.js +0 -71
- package/lib/esm/charts/Legend.js.map +0 -1
- package/lib/esm/charts/LegendItem.js +0 -61
- package/lib/esm/charts/LegendItem.js.map +0 -1
- package/lib/esm/charts/LegendLayout.js +0 -323
- package/lib/esm/charts/LegendLayout.js.map +0 -1
- package/lib/esm/charts/hooks/use-chart-instance.js +0 -128
- package/lib/esm/charts/hooks/use-chart-instance.js.map +0 -1
- package/lib/esm/charts/hooks/use-chart-option.js +0 -82
- package/lib/esm/charts/hooks/use-chart-option.js.map +0 -1
- package/lib/esm/charts/hooks/use-chart-refs.js +0 -48
- package/lib/esm/charts/hooks/use-chart-refs.js.map +0 -1
- package/lib/esm/charts/hooks/use-chart-zoom.js +0 -129
- package/lib/esm/charts/hooks/use-chart-zoom.js.map +0 -1
- package/lib/esm/charts/hooks/use-legend-interactions.js +0 -145
- package/lib/esm/charts/hooks/use-legend-interactions.js.map +0 -1
- package/lib/esm/charts/hooks/use-legend-series.js +0 -184
- package/lib/esm/charts/hooks/use-legend-series.js.map +0 -1
- package/lib/esm/charts/hooks/use-legend-visibility.js +0 -87
- package/lib/esm/charts/hooks/use-legend-visibility.js.map +0 -1
- package/lib/esm/charts/index.js.map +0 -1
- package/lib/esm/charts/tests/ChartWrapperWithTooltipFormatter.js.map +0 -1
- package/lib/esm/charts/tests/ChartZoomHarness.js +0 -109
- package/lib/esm/charts/tests/ChartZoomHarness.js.map +0 -1
- package/lib/esm/charts/tests/HorizontalBarWithVerticalSlider.js +0 -74
- package/lib/esm/charts/tests/HorizontalBarWithVerticalSlider.js.map +0 -1
- package/lib/esm/charts/tests/PieChartWithRerender.js +0 -43
- package/lib/esm/charts/tests/PieChartWithRerender.js.map +0 -1
- package/lib/esm/charts/tests/chart-test-utils.js +0 -500
- package/lib/esm/charts/tests/chart-test-utils.js.map +0 -1
- package/lib/esm/charts/themes/ndl-echarts-theme.js +0 -172
- package/lib/esm/charts/themes/ndl-echarts-theme.js.map +0 -1
- package/lib/esm/charts/utils/aria-description.js +0 -228
- package/lib/esm/charts/utils/aria-description.js.map +0 -1
- package/lib/esm/charts/utils/build-chart-option.js +0 -193
- package/lib/esm/charts/utils/build-chart-option.js.map +0 -1
- package/lib/esm/charts/utils/chart-tooltip-formatter.js +0 -177
- package/lib/esm/charts/utils/chart-tooltip-formatter.js.map +0 -1
- package/lib/esm/charts/utils/chart-types.js.map +0 -1
- package/lib/esm/charts/utils/defaults.js +0 -73
- package/lib/esm/charts/utils/defaults.js.map +0 -1
- package/lib/esm/charts/utils/format-utils.js +0 -74
- package/lib/esm/charts/utils/format-utils.js.map +0 -1
- package/lib/esm/charts/utils/legend-layout.js +0 -59
- package/lib/esm/charts/utils/legend-layout.js.map +0 -1
- package/lib/esm/charts/utils/legend-utils.js +0 -131
- package/lib/esm/charts/utils/legend-utils.js.map +0 -1
- package/lib/esm/charts/utils/scatter-tooltip-points.js +0 -291
- package/lib/esm/charts/utils/scatter-tooltip-points.js.map +0 -1
- package/lib/esm/charts/utils/threshold.js +0 -106
- package/lib/esm/charts/utils/threshold.js.map +0 -1
- package/lib/esm/charts/utils/user-option-utils.js +0 -374
- package/lib/esm/charts/utils/user-option-utils.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
|
@@ -1,363 +1,345 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
17
5
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
-
var t = {};
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
-
t[p] = s[p];
|
|
39
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
-
t[p[i]] = s[p[i]];
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
45
|
-
};
|
|
46
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
-
};
|
|
49
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.LegendLayout = void 0;
|
|
51
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
7
|
+
const require_charts_utils_legend_layout = require("./utils/legend-layout.js");
|
|
8
|
+
const require_objectSpread2 = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js");
|
|
9
|
+
const require_objectWithoutProperties = require("../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.js");
|
|
10
|
+
let react = require("react");
|
|
11
|
+
react = require_runtime.__toESM(react);
|
|
12
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
+
let _neo4j_ndl_react = require("@neo4j-ndl/react");
|
|
14
|
+
let classnames = require("classnames");
|
|
15
|
+
classnames = require_runtime.__toESM(classnames);
|
|
16
|
+
// src/charts/LegendLayout.tsx
|
|
52
17
|
/*!
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
+
*/
|
|
37
|
+
const _excluded = [
|
|
38
|
+
"children",
|
|
39
|
+
"className",
|
|
40
|
+
"isLayoutReady",
|
|
41
|
+
"itemCount",
|
|
42
|
+
"onLayoutReady",
|
|
43
|
+
"htmlAttributes"
|
|
44
|
+
];
|
|
76
45
|
const getLegendElementsContentHeight = (legendContent, elements) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return elementsBottom + paddingBottom;
|
|
46
|
+
const legendContentStyle = getComputedStyle(legendContent);
|
|
47
|
+
const paddingBottom = parseFloat(legendContentStyle.paddingBottom) || 0;
|
|
48
|
+
return Math.max(...elements.map((element) => element.offsetTop + element.offsetHeight)) + paddingBottom;
|
|
81
49
|
};
|
|
82
|
-
const getCollapsedLegendContentHeight = ({ availableRowWidth, elements, legendContent
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const rowsHeight = rowHeights.reduce((height, rowHeight) => {
|
|
106
|
-
return height + rowHeight;
|
|
107
|
-
}, 0);
|
|
108
|
-
return (paddingTop +
|
|
109
|
-
rowsHeight +
|
|
110
|
-
rowGap * Math.max(rowHeights.length - 1, 0) +
|
|
111
|
-
paddingBottom);
|
|
50
|
+
const getCollapsedLegendContentHeight = ({ availableRowWidth, elements, legendContent }) => {
|
|
51
|
+
const legendContentStyle = getComputedStyle(legendContent);
|
|
52
|
+
const paddingTop = parseFloat(legendContentStyle.paddingTop) || 0;
|
|
53
|
+
const paddingBottom = parseFloat(legendContentStyle.paddingBottom) || 0;
|
|
54
|
+
const rowGap = parseFloat(legendContentStyle.rowGap) || 0;
|
|
55
|
+
let currentRowHeight = 0;
|
|
56
|
+
let currentRowWidth = 0;
|
|
57
|
+
const rowHeights = [];
|
|
58
|
+
elements.forEach((element) => {
|
|
59
|
+
const elementWidth = require_charts_utils_legend_layout.getComputedElementWidth(element);
|
|
60
|
+
const elementHeight = element.getBoundingClientRect().height;
|
|
61
|
+
if (currentRowWidth > 0 && currentRowWidth + elementWidth > availableRowWidth) {
|
|
62
|
+
rowHeights.push(currentRowHeight);
|
|
63
|
+
currentRowHeight = 0;
|
|
64
|
+
currentRowWidth = 0;
|
|
65
|
+
}
|
|
66
|
+
currentRowWidth += elementWidth;
|
|
67
|
+
currentRowHeight = Math.max(currentRowHeight, elementHeight);
|
|
68
|
+
});
|
|
69
|
+
if (currentRowHeight > 0) rowHeights.push(currentRowHeight);
|
|
70
|
+
return paddingTop + rowHeights.reduce((height, rowHeight) => {
|
|
71
|
+
return height + rowHeight;
|
|
72
|
+
}, 0) + rowGap * Math.max(rowHeights.length - 1, 0) + paddingBottom;
|
|
112
73
|
};
|
|
113
74
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
75
|
+
* Tracks legend container width for responsive collapsed-layout recalculation.
|
|
76
|
+
*
|
|
77
|
+
* The width is kept in state so `useCollapsibleLegendLayout` can re-measure item
|
|
78
|
+
* wrapping whenever the available legend width changes.
|
|
79
|
+
*/
|
|
119
80
|
const useLegendContainerWidth = (legendContainerRef) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
resizeObserver.disconnect();
|
|
139
|
-
};
|
|
140
|
-
}, [legendContainerRef, updateLegendWidth]);
|
|
141
|
-
return legendWidth;
|
|
81
|
+
const [legendWidth, setLegendWidth] = (0, react.useState)(Infinity);
|
|
82
|
+
const updateLegendWidth = (0, react.useCallback)(() => {
|
|
83
|
+
var _legendContainerRef$c;
|
|
84
|
+
const nextWidth = (_legendContainerRef$c = legendContainerRef.current) === null || _legendContainerRef$c === void 0 ? void 0 : _legendContainerRef$c.clientWidth;
|
|
85
|
+
if (nextWidth === void 0) return;
|
|
86
|
+
setLegendWidth(nextWidth);
|
|
87
|
+
}, [legendContainerRef]);
|
|
88
|
+
(0, react.useEffect)(() => {
|
|
89
|
+
updateLegendWidth();
|
|
90
|
+
const legendContainer = legendContainerRef.current;
|
|
91
|
+
if (!legendContainer) return;
|
|
92
|
+
const resizeObserver = new ResizeObserver(updateLegendWidth);
|
|
93
|
+
resizeObserver.observe(legendContainer);
|
|
94
|
+
return () => {
|
|
95
|
+
resizeObserver.disconnect();
|
|
96
|
+
};
|
|
97
|
+
}, [legendContainerRef, updateLegendWidth]);
|
|
98
|
+
return legendWidth;
|
|
142
99
|
};
|
|
143
100
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const useCollapsibleLegendLayout = ({ itemCount, legendContainerRef, legendContentRef, legendMeasurementRef, viewMoreButtonMeasurementRef
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
101
|
+
* Owns the collapsed, measuring, and expanded layout state for wrapping legends.
|
|
102
|
+
*
|
|
103
|
+
* Collapsed legends only render the visible subset of items. When the item count
|
|
104
|
+
* or container width changes, the hook temporarily renders every item in an
|
|
105
|
+
* invisible measuring pass so it can calculate wrapping, overflow, and the next
|
|
106
|
+
* visible item count. The last collapsed height is preserved during that pass so
|
|
107
|
+
* the chart area does not shrink while the hidden full legend is being measured.
|
|
108
|
+
*/
|
|
109
|
+
const useCollapsibleLegendLayout = ({ itemCount, legendContainerRef, legendContentRef, legendMeasurementRef, viewMoreButtonMeasurementRef }) => {
|
|
110
|
+
const [isExpanded, setIsExpanded] = (0, react.useState)(false);
|
|
111
|
+
const [isMeasuring, setIsMeasuring] = (0, react.useState)(false);
|
|
112
|
+
const [layoutSnapshot, setLayoutSnapshot] = (0, react.useState)({
|
|
113
|
+
contentHeight: 0,
|
|
114
|
+
hasOverflow: false,
|
|
115
|
+
visibleItemCount: itemCount
|
|
116
|
+
});
|
|
117
|
+
const skipNextCollapseMeasurementRef = (0, react.useRef)(false);
|
|
118
|
+
const legendWidth = useLegendContainerWidth(legendContainerRef);
|
|
119
|
+
const updateVisibleItems = (0, react.useCallback)(() => {
|
|
120
|
+
var _legendContainer$clie;
|
|
121
|
+
const legendContent = legendMeasurementRef.current;
|
|
122
|
+
const viewMoreButton = viewMoreButtonMeasurementRef.current;
|
|
123
|
+
if (!legendContent || !viewMoreButton) {
|
|
124
|
+
setIsMeasuring(false);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const legendItems = Array.from(legendContent.querySelectorAll(".ndl-chart-legend-item")).filter((element) => element.offsetParent !== null);
|
|
128
|
+
if (legendItems.length === 0) {
|
|
129
|
+
setLayoutSnapshot((snapshot) => require_objectSpread2.default(require_objectSpread2.default({}, snapshot), {}, {
|
|
130
|
+
contentHeight: 0,
|
|
131
|
+
hasOverflow: false,
|
|
132
|
+
visibleItemCount: itemCount
|
|
133
|
+
}));
|
|
134
|
+
setIsMeasuring(false);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const rowTops = Array.from(new Set(legendItems.map((element) => element.offsetTop))).sort((left, right) => left - right);
|
|
138
|
+
const nextLegendContentHeight = legendContent.scrollHeight;
|
|
139
|
+
const nextLegendItemsContentHeight = getLegendElementsContentHeight(legendContent, legendItems);
|
|
140
|
+
if (rowTops.length <= 2) {
|
|
141
|
+
setLayoutSnapshot((snapshot) => require_objectSpread2.default(require_objectSpread2.default({}, snapshot), {}, {
|
|
142
|
+
contentHeight: nextLegendItemsContentHeight,
|
|
143
|
+
hasOverflow: false,
|
|
144
|
+
visibleItemCount: itemCount
|
|
145
|
+
}));
|
|
146
|
+
setIsMeasuring(false);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const legendContainer = legendContainerRef.current;
|
|
150
|
+
const legendContentStyle = getComputedStyle(legendContent);
|
|
151
|
+
const availableRowWidth = ((_legendContainer$clie = legendContainer === null || legendContainer === void 0 ? void 0 : legendContainer.clientWidth) !== null && _legendContainer$clie !== void 0 ? _legendContainer$clie : legendContent.clientWidth) - (parseFloat(legendContentStyle.paddingLeft) || 0) - (parseFloat(legendContentStyle.paddingRight) || 0);
|
|
152
|
+
const viewMoreButtonWidth = require_charts_utils_legend_layout.getComputedElementWidth(viewMoreButton);
|
|
153
|
+
const legendItemWidths = legendItems.map(require_charts_utils_legend_layout.getComputedElementWidth);
|
|
154
|
+
const nextVisibleItemCount = require_charts_utils_legend_layout.getCollapsedVisibleItemCount(legendItemWidths, availableRowWidth, viewMoreButtonWidth);
|
|
155
|
+
const nextCollapsedContentHeight = getCollapsedLegendContentHeight({
|
|
156
|
+
availableRowWidth,
|
|
157
|
+
elements: [...legendItems.slice(0, nextVisibleItemCount), viewMoreButton],
|
|
158
|
+
legendContent
|
|
159
|
+
});
|
|
160
|
+
setLayoutSnapshot((snapshot) => require_objectSpread2.default(require_objectSpread2.default({}, snapshot), {}, {
|
|
161
|
+
collapsedHeight: Math.min(nextCollapsedContentHeight, 64),
|
|
162
|
+
contentHeight: nextLegendContentHeight,
|
|
163
|
+
hasOverflow: nextVisibleItemCount < itemCount,
|
|
164
|
+
visibleItemCount: nextVisibleItemCount
|
|
165
|
+
}));
|
|
166
|
+
setIsMeasuring(false);
|
|
167
|
+
}, [
|
|
168
|
+
itemCount,
|
|
169
|
+
legendContainerRef,
|
|
170
|
+
legendMeasurementRef,
|
|
171
|
+
viewMoreButtonMeasurementRef
|
|
172
|
+
]);
|
|
173
|
+
(0, react.useEffect)(() => {
|
|
174
|
+
setIsExpanded(false);
|
|
175
|
+
}, [itemCount]);
|
|
176
|
+
(0, react.useEffect)(() => {
|
|
177
|
+
if (isExpanded) {
|
|
178
|
+
setIsMeasuring(false);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (skipNextCollapseMeasurementRef.current) {
|
|
182
|
+
skipNextCollapseMeasurementRef.current = false;
|
|
183
|
+
setIsMeasuring(false);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
setIsMeasuring(true);
|
|
187
|
+
}, [
|
|
188
|
+
isExpanded,
|
|
189
|
+
itemCount,
|
|
190
|
+
legendWidth
|
|
191
|
+
]);
|
|
192
|
+
(0, react.useEffect)(() => {
|
|
193
|
+
const isMeasuringCollapsed = !isExpanded && isMeasuring;
|
|
194
|
+
const animationFrame = requestAnimationFrame(() => {
|
|
195
|
+
if (isMeasuringCollapsed) updateVisibleItems();
|
|
196
|
+
else {
|
|
197
|
+
setLayoutSnapshot((snapshot) => {
|
|
198
|
+
var _legendContentRef$cur, _legendContentRef$cur2;
|
|
199
|
+
return require_objectSpread2.default(require_objectSpread2.default({}, snapshot), {}, { contentHeight: (_legendContentRef$cur = (_legendContentRef$cur2 = legendContentRef.current) === null || _legendContentRef$cur2 === void 0 ? void 0 : _legendContentRef$cur2.scrollHeight) !== null && _legendContentRef$cur !== void 0 ? _legendContentRef$cur : 0 });
|
|
200
|
+
});
|
|
201
|
+
if (!isMeasuring && !isExpanded && layoutSnapshot.hasOverflow) setLayoutSnapshot((snapshot) => {
|
|
202
|
+
var _legendContentRef$cur3;
|
|
203
|
+
return require_objectSpread2.default(require_objectSpread2.default({}, snapshot), {}, { collapsedHeight: (_legendContentRef$cur3 = legendContentRef.current) === null || _legendContentRef$cur3 === void 0 ? void 0 : _legendContentRef$cur3.getBoundingClientRect().height });
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return () => {
|
|
208
|
+
cancelAnimationFrame(animationFrame);
|
|
209
|
+
};
|
|
210
|
+
}, [
|
|
211
|
+
isExpanded,
|
|
212
|
+
isMeasuring,
|
|
213
|
+
legendContentRef,
|
|
214
|
+
layoutSnapshot.hasOverflow,
|
|
215
|
+
updateVisibleItems
|
|
216
|
+
]);
|
|
217
|
+
const expandLegend = (0, react.useCallback)(() => {
|
|
218
|
+
setIsMeasuring(false);
|
|
219
|
+
setIsExpanded(true);
|
|
220
|
+
}, []);
|
|
221
|
+
return {
|
|
222
|
+
collapseLegend: (0, react.useCallback)(() => {
|
|
223
|
+
skipNextCollapseMeasurementRef.current = true;
|
|
224
|
+
setIsExpanded(false);
|
|
225
|
+
}, []),
|
|
226
|
+
expandLegend,
|
|
227
|
+
isExpanded,
|
|
228
|
+
isMeasuring,
|
|
229
|
+
layoutSnapshot
|
|
230
|
+
};
|
|
264
231
|
};
|
|
265
232
|
/**
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const LegendLayout = (
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
233
|
+
* Renders the responsive legend layout shell.
|
|
234
|
+
*
|
|
235
|
+
* The component switches between a two-row collapsed view, an invisible
|
|
236
|
+
* measurement view, and an expanded scrollable view while keeping the
|
|
237
|
+
* "View more"/"View less" action wired to the measured overflow state.
|
|
238
|
+
*/
|
|
239
|
+
const LegendLayout = (_ref) => {
|
|
240
|
+
let { children, className, isLayoutReady = true, itemCount, onLayoutReady, htmlAttributes } = _ref, restProps = require_objectWithoutProperties.default(_ref, _excluded);
|
|
241
|
+
const legendContainerRef = (0, react.useRef)(null);
|
|
242
|
+
const legendContentRef = (0, react.useRef)(null);
|
|
243
|
+
const legendMeasurementRef = (0, react.useRef)(null);
|
|
244
|
+
const pendingFocusLegendItemIndexRef = (0, react.useRef)(null);
|
|
245
|
+
const viewMoreButtonMeasurementRef = (0, react.useRef)(null);
|
|
246
|
+
const { collapseLegend, expandLegend, isExpanded, isMeasuring, layoutSnapshot } = useCollapsibleLegendLayout({
|
|
247
|
+
itemCount,
|
|
248
|
+
legendContainerRef,
|
|
249
|
+
legendContentRef,
|
|
250
|
+
legendMeasurementRef,
|
|
251
|
+
viewMoreButtonMeasurementRef
|
|
252
|
+
});
|
|
253
|
+
const childList = react.default.Children.toArray(children);
|
|
254
|
+
const childrenToRender = !isExpanded ? childList.slice(0, layoutSnapshot.visibleItemCount) : childList;
|
|
255
|
+
const legendHeight = !isMeasuring && !isExpanded && layoutSnapshot.hasOverflow ? layoutSnapshot.collapsedHeight : !isMeasuring && !layoutSnapshot.hasOverflow && layoutSnapshot.contentHeight ? layoutSnapshot.contentHeight : void 0;
|
|
256
|
+
(0, react.useEffect)(() => {
|
|
257
|
+
if (!isMeasuring && layoutSnapshot.contentHeight > 0) {
|
|
258
|
+
let secondFrame;
|
|
259
|
+
const firstFrame = requestAnimationFrame(() => {
|
|
260
|
+
secondFrame = requestAnimationFrame(() => {
|
|
261
|
+
onLayoutReady === null || onLayoutReady === void 0 || onLayoutReady();
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
return () => {
|
|
265
|
+
cancelAnimationFrame(firstFrame);
|
|
266
|
+
if (secondFrame !== void 0) cancelAnimationFrame(secondFrame);
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
}, [
|
|
270
|
+
isMeasuring,
|
|
271
|
+
layoutSnapshot.contentHeight,
|
|
272
|
+
onLayoutReady
|
|
273
|
+
]);
|
|
274
|
+
(0, react.useEffect)(() => {
|
|
275
|
+
var _legendContentRef$cur4, _legendItems$pendingF;
|
|
276
|
+
const pendingFocusLegendItemIndex = pendingFocusLegendItemIndexRef.current;
|
|
277
|
+
if (!isExpanded || pendingFocusLegendItemIndex === null) return;
|
|
278
|
+
const legendItems = (_legendContentRef$cur4 = legendContentRef.current) === null || _legendContentRef$cur4 === void 0 ? void 0 : _legendContentRef$cur4.querySelectorAll(".ndl-chart-legend-item");
|
|
279
|
+
legendItems === null || legendItems === void 0 || (_legendItems$pendingF = legendItems[pendingFocusLegendItemIndex]) === null || _legendItems$pendingF === void 0 || _legendItems$pendingF.focus();
|
|
280
|
+
pendingFocusLegendItemIndexRef.current = null;
|
|
281
|
+
}, [isExpanded]);
|
|
282
|
+
const handleLegendActionClick = (0, react.useCallback)(() => {
|
|
283
|
+
if (isExpanded) {
|
|
284
|
+
collapseLegend();
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
pendingFocusLegendItemIndexRef.current = layoutSnapshot.visibleItemCount;
|
|
288
|
+
expandLegend();
|
|
289
|
+
}, [
|
|
290
|
+
collapseLegend,
|
|
291
|
+
expandLegend,
|
|
292
|
+
isExpanded,
|
|
293
|
+
layoutSnapshot.visibleItemCount
|
|
294
|
+
]);
|
|
295
|
+
const classes = (0, classnames.default)("ndl-chart-legend", {
|
|
296
|
+
"ndl-chart-legend-calculating": !isExpanded && isMeasuring,
|
|
297
|
+
"ndl-chart-legend-collapsed": layoutSnapshot.hasOverflow && !isExpanded,
|
|
298
|
+
"ndl-chart-legend-expanded": layoutSnapshot.hasOverflow && isExpanded,
|
|
299
|
+
"ndl-chart-legend-hidden": !isLayoutReady,
|
|
300
|
+
"ndl-chart-legend-scrollable": layoutSnapshot.hasOverflow && isExpanded && layoutSnapshot.contentHeight > 64,
|
|
301
|
+
"ndl-chart-legend-wrapping": true
|
|
302
|
+
}, className);
|
|
303
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", require_objectSpread2.default(require_objectSpread2.default(require_objectSpread2.default({
|
|
304
|
+
ref: legendContainerRef,
|
|
305
|
+
className: "ndl-chart-legend-container"
|
|
306
|
+
}, restProps), htmlAttributes), {}, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
307
|
+
className: classes,
|
|
308
|
+
ref: legendContentRef,
|
|
309
|
+
style: {
|
|
310
|
+
height: legendHeight,
|
|
311
|
+
maxHeight: layoutSnapshot.hasOverflow && isExpanded ? "var(--ndl-chart-legend-expanded-max-height)" : layoutSnapshot.hasOverflow ? 64 : void 0
|
|
312
|
+
},
|
|
313
|
+
children: [
|
|
314
|
+
childrenToRender,
|
|
315
|
+
layoutSnapshot.hasOverflow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_neo4j_ndl_react.TextLink, {
|
|
316
|
+
as: "button",
|
|
317
|
+
className: "ndl-chart-legend-action",
|
|
318
|
+
htmlAttributes: {
|
|
319
|
+
"aria-expanded": isExpanded,
|
|
320
|
+
onClick: handleLegendActionClick,
|
|
321
|
+
type: "button"
|
|
322
|
+
},
|
|
323
|
+
children: isExpanded ? "View less" : "View more"
|
|
324
|
+
}),
|
|
325
|
+
isMeasuring && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
326
|
+
"aria-hidden": "true",
|
|
327
|
+
className: "ndl-chart-legend-measurement",
|
|
328
|
+
ref: legendMeasurementRef,
|
|
329
|
+
children: [childList, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_neo4j_ndl_react.TextLink, {
|
|
330
|
+
as: "button",
|
|
331
|
+
ref: viewMoreButtonMeasurementRef,
|
|
332
|
+
className: "ndl-chart-legend-action",
|
|
333
|
+
htmlAttributes: {
|
|
334
|
+
tabIndex: -1,
|
|
335
|
+
type: "button"
|
|
336
|
+
},
|
|
337
|
+
children: "View more"
|
|
338
|
+
})]
|
|
339
|
+
})
|
|
340
|
+
]
|
|
341
|
+
}) }));
|
|
361
342
|
};
|
|
362
343
|
exports.LegendLayout = LegendLayout;
|
|
344
|
+
|
|
363
345
|
//# sourceMappingURL=LegendLayout.js.map
|