This project visualizes road accidents data in the Australian state of Victoria from 2018 to 2022 using a tree diagram and an interactive timeline. Built with D3.js, HTML, and CSS, the visualization allows users to explore accident trends by speed zones, weekdays, and years.
- Interactive Tree Diagram: Displays accident counts grouped by speed zones (≤50 km/h, 50-100 km/ph, and 100-110 km/ph).
- Interactive Timeline: Accident counts per day of the week, connected interactively with the tree diagram.
- Hover Interaction: Highlight nodes and timeline bars, and display detailed accident data via tooltips.
- Color Legend: Sequential color scale representing accident counts.
- D3.js (Data-Driven Documents)
- HTML5
- CSS3
Road_Accident_code.html: Core HTML and JavaScript implementation.color-legend.js: Module for generating color legends in D3.js visualizations.accident_data.csv: Contains accident counts per year, speed zone, and day of the week.roads_hierarchy.json: Defines the hierarchical structure used in the tree diagram (by speed zones and years).
Clone this repository and open Road_Accident_code.html in a web browser. Ensure you have an internet connection as the project relies on external D3.js CDN.
- Accident data sourced from official Victoria road accident statistics (included as
accident_data.csv).
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.