{
const svg = d3.create('svg').attr('viewbox', [0, 0, width, height]);
const svgg = svg.append('g').attr('fill', '#cccccc');
let i = 0;
let max = 7;
while (true) {
i += 1;
if (i % max == 0) i = 0;
var rects = svgg.selectAll('rect').data(randomNumbers(i));
rects
.join(
enter => enter.append('rect').attr('fill', 'green'),
update => update.attr('fill', '#fd614d')
)
.attr('x', (d, i) => x(i))
.attr('y', (d, i) => y(d))
.attr('height', d => y(0) - y(d))
.attr('width', x.bandwidth());
yield svg.node();
await Promises.tick(1000);
}
}