From 2f1cdd2de1170e8e97770c029a364cca973fa09a Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 28 Nov 2024 15:17:40 +0100 Subject: [PATCH] debug: Add debugging logs for domain and range arrays Includes console logs to output the domain and range arrays during the heatmap data retrieval. This helps in debugging by providing visibility into the data structure used for the heatmap color mapping. Refines date range object to avoid redundancy. --- mood/static/mood/dashboard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mood/static/mood/dashboard.js b/mood/static/mood/dashboard.js index df6c509..85c81bd 100644 --- a/mood/static/mood/dashboard.js +++ b/mood/static/mood/dashboard.js @@ -12,6 +12,9 @@ fetch("/mood/statistics/heatmap/values/") const range = ["#ffffd4"].concat(domain.map((key) => moodOptions[key]["color"])).concat(["#000000"]); domain = [0].concat(domain).concat([Infinity]); + console.log(domain); + console.log(range); + fetch("/mood/statistics/heatmap/?start=" + start.toISOString().split("T")[0] + "&end=" + end.toISOString().split("T")[0]) .then((response) => response.json()) .then((data) => { @@ -37,7 +40,7 @@ fetch("/mood/statistics/heatmap/values/") } }, date: { - start: start, // Start from one year ago + start: start, }, range: 13, // Display 13 months so that the current month is included domain: {