fix: Fix heatmap color scale domain
Corrects the heatmap color scale by adjusting the domain's initial value to negative infinity. This ensures appropriate color mapping for all mood values from lowest to highest.
This commit is contained in:
parent
4fb05e6287
commit
45b1815b26
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ fetch("/mood/statistics/heatmap/values/")
|
||||||
|
|
||||||
var domain = Object.keys(moodOptions).map((key) => Number(key));
|
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 = [-Infinity].concat(domain).concat([Infinity]);
|
||||||
|
|
||||||
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())
|
||||||
|
|
Loading…
Reference in a new issue