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.
This commit is contained in:
Kumi 2024-11-28 15:35:17 +01:00
parent 3e4b68aa19
commit c0fb79ed5c
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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;