Skip to main content
100%

Refactoring a Bar Chart

✓ Published1🌍 Public
DDanier
Last edited Sep 18, 2021
Created on Sep 17, 2021

This example shows a bar chart of the top 10 most populous countries, with population values from the United Nations World Population Prospects 2019 dataset. The visualization refactors a basic bar chart by adding axes using React components. It uses d3.v5’s `scaleBand` for the categorical y-axis, `scaleLinear` for the numeric x-axis, and renders SVG elements directly through React. The `AxisBottom` and `AxisLeft` components generate tick marks and labels, while the `Marks` component draws the bars.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.

MIT Licensed

Similar vizzes