Bar chart race: the most populous cities in the world

Bar chart race: the most populous cities in the world

attrs({
class: ‘bar’,
x: x(0)+1,
width: d = x(d.value)-x(0)-1,
y: d = y(d.rank)+5,
height: y(1)-y(0)-barPadding
})
. attrs({
class: d = `bar x: x(0)+1,
width: d = x(d.value)-x(0)-1,
y: d = y(top_n+1)+5,
height: y(1)-y(0)-barPadding
})
. attrs({
width: d = x(d.value)-x(0)-1,
y: d = y(d.rank)+5
});

bars
.

Source: observablehq.com