Skip to main content
Public

Share visualization

Loading preview…

Rendering data with react & d3

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Rendering data with react & d3

1
Ddiogomirandabarbosa25@gmail.com
Last edited Aug 13, 2024
Created on Aug 13, 2024

This example displays a horizontal bar chart of the top ten countries by 2020 population, using data loaded from a GitHub-hosted CSV file. The visualization is built with React and D3, where React’s `useState` and `useEffect` manage the asynchronous data fetching state, and D3’s `csv`, `scaleBand`, `scaleLinear`, and `max` utilities handle data parsing and scaling. The resulting SVG rectangles are generated directly within React’s declarative JSX markup, showing a clean integration of D3’s quantitative toolkit with React’s component model.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed