Assignment 7
This reusable D3.js scatter plot visualizes the relationship between math and physics scores for 40 students, with points colored by group membership. The chart uses `d3.csv` to load the dataset and custom scales via `d3.scaleLinear` for both axes and `d3.scaleOrdinal` for the categorical color encoding. The reusable function accepts parameters for data, axis value accessors, labels, dimensions, and title, rendering the chart as SVG with axes, labels, a legend, and semi-transparent circles. This design allows the same function to be applied to different datasets and attributes without modification.
AI-generated descriptionReusable Scatter Plot - Assignment 7
This project shows a reusable scatter plot using D3.js.
Dataset
File used: student_scores.csv
Visualization
- X-axis: Math Score
- Y-axis: Physics Score
- Color: Group
Why this chart is reusable
This chart is reusable because the same function can be used again with different:
- datasets
- x-axis attributes
- y-axis attributes
- chart size
- color categories
Example
In this chart, each point represents one student. The chart shows the relationship between Math score and Physics score.
Author
Ariful Hasan
Comments
Sign in to join the discussion.