Plot.plot({
caption: `🥇 = 1 gold medal, 🥈 = 1 silver medal, 🥉 = 1 bronze medal`,
margin: 60,
width,
y: {
label: null,
reverse: true
},
x: {
label: null,
domain: createArray(10),
},
fx: {
label: null,
domain: d3.sort(olympicsTop10Nations2020, d => -d.Gold).map(d => d.nation),
tickFormat: (d) => `${d}${flags[d]}`,
tickPadding: 20,
},
marks: [
Plot.text(olympicsMatrixData, { x: "x", y: "y", text: d => medals[d.type], fontSize: 20, fx: "nation"})
]
})