globeNightViz = {
const svg = d3.create("svg").attr("width", width).attr("height", height);
svg
.append("rect")
.attr("x",0)
.attr("y",0)
.attr("width", width)
.attr("height", height)
.attr("fill", "#f0f0f0");
const magScale = d3.scaleLinear().domain([0,7]).range([0,1]);
svg
.selectAll(".dataPoints")
.data(globeNightMod)
.enter()
.append("circle")
.attr("cx", (d) => longScaleX(d.long))
.attr("cy", (d) => latScaleY(d.lat))
.attr("r", 5)
.attr("fill", (d) => d3.interpolateViridis(d.limitingMag))
.attr("class", "locationPoints")
.on("mouseover", (event) => {
d3.select(event.target).attr("stroke", "#000").attr("stroke-width", "2");
})
.on("mouseout", (event) => {
d3.select(event.currentTarget).attr("stroke", "#0ff").attr("stroke-width", "0");
})
.on("click", (event) => {
d3.select(event.currentTarget).append("text").text(event.location);
});
svg
.selectAll(".locationText")
.data(globeNightMod)
.enter()
.append("text")
.attr("x", width - margin / 2)
.attr("y", margin / 2)
.attr("fill", "white")
.style("text-anchor", "end")
.attr("font-size", "12")
.attr("font-family", "courier")
.attr("id", "infoText")
.text((d) => d.city);
return svg.node();
}