From 4d96249116cab3219f4a36fd9bc97ac42dbf574b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 26 Dec 2022 15:14:55 +0100 Subject: [PATCH] Compress the sparkline range a bit. --- www/js/remoteglot.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index b0c89cb..c3de366 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1408,6 +1408,13 @@ let update_sparkline = function(data) { if (score < min_score) min_score = score; if (score > max_score) max_score = score; } + if (max_score - min_score < 100) { + if (Math.abs(max_score) >= Math.abs(min_score)) { + max_score = min_score + 100; + } else { + min_score = max_score - 100; + } + } const h = scorespark.getBoundingClientRect().height; -- 2.39.2