@auth0/quantum-charts 1.3.15 → 1.3.16
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/esm/line-chart/index.js +5 -1
- package/line-chart/index.js +5 -1
- package/package.json +1 -1
package/esm/line-chart/index.js
CHANGED
|
@@ -59,6 +59,7 @@ export function LineChart(props) {
|
|
|
59
59
|
var _p = __read(React.useState(false), 2), isOpen = _p[0], setIsOpen = _p[1];
|
|
60
60
|
React.useEffect(function () {
|
|
61
61
|
setThreshold(thresholds === null || thresholds === void 0 ? void 0 : thresholds[0]);
|
|
62
|
+
setLineVisibility(__assign(__assign({}, ((thresholds === null || thresholds === void 0 ? void 0 : thresholds[0]) && { thresholdControl: false })), lineVisibility));
|
|
62
63
|
}, [thresholds]);
|
|
63
64
|
var handleLegendMouseEnter = function (e) {
|
|
64
65
|
if (!lineVisibility[e.dataKey]) {
|
|
@@ -73,7 +74,10 @@ export function LineChart(props) {
|
|
|
73
74
|
};
|
|
74
75
|
var selectLine = function (e) {
|
|
75
76
|
var _a;
|
|
76
|
-
|
|
77
|
+
var checkedLines = Object.values(lineVisibility).filter(function (line) { return line === false; }).length;
|
|
78
|
+
if (checkedLines > 1 || lineVisibility[e.dataKey]) {
|
|
79
|
+
setLineVisibility(__assign(__assign({}, lineVisibility), (_a = {}, _a[e.dataKey] = !lineVisibility[e.dataKey], _a.hover = null, _a)));
|
|
80
|
+
}
|
|
77
81
|
};
|
|
78
82
|
var getThresholdData = function (threshold, entry) {
|
|
79
83
|
var ewma = entry.ewma, stdDev = entry.stdDev;
|
package/line-chart/index.js
CHANGED
|
@@ -88,6 +88,7 @@ function LineChart(props) {
|
|
|
88
88
|
var _p = __read(React.useState(false), 2), isOpen = _p[0], setIsOpen = _p[1];
|
|
89
89
|
React.useEffect(function () {
|
|
90
90
|
setThreshold(thresholds === null || thresholds === void 0 ? void 0 : thresholds[0]);
|
|
91
|
+
setLineVisibility(__assign(__assign({}, ((thresholds === null || thresholds === void 0 ? void 0 : thresholds[0]) && { thresholdControl: false })), lineVisibility));
|
|
91
92
|
}, [thresholds]);
|
|
92
93
|
var handleLegendMouseEnter = function (e) {
|
|
93
94
|
if (!lineVisibility[e.dataKey]) {
|
|
@@ -102,7 +103,10 @@ function LineChart(props) {
|
|
|
102
103
|
};
|
|
103
104
|
var selectLine = function (e) {
|
|
104
105
|
var _a;
|
|
105
|
-
|
|
106
|
+
var checkedLines = Object.values(lineVisibility).filter(function (line) { return line === false; }).length;
|
|
107
|
+
if (checkedLines > 1 || lineVisibility[e.dataKey]) {
|
|
108
|
+
setLineVisibility(__assign(__assign({}, lineVisibility), (_a = {}, _a[e.dataKey] = !lineVisibility[e.dataKey], _a.hover = null, _a)));
|
|
109
|
+
}
|
|
106
110
|
};
|
|
107
111
|
var getThresholdData = function (threshold, entry) {
|
|
108
112
|
var ewma = entry.ewma, stdDev = entry.stdDev;
|