From 00aa3216ff2c5fd2088da4853fa881ef34913259 Mon Sep 17 00:00:00 2001 From: Pablo Revilla Date: Tue, 9 Dec 2025 16:19:55 -0800 Subject: [PATCH] Fix chart on node.html. --- meshview/templates/node.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meshview/templates/node.html b/meshview/templates/node.html index 5807f75..9d13f3f 100644 --- a/meshview/templates/node.html +++ b/meshview/templates/node.html @@ -928,8 +928,10 @@ async function loadNeighborTimeSeries() { return; } - // Time-series structure: - // neighborHistory = { node_id: { name, snr:[...], times:[...] } } + // --- FIX: sort packets chronologically (oldest → newest) --- + packets.sort((a, b) => (b.import_time_us || 0) - (a.import_time_us || 0)); + + const neighborHistory = {}; for (const pkt of packets.reverse()) {