Skip to content

Commit d8c3dff

Browse files
authored
Merge branch 'master' into krish
2 parents 22193e5 + 0f0fb53 commit d8c3dff

73 files changed

Lines changed: 10432 additions & 35 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: npm
29+
30+
- name: Install
31+
run: npm ci
32+
33+
- name: Build
34+
env:
35+
# Vite resolves base from index.html `./` so this isn't strictly required,
36+
# but exposing PUBLIC_BASE lets future code branch on dev vs prod paths.
37+
PUBLIC_BASE: ./
38+
run: npm run build
39+
40+
- name: Upload Pages artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: ./dist
44+
45+
deploy:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Build artifacts
2+
dist/
3+
.vite/
4+
5+
# Dependencies
6+
node_modules/
7+
.venv/
8+
9+
# Secrets
10+
.env
11+
.env.*
12+
!.env.example
13+
14+
# OS / editor
15+
.DS_Store
16+
.idea/
17+
.vscode/
18+
*.swp
19+
20+
# Python EDA scratch
21+
__pycache__/
22+
*.pyc
23+
.ipynb_checkpoints/
24+
.vercel
25+
26+
docs/assets/
27+
docs/screenshots/
28+
docs/sketches/
29+
notebooks/
30+
data/
31+
process_book.md
32+
process_book.pdf
33+
screencast.md

.vercelignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# What NOT to upload to Vercel. The build only needs index.html, src/, public/,
2+
# data/processed/, vite.config.js and package*.json. Everything below is course
3+
# material, source data, or planning docs that would just bloat the upload.
4+
5+
node_modules
6+
.git
7+
dist
8+
.vite
9+
.DS_Store
10+
11+
# Course material & heavy source docs (254 MB of lecture PDFs, etc.)
12+
lectures/
13+
docs/
14+
notebooks/
15+
data/raw/
16+
.github/
17+
18+
# Submission PDFs & planning / internal docs
19+
Milestone_*.pdf
20+
CLAUDE.md
21+
HANDOFF.md
22+
PLAN.md
23+
sketches.md
24+
Deep-research-data-sources.md

