Update src/streamlit_app.py
Browse files- src/streamlit_app.py +0 -8
src/streamlit_app.py
CHANGED
|
@@ -13,14 +13,11 @@ st.markdown("---")
|
|
| 13 |
st.markdown(
|
| 14 |
"""
|
| 15 |
## What Is This About?
|
| 16 |
-
|
| 17 |
Every day, hundreds of crime incidents are reported across Chicago's 77 community areas.
|
| 18 |
But where do they happen? At what time? And does poverty play a role?
|
| 19 |
-
|
| 20 |
This interactive article walks you through 2026 Chicago crime data drawn directly from
|
| 21 |
the [Chicago Data Portal](https://data.cityofchicago.org/) to help you explore the
|
| 22 |
geography, timing, and social context of crime in one of America's largest cities.
|
| 23 |
-
|
| 24 |
The dataset records every reported crime incident in 2026, including the exact location,
|
| 25 |
date and time, crime type, and the police district that handled it. Each row is one
|
| 26 |
reported incident. We also include community-level socioeconomic data to examine the
|
|
@@ -146,7 +143,6 @@ st.markdown(
|
|
| 146 |
**Drag a box on the map** to select a geographic area, or **click a district boundary**
|
| 147 |
to highlight it — both actions filter the bar chart on the right and the timeline below.
|
| 148 |
You can also **click a crime category** in the bar chart to drill into its temporal trend.
|
| 149 |
-
|
| 150 |
The bottom line chart breaks daily incident counts into four time-of-day periods
|
| 151 |
(plus a grey total line). The bar chart and line chart use the **full dataset** with
|
| 152 |
no sampling; only the map points are sampled to keep the browser responsive.
|
|
@@ -282,7 +278,6 @@ st.markdown(
|
|
| 282 |
the heatmap by crime category, or leave it on *All* to see the overall pattern.
|
| 283 |
Each cell shows the total number of incidents at that day-of-week x hour-of-day
|
| 284 |
combination across the full dataset; darker red means more incidents.
|
| 285 |
-
|
| 286 |
Across nearly every category, Friday and Saturday evenings (6 pm to midnight)
|
| 287 |
stand out as the most active windows, while the early-morning hours (2 to 5 am)
|
| 288 |
are consistently quietest.
|
|
@@ -337,12 +332,10 @@ st.markdown(
|
|
| 337 |
with a binned crime density heatmap overlaid. The heatmap uses the full dataset
|
| 338 |
with no sampling: each cell's color reflects how many incidents fall in that
|
| 339 |
geographic bin, giving a clear picture of crime hotspots.
|
| 340 |
-
|
| 341 |
The scatter plot on the right makes the poverty-crime relationship explicit:
|
| 342 |
each dot is one community area, and the dashed line is a statistical trend.
|
| 343 |
There is a moderate positive correlation, though it is far from deterministic -
|
| 344 |
policy, policing patterns, and reporting rates all play a role.
|
| 345 |
-
|
| 346 |
**Socioeconomic data source:** [Census Data - Chicago Data Portal](https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-Socioeconomic-Indicators-in-C/kn9c-c2s2)
|
| 347 |
"""
|
| 348 |
)
|
|
@@ -454,7 +447,6 @@ st.markdown(
|
|
| 454 |
| Socioeconomic Indicators by Community | City of Chicago Data Portal | [kn9c-c2s2](https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-Socioeconomic-Indicators-in-C/kn9c-c2s2) |
|
| 455 |
| Police District Boundaries (GeoJSON) | City of Chicago Data Portal | [24zt-jpfn](https://data.cityofchicago.org/Public-Safety/Boundaries-Police-Districts-current-/24zt-jpfn) |
|
| 456 |
| Community Area Boundaries (GeoJSON) | City of Chicago Data Portal | [igwz-8jzy](https://data.cityofchicago.org/Facilities-Geographic-Boundaries/Boundaries-Community-Areas-current-/cauq-8yn6) |
|
| 457 |
-
|
| 458 |
All data accessed April 2026. Visualizations built with [Altair](https://altair-viz.github.io/) and [Streamlit](https://streamlit.io/).
|
| 459 |
"""
|
| 460 |
)
|
|
|
|
| 13 |
st.markdown(
|
| 14 |
"""
|
| 15 |
## What Is This About?
|
|
|
|
| 16 |
Every day, hundreds of crime incidents are reported across Chicago's 77 community areas.
|
| 17 |
But where do they happen? At what time? And does poverty play a role?
|
|
|
|
| 18 |
This interactive article walks you through 2026 Chicago crime data drawn directly from
|
| 19 |
the [Chicago Data Portal](https://data.cityofchicago.org/) to help you explore the
|
| 20 |
geography, timing, and social context of crime in one of America's largest cities.
|
|
|
|
| 21 |
The dataset records every reported crime incident in 2026, including the exact location,
|
| 22 |
date and time, crime type, and the police district that handled it. Each row is one
|
| 23 |
reported incident. We also include community-level socioeconomic data to examine the
|
|
|
|
| 143 |
**Drag a box on the map** to select a geographic area, or **click a district boundary**
|
| 144 |
to highlight it — both actions filter the bar chart on the right and the timeline below.
|
| 145 |
You can also **click a crime category** in the bar chart to drill into its temporal trend.
|
|
|
|
| 146 |
The bottom line chart breaks daily incident counts into four time-of-day periods
|
| 147 |
(plus a grey total line). The bar chart and line chart use the **full dataset** with
|
| 148 |
no sampling; only the map points are sampled to keep the browser responsive.
|
|
|
|
| 278 |
the heatmap by crime category, or leave it on *All* to see the overall pattern.
|
| 279 |
Each cell shows the total number of incidents at that day-of-week x hour-of-day
|
| 280 |
combination across the full dataset; darker red means more incidents.
|
|
|
|
| 281 |
Across nearly every category, Friday and Saturday evenings (6 pm to midnight)
|
| 282 |
stand out as the most active windows, while the early-morning hours (2 to 5 am)
|
| 283 |
are consistently quietest.
|
|
|
|
| 332 |
with a binned crime density heatmap overlaid. The heatmap uses the full dataset
|
| 333 |
with no sampling: each cell's color reflects how many incidents fall in that
|
| 334 |
geographic bin, giving a clear picture of crime hotspots.
|
|
|
|
| 335 |
The scatter plot on the right makes the poverty-crime relationship explicit:
|
| 336 |
each dot is one community area, and the dashed line is a statistical trend.
|
| 337 |
There is a moderate positive correlation, though it is far from deterministic -
|
| 338 |
policy, policing patterns, and reporting rates all play a role.
|
|
|
|
| 339 |
**Socioeconomic data source:** [Census Data - Chicago Data Portal](https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-Socioeconomic-Indicators-in-C/kn9c-c2s2)
|
| 340 |
"""
|
| 341 |
)
|
|
|
|
| 447 |
| Socioeconomic Indicators by Community | City of Chicago Data Portal | [kn9c-c2s2](https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-Socioeconomic-Indicators-in-C/kn9c-c2s2) |
|
| 448 |
| Police District Boundaries (GeoJSON) | City of Chicago Data Portal | [24zt-jpfn](https://data.cityofchicago.org/Public-Safety/Boundaries-Police-Districts-current-/24zt-jpfn) |
|
| 449 |
| Community Area Boundaries (GeoJSON) | City of Chicago Data Portal | [igwz-8jzy](https://data.cityofchicago.org/Facilities-Geographic-Boundaries/Boundaries-Community-Areas-current-/cauq-8yn6) |
|
|
|
|
| 450 |
All data accessed April 2026. Visualizations built with [Altair](https://altair-viz.github.io/) and [Streamlit](https://streamlit.io/).
|
| 451 |
"""
|
| 452 |
)
|