Commit
·
c1961f5
1
Parent(s):
3318017
Show Wrist and Tips by default in graphs
Browse files
src/components/data-recharts.tsx
CHANGED
|
@@ -94,8 +94,13 @@ const SingleDataGraph = React.memo(
|
|
| 94 |
// Get all keys except timestamp from the first row
|
| 95 |
const keys = Object.keys(chartData[0]).filter((k) => k !== "timestamp");
|
| 96 |
setDataKeys(keys);
|
| 97 |
-
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
}, [chartData]);
|
| 100 |
|
| 101 |
// Parse dataKeys into groups (dot notation)
|
|
|
|
| 94 |
// Get all keys except timestamp from the first row
|
| 95 |
const keys = Object.keys(chartData[0]).filter((k) => k !== "timestamp");
|
| 96 |
setDataKeys(keys);
|
| 97 |
+
|
| 98 |
+
// Show WRIST and TIPS by default for a good overview without performance lag
|
| 99 |
+
const defaultVisible = keys.filter(k =>
|
| 100 |
+
k.toLowerCase().includes("wrist") ||
|
| 101 |
+
k.toLowerCase().includes("tip")
|
| 102 |
+
);
|
| 103 |
+
setVisibleKeys(defaultVisible);
|
| 104 |
}, [chartData]);
|
| 105 |
|
| 106 |
// Parse dataKeys into groups (dot notation)
|