chart = {
replay;
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("fill", "#B8BFC6")
.selectAll("rect")
.data(dataPos)
.join("rect")
.attr("x", d => d.x0)
.attr("width", barWidth)
.attr("height", barHeight)
.attr("fill", d => color(d.party))
.transition()
.duration((d, i) => 0.5 * (d.ministryIndex + 1) * (data.length - ministriesCount.get(d.ministry)))
.delay((d, i) => Math.floor(d.count / nRows) * 100 + (d.count % nRows) * 20)
.attr("x", d => d.x1)
.attr("y", d => d.y1)
.attr("width", squareSize)
.attr("height", squareSize)
.attr("stroke-width", 0.5)
.attr("stroke", "white");
return svg.node();
}