Loading Data with React and D3: Organized
This example demonstrates a React and D3.js application that loads and summarizes a CSV dataset of fatal police shootings in the US from 2015 to 2020, sourced from the Washington Post. The interface displays a text summary showing the data size in kilobytes, row count, and column count. The application uses React’s `useState` and `useEffect` hooks to manage the data-loading lifecycle, and D3’s `csv` function to fetch and parse the remote data. The code is organized into separate JavaScript files, with the `message` function formatting the output, and renders results using ReactDOM.
AI-generated descriptionA 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.