Skip to main content
100%

Spotify Dataset Basic Scatter Plot with Axis Using React & D3

✓ Published0🌍 Public
JJose Morales
Last edited Sep 19, 2025
Created on Sep 19, 2025

This scatter plot visualizes 500 tracks from a Spotify Music Dataset, plotting song duration in milliseconds against a popularity score from 0–100. The chart uses a linear scale for both axes, with the x-axis labels formatted as minutes:seconds. Built with React and D3 v7, the visualization uses D3’s `scaleLinear`, `axisBottom`, `axisLeft`, and `extent` functions to create and scale the plot. Data is loaded from a CSV file and rendered as black circles with a radius of 6.

AI-generated description

Spotify Music Dataset

This dataset is a subset of the “Spotify Music Dataset” dataset available from Kaggle.

To create this subset, I simply took the first the 500 entries from the data full dataset, and removed some of the columns included. The following are included in this subset:

  • track_artist – The artist(s) performing the track (categorical attribute)
  • track_popularity – A score from 0–100 based on the track’s relative streaming frequency (quantitative sequential attribute)
  • track_album_name – The album in which the track is featured (categorical attribute)
  • playlist_name – The name of the playlist where the track is included (categorical attribute)
  • track_name – The name of the track (categorical attribute)
  • duration_ms – The length of the track in milliseconds (quantitative sequential attribute)
  • id – A unique identifier for the song (categorical attribute)
MIT Licensed

Similar vizzes