silentPlot = {
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("id", "mapArea");
let bg = svg
.append("rect")
.attr("x", 0)
.attr("y", 0)
.attr("width", width)
.attr("height", height)
.attr("fill", "#000000")
.on("mouseover", function () {
d3.select("#directions").transition().duration(1000).attr("opacity", 0);
d3.selectAll(".deathCircles")
.data(vizData)
.transition()
.delay(2000)
.attr("opacity", 0)
.transition()
.duration((d, i) => Math.random() * 1000)
.delay((d, i) => Math.random() * 5000)
.attr("opacity", 1)
.attr("cy", (d) => y(d.total));
})
.on("mouseout", function (d) {
d3.select("#directions").transition().duration(1000).attr("opacity", 1);
d3.selectAll(".deathCircles")
.transition()
.duration(1000)
.attr("opacity", 0)
.transition()
.duration(0)
.attr("cy", margin.top);
});
let directions = svg
.append("text")
.attr("id", "directions")
.attr("pointer-events", "none")
.attr("x", width / 2)
.attr("y", height / 2)
.attr("fill", "white")
.attr("font-family", "sans-serif")
.attr("text-anchor", "middle")
.attr("alignment-baseline", "center")
.text("pay your respects by pausing here");
const gx = svg.append("g").call(xAxis);
const gy = svg.append("g").call(yAxis);
svg
.selectAll(".deathCircles")
.data(vizData)
.enter()
.append("circle")
.attr("cx", (d) => x(d.date))
.attr("cy", margin.top)
.attr("r", (d) => radScale(d.cases))
.attr("opacity", 0)
.attr("class", "deathCircles")
.attr("pointer-events", "none")
.attr("fill", (d) => d3.interpolatePuBuGn(colorScale(d.cases)));
return svg.node();
}