Skip to content

Commit f3dda72

Browse files
author
jacquesbach
committed
ShowShapDetails automatic today
1 parent 29266f1 commit f3dda72

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

static/js/script.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,14 @@ function showShapError(message) {
952952
`;
953953
}
954954

955+
function getTodayForecastPoint(forecastData) {
956+
957+
const todayStr = new Date().toISOString().split("T")[0];
958+
// → ergibt z.B. "2026-03-17"
959+
960+
return forecastData.find(d => d.date === todayStr);
961+
}
962+
955963
async function loadForecast() {
956964

957965
const response = await fetch("/api/forecast");
@@ -1139,6 +1147,11 @@ async function loadForecast() {
11391147
},
11401148
}
11411149
});
1150+
const todayPoint = getTodayForecastPoint(data.forecast) || data.forecast[0];
1151+
if (todayPoint) {
1152+
showShapDetails(todayPoint);
1153+
document.getElementById("card-shap")?.style.display = "block";
1154+
};
11421155
}
11431156

11441157
async function loadFeatureImportance() {

0 commit comments

Comments
 (0)