{
replay;
const container = d3.create("svg")
.attr("height", h + margin.top + margin.bottom)
.attr("width", width)
const chart = container.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")")
chart.append("g")
.attr("transform", "translate(0," + h + ")")
.call(d3.axisBottom(xScale))
.selectAll("text")
.attr("transform", "rotate(-45)translate(-5,0)")
.attr("text-anchor", "end")
.style("font-size", "10px")
.style("font-family", "Helvetica Neue, Arial")
chart.append("g")
.call(d3.axisLeft(yScale))
.selectAll("text")
.style("font-size", "12px")
.style("font-family", "Helvetica Neue, Arial")
chart.selectAll("myline")
.data(gapminder2005_top10)
.enter()
.append("line")
.attr("x1", xScale(0))
.attr("x2", xScale(0))
.attr("y1", d => yScale(d.country))
.attr("y2", d => yScale(d.country))
.attr("stroke", "steelblue")
chart.selectAll("mycircle")
.data(gapminder2005_top10)
.enter()
.append("circle")
.attr("cx", xScale(0))
.attr("cy", d => yScale(d.country))
.attr("r", "6")
.attr("fill", "turquoise")
chart.selectAll("line")
.transition()
.duration(2000)
.attr("x1", d => xScale(d.pop))
chart.selectAll("circle")
.transition()
.duration(2000)
.attr("cx", d => xScale(d.pop))
.attr("r", "8")
return container.node()
}