Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

14.00 Axes with React $ D3

Public visualization

14.00 Axes with React $ D3

0 stars1🌍 Public
EEric Weiss
Last edited Apr 9, 2021
Created on Apr 9, 2021

This example displays a horizontal bar chart of the top 10 countries by population in 2020, using data from a UN Population CSV file. The chart is rendered as SVG via React components, with D3 scales (`d3.scaleBand` and `d3.scaleLinear`) computing positions and sizes. Axes are drawn manually using D3’s `ticks()` for the x-axis and iterating over the scale’s domain for y-axis labels. Grid lines and text elements are styled inline, while React’s `useState` and `useEffect` handle asynchronous data loading.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed