Tiew Kee Hui's Blog

Visualization of Total Accidents in Malaysia

February 19, 2018 | 3 Minute Read

Javascript is definitely not my strong suit.

Most of the code was adopted from this example where I removed some unnecessary code and added projection code for projecting the Malaysia map instead of the world map. Accidents data was retrieved from this link and I structured the necessary data into a JSON file. The map data for Malaysia was provided as part of the assignment but changes were made to the TopoJSON to include the ID of the states so that the accidents data and the map data can be merged. Not much change can be seen from the colours of the choropleth map because the trend for the number of accidents of each state remains constant throughout the years.