Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

NYC Crash Bar Chart Interactive Legend with React & D3

Public visualization

Viewing a saved revision (read-only)

4fd4d28d5ecf4c3abdfbded02b12964b

NYC Crash Bar Chart Interactive Legend with React & D3

0 stars0🌍 Public
JJose Morales
Last edited Nov 6, 2025
Created on Oct 30, 2025

This stacked bar chart displays NYC collision data by hour, breaking down each bar into injuries, deaths, and other crashes. Hovering over legend items highlights the corresponding stack with a black stroke and fades others to 20% opacity. The visualization uses React for state management and D3 v7 for rendering, including `d3.stack`, `d3.scaleLinear`, and `d3.axisBottom`. It loads hourly crash statistics from a CSV file via `d3.csv` and handles window resizing with dynamic SVG dimensions.

AI-generated description