fix: Refines mood domain handling in heatmap
Converts mood domain keys to numbers for uniform processing. Removes console logs for cleaner production code.
This commit is contained in:
parent
2f1cdd2de1
commit
2c4e02e1af
1 changed files with 1 additions and 4 deletions
|
@ -8,13 +8,10 @@ fetch("/mood/statistics/heatmap/values/")
|
||||||
const start = new Date(new Date().setFullYear(new Date().getFullYear() - 1));
|
const start = new Date(new Date().setFullYear(new Date().getFullYear() - 1));
|
||||||
const end = new Date();
|
const end = new Date();
|
||||||
|
|
||||||
var domain = Object.keys(moodOptions);
|
var domain = Object.keys(moodOptions).map((key) => Number(key));
|
||||||
const range = ["#ffffd4"].concat(domain.map((key) => moodOptions[key]["color"])).concat(["#000000"]);
|
const range = ["#ffffd4"].concat(domain.map((key) => moodOptions[key]["color"])).concat(["#000000"]);
|
||||||
domain = [0].concat(domain).concat([Infinity]);
|
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])
|
fetch("/mood/statistics/heatmap/?start=" + start.toISOString().split("T")[0] + "&end=" + end.toISOString().split("T")[0])
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
Loading…
Reference in a new issue