chart1 = {
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, height])
.style("overflow", "visible");
svg
.append("g")
.selectAll("circle")
.data(data)
.join("circle")
.attr("cx", (d) => scale.x(d.danceability))
.style("fill", (d) => scale.c(d.danceability))
.style("opacity", 0.5)
.attr("r", 0)
.attr("cy", 10)
.transition()
.duration(1)
.delay((d, i) => i * 0.2)
.attr("r", 1.8)
.attr("cy", (d) => scale.y(d[Channel]));
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
svg
.append("g")
.attr("transform", `translate(${width / 2}, ${height - 5})`)
.append("text")
.style("text-anchor", "middle")
.text("danceability")
.attr("class", "x_text");
svg
.append("g")
.attr("transform", `translate(${margin.left}, ${height / 2})rotate(-90)`)
.append("text")
.style("text-anchor", "middle")
.text(Channel)
.attr("class", "y_text");
return svg.node();
}