{
const svg = d3.create("svg")
.attr("viewBox", [-width / 2, -height / 2, width, height]);
const axis = svg.selectAll(".axis")
.data([1,0])
.enter()
.append("g")
.attr("class", "axis");
axis.append("line")
.attr("x1", -width/2)
.attr("y1", 0)
.attr("x2", width/2)
.attr("y2", 0)
.attr("class", "line")
axis.append("line")
.attr("x1", 0)
.attr("y1", -height/2)
.attr("x2", 0)
.attr("y2", height/2)
.attr("class", "line")
var slicedData = desiredData.map(d=>d[regions.indexOf(xxx)]).splice(0,z)
svg
.append('g')
.selectAll("ellipse")
.data(slicedData)
.join("ellipse")
.attr("class", "ellipse")
.attr("cy", d => rScale_(maxDeaths) - rScale_(d.deaths))
.attr("ry", d => rScale_(d.deaths))
.attr("rx", d => rScale_(d.deaths) /3)
.attr("fill", d => colorByContinent3(d.region, 0.1))
.attr("stroke", "white")
.attr("stroke-width", strokeWidth)
.attr('transform', function(d, i) {
var rx = Math.cos(_xcos(i)) * _outerRadius;
var ry = Math.sin(_ysin(i)) * _outerRadius;
return `translate(${rx},${ry})
rotate(${_xcos(i) * 180 / Math.PI + 90})
scale(${0.8})`;
})
svg.selectAll(".ellipse:nth-last-child(1)")
.attr("fill", d => colorByContinent3(d.region, 0.5))
.attr("stroke", "white")
.attr("stroke-width", 1.5)
svg.append("text")
.attr("class", "label")
.attr("x", 0)
.attr("y", -15)
.text(desiredData.map(d=>d[regions.indexOf(xxx)])[z]["yearWeek"]);
svg.append("text")
.attr("class", "label")
.attr("x", 0)
.attr("y", 0)
.text(desiredData.map(d=>d[regions.indexOf(xxx)])[0].region);
svg.append("text")
.attr("class", "label")
.attr("x", 0)
.attr("y", 15)
.text(desiredData.map(d=>d[regions.indexOf(xxx)])[z]["deaths"]);
return svg.node()
}