function draw(C) {
let projection = d3
.geoMercator()
.fitExtent([[100, 40], [width - 150, height - 100]], {
type: "MultiPoint",
coordinates: C
})
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const path = d3.geoPath(projection);
svg
.append("path")
.datum({ type: "Polygon", coordinates: [C] })
.attr("d", path)
.attr("fill", "lightblue");
svg
.append("g")
.selectAll()
.data(C.map(c => ({ type: "Point", coordinates: c })))
.join("path")
.attr("d", path);
svg
.append("g")
.selectAll()
.data(C)
.join("text")
.text((d, i) => `${i}: ${d.map(e => e.toFixed(2))}`)
.attr("transform", d => `translate(${projection(d)})`)
.attr("dy", (_, i) => (i >= 2 ? -10 : 20));
return svg.node();
}