Skip to main content
100%

Axes with React & D3

✓ Published1🌍 Public
SSonja Ek
Last edited Jun 1, 2021
Created on Jun 1, 2021

This example shows a horizontal bar chart of the top 10 most populous countries in 2020, with labeled axes and tick marks, rendered as SVG. The visualization combines React for component state and rendering with D3 utilities like `scaleBand`, `scaleLinear`, and `csv` for data loading. React’s `useState` and `useEffect` hooks fetch the UN population CSV data, while the `xScale` and `yScale` functions position the bars and axis labels within configured margins. Tick marks and text are generated manually from `xScale.ticks()` and `yScale.domain()`.

AI-generated description

A program that loads in some data and creates a bar chart with margins, info texts and ticks.

MIT Licensed

Similar vizzes