Spotify Tracks Dataset Visualization
Table of Contents
Spotify Tracks DataVis is an interactive web tool for exploring trends and insights from over 160,000 Spotify tracks. Built with JavaScript and D3.js, it visualizes attributes like genre, popularity, and audio features using bar charts, radar plots, histograms, and more.
This is a simple data visualization project that explores the Spotify Tracks Dataset from Kaggle.
The project was built using vanilla JavaScript, D3.js, and Bootstrap.
System Introduction #

The figure above shows a preview of the entire system. We introduce each section below.
A. Filtering #
Clicking on the Filter button in the upper-right corner reveals a sidebar where various modifications to the dataset can be made.

1. Selecting interested genres #
Use the dropdown to select genres you’re interested in visualizing and comparing.

2. Sorting the data #
You can sort the data by any numerical attribute and choose either ascending or descending order.

3. Selecting the TOP N% rows of each genre #
To perform deeper analysis, adjust the slider to choose how much of the dataset you want to include.

Here, we selected the top 30% of tracks by popularity within each genre.
Modifying the filters helps reveal several insights about the data.
B. Single Genre Analysis #
This section allows you to examine the properties of one genre at a time.

Select the genre from the dropdown:

Different views will be shown:

1. Histogram of Numerical Attributes #
Histograms show the distribution of numerical features within a genre.
For example, classical music tends to have high acousticness:

But not much energy:

2. Count of Each Key and Mode #

We can see that many popular classical tracks are written in major keys, especially those with sharps. D major is the most common, which aligns with the idea that it sounds heavenly or divine in Western music theory.
3. Pie Chart of Explicit Lyrics #
For single genres, we show the number of tracks with explicit lyrics. For the all-genres category, we show a different chart explained later.

Classical music contains no explicit lyrics.
Some genres like j-rock contain a few:

C. Cross-Genre Analysis and Visualization #
1. Violin Plot for Numerical Distribution #
I was curious about how different features vary across genres, so I created violin plots.
Here’s one for valence:

Valence measures how positive a track sounds (0.0 = sad, 1.0 = happy).
Mandopop tends to have lower valence—many Taiwanese and Chinese songs are more melancholic. Japanese songs generally have higher valence.
2. Radar Plot for Averaged Statistics #

The radar plot shows how genres differ in average attributes.
Classical music is high in acousticness, Japanese music is high in energy, and most selected genres have decent danceability.
3. Top 20 Genres in “All-Genres” Mode #
This chart is shown when analyzing all genres together.

With the top 30% most popular tracks selected, the most common genres are pop-film, chill, and k-pop.
If we change the filter to show the top 1% tracks with the highest valence:

We get:

Children’s music ranks highest in positivity, and cheerful music tends to have more energy (top-left quadrant).
Feel free to explore the tool and uncover your own insights!