{
const height = width*9/16;
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]).style("background","#ffffff");
const data = JSON.parse(JSON.stringify(sampleData2));
const simulation = d3.forceSimulation(data)
.force("x", d3.forceX().x(d => 9*d.X0))
.force("y", d3.forceY().y(d => 6*d.Y0))
.force("center", d3.forceCenter())
.force("collide", d3.forceCollide(d=>(rScale(d.pop))))
.tick(5000);
var groups = svg.selectAll(".locations")
.data(data)
.enter()
.append("g")
.attr("transform", d => "translate("+(width/2+d.x)+","+(height/2+d.y)+")")
.attr("class","locations");
groups.append("circle")
.attr("cx", d => 0)
.attr("cy", d => 0)
.attr("r", d => rScale(d.pop))
.attr("fill", "none")
.attr("stroke", "#0984e3")
.attr("stroke-width", 1.5);
groups.append("circle")
.attr("cx", d => 0)
.attr("cy", d => rScale(d.pop)-rScale(d.doses))
.attr("r", d => rScale(d.doses))
.attr("fill", "#ff7675")
.attr("stroke", "none");
groups.append("text")
.attr("x", d => 0)
.attr("y", d => 0)
.text(d => d.where)
.attr("font-size", 10)
.attr("text-anchor", "middle");
return svg.node();
}