addTooltips(
Plot.plot({
marks: [
Plot.text(medalsData, {
text: (d) => {
if (d.Medal == "Gold") return "🥇";
if (d.Medal == "Silver") return "🥈";
if (d.Medal == "Bronze") return "🥉";
},
x: "Year",
y: "Age",
title: (d) =>
`${d.Name} \n country: ${d.Team} \n event: ${d.Event} \n year: ${d.Year}`
})
]
})
)