Skip to content

Commit b15fe91

Browse files
committed
feat: sync medal countries and continents
1 parent ba6798f commit b15fe91

5 files changed

Lines changed: 41 additions & 27 deletions

File tree

website/index.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535

3636
<div class="section" data-anchor="introduction">
3737
<h2>How have sociocultural, economic, and geopolitical contexts been reflected in the Olympics over time?</h2>
38-
<div class="intro-columns">
38+
<div class="text-columns">
3939

40-
<div class="intro-column">
40+
<div class="text-column">
4141
<p>
4242
At first glance, the Olympics look like so-called fair Games: the best athletes compete,
4343
and the best win. But is it really that simple?
@@ -49,7 +49,7 @@ <h2>How have sociocultural, economic, and geopolitical contexts been reflected i
4949
</p>
5050
</div>
5151

52-
<div class="intro-column">
52+
<div class="text-column">
5353
<p>
5454
Wealth, population, politics, and opportunities all play a part in determining who gets to stand on the podium.
5555
We're going to see five axes behind medals in Olympics:
@@ -67,8 +67,8 @@ <h2>How have sociocultural, economic, and geopolitical contexts been reflected i
6767
<div class="section" data-anchor="gender">
6868
<div class="slide" data-anchor="gender-text">
6969
<h2>How has gender representation evolved across Olympic sports and disciplines over time?</h2>
70-
<div class="intro-columns">
71-
<div class="intro-column">
70+
<div class="text-columns">
71+
<div class="text-column">
7272
<p>
7373
The Olympic Games have long reflected broader social attitudes toward gender.
7474
For decades, women had limited access to Olympic participation and were excluded
@@ -77,7 +77,7 @@ <h2>How has gender representation evolved across Olympic sports and disciplines
7777
</p>
7878
</div>
7979

80-
<div class="intro-column">
80+
<div class="text-column">
8181
<p>
8282
Over time, social change, institutional reforms, and growing demands for equality
8383
expanded opportunities for women across sports and disciplines. This visualization
@@ -118,8 +118,8 @@ <h2 class="gender-viz-title">Gender representation in Olympic sports</h2>
118118
<div class="section" data-anchor="delegations">
119119
<div class="slide" data-anchor="delegations-text">
120120
<h2>Where do the medal winners come from?</h2>
121-
<div class="intro-columns">
122-
<div class="intro-column">
121+
<div class="text-columns">
122+
<div class="text-column">
123123
<p>
124124
Olympic medals are not distributed evenly across the world. Some countries and
125125
continents appear repeatedly on the podium, while others participate without
@@ -128,7 +128,7 @@ <h2>Where do the medal winners come from?</h2>
128128
</p>
129129
</div>
130130

131-
<div class="intro-column">
131+
<div class="text-column">
132132
<p>
133133
The visualizations show where medal winners come from and which countries take part
134134
without reaching the podium. By comparing continents, countries, medal types, and sports
@@ -186,8 +186,8 @@ <h2>Who participates without reaching the podium?</h2>
186186
<div class="slide" data-anchor="body-types-text">
187187
<h2>Which body type excels in a particular discipline?</h2>
188188

189-
<div class="intro-columns">
190-
<div class="intro-column">
189+
<div class="text-columns">
190+
<div class="text-column">
191191
<p>
192192
Olympic performance is also shaped by the physical demands of each sport.
193193
Different disciplines reward different combinations of height, weight, power,
@@ -196,7 +196,7 @@ <h2>Which body type excels in a particular discipline?</h2>
196196
</p>
197197
</div>
198198

199-
<div class="intro-column">
199+
<div class="text-column">
200200
<p>
201201
This visualization compares medal-winning athletes by sport, discipline, year,
202202
gender, height, and weight. By exploring podiums across events, we can see how
@@ -244,8 +244,8 @@ <h2 class="bodytype-viz-title">Olympic body types by discipline</h2>
244244
<div class="section" data-anchor="geopolitics">
245245
<div class="slide" data-anchor="geopolitics-text">
246246
<h2>How do geopolitical conflicts affect the Olympic Games?</h2>
247-
<div class="intro-columns">
248-
<div class="intro-column">
247+
<div class="text-columns">
248+
<div class="text-column">
249249
<p>
250250
The Olympics are often presented as a moment of global unity. However, they have
251251
repeatedly been shaped by wars, boycotts, political tensions, and international
@@ -254,7 +254,7 @@ <h2>How do geopolitical conflicts affect the Olympic Games?</h2>
254254
</p>
255255
</div>
256256

