Skip to main content
100%

Loading Data with React and D3: Organized

✓ Published1🌍 Public
MMartin Blatz
Last edited Oct 8, 2020
Created on Oct 8, 2020

This example demonstrates how to load and parse CSV data within a React application using D3. The Washington Post’s fatal police shooting dataset is fetched via `d3.csv`, with the resulting data stored in a React state hook. The interface displays a concise summary—file size in kilobytes, row count, and column count—computed using `d3.csvFormat`. The code separates data-loading logic, the main `App` component, and a utility `message` function into distinct files, highlighting an organized React structure.

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. In this version, individual components are separated into their own *.js files.

MIT Licensed

Similar vizzes