htl.html`<div style="display: flex; flex-wrap: wrap; gap: 1em; max-height: 700px; overflow: scroll;">
${d3.groups(olympians, (d) => d.nationality)
.sort((a, b) => d3.descending(a[1].length, b[1].length))
.map(([caption, data]) =>
htl.html`<figure>
${Plot.plot({
width: 260,
height: 200,
marks: [Plot.frame(), Plot.dot(data, { x: "height", y: "weight" })]
})}
<figcaption style="text-align: center;">${caption}</figcaption>
</figure>`
)}
</div>`