barchart = Plot.barY(data, {
x: (d, i) => i,
fill: (d) => d,
render: (i, s, v, d, c, next) => {
const g = next(i, s, v, d, c);
c.ownerSVGElement.update = (values) =>
d3
.select(g)
.selectAll("rect")
.transition()
.duration(750)
.attr("height", (i) => s.y(0) - s.y(values[i]))
.attr("y", (i) => s.y(values[i]))
.attr("fill", (i) => s.color(values[i]));
return g;
}
}).plot({
y: { domain: [0, 10] },
color: { scheme: "bupu", domain: [-2, 10] }
})