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:
Kumi 2024-11-28 16:02:24 +01:00
parent 4fb05e6287
commit 45b1815b26
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -10,7 +10,7 @@ fetch("/mood/statistics/heatmap/values/")
var domain = Object.keys(moodOptions).map((key) => Number(key));
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])
.then((response) => response.json())