Fatal Police Shootings Category Selection
This interactive map displays fatal police shootings across the United States, allowing users to color-code incidents by attributes such as race, gender, or flee status via a dropdown menu. The visualization uses d3.geoPath with a geoAlbersUsa projection to render state boundaries from TopoJSON data, while circles representing incidents are positioned using the same projection. A d3.scaleOrdinal color scale maps categorical values, with a React-based ColorLegend component showing the corresponding categories. Data comes from the Washington Post’s Fatal Police Shootings database, loaded and cleaned via d3.csv.
AI-generated descriptionA 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.
I've increased opacity compared to previous iterations of my work, and applied a color scale based on an attribute interactively selected by the user. This allows the user to explore any geographic trends in the data based on various attributes of each record. It is my intention to add a histogram to the bottom of the visualization to provide raw count data to provide additional insights.
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. Finally, I switched the abbreviations for race with full words to be used in the legend.