File size: 2,615 Bytes
139c8bc
acda8b7
 
139c8bc
acda8b7
139c8bc
acda8b7
 
139c8bc
 
acda8b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: SF Taxi Mobility Equity Dashboard
emoji: πŸš•
colorFrom: blue
colorTo: yellow
sdk: docker
app_port: 7860
pinned: True
---

# SF Taxi Mobility Equity Dashboard

An interactive Plotly Dash dashboard analyzing spatial equity in San Francisco taxi services. Compares **Street-Hail** vs **App-Based** trip patterns across SF's 41 Analysis Neighborhoods and evaluates service representation relative to demographic baselines using Representative Ratios.

_Debayan Mandal_

## Features

- **Interactive choropleth maps** β€” click any neighborhood to cross-filter all views
- **Representative Ratio visualizations** β€” bar chart and heatmap showing the central equity metric (overrepresentation vs underrepresentation by demographic group)
- **Neighborhood detail panel** β€” click to see full profile: trips, demographics, deviations, and trends
- **Monthly comparison** β€” side-by-side difference maps revealing temporal trends
- **Dynamic narrative** β€” auto-generated equity insights that update with your selections
- **CSV data export** β€” download filtered trip + demographic data
- **Publication-ready image export** β€” high-resolution PNG via the camera icon on each map
- **Guided tour** β€” step-by-step walkthrough for non-technical audiences
- **Colorblind-safe palettes** β€” Viridis, Cividis, and RdBu scales

## Data Sources

- **SF Taxi Trips**: [DataSF Taxi Trips (m8hk-2ipk)](https://data.sfgov.org/Transportation/Taxi-Trips/m8hk-2ipk/)
- **SF Analysis Neighborhoods**: [DataSF Analysis Neighborhoods (j2bu-swwd)](https://data.sfgov.org/resource/j2bu-swwd.geojson)
- **Census Demographics**: [ACS 5-Year 2022, Table B02001](https://api.census.gov/data/2022/acs/acs5.html), Block Groups for SF County (FIPS 06075)
- **Block Group Geometries**: [TIGER/Line 2022](https://www2.census.gov/geo/tiger/TIGER2022/BG/tl_2022_06_bg.zip)

## Local Setup

```bash
pip install -r requirements.txt
python data_pipeline.py      # builds sf_dashboard.db
python app.py                # opens dashboard at http://localhost:7860
```

## Docker

```bash
docker build -t sf-taxi-dashboard .
docker run -p 7860:7860 sf-taxi-dashboard
```

Then open http://localhost:7860.

## Architecture

| File | Purpose |
|------|---------|
| `data_pipeline.py` | Downloads taxi trips, neighborhoods, and census data; builds `sf_dashboard.db` |
| `dashboard_helpers.py` | Plotly figure builders and data query helpers |
| `app.py` | Plotly Dash application layout and callbacks |
| `assets/styles.css` | Custom CSS |
| `requirements.txt` | Python dependencies |
| `Dockerfile` | Containerization for Hugging Face Spaces |