# West Godavari Rainfall Monitoring Dashboard

## PURPOSE
A Streamlit + Plotly dashboard that turns the daily district rainfall bulletin from
the source video into a visual: a bar chart ranking every mandal by millimeters, a
KPI strip showing the district maximum (Koyyalagudem, 24 mm) and the average of the
other reporting areas (about 10 mm), and a threshold control so an officer can ask
"which mandals crossed 10 mm?" at a glance. Data is loaded from a CSV so students can
swap in their own bulletin.

## WHY THIS MATTERS
The bulletin is spoken once and forgotten. A dashboard makes the spatial pattern
legible in seconds — that a single mandal dominates while the rest cluster — which is
exactly the insight an agriculture or irrigation officer needs before deciding where
to send advice.

## HOW TO BUILD
Load the bulletin with Pandas, build the chart with `plotly.express.bar`, and render
with `st.plotly_chart(..., use_container_width=True)`. Use `st.sidebar.slider` for the
threshold and `st.metric` for the KPI row. Cache the loader with `@st.cache_data` so
the page does not re-read the file on every interaction.

Key snippet:

```python
import streamlit as st
import plotly.express as px

@st.cache_data
def load(path: str):
    return pd.read_csv(path)

df = load("bulletin.csv")
fig = px.bar(df.sort_values("millimeters", ascending=False),
             x="mandal", y="millimeters", color="millimeters",
             color_continuous_scale="Blues")
st.plotly_chart(fig, use_container_width=True)
```

## WHEN TO USE IN PRODUCTION
Use it internally for district officers, journalists, and agricultural extension
teams who need a shared read on the day's rainfall, or as a public information page.
Do NOT use it as the system of record — it reads a file, it does not store history.
Do NOT use it for low-latency alerting; pair it with the ingestion service instead.

## HOW IT HELPS STUDENTS
Students learn declarative charting, layout and interaction design, caching, and how
to frame a KPI that answers a real question rather than decorating a screen with
charts.

## STARTER CODE
See `starter/main.py` for the cached CSV loader, a seeded in-code bulletin replicating
the transcript's figures, the Plotly bar chart, KPI metrics, threshold filter and
`# TODO` markers for multi-day history and map views.
