Skip to main content
Public

Share visualization

Loading preview…

Loading Data with React and 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

Loading Data with React and D3

1
MMartin Blatz
Last edited Oct 8, 2020
Created on Oct 8, 2020
Forked from Mouse Follower

This example demonstrates how to load and parse a CSV dataset of fatal police shootings in the US using D3 and React, displaying the data’s size, row count, and column count as text. The visualization shows a simple loading state until the data arrives, then presents the parsed summary. It uses `d3.csv` to fetch the dataset from a URL and React’s `useState` and `useEffect` hooks to manage the asynchronous data fetching and re-rendering. The data originates from the Washington Post’s police shootings database.

AI-generated description

A program that loads and parses some CSV fatal police shooting data collected by the Washington Post on fatal police shootings in the US from 2015-present (Sept 9, 2020). The original data is updated in near real time and so may differ slightly from the data contained in this gist.

Additional information can be found at the study web page

Using D3 to load and React states to keep track of the data

Comments

Sign in to join the discussion.

MIT Licensed