Skip to content

Commit 0c846ee

Browse files
author
Lysandre Costes
committed
fixes
1 parent 3dd4281 commit 0c846ee

2 files changed

Lines changed: 5 additions & 29 deletions

File tree

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ No build step. D3, Three.js, and fonts are loaded from CDNs in `index.html`.
2424

2525
Live site: [com-480-data-visualization.github.io/com-480-project-pff](https://com-480-data-visualization.github.io/com-480-project-pff/)
2626

27-
**One-time setup** (repo admin):
28-
29-
1. **Settings → Pages → Build and deployment**
30-
2. **Source:** Deploy from a branch
31-
3. **Branch:** `gh-pages` · folder **`/ (root)`** → Save
32-
33-
Each push to `main` runs the workflow and updates the `gh-pages` branch from `website/` (Three.js, D3, and JSON included). If the workflow failed before with *Get Pages site failed*, that was because Pages was not enabled yet — the steps above fix it.
34-
35-
**Re-deploy manually:** Actions → *Deploy website to GitHub Pages**Run workflow*
36-
3727
---
3828

3929
## Intended usage
@@ -56,7 +46,6 @@ The narrative scrolls through six analytical views:
5646

5747
- Use toggles, sliders, and tabs in each section to filter seasons, players, or teams.
5848
- Hover court cells on heatmaps for exact values (ratio, counts, FG%).
59-
- Player headshots are loaded from `cdn.nba.com` (requires network).
6049

6150
**Audience:** basketball fans and anyone interested in spatial sports analytics, without requiring a statistics background.
6251

website/js/fingerprint.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@
152152
}
153153

154154
const CX = 210, CY = 210, R_OUTER = 165, R_INNER = 65;
155-
const PHOTO_R = 55;
156155

157156
// 6 zones (exclude Backcourt)
158157
const ZONES = [
@@ -177,10 +176,6 @@
177176
.range(['#2166ac', '#C9082A'])
178177
.clamp(true);
179178

180-
// ── Defs: clip for player photo ───────────────────────────────────────────
181-
svg.append('defs').append('clipPath').attr('id', 'fp-photo-clip')
182-
.append('circle').attr('cx', CX).attr('cy', CY).attr('r', PHOTO_R);
183-
184179
// ── Background rings + radial frequency ticks ─────────────────────────────
185180
const FREQ_TICKS = [0, 0.25, 0.5, 0.75, 1];
186181

@@ -285,26 +280,25 @@
285280

286281
// ── Bars group ────────────────────────────────────────────────────────────
287282
const barsG = svg.append('g');
288-
const photoEl = svg.append('image')
289-
.attr('clip-path', 'url(#fp-photo-clip)')
290-
.attr('preserveAspectRatio', 'xMidYMin slice');
291283

292284
// Centre ring (covers inner part)
293285
svg.append('circle')
294286
.attr('cx', CX).attr('cy', CY).attr('r', R_INNER)
295287
.attr('fill', '#090910');
296288

297-
// Centre text elements (player name + total)
289+
// Centre text (player name + total)
298290
const nameEl = svg.append('text')
299-
.attr('x', CX).attr('y', CY + PHOTO_R + 14)
291+
.attr('x', CX).attr('y', CY - 6)
300292
.attr('text-anchor', 'middle')
293+
.attr('dominant-baseline', 'middle')
301294
.attr('fill', '#e8e8f0')
302295
.attr('font-size', '11px')
303296
.attr('font-weight', '600')
304297
.attr('font-family', 'Inter, sans-serif');
305298
const shotsEl = svg.append('text')
306-
.attr('x', CX).attr('y', CY + PHOTO_R + 28)
299+
.attr('x', CX).attr('y', CY + 10)
307300
.attr('text-anchor', 'middle')
301+
.attr('dominant-baseline', 'middle')
308302
.attr('fill', '#7070a0')
309303
.attr('font-size', '9px')
310304
.attr('font-family', 'Inter, sans-serif');
@@ -367,13 +361,6 @@
367361
);
368362
hitG.raise();
369363

370-
// Photo
371-
const pid = p.player_id;
372-
photoEl
373-
.attr('href', `https://cdn.nba.com/headshots/nba/latest/1040x760/${pid}.png`)
374-
.attr('x', CX - PHOTO_R).attr('y', CY - PHOTO_R)
375-
.attr('width', PHOTO_R * 2).attr('height', PHOTO_R * 2);
376-
377364
nameEl.text(playerName.split(' ').slice(-1)[0]); // last name
378365
shotsEl.text(`${p.total_shots.toLocaleString()} shots`);
379366

0 commit comments

Comments
 (0)