{
const projection = d3.geoNaturalEarth1();
const path = d3.geoPath(projection);
const maxCapacity = d3.max(stadiumDataRaw, o => o.capacity);
const circleScale = d3.scaleSqrt()
.domain([0, maxCapacity])
.range([0, 6]);
const circles = stadiumDataRaw.map(d => {
const position = projection([d.long, d.lat]);
const [x, y] = position;
const type = d.kind.replace(" ", "").toLowerCase();
return svg`<circle cx="${x}" cy="${y}" r="${circleScale(d.capacity)}" fill="${stadiumColors[type]}" opacity="0.8" />`;
});
return html`
<svg viewbox="0 0 ${width} ${height}">
<rect x="0" y="0" width="${width}" height="${height}" fill="#191A1A" />
<path d="${path(d3.geoGraticule10())}" stroke="#515150" fill="none" opacity="0.3" />
<path d="${path(countries)}" stroke="#515150" fill="#343332" />
${circles}
</svg>
`;
}