Skip to main content
100%

Assignment 7

✓ Published1🌍 Public
AAriful Hasan
Last edited Mar 29, 2026
Created on Mar 29, 2026
Forked from D3 Starter

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 description

Reusable 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

MIT Licensed

Similar vizzes