Skip to content

Commit 8f3525e

Browse files
committed
fix: correct colours of medals map to be the same as geopolitics map
1 parent 53c7d4c commit 8f3525e

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

website/js/never-medaled.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -801,16 +801,13 @@
801801
})
802802
.attr("stroke", d => {
803803
const country = normalizeCountryName(d.properties.name);
804-
return byCountry.has(country) ? "rgba(255,255,255,0.78)" : "#4d4d4d";
804+
const record = byCountry.get(country);
805+
return record ? (continentColors[record.continent] || "#aeeaf2") : "#5b5b5b";
805806
})
806807
.attr("stroke-width", d => {
807808
const country = normalizeCountryName(d.properties.name);
808809
return byCountry.has(country) ? 1.6 : 0.6;
809810
})
810-
.attr("opacity", d => {
811-
const country = normalizeCountryName(d.properties.name);
812-
return byCountry.has(country) ? 0.94 : 0.68;
813-
})
814811
.style("cursor", "pointer")
815812
.on("mousemove", function (event, d) {
816813
const rawName = d.properties.name || "Unknown country";
@@ -819,7 +816,6 @@
819816

820817
if (record) {
821818
d3.select(this)
822-
.attr("opacity", 1)
823819
.attr("stroke-width", 1.8);
824820

825821
tooltip
@@ -844,13 +840,9 @@
844840
})
845841
.on("mouseleave", function () {
846842
d3.select(this)
847-
.attr("opacity", d => {
848-
const country = normalizeCountryName(d.properties.name);
849-
return byCountry.has(country) ? 0.94 : 0.68;
850-
})
851843
.attr("stroke-width", d => {
852844
const country = normalizeCountryName(d.properties.name);
853-
return byCountry.has(country) ? 0.95 : 0.45;
845+
return byCountry.has(country) ? 1.6 : 0.6;
854846
});
855847

856848
tooltip.style("opacity", 0);

0 commit comments

Comments
 (0)