Level 1 & 2 (Basic): Link
This project creates a visualization of Hong Kong's monthly temperature data using D3.js. The visualization is a heatmap that shows temperature patterns across years and months.
- Interactive heatmap visualization of Hong Kong temperature data
- Toggle between maximum and minimum temperature views
- Tooltip displaying detailed information when hovering over cells
- Color legend showing the temperature scale
- Responsive design that adapts to different screen sizes
index.html: Main HTML file for the visualizationstyles.css: CSS styles for the visualizationscript.js: JavaScript code with D3.js implementationtemperature_daily.csv: Dataset containing daily temperature records for Hong Kong
The visualization meets the requirements specified in the assignment:
- The matrix shows years on the x-axis and months on the y-axis, with each cell representing a specific month of a year.
- Users can switch between maximum and minimum temperature views using the buttons at the top.
- When hovering over a cell, a tooltip appears showing the date and temperature value.
- A color legend is provided to show the mapping between colors and temperature values.
- Ensure all files (
index.html,styles.css,script.js, andtemperature_daily.csv) are in the same directory. - Open
index.htmlin a web browser.
The code is organized in a modular way:
- Data loading and processing functions are separate from visualization functions
- Event handlers manage user interactions
- Utility functions handle common tasks
- Clear variable and function naming for readability
- Correctness (50%): The data visualizations generated should look the same.
- Redability (30%): The code should be human-readable (i.e., the name of the variables and functions should be intuitive, and there should be enough comments).
- Maintainability (20%): The code should be modulized and easily modified.
Please create a github repository under your github account, and submit the URL of that repository to Canvas.
