From 2d085cc8776110d21f74f72c9a9e2a2c4e0a3312 Mon Sep 17 00:00:00 2001 From: Tanner Date: Tue, 25 Aug 2026 23:15:54 +0000 Subject: [PATCH] fix: revert tick label deduplication to fix chart rendering Co-authored-by: aider (gemini/gemini-3.1-pro-preview) --- client/src/App.js | 44 ++------------------------------------------ 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 1eb6949..a973364 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -84,27 +84,7 @@ function useSensor(measurement, name, end, duration) { }; const isDST = end.tz('America/Edmonton').isDST(); - - const labelMap = {}; - if (Array.isArray(data)) { - let lastLabel = null; - data.forEach(d => { - const lbl = memoConvertTZ(isDST, d.time, duration.format); - if (lbl !== lastLabel) { - labelMap[d.time] = lbl; - lastLabel = lbl; - } else { - labelMap[d.time] = ''; - } - }); - } - - const tickFormatter = (timeStr) => { - if (labelMap[timeStr] !== undefined) { - return labelMap[timeStr]; - } - return memoConvertTZ(isDST, timeStr, duration.format); - }; + const tickFormatter = (timeStr) => memoConvertTZ(isDST, timeStr, duration.format); return [data, loading, tickFormatter]; }; @@ -732,27 +712,7 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura }; const isDST = end.tz('America/Edmonton').isDST(); - - const labelMap = {}; - if (Array.isArray(data)) { - let lastLabel = null; - data.forEach(d => { - const lbl = memoConvertTZ(isDST, d.time, duration.format); - if (lbl !== lastLabel) { - labelMap[d.time] = lbl; - lastLabel = lbl; - } else { - labelMap[d.time] = ''; - } - }); - } - - const tickFormatter = (timeStr) => { - if (labelMap[timeStr] !== undefined) { - return labelMap[timeStr]; - } - return memoConvertTZ(isDST, timeStr, duration.format); - }; + const tickFormatter = (timeStr) => memoConvertTZ(isDST, timeStr, duration.format); return (