Skip to main content
100%

Refactored Bar chart

✓ Published2🌍 Public
Kkragovic
Last edited Mar 31, 2021
Created on Mar 31, 2021

This example shows a horizontal bar chart of the top 10 countries by population, using data loaded from a publicly hosted CSV of the 2019 UN population estimates. The chart renders population values on the x-axis and country names on the y-axis using SVG. The code builds the visualization with React components for the axes and marks, while D3’s `csv`, `scaleBand`, `scaleLinear`, and `max` utilities handle data loading and coordinate mapping. React state manages the asynchronous data fetch, and the axes are drawn as reusable function components.

AI-generated description

A program that loads in some data using D3 utilities, and uses React state to keep track of the data.

MIT Licensed

Similar vizzes