makeChart1 = (dataset) => {
dataset.sort((a, b) => b.downloads - a.downloads);
const chart = d3.create("svg").attr("width", w).attr("height", h);
const bars = chart
.selectAll("rect")
.data(dataset)
.join("rect")
.attr("x", 80)
.attr("y", (d) => yScale(d.app_name))
.attr("width", 0)
.attr("height", 20)
.style("fill", "#88d");
chart
.append("g")
.classed("axis", true)
.attr("transform", `translate(80, ${h - 20})`)
.call(d3.axisBottom(xScale));
chart
.append("g")
.classed("axis", true)
.attr("transform", `translate(80,0)`)
.call(d3.axisLeft(yScale));
bars.transition()
.duration(500)
.delay((d, i) => i * 35)
.attr("width", d => xScale(d.downloads))
.style("fill", d => colorScale(d.downloads))
.transition()
.duration(200)
.delay((d, i) => (i + 1) * 35)
.style("fill", "#88d")
.transition()
.duration(200)
.delay((d, i) => (i + 2) * 35)
.style("fill", d => colorScale(d.downloads));
return chart.node();
}