From 0df63a998d0265c3bae0292026e9f4b966345f95 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 11 May 2024 12:00:16 +0200 Subject: [PATCH] visualizer: treat -1e38 as NaN I considered updating jsonlogger.c to represent NaN as "null" in the JSON. However, this makes the hand-written JSON generator much more complicated. --- impl/utils/visualizer/static/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/impl/utils/visualizer/static/index.js b/impl/utils/visualizer/static/index.js index f212af0..d26e959 100644 --- a/impl/utils/visualizer/static/index.js +++ b/impl/utils/visualizer/static/index.js @@ -146,9 +146,6 @@ function addHistory(packet) { || x === 'data_symbols') { continue; } - if (x === 'header_evm' || x === 'data_evm') { - continue; - }; keys.push(x); } keys.sort(); @@ -164,7 +161,11 @@ function addHistory(packet) { let i = 0; for (const x of keys) { - chartHistory.data.datasets[i].data.push(packet[x]); + let data = packet[x]; + if (data == -1e38 /* "NaN" */) { + data = undefined; + } + chartHistory.data.datasets[i].data.push(data); i++; } chartHistory.data.labels.push((new Date() - state.start)/1000);