CLAUDE.md

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# COM-480 Data Visualization — Project Guardrails
2+
3+
> This file is the canonical guardrail for any future work in this repo.
4+
> It encodes (a) what the course expects, (b) what the lectures taught,
5+
> (c) the milestone schedule, and (d) the working constraints for this team.
6+
> Read this first before writing or planning anything.
7+
8+
---
9+
10+
## 0. Critical context
11+
12+
- **Course:** EPFL COM-480 — *Data Visualization*.
13+
- **Deliverable:** an interactive, D3.js-based web visualization that **tells a story**.
14+
- **Today:** 2026-05-26. **M3 deadline:** Friday 2026-05-29, 5pm. **~3 days left.**
15+
- **Project topic:** "What's in a barrel?" — a scrollytelling piece about one barrel of crude oil, from distillation tower through end-uses to the objects in a reader's day, plus a closing May 2026 epilogue.
16+
- **2026 context that shapes the project:** Iran/Hormuz crisis began 28 Feb 2026 → largest oil-market disruption since COVID. EIA STEO May 2026 cut 2026 demand growth from +1.2 Mb/d (Feb) to +0.2 Mb/d (May). IEA OMR May 2026 expects a 420 kb/d contraction. OPEC MOMR May 2026 still projects +1.2 Mb/d. Scene 6.5 of the site uses this as the crisis epilogue. Background and source list in `Deep-research-data-sources.md`.
17+
- **Storytelling is graded heavily.** Lecture `12_1_Storytelling.pdf` is the load-bearing reference. Lecture `7_2_Do_and_dont_viz.pdf` is the second guardrail.
18+
19+
---
20+
21+
## 1. Milestone schedule and weight
22+
23+
| Milestone | Deadline | Weight | Status |
24+
|-----------|---------|--------|--------|
25+
| M1 — dataset, problematic, EDA, related work | 2026-03-20 | 10% | overdue, do retroactively for feedback |
26+
| M2 — 2-page plan + sketches + working skeleton website | 2026-04-17 | 10% | overdue, do retroactively for feedback |
27+
| M3 — final D3 viz + screencast (2 min) + process book (≤8 pages) + GitHub repo | 2026-05-29 | 80% | **active — 3 days** |
28+
29+
**M3 grade breakdown:** Visualization 35% • Technical Implementation 15% • Screencast 25% • Process book 25%.
30+
31+
**Late policy:** <24h → 80%, <48h → 70%. Anything past that drops fast. Plan for **2026-05-28** as internal cut-off.
32+
33+
---
34+
35+
## 2. Lecture index (guardrails)
36+
37+
All PDFs live in `lectures/`. Reach for them in this order depending on what you're doing.
38+
39+
### Foundations (web stack)
40+
- `2_Javascript.pdf` — JS essentials.
41+
- `3_More_javascript.pdf` — modern JS (modules, async).
42+
- `4_1_Data.pdf` — data acquisition, formats (CSV, JSON, TSV), cleaning basics.
43+
- `4_2_D3.pdf` — D3 core: selections, data joins, scales, axes.
44+
45+
### Interaction & D3 patterns
46+
- `5_1_Interaction.pdf` — interaction grammar (hover, brush, zoom, linked views).
47+
- `5_2_More_interactive_d3.pdf` — transitions, enter/update/exit, dispatch.
48+
49+
### Visual perception & design
50+
- `6_1_Perception_colors.pdf` — colorblind-safe palettes, sequential vs diverging vs categorical.
51+
- `6_2_Mark_channel.pdf` — marks (point/line/area) × channels (position/length/color/shape) and their effectiveness ranking.
52+
- `7_1_Designing_viz.pdf` — design process, sketching, iteration.
53+
- **`7_2_Do_and_dont_viz.pdf`****Tufte integrity rules** (data-ink ratio, lie factor, chartjunk, no unjustified 3D, start bar charts at 0, consistent intervals). Apply to every chart.
54+
55+
### Spatial, tabular, network, text, sound
56+
- `8_1_Maps.pdf` — projections, choropleths, geographic data.
57+
- `8_2_Practical_maps.pdf` — Leaflet, Mapbox, TopoJSON.
58+
- `9_Text.pdf` — text viz (word clouds, topic modeling outputs, NLP-fed visuals).
59+
- `10_Graphs.pdf` — networks (force layouts, matrix view, arc diagrams).
60+
- `11_1_Tabular_data.pdf` — tables, heatmaps, parallel coordinates, scatterplot matrix.
61+
- `11_2_Sound_viz.pdf` — audio visualization (waveform, spectrogram).
62+
63+
### Storytelling capstones (study these closely for M3)
64+
- **`12_1_Storytelling.pdf`****the most important lecture for grading.** Key takeaways:
65+
- Stories are *emotional, memorable, impactful*. Build one — don't just dump charts.
66+
- **Freytag's pyramid:** Exposition → Rising action → **Climax** → Falling action → Resolution. Map this to your scrolly/slides.
67+
- **Segel & Heer (2010) design space:** Visual Design + Messaging + Interactivity. Genres include *magazine style, annotated chart, slideshow, comic strip, movie, science-fair poster, flowchart*.
68+
- **Author-driven** (strong ordering, heavy messaging, limited interactivity) vs **Reader-driven** (weak ordering, light messaging, free interactivity). Best work picks a hybrid.
69+
- **Three canonical structures:** Martini glass (author-led then opens up), Interactive slideshow, Drill-down story.
70+
- "Add structure!" → Even an exploratory tool should have a guided entry path.
71+
- "Compare this / to this?" → Replace descriptive titles with active titles. Use color *strategically*, not decoratively. Order categorical data meaningfully.
72+
- `12_2_Beyond_visualization.pdf` — what comes after viz (deployment, ethics, advanced media).
73+
74+
---
75+
76+
## 3. Hard rules pulled from the lectures
77+
78+
Apply mechanically. Each one is a place graders deduct points.
79+
80+
1. **Active titles, not descriptive titles.** "We invest primarily in four areas" beats "Investment by area".
81+
2. **Start bar chart Y-axis at 0.** Truncated bars = lie factor > 1.
82+
3. **Show all the data on time series; start the axis at a value that doesn't distort the trend.**
83+
4. **Consistent intervals on axes.** Don't mix yearly and quarterly without making the change obvious.
84+
5. **No unjustified 3D. No drop shadows. No gradient fills. No skeuomorphism.**
85+
6. **Order categorical data by value or by meaning, never alphabetically by default.**
86+
7. **Color = meaning.** Highlight one or two categories; neutralize the rest in grey.
87+
8. **Colorblind-safe.** Test with a simulator. Avoid red/green as the only distinguishing channel.
88+
9. **Channel choice follows the Mackinlay ranking:** position > length > angle/slope > area > color hue > volume. Don't encode quantitative data with hue alone.
89+
10. **Annotate.** Every climactic chart needs labels, arrows, and a one-sentence interpretation directly on the chart.
90+
11. **Mobile second.** Author for desktop; degrade gracefully. Don't ship a mobile-broken site.
91+
12. **Accessibility.** Keyboard reachable, ARIA labels on interactive SVG, reduced-motion respected.
92+
93+
---
94+
95+
## 4. Working constraints (this repo)
96+
97+
### Tech stack (commit to these — no swaps mid-build)
98+
- **D3.js v7** (the course expects it; required for M3 grading).
99+
- **Vite + vanilla JS** or **Next.js** for the shell. Pick **one** and stick to it. (Recommendation: Vite + vanilla — faster build, no SSR complications, lighter for a 3-day sprint.)
100+
- **Scrollama** for scroll-triggered storytelling (the "interactive slideshow" Segel/Heer genre maps cleanly to scrollytelling).
101+
- **TopoJSON + d3-geo** if maps are needed.
102+
- **GitHub Pages** for hosting (free, satisfies M3's "host on GitHub" requirement).
103+
- **Tailwind or plain CSS** — your call, but no UI library that injects its own opinions (no MUI, no Chakra). Charts should be hand-built.
104+
105+
### File layout (target)
106+
```
107+
.
108+
├── CLAUDE.md (this file)
109+
├── README.md (M3 deliverable — technical setup, usage)
110+
├── Milestone_1.pdf, _2.pdf, _3.pdf
111+
├── lectures/ (reference only, don't edit)
112+
├── docs/ (M1, M2, M3 written submissions + sketches)
113+
│ ├── milestone1.md
114+
│ ├── milestone2.md
115+
│ ├── sketches/
116+
│ └── process_book.pdf (M3 final)
117+
├── data/ (cleaned dataset + raw)
118+
│ ├── raw/
119+
│ └── processed/
120+
├── notebooks/ (Python EDA, optional)
121+
├── src/ (web app)
122+
│ ├── index.html
123+
│ ├── main.js
124+
│ ├── scenes/ (one file per story scene)
125+
│ ├── components/ (chart modules)
126+
│ ├── lib/ (scales, color, utils)
127+
│ └── styles/
128+
└── public/
129+
```
130+
131+
### Code style
132+
- D3 chart modules export a `render(container, data, options)` function. **No god-files.**
133+
- Animate `transform` and `opacity` only.
134+
- Define design tokens (colors, fonts, spacing) as CSS custom properties.
135+
- One commit per scene / per chart. Conventional commits (`feat:`, `fix:`, `docs:`).
136+
137+
---
138+
139+
## 5. Story-quality bar
140+
141+
A submission gets a top grade only if it passes all of these:
142+
143+
- **One sentence story.** You can summarize the project's claim in one sentence. ("X happened, and the data shows it could have been prevented because…")
144+
- **Freytag arc maps to scenes.** Each scene has a purpose: exposition / rising / climax / falling / resolution.
145+
- **Climax has a single dominant chart**, annotated, with active title.
146+
- **The reader can re-explore freely after the guided tour** (martini-glass structure).
147+
- **Every chart answers a specific question** stated in its title.
148+
- **Interactivity has a payoff** — hover/filter/drill must reveal something not visible at rest.
149+
- **Annotations on the chart, not in a side caption.** Eyes don't bounce.
150+
- **No chart bigger than what its data justifies.**
151+
152+
---
153+
154+
## 6. Process-book bar (worth 25% on its own)
155+
156+
- ≤ 8 pages, designed (not a Word dump).
157+
- Reuses and expands M1/M2 sketches — shows evolution.
158+
- Calls out design *decisions* and *trade-offs*, not just what you built.
159+
- Peer-assessment table at the end (who did what).
160+
- Export to PDF and check it on a phone.
161+
162+
---
163+
164+
## 7. Screencast bar (worth 25%)
165+
166+
- **Exactly 2 minutes.** Over = penalty.
167+
- Open with the *story claim*, not the tech stack.
168+
- Show the climax interaction in the first 30 seconds.
169+
- Voiceover, not text-on-screen narration.
170+
- End with a 5-second call to action ("explore at <url>").
171+
172+
---
173+
174+
## 8. What this project is NOT
175+
176+
- Not a dashboard. (Dashboards are explicitly the *anti-pattern* of the storytelling lecture.)
177+
- Not a Tableau-style "here are 12 charts, pick one".
178+
- Not a tutorial for D3.
179+
- Not a research paper. Process book is for design decisions, not literature review.
180+
181+
---
182+
183+
## 9. When in doubt
184+
185+
1. Open `12_1_Storytelling.pdf` — does the current scene fit *some* slot in Freytag's pyramid?
186+
2. Open `7_2_Do_and_dont_viz.pdf` — does the current chart violate any Tufte rule?
187+
3. Open `6_2_Mark_channel.pdf` — is the encoding using the best channel for the data type?
188+
4. If three answers are all yes → ship it. If any is no → fix before moving on.

0 commit comments

Comments
 (0)