update = async (allData) => {
let data = allData[0]
let shuffledIds = allData[1];
x.domain(shuffledIds);
let rects = d3.select("#container").selectAll(".rects")
.data(data, d => d.id)
rects
.join(
enter => enter.append("rect")
.classed('rects', true)
.attr('x', d => x(d.id))
.attr('y', d => height - d.height)
.attr('width', x.bandwidth())
.attr('height', d => d.height)
.attr("fill", d => d.color)
.attr("stroke", d => d.color)
.attr("stroke-linecap", "round")
.attr("stroke-opacity", 0.1)
.style("opacity", d => d.status != "inactive" ? 1 : 0.6),
update => update.call(e => e.transition()
.duration(100)
.delay(0)
.attr('x', d => x(d.id))
.attr("stroke-opacity", 0.1)
.style("opacity", d => d.status != "inactive" ? 1 : 0.6)
)
)
}