From c0fb79ed5cc40ebfd6262d4030bb5a48f736d327 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 28 Nov 2024 15:35:17 +0100 Subject: [PATCH] debug: Adds debug logging for mood mapping Introduces console logging to debug mood average mapping to the closest mood option key, aiding in verifying the calculation and understanding discrepancies. --- mood/static/mood/dashboard.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mood/static/mood/dashboard.js b/mood/static/mood/dashboard.js index 0973ad7..9f54c36 100644 --- a/mood/static/mood/dashboard.js +++ b/mood/static/mood/dashboard.js @@ -24,6 +24,7 @@ fetch("/mood/statistics/heatmap/values/") y: d => { if (d.average) { const key = Object.keys(moodOptions).reduce((a, b) => Math.abs(a - d.average) < Math.abs(b - d.average) ? a : b); + console.log(key, d.average, moodOptions[key]); return key; } return 0;