You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-84Lines changed: 46 additions & 84 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,51 +8,44 @@ Interactive data-visualization project for **COM-480 (EPFL)** exploring how NBA
8
8
9
9
## Quick start — run the website
10
10
11
-
The site is a **static** front end (`website/`). It loads JSON from `website/data/` and must be served over HTTP (opening `index.html` directly will block `fetch` / `d3.json`).
12
-
13
-
1. Clone the repository and go to the project root:
11
+
The site is a **static** front end in `website/`. It loads JSON via `fetch` / `d3.json`, so serve it over HTTP (a `file://` URL will not work).
|**Hero**| 3D particle court — sample of shots over time |
42
+
|**Expected value**| Court heatmap: points per attempt, FG%, or volume |
43
+
|**League adaptation**| Season-by-season shot maps vs league average + trend lines |
44
+
|**Team DNA**| Zone profiles: team vs league vs champion |
45
+
|**Player fingerprint**| Radial chart of zone frequency and efficiency |
46
+
|**Player movement**| Stacked zone shares across team stints |
47
+
|**Clutch**| Last-5-seconds Q4 shot locations vs rest of game + player scatter |
48
+
56
49
57
50
**Interaction tips**
58
51
@@ -66,102 +59,71 @@ The narrative scrolls through six analytical views:
66
59
67
60
## Technical setup
68
61
69
-
### Requirements
62
+
**Website**: static HTML/CSS/JS in `website/`. One shared module (`court.js`) plus one file per visualization. D3 v7 for charts; Three.js (ES module) for the hero section only.
70
63
71
-
| Component | Version / notes |
72
-
|-----------|-----------------|
73
-
|**Browser**| Modern evergreen browser (Chrome, Firefox, Safari, Edge) |
74
-
|**Python**| 3.10+ — only needed to **regenerate** JSON from raw CSVs |
75
-
|**Local HTTP server**| Any static file server (see Quick start) |
64
+
**Data pipeline**: `preprocess.py` (Python 3.10+, `numpy`, `pandas` in `requirements.txt`) reads raw season CSVs and writes JSON to `website/data/`. Those JSON files are committed, so the site runs without reprocessing.
76
65
77
-
### Regenerating `website/data` (optional)
66
+
To regenerate data:
78
67
79
-
Preprocessed JSON files are **committed** in `website/data/`, so you can run the site without raw CSVs. To rebuild them from source:
80
-
81
-
1. Download the raw shot data into `NBA_Shots_04_25/` (see [Data](#data)).
82
-
83
-
2. Install Python dependencies:
68
+
1. Clone [NBA_Shots_04_25](https://github.com/DomSamangy/NBA_Shots_04_25) into `NBA_Shots_04_25/` at the repo root (`NBA_*_Shots.csv`).
This reads all `NBA_Shots_04_25/NBA_*_Shots.csv` files and writes aggregated JSON under `website/data/`. Expect several minutes and ~8 GB RAM for the full merge.
98
-
99
-
### Exploratory analysis
100
-
101
-
`eda.ipynb` documents early data exploration (pandas, matplotlib). Open with Jupyter:
102
-
103
-
```bash
104
-
pip install jupyter matplotlib
105
-
jupyter notebook eda.ipynb
106
-
```
77
+
Expect several minutes and ~8 GB RAM for the full merge.
107
78
108
79
---
109
80
110
81
## Repository structure
111
82
112
83
```
113
84
com-480-project-pff/
114
-
├── README.md # This file
115
-
├── requirements.txt # Python deps for preprocess.py
116
-
├── preprocess.py # CSV → website/data/*.json
117
-
├── eda.ipynb # Exploratory analysis notebook
118
-
├── NBA_Shots_04_25/ # Raw season CSVs (not in git — see Data)
-**[Three.js r160](https://threejs.org/)** — hero court (ES modules via import map).
140
-
-**ES modules** only in `hero.js`; other scripts are classic scripts with global `Court` from `court.js`.
141
-
142
106
---
143
107
144
108
## Data
145
109
146
110
### Source dataset
147
111
148
-
We use [NBA_Shots_04_25](https://github.com/DomSamangy/NBA_Shots_04_25): NBA regular-season shot data from **2003–04 to 2024–25** (~4.4M attempts). Each row is one field-goal attempt with player, team, outcome, shot type, court coordinates, zone, and game-clock context.
112
+
[NBA_Shots_04_25](https://github.com/DomSamangy/NBA_Shots_04_25): NBA regular-season shot data from **2003–04 to 2024–25** (~4.4M attempts). Each row is one field-goal attempt with player, team, outcome, shot type, court coordinates, zone, and game-clock context.
149
113
150
114
### What is hosted on GitHub
151
115
152
-
| Path | In repository? | Description |
153
-
|------|----------------|-------------|
154
-
|`website/data/*.json`| Yes | Aggregated data used by the website |
155
-
|`NBA_Shots_04_25/*.csv`|**No** (gitignored) | Full raw CSVs (~GB) — clone separately |
0 commit comments