diff --git a/content.py b/content.py index 7521f21..09fcf9e 100644 --- a/content.py +++ b/content.py @@ -206,6 +206,10 @@ def _monthly_normals(history) -> list[dict]: tmax, tmin, precip = clim.get("tmax"), clim.get("tmin"), clim.get("precip") high_f = tmax["mean"] if tmax else None low_f = tmin["mean"] if tmin else None + # The range strip spans the typical spread: 10th-percentile daily low to + # 90th-percentile daily high (the band most days fall within). + rng_lo = tmin["p10"] if tmin else None + rng_hi = tmax["p90"] if tmax else None rows.append({ "name": name, "slug": MONTHS[i - 1], @@ -213,9 +217,11 @@ def _monthly_normals(history) -> list[dict]: "high_f": high_f, "low": _temp(tmin["mean"]) if tmin else "—", "low_f": low_f, + "range_lo_f": rng_lo, + "range_hi_f": rng_hi, "precip": f"{precip['mean']:.2f} in" if precip else "—", "precip_v": precip["mean"] if precip else None, - "bar": _range_bar(low_f, high_f), + "bar": _range_bar(rng_lo, rng_hi), }) return rows diff --git a/templates/city.html.j2 b/templates/city.html.j2 index faa171a..c188466 100644 --- a/templates/city.html.j2 +++ b/templates/city.html.j2 @@ -75,14 +75,15 @@ {% if m.bar %}{% endif %} - {% if m.low_f is not none and m.high_f is not none %} - {{ m.low_f | round | int }}°–{{ m.high_f | round | int }}° + {% if m.range_lo_f is not none and m.range_hi_f is not none %} + {{ m.range_lo_f | round | int }}°–{{ m.range_hi_f | round | int }}° {% else %}{% endif %} {% endfor %} -

Each bar spans the average daily low to high, coloured cold → hot - on a shared −10 °F to 115 °F scale — so the whole year's rhythm reads at a glance.

+

Each bar spans the 10th-percentile daily low to the 90th-percentile daily + high — the range most days fall within — coloured cold → hot on a shared + −10 °F to 115 °F scale, so the whole year's rhythm reads at a glance.