diff --git a/web/app.py b/web/app.py index 3509952c..a3d3c24f 100644 --- a/web/app.py +++ b/web/app.py @@ -586,6 +586,7 @@ async def city_history(name: str): act = rec.get("actual_high") deb = rec.get("deb_prediction") mu = rec.get("mu") + mgm = rec.get("forecasts", {}).get("MGM") # Only return items where we have at least an actual or a prediction out.append({ @@ -593,6 +594,7 @@ async def city_history(name: str): "actual": float(act) if act is not None else None, "deb": float(deb) if deb is not None else None, "mu": float(mu) if mu is not None else None, + "mgm": float(mgm) if mgm is not None else None, }) return {"history": out} diff --git a/web/static/app.js b/web/static/app.js index 97c28cc3..1816ae00 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -1167,12 +1167,14 @@ async function openHistoryModal() { const actuals = []; const debs = []; const mus = []; + const mgms = []; data.forEach((row) => { dates.push(row.date); actuals.push(row.actual); debs.push(row.deb); mus.push(row.mu); + mgms.push(row.mgm); if (row.actual != null && row.deb != null) { debErrors.push(Math.abs(row.actual - row.deb)); @@ -1242,6 +1244,16 @@ async function openHistoryModal() { tension: 0.2, pointRadius: 3, }, + { + label: "MGM 官方预报", + data: mgms, + borderColor: "#fb923c", // orange + backgroundColor: "transparent", + borderWidth: 2, + tension: 0.2, + pointRadius: 3, + hidden: false, // Show by default for Ankara + }, ], }, options: {