svgChart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
locations.sort((x, y) => x.long - y.long)
svg.append("path")
.datum(sphere)
.attr("fill", "#000")
.attr("d", path);
svg.append("path")
.datum(land)
.attr("fill", "rgb(37, 49, 70)")
.attr("d", path);
svg.append("path")
.datum(day)
.attr("fill", "rgba(255, 255, 255, 0.1")
.attr("d", path);
svg.append("g").selectAll("circle")
.data(locations)
.enter()
.append("circle")
.attr("fill", "#fff")
.attr("r", 2)
.attr("cx", (d) => coords(d)[0])
.attr("cy", (d) => coords(d)[1])
svg.append("g").selectAll("path")
.data(voronoi.polygons(locations))
.enter()
.append("path")
.attr("fill", "none")
.attr("stroke", "cyan")
.attr("stroke-opacity", "0.2")
.attr("d", (d) => d ? "M" + d.join("L") + "Z" : null)
return svg.node();
}