Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Spotify Music Dataset Loading Data

Public visualization

Viewing a saved revision (read-only)

2d214acde0e642b2b1bb5cad00fc4aa7

Spotify Music Dataset Loading Data

0 stars0🌍 Public
JJose Morales
Last edited Sep 4, 2025
Created on Sep 3, 2025
Forked from Loading Data

This example loads a Spotify music dataset and displays the first 500 entries as raw JSON text in a `pre` element. The visualization uses a state machine to sequentially render three states: `undefined`, `'LOADING'`, and the parsed data array. It fetches `data.csv`, parses it with `d3.csvParse`, and converts `track_popularity` and `duration_ms` to numbers. Each state transition triggers a re-render via the D3 `select` and `.join` pattern, showing how asynchronous data loading can be handled transparently with D3 v7.

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 filtered the full dataset (approximately 4.42 million rows) to include only motorcycles involved in crashes. I also removed any entries without a listed vehicle model, which reduced the dataset to 223 entries.

While the original dataset contains many more columns, the following are included in this subset:

  • UNIQUE_ID – A unique identifier generated by the NYC record system (sequential ordinal attribute)
  • CRASH_DATE – The date of the crash (temporal attribute)
  • VEHICLE_MAKE – The manufacturer of the motorcycle involved (categorical attribute)
  • VEHICLE_MODEL – The model of the motorcycle involved (categorical attribute)
  • DRIVER_SEX – The gender of the driver (categorical attribute)
  • CONTRIBUTING_FACTOR_1 – A primary factor contributing to the crash (categorical attribute)
  • CONTRIBUTING_FACTOR_2 – A secondary factor contributing to the crash (categorical attribute)