barX = function (data, options) {
const B = Plot.barY(data, options);
const { render } = B;
const G = [];
let c;
let that;
B.render = function (I, scales, channels, dimensions) {
c = { scales, dimensions };
that = this;
const g = render.apply(this, arguments);
G.push(g);
return g;
};
B.transition = ({ Y, F }, { delay = 500, duration = 1000 } = {}) => {
const y1 = Array.from(Y, () => c.scales.y(0));
const y2 = Array.from(Y, c.scales.y);
const y = that._y(c.scales, { y1, y2 }, c.dimensions);
const height = that._height(c.scales, { y1, y2 }, c.dimensions);
return d3
.selectAll(G)
.selectAll("rect")
.transition()
.delay(delay)
.duration(duration)
.attr("height", height)
.attr("fill", (i) => c.scales.color(F[i]))
.attr("y", y);
};
return B;
}