Skip to main content
100%

Fatal Police Shootings Mapped with Data Cleaned

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

This interactive map displays fatal police shootings across the United States, with red semi-transparent circles marking each event to reveal density clusters in population centers. The visualization uses the react framework with d3.geoAlbersUsa projection and d3.geoPath to render state boundaries from the us-atlas TopoJSON, while plotting incident coordinates from the Washington Post’s Fatal Police Shootings database. The code also cleans null data entries, converting blanks to “Unknown” for categorical fields and -1 for missing ages, and aggregates incident counts per state using d3.nest() for future analysis.

AI-generated description

A program that loads and parses some CSV data from the Fatal Police Shootings Database compiled by the Washington Post

I used the U.S. Geo Map of State Boundaries for the underlying map. In this iteration, I used the geoAlbersUsa projection to clean up and zoom in on the map. While other projection types appear to gracefully handle a lat/long input of 0, it returns null with this projection, which causes a fatal error when you reference the scaled pixel locations.

Adapted from Mass School District Boundaries from the DataVis class.

The intent is to map each event to it's location within the U.S. with a semitransparent circle to show darker regions as the areas with higher event density. This helps to answer the question "are there more fatal police shootings in certain parts of the country?" There are clearly areas with more events, though at a glance they appear to be in population centers.

What you can't see yet is that I've also improved the useData.js file to clean null data from fields I'll be using in future work. Blank data entries are now populated with "unknown" for the gender, race, flee, and armed fields. The age field is populated with a -1 for any blank entries. I've also placed a data aggregation prototype in the index.js file using the nest() and rollup() functions to create a new data array where each element contains a state key and a count. I hope to be able to utilize this framework with a menu to allow the user to select a grouping field to interact dynamically.

To do:

  • Improve zoom level for better visibility
  • clean nulls in data (changed blanks to "unknown")
  • aggregate data per state
  • develop a module to build a pie chart
  • develop a module to plot pie charts in the center of each state
  • use the path.centroid() function to plot aggregated data
MIT Licensed

Similar vizzes