fix: Fixes heatmap key conversion issue
Ensures keys returned from moodOptions are correctly converted to numbers to prevent mismatch errors and improve accuracy in data processing.
This commit is contained in:
parent
c0fb79ed5c
commit
2decdba78c
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ fetch("/mood/statistics/heatmap/values/")
|
||||||
if (d.average) {
|
if (d.average) {
|
||||||
const key = Object.keys(moodOptions).reduce((a, b) => Math.abs(a - d.average) < Math.abs(b - d.average) ? a : b);
|
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]);
|
console.log(key, d.average, moodOptions[key]);
|
||||||
return key;
|
return Number(key);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue