Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axes for React and D3

Public visualization

Axes for React and D3

0 stars1🌍 Public
SSarah Elkeurti
Last edited Apr 11, 2022
Created on Apr 6, 2022

This example displays a horizontal bar chart of the top ten countries by population in 2020, using data loaded from a CSV file. The visualization is built with React and D3 v5, rendered as an SVG. The code uses D3 utilities like `csv` for data loading, `scaleBand` for the y-axis, `scaleLinear` for the x-axis, and `max` to compute the domain. Axis ticks and grid lines are generated from the scales, with bars drawn as SVG rectangles.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed