Skip to content

Commit 242dd05

Browse files
committed
fix: remove hovering on useless countries on maps and correct texts for non winning countries
1 parent 85cf288 commit 242dd05

3 files changed

Lines changed: 5 additions & 15 deletions

File tree

website/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ <h4 class="medal-viz-subtitle"></h4>
175175
</div>
176176

177177
<div class="slide" data-anchor="never-medaled">
178-
<h3 class="never-medaled-viz-title">Countries That Have Participated Without Ever Winning a Medal</h3>
178+
<h3 class="never-medaled-viz-title">Countries That Participated Without Winning a Medal</h3>
179179

180180
<div id="never-medaled-viz"></div>
181181

website/js/geopolitics-conflicts.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,11 +584,6 @@
584584
${note}<br>
585585
<span style="color:#f4b400;">Click to see medal performance</span>
586586
`);
587-
} else {
588-
showTooltip(
589-
event,
590-
`<strong>${rawName}</strong><br>Not specifically highlighted for ${selected.year}.`
591-
);
592587
}
593588
})
594589
.on("mouseleave", hideTooltip)

website/js/never-medaled.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@
676676
const path = d3.geoPath().projection(projection);
677677

678678
d3.select(".never-medaled-viz-title").text(
679-
`Countries That Have Participated Without Ever Winning a Medal`
679+
`Countries That Participated Without Winning a Medal`
680680
);
681681

682682
const byCountry = new Map(
@@ -707,7 +707,7 @@
707707
const country = normalizeCountryName(d.properties.name);
708708
return byCountry.has(country) ? 1.6 : 0.6;
709709
})
710-
.style("cursor", "pointer")
710+
.style("cursor", d => byCountry.has(normalizeCountryName(d.properties.name)) ? "pointer" : "default")
711711
.on("mousemove", function (event, d) {
712712
const rawName = d.properties.name || "Unknown country";
713713
const country = normalizeCountryName(rawName);
@@ -723,18 +723,13 @@
723723
Continent: <strong>${record.continent}</strong><br>
724724
Participations: <strong>${d3.format(",")(record.participations)}</strong><br>
725725
Sports entered: <strong>${record.sports}</strong><br>
726-
Years: ${formatYearRange(record.firstYear, record.lastYear)}<br>
727-
<span style="color:#aeeaf2;">No Olympic medals in this dataset</span>
726+
Years: ${formatYearRange(record.firstYear, record.lastYear)}
728727
`)
729728
.style("left", `${event.pageX + 14}px`)
730729
.style("top", `${event.pageY + 14}px`)
731730
.style("opacity", 1);
732731
} else {
733-
tooltip
734-
.html(`<strong>${rawName}</strong><br>Not in the never-medaled group.`)
735-
.style("left", `${event.pageX + 14}px`)
736-
.style("top", `${event.pageY + 14}px`)
737-
.style("opacity", 1);
732+
tooltip.style("opacity", 0);
738733
}
739734
})
740735
.on("mouseleave", function () {

0 commit comments

Comments
 (0)