Skip to main content
100%

Axis with React d3

✓ Published1🌍 Public
Rrajamrit-singh
Last edited Feb 1, 2023
Created on Jan 31, 2023
Forked from Margin Convention

This example displays a horizontal bar chart of the top 10 countries by 2020 population, using React for rendering and D3 for scales and data loading. It uses `d3.csv` to fetch UN population data, `scaleBand` for the categorical y-axis, and `scaleLinear` for the numeric x-axis. Tick marks and labels are manually generated with SVG elements, while bars are drawn as `rect` components. The visualization explicitly demonstrates creating axes without D3’s axis generator, relying instead on explicit tick mapping and SVG positioning within a transformed `<g>` element.

AI-generated description

A program that loads in some data

MIT Licensed

Similar vizzes