257-
<div class="intro-column">
257+
<div class="text-column">
258258
<p>
259259
This visualization highlights key geopolitical events and shows how they affected
260260
Olympic participation and medal rewards. By exploring specific years and countries,
@@ -298,8 +298,8 @@ <h2 class="geo-viz-title">Geopolitical disruptions in the Olympic Games</h2>
298298
<div class="section" data-anchor="fair">
299299
<div class="slide" data-anchor="fair-text">
300300
<h2>What would a fair distribution of Olympic medals look like?</h2>
301-
<div class="intro-columns">
302-
<div class="intro-column">
301+
<div class="text-columns">
302+
<div class="text-column">
303303
<p>
304304
Medal tables usually reward countries with the highest number of podium finishes,
305305
but this can hide major differences in population, wealth, and resources.
@@ -308,7 +308,7 @@ <h2>What would a fair distribution of Olympic medals look like?</h2>
308308
</p>
309309
</div>
310310

311-
<div class="intro-column">
311+
<div class="text-column">
312312
<p>
313313
These visualizations compare actual medals with a “fair” medal distribution adjusted
314314
by mean population and GDP. By looking beyond the raw medal count, we can question
@@ -338,16 +338,16 @@ <h2 class="fair-viz-title">Fair ranking of countries</h2>
338338
<div class="section" data-anchor="conclusion">
339339
<h2>Finish line</h2>
340340

341-
<div class="intro-columns">
342-
<div class="intro-column">
341+
<div class="text-columns">
342+
<div class="text-column">
343343
<p>
344344
The data shows that Olympic success is not only a question of individual excellence.
345345
It is also shaped by access, institutions, national wealth, political stability,
346346
and the historical inclusion or exclusion of different groups.
347347
</p>
348348
</div>
349349

350-
<div class="intro-column">
350+
<div class="text-column">
351351
<p>
352352
Over time, the Games have become more inclusive, especially in terms of gender
353353
representation. Yet large inequalities remain in which countries win medals,

website/js/delegations.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,16 @@
376376

377377
const year = Number(event.detail?.year);
378378
const season = event.detail?.season || state.currentSeason;
379+
const mode = event.detail?.mode || state.currentMode;
379380

380381
if (!Number.isFinite(year)) return;
381382

382383
state.currentSeason = season;
383384
d3.select(selectors.seasonSelect).property("value", season);
384385

386+
state.currentMode = mode;
387+
d3.select(selectors.modeSelect).property("value", mode);
388+
385389
state.availableYears = getAvailableYears(season);
386390

387391
if (state.availableYears.includes(year)) {
@@ -520,6 +524,7 @@
520524
detail: {
521525
year: state.currentYear,
522526
season: state.currentSeason,
527+
mode: state.currentMode,
523528
source: "delegations"
524529
}
525530
}));

website/js/never-medaled.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@
446446
d3.select(selectors.modeSelect).on("change", function () {
447447
state.currentMode = this.value;
448448
update();
449+
broadcastYear(state.currentYear);
449450
});
450451

451452
d3.select(selectors.yearSlider).on("input", function () {
@@ -464,13 +465,20 @@
464465
d3.select(selectors.play).on("click", togglePlay);
465466

466467
window.addEventListener("olympic-year-change", event => {
468+
if (event.detail?.source === "never-medaled") return;
469+
467470
const year = Number(event.detail?.year);
468471
const season = event.detail?.season || state.currentSeason;
472+
const mode = event.detail?.mode || state.currentMode;
469473

470474
if (!Number.isFinite(year)) return;
471475

472476
state.currentSeason = season;
473477
d3.select(selectors.seasonSelect).property("value", season);
478+
479+
state.currentMode = mode;
480+
d3.select(selectors.modeSelect).property("value", mode);
481+
474482
state.availableYears = getAvailableYears(season);
475483

476484
if (state.availableYears.includes(year)) {
@@ -597,6 +605,7 @@
597605
detail: {
598606
year,
599607
season: state.currentSeason,
608+
mode: state.currentMode,
600609
source: "never-medaled"
601610
}
602611
}));

website/js/race-navigation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
const sectionLabels = {
55
title: "Start",
6-
introduction: "Intro",
6+
introduction: "Starting Blocks",
77
gender: "Gender",
88
delegations: "Medals",
99
"body-types": "Bodies",
1010
geopolitics: "Politics",
1111
fair: "Fairness",
12-
conclusion: "Finish"
12+
conclusion: "Finish Line"
1313
};
1414

1515
const config = {

website/styles.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ p {
171171
flex-direction: column;
172172
}
173173

174-
.intro-columns {
174+
.text-columns {
175175
display: flex;
176176
justify-content: center;
177177
gap: 80px;
@@ -180,12 +180,12 @@ p {
180180
margin-top: 40px;
181181
}
182182

183-
.intro-column {
183+
.text-column {
184184
flex: 1;
185185
max-width: 500px;
186186
}
187187

188-
.intro-column p {
188+
.text-column p {
189189
width: 100%;
190190
text-align: justify;
191191
margin: 0;
@@ -497,7 +497,7 @@ p {
497497
}
498498

499499
@media (max-width: 900px) {
500-
.intro-columns {
500+
.text-columns {
501501
flex-direction: column;
502502
gap: 30px;
503503
width: 90%;

0 commit comments

Comments
 (0)